diff options
author | dannye <33dannye@gmail.com> | 2020-05-20 19:40:33 -0500 |
---|---|---|
committer | dannye <33dannye@gmail.com> | 2020-05-20 20:02:53 -0500 |
commit | 10f9559eab8c93b94abb8ae8d1083704ad4e169a (patch) | |
tree | 7dbe7b152dde8a6e9b56664b5b8cdfc0d6be1253 /scripts/PokemonTower2F.asm | |
parent | b8954732a3eaa3a784a6e3eaaa68977a9ccd9816 (diff) |
Sync with pokered
Diffstat (limited to 'scripts/PokemonTower2F.asm')
-rwxr-xr-x | scripts/PokemonTower2F.asm | 172 |
1 files changed, 172 insertions, 0 deletions
diff --git a/scripts/PokemonTower2F.asm b/scripts/PokemonTower2F.asm new file mode 100755 index 00000000..54f49cae --- /dev/null +++ b/scripts/PokemonTower2F.asm @@ -0,0 +1,172 @@ +PokemonTower2F_Script: + call EnableAutoTextBoxDrawing + ld hl, PokemonTower2F_ScriptPointers + ld a, [wPokemonTower2FCurScript] + jp CallFunctionInTable + +PokemonTower2Script_604fe: + xor a + ld [wJoyIgnore], a + ld [wPokemonTower2FCurScript], a + ld [wCurMapScript], a + ret + +PokemonTower2F_ScriptPointers: + dw PokemonTower2Script0 + dw PokemonTower2Script1 + dw PokemonTower2Script2 + +PokemonTower2Script0: + CheckEvent EVENT_BEAT_POKEMON_TOWER_RIVAL + ret nz + ld hl, CoordsData_6055e + call ArePlayerCoordsInArray + ret nc + call StopAllMusic + ld c, BANK(Music_MeetRival) + ld a, MUSIC_MEET_RIVAL + call PlayMusic + ResetEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT + ld a, [wCoordIndex] + cp $1 + ld a, PLAYER_DIR_UP + ld b, SPRITE_FACING_DOWN + jr nz, .asm_60544 +; the rival is on the left side and the player is on the right side + SetEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT + ld a, PLAYER_DIR_LEFT + ld b, SPRITE_FACING_RIGHT +.asm_60544 + ld [wPlayerMovingDirection], a + ld a, $1 + ld [H_SPRITEINDEX], a + ld a, b + ld [hSpriteFacingDirection], a + call SetSpriteFacingDirectionAndDelay + ld a, $1 + ld [hSpriteIndexOrTextID], a + call DisplayTextID + xor a + ld [hJoyHeld], a + ld [hJoyPressed], a + ret + +CoordsData_6055e: + db $05,$0F + db $06,$0E + db $0F ; isn't this supposed to end in $ff? + +PokemonTower2Script1: + ld a, [wIsInBattle] + cp $ff + jp z, PokemonTower2Script_604fe + ld a, $f0 + ld [wJoyIgnore], a + SetEvent EVENT_BEAT_POKEMON_TOWER_RIVAL + ld a, $1 + ld [hSpriteIndexOrTextID], a + call DisplayTextID + ld de, MovementData_605b2 + CheckEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT + jr nz, .asm_60589 + callab Func_f1e22 + ld de, MovementData_605a9 +.asm_60589 + ld a, $1 + ld [H_SPRITEINDEX], a + call MoveSprite + call StopAllMusic + callba Music_RivalAlternateStart + ld a, $2 + ld [wPokemonTower2FCurScript], a + ld [wCurMapScript], a + ret + +MovementData_605a9: + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_RIGHT + db $FF + +MovementData_605b2: + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db $FF + +PokemonTower2Script2: + ld a, [wd730] + bit 0, a + ret nz + ld a, HS_POKEMON_TOWER_2F_RIVAL + ld [wMissableObjectIndex], a + predef HideObject + xor a + ld [wJoyIgnore], a + call PlayDefaultMusic + ld a, $0 + ld [wPokemonTower2FCurScript], a + ld [wCurMapScript], a + ret + +PokemonTower2F_TextPointers: + dw PokemonTower2Text1 + dw PokemonTower2Text2 + +PokemonTower2Text1: + TX_ASM + CheckEvent EVENT_BEAT_POKEMON_TOWER_RIVAL + jr z, .asm_16f24 + ld hl, PokemonTower2Text_6063c + call PrintText + jr .asm_41852 +.asm_16f24 + ld hl, PokemonTower2Text_6062d + call PrintText + ld hl, wd72d + set 6, [hl] + set 7, [hl] + ld hl, PokemonTower2Text_60632 + ld de, PokemonTower2Text_60637 + call SaveEndBattleTextPointers + ld a, OPP_SONY2 + ld [wCurOpponent], a + ld a, [wRivalStarter] + add $1 + ld [wTrainerNo], a + + ld a, $1 + ld [wPokemonTower2FCurScript], a + ld [wCurMapScript], a +.asm_41852 + jp TextScriptEnd + +PokemonTower2Text_6062d: + TX_FAR _PokemonTower2Text_6062d + db "@" + +PokemonTower2Text_60632: + TX_FAR _PokemonTower2Text_60632 + db "@" + +PokemonTower2Text_60637: + TX_FAR _PokemonTower2Text_60637 + db "@" + +PokemonTower2Text_6063c: + TX_FAR _PokemonTower2Text_6063c + db "@" + +PokemonTower2Text2: + TX_FAR _PokemonTower2Text2 + db "@" |