First couple abilities implemented
All checks were successful
Build / Build (push) Successful in 48s
All checks were successful
Build / Build (push) Successful in 48s
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using PkmnLib.Static.Moves;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
[Script(ScriptCategory.Side, "battery")]
|
||||
public class BatteryAbilityEffect : Script
|
||||
{
|
||||
private HashSet<IPokemon> _placers = new();
|
||||
|
||||
public void PlacerActivated(IPokemon placer) => _placers.Add(placer);
|
||||
|
||||
public void PlacerDeactivated(IPokemon placer)
|
||||
{
|
||||
_placers.Remove(placer);
|
||||
if (_placers.Count == 0)
|
||||
RemoveSelf();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
if (move.UseMove.Category == MoveCategory.Special)
|
||||
{
|
||||
modifier *= 5325f / 4096f; // ~1.3x
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user