27 lines
761 B
C#
27 lines
761 B
C#
using PkmnLib.Static.Moves;
|
|
|
|
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
|
|
|
[Script(ScriptCategory.Side, "battery")]
|
|
public class BatteryAbilityEffect : Script, IScriptChangeDamageModifier
|
|
{
|
|
private HashSet<IBattlePokemon> _placers = new();
|
|
|
|
public void PlacerActivated(IBattlePokemon placer) => _placers.Add(placer);
|
|
|
|
public void PlacerDeactivated(IBattlePokemon placer)
|
|
{
|
|
_placers.Remove(placer);
|
|
if (_placers.Count == 0)
|
|
RemoveSelf();
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public void ChangeDamageModifier(IExecutingMove move, IBattlePokemon target, byte hit, ref float modifier)
|
|
{
|
|
if (move.UseMove.Category == MoveCategory.Special)
|
|
{
|
|
modifier *= 5325f / 4096f; // ~1.3x
|
|
}
|
|
}
|
|
} |