Strong Parachute (with energy) added!

and defensive (really all) weapons indexes (numbers) as constans.
This commit is contained in:
Pecusx
2022-06-20 10:43:16 +02:00
parent 7324203925
commit 67b5dfb110
6 changed files with 146 additions and 65 deletions
+7 -7
View File
@@ -602,7 +602,7 @@ WeaponPriceH ; weapons prices (tables with prices of weapons)
.by >price_Vert_Guidance__
.by >price_Lazy_Boy_______
.by >price_Parachute______
.by >price_Battery________
.by >price_StrongParachute
.by >price_Mag_Deflector__
.by >price_Shield_________
.by >price_Force_Shield___
@@ -668,7 +668,7 @@ WeaponPriceL
.by <price_Vert_Guidance__
.by <price_Lazy_Boy_______
.by <price_Parachute______
.by <price_Battery________
.by <price_StrongParachute
.by <price_Mag_Deflector__
.by <price_Shield_________
.by <price_Force_Shield___
@@ -740,7 +740,7 @@ WeaponUnits
.by 5 ;Vert_Guidance__
.by 2 ;Lazy_Boy_______
.by 8 ;Parachute______
.by 10 ;Battery________
.by 2 ;StrongParachute
.by 2 ;Mag_Deflector__
.by 3 ;Shield_________
.by 3 ;Force_Shield___
@@ -811,7 +811,7 @@ WeaponSymbols
.by $58,$59,$5a,$5b,$60,$7b,$7c,$7d
.by $20,$00,$00,$00,$00,$00,$00,$00
.by $00,$00,$00,$00,$00,$00,$00,$00
.by $5f,$02,$03,$06,$1d,$0a,$1b,$1c ; defensives
.by $5f,$02,$03,$06,$1d,$0a,$1b,$1b ; defensives
.by $1e,$3b,$3c,$3d,$3e,$3f,$5e,$00
; Names of weapons (16 chars long)
@@ -872,7 +872,7 @@ NamesOfWeapons ;the comment is an index in the tables
dta d"Vert Guidance " ; 52
dta d"Lazy Boy " ; 53
dta d"Parachute " ; 54 - no energy
dta d"Battery " ; 55
dta d"Strong Parachute" ; 55 - with energy (earlier Battery)
dta d"Mag Deflector " ; 56 - with shield and energy
dta d"Shield " ; 57 - shield for one shot - no energy
dta d"Force Shield " ; 58 - shield with energy and parachute
@@ -889,8 +889,8 @@ DefensiveEnergy = * - 48
.by 00 ; Vert Guidance
.by 00 ; Lazy Boy
.by 00 ; Parachute
.by 00 ; Battery
.by 90 ; Mag Deflector
.by 99 ; Strong Parachute
.by 99 ; Mag Deflector
.by 00 ; Shield
.by 99 ; Force Shield
.by 99 ; Heavy Shield
+66 -1
View File
@@ -66,7 +66,7 @@ price_Horz_Guidance__ = $ffff ;_51
price_Vert_Guidance__ = $ffff ;_52
price_Lazy_Boy_______ = $ffff ;_53
price_Parachute______ = 234 ;_54
price_Battery________ = $ffff ;_55
price_StrongParachute = 1000 ;_55
price_Mag_Deflector__ = 245 ;_56
price_Shield_________ = 112 ;_57
price_Force_Shield___ = 268 ;_58
@@ -75,6 +75,71 @@ price_Super_Mag______ = $ffff ;_60
price_Auto_Defense___ = 512 ;_61
price_Fuel_Tank______ = $ffff ;_62
price_Contact_Trigger = $ffff ;_63
;Weapon indexes (numbers)
ind_Baby_Missile___ = 0
ind_Missile________ = 1
ind_Baby_Nuke______ = 2
ind_Nuke___________ = 3
ind_LeapFrog_______ = 4
ind_Funky_Bomb_____ = 5
ind_MIRV___________ = 6
ind_Death_s_Head___ = 7
ind_Napalm_________ = 8
ind_Hot_Napalm_____ = 9
ind_Tracer_________ = 10
ind_Smoke_Tracer___ = 11
ind_Baby_Roller____ = 12
ind_Roller_________ = 13
ind_Heavy_Roller___ = 14
ind_Riot_Charge____ = 15
ind_Riot_Blast_____ = 16
ind_Riot_Bomb______ = 17
ind_Heavy_Riot_Bomb = 18
ind_Baby_Digger____ = 19
ind_Digger_________ = 20
ind_Heavy_Digger___ = 21
ind_Baby_Sandhog___ = 22
ind_Sandhog________ = 23
ind_Heavy_Sandhog__ = 24
ind_Dirt_Clod______ = 25
ind_Dirt_Ball______ = 26
ind_Ton_of_Dirt____ = 27
ind_Liquid_Dirt____ = 28
ind_Dirt_Charge____ = 29
ind_Earth_Disrupter = 30
ind_Plasma_Blast___ = 31
ind_Laser__________ = 32
ind______________33 = 0
ind______________34 = 0
ind______________35 = 0
ind______________36 = 0
ind______________37 = 0
ind______________38 = 0
ind______________39 = 0
ind______________40 = 0
ind______________41 = 0
ind______________42 = 0
ind______________43 = 0
ind______________44 = 0
ind______________45 = 0
ind______________46 = 0
ind______________47 = 0
ind_White_Flag_____ = 48
ind_Heat_Guidance__ = 49
ind_Bal_Guidance___ = 50
ind_Horz_Guidance__ = 51
ind_Vert_Guidance__ = 52
ind_Lazy_Boy_______ = 53
ind_Parachute______ = 54
ind_StrongParachute = 55
ind_Mag_Deflector__ = 56
ind_Shield_________ = 57
ind_Force_Shield___ = 58
ind_Heavy_Shield___ = 59
ind_Super_Mag______ = 60
ind_Auto_Defense___ = 61
ind_Fuel_Tank______ = 62
ind_Contact_Trigger = 63
;--------------------------------
; names of RMT instruments (sfx)
;--------------------------------
+5 -5
View File
@@ -694,15 +694,15 @@ NoPlayerMissile
; draw defensive weapons like shield ( tank number in X )
; in xdraw, ydraw we have coordinates left LOWER corner of Tank char
lda ActiveDefenceWeapon,x
cmp #57 ; one shot shield activation
cmp #ind_Shield_________ ; one shot shield
beq ShieldDraw
cmp #58 ; shield with energy and parachute activation
cmp #ind_Force_Shield___ ; shield with energy and parachute
beq ShieldDraw
cmp #59 ; shield with energy activation
cmp #ind_Heavy_Shield___ ; shield with energy
beq ShieldDraw
cmp #61 ; Auto Defence
cmp #ind_Auto_Defense___ ; Auto Defence
beq DrawTankShieldWihHorns
cmp #56 ; Mag Deflector
cmp #ind_Mag_Deflector__ ; Mag Deflector
beq DrawTankShieldWihHorns
bne NoShieldDraw
ShieldDraw
-11
View File
@@ -136,17 +136,6 @@ START
jsr RandomizeSequence
; for the round #1 shooting sequence is random
; activate mag deflector for all players (test)
; ldx numberOfPlayers
; dex
;@
; mva #56 ActiveDefenceWeapon,x
; tay
; lda DefensiveEnergy,y
; sta ShieldEnergy,x ; set energy of shield
; dex
; bpl @-
; mag deflector activated! (test)
MainGameLoop
jsr CallPurchaseForEveryTank
BIN
View File
Binary file not shown.
+68 -41
View File
@@ -656,15 +656,15 @@ DistanceCheckLoop
tay
; check shields
lda ActiveDefenceWeapon,x
cmp #57 ; one hit shield
cmp #ind_Shield_________ ; one hit shield
beq UseShield
cmp #58 ; shield with energy and parachute
cmp #ind_Force_Shield___ ; shield with energy and parachute
beq UseShieldWithEnergy
cmp #59 ; shield with energy
cmp #ind_Heavy_Shield___ ; shield with energy
beq UseShieldWithEnergy
cmp #61 ; Auto Defence (it works only if hit ground next to tank. Tank hit is handled in Flight proc)
cmp #ind_Auto_Defense___ ; Auto Defence (it works only if hit ground next to tank. Tank hit is handled in Flight proc)
beq UseShieldWithEnergy
cmp #56 ; Mag deflector (it works only if hit ground next to tank. Tank hit is handled in Flight proc)
cmp #ind_Mag_Deflector__ ; Mag deflector (it works only if hit ground next to tank. Tank hit is handled in Flight proc)
beq UseShieldWithEnergy
jsr DecreaseEnergyX
jmp EndOfDistanceCheckLoop
@@ -1345,9 +1345,11 @@ ShotUnderGround
; let's check if the given tank has got the parachute
ldx TankNr
lda ActiveDefenceWeapon,x
cmp #54 ; parachute
cmp #ind_Parachute______ ; parachute
beq ParachuteActive
cmp #58 ; scheld witch energy and parachute
cmp #ind_StrongParachute ; strong parachute
beq ParachuteActive
cmp #ind_Force_Shield___ ; shield witch energy and parachute
bne TankFallsX
ParachuteActive
inc Parachute
@@ -1417,6 +1419,44 @@ ItStillFalls
FallDiagonally
NoFallingDown
ParachutePresent
; check parachute type
lda ActiveDefenceWeapon,x
cmp #ind_StrongParachute ; strong parachute
bne OneTimeParachute
; decreasing energy of parachute - if the vertical fall, substract 2
; and if at an angle then substract 1
ldy #1 ; how much energy to substract
lda IfFallDown
and #1
beq NoFallingDown2
ldx TankNr
jsr DecreaseShieldEnergyX
cpy #0 ; is necessary to reduce tenk energy ?
beq @+
jsr DecreaseEnergyX
@
ldy #1
lda IfFallDown
and #6
bne FallDiagonally2
ldx TankNr
jsr DecreaseShieldEnergyX
cpy #0 ; is necessary to reduce tenk energy ?
beq @+
jsr DecreaseEnergyX
@
; check energy of parachute
lda ShieldEnergy,x
bne OneTimeParachute
mva #0 Parachute
mva #0 ActiveDefenceWeapon,x ; deactivate defence weapon (parachute)
; and now we must clear parachute symbol
mva #1 Erase
jsr DrawTankParachute
FallDiagonally2
NoFallingDown2
OneTimeParachute
; we must set flag meaning that the tank was falling down
; because later maybe the number of parachutes will decrease
; (if there were parachutes and they were ON)
@@ -1424,7 +1464,7 @@ ParachutePresent
lda Parachute
ora #2 ; we set bit nr 1 (nr 0 means that parachute is present)
sta Parachute
testowanie
; storing last direction of falling
; (it is not necessarily the direction from the previous
; iteraction, so we must check directional bits before storing)
@@ -1472,17 +1512,7 @@ NotRightEdge
beq DoNotClearParachute
; here we clear the parachute
ldx TankNr
lda #$34
sta CharCode
lda Ytankstable,x
sec
sbc #8
sta ydraw
lda XtanksTableL,x
sta xdraw
lda XtanksTableH,x
sta xdraw+1
jsr TypeChar
jsr DrawTankParachute
DoNotClearParachute
mva #0 Erase
ldx TankNr
@@ -1525,17 +1555,7 @@ DoesNotFallRight
; here we draw parachute
ldx TankNr
lda #$34
sta CharCode
lda Ytankstable,x
sec
sbc #8
sta ydraw
lda XtanksTableL,x
sta xdraw
lda XtanksTableH,x
sta xdraw+1
jsr TypeChar
jsr DrawTankParachute
DoNotDrawParachute
lda EndOfTheFallFlag
jeq TankFallsX
@@ -1552,11 +1572,24 @@ EndOfFall
mva #1 Erase
ldx TankNr
lda ActiveDefenceWeapon,x
cmp #54 ; deactivate weapon only if parachute (53)
cmp #ind_Parachute______ ; deactivate weapon only if parachute (54)
bne NoParachuteWeapon
mva #0 ActiveDefenceWeapon,x ; deactivate defence weapon (parachute)
NoParachuteWeapon
lda #$34
jsr DrawTankParachute
mva #0 Erase
ldx TankNr
jsr DrawTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) )
ThereWasNoParachute
mva #sfx_silencer sfx_effect
rts
.endp
;--------------------------------------------------
.proc DrawTankParachute
;Tank number in X
;--------------------------------------------------
lda #$34 ; parachute symbol
sta CharCode
lda Ytankstable,x
sec
@@ -1567,14 +1600,8 @@ NoParachuteWeapon
lda XtanksTableH,x
sta xdraw+1
jsr TypeChar
mva #0 Erase
ldx TankNr
jsr DrawTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) )
ThereWasNoParachute
mva #sfx_silencer sfx_effect
rts
rts
.endp
;--------------------------------------------------
.proc Flight ; Force(byte.byte), Wind(0.word)
; Angle(byte) 128=0, 255=maxright, 0=maxleft
@@ -1858,9 +1885,9 @@ EndOfFlight2
tax
dex ; index of tank in X
lda ActiveDefenceWeapon,x
cmp #61 ; Auto Defence
cmp #ind_Auto_Defense___ ; Auto Defence
beq AutoDefence
cmp #56 ; Mag Deflector
cmp #ind_Mag_Deflector__ ; Mag Deflector
bne NoDefence
MagDeflector
; now run defensive-aggressive weapon - Mag Deflector!