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

It does sometimes get a little embarrassing that I often come here to ask for help with something and seldom have anything to actually show for it. If there is one thing though I can commend myself for, it's for sticking with an idea I've been tinkering with for this long now and gradually making headways. Even though I've been reserved about my progress, I can say I'm farther now than where I initially started.
I'm gonna put my project on pause for a tiny bit so I can explore the engine outside of it... Winging it can only get you so far LMFAO
Have seen some of my favorite people here posting and helping others with questions today -- love to see it!
Haven't been on here actively in awhile, project is going strong my biggest issue is the STORY, i'm refining the plot and learning so much i decided to take a writers class to improve even more but the programming and functionality of the game is stepping up nicely!
Hi everyone! Here's what I'm working on today! It's one of the dorms on campus. I know I said I wouldn't use assets but I reused a few things from the cafeteria hehe.
FCuxBOMXMAICK5e

Forum statistics

Threads
116,126
Messages
1,095,984
Members
151,537
Latest member
Anrirck
Top