Feature #2184 ยป 0074-Add-action-type-Scout.patch
| client/gui-qt/dialogs.cpp | ||
|---|---|---|
|
static void regular_move(QVariant data1, QVariant data2);
|
||
|
static void regular_move2(QVariant data1, QVariant data2);
|
||
|
static void regular_move3(QVariant data1, QVariant data2);
|
||
|
static void scout(QVariant data1, QVariant data2);
|
||
|
static void convert_unit(QVariant data1, QVariant data2);
|
||
|
static void fortify(QVariant data1, QVariant data2);
|
||
|
static void fortify2(QVariant data1, QVariant data2);
|
||
| ... | ... | |
|
action_function[ACTION_UNIT_MOVE] = regular_move;
|
||
|
action_function[ACTION_UNIT_MOVE2] = regular_move2;
|
||
|
action_function[ACTION_UNIT_MOVE3] = regular_move3;
|
||
|
action_function[ACTION_SCOUT] = scout;
|
||
|
// Unit acting against all tile extras.
|
||
|
action_function[ACTION_CONQUER_EXTRAS] = conquer_extras;
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
/***********************************************************************//**
|
||
|
Action "Scout" for choice dialog
|
||
|
***************************************************************************/
|
||
|
static void scout(QVariant data1, QVariant data2)
|
||
|
{
|
||
|
int actor_id = data1.toInt();
|
||
|
int target_id = data2.toInt();
|
||
|
if (game_unit_by_number(actor_id) != nullptr
|
||
|
&& index_to_tile(&(wld.map), target_id) != nullptr) {
|
||
|
request_do_action(ACTION_SCOUT,
|
||
|
actor_id, target_id, 0, "");
|
||
|
}
|
||
|
}
|
||
|
/***********************************************************************//**
|
||
|
Popup a window asking a diplomatic unit if it wishes to incite the
|
||
|
given enemy city.
|
||
| common/actions.c | ||
|---|---|---|
|
TRUE, TRUE,
|
||
|
MAK_TELEPORT, 1,
|
||
|
ACTION_DISTANCE_MAX, FALSE);
|
||
|
actions[ACTION_SCOUT] =
|
||
|
unit_action_new(ACTION_SCOUT, ACTRES_SCOUT,
|
||
|
TRUE, TRUE,
|
||
|
MAK_TELEPORT, 1,
|
||
|
ACTION_DISTANCE_MAX, FALSE);
|
||
|
actions[ACTION_GAIN_VETERANCY] =
|
||
|
unit_action_new(ACTION_GAIN_VETERANCY, ACTRES_ENABLER_CHECK,
|
||
|
TRUE, FALSE,
|
||
| ... | ... | |
|
case ACTION_SPY_ESCAPE:
|
||
|
/* TRANS: _Escape To Nearest City (100% chance of success). */
|
||
|
return N_("%sEscape To Nearest City%s");
|
||
|
case ACTION_SCOUT:
|
||
|
/* TRANS: _Scout (100% chance of success). */
|
||
|
return N_("%sScout%s");
|
||
|
case ACTION_USER_ACTION1:
|
||
|
/* TRANS: _User Action 1 (100% chance of success). */
|
||
|
return N_("%sUser Action 1%s");
|
||
| ... | ... | |
|
case ACTION_UNIT_MOVE2:
|
||
|
case ACTION_UNIT_MOVE3:
|
||
|
case ACTION_SPY_ESCAPE:
|
||
|
case ACTION_SCOUT:
|
||
|
case ACTION_GAIN_VETERANCY:
|
||
|
case ACTION_ESCAPE:
|
||
|
case ACTION_CIVIL_WAR:
|
||
| ... | ... | |
|
return "teleport_enter_max_range";
|
||
|
case ACTION_TELEPORT_ENTER_CONQUER:
|
||
|
return "teleport_enter_conquer_max_range";
|
||
|
case ACTION_SCOUT:
|
||
|
return "scout_max_range";
|
||
|
case ACTION_USER_ACTION1:
|
||
|
return "user_action_1_max_range";
|
||
|
case ACTION_USER_ACTION2:
|
||
| ... | ... | |
|
case ACTION_TELEPORT_ENTER:
|
||
|
case ACTION_TELEPORT_ENTER_CONQUER:
|
||
|
case ACTION_SPY_ESCAPE:
|
||
|
case ACTION_SCOUT:
|
||
|
case ACTION_GAIN_VETERANCY:
|
||
|
case ACTION_ESCAPE:
|
||
|
case ACTION_CIVIL_WAR:
|
||
| ... | ... | |
|
case ACTION_TELEPORT_ENTER:
|
||
|
case ACTION_TELEPORT_ENTER_CONQUER:
|
||
|
case ACTION_SPY_ESCAPE:
|
||
|
case ACTION_SCOUT:
|
||
|
case ACTION_GAIN_VETERANCY:
|
||
|
case ACTION_ESCAPE:
|
||
|
case ACTION_CIVIL_WAR:
|
||
| ... | ... | |
|
case ACTION_HUT_FRIGHTEN2:
|
||
|
case ACTION_HUT_FRIGHTEN3:
|
||
|
case ACTION_HUT_FRIGHTEN4:
|
||
|
case ACTION_SCOUT:
|
||
|
case ACTION_GAIN_VETERANCY:
|
||
|
case ACTION_CIVIL_WAR:
|
||
|
case ACTION_FINISH_UNIT:
|
||
| ... | ... | |
|
case ACTION_TELEPORT_ENTER:
|
||
|
case ACTION_TELEPORT_ENTER_CONQUER:
|
||
|
case ACTION_SPY_ESCAPE:
|
||
|
case ACTION_SCOUT:
|
||
|
case ACTION_GAIN_VETERANCY:
|
||
|
case ACTION_ESCAPE:
|
||
|
case ACTION_CIVIL_WAR:
|
||
| doc/README.actions | ||
|---|---|---|
|
- the target tile has an extra with "Enter" in its rmcauses (a Hut)
|
||
|
- the target tile's Hut's rmreqs are fulfilled
|
||
|
"Scout" - Reveal area around a tile until turn change
|
||
|
* max legal distance to the target (center tile of the area to scout)
|
||
|
can be set using scout_max_range
|
||
|
Actions done by a unit against all extras at a tile
|
||
|
===================================================
|
||
|
"Conquer Extras" - Claim ownership of an extra.
|
||
| gen_headers/enums/actions_enums.def | ||
|---|---|---|
|
ACTION_PLANT2 "Plant 2"
|
||
|
ACTION_TRANSFORM_TERRAIN "Transform Terrain"
|
||
|
ACTION_TRANSFORM_TERRAIN2 "Transform Terrain 2"
|
||
|
ACTION_SCOUT "Scout"
|
||
|
# Enabler checks only
|
||
|
ACTION_GAIN_VETERANCY "Gain Veterancy"
|
||