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
+4 -2
View File
@@ -15,7 +15,7 @@
;---------------------------------------------------
.macro build
dta d"1.26" ; number of this build (4 bytes)
dta d"1.27" ; number of this build (4 bytes)
.endm
.macro RMTSong
@@ -27,12 +27,14 @@
icl 'definitions.asm'
;---------------------------------------------------
FirstZpageVariable = $59
FirstZpageVariable = $57
.zpvar DliColorBack .byte = FirstZpageVariable
.zpvar GradientNr .byte
.zpvar GradientColors .word
.zpvar WindChangeInRound .byte ; wind change after each turn (not round only) flag - (0 - round only, >0 - each turn)
.zpvar JoystickNumber .byte
.zpvar LazyFlag .byte ; 7 bit - run Lazy Darwin, 6 bit - run Lazy Boy or Darwin (!) after inventory, 0 - nothing
.zpvar SpyHardFlag .byte ; >$7f - run SpyHard after inventory
.zpvar Vdebug .byte ; "visual debug" flag ($00 - off, $ff - on)
.zpvar xdraw .word ;= $64 ;variable X for plot
.zpvar ydraw .word ;variable Y for plot (like in Atari Basic - Y=0 in upper right corner of the screen)
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+2 -32
View File
@@ -908,27 +908,13 @@ NoAutoDefense
cmp #ind_Lazy_Boy_______
bne NoLazyBoy
; Lazy Boy - do it like battery
mva #sfx_lazy_boys sfx_effect
phy
jsr PrepareAIShoot
jsr FindBestTarget2 ; find nearest tank neighbour
jsr LazyAim
ply
lda #%00000000
sta TestFlightFlag ; set "visual aiming" off
mva #%01000000 LazyFlag
jmp DecreaseDefensive ; bypass activation
NoLazyBoy
cmp #ind_Lazy_Darwin____
bne NoLazyDarwin
; Lazy Darwin - do it like battery
mva #sfx_lazy_boys sfx_effect
phy
jsr PrepareAIShoot
jsr FindBestTarget3 ; find target with lowest energy
jsr LazyAim
ply
lda #%10000000
sta TestFlightFlag ; set "visual aiming" on
mva #%11000000 LazyFlag
jmp DecreaseDefensive ; bypass activation
NoLazyDarwin
cmp #ind_Spy_Hard_______
@@ -974,22 +960,6 @@ 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)
-2
View File
@@ -168,8 +168,6 @@ TargetTankNr ; Target tank index (for AI routines)
.DS 1
SecondTryFlag ; For precise AI aiming
.DS 1
SpyHardFlag ; >$7f - run SpyHard after inventory
.DS 1
;----------------------------------------------------
;Erase .DS 1 ; if 1 only mask of the character is printed
; on the graphics screen. if 0 character is printed normally
+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