This commit is contained in:
parent
6d448e4e8d
commit
43813c1c1c
@ -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
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||||
|
{
|
||||||
|
moveName = "fire_pledge";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||||
|
{
|
||||||
|
basePower = 150;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||||
|
{
|
||||||
|
target.BattleData?.BattleSide.VolatileScripts.Add(new SeaOfFireEffect());
|
||||||
|
}
|
||||||
|
}
|
@ -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
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||||
|
{
|
||||||
|
moveName = "water_pledge";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||||
|
{
|
||||||
|
basePower = 150;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||||
|
{
|
||||||
|
move.User.BattleData?.BattleSide.VolatileScripts.Add(new RainbowEffect());
|
||||||
|
}
|
||||||
|
}
|
@ -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
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||||
|
{
|
||||||
|
moveName = "grass_pledge";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||||
|
{
|
||||||
|
basePower = 150;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||||
|
{
|
||||||
|
move.User.BattleData?.BattleSide.VolatileScripts.Add(new SwampEffect());
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,35 @@
|
|||||||
|
using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||||
|
|
||||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||||
|
|
||||||
[Script(ScriptCategory.Move, "fire_pledge")]
|
[Script(ScriptCategory.Move, "fire_pledge")]
|
||||||
public class FirePledge : Script
|
public class FirePledge : Script
|
||||||
{
|
{
|
||||||
// TODO: pledge moves
|
/// <inheritdoc />
|
||||||
|
public override void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||||
|
{
|
||||||
|
if (move.MoveChoice.Volatile.Contains<FireWaterPledgeMove>() ||
|
||||||
|
move.MoveChoice.Volatile.Contains<FireGrassPledgeMove>())
|
||||||
|
{
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,7 +1,35 @@
|
|||||||
|
using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||||
|
|
||||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||||
|
|
||||||
[Script(ScriptCategory.Move, "grass_pledge")]
|
[Script(ScriptCategory.Move, "grass_pledge")]
|
||||||
public class GrassPledge : Script
|
public class GrassPledge : Script
|
||||||
{
|
{
|
||||||
// TODO: pledge moves
|
/// <inheritdoc />
|
||||||
|
public override void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||||
|
{
|
||||||
|
if (move.MoveChoice.Volatile.Contains<GrassWaterPledgeMove>() ||
|
||||||
|
move.MoveChoice.Volatile.Contains<FireGrassPledgeMove>())
|
||||||
|
{
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -11,6 +11,10 @@ public class Incinerate : Script
|
|||||||
move.GetHitData(target, hit).Fail();
|
move.GetHitData(target, hit).Fail();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO: Add message for item incineration
|
move.Battle.EventHook.Invoke(new DialogEvent("item_incinerated", new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
{ "pokemon", target },
|
||||||
|
{ "item", target.HeldItem },
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,35 @@
|
|||||||
|
using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||||
|
|
||||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||||
|
|
||||||
[Script(ScriptCategory.Move, "water_pledge")]
|
[Script(ScriptCategory.Move, "water_pledge")]
|
||||||
public class WaterPledge : Script
|
public class WaterPledge : Script
|
||||||
{
|
{
|
||||||
// TODO: pledge moves
|
/// <inheritdoc />
|
||||||
|
public override void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||||
|
{
|
||||||
|
if (move.MoveChoice.Volatile.Contains<GrassWaterPledgeMove>() ||
|
||||||
|
move.MoveChoice.Volatile.Contains<FireWaterPledgeMove>())
|
||||||
|
{
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
21
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/RainbowEffect.cs
Normal file
21
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/RainbowEffect.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||||
|
|
||||||
|
[Script(ScriptCategory.Side, "rainbow_effect")]
|
||||||
|
public class RainbowEffect : Script
|
||||||
|
{
|
||||||
|
private int _turns = 5;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeEffectChance(IExecutingMove move, IPokemon target, byte hit, ref float chance)
|
||||||
|
{
|
||||||
|
chance *= 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
|
{
|
||||||
|
_turns--;
|
||||||
|
if (_turns <= 0)
|
||||||
|
RemoveSelf();
|
||||||
|
}
|
||||||
|
}
|
28
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SeaOfFireEffect.cs
Normal file
28
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SeaOfFireEffect.cs
Normal file
@ -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;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
21
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SwampEffect.cs
Normal file
21
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SwampEffect.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||||
|
|
||||||
|
[Script(ScriptCategory.Side, "swamp_effect")]
|
||||||
|
public class SwampEffect : Script
|
||||||
|
{
|
||||||
|
private int _turns = 5;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeSpeed(ITurnChoice choice, ref uint speed)
|
||||||
|
{
|
||||||
|
speed /= 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
|
{
|
||||||
|
_turns--;
|
||||||
|
if (_turns <= 0)
|
||||||
|
RemoveSelf();
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user