More abilities, refactor IPokemon.SetStatus to pass pokemon that caused the status change
All checks were successful
Build / Build (push) Successful in 50s
All checks were successful
Build / Build (push) Successful in 50s
This commit is contained in:
19
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Sturdy.cs
Normal file
19
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Sturdy.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Sturdy is an ability that allows the Pokémon to survive a one-hit KO attack with 1 HP.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sturdy_(Ability)">Bulbapedia - Sturdy</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "sturdy")]
|
||||
public class Sturdy : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (damage >= target.MaxHealth && target.CurrentHealth == target.MaxHealth)
|
||||
{
|
||||
damage = target.MaxHealth - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user