Implements confusion effect
All checks were successful
Build / Build (push) Successful in 52s

This commit is contained in:
2025-06-22 11:56:29 +02:00
parent 6394f4eab3
commit 6d448e4e8d
6 changed files with 137 additions and 33 deletions

View File

@@ -189,7 +189,8 @@ public static class MoveTurnExecutor
var basePower = battle.Library.DamageCalculator.GetBasePower(executingMove, target, hitIndex, hitData);
hitData.BasePower = basePower;
hitData.Damage = battle.Library.DamageCalculator.GetDamage(executingMove, target, hitIndex, hitData);
hitData.Damage = battle.Library.DamageCalculator.GetDamage(executingMove, executingMove.UseMove.Category,
executingMove.User, target, executingMove.TargetCount, hitIndex, hitData);
var accuracy = useMove.Accuracy;
// If the accuracy is 255, the move should always hit, and as such we should not allow

View File

@@ -1,4 +1,5 @@
using PkmnLib.Dynamic.Models;
using PkmnLib.Static.Moves;
namespace PkmnLib.Dynamic.Libraries;
@@ -10,7 +11,8 @@ public interface IDamageCalculator
/// <summary>
/// Calculate the damage for a given hit on a Pokemon.
/// </summary>
uint GetDamage(IExecutingMove executingMove, IPokemon target, byte hitNumber, IHitData hitData);
uint GetDamage(IExecutingMove? executingMove, MoveCategory category, IPokemon user, IPokemon target,
int targetCount, byte hitNumber, IHitData hitData);
/// <summary>
/// Calculate the base power for a given hit on a Pokemon.