Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Feature #920420 » master-Fake-generalize-all-normal-move-actions.patch

Sveinung Kvilhaugsvik, 2021-02-18 05:56 PM

View differences:

ai/default/aitools.c
/* Choose "Conquer City 2". */
unit_do_action(unit_owner(punit), punit->id, tcity->id,
0, "", ACTION_CONQUER_CITY2);
} else if ((tcity = tile_city(ptile))
&& is_action_enabled_unit_on_city(ACTION_CONQUER_CITY3,
punit, tcity)) {
/* Choose "Conquer City 3". */
unit_do_action(unit_owner(punit), punit->id, tcity->id,
0, "", ACTION_CONQUER_CITY3);
} else if ((tcity = tile_city(ptile))
&& is_action_enabled_unit_on_city(ACTION_CONQUER_CITY4,
punit, tcity)) {
/* Choose "Conquer City 4". */
unit_do_action(unit_owner(punit), punit->id, tcity->id,
0, "", ACTION_CONQUER_CITY4);
} else if (!can_unit_survive_at_tile(&(wld.map), punit, ptile)
&& ((ptrans = transporter_for_unit_at(punit, ptile)))
&& is_action_enabled_unit_on_unit(ACTION_TRANSPORT_EMBARK,
......
/* "Transport Embark". */
unit_do_action(unit_owner(punit), punit->id, ptrans->id,
0, "", ACTION_TRANSPORT_EMBARK);
} else if (!can_unit_survive_at_tile(&(wld.map), punit, ptile)
&& ((ptrans = transporter_for_unit_at(punit, ptile)))
&& is_action_enabled_unit_on_unit(ACTION_TRANSPORT_EMBARK2,
punit, ptrans)) {
/* "Transport Embark 2". */
unit_do_action(unit_owner(punit), punit->id, ptrans->id,
0, "", ACTION_TRANSPORT_EMBARK2);
} else if (!can_unit_survive_at_tile(&(wld.map), punit, ptile)
&& ((ptrans = transporter_for_unit_at(punit, ptile)))
&& is_action_enabled_unit_on_unit(ACTION_TRANSPORT_EMBARK3,
punit, ptrans)) {
/* "Transport Embark 3". */
unit_do_action(unit_owner(punit), punit->id, ptrans->id,
0, "", ACTION_TRANSPORT_EMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK1,
punit, ptile, NULL)) {
/* "Transport Disembark". */
......
/* "Transport Disembark 2". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_TRANSPORT_DISEMBARK2);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK3,
punit, ptile, NULL)) {
/* "Transport Disembark 3". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_TRANSPORT_DISEMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK4,
punit, ptile, NULL)) {
/* "Transport Disembark 4". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_TRANSPORT_DISEMBARK4);
} else if (tile_has_claimable_base(ptile, unit_type_get(punit))
&& is_action_enabled_unit_on_extras(ACTION_CONQUER_EXTRAS,
punit, ptile, NULL)) {
......
/* Choose "Conquer Extras 2". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_CONQUER_EXTRAS2);
} else if (tile_has_claimable_base(ptile, unit_type_get(punit))
&& is_action_enabled_unit_on_extras(ACTION_CONQUER_EXTRAS3,
punit, ptile, NULL)) {
/* Choose "Conquer Extras 3". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_CONQUER_EXTRAS3);
} else if (tile_has_claimable_base(ptile, unit_type_get(punit))
&& is_action_enabled_unit_on_extras(ACTION_CONQUER_EXTRAS4,
punit, ptile, NULL)) {
/* Choose "Conquer Extras 4". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_CONQUER_EXTRAS4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER,
punit, ptile, NULL)) {
/* Choose "Enter Hut". */
......
/* Choose "Enter Hut 2". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_ENTER2);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER3,
punit, ptile, NULL)) {
/* Choose "Enter Hut 3". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_ENTER3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER4,
punit, ptile, NULL)) {
/* Choose "Enter Hut 4". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_ENTER4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN,
punit, ptile, NULL)) {
/* Choose "Frighten Hut". */
......
/* Choose "Frighten Hut 2". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_FRIGHTEN2);
} else {
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN3,
punit, ptile, NULL)) {
/* Choose "Frighten Hut 3". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_FRIGHTEN3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN4,
punit, ptile, NULL)) {
/* Choose "Frighten Hut 4". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_HUT_FRIGHTEN4);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE,
punit, ptile, NULL)) {
/* Choose "Unit Move". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_UNIT_MOVE);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE2,
punit, ptile, NULL)) {
/* Choose "Unit Move 2". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_UNIT_MOVE2);
} else {
/* Choose "Unit Move 3". */
unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
0, "", ACTION_UNIT_MOVE3);
}
alive = (game_unit_by_number(sanity) != NULL);
......
punit, ptrans)) {
/* "Transport Embark". */
paction = action_by_number(ACTION_TRANSPORT_EMBARK);
} else if (!can_unit_survive_at_tile(&(wld.map), punit, ptile)
&& ptrans != NULL
&& is_action_enabled_unit_on_unit(ACTION_TRANSPORT_EMBARK2,
punit, ptrans)) {
/* "Transport Embark 2". */
paction = action_by_number(ACTION_TRANSPORT_EMBARK2);
} else if (!can_unit_survive_at_tile(&(wld.map), punit, ptile)
&& ptrans != NULL
&& is_action_enabled_unit_on_unit(ACTION_TRANSPORT_EMBARK3,
punit, ptrans)) {
/* "Transport Embark 3". */
paction = action_by_number(ACTION_TRANSPORT_EMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK1,
punit, ptile, NULL)) {
/* "Transport Disembark". */
......
punit, ptile, NULL)) {
/* "Transport Disembark 2". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK2);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK3,
punit, ptile, NULL)) {
/* "Transport Disembark 3". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK4,
punit, ptile, NULL)) {
/* "Transport Disembark 4". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER,
punit, ptile, NULL)) {
/* "Enter Hut". */
......
punit, ptile, NULL)) {
/* "Enter Hut 2". */
paction = action_by_number(ACTION_HUT_ENTER2);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER3,
punit, ptile, NULL)) {
/* "Enter Hut 3". */
paction = action_by_number(ACTION_HUT_ENTER3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER4,
punit, ptile, NULL)) {
/* "Enter Hut 4". */
paction = action_by_number(ACTION_HUT_ENTER4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN,
punit, ptile, NULL)) {
/* "Frighten Hut". */
......
punit, ptile, NULL)) {
/* "Frighten Hut 2". */
paction = action_by_number(ACTION_HUT_FRIGHTEN2);
} else {
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN3,
punit, ptile, NULL)) {
/* "Frighten Hut 3". */
paction = action_by_number(ACTION_HUT_FRIGHTEN3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN4,
punit, ptile, NULL)) {
/* "Frighten Hut 4". */
paction = action_by_number(ACTION_HUT_FRIGHTEN4);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE,
punit, ptile, NULL)) {
/* "Unit Move". */
paction = action_by_number(ACTION_UNIT_MOVE);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE2,
punit, ptile, NULL)) {
/* "Unit Move 2". */
paction = action_by_number(ACTION_UNIT_MOVE2);
} else {
/* "Unit Move 3". */
paction = action_by_number(ACTION_UNIT_MOVE3);
}
/* Try not to end move next to an enemy if we can avoid it by waiting */
client/control.c
request_do_action(ACTION_TRANSPORT_BOARD,
pcargo->id, ptrans->id, 0, "");
} else {
request_do_action(ACTION_TRANSPORT_EMBARK,
pcargo->id, ptrans->id, 0, "");
action_by_result_iterate(paction, act_id, ACTRES_TRANSPORT_EMBARK) {
if (action_prob_possible(action_prob_vs_unit(pcargo, paction->id,
ptrans))) {
/* Try the first action that may be legal. */
/* Implement something like do_disband_alternative() if a ruleset
* appears where this isn't good enough. */
request_do_action(paction->id,
pcargo->id, ptrans->id, 0, "");
break;
}
} action_by_result_iterate_end;
}
/* Sentry the unit. */
client/packhand.c
case ACTION_TRANSPORT_ALIGHT:
case ACTION_TRANSPORT_BOARD:
case ACTION_TRANSPORT_EMBARK:
case ACTION_TRANSPORT_EMBARK2:
case ACTION_TRANSPORT_EMBARK3:
case ACTION_TRANSPORT_UNLOAD:
case ACTION_TRANSPORT_DISEMBARK1:
case ACTION_TRANSPORT_DISEMBARK2:
case ACTION_TRANSPORT_DISEMBARK3:
case ACTION_TRANSPORT_DISEMBARK4:
case ACTION_UNIT_MOVE:
case ACTION_UNIT_MOVE2:
case ACTION_UNIT_MOVE3:
/* Not interesting. */
break;
case ACTION_USER_ACTION1:
......
case ACTION_SUICIDE_ATTACK:
case ACTION_CONQUER_CITY:
case ACTION_CONQUER_CITY2:
case ACTION_CONQUER_CITY3:
case ACTION_CONQUER_CITY4:
case ACTION_STRIKE_PRODUCTION:
case ACTION_CONQUER_EXTRAS:
case ACTION_CONQUER_EXTRAS2:
case ACTION_CONQUER_EXTRAS3:
case ACTION_CONQUER_EXTRAS4:
/* An attack. */
if (attack_action == ACTION_NONE) {
/* No previous attack action found. */
......
case ACTION_IRRIGATE:
case ACTION_HUT_ENTER:
case ACTION_HUT_ENTER2:
case ACTION_HUT_ENTER3:
case ACTION_HUT_ENTER4:
case ACTION_HUT_FRIGHTEN:
case ACTION_HUT_FRIGHTEN2:
case ACTION_HUT_FRIGHTEN3:
case ACTION_HUT_FRIGHTEN4:
/* An interesting non attack action has been found. */
return ACTION_NONE;
break;
common/actions.c
unit_action_new(ACTION_CONQUER_CITY2, ACTRES_CONQUER_CITY,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_CONQUER_CITY3] =
unit_action_new(ACTION_CONQUER_CITY3, ACTRES_CONQUER_CITY,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_CONQUER_CITY4] =
unit_action_new(ACTION_CONQUER_CITY4, ACTRES_CONQUER_CITY,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_CONQUER_EXTRAS] =
unit_action_new(ACTION_CONQUER_EXTRAS, ACTRES_CONQUER_EXTRAS,
FALSE, TRUE,
......
unit_action_new(ACTION_CONQUER_EXTRAS2, ACTRES_CONQUER_EXTRAS,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_CONQUER_EXTRAS3] =
unit_action_new(ACTION_CONQUER_EXTRAS3, ACTRES_CONQUER_EXTRAS,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_CONQUER_EXTRAS4] =
unit_action_new(ACTION_CONQUER_EXTRAS4, ACTRES_CONQUER_EXTRAS,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_HEAL_UNIT] =
unit_action_new(ACTION_HEAL_UNIT, ACTRES_HEAL_UNIT,
FALSE, TRUE,
......
ACTRES_TRANSPORT_DISEMBARK,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_TRANSPORT_DISEMBARK3] =
unit_action_new(ACTION_TRANSPORT_DISEMBARK3,
ACTRES_TRANSPORT_DISEMBARK,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_TRANSPORT_DISEMBARK4] =
unit_action_new(ACTION_TRANSPORT_DISEMBARK4,
ACTRES_TRANSPORT_DISEMBARK,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_TRANSPORT_EMBARK] =
unit_action_new(ACTION_TRANSPORT_EMBARK, ACTRES_TRANSPORT_EMBARK,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_TRANSPORT_EMBARK2] =
unit_action_new(ACTION_TRANSPORT_EMBARK2, ACTRES_TRANSPORT_EMBARK,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_TRANSPORT_EMBARK3] =
unit_action_new(ACTION_TRANSPORT_EMBARK3, ACTRES_TRANSPORT_EMBARK,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_SPY_ATTACK] =
unit_action_new(ACTION_SPY_ATTACK, ACTRES_SPY_ATTACK,
FALSE, TRUE,
......
unit_action_new(ACTION_HUT_ENTER2, ACTRES_HUT_ENTER,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_HUT_ENTER3] =
unit_action_new(ACTION_HUT_ENTER3, ACTRES_HUT_ENTER,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_HUT_ENTER4] =
unit_action_new(ACTION_HUT_ENTER4, ACTRES_HUT_ENTER,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_HUT_FRIGHTEN] =
unit_action_new(ACTION_HUT_FRIGHTEN, ACTRES_HUT_FRIGHTEN,
FALSE, TRUE,
......
unit_action_new(ACTION_HUT_FRIGHTEN2, ACTRES_HUT_FRIGHTEN,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_HUT_FRIGHTEN3] =
unit_action_new(ACTION_HUT_FRIGHTEN3, ACTRES_HUT_FRIGHTEN,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_HUT_FRIGHTEN4] =
unit_action_new(ACTION_HUT_FRIGHTEN4, ACTRES_HUT_FRIGHTEN,
FALSE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_UNIT_MOVE] =
unit_action_new(ACTION_UNIT_MOVE, ACTRES_UNIT_MOVE,
TRUE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_UNIT_MOVE2] =
unit_action_new(ACTION_UNIT_MOVE2, ACTRES_UNIT_MOVE,
TRUE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_UNIT_MOVE3] =
unit_action_new(ACTION_UNIT_MOVE3, ACTRES_UNIT_MOVE,
TRUE, TRUE,
MAK_REGULAR, 1, 1, FALSE);
actions[ACTION_USER_ACTION1] =
unit_action_new(ACTION_USER_ACTION1, ACTRES_NONE,
FALSE, TRUE,
......
return "ui_name_conquer_city";
case ACTION_CONQUER_CITY2:
return "ui_name_conquer_city_2";
case ACTION_CONQUER_CITY3:
return "ui_name_conquer_city_3";
case ACTION_CONQUER_CITY4:
return "ui_name_conquer_city_4";
case ACTION_CONQUER_EXTRAS:
return "ui_name_conquer_extras";
case ACTION_CONQUER_EXTRAS2:
return "ui_name_conquer_extras_2";
case ACTION_CONQUER_EXTRAS3:
return "ui_name_conquer_extras_3";
case ACTION_CONQUER_EXTRAS4:
return "ui_name_conquer_extras_4";
case ACTION_HEAL_UNIT:
return "ui_name_heal_unit";
case ACTION_HEAL_UNIT2:
......
return "ui_name_transport_board";
case ACTION_TRANSPORT_EMBARK:
return "ui_name_transport_embark";
case ACTION_TRANSPORT_EMBARK2:
return "ui_name_transport_embark_2";
case ACTION_TRANSPORT_EMBARK3:
return "ui_name_transport_embark_3";
case ACTION_TRANSPORT_UNLOAD:
return "ui_name_transport_unload";
case ACTION_TRANSPORT_DISEMBARK1:
return "ui_name_transport_disembark";
case ACTION_TRANSPORT_DISEMBARK2:
return "ui_name_transport_disembark_2";
case ACTION_TRANSPORT_DISEMBARK3:
return "ui_name_transport_disembark_3";
case ACTION_TRANSPORT_DISEMBARK4:
return "ui_name_transport_disembark_4";
case ACTION_HUT_ENTER:
return "ui_name_enter_hut";
case ACTION_HUT_ENTER2:
return "ui_name_enter_hut_2";
case ACTION_HUT_ENTER3:
return "ui_name_enter_hut_3";
case ACTION_HUT_ENTER4:
return "ui_name_enter_hut_4";
case ACTION_HUT_FRIGHTEN:
return "ui_name_frighten_hut";
case ACTION_HUT_FRIGHTEN2:
return "ui_name_frighten_hut_2";
case ACTION_HUT_FRIGHTEN3:
return "ui_name_frighten_hut_3";
case ACTION_HUT_FRIGHTEN4:
return "ui_name_frighten_hut_4";
case ACTION_SPY_ATTACK:
return "ui_name_spy_attack";
case ACTION_UNIT_MOVE:
return "ui_name_unit_move";
case ACTION_UNIT_MOVE2:
return "ui_name_unit_move_2";
case ACTION_UNIT_MOVE3:
return "ui_name_unit_move_3";
case ACTION_USER_ACTION1:
return "ui_name_user_action_1";
case ACTION_USER_ACTION2:
......
/* TRANS: Surgical Str_ike Production (100% chance of success). */
return N_("Surgical Str%sike Production%s");
case ACTION_CONQUER_CITY:
case ACTION_CONQUER_CITY3:
case ACTION_CONQUER_CITY4:
/* TRANS: _Conquer City (100% chance of success). */
return N_("%sConquer City%s");
case ACTION_CONQUER_CITY2:
/* TRANS: _Conquer City 2 (100% chance of success). */
return N_("%sConquer City 2%s");
case ACTION_CONQUER_EXTRAS:
case ACTION_CONQUER_EXTRAS3:
case ACTION_CONQUER_EXTRAS4:
/* TRANS: _Conquer Extras (100% chance of success). */
return N_("%sConquer Extras%s");
case ACTION_CONQUER_EXTRAS2:
......
/* TRANS: _Board (100% chance of success). */
return N_("%sBoard%s");
case ACTION_TRANSPORT_EMBARK:
case ACTION_TRANSPORT_EMBARK2:
case ACTION_TRANSPORT_EMBARK3:
/* TRANS: _Embark (100% chance of success). */
return N_("%sEmbark%s");
case ACTION_TRANSPORT_UNLOAD:
/* TRANS: _Unload (100% chance of success). */
return N_("%sUnload%s");
case ACTION_TRANSPORT_DISEMBARK1:
case ACTION_TRANSPORT_DISEMBARK3:
case ACTION_TRANSPORT_DISEMBARK4:
/* TRANS: _Disembark (100% chance of success). */
return N_("%sDisembark%s");
case ACTION_TRANSPORT_DISEMBARK2:
......
return N_("%sEliminate Diplomat%s");
case ACTION_HUT_ENTER:
case ACTION_HUT_ENTER2:
case ACTION_HUT_ENTER3:
case ACTION_HUT_ENTER4:
/* TRANS: Enter _Hut (100% chance of success). */
return N_("Enter %sHut%s");
case ACTION_HUT_FRIGHTEN:
case ACTION_HUT_FRIGHTEN2:
case ACTION_HUT_FRIGHTEN3:
case ACTION_HUT_FRIGHTEN4:
/* TRANS: Frighten _Hut (100% chance of success). */
return N_("Frighten %sHut%s");
case ACTION_UNIT_MOVE:
case ACTION_UNIT_MOVE2:
case ACTION_UNIT_MOVE3:
/* TRANS: Regular _Move (100% chance of success). */
return N_("Regular %sMove%s");
case ACTION_USER_ACTION1:
......
case ACTION_STRIKE_PRODUCTION:
case ACTION_CONQUER_CITY:
case ACTION_CONQUER_CITY2:
case ACTION_CONQUER_CITY3:
case ACTION_CONQUER_CITY4:
case ACTION_HEAL_UNIT:
case ACTION_HEAL_UNIT2:
case ACTION_TRANSFORM_TERRAIN:
......
case ACTION_TRANSPORT_ALIGHT:
case ACTION_TRANSPORT_BOARD:
case ACTION_TRANSPORT_EMBARK:
case ACTION_TRANSPORT_EMBARK2:
case ACTION_TRANSPORT_EMBARK3:
case ACTION_TRANSPORT_UNLOAD:
case ACTION_TRANSPORT_DISEMBARK1:
case ACTION_TRANSPORT_DISEMBARK2:
case ACTION_TRANSPORT_DISEMBARK3:
case ACTION_TRANSPORT_DISEMBARK4:
case ACTION_BOMBARD:
case ACTION_BOMBARD2:
case ACTION_BOMBARD3:
......
case ACTION_SPY_ATTACK:
case ACTION_CONQUER_EXTRAS:
case ACTION_CONQUER_EXTRAS2:
case ACTION_CONQUER_EXTRAS3:
case ACTION_CONQUER_EXTRAS4:
case ACTION_HUT_ENTER:
case ACTION_HUT_ENTER2:
case ACTION_HUT_ENTER3:
case ACTION_HUT_ENTER4:
case ACTION_HUT_FRIGHTEN:
case ACTION_HUT_FRIGHTEN2:
case ACTION_HUT_FRIGHTEN4:
case ACTION_HUT_FRIGHTEN3:
case ACTION_UNIT_MOVE:
case ACTION_UNIT_MOVE2:
case ACTION_UNIT_MOVE3:
/* Min range is not ruleset changeable */
return NULL;
case ACTION_USER_ACTION1:
......
case ACTION_STRIKE_PRODUCTION:
case ACTION_CONQUER_CITY:
case ACTION_CONQUER_CITY2:
case ACTION_CONQUER_CITY3:
case ACTION_CONQUER_CITY4:
case ACTION_HEAL_UNIT:
case ACTION_HEAL_UNIT2:
case ACTION_TRANSFORM_TERRAIN:
......
case ACTION_TRANSPORT_ALIGHT:
case ACTION_TRANSPORT_BOARD:
case ACTION_TRANSPORT_EMBARK:
case ACTION_TRANSPORT_EMBARK2:
case ACTION_TRANSPORT_EMBARK3:
case ACTION_TRANSPORT_UNLOAD:
case ACTION_TRANSPORT_DISEMBARK1:
case ACTION_TRANSPORT_DISEMBARK2:
case ACTION_TRANSPORT_DISEMBARK3:
case ACTION_TRANSPORT_DISEMBARK4:
case ACTION_BOMBARD:
case ACTION_BOMBARD2:
case ACTION_BOMBARD3:
......
case ACTION_SPY_ATTACK:
case ACTION_CONQUER_EXTRAS:
case ACTION_CONQUER_EXTRAS2:
case ACTION_CONQUER_EXTRAS3:
case ACTION_CONQUER_EXTRAS4:
case ACTION_HUT_ENTER:
case ACTION_HUT_ENTER2:
case ACTION_HUT_ENTER3:
case ACTION_HUT_ENTER4:
case ACTION_HUT_FRIGHTEN:
case ACTION_HUT_FRIGHTEN2:
case ACTION_HUT_FRIGHTEN3:
case ACTION_HUT_FRIGHTEN4:
case ACTION_UNIT_MOVE:
case ACTION_UNIT_MOVE2:
case ACTION_UNIT_MOVE3:
/* Non ruleset defined action min range not supported here */
fc_assert_msg(FALSE, "Probably wrong value.");
return RS_DEFAULT_ACTION_MIN_RANGE;
......
case ACTION_STRIKE_PRODUCTION:
case ACTION_CONQUER_CITY:
case ACTION_CONQUER_CITY2:
case ACTION_CONQUER_CITY3:
case ACTION_CONQUER_CITY4:
case ACTION_HEAL_UNIT:
case ACTION_HEAL_UNIT2:
case ACTION_TRANSFORM_TERRAIN:
......
case ACTION_TRANSPORT_ALIGHT:
case ACTION_TRANSPORT_BOARD:
case ACTION_TRANSPORT_EMBARK:
case ACTION_TRANSPORT_EMBARK2:
case ACTION_TRANSPORT_EMBARK3:
case ACTION_TRANSPORT_UNLOAD:
case ACTION_TRANSPORT_DISEMBARK1:
case ACTION_TRANSPORT_DISEMBARK2:
case ACTION_TRANSPORT_DISEMBARK3:
case ACTION_TRANSPORT_DISEMBARK4:
case ACTION_SPY_ATTACK:
case ACTION_CONQUER_EXTRAS:
case ACTION_CONQUER_EXTRAS2:
case ACTION_CONQUER_EXTRAS3:
case ACTION_CONQUER_EXTRAS4:
case ACTION_HUT_ENTER:
case ACTION_HUT_ENTER2:
case ACTION_HUT_ENTER3:
case ACTION_HUT_ENTER4:
case ACTION_HUT_FRIGHTEN:
case ACTION_HUT_FRIGHTEN2:
case ACTION_HUT_FRIGHTEN3:
case ACTION_HUT_FRIGHTEN4:
case ACTION_UNIT_MOVE:
case ACTION_UNIT_MOVE2:
case ACTION_UNIT_MOVE3:
/* Max range is not ruleset changeable */
return NULL;
case ACTION_HELP_WONDER:
......
case ACTION_STRIKE_PRODUCTION:
case ACTION_CONQUER_CITY:
case ACTION_CONQUER_CITY2:
case ACTION_CONQUER_CITY3:
case ACTION_CONQUER_CITY4:
case ACTION_HEAL_UNIT:
case ACTION_HEAL_UNIT2:
case ACTION_TRANSFORM_TERRAIN:
......
case ACTION_TRANSPORT_ALIGHT:
case ACTION_TRANSPORT_BOARD:
case ACTION_TRANSPORT_EMBARK:
case ACTION_TRANSPORT_EMBARK2:
case ACTION_TRANSPORT_EMBARK3:
case ACTION_TRANSPORT_UNLOAD:
case ACTION_TRANSPORT_DISEMBARK1:
case ACTION_TRANSPORT_DISEMBARK2:
case ACTION_TRANSPORT_DISEMBARK3:
case ACTION_TRANSPORT_DISEMBARK4:
case ACTION_SPY_ATTACK:
case ACTION_CONQUER_EXTRAS:
case ACTION_CONQUER_EXTRAS2:
case ACTION_CONQUER_EXTRAS3:
case ACTION_CONQUER_EXTRAS4:
case ACTION_HUT_ENTER:
case ACTION_HUT_ENTER2:
case ACTION_HUT_ENTER3:
case ACTION_HUT_ENTER4:
case ACTION_HUT_FRIGHTEN:
case ACTION_HUT_FRIGHTEN2:
case ACTION_HUT_FRIGHTEN3:
case ACTION_HUT_FRIGHTEN4:
case ACTION_UNIT_MOVE:
case ACTION_UNIT_MOVE2:
case ACTION_UNIT_MOVE3:
/* Non ruleset defined action max range not supported here */
fc_assert_msg(FALSE, "Probably wrong value.");
return RS_DEFAULT_ACTION_MAX_RANGE;
......
case ACTION_STRIKE_PRODUCTION:
case ACTION_CONQUER_CITY:
case ACTION_CONQUER_CITY2:
case ACTION_CONQUER_CITY3:
case ACTION_CONQUER_CITY4:
case ACTION_HEAL_UNIT:
case ACTION_HEAL_UNIT2:
case ACTION_TRANSFORM_TERRAIN:
......
case ACTION_TRANSPORT_ALIGHT:
case ACTION_TRANSPORT_BOARD:
case ACTION_TRANSPORT_EMBARK:
case ACTION_TRANSPORT_EMBARK2:
case ACTION_TRANSPORT_EMBARK3:
case ACTION_TRANSPORT_UNLOAD:
case ACTION_TRANSPORT_DISEMBARK1:
case ACTION_TRANSPORT_DISEMBARK2:
case ACTION_TRANSPORT_DISEMBARK3:
case ACTION_TRANSPORT_DISEMBARK4:
case ACTION_BOMBARD:
case ACTION_BOMBARD2:
case ACTION_BOMBARD3:
case ACTION_SPY_ATTACK:
case ACTION_CONQUER_EXTRAS:
case ACTION_CONQUER_EXTRAS2:
case ACTION_CONQUER_EXTRAS3:
case ACTION_CONQUER_EXTRAS4:
case ACTION_HUT_ENTER:
case ACTION_HUT_ENTER2:
case ACTION_HUT_ENTER3:
case ACTION_HUT_ENTER4:
case ACTION_HUT_FRIGHTEN:
case ACTION_HUT_FRIGHTEN2:
case ACTION_HUT_FRIGHTEN3:
case ACTION_HUT_FRIGHTEN4:
case ACTION_UNIT_MOVE:
case ACTION_UNIT_MOVE2:
case ACTION_UNIT_MOVE3:
/* Target kind is not ruleset changeable */
return NULL;
case ACTION_NUKE:
......
case ACTION_STRIKE_PRODUCTION:
case ACTION_CONQUER_CITY:
case ACTION_CONQUER_CITY2:
case ACTION_CONQUER_CITY3:
case ACTION_CONQUER_CITY4:
case ACTION_HEAL_UNIT:
case ACTION_HEAL_UNIT2:
case ACTION_TRANSFORM_TERRAIN:
......
case ACTION_TRANSPORT_ALIGHT:
case ACTION_TRANSPORT_BOARD:
case ACTION_TRANSPORT_EMBARK:
case ACTION_TRANSPORT_EMBARK2:
case ACTION_TRANSPORT_EMBARK3:
case ACTION_TRANSPORT_UNLOAD:
case ACTION_TRANSPORT_DISEMBARK1:
case ACTION_TRANSPORT_DISEMBARK2:
case ACTION_TRANSPORT_DISEMBARK3:
case ACTION_TRANSPORT_DISEMBARK4:
case ACTION_BOMBARD:
case ACTION_BOMBARD2:
case ACTION_BOMBARD3:
......
case ACTION_SPY_ATTACK:
case ACTION_CONQUER_EXTRAS:
case ACTION_CONQUER_EXTRAS2:
case ACTION_CONQUER_EXTRAS3:
case ACTION_CONQUER_EXTRAS4:
case ACTION_HUT_ENTER:
case ACTION_HUT_ENTER2:
case ACTION_HUT_ENTER3:
case ACTION_HUT_ENTER4:
case ACTION_HUT_FRIGHTEN:
case ACTION_HUT_FRIGHTEN2:
case ACTION_HUT_FRIGHTEN3:
case ACTION_HUT_FRIGHTEN4:
case ACTION_UNIT_MOVE:
case ACTION_UNIT_MOVE2:
case ACTION_UNIT_MOVE3:
/* actor consuming always is not ruleset changeable */
return NULL;
case ACTION_SPY_SPREAD_PLAGUE:
......
return "conquer_city_blocked_by";
case ACTION_CONQUER_CITY2:
return "conquer_city_2_blocked_by";
case ACTION_CONQUER_CITY3:
return "conquer_city_3_blocked_by";
case ACTION_CONQUER_CITY4:
return "conquer_city_4_blocked_by";
case ACTION_UNIT_MOVE:
return "move_is_blocked_by";
case ACTION_UNIT_MOVE2:
return "move_2_is_blocked_by";
case ACTION_UNIT_MOVE3:
return "move_3_is_blocked_by";
case ACTION_SPY_POISON:
case ACTION_SPY_POISON_ESC:
case ACTION_SPY_SABOTAGE_UNIT:
......
case ACTION_TRANSPORT_ALIGHT:
case ACTION_TRANSPORT_BOARD:
case ACTION_TRANSPORT_EMBARK:
case ACTION_TRANSPORT_EMBARK2:
case ACTION_TRANSPORT_EMBARK3:
case ACTION_TRANSPORT_UNLOAD:
case ACTION_TRANSPORT_DISEMBARK1:
case ACTION_TRANSPORT_DISEMBARK2:
case ACTION_TRANSPORT_DISEMBARK3:
case ACTION_TRANSPORT_DISEMBARK4:
case ACTION_SPY_SPREAD_PLAGUE:
case ACTION_SPY_ATTACK:
case ACTION_CONQUER_EXTRAS:
case ACTION_CONQUER_EXTRAS2:
case ACTION_CONQUER_EXTRAS3:
case ACTION_CONQUER_EXTRAS4:
case ACTION_HUT_ENTER:
case ACTION_HUT_ENTER2:
case ACTION_HUT_ENTER3:
case ACTION_HUT_ENTER4:
case ACTION_HUT_FRIGHTEN:
case ACTION_HUT_FRIGHTEN2:
case ACTION_HUT_FRIGHTEN3:
case ACTION_HUT_FRIGHTEN4:
case ACTION_USER_ACTION1:
case ACTION_USER_ACTION2:
case ACTION_USER_ACTION3:
......
case ACTION_SUICIDE_ATTACK:
case ACTION_CONQUER_CITY:
case ACTION_CONQUER_CITY2:
case ACTION_CONQUER_CITY3:
case ACTION_CONQUER_CITY4:
case ACTION_SPY_POISON:
case ACTION_SPY_POISON_ESC:
case ACTION_SPY_SABOTAGE_UNIT:
......
case ACTION_TRANSPORT_ALIGHT:
case ACTION_TRANSPORT_BOARD:
case ACTION_TRANSPORT_EMBARK:
case ACTION_TRANSPORT_EMBARK2:
case ACTION_TRANSPORT_EMBARK3:
case ACTION_TRANSPORT_UNLOAD:
case ACTION_TRANSPORT_DISEMBARK1:
case ACTION_TRANSPORT_DISEMBARK2:
case ACTION_TRANSPORT_DISEMBARK3:
case ACTION_TRANSPORT_DISEMBARK4:
case ACTION_SPY_SPREAD_PLAGUE:
case ACTION_SPY_ATTACK:
case ACTION_CONQUER_EXTRAS:
case ACTION_CONQUER_EXTRAS2:
case ACTION_CONQUER_EXTRAS3:
case ACTION_CONQUER_EXTRAS4:
case ACTION_HUT_ENTER:
case ACTION_HUT_ENTER2:
case ACTION_HUT_ENTER3:
case ACTION_HUT_ENTER4:
case ACTION_HUT_FRIGHTEN:
case ACTION_HUT_FRIGHTEN2:
case ACTION_HUT_FRIGHTEN3:
case ACTION_HUT_FRIGHTEN4:
case ACTION_UNIT_MOVE:
case ACTION_UNIT_MOVE2:
case ACTION_UNIT_MOVE3:
case ACTION_USER_ACTION1:
case ACTION_USER_ACTION2:
case ACTION_USER_ACTION3:
common/actions.h
#define SPECENUM_VALUE83NAME "User Action 3"
#define SPECENUM_VALUE84 ACTION_HEAL_UNIT2
#define SPECENUM_VALUE84NAME "Heal Unit 2"
#define SPECENUM_VALUE85 ACTION_CONQUER_CITY3
#define SPECENUM_VALUE85NAME "Conquer City 3"
#define SPECENUM_VALUE86 ACTION_CONQUER_CITY4
#define SPECENUM_VALUE86NAME "Conquer City 4"
#define SPECENUM_VALUE87 ACTION_CONQUER_EXTRAS3
#define SPECENUM_VALUE87NAME "Conquer Extras 3"
#define SPECENUM_VALUE88 ACTION_CONQUER_EXTRAS4
#define SPECENUM_VALUE88NAME "Conquer Extras 4"
#define SPECENUM_VALUE89 ACTION_TRANSPORT_DISEMBARK3
#define SPECENUM_VALUE89NAME "Transport Disembark 3"
#define SPECENUM_VALUE90 ACTION_TRANSPORT_DISEMBARK4
#define SPECENUM_VALUE90NAME "Transport Disembark 4"
#define SPECENUM_VALUE91 ACTION_TRANSPORT_EMBARK2
#define SPECENUM_VALUE91NAME "Transport Embark 2"
#define SPECENUM_VALUE92 ACTION_TRANSPORT_EMBARK3
#define SPECENUM_VALUE92NAME "Transport Embark 3"
#define SPECENUM_VALUE93 ACTION_HUT_ENTER3
#define SPECENUM_VALUE93NAME "Enter Hut 3"
#define SPECENUM_VALUE94 ACTION_HUT_ENTER4
#define SPECENUM_VALUE94NAME "Enter Hut 4"
#define SPECENUM_VALUE95 ACTION_HUT_FRIGHTEN3
#define SPECENUM_VALUE95NAME "Frighten Hut 3"
#define SPECENUM_VALUE96 ACTION_HUT_FRIGHTEN4
#define SPECENUM_VALUE96NAME "Frighten Hut 4"
#define SPECENUM_VALUE97 ACTION_UNIT_MOVE2
#define SPECENUM_VALUE97NAME "Unit Move 2"
#define SPECENUM_VALUE98 ACTION_UNIT_MOVE3
#define SPECENUM_VALUE98NAME "Unit Move 3"
#define SPECENUM_BITVECTOR bv_actions
#define SPECENUM_COUNT ACTION_COUNT
#include "specenum_gen.h"
common/movement.c
USP_NATIVE_TILE, FALSE)
|| utype_can_do_act_when_ustate(utype, ACTION_SUICIDE_ATTACK,
USP_NATIVE_TILE, FALSE)
|| utype_can_do_act_when_ustate(utype, ACTION_CONQUER_CITY4,
USP_LIVABLE_TILE, FALSE)
|| utype_can_do_act_when_ustate(utype, ACTION_CONQUER_CITY3,
USP_LIVABLE_TILE, FALSE)
|| utype_can_do_act_when_ustate(utype, ACTION_CONQUER_CITY2,
USP_LIVABLE_TILE, FALSE)
|| utype_can_do_act_when_ustate(utype, ACTION_CONQUER_CITY,
doc/README.actions
* A copy of "Conquer City".
* See "Conquer City" for everything else.
"Conquer City 3" - Conquer the target city.
* UI name can be set using ui_name_conquer_city_3
* any action listed in conquer_city_3_blocked_by must be impossible
* A copy of "Conquer City".
* See "Conquer City" for everything else.
"Conquer City 4" - Conquer the target city.
* UI name can be set using ui_name_conquer_city_4
* any action listed in conquer_city_4_blocked_by must be impossible
* A copy of "Conquer City".
* See "Conquer City" for everything else.
"Surgical Strike Building" - Destroy a specific building.
* UI name can be set using ui_name_surgical_strike_building
* actor must be aware that the target exists
......
unit and all its cargo.
* target must be visible to the actor.
"Transport Embark 2" - Enter target transport on a different tile.
* UI name can be set using ui_name_transport_embark_2
* A copy of "Transport Embark".
* See "Transport Embark" for everything else.
"Transport Embark 3" - Enter target transport on a different tile.
* UI name can be set using ui_name_transport_embark_3
* A copy of "Transport Embark".
* See "Transport Embark" for everything else.
Actions done by a unit against all units at a tile
==================================================
"Capture Units" - steal the target units.
......
* A copy of "Transport Disembark".
* See "Transport Disembark" for everything else.
"Transport Disembark 3" - Exit transport to target tile.
* UI name can be set using ui_name_transport_disembark_3
* A copy of "Transport Disembark".
* See "Transport Disembark" for everything else.
"Transport Disembark 4" - Exit transport to target tile.
* UI name can be set using ui_name_transport_disembark_4
* A copy of "Transport Disembark".
* See "Transport Disembark" for everything else.
"Enter Hut" - Enter a Hut, destroying it in the process.
* UI name can be set using ui_name_enter_hut
* the actor unit must be on a tile next to the target.
......
* A copy of "Enter Hut"
* See "Enter Hut" for everything else.
"Enter Hut 3" - Enter a Hut, destroying it in the process.
* UI name can be set using ui_name_enter_hut_3
* A copy of "Enter Hut"
* See "Enter Hut" for everything else.
"Enter Hut 4" - Enter a Hut, destroying it in the process.
* UI name can be set using ui_name_enter_hut_4
* A copy of "Enter Hut"
* See "Enter Hut" for everything else.
"Frighten Hut" - Frighten a Hut, destroying it in the process.
* UI name can be set using ui_name_frighten_hut
* the actor unit must be on a tile next to the target.
......
* A copy of "Frighten Hut"
* See "Frighten Hut" for everything else.
"Frighten Hut 3" - Frighten a Hut, destroying it in the process.
* UI name can be set using ui_name_frighten_hut_3
* A copy of "Frighten Hut"
* See "Frighten Hut" for everything else.
"Frighten Hut 4" - Frighten a Hut, destroying it in the process.
* UI name can be set using ui_name_frighten_hut_4
* A copy of "Frighten Hut"
* See "Frighten Hut" for everything else.
"Unit Move" - a regular move to the target tile.
* UI name can be set using ui_name_unit_move
* any action listed in move_is_blocked_by must be impossible
......
* the target tile isn't blocked for the actor unit by some other unit's
zone of control (ZOC)
"Unit Move 2" - a regular move to the target tile.
* UI name can be set using ui_name_unit_move_2
* any action listed in move_2_is_blocked_by must be impossible
* A copy of "Unit Move"
* See "Unit Move" for everything else.
"Unit Move 3" - a regular move to the target tile.
* UI name can be set using ui_name_unit_move_3
* any action listed in move_3_is_blocked_by must be impossible
* A copy of "Unit Move"
* See "Unit Move" for everything else.
Actions done by a unit against all extras at a tile
===================================================
"Conquer Extras" - Claim ownership of an extra.
......
* A copy of "Conquer Extras"
* See "Conquer Extras" for everything else.
"Conquer Extras 3" - Claim ownership of an extra.
* UI name can be set using ui_name_conquer_extras_3
* A copy of "Conquer Extras"
* See "Conquer Extras" for everything else.
"Conquer Extras 4" - Claim ownership of an extra.
* UI name can be set using ui_name_conquer_extras_4
* A copy of "Conquer Extras"
* See "Conquer Extras" for everything else.
Actions done by a unit to it self
=================================
"Disband Unit" - Disband the unit.
server/advisors/advgoto.c
punit, ptrans)) {
/* "Transport Embark". */
paction = action_by_number(ACTION_TRANSPORT_EMBARK);
} else if (!can_unit_survive_at_tile(&(wld.map), punit, ptile)
&& ptrans != NULL
&& is_action_enabled_unit_on_unit(ACTION_TRANSPORT_EMBARK2,
punit, ptrans)) {
/* "Transport Embark 2". */
paction = action_by_number(ACTION_TRANSPORT_EMBARK2);
} else if (!can_unit_survive_at_tile(&(wld.map), punit, ptile)
&& ptrans != NULL
&& is_action_enabled_unit_on_unit(ACTION_TRANSPORT_EMBARK3,
punit, ptrans)) {
/* "Transport Embark 3". */
paction = action_by_number(ACTION_TRANSPORT_EMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK1,
punit, ptile, NULL)) {
/* "Transport Disembark". */
......
punit, ptile, NULL)) {
/* "Transport Disembark 2". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK2);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK3,
punit, ptile, NULL)) {
/* "Transport Disembark 3". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK3);
} else if (is_action_enabled_unit_on_tile(ACTION_TRANSPORT_DISEMBARK4,
punit, ptile, NULL)) {
/* "Transport Disembark 4". */
paction = action_by_number(ACTION_TRANSPORT_DISEMBARK4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER,
punit, ptile, NULL)) {
/* "Enter Hut". */
......
punit, ptile, NULL)) {
/* "Enter Hut 2". */
paction = action_by_number(ACTION_HUT_ENTER2);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER3,
punit, ptile, NULL)) {
/* "Enter Hut 3". */
paction = action_by_number(ACTION_HUT_ENTER3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_ENTER4,
punit, ptile, NULL)) {
/* "Enter Hut 4". */
paction = action_by_number(ACTION_HUT_ENTER4);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN,
punit, ptile, NULL)) {
/* "Frighten Hut". */
......
punit, ptile, NULL)) {
/* "Frighten Hut 2". */
paction = action_by_number(ACTION_HUT_FRIGHTEN2);
} else {
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN3,
punit, ptile, NULL)) {
/* "Frighten Hut 3". */
paction = action_by_number(ACTION_HUT_FRIGHTEN3);
} else if (is_action_enabled_unit_on_tile(ACTION_HUT_FRIGHTEN4,
punit, ptile, NULL)) {
/* "Frighten Hut 4". */
paction = action_by_number(ACTION_HUT_FRIGHTEN4);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE,
punit, ptile, NULL)) {
/* "Unit Move". */
paction = action_by_number(ACTION_UNIT_MOVE);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE2,
punit, ptile, NULL)) {
/* "Unit Move 2". */
paction = action_by_number(ACTION_UNIT_MOVE2);
} else {
/* "Unit Move 3". */
paction = action_by_number(ACTION_UNIT_MOVE3);
}
/* Try not to end move next to an enemy if we can avoid it by waiting */
server/barbarian.c
/* Load */
unit_do_action(unit_owner(punit2), punit2->id, boat->id,
0, "", ACTION_TRANSPORT_EMBARK);
} else if (is_action_enabled_unit_on_unit(ACTION_TRANSPORT_EMBARK2,
punit2, boat)) {
/* Load */
unit_do_action(unit_owner(punit2), punit2->id, boat->id,
0, "", ACTION_TRANSPORT_EMBARK2);
} else if (is_action_enabled_unit_on_unit(ACTION_TRANSPORT_EMBARK3,
punit2, boat)) {
/* Load */
unit_do_action(unit_owner(punit2), punit2->id, boat->id,
0, "", ACTION_TRANSPORT_EMBARK3);
}
}
} unit_list_iterate_safe_end;
server/rscompat.c
/* "Bribe Unit" */
auto_perf = action_auto_perf_slot_number(ACTION_AUTO_POST_BRIBE);
auto_perf->alternatives[0] = ACTION_TRANSPORT_EMBARK;
auto_perf->alternatives[1] = ACTION_TRANSPORT_DISEMBARK1;
auto_perf->alternatives[2] = ACTION_TRANSPORT_DISEMBARK2;
auto_perf->alternatives[3] = ACTION_CONQUER_EXTRAS;
auto_perf->alternatives[4] = ACTION_CONQUER_EXTRAS2;
auto_perf->alternatives[5] = ACTION_HUT_ENTER;
auto_perf->alternatives[6] = ACTION_HUT_ENTER2;
auto_perf->alternatives[7] = ACTION_HUT_FRIGHTEN;
auto_perf->alternatives[8] = ACTION_HUT_FRIGHTEN2;
auto_perf->alternatives[9] = ACTION_UNIT_MOVE;
action_list_end(auto_perf->alternatives, 10);
auto_perf->alternatives[1] = ACTION_TRANSPORT_EMBARK2;
auto_perf->alternatives[2] = ACTION_TRANSPORT_EMBARK3;
auto_perf->alternatives[3] = ACTION_TRANSPORT_DISEMBARK1;
auto_perf->alternatives[4] = ACTION_TRANSPORT_DISEMBARK2;
auto_perf->alternatives[5] = ACTION_TRANSPORT_DISEMBARK3;
auto_perf->alternatives[6] = ACTION_TRANSPORT_DISEMBARK4;
auto_perf->alternatives[7] = ACTION_CONQUER_EXTRAS;
auto_perf->alternatives[8] = ACTION_CONQUER_EXTRAS2;
auto_perf->alternatives[9] = ACTION_CONQUER_EXTRAS3;
auto_perf->alternatives[10] = ACTION_CONQUER_EXTRAS4;
auto_perf->alternatives[11] = ACTION_HUT_ENTER;
auto_perf->alternatives[12] = ACTION_HUT_ENTER2;
auto_perf->alternatives[13] = ACTION_HUT_ENTER3;
auto_perf->alternatives[14] = ACTION_HUT_ENTER4;
auto_perf->alternatives[15] = ACTION_HUT_FRIGHTEN;
auto_perf->alternatives[16] = ACTION_HUT_FRIGHTEN2;
auto_perf->alternatives[17] = ACTION_HUT_FRIGHTEN3;
auto_perf->alternatives[18] = ACTION_HUT_FRIGHTEN4;
auto_perf->alternatives[19] = ACTION_UNIT_MOVE;
auto_perf->alternatives[20] = ACTION_UNIT_MOVE2;
auto_perf->alternatives[21] = ACTION_UNIT_MOVE3;
action_list_end(auto_perf->alternatives, 22);
/* "Attack" */
auto_perf = action_auto_perf_slot_number(ACTION_AUTO_POST_ATTACK);
auto_perf->alternatives[0] = ACTION_CONQUER_CITY;
auto_perf->alternatives[1] = ACTION_CONQUER_CITY2;
auto_perf->alternatives[2] = ACTION_TRANSPORT_DISEMBARK1;
auto_perf->alternatives[3] = ACTION_TRANSPORT_DISEMBARK2;
auto_perf->alternatives[4] = ACTION_CONQUER_EXTRAS;
auto_perf->alternatives[5] = ACTION_CONQUER_EXTRAS2;
auto_perf->alternatives[6] = ACTION_HUT_ENTER;
auto_perf->alternatives[7] = ACTION_HUT_ENTER2;
auto_perf->alternatives[8] = ACTION_HUT_FRIGHTEN;
auto_perf->alternatives[9] = ACTION_HUT_FRIGHTEN2;
auto_perf->alternatives[10] = ACTION_UNIT_MOVE;
action_list_end(auto_perf->alternatives, 11);
auto_perf->alternatives[2] = ACTION_CONQUER_CITY3;
auto_perf->alternatives[3] = ACTION_CONQUER_CITY4;
auto_perf->alternatives[4] = ACTION_TRANSPORT_DISEMBARK1;
auto_perf->alternatives[5] = ACTION_TRANSPORT_DISEMBARK2;
auto_perf->alternatives[6] = ACTION_TRANSPORT_DISEMBARK3;
auto_perf->alternatives[7] = ACTION_TRANSPORT_DISEMBARK4;
auto_perf->alternatives[8] = ACTION_CONQUER_EXTRAS;
auto_perf->alternatives[9] = ACTION_CONQUER_EXTRAS2;
auto_perf->alternatives[10] = ACTION_CONQUER_EXTRAS3;
auto_perf->alternatives[11] = ACTION_CONQUER_EXTRAS4;
auto_perf->alternatives[12] = ACTION_HUT_ENTER;
auto_perf->alternatives[13] = ACTION_HUT_ENTER2;
auto_perf->alternatives[14] = ACTION_HUT_ENTER3;
auto_perf->alternatives[15] = ACTION_HUT_ENTER4;
auto_perf->alternatives[16] = ACTION_HUT_FRIGHTEN;
auto_perf->alternatives[17] = ACTION_HUT_FRIGHTEN2;
auto_perf->alternatives[18] = ACTION_HUT_FRIGHTEN3;
auto_perf->alternatives[19] = ACTION_HUT_FRIGHTEN4;
auto_perf->alternatives[20] = ACTION_UNIT_MOVE;
auto_perf->alternatives[21] = ACTION_UNIT_MOVE2;
auto_perf->alternatives[22] = ACTION_UNIT_MOVE3;
action_list_end(auto_perf->alternatives, 23);
/* The city that made the unit's current tile native is gone.
* Evaluated against an adjacent tile. */
auto_perf = action_auto_perf_slot_number(ACTION_AUTO_ESCAPE_CITY);
auto_perf->alternatives[0] = ACTION_TRANSPORT_EMBARK;
auto_perf->alternatives[1] = ACTION_HUT_ENTER;
auto_perf->alternatives[2] = ACTION_HUT_ENTER2;
auto_perf->alternatives[3] = ACTION_HUT_FRIGHTEN;
auto_perf->alternatives[4] = ACTION_HUT_FRIGHTEN2;
auto_perf->alternatives[5] = ACTION_UNIT_MOVE;
action_list_end(auto_perf->alternatives, 6);
auto_perf->alternatives[1] = ACTION_TRANSPORT_EMBARK2;
auto_perf->alternatives[2] = ACTION_TRANSPORT_EMBARK3;
auto_perf->alternatives[3] = ACTION_HUT_ENTER;
auto_perf->alternatives[4] = ACTION_HUT_ENTER2;
auto_perf->alternatives[5] = ACTION_HUT_ENTER3;
auto_perf->alternatives[6] = ACTION_HUT_ENTER4;
auto_perf->alternatives[7] = ACTION_HUT_FRIGHTEN;
auto_perf->alternatives[8] = ACTION_HUT_FRIGHTEN2;
auto_perf->alternatives[9] = ACTION_HUT_FRIGHTEN3;
auto_perf->alternatives[10] = ACTION_HUT_FRIGHTEN4;
auto_perf->alternatives[11] = ACTION_UNIT_MOVE;
auto_perf->alternatives[12] = ACTION_UNIT_MOVE2;
auto_perf->alternatives[13] = ACTION_UNIT_MOVE3;
action_list_end(auto_perf->alternatives, 14);
}
/* diplchance setting control over initial dice roll odds has moved to
server/unithand.c
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_UNIT_MOVE,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE2,
punit, pdesttile, NULL)) {
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_UNIT_MOVE2,
ACT_REQ_PLAYER);
} else if (is_action_enabled_unit_on_tile(ACTION_UNIT_MOVE3,
punit, pdesttile, NULL)) {
return unit_perform_action(pplayer, punit->id, tile_index(pdesttile),
NO_TARGET, "", ACTION_UNIT_MOVE3,
ACT_REQ_PLAYER);
} else {
/* TODO: Extend the action not enabled explanation system to cover all
* existing reasons and switch to using it. See hrm Feature #920229 */
(2-2/2)