Skip to content

Commit

Permalink
Fix mission names misused as mission description (#3376)
Browse files Browse the repository at this point in the history
* Fix missions misusing name as description

* Warn on long mission names

* Shorten some mission names

* DynoMod: shorten mission name
  • Loading branch information
olanti-p authored Oct 6, 2023
1 parent e82ebec commit 42d0b2f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 9 deletions.
3 changes: 2 additions & 1 deletion data/json/npcs/NPC_Brigitte_LaCroix.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@
{
"id": "MISSION_SEER_GATHER_BONE",
"type": "mission_definition",
"name": { "str": "Gather bones for Brigitte LaCroix. About 8 should do it." },
"name": { "str": "Gather Bones" },
"description": { "str": "Gather bones for Brigitte LaCroix. About 8 should do it." },
"difficulty": 1,
"value": 10000,
"goal": "MGOAL_FIND_ITEM",
Expand Down
8 changes: 5 additions & 3 deletions data/json/npcs/missiondef.json
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,8 @@
{
"id": "MISSION_LAST_DELIVERY",
"type": "mission_definition",
"name": { "str": "Reach The Mansion And Finish This Delivery" },
"name": { "str": "Finish The Delivery" },
"description": { "str": "Reach the mansion and finish this delivery." },
"goal": "MGOAL_GO_TO_TYPE",
"destination": "mansion_c3",
"difficulty": 1,
Expand Down Expand Up @@ -707,7 +708,8 @@
{
"id": "MISSION_GET_CITY_COP_MOMENTO",
"type": "mission_definition",
"name": { "str": "Break into armory to retrieve family photo" },
"name": { "str": "Retrieve Family Photo" },
"description": { "str": "Break into armory to retrieve family photo." },
"goal": "MGOAL_FIND_ITEM",
"difficulty": 2,
"value": 800,
Expand Down Expand Up @@ -789,7 +791,7 @@
{
"id": "MISSION_LEARN_ABOUT_CATTAIL_JELLY",
"type": "mission_definition",
"name": { "str": "Gather cattail stalks to create cattail jelly" },
"name": { "str": "Gather Cattail Stalks" },
"description": "Gather <color_light_blue>80 cattail stalks</color> from the swamp and bring them back to <color_light_red>learn how to craft cattail jelly</color>. Raise your <color_light_blue>survival skill to at least 1</color> by harvesting cattail stalks. <color_light_blue>Bring back the provided bag</color> as well.",
"goal": "MGOAL_CONDITION",
"goal_condition": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@
{
"id": "MISSION_REFUGEE_Uyen_1",
"type": "mission_definition",
"name": {
"name": { "str": "Find Antiseptic" },
"description": {
"str": "Find 50 doses of antiseptic for Uyen Tran in the refugee center, in exchange for <reward_count:FMCNote> Merch."
},
"goal": "MGOAL_FIND_ITEM",
Expand Down Expand Up @@ -188,7 +189,8 @@
{
"id": "MISSION_REFUGEE_Uyen_2",
"type": "mission_definition",
"name": { "str": "Find 30 bandages for Uyen Tran in the refugee center, in exchange for <reward_count:FMCNote> Merch." },
"name": { "str": "Find Bandages" },
"description": { "str": "Find 30 bandages for Uyen Tran in the refugee center, in exchange for <reward_count:FMCNote> Merch." },
"goal": "MGOAL_FIND_ITEM",
"difficulty": 2,
"value": 0,
Expand Down Expand Up @@ -218,7 +220,8 @@
{
"id": "MISSION_REFUGEE_Uyen_3",
"type": "mission_definition",
"name": { "str": "Find 6 bottles of Prozac for Uyen Tran in the refugee center, in exchange for <reward_count:FMCNote> Merch." },
"name": { "str": "Find Prozac" },
"description": { "str": "Find 6 bottles of Prozac for Uyen Tran in the refugee center, in exchange for <reward_count:FMCNote> Merch." },
"goal": "MGOAL_FIND_ITEM",
"difficulty": 2,
"value": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@
{
"id": "MISSION_REFUGEE_Vanessa_1",
"type": "mission_definition",
"name": { "str": "Make a makeshift haircut kit for Vanessa Toby in the refugee center" },
"name": { "str": "Make A Haircut Kit" },
"description": { "str": "Make a makeshift haircut kit for Vanessa Toby in the refugee center." },
"goal": "MGOAL_FIND_ITEM",
"difficulty": 2,
"value": 0,
Expand Down
3 changes: 2 additions & 1 deletion data/mods/DinoMod/NPC/NC_BO_BARONYX.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@
{
"id": "MISSION_SWAMPER_GATHER_MEAT",
"type": "mission_definition",
"name": { "str": "Gather meat for Bo Baronyx. About 8 should do it." },
"name": { "str": "Gather Meat" },
"description": { "str": "Gather meat for Bo Baronyx. About 8 should do it." },
"difficulty": 1,
"value": 10000,
"goal": "MGOAL_FIND_ITEM",
Expand Down
7 changes: 7 additions & 0 deletions src/missiondef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,13 @@ void mission_type::check_consistency()
if( !m.item_id.is_empty() && !m.item_id.is_valid() ) {
debugmsg( "Mission %s has undefined item id %s", m.id.c_str(), m.item_id.c_str() );
}
// 40 is an arbitrary limit, but it's enough to convey the meaning.
// Any extra details and such belong in the 'description' field.
if( json_report_strict && m.name.debug_get_raw().length() > 40 ) {
debugmsg( "Mission %s has name that exceeds recommended width of 40 characters (\"%s\"). "
"Consider moving the details into 'description' field.",
m.id, m.name.debug_get_raw() );
}
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/translations.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ class translation
*/
std::pair<bool, int> legacy_hash() const;

/**
* Get raw untranslated string for debug purposes.
*/
inline std::string_view debug_get_raw() const {
return raw;
}

private:
translation( const std::string &ctxt, const std::string &raw );
translation( const std::string &raw );
Expand Down

0 comments on commit 42d0b2f

Please sign in to comment.