Project

General

Profile

Feature #165 » 0046-Add-hut-entering-variants-of-teleport-actions.patch

main - Marko Lindqvist, 01/10/2024 07:39 AM

View differences:

common/actions.c
TRUE, TRUE,
MAK_TELEPORT, 1,
ACTION_DISTANCE_MAX, FALSE);
actions[ACTION_TELEPORT_ENTER] =
unit_action_new(ACTION_TELEPORT_ENTER,
ACTRES_TELEPORT,
TRUE, TRUE,
MAK_TELEPORT, 1,
ACTION_DISTANCE_MAX, FALSE);
actions[ACTION_TELEPORT_ENTER_CONQUER] =
unit_action_new(ACTION_TELEPORT_ENTER_CONQUER,
ACTRES_TELEPORT_CONQUER,
TRUE, TRUE,
MAK_TELEPORT, 1,
ACTION_DISTANCE_MAX, FALSE);
actions[ACTION_GAIN_VETERANCY] =
unit_action_new(ACTION_GAIN_VETERANCY, ACTRES_ENABLER_CHECK,
TRUE, FALSE,
......
return "ui_name_teleport_3";
case ACTION_TELEPORT_CONQUER:
return "ui_name_teleport_conquer";
case ACTION_TELEPORT_ENTER:
return "ui_name_teleport_enter";
case ACTION_TELEPORT_ENTER_CONQUER:
return "ui_name_teleport_enter_conquer";
case ACTION_SPY_ESCAPE:
return "ui_name_escape";
case ACTION_USER_ACTION1:
......
/* TRANS: _Teleport (100% chance of success). */
return N_("%sTeleport%s");
case ACTION_TELEPORT_CONQUER:
/* TRANS: _Teleport to Conquer (100% chance of success). */
return N_("%sTeleport to Conquer%s");
/* TRANS: _Teleport (100% chance of success). */
return N_("%sTeleport%s");
case ACTION_TELEPORT_ENTER:
/* TRANS: _Teleport (100% chance of success). */
return N_("%sTeleport%s");
case ACTION_TELEPORT_ENTER_CONQUER:
/* TRANS: _Teleport (100% chance of success). */
return N_("%sTeleport%s");
case ACTION_SPY_ESCAPE:
/* TRANS: _Escape To Nearest City (100% chance of success). */
return N_("%sEscape To Nearest City%s");
......
return "teleport_3_min_range";
case ACTION_TELEPORT_CONQUER:
return "teleport_conquer_min_range";
case ACTION_TELEPORT_ENTER:
return "teleport_enter_min_range";
case ACTION_TELEPORT_ENTER_CONQUER:
return "teleport_enter_conquer_min_range";
case ACTION_USER_ACTION1:
return "user_action_1_min_range";
case ACTION_USER_ACTION2:
......
return "teleport_3_max_range";
case ACTION_TELEPORT_CONQUER:
return "teleport_conquer_max_range";
case ACTION_TELEPORT_ENTER:
return "teleport_enter_max_range";
case ACTION_TELEPORT_ENTER_CONQUER:
return "teleport_enter_conquer_max_range";
case ACTION_USER_ACTION1:
return "user_action_1_max_range";
case ACTION_USER_ACTION2:
......
case ACTION_TELEPORT2:
case ACTION_TELEPORT3:
case ACTION_TELEPORT_CONQUER:
case ACTION_TELEPORT_ENTER:
case ACTION_TELEPORT_ENTER_CONQUER:
case ACTION_SPY_ESCAPE:
case ACTION_GAIN_VETERANCY:
/* Target kind is not ruleset changeable */
......
case ACTION_TELEPORT2:
case ACTION_TELEPORT3:
case ACTION_TELEPORT_CONQUER:
case ACTION_TELEPORT_ENTER:
case ACTION_TELEPORT_ENTER_CONQUER:
case ACTION_GAIN_VETERANCY:
case ACTION_SPY_ESCAPE:
/* Actor consuming always is not ruleset changeable */
......
return "teleport_3_blocked_by";
case ACTION_TELEPORT_CONQUER:
return "teleport_conquer_blocked_by";
case ACTION_TELEPORT_ENTER:
return "teleport_enter_blocked_by";
case ACTION_TELEPORT_ENTER_CONQUER:
return "teleport_enter_conquer_blocked_by";
case ACTION_SPY_ESCAPE:
case ACTION_SPY_POISON:
case ACTION_SPY_POISON_ESC:
......
case ACTION_TELEPORT2:
case ACTION_TELEPORT3:
case ACTION_TELEPORT_CONQUER:
case ACTION_TELEPORT_ENTER:
case ACTION_TELEPORT_ENTER_CONQUER:
case ACTION_GAIN_VETERANCY:
case ACTION_SPY_ESCAPE:
case ACTION_USER_ACTION1:
common/fc_types.h
#define SPECENUM_VALUE65 ACTRES_TELEPORT
#define SPECENUM_VALUE65NAME "Teleport"
#define SPECENUM_VALUE66 ACTRES_TELEPORT_CONQUER
#define SPECENUM_VALUE66NAME "Teleport Conquer"
/* Hardcoded action that's just controlled by enablers */
#define SPECENUM_VALUE67 ACTRES_ENABLER_CHECK
/* All consequences are handled as (ruleset) action data. */
doc/README.actions
* A copy of "Unit Move"
* See "Unit Move" for everything else.
"Teleport" - telepor unit to the target tile.
"Teleport" - teleport unit to the target tile.
* UI name can be set using ui_name_teleport
* any action listed in teleport_blocked_by must be impossible
* the range of legal distance between actor unit and target tile
......
* the target tile can't contain any city or units not allied to the actor
unit and all its cargo.
"Teleport 2" - telepor unit to the target tile.
"Teleport 2" - teleport unit to the target tile.
* UI name can be set using ui_name_teleport_2
* any action listed in teleport_2_blocked_by must be impossible
* the range of legal distance between actor unit and target tile
must be between teleport_2_min_range and teleport_2_max_range
* See "Teleport" for everything else.
"Teleport 3" - telepor unit to the target tile.
"Teleport 3" - teleport unit to the target tile.
* UI name can be set using ui_name_teleport_3
* any action listed in teleport_3_blocked_by must be impossible
* the range of legal distance between actor unit and target tile
must be between teleport_3_min_range and teleport_3_max_range
* See "Teleport" for everything else.
"Teleport Conquer" - telepor unit to the target tile and conquer it
"Teleport Conquer" - teleport unit to the target tile and conquer it
* UI name can be set using ui_name_teleport_conquer
* any action listed in teleport_conquer_blocked_by must be impossible
* the range of legal distance between actor unit and target tile
......
* the target tile can't contain any units not allied to the actor
unit and all its cargo.
"Teleport Enter" - teleport unit to the target tile.
* UI name can be set using ui_name_teleport
* any action listed in teleport_blocked_by must be impossible
* the range of legal distance between actor unit and target tile
must be between teleport_min_range and teleport_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 entry 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 Conquer" - teleport unit to the target tile and conquer it
* UI name can be set using ui_name_teleport_conquer
* any action listed in teleport_conquer_blocked_by must be impossible
* the range of legal distance between actor unit and target tile
must be between teleport_conquer_min_range and teleport_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 entry if
- the target tile has an extra with "Enter" in its rmcauses (a Hut)
- the target tile's Hut's rmreqs are fulfilled
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_TELEPORT2 "Teleport2"
ACTION_TELEPORT3 "Teleport3"
ACTION_TELEPORT_CONQUER "Teleport Conquer"
ACTION_TELEPORT_ENTER "Teleport Unit Enter"
ACTION_TELEPORT_ENTER_CONQUER "Teleport Unit Enter Conquer"
ACTION_CLEAN "Clean"
ACTION_COLLECT_RANSOM "Collect Ransom"
ACTION_FORTIFY "Fortify"
server/advisors/advdata.c
|| unit_can_do_action(punit, ACTION_PARADROP_FRIGHTEN_CONQUER)
|| unit_can_do_action(punit, ACTION_PARADROP_ENTER)
|| unit_can_do_action(punit, ACTION_PARADROP_ENTER_CONQUER)) {
/* TODO: Cover also teleporting */
adv->stats.units.paratroopers++;
}
if (utype_can_do_action(punit->utype, ACTION_AIRLIFT)) {
server/citytools.c
|| utype_can_do_action(unit_type_get(punit),
ACTION_PARADROP_FRIGHTEN_CONQUER)
|| utype_can_do_action(unit_type_get(punit),
ACTION_PARADROP_ENTER_CONQUER),
ACTION_PARADROP_ENTER_CONQUER)
|| utype_can_do_action(unit_type_get(punit),
ACTION_TELEPORT_ENTER_CONQUER),
FALSE, "Bad unit for city occupation.");
/* A transported unit trying to conquer a city should already have been
server/ruleset/ruleload.c
ACT_SUB_RES_HUT_ENTER);
BV_SET(action_by_number(ACTION_PARADROP_ENTER_CONQUER)->sub_results,
ACT_SUB_RES_HUT_ENTER);
BV_SET(action_by_number(ACTION_TELEPORT_ENTER)->sub_results,
ACT_SUB_RES_HUT_ENTER);
BV_SET(action_by_number(ACTION_TELEPORT_ENTER_CONQUER)->sub_results,
ACT_SUB_RES_HUT_ENTER);
/* Unit Frighten Hut */
action_by_result_iterate(paction, ACTRES_HUT_FRIGHTEN) {
(1-1/4)