More abilities
All checks were successful
Build / Build (push) Successful in 49s

This commit is contained in:
2025-06-09 15:24:37 +02:00
parent 074f92bfc0
commit 1579d46671
23 changed files with 480 additions and 41 deletions

View File

@@ -1,3 +1,5 @@
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
/// <summary>
@@ -21,13 +23,18 @@ public class Autotomize : Script
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
var user = move.User;
if (user.ChangeStatBoost(Statistic.Speed, 2, true, false) && user.ChangeWeightInKgBy(-100.0f))
var existingEffect = user.Volatile.Get<AutotomizeEffect>();
var stacks = existingEffect?.Stacks ?? 0;
if (!user.ChangeStatBoost(Statistic.Speed, 2, true, false) || !(user.WeightInKg - 100f * stacks >= 0.1f))
return;
user.Volatile.StackOrAdd(ScriptUtils.ResolveName<AutotomizeEffect>(), () => new AutotomizeEffect());
var battle = user.BattleData?.Battle;
battle?.EventHook.Invoke(new DialogEvent("pokemon_became_nimble", new Dictionary<string, object>
{
var battle = user.BattleData?.Battle;
battle?.EventHook.Invoke(new DialogEvent("pokemon_became_nimble", new Dictionary<string, object>
{
{ "pokemon", user },
}));
}
{ "pokemon", user },
}));
}
}

View File

@@ -1,3 +1,4 @@
using PkmnLib.Plugin.Gen7.Scripts.Utils;
using PkmnLib.Static.Utils;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
@@ -36,6 +37,8 @@ public class BatonPass : Script
foreach (var script in volatileScripts)
{
if (script is not IBatonPassException)
return;
toSwitch.Volatile.Add(script);
}
}