Make another pass through moves file
All checks were successful
Build / Build (push) Successful in 47s
All checks were successful
Build / Build (push) Successful in 47s
This commit is contained in:
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Uproar.cs
Normal file
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Uproar.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "uproar")]
|
||||
public class Uproar : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var battle = move.Battle;
|
||||
|
||||
foreach (var pokemon in battle.Sides.SelectMany(x => x.Pokemon).WhereNotNull())
|
||||
{
|
||||
if (pokemon.HasStatus(ScriptUtils.ResolveName<Status.Sleep>()))
|
||||
{
|
||||
pokemon.ClearStatus();
|
||||
}
|
||||
}
|
||||
var script = battle.Volatile.Add(new UproarEffect());
|
||||
if (script?.Script is UproarEffect uproarEffect)
|
||||
{
|
||||
uproarEffect.SetPlacer(move.User);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user