Skill that reflects upcoming damage on the next turn

Cub1C

CubiC
Member
Joined
Jan 27, 2023
Messages
15
Reaction score
4
First Language
Swedish
Primarily Uses
RMMZ
I'm new to writing scripts in general, and especially in RMMZ with java, but how would you theoretically code this? I had the idea for a skill that would reflect any damage done to the actor that round back to the enemy, multiplied by about 1.5 or so. Additionally, it would only successfully reflect the damage 80%/90% of the time. If anyone knows how to make this skill, please explain it to me, any help is appreciated.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
7,630
Reaction score
5,399
First Language
English
Primarily Uses
RMMV
I'm new to writing scripts in general, and especially in RMMZ with java
Just for your information, since this sounds like you plan to learn it - RPG Maker uses JavaScript, not Java. They're two different programming languages.

but how would you theoretically code this?
This is pretty straightforward to do with VisuStella's Battle Core.

I had the idea for a skill that would reflect any damage done to the actor that round back to the enemy, multiplied by about 1.5 or so. Additionally, it would only successfully reflect the damage 80%/90% of the time.
In the state that the skill puts on you, you put these notetags:
Code:
<JS Pre-Damage As Target>
if (this.isDamage() && this.isHpEffect() && Math.random()<.8)
{
    target.reflected=value;
    value=0;
}
</JS Pre-Damage As Target>

<JS Post-Apply As Target>
if (target.reflected)
{
    user.gainHp(0-target.reflected);
    delete target.reflected;
    if (user.isDead())
        user.performCollapse();
}
</JS Post-Apply As Target>

That has an 80% chance of triggering.
 

Cub1C

CubiC
Member
Joined
Jan 27, 2023
Messages
15
Reaction score
4
First Language
Swedish
Primarily Uses
RMMZ
Just for your information, since this sounds like you plan to learn it - RPG Maker uses JavaScript, not Java. They're two different programming languages.


This is pretty straightforward to do with VisuStella's Battle Core.


In the state that the skill puts on you, you put these notetags:
Code:
<JS Pre-Damage As Target>
if (this.isDamage() && this.isHpEffect() && Math.random()<.8)
{
    target.reflected=value;
    value=0;
}
</JS Pre-Damage As Target>

<JS Post-Apply As Target>
if (target.reflected)
{
    user.gainHp(0-target.reflected);
    delete target.reflected;
    if (user.isDead())
        user.performCollapse();
}
</JS Post-Apply As Target>

That has an 80% chance of triggering.
thank you very much
 

Latest Threads

Latest Profile Posts

Learn how to do custom face parts with my latest tutorial!
Generatorpartsfromscratch.png
The Legion
T7T0hR2.gif
Made a title screen, and by ''made'' I ofc mean I slapped a simple title on some cool art I bought xD This side project might be fun.

sIMPLE.png
CDF.png

Trying for a Classical RPG with Pokemon Elements. Capture monsters like Zombies and Harpys and use them on your team.
ow28O4A.png

Astarte in her usual demeanor: mocking people.

Forum statistics

Threads
129,873
Messages
1,205,850
Members
171,051
Latest member
Atakh4n
Top