This commit is contained in:
@@ -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 },
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user