Alright, I'm having some issues with the PROTECT / COVER skill.
The character will "cover" a weak ally even when he is being HEALED.
How to negate it?
def check_substitute(target, item)
target.hp < target.mhp / 4 && (!item || !item.certain?)
end
I've though about stating in the def to return if a item of element (3) HEAL.
But would this work? I dont know even how to declare it.
Little hand here?
How to stop PROTECT/COVER on character being healed
● ARCHIVED · READ-ONLY
-
-
All I can tell you is the game pretty much treats all battle 'actions' the same. I've got potions dealing 'painful blows' when they land a critical heal and people 'nullifying the magic' when they try to guard. I remember vaguely there is a spot where it checks for item.recover?.
Eventually I'll dig through and find out where to put the switch, unless someone here can answer it.
For now, I'm just calling them "features". -
I see. I've tried something like:All I can tell you is the game pretty much treats all battle 'actions' the same. I've got potions dealing 'painful blows' when they land a critical heal and people 'nullifying the magic' when they try to guard. I remember vaguely there is a spot where it checks for item.recover?.
Eventually I'll dig through and find out where to put the switch, unless someone here can answer it.
For now, I'm just calling them "features".
def check_substitute(target, item)
target.hp < target.mhp / 4 && (!item || !item.certain?)
return if item.damage.recover? && item.damage.to_hp? && hp < mhp
end
But it throws a error:
undefined local variable or method 'hp' for scene_battle...
Unfortunately I dont know exactly how to comunicate this sistuation for the game. -
This seems like it might be a little involved/complicated, so I'm moving it into its own thread.
-
change the hp on the last line to target.hp...
also that method should return a boolean...
Also, I don't think HP recover and HP damage can coexist on a single item/skill at the same time, so that will probably always be false
Code:def check_substitute(target, item) return false if item.damage.recover? #So that it won't work for recovery target.hp < target.mhp / 4 && (!item || !item.certain?) end -
Yanfly's Core engine has a fix but I think it's this?
Code:class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # alias method: check_substitute #-------------------------------------------------------------------------- alias scene_battle_check_substitute_ace check_substitute def check_substitute(target, item) return false if @subject.actor? == target.actor? return scene_battle_check_substitute_ace(target, item) end -
Works perfectly!change the hp on the last line to target.hp...
also that method should return a boolean...
Also, I don't think HP recover and HP damage can coexist on a single item/skill at the same time, so that will probably always be false
def check_substitute(target, item) return false if item.damage.recover? #So that it won't work for recovery target.hp < target.mhp / 4 && (!item || !item.certain?) end
Thanks!
@Archeiahttp://forums.rpgmakerweb.com/index.php?/user/11-archeia/
Yeah! I'm using VE Engine instead of YEA. That's why I'm having this problem.
But thanks for your help too!
This one is solved! -
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.