19 lines
546 B
C#

using PkmnLib.Plugin.Gen7.Scripts.Weather;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "shore_up")]
public class ShoreUp : Script, IScriptOnSecondaryEffect
{
/// <inheritdoc />
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
var healMod = 0.5f;
if (move.Battle.WeatherName == ScriptUtils.ResolveName<Sandstorm>())
{
healMod = 2f / 3f;
}
var heal = (uint)(target.MaxHealth * healMod);
target.Heal(heal);
}
}