pokefirered/data/scripts/field_moves.inc

380 lines
9.2 KiB
PHP

EventScript_CutTree::
goto_if_questlog EventScript_ReleaseEnd
lockall
checkfieldmoveusable FIELD_MOVE_CUT
goto_if_eq VAR_RESULT, FALSE, EventScript_CantCutTree
msgbox Text_CutTreeDown, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, EventScript_DontCutTree
msgbox Text_MonUsedMove
closemessage
EventScript_CutTreeCommon:
isfollowerfieldmoveuser VAR_0x8004
setfieldeffectargument 3, VAR_0x8004 @ skip pose if so
dofieldeffect FLDEFF_USE_CUT_ON_TREE
waitstate
EventScript_CutTreeDown:: @ fallthrough
setflag FLAG_SAFE_FOLLOWER_MOVEMENT
call_if_eq VAR_0x8004, TRUE, EventScript_FollowerFieldMove
applymovement VAR_LAST_TALKED, Movement_CutTreeDown
waitmovement 0
removeobject VAR_LAST_TALKED
releaseall
end
@ Use cut from party menu
EventScript_FldEffCut::
lockall
goto EventScript_CutTreeCommon
Movement_CutTreeDown::
cut_tree
step_end
EventScript_CantCutTree::
msgbox Text_TreeCanBeCutDown, MSGBOX_SIGN
releaseall
end
EventScript_DontCutTree::
closemessage
releaseall
end
Text_CutTreeDown::
.string "This tree looks like it can be CUT\n"
.string "down!\p"
.string "Would you like to CUT it?$"
Text_MonUsedMove::
.string "{STR_VAR_1} used {STR_VAR_2}!$"
Text_TreeCanBeCutDown::
.string "This tree looks like it can be CUT\n"
.string "down!$"
@ Use rock smash from party menu
EventScript_FldEffRockSmash::
lockall
goto EventScript_RockSmashCommon
EventScript_RockSmash::
goto_if_questlog EventScript_ReleaseEnd
lockall
checkfieldmoveusable FIELD_MOVE_ROCK_SMASH
goto_if_eq VAR_RESULT, FALSE, EventScript_CantSmashRock
msgbox Text_UseRockSmash, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, EventScript_DontSmashRock
msgbox Text_MonUsedMove
closemessage
EventScript_RockSmashCommon:
@ check if follower should use the field move
isfollowerfieldmoveuser VAR_0x8004
setfieldeffectargument 3, VAR_0x8004 @ skip pose if so
dofieldeffect FLDEFF_USE_ROCK_SMASH
waitstate
EventScript_SmashRock:: @ fallthrough
setflag FLAG_SAFE_FOLLOWER_MOVEMENT
call_if_eq VAR_0x8004, TRUE, EventScript_FollowerFieldMove
applymovement VAR_LAST_TALKED, Movement_BreakRock
waitmovement 0
removeobject VAR_LAST_TALKED
special RockSmashWildEncounter
goto_if_eq VAR_RESULT, FALSE, EventScript_RockSmashNoEncounter
waitstate
releaseall
end
EventScript_FollowerFieldMove:
getdirectiontoface VAR_0x8005, OBJ_EVENT_ID_FOLLOWER, OBJ_EVENT_ID_PLAYER
specialvar VAR_0x8006, GetPlayerFacingDirection
goto_if_eq VAR_0x8005, DIR_NONE, EventScript_FollowerFieldMoveEnd
@ Swap follower and player
call EventScript_FollowerSwap
@ Face follower in direction and jump
switch VAR_0x8006
case DIR_NORTH, EventScript_FollowerJumpNorth
case DIR_EAST, EventScript_FollowerJumpEast
case DIR_SOUTH, EventScript_FollowerJumpSouth
case DIR_WEST, EventScript_FollowerJumpWest
EventScript_FollowerFieldMoveEnd:
return
EventScript_FollowerSwap:
switch VAR_0x8005
case DIR_NORTH, EventScript_FollowerMoveNorth
case DIR_EAST, EventScript_FollowerMoveEast
case DIR_SOUTH, EventScript_FollowerMoveSouth
case DIR_WEST, EventScript_FollowerMoveWest
return
EventScript_FollowerMoveNorth:
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_WalkUp
applymovement OBJ_EVENT_ID_PLAYER, Movement_WalkDown
waitmovement 0
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceUp
waitmovement 0
return
EventScript_FollowerMoveEast:
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_WalkRight
applymovement OBJ_EVENT_ID_PLAYER, Movement_WalkLeft
waitmovement 0
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceRight
waitmovement 0
return
EventScript_FollowerMoveSouth:
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_WalkDown
applymovement OBJ_EVENT_ID_PLAYER, Movement_WalkUp
waitmovement 0
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceDown
waitmovement 0
return
EventScript_FollowerMoveWest:
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_WalkLeft
applymovement OBJ_EVENT_ID_PLAYER, Movement_WalkRight
waitmovement 0
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_FaceLeft
waitmovement 0
return
EventScript_FollowerJumpNorth:
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_JumpUp
waitmovement 0
return
EventScript_FollowerJumpEast:
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_JumpRight
waitmovement 0
return
EventScript_FollowerJumpSouth:
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_JumpDown
waitmovement 0
return
EventScript_FollowerJumpWest:
applymovement OBJ_EVENT_ID_FOLLOWER, Movement_JumpLeft
waitmovement 0
return
EventScript_RockSmashNoEncounter::
releaseall
end
Movement_WalkUp:
walk_up
step_end
Movement_JumpUp:
jump_in_place_up
step_end
Movement_WalkRight:
walk_right
step_end
Movement_JumpRight:
jump_in_place_right
step_end
Movement_WalkDown:
walk_down
step_end
Movement_JumpDown:
jump_in_place_down
step_end
Movement_WalkLeft:
walk_left
step_end
Movement_JumpLeft:
jump_in_place_left
step_end
Movement_BreakRock::
rock_smash_break
step_end
EventScript_CantSmashRock::
msgbox Text_MonMaySmashRock, MSGBOX_SIGN
end
EventScript_DontSmashRock::
closemessage
releaseall
end
Text_UseRockSmash::
.string "This rock appears to be breakable.\n"
.string "Would you like to use ROCK SMASH?$"
Text_MonMaySmashRock::
.string "It's a rugged rock, but a POKéMON\n"
.string "may be able to smash it.$"
EventScript_StrengthBoulder::
goto_if_questlog EventScript_ReleaseEnd
lockall
goto_if_set FLAG_SYS_USE_STRENGTH, EventScript_AlreadyUsedStrength
checkfieldmoveusable FIELD_MOVE_STRENGTH
goto_if_eq VAR_RESULT, FALSE, EventScript_CantMoveBoulder
msgbox Text_UseStrength, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, EventScript_DontUseStrength
closemessage
dofieldeffect FLDEFF_USE_STRENGTH
waitstate
goto EventScript_UseStrength
end
EventScript_FldEffStrength::
lockall
dofieldeffect FLDEFF_USE_STRENGTH
waitstate
goto EventScript_UseStrength
end
EventScript_UseStrength::
setflag FLAG_SYS_USE_STRENGTH
msgbox Text_MonUsedStrengthCanMoveBoulders, MSGBOX_SIGN
end
EventScript_CantMoveBoulder::
msgbox Text_MonMayPushBoulder, MSGBOX_SIGN
end
EventScript_AlreadyUsedStrength::
msgbox Text_StrengthMadeMovingBouldersPossible, MSGBOX_SIGN
end
EventScript_DontUseStrength::
closemessage
releaseall
end
Text_UseStrength::
.string "It's a big boulder, but a POKéMON\n"
.string "may be able to push it aside.\p"
.string "Would you like to use STRENGTH?$"
Text_MonUsedStrengthCanMoveBoulders::
.string "{STR_VAR_1} used STRENGTH!\p"
.string "{STR_VAR_1}'s STRENGTH made it\n"
.string "possible to move boulders around!$"
Text_MonMayPushBoulder::
.string "It's a big boulder, but a POKéMON\n"
.string "may be able to push it aside.$"
Text_StrengthMadeMovingBouldersPossible::
.string "STRENGTH made it possible to move\n"
.string "boulders around.$"
EventScript_Waterfall::
goto_if_questlog EventScript_ReleaseEnd
lockall
checkfieldmoveusable FIELD_MOVE_WATERFALL
goto_if_eq VAR_RESULT, FALSE, EventScript_WaterCrashingDown
msgbox Text_UseWaterfall, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, EventScript_EndWaterfall
msgbox Text_MonUsedWaterfall
dofieldeffect FLDEFF_USE_WATERFALL
goto EventScript_EndWaterfall
EventScript_CantUseWaterfall::
lockall
EventScript_WaterCrashingDown:
msgbox Text_WallOfWaterCrashingDown
EventScript_EndWaterfall:
releaseall
end
Text_WallOfWaterCrashingDown::
.string "A wall of water is crashing down\n"
.string "with a mighty roar.$"
Text_UseWaterfall::
.string "It's a large waterfall.\n"
.string "Would you like to use WATERFALL?$"
Text_MonUsedWaterfall::
.string "{STR_VAR_1} used WATERFALL.$"
@ Unused leftover from R/S
EventScript_DeepWater::
lockall
checkfieldmoveusable FIELD_MOVE_DIVE
goto_if_eq VAR_RESULT, FALSE, EventScript_MayGoUnderwater
setfieldeffectargument 1, 1
msgbox Text_SeaIsDeepUseDive, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, EventScript_EndDive
msgbox Text_MonUsedDive
dofieldeffect FLDEFF_USE_DIVE
goto EventScript_EndDive
EventScript_CantDive::
lockall
EventScript_MayGoUnderwater:
msgbox Text_MonMayGoUnderwater
EventScript_EndDive:
releaseall
end
EventScript_TrySurface::
lockall
checkfieldmoveusable FIELD_MOVE_DIVE
goto_if_eq VAR_RESULT, PARTY_SIZE, EventScript_CantSurface
setfieldeffectargument 1, 1
msgbox Text_LightFilteringUseDive, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, EventScript_EndSurface
msgbox Text_MonUsedDive
dofieldeffect FLDEFF_USE_DIVE
goto EventScript_EndSurface
EventScript_CantSurface::
lockall
msgbox Text_MonMaySurface
goto EventScript_EndSurface
EventScript_ObstacleCantSurface::
lockall
msgbox Text_DiveCantBeUsedHere
EventScript_EndSurface:
releaseall
end
Text_MonMayGoUnderwater::
.string "The sea is deep here. A POKéMON\n"
.string "may be able to go underwater.$"
Text_SeaIsDeepUseDive::
.string "The sea is deep here.\n"
.string "Would you like to use DIVE?$"
Text_MonUsedDive::
.string "{STR_VAR_1} used DIVE.$"
Text_MonMaySurface::
.string "Light is filtering down from above.\n"
.string "A POKéMON may be able to surface.$"
Text_LightFilteringUseDive::
.string "Light is filtering down from above.\n"
.string "Would you like to use DIVE?$"
Text_DiveCantBeUsedHere::
.string "There is an obstacle above.\n"
.string "DIVE can't be used here.$"
EventScript_FailSweetScent::
msgbox Text_LooksLikeNothingHere, MSGBOX_SIGN
end
Text_LooksLikeNothingHere::
.string "Looks like there's nothing here…$"