mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Add a LEVEL option to the mana command
This commit is contained in:
parent
6465d99e3e
commit
bb661da35e
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue