diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/MoveVolatile/FireGrassPledgeMove.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/MoveVolatile/FireGrassPledgeMove.cs
new file mode 100644
index 0000000..d982e9d
--- /dev/null
+++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/MoveVolatile/FireGrassPledgeMove.cs
@@ -0,0 +1,25 @@
+using PkmnLib.Plugin.Gen7.Scripts.Side;
+
+namespace PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
+
+[Script(ScriptCategory.MoveVolatile, "fire_grass_pledge")]
+public class FireGrassPledgeMove : Script
+{
+ ///
+ public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
+ {
+ moveName = "fire_pledge";
+ }
+
+ ///
+ public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
+ {
+ basePower = 150;
+ }
+
+ ///
+ public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
+ {
+ target.BattleData?.BattleSide.VolatileScripts.Add(new SeaOfFireEffect());
+ }
+}
\ No newline at end of file
diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/MoveVolatile/FireWaterPledgeMove.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/MoveVolatile/FireWaterPledgeMove.cs
new file mode 100644
index 0000000..3467f2b
--- /dev/null
+++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/MoveVolatile/FireWaterPledgeMove.cs
@@ -0,0 +1,25 @@
+using PkmnLib.Plugin.Gen7.Scripts.Side;
+
+namespace PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
+
+[Script(ScriptCategory.MoveVolatile, "fire_water_pledge")]
+public class FireWaterPledgeMove : Script
+{
+ ///
+ public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
+ {
+ moveName = "water_pledge";
+ }
+
+ ///
+ public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
+ {
+ basePower = 150;
+ }
+
+ ///
+ public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
+ {
+ move.User.BattleData?.BattleSide.VolatileScripts.Add(new RainbowEffect());
+ }
+}
\ No newline at end of file
diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/MoveVolatile/GrassWaterPledgeMove.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/MoveVolatile/GrassWaterPledgeMove.cs
new file mode 100644
index 0000000..31db24e
--- /dev/null
+++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/MoveVolatile/GrassWaterPledgeMove.cs
@@ -0,0 +1,25 @@
+using PkmnLib.Plugin.Gen7.Scripts.Side;
+
+namespace PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
+
+[Script(ScriptCategory.MoveVolatile, "grass_water_pledge")]
+public class GrassWaterPledgeMove : Script
+{
+ ///
+ public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
+ {
+ moveName = "grass_pledge";
+ }
+
+ ///
+ public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
+ {
+ basePower = 150;
+ }
+
+ ///
+ public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
+ {
+ move.User.BattleData?.BattleSide.VolatileScripts.Add(new SwampEffect());
+ }
+}
\ No newline at end of file
diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/FirePledge.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/FirePledge.cs
index ee1c23b..e2f3a1d 100644
--- a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/FirePledge.cs
+++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/FirePledge.cs
@@ -1,7 +1,35 @@
+using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
+
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "fire_pledge")]
public class FirePledge : Script
{
- // TODO: pledge moves
+ ///
+ public override void StopBeforeMove(IExecutingMove move, ref bool stop)
+ {
+ if (move.MoveChoice.Volatile.Contains() ||
+ move.MoveChoice.Volatile.Contains())
+ {
+ return;
+ }
+
+ var pledgeMove = (IMoveChoice?)move.Battle.ChoiceQueue?.FirstOrDefault(x =>
+ x is IMoveChoice mc && mc.User.BattleData?.SideIndex == move.User.BattleData?.SideIndex &&
+ (mc.ChosenMove.MoveData.Name == "water_pledge" || mc.ChosenMove.MoveData.Name == "grass_pledge"));
+ if (pledgeMove is null)
+ return;
+
+ // If a pledge move is already queued, we stop the current move.
+ stop = true;
+
+ if (pledgeMove.ChosenMove.MoveData.Name == "water_pledge")
+ {
+ pledgeMove.Volatile.Add(new FireWaterPledgeMove());
+ }
+ else if (pledgeMove.ChosenMove.MoveData.Name == "grass_pledge")
+ {
+ pledgeMove.Volatile.Add(new FireGrassPledgeMove());
+ }
+ }
}
\ No newline at end of file
diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GrassPledge.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GrassPledge.cs
index 0ef9511..469315c 100644
--- a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GrassPledge.cs
+++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/GrassPledge.cs
@@ -1,7 +1,35 @@
+using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
+
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "grass_pledge")]
public class GrassPledge : Script
{
- // TODO: pledge moves
+ ///
+ public override void StopBeforeMove(IExecutingMove move, ref bool stop)
+ {
+ if (move.MoveChoice.Volatile.Contains() ||
+ move.MoveChoice.Volatile.Contains())
+ {
+ return;
+ }
+
+ var pledgeMove = (IMoveChoice?)move.Battle.ChoiceQueue?.FirstOrDefault(x =>
+ x is IMoveChoice mc && mc.User.BattleData?.SideIndex == move.User.BattleData?.SideIndex &&
+ (mc.ChosenMove.MoveData.Name == "water_pledge" || mc.ChosenMove.MoveData.Name == "fire_pledge"));
+ if (pledgeMove is null)
+ return;
+
+ // If a pledge move is already queued, we stop the current move.
+ stop = true;
+
+ if (pledgeMove.ChosenMove.MoveData.Name == "water_pledge")
+ {
+ pledgeMove.Volatile.Add(new GrassWaterPledgeMove());
+ }
+ else if (pledgeMove.ChosenMove.MoveData.Name == "fire_pledge")
+ {
+ pledgeMove.Volatile.Add(new FireGrassPledgeMove());
+ }
+ }
}
\ No newline at end of file
diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Incinerate.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Incinerate.cs
index c3ee7c1..c811600 100644
--- a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Incinerate.cs
+++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Incinerate.cs
@@ -11,6 +11,10 @@ public class Incinerate : Script
move.GetHitData(target, hit).Fail();
return;
}
- // TODO: Add message for item incineration
+ move.Battle.EventHook.Invoke(new DialogEvent("item_incinerated", new Dictionary
+ {
+ { "pokemon", target },
+ { "item", target.HeldItem },
+ }));
}
}
\ No newline at end of file
diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/WaterPledge.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/WaterPledge.cs
index 0c6e2e4..5f86bef 100644
--- a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/WaterPledge.cs
+++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/WaterPledge.cs
@@ -1,7 +1,35 @@
+using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
+
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "water_pledge")]
public class WaterPledge : Script
{
- // TODO: pledge moves
+ ///
+ public override void StopBeforeMove(IExecutingMove move, ref bool stop)
+ {
+ if (move.MoveChoice.Volatile.Contains() ||
+ move.MoveChoice.Volatile.Contains())
+ {
+ return;
+ }
+
+ var pledgeMove = (IMoveChoice?)move.Battle.ChoiceQueue?.FirstOrDefault(x =>
+ x is IMoveChoice mc && mc.User.BattleData?.SideIndex == move.User.BattleData?.SideIndex &&
+ (mc.ChosenMove.MoveData.Name == "grass_pledge" || mc.ChosenMove.MoveData.Name == "fire_pledge"));
+ if (pledgeMove is null)
+ return;
+
+ // If a pledge move is already queued, we stop the current move.
+ stop = true;
+
+ if (pledgeMove.ChosenMove.MoveData.Name == "grass_pledge")
+ {
+ pledgeMove.Volatile.Add(new GrassWaterPledgeMove());
+ }
+ else if (pledgeMove.ChosenMove.MoveData.Name == "fire_pledge")
+ {
+ pledgeMove.Volatile.Add(new FireWaterPledgeMove());
+ }
+ }
}
\ No newline at end of file
diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/RainbowEffect.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/RainbowEffect.cs
new file mode 100644
index 0000000..9854b8a
--- /dev/null
+++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/RainbowEffect.cs
@@ -0,0 +1,21 @@
+namespace PkmnLib.Plugin.Gen7.Scripts.Side;
+
+[Script(ScriptCategory.Side, "rainbow_effect")]
+public class RainbowEffect : Script
+{
+ private int _turns = 5;
+
+ ///
+ public override void ChangeEffectChance(IExecutingMove move, IPokemon target, byte hit, ref float chance)
+ {
+ chance *= 2;
+ }
+
+ ///
+ public override void OnEndTurn(IScriptSource owner, IBattle battle)
+ {
+ _turns--;
+ if (_turns <= 0)
+ RemoveSelf();
+ }
+}
\ No newline at end of file
diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SeaOfFireEffect.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SeaOfFireEffect.cs
new file mode 100644
index 0000000..7ad8fc6
--- /dev/null
+++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SeaOfFireEffect.cs
@@ -0,0 +1,28 @@
+namespace PkmnLib.Plugin.Gen7.Scripts.Side;
+
+[Script(ScriptCategory.Side, "sea_of_fire_effect")]
+public class SeaOfFireEffect : Script
+{
+ private int _turns = 5;
+
+ ///
+ public override void OnEndTurn(IScriptSource owner, IBattle battle)
+ {
+ if (owner is not IBattleSide side)
+ return;
+ _turns--;
+ if (_turns <= 0)
+ {
+ RemoveSelf();
+ return;
+ }
+
+ foreach (var pokemon in side.Pokemon.WhereNotNull())
+ {
+ if (pokemon.Types.Any(x => x.Name == "fire"))
+ continue;
+
+ pokemon.Damage(pokemon.MaxHealth / 8, DamageSource.Misc);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SwampEffect.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SwampEffect.cs
new file mode 100644
index 0000000..4502c79
--- /dev/null
+++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SwampEffect.cs
@@ -0,0 +1,21 @@
+namespace PkmnLib.Plugin.Gen7.Scripts.Side;
+
+[Script(ScriptCategory.Side, "swamp_effect")]
+public class SwampEffect : Script
+{
+ private int _turns = 5;
+
+ ///
+ public override void ChangeSpeed(ITurnChoice choice, ref uint speed)
+ {
+ speed /= 4;
+ }
+
+ ///
+ public override void OnEndTurn(IScriptSource owner, IBattle battle)
+ {
+ _turns--;
+ if (_turns <= 0)
+ RemoveSelf();
+ }
+}
\ No newline at end of file