namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// Water Bubble is an ability that halves the damage taken from Fire-type moves and prevents the Pokémon from being burned. /// /// Bulbapedia - Water Bubble /// [Script(ScriptCategory.Ability, "water_bubble")] public class WaterBubble : Script, IScriptChangeIncomingMoveDamage, IScriptChangeMoveDamage, IScriptPreventStatusChange { /// public void PreventStatusChange(IBattlePokemon pokemon, StringKey status, bool selfInflicted, ref bool preventStatus) { if (status == ScriptUtils.ResolveName()) preventStatus = true; } /// public void ChangeIncomingMoveDamage(IExecutingMove move, IBattlePokemon target, byte hit, ref uint damage) { if (move.GetHitData(target, hit).Type?.Name == TypeNames.Fire) damage /= 2; } /// public void ChangeMoveDamage(IExecutingMove move, IBattlePokemon target, byte hit, ref uint damage) { if (move.GetHitData(target, hit).Type?.Name == TypeNames.Water) damage *= 2; } }