- Joined
- Oct 11, 2015
- Messages
- 424
- Reaction score
- 171
- First Language
- Dutch
- Primarily Uses
- RMMV
I messed around in the:
Game_Action.prototype.apply()
Game_Action.prototype.applyItemEffect()
// Apply damage to the formula, if not already.if (target.isUndead && (effect.code == Game_Action.EFFECT_RECOVER_HP)){ if (item.damage.formula == '0') item.damage.formula = effect.value2;}
But I can't find the right spot to alias and to reverse recover/damage. I know it's super simple but I just can't find the right spot. I'm sure that this can be done with ~2 alias methods and I know that I'm close but just not close enough.
Game_Action.prototype.apply()
Game_Action.prototype.applyItemEffect()
// Apply damage to the formula, if not already.if (target.isUndead && (effect.code == Game_Action.EFFECT_RECOVER_HP)){ if (item.damage.formula == '0') item.damage.formula = effect.value2;}
Code:
// switch heal to damagevar alias_silv_undead_Game_Action_hasItemAnyValidEffects = Game_Action.prototype.hasItemAnyValidEffects;Game_Action.prototype.hasItemAnyValidEffects = function(target){ var item = this.item(); // JsonEx.makeDeepCopy( // cloning is not required because these items are new objects and are not the database itself. if (target.isUndead && ('invert_for_undead' in item.meta))//target.isStateAffected(Silv.Undead.StateID) // todo: find out why RM deletes my state... { if (item.code == Game_Action.EFFECT_RECOVER_HP) { item.code = Game_Action.HITTYPE_CERTAIN; } } return alias_silv_undead_Game_Action_hasItemAnyValidEffects.apply(this, arguments);;};
Last edited by a moderator:

