RMMV Help with passive skills like in pokemon: flame body and gooey. Are affecting the allies too

NotAHero

Villager
Member
Joined
Mar 27, 2018
Messages
14
Reaction score
0
First Language
Portuguese - BR
Primarily Uses
RMMV
As in pokémon I would like to apply skills that exist in the game, however, I am having problems with the formulas to execute 3 types of states that will be executed practically in the same way, and will only have some small changes in the formula. The effects work, but as soon as an ally tries to use the buff, healing, or other support ability on the character with these states, the ally also receives the effects of these passive abilities, so I'm just looking for help to fix the formula so that it applies the effects correctly on enemies.

These will be passive skills, where I use the plugin: Auto Passive States (YEP).

Passive States:

STICKY: if there is physical damage, it slows down the enemy (30%)
FLAMING BODY: if there is physical damage, it burns the enemy (30%)
BRAND OF THE WITCH: if there is physical damage (20%), magic damage (10%), curses the enemy.

---------------------------------------------
The formulas I'm using:

<Custom Respond Effect>

if (target.isStateAffected (96) && Math.random () <0.3) {

user.addState (15);}

</ Custom Respond Effect>
-----------------------------------------------

What I tried:

<Custom Respond Effect>

if (target.isStateAffected (196) && this.isMagical () && Math.random () <0.3) {

user.addState (15);}

</ Custom Respond Effect>
 

stramin

Veteran
Veteran
Joined
Nov 4, 2012
Messages
287
Reaction score
135
First Language
spanish
Primarily Uses
N/A
I didn't test this, but I think will solve your problem:

Code:
if(target.isStateAffected (196) && user.isActor()==target.isEnemy() && Math.random()<0.3){
    user.addState (15);
}

Explanation:

this condition will be true only when:
  • the user is actor and the target is enemy (true==true)
  • the user is enemy and the target is actor (false==false)
And will fail when the user and target are in the same team, this way even an enemy affected by "Flamming body" could also burn an actor in the party :kaojoy:
 

NotAHero

Villager
Member
Joined
Mar 27, 2018
Messages
14
Reaction score
0
First Language
Portuguese - BR
Primarily Uses
RMMV
Thank you very much, it worked very well. Even making the additions to check physical or magic damage, it kept working perfectly :LZSsmile:

Code:
<Custom Respond Effect>

if(target.isStateAffected (196) && user.isActor()==target.isEnemy()
&& this.isPhsysical && Math.random() <0.3){
    user.addState (15);
}

</Custom Respond Effect>
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,736
First Language
English
Primarily Uses
RMMV

I've moved this thread to JS Plugin Support. Thank you.

 

Latest Threads

Latest Profile Posts

It's been a while since i posted so here's something i've been working on.
Game_Mockup7_6.png
Engine: RPG Maker VX Ace

I've decided to stop buying candy in supermarket and bulk buy 4.5kg of candy. The disadvantage of that is, now I eat a lot of candy. -_-
Microsoft has consumed Activision Blizzard. Makes me wonder if they're gonna make Blizzard Blizzard again.
HexMozart88 wrote on AphoticAmaranth's profile.
Your profile pic's face is my current mood.

Forum statistics

Threads
118,543
Messages
1,116,813
Members
155,579
Latest member
dignus93
Top