More move scripts
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using PkmnLib.Dynamic.Models;
|
||||
using PkmnLib.Dynamic.ScriptHandling;
|
||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "heal_each_end_of_turn_effect")]
|
||||
public class HealEachEndOfTurnEffect : Script
|
||||
{
|
||||
private readonly float _healPercentage;
|
||||
private readonly IPokemon? _pokemon;
|
||||
|
||||
private HealEachEndOfTurnEffect()
|
||||
{
|
||||
}
|
||||
|
||||
public HealEachEndOfTurnEffect(float healPercentage, IPokemon pokemon)
|
||||
{
|
||||
_healPercentage = healPercentage;
|
||||
_pokemon = pokemon;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn()
|
||||
{
|
||||
if (_pokemon is null)
|
||||
return;
|
||||
if (_pokemon.BattleData?.IsOnBattlefield != true)
|
||||
return;
|
||||
|
||||
var amount = _pokemon.BoostedStats.Hp * _healPercentage;
|
||||
if (_pokemon.HasHeldItem("big_root"))
|
||||
amount *= 1.3f;
|
||||
_pokemon.Heal((uint)amount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using PkmnLib.Dynamic.Models.Choices;
|
||||
using PkmnLib.Dynamic.ScriptHandling;
|
||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "prevent_foes_exit_effect")]
|
||||
public class PreventFoesExitEffect : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventOpponentSwitch(ISwitchChoice choice, ref bool prevent)
|
||||
{
|
||||
prevent = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventOpponentRunAway(IFleeChoice choice, ref bool prevent)
|
||||
{
|
||||
prevent = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user