Another new weapon! - Lazy Darwin :)

This commit is contained in:
Pecusx
2022-11-08 19:31:12 +01:00
parent b3b8633574
commit a7493e1dcb
7 changed files with 45 additions and 16 deletions
+28 -10
View File
@@ -854,20 +854,22 @@ NotBattery
mva #sfx_smoke_cloud sfx_effect
phy
jsr PrepareAIShoot
;jsr FindBestTarget3 ; find target with lowest energy
jsr FindBestTarget2 ; find nearest tank neighbour
sty TargetTankNr
; aiming
jsr TakeAim ; direction still in A (0 - left, >0 - right)
lda Force
sta ForceTableL,x
lda Force+1
sta ForceTableH,x
lda NewAngle
sta AngleTable,x
jsr LazyAim
ply
jmp DecreaseDefensive ; bypass activation
NoLazyBoy
cmp #ind_Lazy_Darwin____
bne NoLazyDarwin
; Lazy Darwin - do it like battery
mva #sfx_smoke_cloud sfx_effect
phy
jsr PrepareAIShoot
jsr FindBestTarget3 ; find target with lowest energy
jsr LazyAim
ply
jmp DecreaseDefensive ; bypass activation
NoLazyDarwin
cmp #ind_Long_Barrel____
bne NotBarrel
; if activate long barrel, we do it differently too
@@ -906,6 +908,22 @@ DefActivationEnd
jmp WaitForKeyRelease ; rts
.endp
.proc LazyAim
; aiming proc for Lazy ... weapons
; as proc for memory optimisation
; Y - target tan nr
; A - target direction
sty TargetTankNr
; aiming
jsr TakeAim ; direction still in A (0 - left, >0 - right)
lda Force
sta ForceTableL,x
lda Force+1
sta ForceTableH,x
lda NewAngle
sta AngleTable,x
rts
.endp
; -----------------------------------------------------
.proc calcPosDefensive
; calculate positionOnTheList from the activeWeapon (defensives)