mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 15:44:30 +00:00
54 lines
1.4 KiB
Java
54 lines
1.4 KiB
Java
package kamkeel.npcs.controllers.data.ability;
|
|
|
|
/**
|
|
* Defines what happens to NPC rotation during ability phases.
|
|
* Used with a LockMovementType to control WHEN it applies.
|
|
*/
|
|
public enum RotationMode {
|
|
/**
|
|
* NPC rotates normally via AI look helper.
|
|
*/
|
|
FREE,
|
|
|
|
/**
|
|
* Freeze rotation at the moment the phase starts.
|
|
* NPC stays facing the direction it was looking when the phase began.
|
|
*/
|
|
LOCKED,
|
|
|
|
/**
|
|
* Force NPC to continuously face its target (hit scan).
|
|
* Overrides AI look helper every tick for precise aiming.
|
|
*/
|
|
TRACK;
|
|
|
|
public String getDisplayKey() {
|
|
switch (this) {
|
|
case FREE:
|
|
return "ability.rotation.free";
|
|
case LOCKED:
|
|
return "ability.rotation.locked";
|
|
case TRACK:
|
|
return "ability.rotation.track";
|
|
default:
|
|
return "ability.rotation.free";
|
|
}
|
|
}
|
|
|
|
public static String[] getDisplayKeys() {
|
|
return new String[]{
|
|
"ability.rotation.free",
|
|
"ability.rotation.locked",
|
|
"ability.rotation.track"
|
|
};
|
|
}
|
|
|
|
public static RotationMode fromOrdinal(int ordinal) {
|
|
RotationMode[] values = values();
|
|
if (ordinal >= 0 && ordinal < values.length) {
|
|
return values[ordinal];
|
|
}
|
|
return FREE;
|
|
}
|
|
}
|