Items can be used on Pokemon outside of battle, and we want the user of the library to be able to check for what changed. This allows for example a heal event to be sent back to the user of the library after using an item.
This commit is contained in:
7 files changed
+21
-17
No files matched your search
@@ -34,8 +34,8 @@ public class HealingItem : ItemScript
|
||||
public override bool IsTargetValid(IPokemon target) => !target.IsFainted;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnUseWithTarget(IPokemon target)
|
||||
public override void OnUseWithTarget(IPokemon target, EventHook eventHook)
|
||||
{
|
||||
target.Heal(_healAmount);
|
||||
target.Heal(_healAmount, customEventHook: eventHook);
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,6 @@ public class BugBite : Script
|
||||
}
|
||||
|
||||
_ = target.SetHeldItem(null);
|
||||
targetHeldItem.RunItemScript(battleData.Battle.Library.ScriptResolver, user);
|
||||
targetHeldItem.RunItemScript(battleData.Battle.Library.ScriptResolver, user, move.Battle.EventHook);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user