(Yanfly Plugins) State add another state on attack?

Servidion

Last Soul Keeper
Veteran
Joined
Mar 15, 2015
Messages
233
Reaction score
27
First Language
English
Primarily Uses
RMMV
I'm not sure how to build a state like this, but here's the description:

Passive State - Berserker
Any physical attacks/skills you deal have a 10% chance to apply the "Enrage" state to your character.

Thank you for your time!
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
On it. I'll post an answer soon enough
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
Assuming you use Yanfly's buffs and states plugin

Code:
<custom respond effect>
//Replace enrageId with whatever state ID you wanna add
enrageId = x
if (value > 0){
    randNo = Math.random();
    //If you wanna change the percentage 1.0 is 100%, 0.01 is 1%, 0.5 is 50%, etc.
    if (randNo < 0.1){
    user.addState(enrageId);
    }
}
</custom respond effect>
This should work, take note of what the lines say after the "//" as they're intructions
 

shockra

Slightly Crazy Programmer
Veteran
Joined
Feb 16, 2016
Messages
444
Reaction score
208
First Language
English
Primarily Uses
RMMV
That's good, but not quite correct. It should look like this, I think:

<custom establish effect>
//Replace enrageId with whatever state ID you wanna add
enrageId = x
if (value > 0 && this.isPhysical() && this.isHpEffect()){
randNo = Math.random();
//If you wanna change the percentage 1.0 is 100%, 0.01 is 1%, 0.5 is 50%, etc.
if (randNo < 0.1){
user.addState(enrageId);
}
}
</custom establish effect>

First, the effect should be Establish, not Respond. Respond occurs when an enemy attacks the target with the state. Establish occurs when the attacker HAS the state.

Next, to ensure that the effect doesn't trigger off a magic effect, I added this.isPhysical() and this.isHpEffect() to the conditions. Since the effect is only triggered by physical attacks, leaving out this.isPhysical() allows a magical attack to trigger it as well. The HpEffect line checks if the effect alters the HP of the target. You may not need that part, depending on the exact conditions of the Berserk effect, but it's there if you need it.
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
Ah, I misread the OP and thought they were going for a gets angry when hurt kinda thing. Thanks for having more scrutinous eyes than I
 

Servidion

Last Soul Keeper
Veteran
Joined
Mar 15, 2015
Messages
233
Reaction score
27
First Language
English
Primarily Uses
RMMV
@shockra and @Fugama Thank you very much for that! That helps me a great deal with a variety of skills. I also had not realized what <custom establish effect> really meant.
@Fugama I will likely add that into my Berserker state, as well. Although I was referring to the state being added when the actor attacks, I like the idea of it being added when damaged as well.

Thank you both very much!
~Serv
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top