More moves implemented
This commit is contained in:
@@ -27,7 +27,7 @@ public class ChargeBounceEffect : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (!move.UseMove.HasFlag("effective_against_fly"))
|
||||
damage *= 2;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class DigEffect : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (!move.UseMove.HasFlag("effective_against_underground"))
|
||||
damage *= 2;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class DiveEffect : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (!move.UseMove.HasFlag("effective_against_underwater"))
|
||||
damage *= 2;
|
||||
|
||||
31
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/EmbargoEffect.cs
Normal file
31
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/EmbargoEffect.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using PkmnLib.Static;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "embargo")]
|
||||
public class EmbargoEffect : Script
|
||||
{
|
||||
private int _turns = 5;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventHeldItemConsume(IPokemon pokemon, IItem heldItem, ref bool prevented)
|
||||
{
|
||||
prevented = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Stack()
|
||||
{
|
||||
_turns = 5;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IBattle battle)
|
||||
{
|
||||
_turns--;
|
||||
if (_turns == 0)
|
||||
{
|
||||
RemoveSelf();
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/EncoreEffect.cs
Normal file
42
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/EncoreEffect.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "encore")]
|
||||
public class EncoreEffect : Script
|
||||
{
|
||||
private readonly IPokemon _owner;
|
||||
private readonly StringKey _move;
|
||||
private int _turns;
|
||||
|
||||
public EncoreEffect(IPokemon owner, StringKey move, int turns)
|
||||
{
|
||||
_owner = owner;
|
||||
_move = move;
|
||||
_turns = turns;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ForceTurnSelection(byte sideIndex, byte position, ref ITurnChoice? choice)
|
||||
{
|
||||
var opposingSideIndex = (byte)(_owner.BattleData?.SideIndex == 0 ? 1 : 0);
|
||||
choice = TurnChoiceHelper.CreateMoveChoice(_owner, _move, opposingSideIndex, position);
|
||||
if (choice is IMoveChoice { ChosenMove.CurrentPp: <= 0 } moveChoice)
|
||||
{
|
||||
choice =
|
||||
moveChoice.User.BattleData?.Battle.Library.MiscLibrary.ReplacementChoice(_owner, opposingSideIndex,
|
||||
position);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IBattle battle)
|
||||
{
|
||||
_turns--;
|
||||
if (_turns <= 0)
|
||||
{
|
||||
RemoveSelf();
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/EndureEffect.cs
Normal file
15
Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/EndureEffect.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "endure")]
|
||||
public class EndureEffect : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingDamage(IPokemon pokemon, DamageSource source, ref uint damage)
|
||||
{
|
||||
if (damage > pokemon.CurrentHealth)
|
||||
damage = pokemon.CurrentHealth - 1;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IBattle battle) => RemoveSelf();
|
||||
}
|
||||
Reference in New Issue
Block a user