Overcharge

This week’s state is a lot more simple. Overcharge is a special ability of the wizard class in my project, which allows them to cast a magic spell that deals twice as much damage as normal, while costing double the normal MP cost. This effect is instant cast, and only lasts for the following turn, and also makes use of a skill cooldown to prevent abuse.

Naturally, for the instant cast and cooldown, you will need the YEP Instant Cast and YEP Skill Cooldown plugins.

For this effect, we need a state, and a skill. The skill is used to apply the state to the caster.

overchargeskill

To complete the skill, we also need the following note tags in the note box.

<Instant Cast>
<Cooldown: 2>

Next we need the stateoverchargedstateThe state itself doesn’t really do anything, aside from expire after 1 turn. To get the desired effect, we need to add a few things to affected skills.

First, in order to double the MP cost of an overcharged skill, we need to add the following note tag to ANY skill that will be affected by Overcharged:

<Custom MP Cost>
cost = cost * (1+ user.isStateAffected(43))
</Custom MP Cost>

Note that StateId 43 is our overcharged state. What this does is double the cost of the spell, but only if Overcharged is active.

Next, the easiest way to double the damage of the affected skill is to change its damage formula. We need to add the following bit to the end of the damage formula for our spell.

* (1 + a.isStateAffected(43));

This will double the damage of the skill, only if the user is affected by the overcharged state.

If your damage formula looked like this before:

a.atk * 4 - b.def * 2

It should look like this after:

(a.atk * 4 - b.def * 2) * (1 + a.isStateAffected(43));

Because the state expires after one turn, generally the actor will only be able to use it once before it expires. This will not be the case when using instant cast skills, so keep that in mind when you’re balancing your battles around this mechanic.

 

That’s all for this update, folks.

 

~Ramza

Leave a comment