Shield with energy added

Only for test.
Now all players has active Shield with energy (99) before game.
This commit is contained in:
Pecusx
2022-06-08 21:52:19 +02:00
parent 4c6b56a1e2
commit eace9eb5cf
8 changed files with 97 additions and 17 deletions
+31 -4
View File
@@ -129,12 +129,12 @@ START
jsr RandomizeSequence
; for the round #1 shooting sequence is random
; activate shield for all players (test)
lda #56
; activate shield with energy for all players (test)
ldx numberOfPlayers
dex
@
sta ActiveDefenceWeapon,x
mva #58 ActiveDefenceWeapon,x
mva #99 ShieldEnergy,x ; set energy of shield
dex
bpl @-
; shield activated! (test)
@@ -658,7 +658,7 @@ MetodOfDeath
;--------------------------------------------------
.proc DecreaseEnergyX
;Decreases energy of player nr X
;Decreases energy of player nr X by the value Y
;increases his financial loss
;increases gain of tank TankNr
;--------------------------------------------------
@@ -696,6 +696,33 @@ NotNegativeEnergy
rts
.endp
;--------------------------------------------------
.proc DecreaseShieldEnergyX
; Decreases energy of shield player nr X by the value Y
; if shield energy is 0 after decrease then in Y we have
; rest of the energy - to decrease tank energy
;--------------------------------------------------
sty EnergyDecrease
ldy #0 ; if Shield survive then no decrease tank anergy
; Energy cannot be less than 0
lda ShieldEnergy,x
cmp EnergyDecrease
bcc ldahashzero
;sec
sbc EnergyDecrease
bpl NotNegativeEnergy
ldahashzero
; now calculate rest of energy for future tank energy decrease
sec
lda EnergyDecrease
sbc ShieldEnergy,x
tay
lda #0
NotNegativeEnergy
sta ShieldEnergy,x
rts
.endp
;---------------------------------
.proc Seppuku
lda #0