Bug #1803 » 0045-AI-Try-Collect-Ransom-as-an-attack-action.patch
| ai/default/daitools.c | ||
|---|---|---|
|
/* Choose capture. */
|
||
|
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
|
||
|
0, "", ACTION_CAPTURE_UNITS);
|
||
|
} else if (is_action_enabled_unit_on_stack(nmap, ACTION_COLLECT_RANSOM,
|
||
|
punit, ptile)) {
|
||
|
/* Choose "Collect Ransom". */
|
||
|
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
|
||
|
0, "", ACTION_COLLECT_RANSOM);
|
||
|
} else if (is_action_enabled_unit_on_stack(nmap, ACTION_BOMBARD_LETHAL,
|
||
|
punit, ptile)) {
|
||
|
/* Choose "Bombard Lethal". */
|
||
| ai/default/daiunit.c | ||
|---|---|---|
|
if (can_unit_attack_tile(punit, nullptr, ptile)
|
||
|
&& (pdef = get_defender(nmap, punit, ptile, nullptr))
|
||
|
/* Action enablers might prevent attacking */
|
||
|
&& is_action_enabled_unit_on_stack(nmap, ACTION_ATTACK,
|
||
|
punit, ptile)) {
|
||
|
&& (is_action_enabled_unit_on_stack(nmap, ACTION_ATTACK,
|
||
|
punit, ptile)
|
||
|
|| is_action_enabled_unit_on_stack(nmap, ACTION_COLLECT_RANSOM,
|
||
|
punit, ptile))) {
|
||
|
/* See description of kill_desire() about these variables. */
|
||
|
int attack = unit_att_rating_now(punit);
|
||
|
int benefit = stack_cost(punit, pdef);
|
||
- « Previous
- 1
- 2
- Next »