23 lines
737 B
C#
23 lines
737 B
C#
|
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;
|
||
|
}
|
||
|
|
||
|
/// <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);
|
||
|
}
|
||
|
}
|