Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split HINT_THE_LOCATION from PRESERVE_SPAWN_OMT flag #78193

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/json/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,11 @@
"type": "json_flag",
"//": "This item will store the OMT it spawned in the 'spawn_location_omt' var"
},
{
"id": "HINT_THE_LOCATION",
"type": "json_flag",
"//": "Same as PRESERVE_SPAWN_OMT, but aslo shows a snippet of how far the character from the `spawn_location_omt`: 1 OMT or less is `(from here)`, less than 6 OMT is `(from nearby)`, less than 30 OMT is `(from this area)`, anything more is (from far away)"
},
{
"id": "PROVIDES_TECHNIQUES",
"type": "json_flag",
Expand Down
62 changes: 45 additions & 17 deletions data/json/items/id_cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"copy-from": "id_science",
"name": { "str": "Maintenance: green zone badge" },
"description": "An employee badge for a maintenance worker. The reverse side describes the protocol for using it; this could grant access at green zone card readers.",
"flags": [ "SCIENCE_CARD_MAINTENANCE_GREEN", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ]
"flags": [ "SCIENCE_CARD_MAINTENANCE_GREEN", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ]
},
{
"type": "GENERIC",
Expand All @@ -98,7 +98,7 @@
"copy-from": "id_science",
"name": { "str": "Maintenance: ocher zone badge" },
"description": "An employee badge for a maintenance worker. The reverse side describes the protocol for using it; this could grant access at ocher zone card readers.",
"flags": [ "SCIENCE_CARD_MAINTENANCE_YELLOW", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ]
"flags": [ "SCIENCE_CARD_MAINTENANCE_YELLOW", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ]
},
{
"type": "GENERIC",
Expand All @@ -107,7 +107,7 @@
"copy-from": "id_science",
"name": { "str": "Maintenance: blue zone badge" },
"description": "An employee badge for a maintenance worker. The reverse side describes the protocol for using it; this could grant access at blue zone card readers.",
"flags": [ "SCIENCE_CARD_MAINTENANCE_BLUE", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ]
"flags": [ "SCIENCE_CARD_MAINTENANCE_BLUE", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ]
},
{
"type": "GENERIC",
Expand Down Expand Up @@ -146,7 +146,7 @@
"copy-from": "id_science",
"name": { "str": "Security: yellow zone badge" },
"description": "An employee badge for a security officer. The reverse side describes the protocol for using it; this could grant access at yellow zone card readers.",
"flags": [ "SCIENCE_CARD_SECURITY_YELLOW", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ]
"flags": [ "SCIENCE_CARD_SECURITY_YELLOW", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ]
},
{
"type": "GENERIC",
Expand All @@ -155,7 +155,7 @@
"copy-from": "id_science",
"name": { "str": "Security: magenta zone badge" },
"description": "An employee badge for a security officer. The reverse side describes the protocol for using it; this could grant access at magenta zone card readers.",
"flags": [ "SCIENCE_CARD_SECURITY_MAGENTA", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ]
"flags": [ "SCIENCE_CARD_SECURITY_MAGENTA", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ]
},
{
"type": "GENERIC",
Expand All @@ -164,7 +164,7 @@
"copy-from": "id_science",
"name": { "str": "Security: black zone badge" },
"description": "An employee badge for a security officer. The reverse side describes the protocol for using it; this could grant access at black zone card readers.",
"flags": [ "SCIENCE_CARD_SECURITY_BLACK", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ]
"flags": [ "SCIENCE_CARD_SECURITY_BLACK", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ]
},
{
"type": "GENERIC",
Expand All @@ -173,7 +173,7 @@
"copy-from": "id_science",
"name": { "str": "Researcher: light green zone badge" },
"description": "An employee badge for a research scientist. The reverse side describes the protocol for using it; this could grant access at light green zone card readers.",
"flags": [ "SCIENCE_CARD_MUTAGEN_GREEN", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ]
"flags": [ "SCIENCE_CARD_MUTAGEN_GREEN", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ]
},
{
"type": "GENERIC",
Expand All @@ -182,7 +182,7 @@
"copy-from": "id_science",
"name": { "str": "Researcher: pink zone badge" },
"description": "An employee badge for a research scientist. The reverse side describes the protocol for using it; this could grant access at pink zone card readers.",
"flags": [ "SCIENCE_CARD_MUTAGEN_PINK", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ]
"flags": [ "SCIENCE_CARD_MUTAGEN_PINK", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ]
},
{
"type": "GENERIC",
Expand All @@ -191,7 +191,7 @@
"copy-from": "id_science",
"name": { "str": "Researcher: cyan zone badge" },
"description": "An employee badge for a research scientist. The reverse side describes the protocol for using it; this could grant access at cyan zone card readers.",
"flags": [ "SCIENCE_CARD_MUTAGEN_CYAN", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ]
"flags": [ "SCIENCE_CARD_MUTAGEN_CYAN", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ]
},
{
"type": "GENERIC",
Expand All @@ -200,7 +200,7 @@
"copy-from": "id_science",
"name": { "str": "Doctor: red zone badge" },
"description": "An employee badge for a medical doctor. The reverse side describes the protocol for using it; this could grant access at red zone card readers.",
"flags": [ "SCIENCE_CARD_MEDICAL_RED", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ]
"flags": [ "SCIENCE_CARD_MEDICAL_RED", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ]
},
{
"type": "GENERIC",
Expand All @@ -219,7 +219,7 @@
"looks_like": "id_science",
"name": { "str": "LIXA ID badge" },
"description": "An ID badge for the LIXA facility, with a photo of an awkwardly smiling scientist on the front. Instructions on the back explain that this will grant you access to the LIXA experiment floor.",
"flags": [ "LIXA_SCIENCE_CARD", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ],
"flags": [ "LIXA_SCIENCE_CARD", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ],
"price_postapoc": "2 USD 50 cent",
"material": [ "plastic" ],
"weight": "3 g",
Expand All @@ -233,7 +233,7 @@
"looks_like": "id_science",
"name": { "str": "defaced LIXA ID badge" },
"description": "An ID badge for the LIXA facility, with a photo of an awkwardly smiling scientist on the front. It is heavily scratched, and there is a line on the back in black marker.",
"flags": [ "LIXA_SCIENCE_CARD", "LIXA_SCIENCE_CARD_2", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ],
"flags": [ "LIXA_SCIENCE_CARD", "LIXA_SCIENCE_CARD_2", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ],
"price_postapoc": "2 USD 50 cent",
"material": [ "plastic" ],
"weight": "3 g",
Expand All @@ -247,7 +247,14 @@
"looks_like": "id_science",
"name": { "str": "LIXA ID badge: Dr. Najma Saed", "str_pl": "LIXA ID badges: Dr. Najma Saed" },
"description": "An ID badge for the LIXA facility. The photo is of a pleasantly smiling woman in a hijab.",
"flags": [ "LIXA_SCIENCE_CARD", "LIXA_SCIENCE_CARD_2", "LIXA_SCIENCE_CARD_3", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ],
"flags": [
"LIXA_SCIENCE_CARD",
"LIXA_SCIENCE_CARD_2",
"LIXA_SCIENCE_CARD_3",
"PRESERVE_SPAWN_OMT",
"HINT_THE_LOCATION",
"CREDIT_CARD_SHAPED"
],
"price_postapoc": "2 USD 50 cent",
"material": [ "plastic" ],
"weight": "3 g",
Expand All @@ -261,7 +268,14 @@
"looks_like": "id_science",
"name": { "str": "LIXA ID badge: Dr. Jason Mitchell", "str_pl": "LIXA ID badges: Dr. Jason Mitchell" },
"description": "An ID badge for the LIXA facility. The photo is of a confidently smiling young man.",
"flags": [ "LIXA_SCIENCE_CARD", "LIXA_SCIENCE_CARD_2", "LIXA_SCIENCE_CARD_3", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ],
"flags": [
"LIXA_SCIENCE_CARD",
"LIXA_SCIENCE_CARD_2",
"LIXA_SCIENCE_CARD_3",
"PRESERVE_SPAWN_OMT",
"HINT_THE_LOCATION",
"CREDIT_CARD_SHAPED"
],
"price_postapoc": "2 USD 50 cent",
"material": [ "plastic" ],
"weight": "3 g",
Expand All @@ -275,7 +289,14 @@
"looks_like": "id_science",
"name": { "str": "LIXA ID badge: Dr. Kai-Mei Luo", "str_pl": "LIXA ID badges: Dr. Kai-Mei Luo" },
"description": "An ID badge for the LIXA facility. The photo is of an awkwardly smiling woman, who blinked during the picture.",
"flags": [ "LIXA_SCIENCE_CARD", "LIXA_SCIENCE_CARD_2", "LIXA_SCIENCE_CARD_3", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ],
"flags": [
"LIXA_SCIENCE_CARD",
"LIXA_SCIENCE_CARD_2",
"LIXA_SCIENCE_CARD_3",
"PRESERVE_SPAWN_OMT",
"HINT_THE_LOCATION",
"CREDIT_CARD_SHAPED"
],
"price_postapoc": "2 USD 50 cent",
"material": [ "plastic" ],
"weight": "3 g",
Expand All @@ -289,7 +310,14 @@
"looks_like": "id_science",
"name": { "str": "LIXA ID badge: Dr. Richard Raimes", "str_pl": "LIXA ID badges: Dr. Richard Raimes" },
"description": "An ID badge for the LIXA facility. The photo is of a gently smiling older man, with kind eyes.",
"flags": [ "LIXA_SCIENCE_CARD", "LIXA_SCIENCE_CARD_2", "LIXA_SCIENCE_CARD_3", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ],
"flags": [
"LIXA_SCIENCE_CARD",
"LIXA_SCIENCE_CARD_2",
"LIXA_SCIENCE_CARD_3",
"PRESERVE_SPAWN_OMT",
"HINT_THE_LOCATION",
"CREDIT_CARD_SHAPED"
],
"price_postapoc": "2 USD 50 cent",
"material": [ "plastic" ],
"weight": "3 g",
Expand All @@ -303,7 +331,7 @@
"looks_like": "id_LIXA_mil",
"name": { "str": "LIXA military police badge" },
"description": "An id card bearing the name, rank, and serial number of a soldier stationed at LIXA.",
"flags": [ "LIXA_MILITARY_CARD", "LIXA_SCIENCE_CARD", "PRESERVE_SPAWN_OMT", "CREDIT_CARD_SHAPED" ],
"flags": [ "LIXA_MILITARY_CARD", "LIXA_SCIENCE_CARD", "PRESERVE_SPAWN_OMT", "HINT_THE_LOCATION", "CREDIT_CARD_SHAPED" ],
"price_postapoc": "2 USD 50 cent",
"material": [ "plastic" ],
"weight": "3 g",
Expand Down
12 changes: 11 additions & 1 deletion data/json/items/tool/electronics.json
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,17 @@
},
{ "type": "link_up", "cable_length": 3, "charge_rate": "20 W" }
],
"flags": [ "WATCH", "ALARMCLOCK", "USE_UPS", "NO_UNLOAD", "NO_RELOAD", "WATER_BREAK", "CALORIES_INTAKE", "ELECTRONIC" ],
"flags": [
"WATCH",
"ALARMCLOCK",
"USE_UPS",
"NO_UNLOAD",
"NO_RELOAD",
"WATER_BREAK",
"CALORIES_INTAKE",
"ELECTRONIC",
"PRESERVE_SPAWN_OMT"
],
"pocket_data": [
{ "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 56 } },
{
Expand Down
1 change: 1 addition & 0 deletions doc/JSON_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ These flags can be applied via JSON item definition to most items. Not to be co
- ```PLANTABLE_SEED``` This item is a seed, and you can plant it.
- ```POST_UP``` This item can be placed on terrain/furniture with the WALL flag.
- ```PRESERVE_SPAWN_OMT``` This item will store the OMT that it spawns in, in the `spawn_location_omt` item var.
- ```HINT_THE_LOCATION``` if PRESERVE_SPAWN_OMT is used, shows a snippet of how far the character from the `spawn_location_omt`: 1 OMT or less is `(from here)`, less than 6 OMT is `(from nearby)`, less than 30 OMT is `(from this area)`, anything more is (from far away)
- ```PROVIDES_TECHNIQUES``` This item will provide martial arts techniques when worn/in the character's inventory, in addition to those provided by the weapon and martial art.
- ```PSEUDO``` Used internally to mark items that are referred to in the crafting inventory but are not actually items. They can be used as tools, but not as components. Implies `TRADER_AVOID`.
- ```RABBIT``` Food that only player with `RABBIT` threshold mutation can eat. See also `INEDIBLE`.
Expand Down
3 changes: 2 additions & 1 deletion src/item_tname.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "type_id.h"
#include "units.h"

static const flag_id json_flag_HINT_THE_LOCATION( "HINT_THE_LOCATION" );

static const itype_id itype_barrel_small( "barrel_small" );
static const itype_id itype_disassembly( "disassembly" );
Expand Down Expand Up @@ -289,7 +290,7 @@ std::string food_traits( item const &it, unsigned int /* quantity */,
std::string location_hint( item const &it, unsigned int /* quantity */,
segment_bitset const &/* segments */ )
{
if( it.has_var( "spawn_location_omt" ) ) {
if( it.has_flag( json_flag_HINT_THE_LOCATION ) && it.has_var( "spawn_location_omt" ) ) {
tripoint_abs_omt loc( it.get_var( "spawn_location_omt", tripoint_abs_omt::zero ) );
tripoint_abs_omt player_loc( coords::project_to<coords::omt>( get_map().getglobal(
get_avatar().pos_bub() ) ) );
Expand Down
Loading