Implements an initial version of Baton Pass.

Will probably need some additional work in the future.
This commit is contained in:
2025-01-10 13:07:27 +01:00
parent 92ab67ddf8
commit 0ad692a921
4 changed files with 63 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
using PkmnLib.Dynamic.ScriptHandling;
using PkmnLib.Static.Utils;
namespace PkmnLib.Dynamic.Models.Choices;
@@ -31,6 +32,8 @@ public interface IMoveChoice : ITurnChoice
/// The underlying script of the move.
/// </summary>
ScriptContainer Script { get; set; }
Dictionary<StringKey, object?>? AdditionalData { get; }
}
/// <inheritdoc cref="IMoveChoice"/>
@@ -69,6 +72,9 @@ public class MoveChoice : TurnChoice, IMoveChoice
/// <inheritdoc />
public ScriptContainer Script { get; set; } = new();
/// <inheritdoc />
public Dictionary<StringKey, object?>? AdditionalData { get; }
/// <inheritdoc />
public override int ScriptCount => 1 + User.ScriptCount;

View File

@@ -65,4 +65,9 @@ public class ScriptContainer : IEnumerable<ScriptContainer>, IDeepCloneable
}
Script = null;
}
public void ClearWithoutRemoving()
{
Script = null;
}
}