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

@@ -383,13 +383,14 @@ public class BattleImpl : ScriptSource, IBattle
if (!Library.ScriptResolver.TryResolve(ScriptCategory.Weather, weatherName.Value, null, out var script))
throw new InvalidOperationException($"Weather script {weatherName} not found.");
if (script is IWeatherScript weatherScript)
if (script is ILimitedTurnsScript weatherScript)
{
this.RunScriptHook(x => x.ChangeWeatherDuration(weatherName.Value, ref duration));
weatherScript.SetTurns(duration);
}
_weatherScript.Set(script);
script.OnAddedToParent(this);
}
else
{
@@ -415,6 +416,7 @@ public class BattleImpl : ScriptSource, IBattle
if (!Library.ScriptResolver.TryResolve(ScriptCategory.Terrain, terrainName.Value, null, out var script))
throw new InvalidOperationException($"Terrain script {terrainName} not found.");
_terrainScript.Set(script);
script.OnAddedToParent(this);
}
else
{