Skip to content

Commit

Permalink
Slow down fireballs and tweak garden boss to be easier
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsteele committed Sep 24, 2024
1 parent a31f9a4 commit 6d85cdd
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 27 deletions.
39 changes: 24 additions & 15 deletions src/actors/fireball.asm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
;;;=========================================================================;;;

;;; The speed of a fireball/fireblast, in half-pixels per frame.
kFireballSpeed = 5
kFireballSpeed = 3
kFireblastSpeed = 5

;;; The OBJ palette numbers used for fireball and fireblast actors.
kPaletteObjFireball = 1
Expand All @@ -63,8 +64,17 @@ kPaletteObjFireblast = 1
.EXPORT Func_InitActorProjFireblast
.PROC Func_InitActorProjFireblast
ldy #eActor::ProjFireblast ; param: actor type
.assert eActor::ProjFireblast > 0, error
bne Func_InitActorProjFireballOrFireblast ; unconditional
jsr Func_InitActorWithState1 ; preserves X and T0+
fall Func_ReinitActorProjFireblastVelocity ; preserves X and T3+
.ENDPROC

;;; Sets a fireblast projectile's velocity from its State1 angle value.
;;; @param X The actor index.
;;; @preserve X, T3+
.EXPORT Func_ReinitActorProjFireblastVelocity
.PROC Func_ReinitActorProjFireblastVelocity
ldy #kFireblastSpeed ; param: speed
bne Func_ReinitActorProjFireballOrFireblastVelocity ; unconditional
.ENDPROC

;;; Initializes the specified actor as a fireball projectile.
Expand All @@ -75,25 +85,24 @@ kPaletteObjFireblast = 1
.EXPORT Func_InitActorProjFireball
.PROC Func_InitActorProjFireball
ldy #eActor::ProjFireball ; param: actor type
fall Func_InitActorProjFireballOrFireblast ; preserves X and T3+
jsr Func_InitActorWithState1 ; preserves X and T0+
fall Func_ReinitActorProjFireballVelocity ; preserves X and T3+
.ENDPROC

;;; Initializes the specified actor as a fireball or fireblast projectile.
;;; @prereq The actor's pixel position has already been initialized.
;;; @param A The angle to fire at, measured in increments of tau/256.
;;; Sets a fireball projectile's velocity from its State1 angle value.
;;; @param X The actor index.
;;; @preserve X, T3+
.PROC Func_InitActorProjFireballOrFireblast
jsr Func_InitActorWithState1 ; preserves X and T0+
fall Func_ReinitActorProjFireblastVelocity ; preserves X and T3+
.PROC Func_ReinitActorProjFireballVelocity
ldy #kFireballSpeed ; param: speed
fall Func_ReinitActorProjFireballOrFireblastVelocity ; preserves X and T3+
.ENDPROC

;;; Sets a fireball projectile's velocity from its State1 angle value.
;;; Sets a fireball/fireblast projectile's velocity from its State1 angle
;;; value.
;;; @param X The actor index.
;;; @param Y The speed, in half-pixels per frame.
;;; @preserve X, T3+
.EXPORT Func_ReinitActorProjFireblastVelocity
.PROC Func_ReinitActorProjFireblastVelocity
ldy #kFireballSpeed ; param: speed
.PROC Func_ReinitActorProjFireballOrFireblastVelocity
lda Ram_ActorState1_byte_arr, x ; param: angle
jmp Func_SetActorVelocityPolar ; preserves X and T3+
.ENDPROC
Expand Down Expand Up @@ -121,7 +130,7 @@ _UpdateAngle:
beq @done
add Ram_ActorState1_byte_arr, x ; current angle
sta Ram_ActorState1_byte_arr, x ; current angle
jmp Func_ReinitActorProjFireblastVelocity ; preserves X
jmp Func_ReinitActorProjFireballVelocity ; preserves X
@done:
rts
.ENDPROC
Expand Down
27 changes: 15 additions & 12 deletions src/rooms/boss_garden.asm
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,22 @@ kBossInitHealthPerEye = 4

;;; How many frames the boss waits, after you first enter the room, before
;;; taking action.
kBossInitCooldown = 160
kBossInitCooldown = 150
;;; How many frames to wait between spikes when the boss is in Angry mode.
kBossAngrySpikeCooldown = 15
kBossAngrySpikeCooldown = 18
;;; How many frames to wait between fireballs when the boss is in Shoot mode.
kBossShootFireballCooldown = 60
kBossShootFireballCooldown = 70
;;; How many frames to wait between fireballs when the boss is in Spray mode.
kBossSprayFireballCooldown = 15
kBossSprayFireballCooldown = 18
;;; How many frames the boss stays in SprayWindup mode before starting to shoot
;;; the spray.
kBossSprayWindupCooldown = 80
;;; How many extra frames the boss waits between opening its eye and shooting
;;; its first fireball in Shoot mode.
kBossShootWindupFrames = 15

;;; How many spikes to drop when the boss is in Angry mode.
kBossAngryNumSpikes = 3
kBossAngryNumSpikes = 2

;;; How many frames it takes for an eye to fully open or close.
kBossEyeOpenFrames = 20
Expand Down Expand Up @@ -544,7 +547,7 @@ _ChooseNewBossMode:
dec Zp_RoomState + sState::BossShootsUntilNextSpray_u8
jmp _StartShootMode
_StartSprayMode:
lda #7
lda #5
sta Zp_RoomState + sState::BossProjCount_u8
;; Set BossShootsUntilNextSpray_u8 to a random value from 2-3.
jsr Func_GetRandomByte ; returns A
Expand All @@ -559,10 +562,10 @@ _StartSprayMode:
_StartShootMode:
;; Choose a random number of fireballs to shoot, from 4-7.
jsr Func_GetRandomByte ; returns A
and #$03
add #4
mod #4
ora #4
sta Zp_RoomState + sState::BossProjCount_u8
lda #kBossEyeOpenFrames
lda #kBossEyeOpenFrames + kBossShootWindupFrames
sta Zp_RoomState + sState::BossCooldown_u8
lda #eBossMode::Shoot
sta Zp_RoomState + sState::Current_eBossMode
Expand Down Expand Up @@ -941,14 +944,14 @@ _Close:
.ENDPROC

;;; Makes the garden boss enter waiting mode for a random amount of time
;;; (between about 1-2 seconds).
;;; (between about 2-3 seconds).
;;; @preserve X
.PROC FuncA_Room_BossGarden_StartWaiting
lda #eBossMode::Waiting
sta Zp_RoomState + sState::Current_eBossMode
jsr Func_GetRandomByte ; preserves X, returns A
and #$3f
ora #$40
mod #$40
ora #$80
sta Zp_RoomState + sState::BossCooldown_u8
rts
.ENDPROC
Expand Down

0 comments on commit 6d85cdd

Please sign in to comment.