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

 …So I was looking at a question someone had asked and did some related experimentation. Apparently the Jump… movement route command works like the ultimate through. Including letting you move around outside the confines of the map entirely. o_O
Jump.png
Okay so today I heard the dumbest theory I have heard in a loooooooong while. It's so stupid I just have to share... Appearantly I have learned to draw 'hot chicks' so that 'real men' get physically excited by looking at it and I can then swoop in and 'turn' them.... Wow... Just... Amazing how some brains works...
What the writer wrote: "The curtain is blue."
The readers: "There must be a hidden meaning behind this, perhaps to convey the character emotions ...".
What the writer has in mind: "The curtain is frickin' blue".
Time to share something!
hmZFwQe.png

I made these a while ago for my game. I took reference from various huts in Africa.
Have a great night! :D
I really need to buy a new mouse. Mine's keeps double-clicking and makes me waste A LOT of time eventing

Forum statistics

Threads
115,843
Messages
1,093,362
Members
151,034
Latest member
Jubs
Top