2019-01-01 20:06:23 +00:00
|
|
|
PokemonMansion3F_Script:
|
2014-05-18 18:19:10 +00:00
|
|
|
call Mansion3Script_52204
|
|
|
|
call EnableAutoTextBoxDrawing
|
|
|
|
ld hl, Mansion3TrainerHeader0
|
2019-01-01 20:06:23 +00:00
|
|
|
ld de, PokemonMansion3F_ScriptPointers
|
|
|
|
ld a, [wPokemonMansion3FCurScript]
|
2014-05-18 18:19:10 +00:00
|
|
|
call ExecuteCurMapScriptInTable
|
2019-01-01 20:06:23 +00:00
|
|
|
ld [wPokemonMansion3FCurScript], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3Script_52204:
|
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
|
2014-05-18 18:19:10 +00:00
|
|
|
jr nz, .asm_52224
|
|
|
|
ld a, $e
|
2019-07-07 04:44:21 +00:00
|
|
|
lb bc, 2, 7
|
2014-05-18 18:19:10 +00:00
|
|
|
call Mansion2Script_5202f
|
|
|
|
ld a, $5f
|
2019-07-07 04:44:21 +00:00
|
|
|
lb bc, 5, 7
|
2014-05-18 18:19:10 +00:00
|
|
|
call Mansion2Script_5202f
|
|
|
|
ret
|
|
|
|
.asm_52224
|
|
|
|
ld a, $5f
|
2019-07-07 04:44:21 +00:00
|
|
|
lb bc, 2, 7
|
2014-05-18 18:19:10 +00:00
|
|
|
call Mansion2Script_5202f
|
|
|
|
ld a, $e
|
2019-07-07 04:44:21 +00:00
|
|
|
lb bc, 5, 7
|
2014-05-18 18:19:10 +00:00
|
|
|
call Mansion2Script_5202f
|
|
|
|
ret
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
PokemonMansion3F_ScriptPointers:
|
2014-05-18 18:19:10 +00:00
|
|
|
dw Mansion3Script0
|
2014-09-14 18:29:18 +00:00
|
|
|
dw DisplayEnemyTrainerTextAndStartBattle
|
2014-05-18 18:19:10 +00:00
|
|
|
dw EndTrainerBattle
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3Script0:
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, CoordsData_52254
|
|
|
|
call Mansion3Script_5225b
|
2014-09-13 07:50:56 +00:00
|
|
|
ld a, [wWhichDungeonWarp]
|
2014-05-18 18:19:10 +00:00
|
|
|
and a
|
|
|
|
jp z, CheckFightingMapTrainers
|
|
|
|
cp $3
|
2019-07-07 04:44:21 +00:00
|
|
|
ld a, POKEMON_MANSION_1F
|
2014-05-18 18:19:10 +00:00
|
|
|
jr nz, .asm_52250
|
2019-07-07 04:44:21 +00:00
|
|
|
ld a, POKEMON_MANSION_2F
|
2014-05-18 18:19:10 +00:00
|
|
|
.asm_52250
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wDungeonWarpDestinationMap], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ret
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
CoordsData_52254:
|
2014-05-18 18:19:10 +00:00
|
|
|
db $0E,$10
|
|
|
|
db $0E,$11
|
|
|
|
db $0E,$13
|
|
|
|
db $FF
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3Script_5225b:
|
2014-05-18 18:19:10 +00:00
|
|
|
xor a
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wWhichDungeonWarp], a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wd72d]
|
2014-05-18 18:19:10 +00:00
|
|
|
bit 4, a
|
|
|
|
ret nz
|
|
|
|
call ArePlayerCoordsInArray
|
|
|
|
ret nc
|
2015-07-19 03:49:52 +00:00
|
|
|
ld a, [wCoordIndex]
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wWhichDungeonWarp], a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl, wd72d
|
2014-05-18 18:19:10 +00:00
|
|
|
set 4, [hl]
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl, wd732
|
2014-05-18 18:19:10 +00:00
|
|
|
set 4, [hl]
|
|
|
|
ret
|
|
|
|
|
2020-06-27 19:32:24 +00:00
|
|
|
Mansion3Script_Switches::
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wSpriteStateData1 + 9]
|
2015-07-04 05:44:12 +00:00
|
|
|
cp SPRITE_FACING_UP
|
2014-05-18 18:19:10 +00:00
|
|
|
ret nz
|
|
|
|
xor a
|
2014-05-25 17:51:53 +00:00
|
|
|
ld [hJoyHeld], a
|
2014-05-18 18:19:10 +00:00
|
|
|
ld a, $6
|
2015-07-18 15:17:29 +00:00
|
|
|
ld [hSpriteIndexOrTextID], a
|
2014-05-18 18:19:10 +00:00
|
|
|
jp DisplayTextID
|
|
|
|
|
2019-01-01 20:06:23 +00:00
|
|
|
PokemonMansion3F_TextPointers:
|
2014-05-18 18:19:10 +00:00
|
|
|
dw Mansion3Text1
|
|
|
|
dw Mansion3Text2
|
2015-07-18 15:17:29 +00:00
|
|
|
dw PickUpItemText
|
|
|
|
dw PickUpItemText
|
2014-05-18 18:19:10 +00:00
|
|
|
dw Mansion3Text5
|
|
|
|
dw Mansion3Text6
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3TrainerHeader0:
|
2015-07-21 01:32:02 +00:00
|
|
|
dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_0
|
2014-05-18 18:19:10 +00:00
|
|
|
db ($0 << 4) ; trainer's view range
|
2015-07-21 01:32:02 +00:00
|
|
|
dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_0
|
2015-07-03 19:38:12 +00:00
|
|
|
dw Mansion3BattleText1 ; TextBeforeBattle
|
|
|
|
dw Mansion3AfterBattleText1 ; TextAfterBattle
|
|
|
|
dw Mansion3EndBattleText1 ; TextEndBattle
|
|
|
|
dw Mansion3EndBattleText1 ; TextEndBattle
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-07-20 05:40:04 +00:00
|
|
|
Mansion3TrainerHeader1:
|
|
|
|
dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_1
|
2014-05-18 18:19:10 +00:00
|
|
|
db ($2 << 4) ; trainer's view range
|
2016-07-20 05:40:04 +00:00
|
|
|
dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_1
|
2015-07-03 19:38:12 +00:00
|
|
|
dw Mansion3BattleText2 ; TextBeforeBattle
|
|
|
|
dw Mansion3AfterBattleText2 ; TextAfterBattle
|
|
|
|
dw Mansion3EndBattleText2 ; TextEndBattle
|
|
|
|
dw Mansion3EndBattleText2 ; TextEndBattle
|
2014-05-18 18:19:10 +00:00
|
|
|
|
|
|
|
db $ff
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3Text1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2014-05-18 18:19:10 +00:00
|
|
|
ld hl, Mansion3TrainerHeader0
|
|
|
|
call TalkToTrainer
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3Text2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_asm
|
2016-07-20 05:40:04 +00:00
|
|
|
ld hl, Mansion3TrainerHeader1
|
2014-05-18 18:19:10 +00:00
|
|
|
call TalkToTrainer
|
|
|
|
jp TextScriptEnd
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3BattleText1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _Mansion3BattleText1
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3EndBattleText1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _Mansion3EndBattleText1
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3AfterBattleText1:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _Mansion3AfterBattleText1
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3BattleText2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _Mansion3BattleText2
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3EndBattleText2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _Mansion3EndBattleText2
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3AfterBattleText2:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _Mansion3AfterBattleText2
|
|
|
|
text_end
|
2014-05-18 18:19:10 +00:00
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
Mansion3Text5:
|
2020-07-04 21:09:35 +00:00
|
|
|
text_far _Mansion3Text5
|
|
|
|
text_end
|