This commit is contained in:
@@ -11,6 +11,19 @@ public class SubstituteEffect(uint health) : Script
|
||||
if (executingMove.UseMove.HasFlag("ignore-substitute"))
|
||||
return;
|
||||
|
||||
var bypass = false;
|
||||
var parameters = new Dictionary<StringKey, object?>
|
||||
{
|
||||
{ "target", target },
|
||||
{ "move", executingMove },
|
||||
{ "hitIndex", hitIndex },
|
||||
{ "bypass", bypass },
|
||||
};
|
||||
executingMove.User.RunScriptHook(x => x.CustomTrigger(CustomTriggers.BypassProtection, parameters));
|
||||
bypass = parameters.GetValueOrDefault("bypass", false) as bool? ?? false;
|
||||
if (bypass)
|
||||
return;
|
||||
|
||||
block = true;
|
||||
var damage = executingMove.GetHitData(target, hitIndex).Damage;
|
||||
if (damage >= _health)
|
||||
|
||||
Reference in New Issue
Block a user