More abilities
All checks were successful
Build / Build (push) Successful in 48s

This commit is contained in:
2025-06-13 15:39:08 +02:00
parent 4385f0afaa
commit 24712fbb0d
16 changed files with 238 additions and 16 deletions

View File

@@ -0,0 +1,19 @@
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Poison Touch is an ability that may poison targets when the Pokémon uses a contact move.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Poison_Touch_(Ability)">Bulbapedia - Poison Touch</see>
/// </summary>
[Script(ScriptCategory.Ability, "poison_touch")]
public class PoisonTouch : Script
{
private const int PoisonChance = 30;
/// <inheritdoc />
public override void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
{
if (move.GetHitData(target, hit).IsContact && move.Battle.Random.GetInt(0, 100) < PoisonChance)
move.User.SetStatus(ScriptUtils.ResolveName<Status.Poisoned>(), false);
}
}