mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-18 15:24:45 +01:00
Implement !clean command and f affinity
This commit is contained in:
@@ -26,6 +26,7 @@ public class CommandArgs {
|
||||
private int advance = -1;
|
||||
private int talent = -1;
|
||||
private int skill = -1;
|
||||
private int affinity = -1;
|
||||
|
||||
private Int2IntMap map;
|
||||
private ObjectSet<String> flags;
|
||||
@@ -61,6 +62,9 @@ public class CommandArgs {
|
||||
} else if (arg.startsWith("s")) { // Skill
|
||||
this.skill = Utils.parseSafeInt(arg.substring(1));
|
||||
it.remove();
|
||||
} else if (arg.startsWith("f")) { // Affinity level
|
||||
this.affinity = Utils.parseSafeInt(arg.substring(1));
|
||||
it.remove();
|
||||
}
|
||||
} else if (arg.startsWith("-")) { // Flag
|
||||
if (this.flags == null) this.flags = new ObjectOpenHashSet<>();
|
||||
@@ -190,6 +194,16 @@ public class CommandArgs {
|
||||
|
||||
hasChanged = true;
|
||||
}
|
||||
|
||||
if (this.getAffinity() >= 0) {
|
||||
int target = this.getAffinity();
|
||||
if (target > 50) target = 50;
|
||||
if (target < 0) target = 0;
|
||||
if (character.getAffinityLevel() != target) {
|
||||
character.setAffinityLevel(target);
|
||||
hasChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
return hasChanged;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user