Adds more abilities
This commit is contained in:
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Defeatist.cs
Normal file
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Defeatist.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Defeatist is an ability that halves the Pokémon's Attack and Special Attack when its HP drops below 50%.
|
||||
/// This reduction applies to all moves used by the Pokémon, making it significantly weaker when damaged.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Defeatist_(Ability)">Bulbapedia - Defeatist</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "defeatist")]
|
||||
public class Defeatist : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||
{
|
||||
if (move.User.CurrentHealth < move.User.MaxHealth / 2)
|
||||
{
|
||||
modifier *= 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user