mirror of
https://github.com/blondie7575/GSCats.git
synced 2025-01-09 18:32:11 +00:00
Ammo consumption
This commit is contained in:
parent
c29ddd74c1
commit
a5e4c3e143
BIN
gscats.2mg
BIN
gscats.2mg
Binary file not shown.
28
player.s
28
player.s
@ -160,9 +160,26 @@ playerDeltaPowerClampHigh:
|
||||
; Y = Player index
|
||||
;
|
||||
playerFire:
|
||||
pha
|
||||
SAVE_AX
|
||||
PLAYERPTR_Y
|
||||
|
||||
; Check for inventory
|
||||
lda playerData+PD_CURRWEAPON,y
|
||||
pha
|
||||
asl
|
||||
tax
|
||||
beq playerFire_infiniteAmmo
|
||||
lda playerData+PD_INVENTORY,x
|
||||
beq playerFire_abort
|
||||
dec ; Consume ammo
|
||||
sta playerData+PD_INVENTORY,x
|
||||
dec inventoryDirty
|
||||
|
||||
playerFire_infiniteAmmo:
|
||||
|
||||
; Prepare projectile parameters
|
||||
pla
|
||||
sta projectileParams+8
|
||||
lda playerData+GO_POSX,y
|
||||
sta projectileParams
|
||||
lda playerData+GO_POSY,y
|
||||
@ -173,13 +190,16 @@ playerFire:
|
||||
sta projectileParams+4
|
||||
lda playerData+PD_POWER,y
|
||||
sta projectileParams+6
|
||||
lda playerData+PD_CURRWEAPON,y
|
||||
sta projectileParams+8
|
||||
jsr fireProjectile
|
||||
|
||||
pla
|
||||
playerFire_done:
|
||||
RESTORE_AX
|
||||
rts
|
||||
|
||||
playerFire_abort:
|
||||
pla ; Balance stack
|
||||
bra playerFire_done
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; playerIntersectRect
|
||||
|
@ -39,7 +39,7 @@ GRAVITY = $ffff ; 8.8 fixed point
|
||||
projectileTypes:
|
||||
; Spit
|
||||
.word 3 ; Damage
|
||||
.word 1 ; Crater radius
|
||||
.word 9 ; Crater radius
|
||||
.word 4 ; Frame 0
|
||||
.word 5 ; Frame 1
|
||||
.word 6 ; Frame 2
|
||||
|
Loading…
x
Reference in New Issue
Block a user