More abilities, refactor custom triggers to be typed.
All checks were successful
Build / Build (push) Successful in 48s
All checks were successful
Build / Build (push) Successful in 48s
This commit is contained in:
@@ -29,12 +29,9 @@ public class Hail : Script, ILimitedTurnsScript
|
||||
continue;
|
||||
if (pokemon.Types.Contains(iceType))
|
||||
continue;
|
||||
var ignoresHail = false;
|
||||
pokemon.RunScriptHook(x => x.CustomTrigger(CustomTriggers.IgnoreHail, new Dictionary<StringKey, object?>
|
||||
{
|
||||
{ "ignoresHail", ignoresHail },
|
||||
}));
|
||||
if (ignoresHail)
|
||||
var args = new CustomTriggers.IgnoreHailArgs(pokemon);
|
||||
pokemon.RunScriptHook(x => x.CustomTrigger(CustomTriggers.IgnoreHail, args));
|
||||
if (args.Ignore)
|
||||
continue;
|
||||
|
||||
var maxHealth = pokemon.BoostedStats.Hp;
|
||||
|
||||
@@ -24,17 +24,15 @@ public class HarshSunlight : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, IDictionary<StringKey, object?>? parameters)
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName == CustomTriggers.BypassChargeMove)
|
||||
if (eventName != CustomTriggers.BypassChargeMove)
|
||||
return;
|
||||
if (args is not CustomTriggers.BypassChargeMoveArgs bypassArgs)
|
||||
return;
|
||||
if (bypassArgs.Move.UseMove.Name == "solar_beam" || bypassArgs.Move.UseMove.Name == "solar_blade")
|
||||
{
|
||||
if (parameters == null || !parameters.TryGetValue("move", out var moveObj) ||
|
||||
moveObj is not IExecutingMove move)
|
||||
return;
|
||||
if (move.UseMove.Name == "solar_beam" || move.UseMove.Name == "solar_blade")
|
||||
{
|
||||
parameters["bypassCharge"] = true;
|
||||
}
|
||||
bypassArgs.Bypass = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user