More moves implemented
This commit is contained in:
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/SkyAttack.cs
Normal file
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/SkyAttack.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
using PkmnLib.Static;
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user