26 lines
770 B
C#
26 lines
770 B
C#
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
|
|
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
[Script(ScriptCategory.Move, "sky_attack")]
|
|
public class SkyAttack : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
|
{
|
|
if (move.User.Volatile.Contains<SkyAttackEffect>())
|
|
return;
|
|
move.User.Volatile.Add(new SkyAttackEffect(move.User));
|
|
prevent = true;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
|
{
|
|
move.User.Volatile.Remove<SkyAttackEffect>();
|
|
if (move.Battle.Random.EffectChance(30, move, target, hit))
|
|
{
|
|
target.Volatile.Add(new FlinchEffect());
|
|
}
|
|
}
|
|
} |