Advertisement
dsiver144

ArmorTP

Feb 4th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=====================================================================================
  2. // ArmorTP.js
  3. //=====================================================================================
  4. /*:
  5. * @plugindesc Set Actor TP from Armor
  6. * @help Armor Notetag:
  7. * <startTp:x> where x is value of tp gained when battle starts.
  8. * @author dsiver144
  9. */
  10. (function(){
  11.     var alias_Game_Battler_onBattleStart = Game_Battler.prototype.onBattleStart
  12.     // alias method: onBattleStart
  13.     Game_Actor.prototype.onBattleStart = function() {
  14.         alias_Game_Battler_onBattleStart.call(this);
  15.         this.setArmorTP();
  16.     };
  17.     // new method: Set Begin Armor TP
  18.     Game_Actor.prototype.setArmorTP = function() {
  19.         for (var i = 0; i < this.armors().length; i++) {
  20.             armor = this.armors()[i];
  21.             if (armor && armor.meta.startTp) {
  22.                 this.setTp(Number(armor.meta.startTp));
  23.             }
  24.         }
  25.     };
  26. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement