Implements terrain
All checks were successful
Build / Build (push) Successful in 49s

This commit is contained in:
2025-06-22 11:31:24 +02:00
parent 02510fd1d0
commit 6394f4eab3
10 changed files with 133 additions and 11 deletions

View File

@@ -774,7 +774,7 @@ public abstract class Script : IDeepCloneable
/// <summary>
/// This function allows a script to prevent a Pokémon from being affected by a volatile status condition.
/// </summary>
public virtual void PreventVolatileAdd(Script script, ref bool preventVolatileAdd)
public virtual void PreventVolatileAdd(IScriptSource parent, Script script, ref bool preventVolatileAdd)
{
}

View File

@@ -86,7 +86,7 @@ public interface IScriptSet : IEnumerable<ScriptContainer>
/// <inheritdoc cref="IScriptSet"/>
public class ScriptSet : IScriptSet
{
private IScriptSource _source;
private readonly IScriptSource _source;
private readonly List<ScriptContainer> _scripts = [];
@@ -108,7 +108,7 @@ public class ScriptSet : IScriptSet
if (!forceAdd)
{
var preventVolatileAdd = false;
_source.RunScriptHook(x => x.PreventVolatileAdd(script, ref preventVolatileAdd));
_source.RunScriptHook(x => x.PreventVolatileAdd(_source, script, ref preventVolatileAdd));
if (preventVolatileAdd)
return null;
}