Even more moves
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-05-05 16:58:03 +02:00
parent 292c303fc0
commit 7727f92f4e
132 changed files with 624 additions and 171 deletions

View File

@@ -76,6 +76,11 @@ public interface ILearnedMove : IDeepCloneable
/// </summary>
bool TryUse(byte amount = 1);
/// <summary>
/// Reduce the remaining PP by a certain amount. If the number of PP is already 0, return false.
/// </summary>
bool ReduceUses(byte amount = 1);
/// <summary>
/// Set the remaining PP to the max amount of PP.
/// </summary>
@@ -139,6 +144,20 @@ public class LearnedMoveImpl : ILearnedMove
return true;
}
/// <inheritdoc />
public bool ReduceUses(byte amount = 1)
{
if (CurrentPp == 0)
return false;
if (CurrentPp >= amount)
CurrentPp -= amount;
else
CurrentPp = 0;
return true;
}
/// <summary>
/// Restore the PP to the maximum amount of PP.
/// </summary>