New AI tank - Toosser and angle bugfixex
This commit is contained in:
@@ -49,7 +49,7 @@ AIRoutines
|
|||||||
.word Moron-1
|
.word Moron-1
|
||||||
.word Shooter-1 ;Shooter
|
.word Shooter-1 ;Shooter
|
||||||
.word Poolshark-1 ;Poolshark
|
.word Poolshark-1 ;Poolshark
|
||||||
.word Poolshark-1 ;Toosser
|
.word Toosser-1 ;Toosser
|
||||||
.word Poolshark-1 ;Chooser
|
.word Poolshark-1 ;Chooser
|
||||||
.word Poolshark-1 ;Spoiler
|
.word Poolshark-1 ;Spoiler
|
||||||
.word Poolshark-1 ;Cyborg
|
.word Poolshark-1 ;Cyborg
|
||||||
@@ -77,10 +77,9 @@ AIRoutines
|
|||||||
lda PreviousAngle,x
|
lda PreviousAngle,x
|
||||||
clc
|
clc
|
||||||
adc #5
|
adc #5
|
||||||
bmi @+
|
cmp #180
|
||||||
cmp #90
|
|
||||||
bcc @+
|
bcc @+
|
||||||
lda #(-90)
|
lda #0
|
||||||
@
|
@
|
||||||
sta NewAngle
|
sta NewAngle
|
||||||
|
|
||||||
@@ -174,6 +173,10 @@ loop
|
|||||||
NoBatteries
|
NoBatteries
|
||||||
EnoughEnergy
|
EnoughEnergy
|
||||||
; use best defensive :)
|
; use best defensive :)
|
||||||
|
; but not allways
|
||||||
|
randomize 1 3
|
||||||
|
cmp #1
|
||||||
|
bne NoUseDefensive
|
||||||
; first check check if any is in use
|
; first check check if any is in use
|
||||||
lda ActiveDefenceWeapon,x
|
lda ActiveDefenceWeapon,x
|
||||||
bne DefensiveInUse
|
bne DefensiveInUse
|
||||||
@@ -280,9 +283,43 @@ loop
|
|||||||
|
|
||||||
;----------------------------------------------
|
;----------------------------------------------
|
||||||
AngleTable ; 16 bytes ;ba w $348b L$3350
|
AngleTable ; 16 bytes ;ba w $348b L$3350
|
||||||
.by 178,186,194,202,210,218,226,234
|
.by 106,114,122,130,138,146,154,162
|
||||||
.by 16,24,32,40,48,56,64,72
|
.by 18,26,34,43,50,58,66,74
|
||||||
.endp
|
.endp
|
||||||
|
;----------------------------------------------
|
||||||
|
.proc Toosser
|
||||||
|
ldx TankNr
|
||||||
|
; address of weapons table
|
||||||
|
lda TanksWeaponsTableL,x
|
||||||
|
sta temp
|
||||||
|
lda TanksWeaponsTableH,x
|
||||||
|
sta temp+1
|
||||||
|
; use best defensive :)
|
||||||
|
; allways
|
||||||
|
; first check check if any is in use
|
||||||
|
lda ActiveDefenceWeapon,x
|
||||||
|
bne DefensiveInUse
|
||||||
|
ldy #64 ;the last defensive weapon
|
||||||
|
@
|
||||||
|
dey
|
||||||
|
cpy #ind_Battery________ ;first defensive weapon (White Flag nad Battery - never use)
|
||||||
|
beq NoUseDefensive
|
||||||
|
lda (temp),y
|
||||||
|
beq @-
|
||||||
|
tya
|
||||||
|
; activate defensive weapon
|
||||||
|
sta ActiveDefenceWeapon,x
|
||||||
|
lda DefensiveEnergy,y
|
||||||
|
sta ShieldEnergy,x
|
||||||
|
; decrease in inventory
|
||||||
|
clc
|
||||||
|
sbc #1
|
||||||
|
sta (temp),y
|
||||||
|
DefensiveInUse
|
||||||
|
NoUseDefensive
|
||||||
|
; Toosser is like Poolshark but allways uses defensives
|
||||||
|
jmp Poolshark
|
||||||
|
.endp
|
||||||
;----------------------------------------------
|
;----------------------------------------------
|
||||||
.proc PurchaseAI ;
|
.proc PurchaseAI ;
|
||||||
; A - skill of the TankNr
|
; A - skill of the TankNr
|
||||||
|
|||||||
+1
-7
@@ -1142,14 +1142,8 @@ LimitForce
|
|||||||
.proc MoveBarrelToNewPosition
|
.proc MoveBarrelToNewPosition
|
||||||
jsr DrawTankNr
|
jsr DrawTankNr
|
||||||
ldx TankNr
|
ldx TankNr
|
||||||
lda AngleTable,x
|
|
||||||
clc
|
|
||||||
adc #90 ;shift angle to the positive values
|
|
||||||
sta temp
|
|
||||||
lda NewAngle
|
lda NewAngle
|
||||||
clc
|
cmp AngleTable,x
|
||||||
adc #90
|
|
||||||
cmp temp
|
|
||||||
beq BarrelPositionIsFine
|
beq BarrelPositionIsFine
|
||||||
bcc rotateLeft ; older is bigger
|
bcc rotateLeft ; older is bigger
|
||||||
rotateRight;older is lower
|
rotateRight;older is lower
|
||||||
|
|||||||
BIN
Binary file not shown.
Reference in New Issue
Block a user