diff --git a/src/actors/fireball.asm b/src/actors/fireball.asm index 4743b09e..b7283e77 100644 --- a/src/actors/fireball.asm +++ b/src/actors/fireball.asm @@ -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 @@ -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. @@ -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 @@ -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 diff --git a/src/rooms/boss_garden.asm b/src/rooms/boss_garden.asm index ff2eb0e2..56ec312c 100644 --- a/src/rooms/boss_garden.asm +++ b/src/rooms/boss_garden.asm @@ -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 @@ -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 @@ -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 @@ -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