Add a LEVEL option to the mana command

This commit is contained in:
Sollace 2024-02-12 13:27:50 +00:00
parent 6465d99e3e
commit bb661da35e
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -32,6 +32,11 @@ public class ManaCommand {
var bar = type.getBar(pony.getMagicalReserves());
float value = source.getArgument("value", Float.class);
if (type == ManaType.LEVEL) {
pony.getLevel().set((int)value);
value -= (int)value;
type = ManaType.XP;
}
if (type == ManaType.XP) {
int currentLevel = pony.getLevel().get();
while (type == ManaType.XP && value > 1) {
@ -52,7 +57,8 @@ public class ManaCommand {
EXHAUSTION(MagicReserves::getExhaustion),
ENERGY(MagicReserves::getEnergy),
MANA(MagicReserves::getMana),
XP(MagicReserves::getXp);
XP(MagicReserves::getXp),
LEVEL(MagicReserves::getXp);
private final Function<MagicReserves, MagicReserves.Bar> getter;