namespace PkmnLib.Plugin.Gen7.Scripts.Moves; [Script(ScriptCategory.Move, "weather_ball")] public class WeatherBall : Script, IScriptChangeMoveType, IScriptChangeBasePower { /// public void ChangeBasePower(IExecutingMove move, IBattlePokemon target, byte hit, ref ushort basePower) { if (move.Battle.WeatherName is not null) { basePower = basePower.MultiplyOrMax(2); } } /// public void ChangeMoveType(IExecutingMove move, IBattlePokemon target, byte hit, ref TypeIdentifier? typeIdentifier) { var weather = move.Battle.WeatherName; var typeLibrary = move.Battle.Library.StaticLibrary.Types; if (weather is null) return; if (weather == ScriptUtils.ResolveName() && typeLibrary.TryGetTypeIdentifier(TypeNames.Fire, out var fireType)) typeIdentifier = fireType; else if (weather == ScriptUtils.ResolveName() && typeLibrary.TryGetTypeIdentifier(TypeNames.Water, out var waterType)) typeIdentifier = waterType; else if (weather == ScriptUtils.ResolveName() && typeLibrary.TryGetTypeIdentifier(TypeNames.Ice, out var iceType)) typeIdentifier = iceType; else if (weather == ScriptUtils.ResolveName() && typeLibrary.TryGetTypeIdentifier(TypeNames.Rock, out var rockType)) typeIdentifier = rockType; } }