Initial trolls:

- random dash timer
- random bomb timer
- flute sometimes summons chickens
- ice physics while carrying things
- lowered i-frames with increased hearts/armor
- Blind impervious (TODO: allow hitting with bunny pots)
This commit is contained in:
2023-03-15 22:06:02 -05:00
parent 2a9b098dac
commit d20c8d5d31
7 changed files with 115 additions and 7 deletions

View File

@@ -158,6 +158,7 @@ incsrc msu.asm
incsrc dungeonmap.asm
incsrc special_weapons.asm
incsrc variable_ganon_vulnerability.asm
incsrc trolls.asm
if !FEATURE_NEW_TEXT
incsrc textrenderer.asm
endif

View File

@@ -9,7 +9,11 @@ CuccoStorm:
SEP #$30 ; set 8-bit accumulator index registers
LDA.l CuccoStormer : BEQ + ; only if storm is on
LDA.b GameMode : CMP.b #$09 : BNE + ; only if outdoors
LDA.b GameMode : CMP.b #$09 : BNE .check ; only if outdoors
.indoors
LDA.b #$00 : STA.l CuccoStormer ; turn off cucco storm if indoors
BRA +
.check
LDA.l LoopFrames : AND.b #$7F : BNE + ; check every 128 frames
-

Binary file not shown.

View File

@@ -2014,11 +2014,11 @@ JSL.l Overworld_LoadNewTiles : NOP #$02
org $02EC2E ;<- 016C2E
JSL.l Overworld_LoadNewTiles : NOP #$02
;================================================================================
org $07A3E2 ;<- 3A3E2 Bank07.asm:5764 (LDA.b #$80 : STA $03F0)
JSL.l FreeDuckCheck : BEQ +
NOP
skip 3 ; a JSR we need to keep
+
; org $07A3E2 ;<- 3A3E2 Bank07.asm:5764 (LDA.b #$80 : STA $03F0)
; JSL.l FreeDuckCheck : BEQ +
; NOP
; skip 3 ; a JSR we need to keep
; +
;================================================================================
org $07A9AC ; <- 3A9AC - Bank07.asm:6628 (LDA $0C : ORA $0E : STA $00 : AND.b #$0C : BEQ BRANCH_BETA)
JML.l MirrorBonk
@@ -2623,3 +2623,26 @@ JSL.l TransferVRAMStripes
;===================================================================================================
org $9BF029+1 : db $10
;--------------------------------------------------------------------------------
; Various nonsense
;--------------------------------------------------------------------------------
org $0780B9 ; LDA.b #$3A : STA.w $031F
JSL CalcIFrames
NOP
org $09814E ; LDA.w Bomb_timer : STA.w $039F, X
JSL SetBombTimer
NOP #2
org $07B282 ; LDA.b #$1D : STA.w $0374
JSL SetDashTimer
NOP
org $07A3E7 ; LDA.b #$13 : JSR PlaySFX_Set2 : ...
JSL ProcessFlute
BCS +
RTS
NOP #14 : +
org $08E073 ; LDA.b #$0E : STA.b $10
JSL FluteMap

View File

@@ -274,7 +274,8 @@ Utility_CheckHammerHelmasaurKingMask:
RTL
;--------------------------------------------------------------------------------
Utility_CheckImpervious:
LDA $0E20, X : CMP.b #$CB : BNE .normal
LDA $0E20, X : CMP.b #$CE : BEQ .blind
CMP.b #$CB : BNE .normal
.trinexx
LDA SpecialWeapons : CMP #$01 : BEQ +
CMP #$03 : BEQ +
@@ -282,6 +283,9 @@ Utility_CheckImpervious:
CMP #$05 : BEQ +
CMP #$06 : BEQ .check_sidenexx
BRA .normal
.blind
LDA $0301 : AND.b #$0A : BNE .impervious ; impervious to hammer
BRA .normal
+
LDA $0301 : AND.b #$0A : BNE .impervious ; impervious to hammer
.check_sidenexx

View File

@@ -9,6 +9,10 @@ LoadSwordForDamage:
CMP.b #$04 : !BLT + : DEC : + ; if it's gold sword, change it to tempered
RTL
.notMoth
CMP.b #$CE : BNE .notBlind
LDA.b #$01
RTL
.notBlind
JSR.w LoadModifiedSwordLevel ; load normal sword value
RTL
;================================================================================
@@ -81,8 +85,10 @@ LoadModifiedIceFloorValue:
LDA.b LinkState : CMP.b #$01 : BEQ + : CMP.b #$17 : BEQ + : CMP.b #$1C : BEQ +
LDA.b LinkSpeed : CMP.b #$02 : BEQ +
LDA.b LinkSlipping : BNE +
LDA.w $0308 : BIT #$80 : BNE .yes
LDA.l ChallengeModes : BIT #$01 : BEQ ++
LDA.l RoomIndex : CMP #$16 : BEQ ++ ; swamp supertile with current -- fine for temporary physics but impossible without boots for permanent
.yes
LDA.w TileActIce : ORA.l IceModifier : ORA.b #$10 : RTS
++ : LDA.w TileActIce : ORA.l IceModifier : RTS
+ : LDA.w TileActIce

70
trolls.asm Normal file
View File

@@ -0,0 +1,70 @@
IFrameData:
db $00, $14, $28
CalcIFrames:
LDA.l ArmorEquipment
PHX : TAX
LDA.l MaximumHealth : LSR #3
CLC : ADC.l IFrameData, X
EOR.b #$FF
CLC : ADC.b #$3E
PLX
STA.w $031F
RTL
SetBombTimer:
JSL GetRandomInt
STA.w $039F, X
RTL
SetDashTimer:
JSL GetRandomInt
AND.b #$3F
STA.w $0374
RTL
ProcessFlute:
LDA.b $1B
BNE .play_and_leave ; indoors
LDA.b $10
CMP.b #$0B
BEQ .play_and_leave ; special overworld
JSL GetRandomInt
BIT #$08
BNE .cucco
.normal
LDA.b $8A
AND.b #$40
BNE .play_and_leave ; dark world
JSR PlayDuck
SEC : RTL ; light world; play duck sound and resume normal behavior
.cucco
JSR PlayCluck ; outdoors; play cucco sound
LDA.b #$01
STA.l $7F50C5 ; turn on cucco storm
CLC : RTL ; do not summon duck
.play_and_leave
JSR PlayDuck
CLC : RTL
PlayDuck:
LDA.b #$13
STA.w $0CF8
JSL Sound_SetSfxPanWithPlayerCoords
ORA.w $0CF8
STA.w $012E
RTS
PlayCluck:
LDA.b #$30
STA.w $0CF8
JSL Sound_SetSfxPanWithPlayerCoords
ORA.w $0CF8
STA.w $012E
RTS
FluteMap:
LDA.b #$00
STA.l $7F50C5 ; turn off cuccos
LDA.b #$0E
STA.b $10
RTL