Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Make sure to tag skills with <hit> to make them unmissable!
- //Also note that this should be placed above all other plugins to reduce the chance for compatibility issues.
- Game_Action.prototype.apply = function(target) {
- var result = target.result();
- this.subject().clearResult();
- result.clear();
- result.used = this.testApply(target);
- if (!this.item().meta.hit) {
- result.missed = (result.used && Math.random() >= this.itemHit(target));
- result.evaded = (!result.missed && Math.random() < this.itemEva(target));
- }
- result.physical = this.isPhysical();
- result.drain = this.isDrain();
- if (result.isHit()) {
- if (this.item().damage.type > 0) {
- result.critical = (Math.random() < this.itemCri(target));
- var value = this.makeDamageValue(target, result.critical);
- this.executeDamage(target, value);
- }
- this.item().effects.forEach(function(effect) {
- this.applyItemEffect(target, effect);
- }, this);
- this.applyItemUserEffect(target);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement