State that applies effects to enemy upon inflicted target being attacked

Youhadabadday

Villager
Member
Joined
Nov 10, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm having trouble with RPG Maker MV regarding a specific type of attack: I want to make a skill that inflicts a status effect onto an ally, and if an enemy attacks an ally with the status effect on them, the status effect is removed, and the enemy that attacked them will be affected with debuffs. How do I do it?
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
Edit: Sorry wrong info
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
What was the info? I saw your reply after I got back from being AFK.
"First set the state to be removed when damage is taken. Then use the plugin and info from here to set up the rest."

I misread your issue and jumped the gun. Unless you want the player to inflict a negative effect on themselves first then the enemy that hits them would get that state.
 

Youhadabadday

Villager
Member
Joined
Nov 10, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
Yeah, it's not exactly what I want. I don't want them to get the effect first, but I'll see what I can do with that.
 

Youhadabadday

Villager
Member
Joined
Nov 10, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
"First set the state to be removed when damage is taken. Then use the plugin and info from here to set up the rest."

I misread your issue and jumped the gun. Unless you want the player to inflict a negative effect on themselves first then the enemy that hits them would get that state.
Yeah it's still confusing. However, I have obtained a lead that maybe the counter plugin would help. If I need to get the most accurate help, I'll explain exactly what I'm doing:

I'm trying to make a Dead By Daylight fangame using RPG Maker MV, and I am trying to translate the Trapper's Bear Traps into MV. Basically, I have a series of moves that inflict a different status effect depending on the move that will then act as the actual trap. When an enemy attacks the trapped ally, the "Bear Trap" will trigger, and depending on the status effect variation, different effects will occur. There are 4 types: Normal, Padded, Serrated, and Rusty. Normal will stun the enemy for a bit and inflict a small ammount of damage, Padded will stun for longer, but deals no damage, Serrated will deal more damage, but not stun, and Rusty will deal more damage and inflict a Bleed effect instead of a Stun effect.

Hopefully that helps.
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
Ah ok, that explains it a bit better. Ok try using this code in the state notebox:

<Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
user.addState(x);
}
</Custom React Effect>

Replace X with the state you want and when the state holder is attacked this should add the state in the formula.

Edit: I suggest using Himes State Change Animation plugin to give a visual flare when the state is applied to the attacker.
 
Last edited:

Youhadabadday

Villager
Member
Joined
Nov 10, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
Ah ok, that explains it a bit better. Ok try using this code in the state notebox:

<Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
user.addState(x);
}
</Custom React Effect>

Replace X with the state you want and when the state holder is attacked this should add the state in the formula.

Edit: I suggest using Himes State Change Animation plugin to give a visual flare when the state is applied to the attacker.
That's perfect! It adds the state that I want, now I just need to figure out how to make it deal damage.
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
That's perfect! It adds the state that I want, now I just need to figure out how to make it deal damage.
Do you mean make the inflicted state deal damage? You use the Ex parameter tab in the state menu, pick HP regeneration, and then add -x%.
 

Youhadabadday

Villager
Member
Joined
Nov 10, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
Do you mean make the inflicted state deal damage? You use the Ex parameter tab in the state menu, pick HP regeneration, and then add -x%.
No, as in like basic attack damage.
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
Ok, I'm trying to get what you're trying to do. Are you trying to make a skill do damage?
 

Youhadabadday

Villager
Member
Joined
Nov 10, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
I want the damage to be triggered the same way the status effect was triggered.
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
Ah ok. In that case use this code instead:

<Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
user.addState(x);
// Sets the Recoil Rate to 15%.
var rate = 0.15;
// Determines the amount of recoil damage dealt.
var recoil = value * rate;
// Sets the DEF bonus rate to 25%.
var rate = 0.25;
// Determines the amount of bonus damage dealt.
var bonus = target.def * rate;
// Rounds up the bonus damage and recoil damage.
var dmg = Math.ceil(bonus + recoil);
// Makes the attacker lose damage equal to the dmg variable.
user.gainHp(-1 * dmg);
// Check to see if the attacker is dead.
if (user.isDead()) {
// If the attacker is dead, make it collapse.
user.performCollapse();
}
}
 

Youhadabadday

Villager
Member
Joined
Nov 10, 2019
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMMV
Ah ok. In that case use this code instead:
I have a basic understanding of the code from what I'm reading, but there are a few more things I need to know. 1: What does the recoil damage and the bonus damage represent in terms of how it works in-game? 2: What's the difference between recoil damage and bonus damage?
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
The recoil rate is 15% of the damage that will be reflected back to the attacker. The bonus damage is a percentage of the user's defense state. If you want a breakdown of how it works you can check out more info here.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Are we allowed to post about non-RPG Maker games? And, if so, would any of you be interested in a short, proof of concept type non-euclidian puzzle game?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:

Forum statistics

Threads
105,883
Messages
1,017,232
Members
137,607
Latest member
Maddo
Top