| 1958 | } |
| 1959 | |
| 1960 | Scene_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 | |
| 2002 | static int AdjustPoseForDirection(const Game_Battler* battler, int pose) { |
| 2003 | if (battler->IsDirectionFlipped()) { |
nothing calls this directly
no test coverage detected