20 lines
690 B
C#
20 lines
690 B
C#
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
[Script(ScriptCategory.Move, "reflect")]
|
|
public class Reflect : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
|
{
|
|
var battleData = move.User.BattleData;
|
|
if (battleData is null)
|
|
return;
|
|
var numberOfTurns = 5;
|
|
|
|
var args = new CustomTriggers.ReflectNumberOfTurnsArgs(move, numberOfTurns);
|
|
move.User.RunScriptHook(x => x.CustomTrigger(CustomTriggers.ReflectNumberOfTurns, args));
|
|
numberOfTurns = args.Duration;
|
|
|
|
battleData.BattleSide.VolatileScripts.Add(new Side.ReflectEffect(numberOfTurns));
|
|
}
|
|
} |