Auto Defence added

Only for test.
Now all players has active Auto Defence with energy (99) before game.
This commit is contained in:
Pecusx
2022-06-10 11:13:20 +02:00
parent 836c67afcf
commit 6a6689b9b7
4 changed files with 46 additions and 2 deletions
+7
View File
@@ -699,12 +699,19 @@ NoPlayerMissile
cmp #57 ; shield with energy and parachute activation cmp #57 ; shield with energy and parachute activation
beq ShieldDraw beq ShieldDraw
cmp #58 ; shield with energy activation cmp #58 ; shield with energy activation
beq ShieldDraw
cmp #60 ; Auto Defence
beq DrawTankShieldWihHorns
bne NoShieldDraw bne NoShieldDraw
ShieldDraw ShieldDraw
jsr DrawTankShield.DrawInPosition jsr DrawTankShield.DrawInPosition
NoShieldDraw NoShieldDraw
DoNotDrawTankNr DoNotDrawTankNr
rts rts
DrawTankShieldWihHorns
jsr DrawTankShield.DrawInPosition
jsr DrawTankShieldHorns
rts
.endp .endp
; ------------------------------------- ; -------------------------------------
+1 -1
View File
@@ -133,7 +133,7 @@ START
ldx numberOfPlayers ldx numberOfPlayers
dex dex
@ @
mva #57 ActiveDefenceWeapon,x mva #60 ActiveDefenceWeapon,x
mva #99 ShieldEnergy,x ; set energy of shield mva #99 ShieldEnergy,x ; set energy of shield
dex dex
bpl @- bpl @-
BIN
View File
Binary file not shown.
+37
View File
@@ -673,6 +673,8 @@ DistanceCheckLoop
beq UseShieldWithEnergy beq UseShieldWithEnergy
cmp #58 ; shield with energy cmp #58 ; shield with energy
beq UseShieldWithEnergy beq UseShieldWithEnergy
cmp #60 ; Auto Defence (it works only if hit ground next to tank. Tank hit is handled in Flight proc)
beq UseShieldWithEnergy
jsr DecreaseEnergyX jsr DecreaseEnergyX
jmp EndOfDistanceCheckLoop jmp EndOfDistanceCheckLoop
UseShieldWithEnergy UseShieldWithEnergy
@@ -1580,6 +1582,7 @@ noSmokeTracer
sty SmokeTracerFlag sty SmokeTracerFlag
RepeatIfSmokeTracer RepeatIfSmokeTracer
RepeatFlight
mwa ytraj+1 Ytrajold+1 mwa ytraj+1 Ytrajold+1
mwa xtraj+1 Xtrajold+1 mwa xtraj+1 Xtrajold+1
mva #%01000000 drawFunction mva #%01000000 drawFunction
@@ -1828,6 +1831,40 @@ EndOfFlight
jmp SecondFlight jmp SecondFlight
EndOfFlight2 EndOfFlight2
mva #0 tracerflag ; don't know why mva #0 tracerflag ; don't know why
; and now check for defensive-aggressive weapon
lda HitFlag
beq NoHitAtEndOfFight
bmi NoTankHitAtEndOfFight
; tank hit - check defensive weapon of this tank
tax
dex ; index of tank in X
lda ActiveDefenceWeapon,x
cmp #60 ; Auto Defence
bne NoDefence
; now run defensive-aggressive weapon - Auto Defence!
sbb #255 LeapFrogAngle Angle ; swap angle (LeapFrogAngle - because we have strored angle in this variable)
lsrw Force ; Force = Force / 2 - becouse earlier we multiplied by 2
mva #1 Erase ; now erase shield
phx
jsr DrawTankShield
jsr DrawTankShieldHorns
plx
lda #$00
sta Erase
sta ActiveDefenceWeapon,x ; deactivate used Auto Defence
sta ShieldEnergy,x
sta xtraj ; prepare coordinates
sta ytraj
sta xtraj+2
sta ytraj+2
mwa XHit xtraj+1
sbw YHit #5 ytraj+1
mva #1 color
jmp RepeatFlight ; and repeat Fight
NoTankHitAtEndOfFight
NoHitAtEndOfFight
NoDefence
rts rts
.endp .endp