Rules: Editing the Player

Section 2.D

These are rules that can be used to temporarily edit attributes of the player, their party or their inventory for the duration of this battle.

"tempPlayer"

You can use this rule to change the player's name and/or appearance for this battle, and revert back to normal afterwards. For example, you can use this to disguise the player as a different character for a capture tutorial. This is entered as setBattleRule("tempPlayer", Attributes), where "Attributes" can be either a String, Integer, or an Array which contains both a string and an integer. The string entered here will be used as the player's new temporary name for this battle. If an integer is entered, this will change the player's outfit to whichever outfit number is set here.

"tempParty"

You can use this rule to give the player a temporary party that will replace their normal party for this battle, and revert back to their normal party afterwards. This is entered as setBattleRule("tempParty", Array), where "Array" is an array that contains a number of Pokemon objects, or species ID's and levels. For example, [:PIKACHU, 20, :MEOWTH, 15] will give the player a temporary party consisting of a level 20 Pikachu and a level 15 Meowth. If you want to edit specific values on the temporary Pokemon the player should have, then you can first create a Pokemon object yourself with something like:

pkmn = Pokemon.new(:PIKACHU, 20)

Then you may edit its values from there. Once the Pokemon is edited to your liking, you may just enter pkmn in the array for this battle rule instead of a species ID and level.

"tempBag"

You can use this rule to give the player a temporary inventory that will replace their normal bag for this battle, and return all of their normal items afterwards. This is entered as setBattleRule("tempBag", Array), where "Array" is an array that contains a number of item ID's and quantities for each item. For example, [:POTION, 5, :ANTIDOTE, 2] will give the player a temporary bag consisting of only 5 Potions and 2 Antidotes. If no quantity is entered after an item ID, the quantity will always assumed to be 1. So for example, if you set this to something like [:POKEBALL, 5, :QUICKBALL, :DUSKBALL], then the player's temporary bag will consist of 5 Poke Balls, 1 Quick Ball and 1 Dusk Ball.

Last updated