Nicer Lazy targeting amd "visual Debug" for Lazy Boys

This commit is contained in:
Pecusx
2023-01-24 14:20:29 +01:00
parent 0832d841f4
commit 6b2eabd1ca
6 changed files with 46 additions and 37 deletions
+40 -1
View File
@@ -1149,8 +1149,12 @@ afterInventory
jsr MakeDarkScreen
jsr DisplayStatus
jsr SetMainScreen
;jsr WaitOneFrame ; not necessary
jsr DrawTanks
;jsr WaitOneFrame ; not necessary
bit LazyFlag
bvc NoLazy
jsr LazyBoys
NoLazy
bit SpyHardFlag
bpl NoSpyHard
jsr SpyHard
@@ -2508,6 +2512,41 @@ SpyHardEnd
rts
.endp
; -------------------------------------------------
.proc LazyBoys
; -------------------------------------------------
mva #sfx_lazy_boys sfx_effect
jsr PrepareAIShoot
ldx TankNr
bit LazyFlag
bmi GoDarwin
jsr FindBestTarget2 ; find nearest tank neighbour
jsr LazyAim
lda #%00000000 ; set "visual aiming" off
beq EndLazy
GoDarwin
jsr FindBestTarget3 ; find target with lowest energy
jsr LazyAim
lda #%10000000
EndLazy
sta TestFlightFlag ; set "visual aiming" on
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
jsr MoveBarrelToNewPosition
rts
.endp
; -------------------------------------------------
.proc TankFlying
; -------------------------------------------------
; This routine is run from inside of the main loop