mirror of
https://github.com/pkali/scorch_src.git
synced 2026-05-20 22:34:21 +02:00
New weapon (Punch) and optimization
This commit is contained in:
@@ -420,18 +420,23 @@ StandardShoot
|
|||||||
dec Energy,x ; lower energy to eventually let tanks commit suicide
|
dec Energy,x ; lower energy to eventually let tanks commit suicide
|
||||||
|
|
||||||
ShootNow
|
ShootNow
|
||||||
jsr Shoot
|
lda ActiveWeapon,x
|
||||||
;here we clear offensive text (after a shoot)
|
cmp #ind_Buy_me ; BFG
|
||||||
ldy TankNr
|
beq WeponNoFlight ; but with explosion
|
||||||
mva #$00 plot4x4color
|
cmp #ind_Baby_Sandhog ; Punch
|
||||||
jsr DisplayOffensiveTextNr
|
beq WeponNoFlight ; but with explosion
|
||||||
|
|
||||||
|
jsr Shoot ; bullet flight
|
||||||
|
|
||||||
bit escFlag
|
bit escFlag
|
||||||
spl:rts ; keys Esc or O
|
spl:rts ; keys Esc or O
|
||||||
|
|
||||||
lda HitFlag ;0 if missed
|
lda HitFlag ;0 if missed
|
||||||
beq missed
|
beq missed
|
||||||
|
bne GoExplosion
|
||||||
|
WeponNoFlight
|
||||||
|
jsr NoShoot ; no bullet flight
|
||||||
|
GoExplosion
|
||||||
jsr Explosion
|
jsr Explosion
|
||||||
|
|
||||||
continueMainRoundLoopAfterSeppuku
|
continueMainRoundLoopAfterSeppuku
|
||||||
|
|||||||
+2
-2
@@ -590,12 +590,12 @@ nokeys
|
|||||||
lda CONSOL
|
lda CONSOL
|
||||||
and #%00000001 ; START KEY
|
and #%00000001 ; START KEY
|
||||||
beq noShellDelay
|
beq noShellDelay
|
||||||
ldx flyDelay
|
ldy flyDelay
|
||||||
DelayLoop
|
DelayLoop
|
||||||
lda VCOUNT
|
lda VCOUNT
|
||||||
@ cmp VCOUNT
|
@ cmp VCOUNT
|
||||||
beq @-
|
beq @-
|
||||||
dex
|
dey
|
||||||
bne DelayLoop
|
bne DelayLoop
|
||||||
noShellDelay
|
noShellDelay
|
||||||
rts
|
rts
|
||||||
|
|||||||
BIN
Binary file not shown.
+126
-6
@@ -44,7 +44,7 @@ ExplosionRoutines
|
|||||||
.word babydigger-1 ;Baby_Digger ;_19
|
.word babydigger-1 ;Baby_Digger ;_19
|
||||||
.word digger-1 ;Digger ;_20
|
.word digger-1 ;Digger ;_20
|
||||||
.word heavydigger-1 ;Heavy_Digger ;_21
|
.word heavydigger-1 ;Heavy_Digger ;_21
|
||||||
.word babysandhog-1 ;Baby_Sandhog ;_22
|
.word punch-1 ;Baby_Sandhog ;_22
|
||||||
.word sandhog-1 ;Sandhog ;_23
|
.word sandhog-1 ;Sandhog ;_23
|
||||||
.word heavysandhog-1 ;Heavy_Sandhog ;_24
|
.word heavysandhog-1 ;Heavy_Sandhog ;_24
|
||||||
.word dirtclod-1 ;Dirt_Clod ;_25
|
.word dirtclod-1 ;Dirt_Clod ;_25
|
||||||
@@ -1052,6 +1052,103 @@ EndOfTheDirt
|
|||||||
mwa ycircle ydraw
|
mwa ycircle ydraw
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
|
; --------------------------------------------------
|
||||||
|
.proc punch ;
|
||||||
|
; --------------------------------------------------
|
||||||
|
;
|
||||||
|
mva #36 ExplosionRadius
|
||||||
|
jsr CalculateExplosionRange
|
||||||
|
|
||||||
|
mva #sfx_dirt_chrg_s sfx_effect
|
||||||
|
|
||||||
|
mva #15 ExplosionRadius
|
||||||
|
; Hoop
|
||||||
|
; 15 pixels up
|
||||||
|
@ jsr ClearTankNr
|
||||||
|
dec ytankstable,x
|
||||||
|
jsr PutTankNr
|
||||||
|
jsr WaitOneFrame
|
||||||
|
dec ExplosionRadius
|
||||||
|
bne @-
|
||||||
|
; ans down
|
||||||
|
mva #15 ExplosionRadius
|
||||||
|
@ jsr ClearTankNr
|
||||||
|
inc ytankstable,x
|
||||||
|
jsr PutTankNr
|
||||||
|
jsr PutTankNr
|
||||||
|
dec ExplosionRadius
|
||||||
|
bne @-
|
||||||
|
|
||||||
|
mva #sfx_dirt_chrg_s sfx_effect
|
||||||
|
|
||||||
|
mva #32 ExplosionRadius
|
||||||
|
CheckRange
|
||||||
|
; punch all (not dead :) tanks in range
|
||||||
|
ldx TankNr
|
||||||
|
ldy NumberOfPlayers
|
||||||
|
dey
|
||||||
|
CheckingNextTank
|
||||||
|
lda eXistenZ,y
|
||||||
|
beq DeadTank
|
||||||
|
cpy TankNr
|
||||||
|
beq NotMy
|
||||||
|
; it's not dead tank - check range
|
||||||
|
mva #0 temp2 ; tank direction (0 - on right side, $ff - on left side)
|
||||||
|
sec
|
||||||
|
lda xtankstableL,y
|
||||||
|
sbc xtankstableL,x
|
||||||
|
sta temp
|
||||||
|
lda xtankstableH,y
|
||||||
|
sbc xtankstableH,x
|
||||||
|
sta temp+1
|
||||||
|
bpl RightSide
|
||||||
|
dec temp2 ; on left side flag
|
||||||
|
lda temp
|
||||||
|
eor #$ff
|
||||||
|
sta temp
|
||||||
|
lda temp+1
|
||||||
|
eor #$ff
|
||||||
|
sta temp+1
|
||||||
|
RightSide
|
||||||
|
bne TooFar
|
||||||
|
lda temp
|
||||||
|
cmp ExplosionRadius
|
||||||
|
bcs TooFar
|
||||||
|
; tank in range!
|
||||||
|
phy
|
||||||
|
phx
|
||||||
|
sty TankNr
|
||||||
|
bit temp2
|
||||||
|
bmi PunchLeft
|
||||||
|
PunchRight
|
||||||
|
jsr ClearTankNr
|
||||||
|
inc xtankstableL,x
|
||||||
|
bne @+
|
||||||
|
inc xtankstableH,x
|
||||||
|
@ jsr PutTankNr
|
||||||
|
jmp TankPunched
|
||||||
|
PunchLeft
|
||||||
|
jsr ClearTankNr
|
||||||
|
lda xtankstableL,x
|
||||||
|
bne @+
|
||||||
|
dec xtankstableH,x
|
||||||
|
@ dec xtankstableL,x
|
||||||
|
jsr PutTankNr
|
||||||
|
TankPunched
|
||||||
|
plx
|
||||||
|
ply
|
||||||
|
stx TankNr
|
||||||
|
TooFar
|
||||||
|
NotMy
|
||||||
|
DeadTank
|
||||||
|
dey
|
||||||
|
bpl CheckingNextTank
|
||||||
|
jsr WaitOneFrame
|
||||||
|
sbb ExplosionRadius #2
|
||||||
|
bne CheckRange
|
||||||
|
rts
|
||||||
|
.endp
|
||||||
|
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc BeforeFire ;TankNr (byte)
|
.proc BeforeFire ;TankNr (byte)
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
@@ -1494,14 +1591,40 @@ AfterStrongShoot
|
|||||||
bcs ShotUnderGround
|
bcs ShotUnderGround
|
||||||
jsr Flight
|
jsr Flight
|
||||||
mva #1 color
|
mva #1 color
|
||||||
rts
|
bne ClearOffensiveText
|
||||||
ShotUnderGround
|
ShotUnderGround
|
||||||
mwa xtraj+1 xdraw ; but why not XHit and YHit !!!???
|
mwa xtraj+1 xdraw ; but why not XHit and YHit !!!???
|
||||||
mwa ytraj+1 ydraw
|
mwa ytraj+1 ydraw
|
||||||
mva #$ff HitFlag
|
mva #$ff HitFlag
|
||||||
rts
|
;here we clear offensive text (after a shoot)
|
||||||
|
ClearOffensiveText
|
||||||
|
ldy TankNr
|
||||||
|
mva #$00 plot4x4color
|
||||||
|
jmp DisplayOffensiveTextNr
|
||||||
|
; rts
|
||||||
.endp
|
.endp
|
||||||
|
|
||||||
|
;--------------------------------------------------
|
||||||
|
.proc NoShoot ;TankNr (byte)
|
||||||
|
;--------------------------------------------------
|
||||||
|
; This is "Shoot" procedure for weapons that do not require a flying bullet.
|
||||||
|
; Shoots tank nr X !!! :)
|
||||||
|
; set the ending coordinates of bullet with correction
|
||||||
|
ldy #0
|
||||||
|
clc
|
||||||
|
lda xtankstableL,x
|
||||||
|
adc #4 ; tank "center" :)
|
||||||
|
sta xdraw ; but why not XHit and YHit !!!???
|
||||||
|
tya ;0
|
||||||
|
adc xtankstableH,x
|
||||||
|
sta xdraw+1
|
||||||
|
lda ytankstable,x
|
||||||
|
sta ydraw
|
||||||
|
sty ydraw+1 ;0
|
||||||
|
dey ; $ff
|
||||||
|
sty HitFlag
|
||||||
|
rts
|
||||||
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc Flight ; Force(byte.byte), Wind(0.word)
|
.proc Flight ; Force(byte.byte), Wind(0.word)
|
||||||
; Angle(byte) 128=0, 255=maxright, 0=maxleft
|
; Angle(byte) 128=0, 255=maxright, 0=maxleft
|
||||||
@@ -2100,13 +2223,10 @@ mrLoopi
|
|||||||
|
|
||||||
jsr ShellDelay
|
jsr ShellDelay
|
||||||
;
|
;
|
||||||
phx
|
|
||||||
jsr CheckExitKeys ; Check for O, Esc or Start+Option keys
|
jsr CheckExitKeys ; Check for O, Esc or Start+Option keys
|
||||||
bpl ExitnotPressed
|
bpl ExitnotPressed
|
||||||
plx
|
|
||||||
rts ; exit if pressed 'Exit keys'
|
rts ; exit if pressed 'Exit keys'
|
||||||
ExitnotPressed
|
ExitnotPressed
|
||||||
plx
|
|
||||||
;
|
;
|
||||||
|
|
||||||
MIRVdoNotChangeY
|
MIRVdoNotChangeY
|
||||||
|
|||||||
Reference in New Issue
Block a user