More moves implemented

This commit is contained in:
2025-05-05 11:36:59 +02:00
parent 11ba3c73bb
commit 292c303fc0
39 changed files with 818 additions and 68 deletions

View File

@@ -0,0 +1,12 @@
namespace PkmnLib.Dynamic.ScriptHandling;
/// <summary>
/// Helper interface for scripts that have a limited number of turns.
/// </summary>
public interface ILimitedTurnsScript
{
/// <summary>
/// Sets the number of turns the script will last.
/// </summary>
public void SetTurns(int turns);
}

View File

@@ -1,12 +0,0 @@
namespace PkmnLib.Dynamic.ScriptHandling;
/// <summary>
/// Helper interface for weather scripts.
/// </summary>
public interface IWeatherScript
{
/// <summary>
/// Sets the number of turns the weather will last.
/// </summary>
public void SetTurns(int turns);
}

View File

@@ -97,6 +97,10 @@ public abstract class Script : IDeepCloneable
{
}
public virtual void OnAddedToParent(IScriptSource source)
{
}
/// <summary>
/// Override to customize whether the move can be selected at all.
/// </summary>

View File

@@ -117,6 +117,7 @@ public class ScriptSet : IScriptSet
script.OnRemoveEvent += s => Remove(s.Name);
var container = new ScriptContainer(script);
_scripts.Add(container);
script.OnAddedToParent(_source);
return container;
}
@@ -136,6 +137,7 @@ public class ScriptSet : IScriptSet
script.OnRemoveEvent += s => Remove(s.Name);
var container = new ScriptContainer(script);
_scripts.Add(container);
script.OnAddedToParent(_source);
return container;
}