Skip to content

Commit

Permalink
Added a shorthand for creating eggs with full number of egg cycles
Browse files Browse the repository at this point in the history
For example: `new pokemon({ egg: true });`.
  • Loading branch information
varkor committed Feb 29, 2016
1 parent 33e4b82 commit deab539
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions battle/scripts/objects/general/pokemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ function pokemon (data, validate) {
return initialisingRandom.chance(4096);
});
setProperty("egg", null); // Number of egg cycles, or null (for not an egg)
if (self.egg === true) {
self.egg = Pokedex._(self.species)["egg cycles"];
}
setProperty("caught", null);
setProperty("ribbons", []);
setProperty("Pokerus", function () {
Expand Down
2 changes: 2 additions & 0 deletions battle/scripts/processing/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ forevery(Types, function (effectivenesses, type) {
forevery(Pokedex, function (poke, name) {
if (!poke.hasOwnProperty("preevolutions"))
poke.preevolutions = [];
if (!poke.hasOwnProperty("egg cycles"))
poke["egg cycles"] = 1;
foreach(poke.evolutions, function (evo) {
var into = Pokedex._(evo.species);
if (!into.hasOwnProperty("preevolutions"))
Expand Down

0 comments on commit deab539

Please sign in to comment.