[MZ] Base function handling actor's parmas update from equipment.
Hello everyone.
I'm writing a plugin and need to change the standard behaviour of when an item is equipped (in particular an armor).
I didn't have much luck figuring out how to achieve this.
My base idea is to find what function handles this aspect, overwrite it with just the addition of a check (prob something along the line
Thanks in advance for any help.
Hello everyone.
I'm writing a plugin and need to change the standard behaviour of when an item is equipped (in particular an armor).
I didn't have much luck figuring out how to achieve this.
My base idea is to find what function handles this aspect, overwrite it with just the addition of a check (prob something along the line
item.isArmor() or item.etype == 2) in order to do my custom calculation of bonus given by the item.I'm creating a plugin that overhaul the base system with a modded version (from my very own homebrew campaign) of the D&D 5e one.
In this particular case, I'm working over AC (def) calculation based on the Actor dex modifier (base def) and the armor type (light/medium/heavy). Basically, in D&D based on the armor category you either add you modifier, add it up to 2 or not add it at all.
I'd like to express this when the Actor equips a new armor. The idea is to reduce the bonus based on the armor type, something along the line of:
(where
In this particular case, I'm working over AC (def) calculation based on the Actor dex modifier (base def) and the armor type (light/medium/heavy). Basically, in D&D based on the armor category you either add you modifier, add it up to 2 or not add it at all.
I'd like to express this when the Actor equips a new armor. The idea is to reduce the bonus based on the armor type, something along the line of:
JavaScript:
param -= (this.def * (item.atype == 3)) // Remove all dex bonus if Heavy Armor
- (Math.max(this.def-2, 0) * (item.atype == 2)); // If it's medium armor should add only 2 dex bonus
(where
this is supposedly the Game_Actor entity)Thanks in advance for any help.