Initial setup for testing AI performance, random fixes
All checks were successful
Build / Build (push) Successful in 54s
All checks were successful
Build / Build (push) Successful in 54s
This commit is contained in:
@@ -48,7 +48,6 @@ public class BideEffect : Script, IScriptForceTurnSelection, IScriptOnIncomingHi
|
||||
choice = _choice;
|
||||
return;
|
||||
}
|
||||
var opposingSideIndex = (byte)(_owner.BattleData?.SideIndex == 0 ? 1 : 0);
|
||||
choice = _choice = TurnChoiceHelper.CreateMoveChoice(_owner, "bide", opposingSideIndex, position);
|
||||
choice = _choice = TurnChoiceHelper.CreateMoveChoice(_owner, "bide", ownerBattleData.SideIndex, position);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "require_charge")]
|
||||
public class RequireChargeEffect(IPokemon owner, StringKey moveName) : BaseChargeEffect(owner, moveName);
|
||||
@@ -1,10 +1,17 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
public class TruantEffect(IPokemon owner) : Script, IScriptForceTurnSelection
|
||||
[Script(ScriptCategory.Pokemon, "truant_effect")]
|
||||
public class TruantEffect(IPokemon owner) : Script, IScriptForceTurnSelection, IScriptOnEndTurn
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void ForceTurnSelection(IBattle battle, byte sideIndex, byte position, ref ITurnChoice? choice)
|
||||
{
|
||||
choice = new PassChoice(owner);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnEndTurn(IScriptSource _, IBattle battle)
|
||||
{
|
||||
RemoveSelf();
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,7 @@ public class WhirlpoolEffect : Script, IScriptOnEndTurn, IScriptPreventOpponentR
|
||||
if (_user == null)
|
||||
return;
|
||||
|
||||
List<PokemonTurn>? pokemonToRemove = null;
|
||||
foreach (var pokemonTurn in _targetedPokemon.Where(x => x.Pokemon.BattleData?.IsOnBattlefield == true))
|
||||
{
|
||||
var pokemon = pokemonTurn.Pokemon;
|
||||
@@ -68,8 +69,15 @@ public class WhirlpoolEffect : Script, IScriptOnEndTurn, IScriptPreventOpponentR
|
||||
pokemonTurn.Turns--;
|
||||
if (pokemonTurn.Turns <= 0)
|
||||
{
|
||||
_targetedPokemon.Remove(pokemonTurn);
|
||||
pokemonToRemove ??= [];
|
||||
pokemonToRemove.Add(pokemonTurn);
|
||||
}
|
||||
}
|
||||
if (pokemonToRemove == null)
|
||||
return;
|
||||
foreach (var turn in pokemonToRemove)
|
||||
{
|
||||
_targetedPokemon.Remove(turn);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user