pokered/scripts/PokemonMansion1F.asm

130 lines
2.5 KiB
NASM
Raw Normal View History

PokemonMansion1F_Script:
2014-05-18 18:19:10 +00:00
call Mansion1Subscript1
call EnableAutoTextBoxDrawing
ld hl, Mansion1TrainerHeaders
ld de, PokemonMansion1F_ScriptPointers
ld a, [wPokemonMansion1FCurScript]
2014-05-18 18:19:10 +00:00
call ExecuteCurMapScriptInTable
ld [wPokemonMansion1FCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
Mansion1Subscript1:
2016-01-03 19:17:10 +00:00
ld hl, wCurrentMapScriptFlags
2014-05-18 18:19:10 +00:00
bit 5, [hl]
res 5, [hl]
ret z
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_MANSION_SWITCH_ON
jr nz, .asm_442ec
2015-08-05 21:20:29 +00:00
lb bc, 6, 12
2014-05-18 18:19:10 +00:00
call Mansion1Script_4430b
2015-08-05 21:20:29 +00:00
lb bc, 3, 8
2014-05-18 18:19:10 +00:00
call Mansion1Script_44304
2015-08-05 21:20:29 +00:00
lb bc, 8, 10
2014-05-18 18:19:10 +00:00
call Mansion1Script_44304
2015-08-05 21:20:29 +00:00
lb bc, 13, 13
2014-05-18 18:19:10 +00:00
jp Mansion1Script_44304
.asm_442ec
2015-08-05 21:20:29 +00:00
lb bc, 6, 12
2014-05-18 18:19:10 +00:00
call Mansion1Script_44304
2015-08-05 21:20:29 +00:00
lb bc, 3, 8
2014-05-18 18:19:10 +00:00
call Mansion1Script_4430b
2015-08-05 21:20:29 +00:00
lb bc, 8, 10
2014-05-18 18:19:10 +00:00
call Mansion1Script_4430b
2015-08-05 21:20:29 +00:00
lb bc, 13, 13
2014-05-18 18:19:10 +00:00
jp Mansion1Script_4430b
2016-06-12 00:24:04 +00:00
Mansion1Script_44304:
2014-05-18 18:19:10 +00:00
ld a, $2d
2015-07-24 21:39:45 +00:00
ld [wNewTileBlockID], a
jr Mansion1ReplaceBlock
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Mansion1Script_4430b:
2014-05-18 18:19:10 +00:00
ld a, $e
2015-07-24 21:39:45 +00:00
ld [wNewTileBlockID], a
2016-06-12 00:24:04 +00:00
Mansion1ReplaceBlock:
2014-09-14 18:29:18 +00:00
predef ReplaceTileBlock
2014-05-18 18:19:10 +00:00
ret
Mansion1Script_Switches::
ld a, [wSpritePlayerStateData1FacingDirection]
cp SPRITE_FACING_UP
2014-05-18 18:19:10 +00:00
ret nz
xor a
ldh [hJoyHeld], a
2014-05-18 18:19:10 +00:00
ld a, $4
ldh [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
jp DisplayTextID
PokemonMansion1F_ScriptPointers:
2014-05-18 18:19:10 +00:00
dw CheckFightingMapTrainers
2014-09-14 18:29:18 +00:00
dw DisplayEnemyTrainerTextAndStartBattle
2014-05-18 18:19:10 +00:00
dw EndTrainerBattle
PokemonMansion1F_TextPointers:
2014-05-18 18:19:10 +00:00
dw Mansion1Text1
2015-07-18 15:17:29 +00:00
dw PickUpItemText
dw PickUpItemText
2014-05-18 18:19:10 +00:00
dw Mansion1Text4
Mansion1TrainerHeaders:
def_trainers
2016-06-12 00:24:04 +00:00
Mansion1TrainerHeader0:
trainer EVENT_BEAT_MANSION_1_TRAINER_0, 3, Mansion1BattleText2, Mansion1EndBattleText2, Mansion1AfterBattleText2
db -1 ; end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Mansion1Text1:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, Mansion1TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
Mansion1BattleText2:
text_far _Mansion1BattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Mansion1EndBattleText2:
text_far _Mansion1EndBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Mansion1AfterBattleText2:
text_far _Mansion1AfterBattleText2
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
Mansion1Text4:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, MansionSwitchText
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
2014-05-18 18:19:10 +00:00
and a
jr nz, .asm_4438c
2014-05-18 18:19:10 +00:00
ld a, $1
2014-09-13 07:50:56 +00:00
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
2016-01-03 19:17:10 +00:00
ld hl, wCurrentMapScriptFlags
2014-05-18 18:19:10 +00:00
set 5, [hl]
ld hl, MansionSwitchPressedText
call PrintText
2015-07-19 08:46:12 +00:00
ld a, SFX_GO_INSIDE
2014-05-18 18:19:10 +00:00
call PlaySound
2015-07-21 17:36:03 +00:00
CheckAndSetEvent EVENT_MANSION_SWITCH_ON
jr z, .asm_44392
2015-07-21 17:36:03 +00:00
ResetEventReuseHL EVENT_MANSION_SWITCH_ON
jr .asm_44392
2014-05-18 18:19:10 +00:00
.asm_4438c
ld hl, MansionSwitchNotPressedText
call PrintText
.asm_44392
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
MansionSwitchText:
text_far _MansionSwitchText
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
MansionSwitchPressedText:
text_far _MansionSwitchPressedText
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
MansionSwitchNotPressedText:
text_far _MansionSwitchNotPressedText
text_end