(ask_olist): Let land units attack as long as they have positive

mobility, except for high-mobility terrain (mountains), where the
rules remain as they were: land units need to have all the mobility
charged for the attack, not counting combat and moving in to occupy.
Rationale: Making sure your land units reach attack positions with
enough mobility left is a pain in the neck.  Requiring only positive
mobility is friendlier, but allows rushing of mountains.
This commit is contained in:
Markus Armbruster 2006-06-17 14:28:59 +00:00
parent df6f365a71
commit 2673a258fe

View file

@ -1037,13 +1037,29 @@ ask_olist(int combat_mode, struct combat *off, struct combat *def,
} }
switch (combat_mode) { switch (combat_mode) {
case A_ATTACK: case A_ATTACK:
mobcost = lnd_pathcost(&land, /*
att_mobcost(off->own, def, * We used to let land units attack only if they have the
lnd_mobtype(&land))); * mobility consumed by the attack, not counting combat
if (land.lnd_mobil < mobcost) { * and moving in to occupy. Making sure your land units
pr("%s does not have enough mobility (%d needed)\n", * reach attack positions with enough mobility left is a
prland(&land), (int)ceil(mobcost)); * pain in the neck. We now require positive mobility,
continue; * just like for marching. Except we don't allow rushing
* of high-mobility sectors (mountains): for those we
* still require attack mobility.
*/
mobcost = att_mobcost(off->own, def, lnd_mobtype(&land));
if (mobcost < 1.0) {
if (land.lnd_mobil <= 0) {
pr("%s is out of mobility\n", prland(&land));
continue;
}
} else {
mobcost = lnd_pathcost(&land, mobcost);
if (land.lnd_mobil < mobcost) {
pr("%s does not have enough mobility (%d needed)\n",
prland(&land), (int)ceil(mobcost));
continue;
}
} }
break; break;
case A_ASSAULT: case A_ASSAULT: