Implements a bunch more moves
This commit is contained in:
29
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Infestation.cs
Normal file
29
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Infestation.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "infestation")]
|
||||
public class Infestation : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var infestationEffect = ScriptUtils.ResolveName<InfestationEffect>();
|
||||
if (target.Volatile.Contains(infestationEffect))
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
}
|
||||
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
return;
|
||||
|
||||
var turns = 4;
|
||||
if (battleData.Battle.Random.GetBool())
|
||||
{
|
||||
turns = 5;
|
||||
}
|
||||
target.Volatile.Add(new InfestationEffect(target, turns));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user