Skip to content

Commit

Permalink
Added a forced flag to the end-battle flags
Browse files Browse the repository at this point in the history
Again, useful for the battle factory.
  • Loading branch information
varkor committed Jan 10, 2016
1 parent 7019e64 commit 5948268
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions battle/scripts/objects/general/BattleContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,9 @@ function BattleContext (client) {
"escape" [the allies escaped from a wild battle]
"illegal battle" [the trainers did not have Pokémon matching the battle requirements]
*/
if (!battleContext.endingFlags.hasOwnProperty("forced")) {
battleContext.endingFlags.forced = false;
}
battleContext.callback(battleContext.endingFlags, stored);
}
battleContext.notifyDelegates("battleIsEnding");
Expand Down
3 changes: 2 additions & 1 deletion battle/scripts/objects/unique/Supervisor.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ Supervisor = {
alliedVictory = false;
}
process.battle.end({
"outcome" : alliedVictory === null ? "draw" : (alliedVictory === true ? "allied victory" : (alliedVictory === false ? "opposing victory" : "termination"))
"outcome" : alliedVictory === null ? "draw" : (alliedVictory === true ? "allied victory" : (alliedVictory === false ? "opposing victory" : "termination")),
"forced" : true
}, true);
foreach(process.parties, function (party) {
Supervisor.send(party, "force", data, identifier);
Expand Down

0 comments on commit 5948268

Please sign in to comment.