RPG Maker Forums

Hello! Need some help conceptualizing this one out.

In essence, I have a skill that applies a debuff state. What I want to add is: for 5 turns, this state will remove itself from current enemy and jump to another enemy.

Here's what I'm thinking of:

1- Skill applies state (duration 1 turn)

2- State to have Custom Apply

Code:
<Custom Apply Effect>

    // Duration of plague
    target._plagueTurns = 5;

</Custom Apply Effect>
3- Every turn, the state removes itself, so in my state, I would also have:

Code:
<Custom Remove Effect>

    // Check if the party is in battle.
    if ($gameParty.inBattle()) {

        // Remove 1 turn from plague duration
        target._plagueTurns -= 1;

        // Plague only jumps if >0 turns left
        if target._plagueTurns > 0 {

            // Get list of all foes
            var members = user.opponentsUnit().aliveMembers();

            // Remove current bearer of plague
            members.splice(members.indexOf(user), 1);

            // Select one member to transfer the plague to
            var member = members[Math.floor(Math.random() * members.length)];

            // Transfer plague state and remaining turns
            member.addState(10);
            member._plagueTurns = user._plagueTurns;

        }

    } else {

        // Not in battle, kill the plague
        user._plagueTurns = 0;

    }

}

</Custom Remove Effect>
Wondering if anyone would approach this one differently?

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

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.

Forum statistics

Threads
106,040
Messages
1,018,476
Members
137,824
Latest member
dobratemporal
Top