28 lines
784 B
C#
28 lines
784 B
C#
using PkmnLib.Plugin.Gen7.Scripts.Status;
|
|
|
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
[Script(ScriptCategory.Move, "poison_tail")]
|
|
public class PoisonTail : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void ChangeCriticalStage(IExecutingMove move, IPokemon target, byte hit, ref byte stage)
|
|
{
|
|
if (stage == 255)
|
|
return;
|
|
stage += 1;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
|
{
|
|
var battleData = move.User.BattleData;
|
|
if (battleData == null)
|
|
return;
|
|
|
|
if (battleData.Battle.Random.EffectChance(10, move, target, hit))
|
|
{
|
|
target.SetStatus(ScriptUtils.ResolveName<BadlyPoisoned>(), move.User);
|
|
}
|
|
}
|
|
} |