Project

General

Profile

Feature #174 » 0015-Add-hut-frightening-variants-of-teleport-actions.patch

S3_2 - Marko Lindqvist, 01/19/2024 08:11 PM

View differences:

common/actions.c
TRUE, TRUE,
MAK_TELEPORT, 1,
ACTION_DISTANCE_MAX, FALSE);
actions[ACTION_TELEPORT_FRIGHTEN] =
unit_action_new(ACTION_TELEPORT_FRIGHTEN,
ACTRES_TELEPORT,
TRUE, TRUE,
MAK_TELEPORT, 1,
ACTION_DISTANCE_MAX, FALSE);
actions[ACTION_TELEPORT_FRIGHTEN_CONQUER] =
unit_action_new(ACTION_TELEPORT_FRIGHTEN_CONQUER,
ACTRES_TELEPORT_CONQUER,
TRUE, TRUE,
MAK_TELEPORT, 1,
ACTION_DISTANCE_MAX, FALSE);
actions[ACTION_TELEPORT_ENTER] =
unit_action_new(ACTION_TELEPORT_ENTER,
ACTRES_TELEPORT,
......
return "ui_name_teleport";
case ACTION_TELEPORT_CONQUER:
return "ui_name_teleport_conquer";
case ACTION_TELEPORT_FRIGHTEN:
return "ui_name_teleport_frighten";
case ACTION_TELEPORT_FRIGHTEN_CONQUER:
return "ui_name_teleport_frighten_conquer";
case ACTION_TELEPORT_ENTER:
return "ui_name_teleport_enter";
case ACTION_TELEPORT_ENTER_CONQUER:
......
case ACTION_TELEPORT_CONQUER:
/* TRANS: _Teleport (100% chance of success). */
return N_("%sTeleport%s");
case ACTION_TELEPORT_FRIGHTEN:
/* TRANS: _Teleport (100% chance of success). */
return N_("%sTeleport%s");
case ACTION_TELEPORT_FRIGHTEN_CONQUER:
/* TRANS: _Teleport (100% chance of success). */
return N_("%sTeleport%s");
case ACTION_TELEPORT_ENTER:
/* TRANS: _Teleport (100% chance of success). */
return N_("%sTeleport%s");
......
return "teleport_min_range";
case ACTION_TELEPORT_CONQUER:
return "teleport_conquer_min_range";
case ACTION_TELEPORT_FRIGHTEN:
return "teleport_frighten_min_range";
case ACTION_TELEPORT_FRIGHTEN_CONQUER:
return "teleport_frighten_conquer_min_range";
case ACTION_TELEPORT_ENTER:
return "teleport_enter_min_range";
case ACTION_TELEPORT_ENTER_CONQUER:
......
return "teleport_max_range";
case ACTION_TELEPORT_CONQUER:
return "teleport_conquer_max_range";
case ACTION_TELEPORT_FRIGHTEN:
return "teleport_frighten_max_range";
case ACTION_TELEPORT_FRIGHTEN_CONQUER:
return "teleport_frighten_conquer_max_range";
case ACTION_TELEPORT_ENTER:
return "teleport_enter_max_range";
case ACTION_TELEPORT_ENTER_CONQUER:
......
case ACTION_UNIT_MOVE3:
case ACTION_TELEPORT:
case ACTION_TELEPORT_CONQUER:
case ACTION_TELEPORT_FRIGHTEN:
case ACTION_TELEPORT_FRIGHTEN_CONQUER:
case ACTION_TELEPORT_ENTER:
case ACTION_TELEPORT_ENTER_CONQUER:
case ACTION_SPY_ESCAPE:
......
case ACTION_UNIT_MOVE3:
case ACTION_TELEPORT:
case ACTION_TELEPORT_CONQUER:
case ACTION_TELEPORT_FRIGHTEN:
case ACTION_TELEPORT_FRIGHTEN_CONQUER:
case ACTION_TELEPORT_ENTER:
case ACTION_TELEPORT_ENTER_CONQUER:
case ACTION_SPY_ESCAPE:
......
return "teleport_blocked_by";
case ACTION_TELEPORT_CONQUER:
return "teleport_conquer_blocked_by";
case ACTION_TELEPORT_FRIGHTEN:
return "teleport_frighten_blocked_by";
case ACTION_TELEPORT_FRIGHTEN_CONQUER:
return "teleport_frighten_conquer_blocked_by";
case ACTION_TELEPORT_ENTER:
return "teleport_enter_blocked_by";
case ACTION_TELEPORT_ENTER_CONQUER:
......
case ACTION_UNIT_MOVE3:
case ACTION_TELEPORT:
case ACTION_TELEPORT_CONQUER:
case ACTION_TELEPORT_FRIGHTEN:
case ACTION_TELEPORT_FRIGHTEN_CONQUER:
case ACTION_TELEPORT_ENTER:
case ACTION_TELEPORT_ENTER_CONQUER:
case ACTION_SPY_ESCAPE:
common/actions.h
#define SPECENUM_VALUE112NAME "Teleport"
#define SPECENUM_VALUE113 ACTION_TELEPORT_CONQUER
#define SPECENUM_VALUE113NAME "Teleport Conquer"
#define SPECENUM_VALUE114 ACTION_TELEPORT_ENTER
#define SPECENUM_VALUE114NAME "Teleport Enter"
#define SPECENUM_VALUE115 ACTION_TELEPORT_ENTER_CONQUER
#define SPECENUM_VALUE115NAME "Teleport Enter Conquer"
#define SPECENUM_VALUE116 ACTION_CLEAN
#define SPECENUM_VALUE116NAME "Clean"
#define SPECENUM_VALUE117 ACTION_COLLECT_RANSOM
#define SPECENUM_VALUE117NAME "Collect Ransom"
#define SPECENUM_VALUE118 ACTION_USER_ACTION1
#define SPECENUM_VALUE118NAME "User Action 1"
#define SPECENUM_VALUE119 ACTION_USER_ACTION2
#define SPECENUM_VALUE119NAME "User Action 2"
#define SPECENUM_VALUE120 ACTION_USER_ACTION3
#define SPECENUM_VALUE120NAME "User Action 3"
#define SPECENUM_VALUE121 ACTION_USER_ACTION4
#define SPECENUM_VALUE121NAME "User Action 4"
#define SPECENUM_VALUE114 ACTION_TELEPORT_FRIGHTEN
#define SPECENUM_VALUE114NAME "Teleport Frighten"
#define SPECENUM_VALUE115 ACTION_TELEPORT_FRIGHTEN_CONQUER
#define SPECENUM_VALUE115NAME "Teleport Frighten Conquer"
#define SPECENUM_VALUE116 ACTION_TELEPORT_ENTER
#define SPECENUM_VALUE116NAME "Teleport Enter"
#define SPECENUM_VALUE117 ACTION_TELEPORT_ENTER_CONQUER
#define SPECENUM_VALUE117NAME "Teleport Enter Conquer"
#define SPECENUM_VALUE118 ACTION_CLEAN
#define SPECENUM_VALUE118NAME "Clean"
#define SPECENUM_VALUE119 ACTION_COLLECT_RANSOM
#define SPECENUM_VALUE119NAME "Collect Ransom"
#define SPECENUM_VALUE120 ACTION_USER_ACTION1
#define SPECENUM_VALUE120NAME "User Action 1"
#define SPECENUM_VALUE121 ACTION_USER_ACTION2
#define SPECENUM_VALUE121NAME "User Action 2"
#define SPECENUM_VALUE122 ACTION_USER_ACTION3
#define SPECENUM_VALUE122NAME "User Action 3"
#define SPECENUM_VALUE123 ACTION_USER_ACTION4
#define SPECENUM_VALUE123NAME "User Action 4"
#define SPECENUM_BITVECTOR bv_actions
#define SPECENUM_COUNT ACTION_COUNT
#define SPECENUM_NAME_UPDATER
doc/README.actions
* the target tile can't contain any units not allied to the actor
unit and all its cargo.
"Teleport Frighten" - teleport unit to the target tile.
* UI name can be set using ui_name_teleport_frighten
* any action listed in teleport_frighten_blocked_by must be impossible
* the range of legal distance between actor unit and target tile
must be between teleport_frighten_min_range and teleport_frighten_max_range
* the actor unit may not be transported (!)
* the actor unit's type must be the target tile's terrain animal if the
player's nation is an animal barbarian.
* the actor unit must be able to exist outside of a transport at the target
tile.
* the actor unit doesn't have the "CoastStrict" unit type flag or the
target tile is on or adjacent to a tile that doesn't have the
"UnsafeCoast" terrain flag.
* the actor unit can't be diplomatically forbidden from entering the target
tile.
* the target tile can't contain any city or units not allied to the actor
unit and all its cargo.
* can result in hut frightening if
- the target tile has an extra with "Enter" in its rmcauses (a Hut)
- the target tile's Hut's rmreqs are fulfilled
"Teleport Frighten Conquer" - teleport unit to the target tile and conquer it
* UI name can be set using ui_name_teleport_frighten_conquer
* any action listed in teleport_frighten_conquer_blocked_by must be impossible
* the range of legal distance between actor unit and target tile
must be between teleport_frighten_conquer_min_range and
teleport_frighten_conquer_max_range
* the actor unit may not be transported (!)
* the actor unit's type must be the target tile's terrain animal if the
player's nation is an animal barbarian.
* the actor unit must be able to exist outside of a transport at the target
tile.
* the actor unit doesn't have the "CoastStrict" unit type flag or the
target tile is on or adjacent to a tile that doesn't have the
"UnsafeCoast" terrain flag.
* the actor unit can't be diplomatically forbidden from entering the target
tile.
* the target tile can't contain any units not allied to the actor
unit and all its cargo.
* can result in hut frightening if
- the target tile has an extra with "Enter" in its rmcauses (a Hut)
- the target tile's Hut's rmreqs are fulfilled
"Teleport Enter" - teleport unit to the target tile.
* UI name can be set using ui_name_teleport_enter
* any action listed in teleport_enter_blocked_by must be impossible
server/citytools.c
ACTION_PARADROP_FRIGHTEN_CONQUER)
|| utype_can_do_action(unit_type_get(punit),
ACTION_PARADROP_ENTER_CONQUER)
|| utype_can_do_action(unit_type_get(punit),
ACTION_TELEPORT_FRIGHTEN_CONQUER)
|| utype_can_do_action(unit_type_get(punit),
ACTION_TELEPORT_ENTER_CONQUER),
FALSE, "Bad unit for city occupation.");
server/ruleset.c
ACT_SUB_RES_HUT_FRIGHTEN);
BV_SET(action_by_number(ACTION_PARADROP_FRIGHTEN_CONQUER)->sub_results,
ACT_SUB_RES_HUT_FRIGHTEN);
BV_SET(action_by_number(ACTION_TELEPORT_FRIGHTEN)->sub_results,
ACT_SUB_RES_HUT_FRIGHTEN);
BV_SET(action_by_number(ACTION_TELEPORT_FRIGHTEN_CONQUER)->sub_results,
ACT_SUB_RES_HUT_FRIGHTEN);
/* Unit May Embark */
action_iterate(act_id) {
(4-4/4)