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:
@@ -10,7 +10,7 @@ public class DestinyBondEffect : Script
|
||||
{
|
||||
if (pokemon.BattleData?.Battle.ChoiceQueue?.LastRanChoice is not IMoveChoice lastChoice)
|
||||
return;
|
||||
lastChoice.User.Damage(lastChoice.User.BoostedStats.Hp * 10, DamageSource.Misc);
|
||||
lastChoice.User.Damage(lastChoice.User.BoostedStats.Hp * 10, DamageSource.Misc, forceDamage: true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,17 +11,9 @@ public class ProtectionEffectScript : Script
|
||||
|
||||
if (!executingMove.UseMove.HasFlag("protect"))
|
||||
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)
|
||||
var args = new CustomTriggers.BypassProtectionArgs(executingMove, target, hitIndex, false);
|
||||
executingMove.User.RunScriptHook(x => x.CustomTrigger(CustomTriggers.BypassProtection, args));
|
||||
if (args.Bypass)
|
||||
return;
|
||||
|
||||
block = true;
|
||||
|
||||
@@ -11,17 +11,9 @@ 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)
|
||||
var args = new CustomTriggers.BypassSubstituteArgs(executingMove, target, hitIndex, false);
|
||||
executingMove.User.RunScriptHook(x => x.CustomTrigger(CustomTriggers.BypassSubstitute, args));
|
||||
if (args.Bypass)
|
||||
return;
|
||||
|
||||
block = true;
|
||||
|
||||
Reference in New Issue
Block a user