Project

General

Profile

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

main - 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_3";
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_3_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_3_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_TELEPORT2:
case ACTION_TELEPORT3:
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_TELEPORT2:
case ACTION_TELEPORT3:
case ACTION_TELEPORT_CONQUER:
case ACTION_TELEPORT_FRIGHTEN:
case ACTION_TELEPORT_FRIGHTEN_CONQUER:
case ACTION_TELEPORT_ENTER:
case ACTION_TELEPORT_ENTER_CONQUER:
case ACTION_GAIN_VETERANCY:
......
return "teleport_3_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_TELEPORT2:
case ACTION_TELEPORT3:
case ACTION_TELEPORT_CONQUER:
case ACTION_TELEPORT_FRIGHTEN:
case ACTION_TELEPORT_FRIGHTEN_CONQUER:
case ACTION_TELEPORT_ENTER:
case ACTION_TELEPORT_ENTER_CONQUER:
case ACTION_GAIN_VETERANCY:
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
gen_headers/enums/actions_enums.def
ACTION_TELEPORT2 "Teleport2"
ACTION_TELEPORT3 "Teleport3"
ACTION_TELEPORT_CONQUER "Teleport Conquer"
ACTION_TELEPORT_FRIGHTEN "Teleport Unit Frighten"
ACTION_TELEPORT_FRIGHTEN_CONQUER "Teleport Unit Frighten Conquer"
ACTION_TELEPORT_ENTER "Teleport Unit Enter"
ACTION_TELEPORT_ENTER_CONQUER "Teleport Unit Enter Conquer"
ACTION_CLEAN "Clean"
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/ruleload.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) {
(3-3/4)