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:
16
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Feint.cs
Normal file
16
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Feint.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "feint")]
|
||||
public class Feint : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeHit(IExecutingMove move, IPokemon target, byte hitIndex)
|
||||
{
|
||||
if (target.Volatile.Contains<ProtectionEffectScript>())
|
||||
{
|
||||
target.Volatile.Remove<ProtectionEffectScript>();
|
||||
}
|
||||
}
|
||||
}
|
||||
7
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/HappyHour.cs
Normal file
7
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/HappyHour.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "happy_hour")]
|
||||
public class HappyHour : Script
|
||||
{
|
||||
// TODO: Implement Happy Hour
|
||||
}
|
||||
@@ -8,10 +8,7 @@ public class IncreasedCriticalStage : Script
|
||||
{
|
||||
// Extreme edge case, should never happen
|
||||
if (stage == byte.MaxValue)
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
}
|
||||
stage += 1;
|
||||
}
|
||||
}
|
||||
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/MagneticFlux.cs
Normal file
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/MagneticFlux.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "magnetic_flux")]
|
||||
public class MagneticFlux : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData is null)
|
||||
return;
|
||||
|
||||
foreach (var pokemon in battleData.BattleSide.Pokemon.WhereNotNull())
|
||||
{
|
||||
if (pokemon.ActiveAbility?.Name != "plus" && pokemon.ActiveAbility?.Name != "minus")
|
||||
continue;
|
||||
|
||||
EventBatchId batch = new();
|
||||
pokemon.ChangeStatBoost(Statistic.Defense, 1, pokemon == move.User, batch);
|
||||
pokemon.ChangeStatBoost(Statistic.SpecialDefense, 1, pokemon == move.User, batch);
|
||||
}
|
||||
}
|
||||
}
|
||||
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