13 lines
486 B
C#
13 lines
486 B
C#
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
[Script(ScriptCategory.Move, "torment")]
|
|
public class Torment : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
|
{
|
|
var lastTargetChoice = move.Battle.PreviousTurnChoices.SelectMany(x => x).Reverse().OfType<IMoveChoice>()
|
|
.FirstOrDefault(x => x.User == target);
|
|
target.Volatile.Add(new Pokemon.TormentEffect(lastTargetChoice));
|
|
}
|
|
} |