| 815 | } |
| 816 | |
| 817 | void ScriptExt::SkipNextAction(TeamClass* pTeam, int successPercentage) |
| 818 | { |
| 819 | if (successPercentage < 0 || successPercentage > 100) |
| 820 | successPercentage = pTeam->CurrentScript->Type->ScriptActions[pTeam->CurrentScript->CurrentMission].Argument; |
| 821 | |
| 822 | if (successPercentage < 0) |
| 823 | successPercentage = 0; |
| 824 | |
| 825 | if (successPercentage > 100) |
| 826 | successPercentage = 100; |
| 827 | |
| 828 | int percentage = ScenarioClass::Instance->Random.RandomRanged(1, 100); |
| 829 | |
| 830 | if (percentage <= successPercentage) |
| 831 | { |
| 832 | ScriptExt::Log("AI Scripts - SkipNextAction: [%s] [%s] (line: %d = %d,%d) Next script line skipped successfuly. Next line will be: %d = %d,%d\n", |
| 833 | pTeam->Type->ID, pTeam->CurrentScript->Type->ID, pTeam->CurrentScript->CurrentMission, pTeam->CurrentScript->Type->ScriptActions[pTeam->CurrentScript->CurrentMission].Action, pTeam->CurrentScript->Type->ScriptActions[pTeam->CurrentScript->CurrentMission].Argument, pTeam->CurrentScript->CurrentMission + 2, |
| 834 | pTeam->CurrentScript->Type->ScriptActions[pTeam->CurrentScript->CurrentMission + 2].Action, pTeam->CurrentScript->Type->ScriptActions[pTeam->CurrentScript->CurrentMission + 2].Argument); |
| 835 | |
| 836 | pTeam->CurrentScript->CurrentMission++; |
| 837 | } |
| 838 | |
| 839 | // This action finished |
| 840 | pTeam->StepCompleted = true; |
| 841 | } |
| 842 | |
| 843 | void ScriptExt::VariablesHandler(TeamClass* pTeam, PhobosScripts eAction, int nArg) |
| 844 | { |
nothing calls this directly
no outgoing calls
no test coverage detected