SC Fúria

Villager
Member
Joined
Feb 19, 2016
Messages
10
Reaction score
2
First Language
Spanish
Primarily Uses
Hi guys!


Today I have another question, I hope it can be resolved!


Currently, I'm using Yanfly Buffs&States Core and the autopassive states plugins to recreate the undead state of Final Fantasy X. The next youtube video shows how to use it in enemies but it can easly done for anything. However, it only works for healing abilities! (which is good, but not thaaaaat good). Healing abilities damages the heroes if they're inflicted with the undead state but, the HP regeneration heals a heroe even if they're undead. So my question is, Can it be possible to make that all types of healings hurts them instead of only abilities?

https://youtu.be/CILbgvxz7DA

PD: I tried modifying the rpg_objects file by changing the Game_Battler.prototype.regenerateHp but i don't know why it doesn't work. The code i placed instead of the default code:


Game_Battler.prototype.regenerateHp = function() {
var value = Math.floor(this.mhp * this.hrg);
value = Math.max(value, -this.maxSlipDamage());
if (this.meetsStateCondition == 48) {
if (value !== 0) {
value = value * -1;
this.gainHp(value);
}
}
else {
if (value !== 0) {
this.gainHp(value);
}
}
};


EDIT: Zombie State ID is 48.
 
Last edited by a moderator:

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,652
Reaction score
437
First Language
Portuguese
Primarily Uses
RMMV
I think you'd have to use a code on your regen state instead of using a trait, so that when a turn passes you gain the hp. Then if you are under Zombie it damages instead.
 

SC Fúria

Villager
Member
Joined
Feb 19, 2016
Messages
10
Reaction score
2
First Language
Spanish
Primarily Uses
Thanks! Finally I got it!

If there's someone who wants the same, all you need to do is place the following code inside the healing state notebox. (Only valid with Yanfly B&S Core). As I said before, in my case the undead state ID is 48. Also, if you want a different healing value just modify it inside parseInt().

Code:
<Custom Turn End Effect>
if (this.isStateAffected(48)) {this.gainHp(parseInt(this.mhp * (-6/100)))} else {this.gainHp(parseInt(this.mhp * (6/100)))}
</Custom Turn End Effect>
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,652
Reaction score
437
First Language
Portuguese
Primarily Uses
RMMV
Why not Custom Regenerate Effect instead of Custom Turn End Effect?
 

SC Fúria

Villager
Member
Joined
Feb 19, 2016
Messages
10
Reaction score
2
First Language
Spanish
Primarily Uses
I'm not a script professional but, if i'm not wrong, Custom Regenerate Effect triggers whenever there's a regeneration (HP, MP or TP) so, basically, it needs a HRG, MRG or TRG xparam value to be activated. As you can see, I haven't used them so it wouldn0t work.
Also I think that Custom Regenerate Effect works after the regeneration it's done, but i'm not sure.

Custom Regenerate Effect>


code


code


</Custom Regenerate Effect>


This effect will run whenever the battler would regenerate HP, MP, or TP.


The code will process after all the other regenerate effects have ran.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,652
Reaction score
437
First Language
Portuguese
Primarily Uses
RMMV
As the text says, would regenerate. I think it means that if there is any usual regen/poison effect it happens then.


I said that because in a code made by Yanfly of a poison that damages based on the attacker's magic attack the damage was made there.
 

SC Fúria

Villager
Member
Joined
Feb 19, 2016
Messages
10
Reaction score
2
First Language
Spanish
Primarily Uses
I supose you are talking about a Tip&Trick Yanfly's video. Do you remember which one is?
 

SC Fúria

Villager
Member
Joined
Feb 19, 2016
Messages
10
Reaction score
2
First Language
Spanish
Primarily Uses
After testing a little bit, I can conclude that it is better using the  Custom Regenerate Effec. Thanks for pointing it out!
 

MattDrummy

Villager
Member
Joined
Nov 11, 2016
Messages
8
Reaction score
1
First Language
English
Primarily Uses
I have a related question to this:

I'm looking to add to this Zombie state by allowing for an "Undeath to Death" skill that specifically kills Undead that I designate, or those who are affected by the Zombie state. The only caveat is that I don't the effect to display as damage. As a bonus, I am using HIME's Placeholder States to test the applying of a specific "Undeath to Death" state that when applied to Undead, applies the ID 1 death state instead.
 

Latest Threads

Latest Posts

Latest Profile Posts

I really need to buy a new mouse. Mine's keeps double-clicking and makes me waste A LOT of time eventing
How come there's no spooktober game jam? I thought horror maker games were some of the most popular genre out there...
"I didn't know X song was about that!" Uh... why? Do you not listen to the lyrics? I mean, I guess that makes sense. We live in a world where nobody listens, but everyone wants to be heard.
Coding class: Python
Game dev work: Javascript
Result: AHHH!!! Writing program for an assignment and having it crash and burn because I used Javascript syntax or format. Or having my game die on me because of a python call :yswt:
Can we make it so whenever a banned user tries to use their account whilst banned, the forum should redirect to this

Forum statistics

Threads
115,835
Messages
1,093,330
Members
151,027
Latest member
Mansfield40matt
Top