Adds a bunch more move scripts
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using PkmnLib.Dynamic.Libraries;
|
||||
using PkmnLib.Dynamic.Models;
|
||||
using PkmnLib.Dynamic.ScriptHandling;
|
||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
||||
using PkmnLib.Static;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
public abstract class ChangeTargetStats : Script
|
||||
{
|
||||
private readonly Statistic _stat;
|
||||
private sbyte _amount;
|
||||
|
||||
protected ChangeTargetStats(Statistic stat)
|
||||
{
|
||||
_stat = stat;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnInitialize(IDynamicLibrary library, IReadOnlyDictionary<StringKey, object?>? parameters)
|
||||
{
|
||||
if (parameters == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(parameters));
|
||||
}
|
||||
|
||||
if (!parameters.TryGetValue("amount", out var amount) || amount == null)
|
||||
{
|
||||
throw new ArgumentException("Parameter 'amount' is required.");
|
||||
}
|
||||
|
||||
_amount = (sbyte)amount;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
target.ChangeStatBoost(_stat, _amount, target == move.User);
|
||||
}
|
||||
}
|
||||
|
||||
[Script(ScriptCategory.Move, "change_target_attack")]
|
||||
public class ChangeTargetAttack : ChangeTargetStats
|
||||
{
|
||||
public ChangeTargetAttack() : base(Statistic.Attack)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[Script(ScriptCategory.Move, "change_target_defense")]
|
||||
public class ChangeTargetDefense : ChangeTargetStats
|
||||
{
|
||||
public ChangeTargetDefense() : base(Statistic.Defense)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[Script(ScriptCategory.Move, "change_target_special_attack")]
|
||||
public class ChangeTargetSpecialAttack : ChangeTargetStats
|
||||
{
|
||||
public ChangeTargetSpecialAttack() : base(Statistic.SpecialAttack)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[Script(ScriptCategory.Move, "change_target_special_defense")]
|
||||
public class ChangeTargetSpecialDefense : ChangeTargetStats
|
||||
{
|
||||
public ChangeTargetSpecialDefense() : base(Statistic.SpecialDefense)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[Script(ScriptCategory.Move, "change_target_speed")]
|
||||
public class ChangeTargetSpeed : ChangeTargetStats
|
||||
{
|
||||
public ChangeTargetSpeed() : base(Statistic.Speed)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user