RPG Maker Forums

Hi guys!


I'm trying to make a spell that has two functions: if cast on a ally it applies an Absorption Barrier. If cast on an enemy, it'll apply a debuff (in this case, the debuff will increase all damage in that target). I'm using Yanfly plugins to try to achieve that but I can't seem to know what object or function to apply the absorption barrier in the target. Sure, I could use notetags, but I can't in this case because if I target an enemy the effect will be different.


I'm making a series of spells like this so what I achieved so far was with a damage/heal one. If cast on ally it heals, if cast on an enemy it deals damage. I use Target Core to check if the target is friendly, then calculate the damage or heal depending on it and then the Action Sequences to make the cast animation according to what is being cast. I'd like to use the same logic here but the thing is I don't know what object or function to use in the damage part or any other plugin.


Could you help me achieve that?


OT: If anyone is interessed, here's how I did the mentioned spell in the 2nd paragraph. Put the code below on the skill notetag. The skill will have Damage Type: HP Damage.

Code:
// You can select any side
<Enemy or Actor Select>

// This is just to make a variable inside the target object
<Custom Target Eval>
if (target.isActor() === user.isActor()) { 
  target._isHealing = true;
} else { 
  target._isHealing = false;
}
targets.push(target);
</Custom Target Eval>

// This part is identical to Yanfly's, except the formula that I adjusted to my needs
<Damage Formula>
// Check if target and user are on the same team.
if (target.isActor() === user.isActor()) {
  // Heal formula for allies.
  value = user.mdf * 4;
// Otherwise for enemies...
} else {
  // Damage formula for enemies.
  value = user.mat * 4;
}
</Damage Formula>
<Pre-Damage Eval>
// Check if target and user are on the same team.
if (target.isActor() === user.isActor()) {
  // Make it heal the ally instead.
  value = -1 * Math.abs(value);
}
</Pre-Damage Eval>

// Here's where I made the animation different if healing or damaging
// Change the animation ID number to whatever you need
<Target Action>
if target._isHealing
  animation 215: target
  wait for animation
  action effect
else
  animation 101: target
  wait for animation
  action effect
end
</Target Action>

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,546
Members
137,835
Latest member
yetisteven
Top