Prevent damage/heal for the prevented damage taken?

MiddleMang

Villager
Member
Joined
Jan 24, 2019
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello, I am using yanfly's plugins and want to recreate Medivh's force of will skill from HOTS in MV. It goes as follows:
"Protect an allied Hero from all damage for 1.5 seconds. Upon expiration, Force of Will heals the target for 20% of the damage it absorbed."

There's also an extra version which deals damage upon expiring:
"When Force of Will expires, it deals 80 damage to nearby enemies, plus 50% of the damage it prevented."

Is this possible to recreate? I'm not sure how to reference damage taken if you don't actually take damage.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,944
Reaction score
1,050
First Language
Dutch
Primarily Uses
RMMV
it is possible if you know lunatic mode (I dont) but my best guess it require 2 states.
one for the 20% absorbed and the chain (or when expire) the 80 dmg with 50% prevented.

does that mean it deal 40 damage? or 50% dmg to teh user on the next attack?
 

MiddleMang

Villager
Member
Joined
Jan 24, 2019
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
it is possible if you know lunatic mode (I dont) but my best guess it require 2 states.
one for the 20% absorbed and the chain (or when expire) the 80 dmg with 50% prevented.

does that mean it deal 40 damage? or 50% dmg to teh user on the next attack?
Sorry for the misunderstanding, it'd do 50% of whatever damage the target took during the "protected" state. So the total effect with both combined would be a state that protects the target from damage, heals 20% of the total damage that would've hit them but it prevented it, and deals 50% of the total damage prevented back at the enemy. The 80 could be left out, it's just a base damage added to the 50% variable.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
For the first effect using Buffs & States Core:

Code:
<Custom React Effect>
target._absorb = value;
value = 0;
</Custom React Effect>

<Custom Leave Effect>
target.gainHp(Math.floor(target._absorb * 0.2));
delete target._absorb;
</Custom Leave Effect>
Second effect:

Code:
<Custom React Effect>
target._absorb = value;
value = 0;
</Custom React Effect>

<Custom Leave Effect>
let targets = $gameTroop.aliveMembers();
let damage = 80 + Math.floor(target._absorb * 0.5);
targets.forEach(function(target) {
  target.gainHp(-damage);
  target.startDamagePopup()
});
delete target._absorb;
</Custom Leave Effect>
 

MiddleMang

Villager
Member
Joined
Jan 24, 2019
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
For the first effect using Buffs & States Core:

Code:
<Custom React Effect>
target._absorb = value;
value = 0;
</Custom React Effect>

<Custom Leave Effect>
target.gainHp(Math.floor(target._absorb * 0.2));
delete target._absorb;
</Custom Leave Effect>
Second effect:

Code:
<Custom React Effect>
target._absorb = value;
value = 0;
</Custom React Effect>

<Custom Leave Effect>
let targets = $gameTroop.aliveMembers();
let damage = 80 + Math.floor(target._absorb * 0.5);
targets.forEach(function(target) {
  target.gainHp(-damage);
  target.startDamagePopup()
});
delete target._absorb;
</Custom Leave Effect>
This looks like it's perfect, thank you very much! Since I'm sort of just learning this stuff, I'm assuming I make a skill, have it apply both of those states (I made the effects two different states, expire in a turn)? I went into a battle, put it on an actor, they took no damage from the enemy that hit them which is great, but they didn't heal or deal damage (I kept getting 0's) is that on my end or do I have to reference something in the skill note section?

EDIT: I also noticed that even after the state expired the enemy kept getting a damage popup after it's turn for 0. When I apply it to one actor, and a different actor gets hit I get this error
 

Attachments

Last edited:

MiddleMang

Villager
Member
Joined
Jan 24, 2019
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
I was able to fix the other issues by putting in at the beginning:

<Custom Apply Effect>

//store a new param to track HP damage

target._absorb = 0;

</Custom Apply Effect>

but it seems like they only work individually and applying both to a single actor results in the 0's.
 

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

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,446
Members
137,820
Latest member
georg09byron
Top