This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user