Advertisement
Guest User

Still Broken

a guest
Aug 19th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // I'll add ability modifiers in a different plugin.
  2. Object.defineProperty(Game_Actor.prototype, "ac", {
  3.     get: function() {
  4.         let ac = 10;
  5.         let bonus = 0;
  6.         for(let i = 0; i < this.armors.length; i++) {
  7.             let armor = this.armors[i];
  8.             // If armor is in the body slot.
  9.             if (armor.etypeId === 4) {
  10.                 ac = armor.meta.ac || ac;
  11.             } else {
  12.                 bonus += armor.meta.ac || 0;
  13.             }
  14.         }
  15.         return ac - bonus;
  16.     }
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement