mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-21 06:39:40 +02:00
AI optimization (50b saved)
This commit is contained in:
@@ -155,13 +155,8 @@ endo
|
|||||||
|
|
||||||
; choose the best weapon
|
; choose the best weapon
|
||||||
|
|
||||||
ldy #last_offensive_____ ;the last weapon
|
ldy #last_offensive_____ ;the last weapon to choose +1
|
||||||
loop
|
jsr ChooseBestOffensive
|
||||||
dey
|
|
||||||
lda (temp),y ; this is set up before calling the routine, has address of TanksWeaponsTable
|
|
||||||
beq loop
|
|
||||||
tya
|
|
||||||
sta ActiveWeapon,x
|
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;----------------------------------------------
|
;----------------------------------------------
|
||||||
@@ -207,17 +202,8 @@ endo
|
|||||||
|
|
||||||
; choose the best weapon
|
; choose the best weapon
|
||||||
|
|
||||||
lda TanksWeaponsTableL,x
|
ldy #ind_Laser__________ ;the last offensive weapon to choose +1
|
||||||
sta temp
|
jsr ChooseBestOffensive
|
||||||
lda TanksWeaponsTableH,x
|
|
||||||
sta temp+1
|
|
||||||
ldy #ind_Laser__________ ;the last offensive weapon
|
|
||||||
loop
|
|
||||||
dey
|
|
||||||
lda (temp),y
|
|
||||||
beq loop
|
|
||||||
tya
|
|
||||||
sta ActiveWeapon,x
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------
|
;----------------------------------------------
|
||||||
@@ -331,17 +317,8 @@ NoUseDefensive
|
|||||||
jsr TakeAim ; direction still in A (0 - left, >0 - right)
|
jsr TakeAim ; direction still in A (0 - left, >0 - right)
|
||||||
|
|
||||||
; choose the best weapon
|
; choose the best weapon
|
||||||
lda TanksWeaponsTableL,x
|
ldy #ind_LeapFrog_______ ;the last offensive weapon to use +1
|
||||||
sta temp
|
jsr ChooseBestOffensive
|
||||||
lda TanksWeaponsTableH,x
|
|
||||||
sta temp+1
|
|
||||||
ldy #ind_LeapFrog_______ ;the last offensive weapon to use
|
|
||||||
loop
|
|
||||||
dey
|
|
||||||
lda (temp),y
|
|
||||||
beq loop
|
|
||||||
tya
|
|
||||||
sta ActiveWeapon,x
|
|
||||||
|
|
||||||
; randomizing force +-100
|
; randomizing force +-100
|
||||||
sbw Force #100 RandBoundaryLow
|
sbw Force #100 RandBoundaryLow
|
||||||
@@ -372,17 +349,8 @@ HighForce
|
|||||||
jsr TakeAim ; direction still in A (0 - left, >0 - right)
|
jsr TakeAim ; direction still in A (0 - left, >0 - right)
|
||||||
|
|
||||||
; choose the best weapon
|
; choose the best weapon
|
||||||
lda TanksWeaponsTableL,x
|
ldy #ind_LeapFrog_______ ;the last offensive weapon to use +1
|
||||||
sta temp
|
jsr ChooseBestOffensive
|
||||||
lda TanksWeaponsTableH,x
|
|
||||||
sta temp+1
|
|
||||||
ldy #ind_LeapFrog_______ ;the last offensive weapon to use
|
|
||||||
loop
|
|
||||||
dey
|
|
||||||
lda (temp),y
|
|
||||||
beq loop
|
|
||||||
tya
|
|
||||||
sta ActiveWeapon,x
|
|
||||||
|
|
||||||
; randomizing force +-50
|
; randomizing force +-50
|
||||||
sbw Force #50 RandBoundaryLow
|
sbw Force #50 RandBoundaryLow
|
||||||
@@ -412,17 +380,8 @@ HighForce
|
|||||||
jsr TakeAim ; direction still in A (0 - left, >0 - right)
|
jsr TakeAim ; direction still in A (0 - left, >0 - right)
|
||||||
|
|
||||||
; choose the best weapon
|
; choose the best weapon
|
||||||
lda TanksWeaponsTableL,x
|
ldy #ind_LeapFrog_______ ;the last offensive weapon to use +1
|
||||||
sta temp
|
jsr ChooseBestOffensive
|
||||||
lda TanksWeaponsTableH,x
|
|
||||||
sta temp+1
|
|
||||||
ldy #ind_LeapFrog_______ ;the last offensive weapon to use
|
|
||||||
loop
|
|
||||||
dey
|
|
||||||
lda (temp),y
|
|
||||||
beq loop
|
|
||||||
tya
|
|
||||||
sta ActiveWeapon,x
|
|
||||||
|
|
||||||
lda Force
|
lda Force
|
||||||
sta ForceTableL,x
|
sta ForceTableL,x
|
||||||
@@ -1052,3 +1011,22 @@ SorryNoPurchase
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
|
;----------------------------------------------
|
||||||
|
.proc ChooseBestOffensive
|
||||||
|
; choose the best weapon
|
||||||
|
; Y - the last offensive weapon to use + 1
|
||||||
|
; X - TankNr
|
||||||
|
;----------------------------------------------
|
||||||
|
|
||||||
|
lda TanksWeaponsTableL,x
|
||||||
|
sta temp
|
||||||
|
lda TanksWeaponsTableH,x
|
||||||
|
sta temp+1
|
||||||
|
loop
|
||||||
|
dey
|
||||||
|
lda (temp),y
|
||||||
|
beq loop
|
||||||
|
tya
|
||||||
|
sta ActiveWeapon,x
|
||||||
|
rts
|
||||||
|
.endp
|
||||||
BIN
Binary file not shown.
Reference in New Issue
Block a user