diff --git a/scorch.asm b/scorch.asm index efe486a..43b66c6 100644 --- a/scorch.asm +++ b/scorch.asm @@ -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) diff --git a/scorch.bin b/scorch.bin index 0271c6e..fe6f020 100644 Binary files a/scorch.bin and b/scorch.bin differ diff --git a/scorch.xex b/scorch.xex index e97e3f2..d603c12 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/textproc.asm b/textproc.asm index 99ed067..52622fa 100644 --- a/textproc.asm +++ b/textproc.asm @@ -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) diff --git a/variables.asm b/variables.asm index 1b78ca4..595e4fb 100644 --- a/variables.asm +++ b/variables.asm @@ -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 diff --git a/weapons.asm b/weapons.asm index d4ea51b..dcf7cd5 100644 --- a/weapons.asm +++ b/weapons.asm @@ -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