Initial set up for item use
This commit is contained in:
54
PkmnLib.Dynamic/ScriptHandling/ItemScript.cs
Normal file
54
PkmnLib.Dynamic/ScriptHandling/ItemScript.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using PkmnLib.Dynamic.Models;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Dynamic.ScriptHandling;
|
||||
|
||||
public abstract class ItemScript : IDeepCloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes the script with the given parameters for a specific item
|
||||
/// </summary>
|
||||
public virtual void OnInitialize(IReadOnlyDictionary<StringKey, object?>? parameters)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the item is usable in the current context.
|
||||
/// </summary>
|
||||
public virtual bool IsItemUsable => false;
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the item requires a target to be used.
|
||||
/// </summary>
|
||||
public virtual bool RequiresTarget => false;
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the item is usable on the given target.
|
||||
/// </summary>
|
||||
public virtual bool IsTargetValid(IPokemon target) => false;
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the item can be held by a Pokémon.
|
||||
/// </summary>
|
||||
public virtual bool IsHoldable => false;
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the item can be held by the given target.
|
||||
/// </summary>
|
||||
public virtual bool CanTargetHold(IPokemon pokemon) => false;
|
||||
|
||||
/// <summary>
|
||||
/// Handles the use of the item.
|
||||
/// </summary>
|
||||
public virtual void OnUse()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the use of the item on the given target.
|
||||
/// </summary>
|
||||
/// <param name="target"></param>
|
||||
public virtual void OnUseWithTarget(IPokemon target)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user