Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // I'll add ability modifiers in a different plugin.
- Object.defineProperty(Game_Actor.prototype, "ac", {
- get: function() {
- let ac = 10;
- let bonus = 0;
- for(let i = 0; i < this.armors.length; i++) {
- let armor = this.armors[i];
- // If armor is in the body slot.
- if (armor.etypeId === 4) {
- ac = armor.meta.ac || ac;
- } else {
- bonus += armor.meta.ac || 0;
- }
- }
- return ac - bonus;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement