More moves implemented
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user