50 files changed
+80425
-20485
No files matched your search
@@ -0,0 +1,25 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Flame Body is an ability that has a 30% chance of burning the attacker when hit by a contact move.
|
||||
/// This ability is similar to Effect Spore and Static, but inflicts burn instead of other status conditions.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Flame_Body_(Ability)">Bulbapedia - Flame Body</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "flame_body")]
|
||||
public class FlameBody : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
if (!move.UseMove.HasFlag("contact"))
|
||||
return;
|
||||
|
||||
var rng = move.Battle.Random;
|
||||
if (rng.GetInt(0, 100) >= 30) // 30% chance
|
||||
return;
|
||||
|
||||
move.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
|
||||
move.User.SetStatus(ScriptUtils.ResolveName<Status.Burned>());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user