Combat Policy: Tactical Completed

- Added Normal / Reverse Button

Tactical targets the strongest threat, while Reverse targets the weakest ones
This commit is contained in:
Kam committed 2024-03-13 20:02:38 -04:00
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;
}
}