2025-02-01 14:00:22 +00:00
|
|
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
|
|
|
|
[Script(ScriptCategory.Move, "dream_eater")]
|
|
|
|
public class DreamEater : Script
|
|
|
|
{
|
|
|
|
/// <inheritdoc />
|
|
|
|
public override void BlockOutgoingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
|
|
|
|
{
|
|
|
|
if (!target.HasStatus("asleep"))
|
|
|
|
block = true;
|
|
|
|
}
|
2025-03-02 16:19:57 +00:00
|
|
|
|
2025-02-01 14:00:22 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
|
|
|
{
|
|
|
|
var user = move.User;
|
|
|
|
var damage = move.GetHitData(target, hit).Damage;
|
|
|
|
var healed = (uint)(damage * 0.5f);
|
|
|
|
if (move.User.HasHeldItem("big_root"))
|
|
|
|
healed = (uint)(healed * 1.3f);
|
|
|
|
user.Heal(healed, false);
|
|
|
|
}
|
|
|
|
}
|