pokefirered/data/scripts/day_care.inc
2026-03-26 12:33:08 -06:00

182 lines
6.0 KiB
PHP

.set LOCALID_ROUTE5_DAYCAREMAN, 1
Route5_PokemonDayCare_EventScript_DaycareMan::
goto_if_questlog EventScript_ReleaseEnd
lock
faceplayer
specialvar VAR_RESULT, GetDaycareState
goto_if_eq VAR_RESULT, DAYCARE_EGG_WAITING, Route5_PokemonDayCare_EventScript_EggWaiting
goto_if_eq VAR_RESULT, DAYCARE_ONE_MON, Route5_PokemonDayCare_EventScript_OneMonInDaycare
goto_if_eq VAR_RESULT, DAYCARE_TWO_MONS, Route5_PokemonDayCare_EventScript_TwoMonsInDaycare
msgbox Route5_PokemonDayCare_Text_WantMeToRaiseMon, MSGBOX_YESNO
goto_if_eq VAR_RESULT, YES, Route5_PokemonDayCare_EventScript_GiveMonToRaise
msgbox Route5_PokemonDayCare_Text_ComeAgain
release
end
Route5_PokemonDayCare_EventScript_GiveMonToRaise::
specialvar VAR_RESULT, CountPartyNonEggMons
goto_if_eq VAR_RESULT, 1, Route5_PokemonDayCare_EventScript_OnlyOneMonInParty
msgbox Route5_PokemonDayCare_Text_WhichMonShouldIRaise
fadescreen FADE_TO_BLACK
special ChooseSendDaycareMon
waitstate
goto_if_ge VAR_0x8004, PARTY_SIZE, Route5_PokemonDayCare_EventScript_ComeAgain
specialvar VAR_RESULT, CountPartyAliveNonEggMons_IgnoreVar0x8004Slot
goto_if_eq VAR_RESULT, 0, Route5_PokemonDayCare_EventScript_OnlyOneAliveMonInParty
specialvar VAR_0x8005, GetSelectedMonNicknameAndSpecies
waitse
playmoncry VAR_0x8005, CRY_MODE_NORMAL
msgbox Route5_PokemonDayCare_Text_LookAfterMonForAWhile
waitmoncry
special StoreSelectedPokemonInDaycare
incrementgamestat GAME_STAT_USED_DAYCARE
specialvar VAR_RESULT, GetDaycareState
goto_if_eq VAR_RESULT, DAYCARE_ONE_MON, Route5_PokemonDayCare_EventScript_CanRaiseOneMore
release
end
Route5_PokemonDayCare_EventScript_ComeAgain::
msgbox Route5_PokemonDayCare_Text_ComeAgain
release
end
Route5_PokemonDayCare_EventScript_CanRaiseOneMore::
msgbox Route5_PokemonDayCare_Text_CanRaiseOneMore, MSGBOX_YESNO
goto_if_eq VAR_RESULT, YES, Route5_PokemonDayCare_EventScript_GiveMonToRaise
goto Route5_PokemonDayCare_EventScript_ComeAgain
end
Route5_PokemonDayCare_EventScript_OnlyOneMonInParty::
msgbox Route5_PokemonDayCare_Text_OnlyHaveOneMonWithYou
release
end
Route5_PokemonDayCare_EventScript_OnlyOneAliveMonInParty::
msgbox Route5_PokemonDayCare_Text_WhatWillYouBattleWith
release
end
Route5_PokemonDayCare_EventScript_EggWaiting::
msgbox Route5_PokemonDayCare_Text_EggWaiting
release
end
Route5_PokemonDayCare_EventScript_MonHasGrownXLevels::
msgbox Route5_PokemonDayCare_Text_MonHasGrownByXLevels
return
Route5_PokemonDayCare_EventScript_DisplayLevelsGained::
specialvar VAR_RESULT, GetNumLevelsGainedFromDaycare
call_if_ne VAR_RESULT, 0, Route5_PokemonDayCare_EventScript_MonHasGrownXLevels
return
Route5_PokemonDayCare_EventScript_OneMonInDaycare::
msgbox Route5_PokemonDayCare_Text_GoodToSeeYou
setvar VAR_0x8004, 0
call Route5_PokemonDayCare_EventScript_DisplayLevelsGained
msgbox Route5_PokemonDayCare_Text_CanRaiseOneMore, MSGBOX_YESNO
goto_if_eq VAR_RESULT, YES, Route5_PokemonDayCare_EventScript_GiveMonToRaise
msgbox Route5_PokemonDayCare_Text_TakeYourMonBack, MSGBOX_YESNO
goto_if_eq VAR_RESULT, YES, Route5_PokemonDayCare_EventScript_TryRetrieveMon
goto Route5_PokemonDayCare_EventScript_ComeAgain
end
Route5_PokemonDayCare_EventScript_TryRetrieveMon::
specialvar VAR_RESULT, CalculatePlayerPartyCount
goto_if_eq VAR_RESULT, PARTY_SIZE, Route5_PokemonDayCare_EventScript_NoRoomInParty
specialvar VAR_RESULT, GetDaycareState
setvar VAR_0x8004, 0
goto_if_eq VAR_RESULT, DAYCARE_ONE_MON, Route5_PokemonDayCare_EventScript_CostPrompt
special ShowDaycareLevelMenu
waitstate
copyvar VAR_0x8004, VAR_RESULT
goto_if_eq VAR_RESULT, DAYCARE_EXITED_LEVEL_MENU, Route5_PokemonDayCare_EventScript_ComeAgain
goto Route5_PokemonDayCare_EventScript_CostPrompt
end
Route5_PokemonDayCare_EventScript_CostPrompt::
special GetDaycareCost
msgbox Route5_PokemonDayCare_Text_OweMeXForMonsReturn, MSGBOX_YESNO
goto_if_eq VAR_RESULT, YES, Route5_PokemonDayCare_EventScript_CheckEnoughMoney
goto Route5_PokemonDayCare_EventScript_ComeAgain
end
Route5_PokemonDayCare_EventScript_CheckEnoughMoney::
specialvar VAR_RESULT, IsEnoughForCostInVar0x8005
goto_if_eq VAR_RESULT, TRUE, Route5_PokemonDayCare_EventScript_RetrieveMon
msgbox Route5_PokemonDayCare_Text_DontHaveEnoughMoney
release
end
Route5_PokemonDayCare_EventScript_RetrieveMon::
applymovement LOCALID_ROUTE5_DAYCAREMAN, Route5_PokemonDayCare_Movement_RetrieveMon
waitmovement 0
specialvar VAR_RESULT, TakePokemonFromDaycare
special SubtractMoneyFromVar0x8005
playse SE_RS_SHOP
msgbox Route5_PokemonDayCare_Text_ThankYouHeresMon
waitse
playmoncry VAR_RESULT, CRY_MODE_NORMAL
textcolor NPC_TEXT_COLOR_NEUTRAL
msgbox Route5_PokemonDayCare_Text_PlayerGotMonBack
call EventScript_RestorePrevTextColor
waitmoncry
specialvar VAR_RESULT, GetDaycareState
goto_if_eq VAR_RESULT, DAYCARE_ONE_MON, Route5_PokemonDayCare_EventScript_AskRetrieveOther
goto Route5_PokemonDayCare_EventScript_ComeAgain
end
Route5_PokemonDayCare_EventScript_AskRetrieveOther::
msgbox Route5_PokemonDayCare_Text_TakeOtherOneBackToo, MSGBOX_YESNO
goto_if_eq VAR_RESULT, YES, Route5_PokemonDayCare_EventScript_TryRetrieveMon
goto Route5_PokemonDayCare_EventScript_ComeAgain
end
Route5_PokemonDayCare_EventScript_NoRoomInParty::
msgbox Route5_PokemonDayCare_Text_YouveGotNoRoomForIt
release
end
Route5_PokemonDayCare_EventScript_TwoMonsInDaycare::
msgbox Route5_PokemonDayCare_Text_GoodToSeeYou
setvar VAR_0x8004, 0
call Route5_PokemonDayCare_EventScript_DisplayLevelsGained
setvar VAR_0x8004, 1
call Route5_PokemonDayCare_EventScript_DisplayLevelsGained
msgbox Route5_PokemonDayCare_Text_TakeYourMonBack, MSGBOX_YESNO
goto_if_eq VAR_RESULT, YES, Route5_PokemonDayCare_EventScript_TryRetrieveMon
msgbox Route5_PokemonDayCare_Text_ComeAgain
release
end
Route5_PokemonDayCare_Movement_RetrieveMon::
delay_16
delay_16
face_right
delay_16
delay_16
face_left
delay_16
delay_16
face_up
walk_slower_up
set_invisible
delay_16
delay_16
delay_16
delay_16
delay_16
face_down
set_visible
walk_slower_down
step_end
EventScript_EggHatch::
lockall
msgbox DayCare_Text_Huh
special EggHatch
waitstate
releaseall
end