More moves

This commit is contained in:
2025-04-17 13:07:45 +02:00
parent 1b54c78b07
commit d02c05874b
31 changed files with 682 additions and 65 deletions

View File

@@ -173,7 +173,9 @@ internal static class MoveTurnExecutor
break;
if (executingMove.GetHitData(target, hitIndex).HasFailed)
break;
if (useMove.Category == MoveCategory.Status)
var category = useMove.Category;
executingMove.RunScriptHook(x => x.ChangeCategory(executingMove, target, hitIndex, ref category));
if (category == MoveCategory.Status)
{
var secondaryEffect = useMove.SecondaryEffect;
if (secondaryEffect != null)

View File

@@ -2,6 +2,7 @@ using PkmnLib.Dynamic.Models;
using PkmnLib.Dynamic.Models.Choices;
using PkmnLib.Dynamic.ScriptHandling.Registry;
using PkmnLib.Static;
using PkmnLib.Static.Moves;
using PkmnLib.Static.Utils;
namespace PkmnLib.Dynamic.ScriptHandling;
@@ -310,14 +311,16 @@ public abstract class Script : IDeepCloneable
/// <summary>
/// This function allows a script to change the actual offensive stat values used when calculating damage
/// </summary>
public virtual void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, ref uint value)
public virtual void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
ref uint value)
{
}
/// <summary>
/// This function allows a script to change the actual defensive stat values used when calculating damage.
/// </summary>
public virtual void ChangeDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit, ref uint value)
public virtual void ChangeDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint offensiveStat,
ref uint value)
{
}
@@ -603,4 +606,8 @@ public abstract class Script : IDeepCloneable
IList<TypeIdentifier> types)
{
}
public virtual void ChangeCategory(IExecutingMove move, IPokemon target, byte hitIndex, ref MoveCategory category)
{
}
}