Deukhoofd 7c270a6d52
All checks were successful
Build / Build (push) Successful in 1m1s
Finish script interface refactor
2025-07-06 10:27:56 +02:00

39 lines
1.1 KiB
C#

using PkmnLib.Static.Moves;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "pollen_puff")]
public class PollenPuff : Script, IScriptOnSecondaryEffect, IScriptChangeCategory
{
/// <inheritdoc />
/// <inheritdoc />
public void ChangeCategory(IExecutingMove move, IPokemon target, byte hitIndex, ref MoveCategory category)
{
var battleData = move.User.BattleData;
var targetBattleData = target.BattleData;
if (battleData == null || targetBattleData == null)
return;
if (battleData.SideIndex == targetBattleData.SideIndex)
{
category = MoveCategory.Status;
}
}
/// <inheritdoc />
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
var battleData = move.User.BattleData;
var targetBattleData = target.BattleData;
if (battleData == null || targetBattleData == null)
return;
if (battleData.SideIndex == targetBattleData.SideIndex)
{
var maxHealth = target.MaxHealth;
target.Heal(maxHealth / 2);
}
}
}