2025-03-07 10:50:59 +00:00
|
|
|
using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
2025-03-07 11:07:57 +00:00
|
|
|
using PkmnLib.Static.Utils;
|
2025-03-07 10:50:59 +00:00
|
|
|
|
|
|
|
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
|
|
|
|
|
|
|
public abstract class BaseChargeEffect : Script
|
|
|
|
{
|
|
|
|
private readonly IPokemon _owner;
|
2025-03-07 11:07:57 +00:00
|
|
|
private readonly StringKey _moveName;
|
2025-03-07 10:50:59 +00:00
|
|
|
|
2025-03-07 11:07:57 +00:00
|
|
|
public BaseChargeEffect(IPokemon owner, StringKey moveName)
|
2025-03-07 10:50:59 +00:00
|
|
|
{
|
|
|
|
_owner = owner;
|
|
|
|
_moveName = moveName;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <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, _moveName, opposingSideIndex, position);
|
|
|
|
}
|
|
|
|
}
|