Last couple abilities
This commit is contained in:
32
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/WaterBubble.cs
Normal file
32
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/WaterBubble.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Water Bubble is an ability that halves the damage taken from Fire-type moves and prevents the Pokémon from being burned.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Water_Bubble_(Ability)">Bulbapedia - Water Bubble</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "water_bubble")]
|
||||
public class WaterBubble : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted,
|
||||
ref bool preventStatus)
|
||||
{
|
||||
if (status == ScriptUtils.ResolveName<Status.Burned>())
|
||||
preventStatus = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Type?.Name == "fire")
|
||||
damage /= 2;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.GetHitData(target, hit).Type?.Name == "water")
|
||||
damage *= 2;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user