diff options
| author | dannye <33dannye@gmail.com> | 2023-11-20 00:33:27 -0600 |
|---|---|---|
| committer | dannye <33dannye@gmail.com> | 2023-11-20 20:23:27 -0600 |
| commit | 298e99d3776580585c3f434e5d93137ae431bdd3 (patch) | |
| tree | a808c4ffd0fd0f9bd28972bae5236e0d3345c8e5 /scripts/SeafoamIslandsB4F.asm | |
| parent | Add sound bits documentation for wOptions (#110) (diff) | |
| parent | Name 2 unnamed labels I missed in SeafoamIslandsB4F and PokemonMansion3F (#437) (diff) | |
| download | pokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.tar.gz pokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.tar.xz pokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.zip | |
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'scripts/SeafoamIslandsB4F.asm')
| -rw-r--r-- | scripts/SeafoamIslandsB4F.asm | 103 |
1 files changed, 53 insertions, 50 deletions
diff --git a/scripts/SeafoamIslandsB4F.asm b/scripts/SeafoamIslandsB4F.asm index 21db0a4d..dc7be7d1 100644 --- a/scripts/SeafoamIslandsB4F.asm +++ b/scripts/SeafoamIslandsB4F.asm @@ -4,7 +4,7 @@ SeafoamIslandsB4F_Script: ld hl, SeafoamIslandsB4F_ScriptPointers jp CallFunctionInTable -SeafoamIslands5Script_467a5: +SeafoamIslandsB4FResetScript: xor a ld [wJoyIgnore], a ld [wSeafoamIslandsB4FCurScript], a @@ -12,22 +12,24 @@ SeafoamIslands5Script_467a5: ret SeafoamIslandsB4F_ScriptPointers: - dw SeafoamIslands5Script0 - dw SeafoamIslands5Script1 - dw SeafoamIslands5Script2 - dw SeafoamIslands5Script3 - dw SeafoamIslands5Script4 + def_script_pointers + dw_const SeafoamIslandsB4FDefaultScript, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT + dw_const SeafoamIslandsB4FObjectMoving1Script, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING1 + dw_const SeafoamIslandsB4FMoveObjectScript, SCRIPT_SEAFOAMISLANDSB4F_MOVE_OBJECT + dw_const SeafoamIslandsB4FObjectMoving2Script, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING2 + dw_const SeafoamIslandsB4FObjectMoving3Script, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING3 + EXPORT SCRIPT_SEAFOAMISLANDSB4F_MOVE_OBJECT ; used by engine/overworld/player_state.asm -SeafoamIslands5Script4: +SeafoamIslandsB4FObjectMoving3Script: ld a, [wIsInBattle] cp $ff - jr z, SeafoamIslands5Script_467a5 + jr z, SeafoamIslandsB4FResetScript call EndTrainerBattle - ld a, $0 + ld a, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT ld [wSeafoamIslandsB4FCurScript], a ret -SeafoamIslands5Script0: +SeafoamIslandsB4FDefaultScript: CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE ret z ld hl, .Coords @@ -35,21 +37,21 @@ SeafoamIslands5Script0: ret nc ld a, [wCoordIndex] cp $3 - jr nc, .asm_467e6 + jr nc, .only1UpInputNeeded ld a, NPC_MOVEMENT_UP ld [wSimulatedJoypadStatesEnd + 1], a ld a, 2 - jr .asm_467e8 -.asm_467e6 + jr .forcePlayerUpFromSurfExit +.only1UpInputNeeded ld a, 1 -.asm_467e8 +.forcePlayerUpFromSurfExit ld [wSimulatedJoypadStatesIndex], a ld a, D_UP ld [wSimulatedJoypadStatesEnd], a call StartSimulatingJoypadStates ld hl, wFlags_D733 res 2, [hl] - ld a, $1 + ld a, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING1 ld [wSeafoamIslandsB4FCurScript], a ret @@ -60,39 +62,39 @@ SeafoamIslands5Script0: dbmapcoord 21, 16 db -1 ; end -SeafoamIslands5Script1: +SeafoamIslandsB4FObjectMoving1Script: ld a, [wSimulatedJoypadStatesIndex] and a ret nz xor a ld [wJoyIgnore], a - ld a, $0 + ld a, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT ld [wSeafoamIslandsB4FCurScript], a ret -SeafoamIslands5Script2: +SeafoamIslandsB4FMoveObjectScript: CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE - ld a, $0 - jr z, .asm_46849 + ld a, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT + jr z, .playerNotInStrongCurrent ld hl, .Coords call ArePlayerCoordsInArray - ld a, $0 - jr nc, .asm_46849 + ld a, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT + jr nc, .playerNotInStrongCurrent ld a, [wCoordIndex] cp $1 - jr nz, .asm_46837 - ld de, RLEMovementData_46859 - jr .asm_4683a -.asm_46837 - ld de, RLEMovementData_46852 -.asm_4683a + jr nz, .nearRightBoulder + ld de, .RLEList_StrongCurrentNearLeftBoulder + jr .forceSurfMovement +.nearRightBoulder + ld de, .RLEList_StrongCurrentNearRightBoulder +.forceSurfMovement ld hl, wSimulatedJoypadStatesEnd call DecodeRLEList dec a ld [wSimulatedJoypadStatesIndex], a call StartSimulatingJoypadStates - ld a, $3 -.asm_46849 + ld a, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING2 +.playerNotInStrongCurrent ld [wSeafoamIslandsB4FCurScript], a ret @@ -101,71 +103,72 @@ SeafoamIslands5Script2: dbmapcoord 5, 14 db -1 ; end -RLEMovementData_46852: +.RLEList_StrongCurrentNearRightBoulder: db D_UP, 3 db D_RIGHT, 2 db D_UP, 1 db -1 ; end -RLEMovementData_46859: +.RLEList_StrongCurrentNearLeftBoulder: db D_UP, 3 db D_RIGHT, 3 db D_UP, 1 db -1 ; end -SeafoamIslands5Script3: +SeafoamIslandsB4FObjectMoving2Script: ld a, [wSimulatedJoypadStatesIndex] ld b, a cp $1 - call z, SeaFoamIslands5Script_46872 + call z, .doneForcedSurfMovement ld a, b and a ret nz - ld a, $0 + ld a, SCRIPT_SEAFOAMISLANDSB4F_DEFAULT ld [wSeafoamIslandsB4FCurScript], a ret -SeaFoamIslands5Script_46872: +.doneForcedSurfMovement: xor a ld [wWalkBikeSurfState], a ld [wWalkBikeSurfStateCopy], a jp ForceBikeOrSurf SeafoamIslandsB4F_TextPointers: - dw BoulderText - dw BoulderText - dw ArticunoText - dw SeafoamIslands5Text4 - dw SeafoamIslands5Text5 + def_text_pointers + dw_const BoulderText, TEXT_SEAFOAMISLANDSB4F_BOULDER1 + dw_const BoulderText, TEXT_SEAFOAMISLANDSB4F_BOULDER2 + dw_const SeafoamIslandsB4FArticunoText, TEXT_SEAFOAMISLANDSB4F_ARTICUNO + dw_const SeafoamIslandsB4FBouldersSignText, TEXT_SEAFOAMISLANDSB4F_BOULDERS_SIGN + dw_const SeafoamIslandsB4FDangerSignText, TEXT_SEAFOAMISLANDSB4F_DANGER_SIGN ; Articuno is object 3, but its event flag is bit 2. ; This is not a problem because its sight range is 0, and ; trainer headers were not stored by ExecuteCurMapScriptInTable. def_trainers 2 ArticunoTrainerHeader: - trainer EVENT_BEAT_ARTICUNO, 0, ArticunoBattleText, ArticunoBattleText, ArticunoBattleText + trainer EVENT_BEAT_ARTICUNO, 0, SeafoamIslandsB4FArticunoBattleText, SeafoamIslandsB4FArticunoBattleText, SeafoamIslandsB4FArticunoBattleText db -1 ; end -ArticunoText: +SeafoamIslandsB4FArticunoText: text_asm ld hl, ArticunoTrainerHeader call TalkToTrainer - ld a, $4 + ld a, SCRIPT_SEAFOAMISLANDSB4F_OBJECT_MOVING3 ld [wSeafoamIslandsB4FCurScript], a jp TextScriptEnd -ArticunoBattleText: - text_far _ArticunoBattleText +SeafoamIslandsB4FArticunoBattleText: + text_far _SeafoamIslandsB4FArticunoBattleText text_asm ld a, ARTICUNO call PlayCry call WaitForSoundToFinish jp TextScriptEnd -SeafoamIslands5Text4: - text_far _SeafoamIslands5Text4 +SeafoamIslandsB4FBouldersSignText: + text_far _SeafoamIslandsB4FBouldersSignText text_end -SeafoamIslands5Text5: - text_far _SeafoamIslands5Text5 +SeafoamIslandsB4FDangerSignText: + text_far _SeafoamIslandsB4FDangerSignText text_end |
