Files
DevelopingTom af0b8a8d50 Configurable immunity timer (#2763)
## Description:

Resolve discussions about stalled PR
https://github.com/openfrontio/OpenFrontIO/pull/2460

<img width="724" height="348" alt="image"
src="https://github.com/user-attachments/assets/c2c9fa79-cace-431a-9ca4-b3656612fa9d"
/>

Changes:
- Added a `Player::canAttackPlayer(other)` function to determine whether
a player can be attacked.
- This function is now used in most places where a fight can occur:
    - AttackExecution (land attacks)
    - Naval invasion
    - Warship fight
- Nukes can't be thrown during the truce
- Immunity only affect human players. Nations and bot will fight as
usual, and can be fought against.
- The immunity timer uses minutes in the modal window.

UI:

- The immunity phase is displayed with a timer bar at the top. This is
from the original PR, to be discussed if it's not deemed visible enough:

<img width="632" height="215" alt="image"
src="https://github.com/user-attachments/assets/f5ab9aa0-bd4f-4503-b8d6-b40b121fba65"
/>


## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

IngloriousTom

---------

Co-authored-by: newyearnewphil <git@nynp.dev>
2026-01-03 20:04:48 -08:00

176 lines
6.6 KiB
JSON

{
"lang": {
"en": "debug",
"native": "debug",
"svg": "xx",
"lang_code": "debug"
},
"main": {
"join_discord": "main.join_discord",
"create_lobby": "main.create_lobby",
"join_lobby": "main.join_lobby",
"single_player": "main.single_player",
"instructions": "main.instructions",
"how_to_play": "main.how_to_play",
"wiki": "main.wiki"
},
"help_modal": {
"hotkeys": "help_modal.hotkeys",
"table_key": "help_modal.table_key",
"table_action": "help_modal.table_action",
"action_alt_view": "help_modal.action_alt_view",
"action_attack_altclick": "help_modal.action_attack_altclick",
"action_build": "help_modal.action_build",
"action_center": "help_modal.action_center",
"action_zoom": "help_modal.action_zoom",
"action_move_camera": "help_modal.action_move_camera",
"action_ratio_change": "help_modal.action_ratio_change",
"action_reset_gfx": "help_modal.action_reset_gfx",
"ui_section": "help_modal.ui_section",
"ui_leaderboard": "help_modal.ui_leaderboard",
"ui_leaderboard_desc": "help_modal.ui_leaderboard_desc",
"ui_control": "help_modal.ui_control",
"ui_control_desc": "help_modal.ui_control_desc",
"ui_pop": "help_modal.ui_pop",
"ui_gold": "help_modal.ui_gold",
"ui_troops_workers": "help_modal.ui_troops_workers",
"ui_attack_ratio": "help_modal.ui_attack_ratio",
"ui_options": "help_modal.ui_options",
"ui_options_desc": "help_modal.ui_options_desc",
"option_pause": "help_modal.option_pause",
"option_timer": "help_modal.option_timer",
"option_exit": "help_modal.option_exit",
"option_settings": "help_modal.option_settings",
"radial_title": "help_modal.radial_title",
"radial_desc": "help_modal.radial_desc",
"radial_build": "help_modal.radial_build",
"radial_info": "help_modal.radial_info",
"radial_boat": "help_modal.radial_boat",
"radial_close": "help_modal.radial_close",
"info_title": "help_modal.info_title",
"info_enemy_desc": "help_modal.info_enemy_desc",
"info_target": "help_modal.info_target",
"info_alliance": "help_modal.info_alliance",
"info_emoji": "help_modal.info_emoji",
"info_ally_panel": "help_modal.info_ally_panel",
"info_ally_desc": "help_modal.info_ally_desc",
"ally_betray": "help_modal.ally_betray",
"ally_donate": "help_modal.ally_donate",
"build_menu_title": "help_modal.build_menu_title",
"build_name": "help_modal.build_name",
"build_icon": "help_modal.build_icon",
"build_desc": "help_modal.build_desc",
"build_city": "help_modal.build_city",
"build_city_desc": "help_modal.build_city_desc",
"build_defense": "help_modal.build_defense",
"build_defense_desc": "help_modal.build_defense_desc",
"build_port": "help_modal.build_port",
"build_port_desc": "help_modal.build_port_desc",
"build_warship": "help_modal.build_warship",
"build_warship_desc": "help_modal.build_warship_desc",
"build_silo": "help_modal.build_silo",
"build_silo_desc": "help_modal.build_silo_desc",
"build_sam": "help_modal.build_sam",
"build_sam_desc": "help_modal.build_sam_desc",
"build_atom": "help_modal.build_atom",
"build_atom_desc": "help_modal.build_atom_desc",
"build_hydrogen": "help_modal.build_hydrogen",
"build_hydrogen_desc": "help_modal.build_hydrogen_desc",
"build_mirv": "help_modal.build_mirv",
"build_mirv_desc": "help_modal.build_mirv_desc",
"player_icons": "help_modal.player_icons",
"icon_desc": "help_modal.icon_desc",
"icon_crown": "help_modal.icon_crown",
"icon_traitor": "help_modal.icon_traitor",
"icon_ally": "help_modal.icon_ally",
"info_enemy_panel": "help_modal.info_enemy_panel"
},
"single_modal": {
"title": "single_modal.title",
"allow_alliances": "single_modal.allow_alliances",
"options_title": "single_modal.options_title",
"bots": "single_modal.bots",
"bots_disabled": "single_modal.bots_disabled",
"disable_nations": "single_modal.disable_nations",
"instant_build": "single_modal.instant_build",
"infinite_gold": "single_modal.infinite_gold",
"random_spawn": "single_modal.random_spawn",
"infinite_troops": "single_modal.infinite_troops",
"disable_nukes": "single_modal.disable_nukes",
"start": "single_modal.start"
},
"map": {
"map": "map.map",
"world": "map.world",
"europe": "map.europe",
"mena": "map.mena",
"northamerica": "map.northamerica",
"oceania": "map.oceania",
"blacksea": "map.blacksea",
"africa": "map.africa",
"asia": "map.asia",
"mars": "map.mars",
"southamerica": "map.southamerica",
"britannia": "map.britannia",
"gatewaytotheatlantic": "map.gatewaytotheatlantic",
"australia": "map.australia",
"random": "map.random",
"iceland": "map.iceland",
"pangaea": "map.pangaea"
},
"private_lobby": {
"title": "private_lobby.title",
"enter_id": "private_lobby.enter_id",
"player": "private_lobby.player",
"players": "private_lobby.players",
"join_lobby": "private_lobby.join_lobby",
"checking": "private_lobby.checking",
"not_found": "private_lobby.not_found",
"error": "private_lobby.error",
"joined_waiting": "private_lobby.joined_waiting"
},
"public_lobby": {
"join": "public_lobby.join",
"waiting": "public_lobby.waiting"
},
"username": {
"enter_username": "username.enter_username",
"not_string": "username.not_string",
"too_short": "username.too_short",
"too_long": "username.too_long",
"invalid_chars": "username.invalid_chars"
},
"host_modal": {
"title": "host_modal.title",
"options_title": "host_modal.options_title",
"bots": "host_modal.bots",
"bots_disabled": "host_modal.bots_disabled",
"player_immunity_duration": "host_modal.player_immunity_duration",
"disable_nations": "host_modal.disable_nations",
"instant_build": "host_modal.instant_build",
"random_spawn": "host_modal.random_spawn",
"infinite_gold": "host_modal.infinite_gold",
"infinite_troops": "host_modal.infinite_troops",
"disable_nukes": "host_modal.disable_nukes",
"player": "host_modal.player",
"players": "host_modal.players",
"waiting": "host_modal.waiting",
"start": "host_modal.start"
},
"game_starting_modal": {
"title": "game_starting_modal.title",
"desc": "game_starting_modal.desc"
},
"difficulty": {
"difficulty": "difficulty.difficulty",
"Relaxed": "difficulty.Relaxed",
"Balanced": "difficulty.Balanced",
"Intense": "difficulty.Intense",
"Impossible": "difficulty.Impossible"
},
"heads_up_message": {
"choose_spawn": "heads_up_message.choose_spawn",
"random_spawn": "heads_up_message.random_spawn"
}
}