ref: 69af99da5e4bcfa9cb90394531e531388f1399eb
parent: ce019e6347435a89fe53037db993049958fc837e
author: PikalaxALT <[email protected]>
date: Wed Jan 6 11:59:56 EST 2016
Mr Pokemons House
--- a/constants/map_setup_constants.asm
+++ b/constants/map_setup_constants.asm
@@ -15,7 +15,7 @@
const_value SET 1
const MAPCALLBACK_TILES
const MAPCALLBACK_OBJECTS
- const MAPCALLBACK_PALETTES
+ const MAPCALLBACK_CMDQUEUE
const MAPCALLBACK_SPRITES
const MAPCALLBACK_NEWMAP
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -577,15 +577,15 @@
; 4040d
Function4040d: ; 4040d (10:440d)
- ld b, $0
+ ld b, DEXMODE_NEW
jr Function40417
Function40411: ; 40411 (10:4411)
- ld b, $1
+ ld b, DEXMODE_OLD
jr Function40417
Function40415: ; 40415 (10:4415)
- ld b, $2
+ ld b, DEXMODE_ABC
Function40417: ; 40417 (10:4417)
ld a, [wCurrentDexMode]
cp b
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -141,7 +141,7 @@
dw Script_stringtotext ; 44
dw Script_itemnotify ; 45
dw Script_pocketisfull ; 46
- dw Script_textbox ; 47
+ dw Script_textbox ; 47
dw Script_refreshscreen ; 48
dw Script_closetext ; 49
dw Script_loadbytec2cf ; 4a
@@ -160,8 +160,8 @@
dw Script_buttonsound ; 55
dw Script_pokepic ; 56
dw Script_closepokepic ; 57
- dw Script__2dmenu ; 58
- dw Script_verticalmenu ; 59
+ dw Script__2dmenu ; 58
+ dw Script_verticalmenu ; 59
dw Script_loadpikachudata ; 5a
dw Script_randomwildmon ; 5b
dw Script_loadmemtrainer ; 5c
@@ -168,7 +168,7 @@
dw Script_loadwildmon ; 5d
dw Script_loadtrainer ; 5e
dw Script_startbattle ; 5f
- dw Script_reloadmapafterbattle ; 60
+ dw Script_reloadmapafterbattle ; 60
dw Script_catchtutorial ; 61
dw Script_trainertext ; 62
dw Script_trainerflagaction ; 63
@@ -203,7 +203,7 @@
dw Script_encountermusic ; 80
dw Script_musicfadeout ; 81
dw Script_playmapmusic ; 82
- dw Script_dontrestartmapmusic ; 83
+ dw Script_dontrestartmapmusic ; 83
dw Script_cry ; 84
dw Script_playsound ; 85
dw Script_waitsfx ; 86
--- a/engine/warp_connection.asm
+++ b/engine/warp_connection.asm
@@ -9,7 +9,7 @@
call RunMapCallback
RunCallback_03: ; 1045c4
callba ClearCmdQueue
- ld a, MAPCALLBACK_PALETTES
+ ld a, MAPCALLBACK_CMDQUEUE
call RunMapCallback
call GetMapHeaderTimeOfDayNybble
ld [wMapTimeOfDay], a
--- a/main.asm
+++ b/main.asm
@@ -383,7 +383,7 @@
StepHappiness:: ; 725a
; Raise the party's happiness by 1 point every other step cycle.
- ld hl, wdc77
+ ld hl, wHappinessStepCount
ld a, [hl]
inc a
and 1
--- a/maps/BlackthornGym2F.asm
+++ b/maps/BlackthornGym2F.asm
@@ -16,7 +16,7 @@
db 1
; callbacks
- dbw MAPCALLBACK_PALETTES, .Boulders
+ dbw MAPCALLBACK_CMDQUEUE, .Boulders
.Boulders
writecmdqueue .BoulderCmdQueue
--- a/maps/BrunosRoom.asm
+++ b/maps/BrunosRoom.asm
@@ -6,8 +6,8 @@
db 2
; triggers
- dw UnknownScript_0x180993, 0
- dw UnknownScript_0x180997, 0
+ dw .Trigger0, 0
+ dw .Trigger1, 0
.MapCallbacks:
db 1
@@ -14,24 +14,24 @@
; callbacks
- dbw MAPCALLBACK_TILES, UnknownScript_0x180998
+ dbw MAPCALLBACK_TILES, .BrunosRoomDoors
-UnknownScript_0x180993:
+.Trigger0
priorityjump UnknownScript_0x1809ad
end
-UnknownScript_0x180997:
+.Trigger1
end
-UnknownScript_0x180998:
+.BrunosRoomDoors:
checkevent EVENT_BRUNOS_ROOM_ENTRANCE_CLOSED
- iffalse UnknownScript_0x1809a2
+ iffalse .KeepDoorClosed
changeblock $4, $e, $2a
-UnknownScript_0x1809a2:
+.KeepDoorClosed
checkevent EVENT_BRUNOS_ROOM_EXIT_OPEN
- iffalse UnknownScript_0x1809ac
+ iffalse .OpenDoor
changeblock $4, $2, $16
-UnknownScript_0x1809ac:
+.OpenDoor
return
UnknownScript_0x1809ad:
--- a/maps/IcePathB1F.asm
+++ b/maps/IcePathB1F.asm
@@ -14,7 +14,7 @@
; callbacks
- dbw MAPCALLBACK_PALETTES, .SetUpStoneTable
+ dbw MAPCALLBACK_CMDQUEUE, .SetUpStoneTable
.SetUpStoneTable:
writecmdqueue .CommandQueue
--- a/maps/MrPokemonsHouse.asm
+++ b/maps/MrPokemonsHouse.asm
@@ -3,105 +3,105 @@
const MRPOKEMONSHOUSE_OAK
MrPokemonsHouse_MapScriptHeader:
-.MapTriggers:
+.MapTriggers
db 2
; triggers
- dw UnknownScript_0x196e51, 0
- dw UnknownScript_0x196e55, 0
+ maptrigger .Trigger0
+ maptrigger .Trigger1
-.MapCallbacks:
+.MapCallbacks
db 0
-UnknownScript_0x196e51:
- priorityjump UnknownScript_0x196e56
+.Trigger0
+ priorityjump .MrPokemonEvent
end
-UnknownScript_0x196e55:
+.Trigger1
end
-UnknownScript_0x196e56:
+.MrPokemonEvent
showemote EMOTE_SHOCK, MRPOKEMONSHOUSE_GENTLEMAN, 15
spriteface MRPOKEMONSHOUSE_GENTLEMAN, DOWN
opentext
- writetext UnknownText_0x196f66
+ writetext MrPokemonIntroText1
waitbutton
closetext
- applymovement PLAYER, MovementData_0x196f5a
+ applymovement PLAYER, MrPokemonsHouse_PlayerWalksToMrPokemon
opentext
- writetext UnknownText_0x196fa8
+ writetext MrPokemonIntroText2
buttonsound
waitsfx
giveitem MYSTERY_EGG
- writetext UnknownText_0x196fd2
+ writetext MrPokemonsHouse_GotEggText
playsound SFX_KEY_ITEM
waitsfx
itemnotify
setevent EVENT_GOT_MYSTERY_EGG_FROM_MR_POKEMON
blackoutmod CHERRYGROVE_CITY
- writetext UnknownText_0x196feb
+ writetext MrPokemonIntroText3
buttonsound
spriteface MRPOKEMONSHOUSE_GENTLEMAN, RIGHT
- writetext UnknownText_0x197092
+ writetext MrPokemonIntroText4
buttonsound
spriteface MRPOKEMONSHOUSE_GENTLEMAN, DOWN
spriteface MRPOKEMONSHOUSE_OAK, LEFT
- writetext UnknownText_0x1970b7
+ writetext MrPokemonIntroText5
waitbutton
closetext
- jump UnknownScript_0x196ec9
+ jump MrPokemonsHouse_OakScript
-GentlemanScript_0x196e97:
+MrPokemonsHouse_MrPokemonScript:
faceplayer
opentext
checkitem RED_SCALE
- iftrue UnknownScript_0x196eb0
+ iftrue .RedScale
checkevent EVENT_GAVE_MYSTERY_EGG_TO_ELM
- iftrue UnknownScript_0x196eaa
- writetext UnknownText_0x197134
+ iftrue .AlwaysNewDiscoveries
+ writetext MrPokemonText_ImDependingOnYou
waitbutton
closetext
end
-UnknownScript_0x196eaa:
- writetext UnknownText_0x19714a
+.AlwaysNewDiscoveries
+ writetext MrPokemonText_AlwaysNewDiscoveries
waitbutton
closetext
end
-UnknownScript_0x196eb0:
- writetext UnknownText_0x197476
+.RedScale
+ writetext MrPokemonText_GimmeTheScale
yesorno
- iffalse UnknownScript_0x196ec3
+ iffalse .refused
verbosegiveitem EXP_SHARE
- iffalse UnknownScript_0x196ec7
+ iffalse .full
takeitem RED_SCALE
- jump UnknownScript_0x196eaa
+ jump .AlwaysNewDiscoveries
-UnknownScript_0x196ec3:
- writetext UnknownText_0x19750d
+.refused
+ writetext MrPokemonText_Disappointed
waitbutton
-UnknownScript_0x196ec7:
+.full
closetext
end
-UnknownScript_0x196ec9:
+MrPokemonsHouse_OakScript:
playmusic MUSIC_PROF_OAK
- applymovement MRPOKEMONSHOUSE_OAK, MovementData_0x196f5d
+ applymovement MRPOKEMONSHOUSE_OAK, MrPokemonsHouse_OakWalksToPlayer
spriteface PLAYER, RIGHT
opentext
- writetext UnknownText_0x197185
+ writetext MrPokemonsHouse_OakText1
buttonsound
waitsfx
- writetext UnknownText_0x1973cc
+ writetext MrPokemonsHouse_GetDexText
playsound SFX_ITEM
waitsfx
setflag ENGINE_POKEDEX
- writetext UnknownText_0x1973de
+ writetext MrPokemonsHouse_OakText2
waitbutton
closetext
spriteface PLAYER, DOWN
- applymovement MRPOKEMONSHOUSE_OAK, MovementData_0x196f61
+ applymovement MRPOKEMONSHOUSE_OAK, MrPokemonsHouse_OakExits
playsound SFX_EXIT_BUILDING
disappear MRPOKEMONSHOUSE_OAK
waitsfx
@@ -109,7 +109,7 @@
pause 15
spriteface PLAYER, UP
opentext
- writetext UnknownText_0x1970ed
+ writetext MrPokemonsHouse_MrPokemonHealText
waitbutton
closetext
special Special_FadeBlackQuickly
@@ -121,7 +121,7 @@
special Special_FadeInQuickly
special RestartMapMusic
opentext
- writetext UnknownText_0x197134
+ writetext MrPokemonText_ImDependingOnYou
waitbutton
closetext
setevent EVENT_RIVAL_NEW_BARK_TOWN
@@ -133,41 +133,41 @@
specialphonecall SPECIALCALL_ROBBED
clearevent EVENT_COP_IN_ELMS_LAB
checkevent EVENT_GOT_TOTODILE_FROM_ELM
- iftrue UnknownScript_0x196f49
+ iftrue .RivalTakesChikorita
checkevent EVENT_GOT_CHIKORITA_FROM_ELM
- iftrue UnknownScript_0x196f4d
+ iftrue .RivalTakesCyndaquil
setevent EVENT_TOTODILE_POKEBALL_IN_ELMS_LAB
end
-UnknownScript_0x196f49:
+.RivalTakesChikorita
setevent EVENT_CHIKORITA_POKEBALL_IN_ELMS_LAB
end
-UnknownScript_0x196f4d:
+.RivalTakesCyndaquil
setevent EVENT_CYNDAQUIL_POKEBALL_IN_ELMS_LAB
end
MapMrPokemonsHouseSignpost1Script:
- jumptext UnknownText_0x197543
+ jumptext MrPokemonsHouse_ForeignMagazinesText
MapMrPokemonsHouseSignpost3Script:
- jumptext UnknownText_0x197584
+ jumptext MrPokemonsHouse_BrokenComputerText
MapMrPokemonsHouseSignpost4Script:
- jumptext UnknownText_0x1975ac
+ jumptext MrPokemonsHouse_StrangeCoinsText
-MovementData_0x196f5a:
+MrPokemonsHouse_PlayerWalksToMrPokemon:
step_right
step_up
step_end
-MovementData_0x196f5d:
+MrPokemonsHouse_OakWalksToPlayer:
step_down
step_left
step_left
step_end
-MovementData_0x196f61:
+MrPokemonsHouse_OakExits:
step_down
step_left
turn_head_down
@@ -174,7 +174,7 @@
db $3f ; movement
step_end
-UnknownText_0x196f66:
+MrPokemonIntroText1:
text "Hello, hello! You"
line "must be <PLAY_G>."
@@ -182,18 +182,18 @@
line "you would visit."
done
-UnknownText_0x196fa8:
+MrPokemonIntroText2:
text "This is what I"
line "want PROF.ELM to"
cont "examine."
done
-UnknownText_0x196fd2:
+MrPokemonsHouse_GotEggText:
text "<PLAYER> received"
line "MYSTERY EGG."
done
-UnknownText_0x196feb:
+MrPokemonIntroText3:
text "I know a couple"
line "who run a #MON"
cont "DAY-CARE service."
@@ -210,18 +210,18 @@
cont "the authority."
done
-UnknownText_0x197092:
+MrPokemonIntroText4:
text "Even PROF.OAK here"
line "recognizes that."
done
-UnknownText_0x1970b7:
+MrPokemonIntroText5:
text "If my assumption"
line "is correct, PROF."
cont "ELM will know it."
done
-UnknownText_0x1970ed:
+MrPokemonsHouse_MrPokemonHealText:
text "You are returning"
line "to PROF.ELM?"
@@ -230,12 +230,12 @@
cont "rest."
done
-UnknownText_0x197134:
+MrPokemonText_ImDependingOnYou:
text "I'm depending on"
line "you!"
done
-UnknownText_0x19714a:
+MrPokemonText_AlwaysNewDiscoveries:
text "Life is delight-"
line "ful! Always, new"
@@ -243,7 +243,7 @@
line "made!"
done
-UnknownText_0x197185:
+MrPokemonsHouse_OakText1:
text "OAK: Aha! So"
line "you're <PLAY_G>!"
@@ -307,12 +307,12 @@
line "encyclopedia!"
done
-UnknownText_0x1973cc:
+MrPokemonsHouse_GetDexText:
text "<PLAYER> received"
line "#DEX!"
done
-UnknownText_0x1973de:
+MrPokemonsHouse_OakText2:
text "Go meet many kinds"
line "of #MON and"
@@ -330,7 +330,7 @@
line "counting on you!"
done
-UnknownText_0x197476:
+MrPokemonText_GimmeTheScale:
text "Hm? That SCALE!"
line "What's that?"
cont "A red GYARADOS?"
@@ -346,13 +346,13 @@
cont "from PROF.OAK."
done
-UnknownText_0x19750d:
+MrPokemonText_Disappointed:
text "That's disappoint-"
line "ing. That happens"
cont "to be very rare."
done
-UnknownText_0x197543:
+MrPokemonsHouse_ForeignMagazinesText:
text "It's packed with"
line "foreign magazines."
@@ -360,13 +360,13 @@
line "their titles…"
done
-UnknownText_0x197584:
+MrPokemonsHouse_BrokenComputerText:
text "It's a big com-"
line "puter. Hmm. It's"
cont "broken."
done
-UnknownText_0x1975ac:
+MrPokemonsHouse_StrangeCoinsText:
text "A whole pile of"
line "strange coins!"
@@ -396,5 +396,5 @@
.PersonEvents:
db 2
- person_event SPRITE_GENTLEMAN, 5, 3, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, GentlemanScript_0x196e97, -1
+ person_event SPRITE_GENTLEMAN, 5, 3, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, MrPokemonsHouse_MrPokemonScript, -1
person_event SPRITE_OAK, 5, 6, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, 0, PERSONTYPE_SCRIPT, 0, ObjectEvent, EVENT_MR_POKEMONS_HOUSE_OAK
--- a/wram.asm
+++ b/wram.asm
@@ -3067,12 +3067,12 @@
ds 1
ds 2
-wdc77:: ds 2
-wdc79::
+wHappinessStepCount:: ds 1
+ ds 1
wParkBallsRemaining::
-wSafariBallsRemaining:: ds 1
-wSafariTimeRemaining:: ds 2
-wPhoneList:: ds CONTACT_LIST_SIZE
+wSafariBallsRemaining:: ds 1 ; dc79
+wSafariTimeRemaining:: ds 2 ; dc7a
+wPhoneList:: ds CONTACT_LIST_SIZE ; dc7c
ds 23
wLuckyNumberShowFlag:: ds 2 ; dc9d
wLuckyIDNumber:: ds 2 ; dc9f