MCPcopy Create free account
hub / github.com/EasyRPG/Player / ProcessSceneActionEscape

Method ProcessSceneActionEscape

src/scene_battle_rpg2k3.cpp:1960–2000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1958}
1959
1960Scene_Battle_Rpg2k3::SceneActionReturn Scene_Battle_Rpg2k3::ProcessSceneActionEscape() {
1961 enum SubState {
1962 eBegin,
1963 eFailure,
1964 eSuccess,
1965 };
1966
1967 if (scene_action_substate == eBegin) {
1968 if (previous_state == State_SelectOption || TryEscape()) {
1969 // There is no success text for escape in 2k3, however 2k3 still waits the same as if there was.
1970 Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Escape));
1971 for (auto& actor: Main_Data::game_party->GetActors()) {
1972 auto* sprite = actor->GetActorBattleSprite();
1973 if (sprite) {
1974 sprite->SetAnimationState(Sprite_Actor::AnimationState_WalkingRight);
1975 }
1976 }
1977 running_away = true;
1978 SetSceneActionSubState(eSuccess);
1979 } else {
1980 SetSceneActionSubState(eFailure);
1981 ShowNotification(ToString(lcf::Data::terms.escape_failure));
1982 }
1983 SetWait(10, 30);
1984 return SceneActionReturn::eContinueThisFrame;
1985 }
1986
1987 if (scene_action_substate == eFailure) {
1988 EndNotification();
1989 ReturnToMainBattleState();
1990 return SceneActionReturn::eContinueThisFrame;
1991 }
1992
1993 if (scene_action_substate == eSuccess) {
1994 EndNotification();
1995 EndBattle(BattleResult::Escape);
1996 return SceneActionReturn::eContinueThisFrame;
1997 }
1998
1999 return SceneActionReturn::eWaitTillNextFrame;
2000}
2001
2002static int AdjustPoseForDirection(const Game_Battler* battler, int pose) {
2003 if (battler->IsDirectionFlipped()) {

Callers

nothing calls this directly

Calls 4

SePlayMethod · 0.80
GetActorBattleSpriteMethod · 0.80
SetAnimationStateMethod · 0.80
GetActorsMethod · 0.45

Tested by

no test coverage detected