Excerpt from the code:
That doesn't seem to have a lot of effect. Everytime an element is damaged, this check is done and the element will die. This is already in as of current code you got, but has little impact. The formula is thus this one:
If current health < max health / (10 * (1 + morale/20)), then die. Morale is on average 10, so that translates to:
maw health / 15. For elephants (morale 4) it's max / 12. I will change that to max health/morale. Morale of 1 or less will be treated as 1. Thus it will be easy to mod things, just change the morale to set the threshold.
Also, I've set a -nopatrol command-line switch. If not enabled, then militia will raise to help the defender even if they are not the same ethnicity or there's no discrimination.
private boolean tookTooMuchDamage()
{
if (isMilitia())
return false;
UnitClass unit = (UnitClass)getUnit();
float personnel = unit.getArchetype().getManpower(unitType);
if (manPower * (1f + getMorale()/20f) < (personnel/10f))
return true;
return false;
}
{
if (isMilitia())
return false;
UnitClass unit = (UnitClass)getUnit();
float personnel = unit.getArchetype().getManpower(unitType);
if (manPower * (1f + getMorale()/20f) < (personnel/10f))
return true;
return false;
}
If current health < max health / (10 * (1 + morale/20)), then die. Morale is on average 10, so that translates to:
maw health / 15. For elephants (morale 4) it's max / 12. I will change that to max health/morale. Morale of 1 or less will be treated as 1. Thus it will be easy to mod things, just change the morale to set the threshold.
Also, I've set a -nopatrol command-line switch. If not enabled, then militia will raise to help the defender even if they are not the same ethnicity or there's no discrimination.
Comment