More unit tests, more fixes
This commit is contained in:
@@ -3,10 +3,13 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
[Script(ScriptCategory.Move, "dream_eater")]
|
||||
public class DreamEater : Script, IScriptOnSecondaryEffect, IScriptBlockOutgoingHit
|
||||
{
|
||||
private static readonly StringKey AsleepStatus = new("asleep");
|
||||
private static readonly StringKey ComatoseAbility = new("comatose");
|
||||
|
||||
/// <inheritdoc />
|
||||
public void BlockOutgoingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
|
||||
{
|
||||
if (!target.HasStatus("asleep"))
|
||||
if (!target.HasStatus(AsleepStatus) && target.ActiveAbility?.Name != ComatoseAbility)
|
||||
block = true;
|
||||
}
|
||||
|
||||
@@ -23,6 +26,8 @@ public class DreamEater : Script, IScriptOnSecondaryEffect, IScriptBlockOutgoing
|
||||
target.RunScriptHook<IScriptCustomTrigger>(x => x.CustomTrigger(CustomTriggers.ModifyDrain, args));
|
||||
var invert = args.Invert;
|
||||
healed = args.Healed;
|
||||
if (healed == 0)
|
||||
healed = 1;
|
||||
|
||||
if (invert)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user