mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 16:09:05 +00:00
Combat Policy: Tactical Completed
- Added Normal / Reverse Button Tactical targets the strongest threat, while Reverse targets the weakest ones
This commit is contained in:
1 parent
d8f320f79c
commit
b17d95edde
4 files changed
+19
-3
No files matched your search
@@ -139,12 +139,14 @@ public class CombatHandler {
|
||||
return randomNum <= chance;
|
||||
}
|
||||
|
||||
public boolean shouldSwitchTactically(EntityLivingBase originalTarget, EntityLivingBase newTarget) {
|
||||
public boolean shouldSwitchTactically(EntityLivingBase originalTarget, EntityLivingBase newTarget, boolean reverse) {
|
||||
// Implement your Tactical Switcher conditions here
|
||||
// Example: Switch if the new target has a higher threat level
|
||||
float currentThreat = calculateThreatLevel(originalTarget);
|
||||
float newThreat = calculateThreatLevel(newTarget);
|
||||
|
||||
if(reverse){
|
||||
return newThreat < currentThreat;
|
||||
}
|
||||
return newThreat > currentThreat;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user