Advanced Spell/Ability Implementation

Hey there 🙂

So I've been designing some pretty advanced spells for boss fights & it doesn't seem very clear to me exactly how they can be implemented. I would appreciate any help I could get -- Some examples are a spell that requires a certain amount of a specified enemy alive in order to be usable, a spell that's more effective if a certain ally/enemy is present, spells that are more powerful if used consecutively, spells that enemies chain together & use collectively, and a class finisher-combo supportive spell that temporarily gives your party members a unique ability that wares off after a set amount of turns.

I'm using RPG Maker VX Ace

Thank you.
Hm, just to be clear, are the spells all cast by enemies or allies? Anyway, I'll assume by boss battle, you want enemies to refer to fellow enemies.

---

1. Spell requires X amount of Y enemies.
This is more of a custom Condition for a skill, so you might need something like Hime's Enemy Action Conditions and place

required_members = 0
t.alive_members.each do |enemy|
required_members += 1 if enemy.enemy_id == 4
end
required_members >= 3


inside the note block. The example here is to check the whole troop and add one if their ID is 4, and then to return true of the number of specific enemies is more than 3.

---

2. Spell more effective if certain enemy/ally present.
From here, it's just formulas. However, you may have to create a formula module or method in case you run out of space.

Anyway, you use $game_troop.alive_members.any? {|enemy| enemy.enemy_id == 2} or $game_party.alive_members.any? {|actor| actor.id == 2}

---

3. Spell that becomes more powerful if used consecutively.
I answered this in a previous topic, but assuming only one person is using the spell, you would increase the $game_variables[x] for that skill (using the variable in the formula). If you want the variable to reset, however, all other skills (or the ones the boss use) should have $game_variables[x] = 0.

For multiple enemies, you would either have to use multiple variables, or you initialize a new @variable for the enemy to represent that use.

---

4. Chained and Collective Spells
Do you mean like Chrono Trigger's X Slash or do you mean Enemy 2 casts Spell B if Enemy 1 casts Spell A?

In the latter's case, I assume enemies choose their actions before they attack, so Hime's Enemy Action Conditions for something like

t.alive_members.any? {|enemy| enemy.state?(70)}

And also a.add_state(70) inside your damage formula.

---

5. Class Finisher What?
...Give Party Members unique abilities with Skill.
I assume you mean giving party members additional Skills. All you have to do is create a State and have it Add Skill (or Add Skill Type with Add Skills if you have multiple skill types). When the state wears off, those skills disappear.

If you want that skill to give Actor A Fire Slash but Actor B Fire Heal, though, too much for formulas, so you either have a Common Event apply the right Skill-holding state to each character, or you can use Hime's Feature Conditions to have one state give different skills to everyone.

===

That's what I interpreted so far.

Original thread: https://forums.rpgmakerweb.com/threads/advanced-spell-ability-implementation.77265/