39 lines
1.1 KiB
C#
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
|
|
{
|
|
/// <inheritdoc />
|
|
/// <inheritdoc />
|
|
public override 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);
|
|
}
|
|
}
|
|
} |