From da6a7cf382b94790addc3997ae6d49e6c3b1db0c Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 14 Dec 2019 12:38:08 +0100 Subject: [PATCH 01/23] Remove useless debug message: "info" and "default" are optional and ignored anyway. --- src/options.cpp | 6 +----- src/worldfactory.cpp | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/options.cpp b/src/options.cpp index 7131ef7e88121..3b4b628d6b036 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -2820,16 +2820,12 @@ void options_manager::deserialize( JsonIn &jsin ) jsin.start_array(); while( !jsin.end_array() ) { JsonObject joOptions = jsin.get_object(); + joOptions.allow_omitted_members(); const std::string name = migrateOptionName( joOptions.get_string( "name" ) ); const std::string value = migrateOptionValue( joOptions.get_string( "name" ), joOptions.get_string( "value" ) ); - // Verify format of options file - if( !joOptions.has_string( "info" ) || !joOptions.has_string( "default" ) ) { - dbg( D_ERROR ) << "options object " << name << " was missing info or default"; - } - add_retry( name, value ); options[ name ].setValue( value ); } diff --git a/src/worldfactory.cpp b/src/worldfactory.cpp index 1b43684991eae..a4fb5c973b0ba 100644 --- a/src/worldfactory.cpp +++ b/src/worldfactory.cpp @@ -1332,15 +1332,11 @@ void WORLD::load_options( JsonIn &jsin ) jsin.start_array(); while( !jsin.end_array() ) { JsonObject jo = jsin.get_object(); + jo.allow_omitted_members(); const std::string name = opts.migrateOptionName( jo.get_string( "name" ) ); const std::string value = opts.migrateOptionValue( jo.get_string( "name" ), jo.get_string( "value" ) ); - // Verify format of options file - if( !jo.has_string( "info" ) || !jo.has_string( "default" ) ) { - dbg( D_ERROR ) << "options object " << name << " was missing info or default"; - } - if( name == "CORE_VERSION" ) { version = std::max( std::atoi( value.c_str() ), 0 ); continue; From 2dfcb21662f00acb6ec901e676ca063a02f5d3c4 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 14 Dec 2019 12:41:03 +0100 Subject: [PATCH 02/23] Convert silent debug message to load message This informs the user that their mods use outdated syntax and encourage them / the mod authors to convert them to the new syntax to get rid of the debug message. --- src/auto_pickup.cpp | 2 +- src/color.cpp | 10 +++++----- src/color_loader.h | 3 +-- src/options.cpp | 4 ++-- src/overmap.cpp | 4 ++-- src/safemode_ui.cpp | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/auto_pickup.cpp b/src/auto_pickup.cpp index b17d31723e38d..94fd78e676704 100644 --- a/src/auto_pickup.cpp +++ b/src/auto_pickup.cpp @@ -795,7 +795,7 @@ void rule_list::load_legacy_rules( std::istream &fin ) const int iNum = std::count( sLine.begin(), sLine.end(), ';' ); if( iNum != 2 ) { - DebugLog( D_ERROR, DC_ALL ) << "Bad Rule: " << sLine; + debugmsg( "Bad Rule: %s (will be skipped)", sLine ); } else { std::string sRule; bool bActive = true; diff --git a/src/color.cpp b/src/color.cpp index eb065c27e14b7..e5c4824eb6af0 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -99,7 +99,7 @@ color_id color_manager::name_to_id( const std::string &name ) const { auto iter = name_map.find( name ); if( iter == name_map.end() ) { - DebugLog( D_ERROR, DC_ALL ) << "couldn't parse color: " << name ; + debugmsg( "couldn't parse color: %s", name ); return def_c_unset; } @@ -559,8 +559,8 @@ nc_color color_from_string( const std::string &color ) while( ( pos = new_color.find( i.second, pos ) ) != std::string::npos ) { new_color.replace( pos, i.second.length(), i.first ); pos += i.first.length(); - DebugLog( D_WARNING, DC_ALL ) << "Deprecated foreground color suffix was used: (" << - i.second << ") in (" << color << "). Please update mod that uses that."; + debugmsg( "Deprecated foreground color suffix was used: (%d) in (%s). Please update mod that uses that.", + i.second, color ); } } @@ -604,8 +604,8 @@ nc_color bgcolor_from_string( const std::string &color ) while( ( pos = new_color.find( i.second, pos ) ) != std::string::npos ) { new_color.replace( pos, i.second.length(), i.first ); pos += i.first.length(); - DebugLog( D_WARNING, DC_ALL ) << "Deprecated background color suffix was used: (" << - i.second << ") in (" << color << "). Please update mod that uses that."; + debugmsg( "Deprecated background color suffix was used: (%s) in (%s). Please update mod that uses that.", + i.second, color ); } } diff --git a/src/color_loader.h b/src/color_loader.h index 9c9d3c8695bd2..cbc396092edf9 100644 --- a/src/color_loader.h +++ b/src/color_loader.h @@ -71,8 +71,7 @@ class color_loader try { load_colorfile( custom_path ); } catch( const JsonError &err ) { - DebugLog( D_ERROR, D_SDL ) << "Failed to load color data from " << custom_path << ": " << - err.what(); + debgmsg( "Failed to load color data from \"%s\": %s", custom_path, err.what() ); // this should succeed, otherwise the installation is botched load_colorfile( default_path ); diff --git a/src/options.cpp b/src/options.cpp index 3b4b628d6b036..ea47de7993876 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -884,8 +884,8 @@ static std::vector build_resource_list( resource_names.emplace_back( resource_name, view_name.empty() ? no_translation( resource_name ) : to_translation( view_name ) ); if( resource_option.count( resource_name ) != 0 ) { - DebugLog( D_ERROR, DC_ALL ) << "Found " << operation_name << " duplicate with name " << - resource_name; + debugmsg( "Found \"%s\" duplicate with name \"%s\" (new definition will be ignored)", + operation_name, resource_name ); } else { resource_option.insert( std::pair( resource_name, resource_dir ) ); } diff --git a/src/overmap.cpp b/src/overmap.cpp index a87882c4e145a..1aeed0c2eedec 100644 --- a/src/overmap.cpp +++ b/src/overmap.cpp @@ -582,8 +582,8 @@ void oter_type_t::load( const JsonObject &jo, const std::string &src ) << id.c_str() << " (" << name << ")"; } if( !jo.has_string( "sym" ) && jo.has_number( "sym" ) ) { - DebugLog( D_ERROR, D_MAP_GEN ) << "sym is defined as number instead of string for overmap_terrain: " - << id.c_str() << " (" << name << ")"; + debugmsg( "sym is defined as number instead of string for overmap_terrain %s (%s)", id.c_str(), + name ); } load_overmap_terrain_mapgens( jo, id.str() ); } diff --git a/src/safemode_ui.cpp b/src/safemode_ui.cpp index ae03647b6a93f..d4b1fdbee119e 100644 --- a/src/safemode_ui.cpp +++ b/src/safemode_ui.cpp @@ -682,7 +682,7 @@ void safemode::load( const bool is_character_in ) JsonIn jsin( fin ); deserialize( jsin ); } catch( const JsonError &e ) { - DebugLog( D_ERROR, DC_ALL ) << "safemode::load: " << e; + debugmsg( "Error while loading safemode settings: %s", e.what() ); } } From 1db2da54309cfd5f98e2eb70eeaf13fe534c28cc Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 14 Dec 2019 20:37:00 +0100 Subject: [PATCH 03/23] Remove JSON members that are not visited and therefor useless. --- .../isherwood_farm/NPC_Barry_Isherwood.json | 2 +- .../isherwood_farm/NPC_Carlos_Isherwood.json | 1 - .../isherwood_farm/NPC_Chris_Isherwood.json | 1 - .../isherwood_farm/NPC_Eddie_Isherwood.json | 1 - .../surface_refugees/NPC_Dana_Nunez.json | 2 +- .../NPC_free_merchant_shopkeep.json | 3 -- .../NPC_old_guard_representative.json | 2 - .../npcs/robofac/NPC_ROBOFAC_INTERCOM.json | 2 - .../tacoma_ranch/NPC_ranch_bartender.json | 4 -- .../npcs/tacoma_ranch/NPC_ranch_foreman.json | 52 ------------------- data/mods/Aftershock/items/afs_bioparts.json | 2 - data/mods/Aftershock/items/afs_tools.json | 2 +- data/mods/Aftershock/maps/afs_furniture.json | 2 - data/mods/FictonalWeapons/fic_mods.json | 3 +- data/mods/FictonalWeapons/fic_weapons.json | 1 - data/mods/Modular_Turrets/items.json | 3 -- data/mods/Salvaged_Robots/monsters.json | 30 ----------- 17 files changed, 4 insertions(+), 109 deletions(-) diff --git a/data/json/npcs/isherwood_farm/NPC_Barry_Isherwood.json b/data/json/npcs/isherwood_farm/NPC_Barry_Isherwood.json index 11a70b1485f3e..834ab44363852 100644 --- a/data/json/npcs/isherwood_farm/NPC_Barry_Isherwood.json +++ b/data/json/npcs/isherwood_farm/NPC_Barry_Isherwood.json @@ -77,7 +77,7 @@ "destination": "dairy_farm_isherwood_W", "start": { "effect": [ { "u_add_var": "u_have_barry_escape", "type": "general", "context": "meeting", "value": "yes" } ], - "assign_mission_target": { "om_terrain": "dairy_farm_isherwood_W", "om_special": "Isherwood Farms", "reveal_radius": 3 } + "assign_mission_target": { "om_terrain": "dairy_farm_isherwood_W", "reveal_radius": 3 } }, "end": { "opinion": { "trust": 5, "value": 5 }, diff --git a/data/json/npcs/isherwood_farm/NPC_Carlos_Isherwood.json b/data/json/npcs/isherwood_farm/NPC_Carlos_Isherwood.json index a8fd1ec2c2c2a..c9427af5c6c52 100644 --- a/data/json/npcs/isherwood_farm/NPC_Carlos_Isherwood.json +++ b/data/json/npcs/isherwood_farm/NPC_Carlos_Isherwood.json @@ -198,7 +198,6 @@ "update_mapgen": [ { "om_terrain": "horse_farm_isherwood_4", - "om_special": "Isherwood Farms", "set": [ { "point": "furniture", "id": "f_anvil", "x": 6, "y": 12 } ] } ] diff --git a/data/json/npcs/isherwood_farm/NPC_Chris_Isherwood.json b/data/json/npcs/isherwood_farm/NPC_Chris_Isherwood.json index d78f4c0fd01b7..57d907bf2f3ad 100644 --- a/data/json/npcs/isherwood_farm/NPC_Chris_Isherwood.json +++ b/data/json/npcs/isherwood_farm/NPC_Chris_Isherwood.json @@ -189,7 +189,6 @@ "update_mapgen": [ { "om_terrain": "cabin_isherwood", - "om_special": "Isherwood Farms", "place_nested": [ { "chunks": [ "cabin_isherwood_update" ], "x": 3, "y": 1 } ] } ] diff --git a/data/json/npcs/isherwood_farm/NPC_Eddie_Isherwood.json b/data/json/npcs/isherwood_farm/NPC_Eddie_Isherwood.json index d2ce435f3e92a..8970247bf6f2d 100644 --- a/data/json/npcs/isherwood_farm/NPC_Eddie_Isherwood.json +++ b/data/json/npcs/isherwood_farm/NPC_Eddie_Isherwood.json @@ -222,7 +222,6 @@ "update_mapgen": [ { "om_terrain": "rural_outbuilding", - "om_special": "Isherwood Farms", "place_nested": [ { "chunks": [ "isherwood_outbuilding_kilns" ], "x": 0, "y": 0 } ], "set": [ { "point": "furniture", "id": "f_kiln_empty", "x": 8, "y": 13 }, diff --git a/data/json/npcs/refugee_center/surface_refugees/NPC_Dana_Nunez.json b/data/json/npcs/refugee_center/surface_refugees/NPC_Dana_Nunez.json index 4d092a1329238..3496c276a12bd 100644 --- a/data/json/npcs/refugee_center/surface_refugees/NPC_Dana_Nunez.json +++ b/data/json/npcs/refugee_center/surface_refugees/NPC_Dana_Nunez.json @@ -328,7 +328,7 @@ "item": "landough_calrisean", "start": { "assign_mission_target": { "om_terrain": "bakery", "reveal_radius": 1, "random": true, "search_range": 120 }, - "update_mapgen": { "om_terrain": "bakery", "om_special": "bakery", "place_item": [ { "item": "landough_calrisean", "x": 5, "y": 16 } ] }, + "update_mapgen": { "om_terrain": "bakery", "place_item": [ { "item": "landough_calrisean", "x": 5, "y": 16 } ] }, "effect": { "u_add_var": "Dana_Sourdough", "type": "mission", "context": "flag", "value": "in_progress" } }, "end": { diff --git a/data/json/npcs/refugee_center/surface_staff/NPC_free_merchant_shopkeep.json b/data/json/npcs/refugee_center/surface_staff/NPC_free_merchant_shopkeep.json index c9b611f314bed..963339124865e 100644 --- a/data/json/npcs/refugee_center/surface_staff/NPC_free_merchant_shopkeep.json +++ b/data/json/npcs/refugee_center/surface_staff/NPC_free_merchant_shopkeep.json @@ -415,7 +415,6 @@ "assign_mission_target": { "om_terrain": "evac_center_9", "reveal_radius": 1 }, "update_mapgen": { "om_terrain": "evac_center_9", - "om_special": "evac_center", "place_monster": [ { "group": "GROUP_REFUGEE_BOSS_ZOMBIE", "name": "Sean McLaughlin", "x": 10, "y": 10, "target": true } ] } }, @@ -426,7 +425,6 @@ ], "update_mapgen": { "om_terrain": "evac_center_9", - "om_special": "evac_center", "set": [ { "square": "terrain", "id": "t_floor", "x": 0, "y": 23, "x2": 1, "y2": 23 } ] } }, @@ -556,7 +554,6 @@ ], "update_mapgen": { "om_terrain": "evac_center_8", - "om_special": "evac_center", "set": [ { "point": "terrain", "id": "t_gates_mech_control_lab", "x": 17, "y": 1 }, { "point": "terrain", "id": "t_gates_mech_control_lab", "x": 17, "y": 3 } diff --git a/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json b/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json index 4f6c05a918819..f0830b5ebb9ec 100644 --- a/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json +++ b/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json @@ -133,12 +133,10 @@ "update_mapgen": [ { "om_terrain": "evac_center_19", - "om_special": "evac_center", "place_npcs": [ { "class": "evac_guard3", "x": 12, "y": 12, "target": true } ] }, { "om_terrain": "evac_center_7", - "om_special": "evac_center", "place_npcs": [ { "class": "scavenger_hunter", "x": [ 9, 15 ], "y": [ 9, 15 ] } ] } ] diff --git a/data/json/npcs/robofac/NPC_ROBOFAC_INTERCOM.json b/data/json/npcs/robofac/NPC_ROBOFAC_INTERCOM.json index ea38f5434b0f1..6605d27f48e8e 100644 --- a/data/json/npcs/robofac/NPC_ROBOFAC_INTERCOM.json +++ b/data/json/npcs/robofac/NPC_ROBOFAC_INTERCOM.json @@ -122,12 +122,10 @@ "update_mapgen": [ { "om_terrain": "robofachq_surface_b0", - "om_special": "hub_01", "place_nested": [ { "chunks": [ "robofac_hq_surface_freemerchant_camp" ], "x": 4, "y": 0 } ] }, { "om_terrain": "robofachq_surface_entrance", - "om_special": "hub_01", "place_nested": [ { "chunks": [ "robofac_hq_surface_merc_1" ], "x": 3, "y": 10 } ] } ], diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_bartender.json b/data/json/npcs/tacoma_ranch/NPC_ranch_bartender.json index afa3ace311ea3..739b67bf3da91 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_bartender.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_bartender.json @@ -93,7 +93,6 @@ "end": { "update_mapgen": { "om_terrain": "ranch_camp_51", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_bar_bartender_1" ], "x": 0, "y": 0 } ] } } @@ -124,7 +123,6 @@ "effect": { "npc_add_trait": "NPC_BRANDY" }, "update_mapgen": { "om_terrain": "ranch_camp_51", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_bar_bartender_2" ], "x": 0, "y": 0 } ] } } @@ -155,7 +153,6 @@ "effect": { "npc_add_trait": "NPC_RUM" }, "update_mapgen": { "om_terrain": "ranch_camp_51", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_bar_bartender_3" ], "x": 0, "y": 0 } ] } } @@ -186,7 +183,6 @@ "effect": { "npc_add_trait": "NPC_WHISKEY" }, "update_mapgen": { "om_terrain": "ranch_camp_51", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_bar_bartender_4" ], "x": 0, "y": 0 } ] } } diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json b/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json index 8d3f66d705851..752c45aa6cded 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json @@ -104,13 +104,11 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_65", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "place_nested": [ { "chunks": [ "tacoma_commune_west_wall_door" ], "x": 22, "y": 0 } ] }, { "om_terrain": "ranch_camp_66", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "place_nested": [ { "chunks": [ "tacoma_commune_east_wall_door" ], "x": 0, "y": 0 }, @@ -120,13 +118,11 @@ }, { "om_terrain": "ranch_camp_74", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "place_nested": [ { "chunks": [ "tacoma_commune_west_wall_door" ], "x": 22, "y": 0 } ] }, { "om_terrain": "ranch_camp_66", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "place_nested": [ { "chunks": [ "tacoma_commune_east_wall_door" ], "x": 0, "y": 0 }, @@ -163,7 +159,6 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_65", - "om_special": "ranch_camp", "//": "Beds in the barn", "place_nested": [ { "chunks": [ "tacoma_commune_makeshift_bed" ], "x": 19, "y": 1 }, @@ -178,7 +173,6 @@ }, { "om_terrain": "ranch_camp_66", - "om_special": "ranch_camp", "//": "Beds in the barn", "place_nested": [ { "chunks": [ "tacoma_commune_makeshift_bed" ], "x": 19, "y": 1 }, @@ -229,7 +223,6 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_46", - "om_special": "ranch_camp", "//": "tilled soil in the fields", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "set": [ @@ -240,7 +233,6 @@ }, { "om_terrain": "ranch_camp_55", - "om_special": "ranch_camp", "//": "tilled soil in the fields", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "set": [ @@ -251,19 +243,16 @@ }, { "om_terrain": "ranch_camp_56", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "place_vehicles": [ { "vehicle": "hippie_van", "x": 10, "y": 10, "rotation": 270, "chance": 100 } ] }, { "om_terrain": "ranch_camp_65", - "om_special": "ranch_camp", "place_furniture": [ { "furn": "f_bookcase", "x": 17, "y": 11 } ], "place_npcs": [ { "class": "ranch_farmer_1", "x": 19, "y": 20 } ] }, { "om_terrain": "ranch_camp_66", - "om_special": "ranch_camp", "place_npcs": [ { "class": "ranch_woodcutter_1", "x": 4, "y": 11 } ] } ] @@ -295,7 +284,6 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_46", - "om_special": "ranch_camp", "//": "tilled soil in the fields", "set": [ { "square": "terrain", "id": "t_dirtmound", "x": 14, "y": 5, "x2": 15, "y2": 22 }, @@ -305,7 +293,6 @@ }, { "om_terrain": "ranch_camp_55", - "om_special": "ranch_camp", "//": "tilled soil in the fields", "set": [ { "square": "terrain", "id": "t_dirtmound", "x": 14, "y": 2, "x2": 15, "y2": 17 }, @@ -315,24 +302,20 @@ }, { "om_terrain": "ranch_camp_56", - "om_special": "ranch_camp", "place_vehicles": [ { "vehicle": "flatbed_truck", "x": 18, "y": 3, "rotation": 0, "chance": 100 } ] }, { "om_terrain": "ranch_camp_57", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "place_npcs": [ { "class": "ranch_crop_overseer", "x": 12, "y": 7 } ] }, { "om_terrain": "ranch_camp_58", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "place_nested": [ { "chunks": [ "tacoma_commune_lumbermill_4" ], "x": 0, "y": 2 } ] }, { "om_terrain": "ranch_camp_67", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "set": [ { "square": "terrain", "id": "t_palisade", "x": 21, "y": 19, "x2": 23, "y2": 19 } ] } @@ -365,24 +348,20 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_56", - "om_special": "ranch_camp", "place_vehicles": [ { "vehicle": "car_chassis", "x": 17, "y": 11, "rotation": 90, "chance": 100 } ] }, { "om_terrain": "ranch_camp_58", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_lumbermill_5" ], "x": 0, "y": 2 } ], "set": [ { "point": "terrain", "id": "t_pit", "x": 6, "y": 18 } ] }, { "om_terrain": "ranch_camp_66", - "om_special": "ranch_camp", "set": [ { "point": "terrain", "id": "t_palisade", "x": 23, "y": 22 } ], "place_npcs": [ { "class": "ranch_farmer_2", "x": 9, "y": 22 } ] }, { "om_terrain": "ranch_camp_67", - "om_special": "ranch_camp", "set": [ { "square": "terrain", "id": "t_palisade", "x": 0, "y": 22, "x2": 5, "y2": 22 } ] } ] @@ -414,13 +393,11 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_58", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_lumbermill_6" ], "x": 0, "y": 2 } ], "set": [ { "point": "terrain", "id": "t_covered_well", "x": 6, "y": 18 } ] }, { "om_terrain": "ranch_camp_66", - "om_special": "ranch_camp", "set": [ { "point": "furniture", "id": "f_fireplace", "x": 6, "y": 12 }, { "point": "furniture", "id": "f_fireplace", "x": 8, "y": 12 } @@ -463,7 +440,6 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_56", - "om_special": "ranch_camp", "//": "western palisade", "set": [ { "square": "terrain", "id": "t_palisade", "x": 16, "y": 16, "x2": 16, "y2": 23 }, @@ -473,7 +449,6 @@ }, { "om_terrain": "ranch_camp_58", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_lumbermill_7" ], "x": 0, "y": 2 } ], "//": "finish the well", "set": [ @@ -483,7 +458,6 @@ }, { "om_terrain": "ranch_camp_65", - "om_special": "ranch_camp", "//": "untilled soil in the fields", "set": [ { "square": "terrain", "id": "t_dirt", "x": 0, "y": 4, "x2": 12, "y2": 18 } ] } @@ -516,7 +490,6 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_56", - "om_special": "ranch_camp", "//": "finish western palisade", "set": [ { "square": "terrain", "id": "t_palisade", "x": 23, "y": 7, "x2": 23, "y2": 10 }, @@ -525,12 +498,10 @@ }, { "om_terrain": "ranch_camp_58", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_lumbermill_8_done" ], "x": 0, "y": 2 } ] }, { "om_terrain": "ranch_camp_59", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_toolshed_8" ], "x": 13, "y": 17 }, { "chunks": [ "tacoma_commune_clinic_8" ], "x": 0, "y": 2 } @@ -538,7 +509,6 @@ }, { "om_terrain": "ranch_camp_65", - "om_special": "ranch_camp", "//": "tilled soil in the fields", "set": [ { "square": "terrain", "id": "t_dirtmound", "x": 1, "y": 5, "x2": 2, "y2": 17 }, @@ -549,7 +519,6 @@ }, { "om_terrain": "ranch_camp_68", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_outhouse_8" ], "x": 16, "y": 1 } ] } ] @@ -581,7 +550,6 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_59", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_toolshed_9_done" ], "x": 13, "y": 17 }, { "chunks": [ "tacoma_commune_clinic_9" ], "x": 0, "y": 2 } @@ -589,7 +557,6 @@ }, { "om_terrain": "ranch_camp_68", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_outhouse_9_done" ], "x": 16, "y": 1 } ] } ] @@ -621,12 +588,10 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_59", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_clinic_10" ], "x": 0, "y": 2 } ] }, { "om_terrain": "ranch_camp_60", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_chopshop_10" ], "x": 0, "y": 4 } ] } ] @@ -658,17 +623,14 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_59", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_clinic_11" ], "x": 0, "y": 2 } ] }, { "om_terrain": "ranch_camp_60", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_chopshop_11" ], "x": 0, "y": 4 } ] }, { "om_terrain": "ranch_camp_61", - "om_special": "ranch_camp", "place_vehicles": [ { "vehicle": "car", "chance": 100, "rotation": 270, "x": 1, "y": 20 }, { "vehicle": "cube_van_cheap", "chance": 100, "rotation": 90, "x": 10, "y": 10 }, @@ -678,7 +640,6 @@ }, { "om_terrain": "ranch_camp_69", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "place_vehicles": [ { "vehicle": "car_chassis", "chance": 100, "rotation": 0, "x": 3, "y": 14 }, @@ -715,17 +676,14 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_49", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_junk_shop_12" ], "x": 0, "y": 9 } ] }, { "om_terrain": "ranch_camp_60", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_chopshop_12_done" ], "x": 0, "y": 4 } ] }, { "om_terrain": "ranch_camp_69", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "place_vehicles": [ { "vehicle": "cube_van", "chance": 100, "rotation": 180, "x": 13, "y": 15 } ] } @@ -758,17 +716,14 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_49", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_junk_shop_13" ], "x": 0, "y": 9 } ] }, { "om_terrain": "ranch_camp_66", - "om_special": "ranch_camp", "place_npcs": [ { "class": "ranch_barber", "x": 5, "y": 3 } ] }, { "om_terrain": "ranch_camp_70", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "place_vehicles": [ { "vehicle": "car_mini", "chance": 100, "rotation": 45, "x": 8, "y": 3 } ] } @@ -801,17 +756,14 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_49", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_junk_shop_14_done" ], "x": 0, "y": 9 } ] }, { "om_terrain": "ranch_camp_51", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_bar_14" ], "x": 0, "y": 0 } ] }, { "om_terrain": "ranch_camp_61", - "om_special": "ranch_camp", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], "place_vehicles": [ { "vehicle": "ambulance", "chance": 100, "rotation": 90, "x": 14, "y": 4 } ] } @@ -843,7 +795,6 @@ "end": { "update_mapgen": { "om_terrain": "ranch_camp_51", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_bar_15" ], "x": 0, "y": 0 } ] } } @@ -874,12 +825,10 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_51", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_bar_16_done" ], "x": 0, "y": 0 } ] }, { "om_terrain": "ranch_camp_52", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_greenhouse_16" ], "x": 2, "y": 10 } ] } ] @@ -911,7 +860,6 @@ "update_mapgen": [ { "om_terrain": "ranch_camp_52", - "om_special": "ranch_camp", "place_nested": [ { "chunks": [ "tacoma_commune_greenhouse_17_done" ], "x": 2, "y": 10 } ] } ] diff --git a/data/mods/Aftershock/items/afs_bioparts.json b/data/mods/Aftershock/items/afs_bioparts.json index 96a2259546a8e..4a98739889e9d 100644 --- a/data/mods/Aftershock/items/afs_bioparts.json +++ b/data/mods/Aftershock/items/afs_bioparts.json @@ -106,8 +106,6 @@ "dispersion": 90, "durability": 7, "loudness": 8, - "max_charges": 80, - "initial_charges": 80, "ammo_effects": [ "LASER", "INCENDIARY" ], "flags": [ "NO_UNLOAD", "NON-FOULING" ] } diff --git a/data/mods/Aftershock/items/afs_tools.json b/data/mods/Aftershock/items/afs_tools.json index e256f1b6bd594..188b848e456d0 100644 --- a/data/mods/Aftershock/items/afs_tools.json +++ b/data/mods/Aftershock/items/afs_tools.json @@ -19,7 +19,7 @@ "active": true, "type": "transform" }, - { "revert_to": "afs_atomic_smartphone", "type": "CAMERA" } + { "type": "CAMERA" } ], "flags": [ "WATCH", "ALARMCLOCK" ] }, diff --git a/data/mods/Aftershock/maps/afs_furniture.json b/data/mods/Aftershock/maps/afs_furniture.json index 32f0d048acf60..c26822de67bc0 100644 --- a/data/mods/Aftershock/maps/afs_furniture.json +++ b/data/mods/Aftershock/maps/afs_furniture.json @@ -8,7 +8,6 @@ "color": "white", "move_cost_mod": -1, "required_str": 10, - "insulation": 3, "flags": [ "CONTAINER", "PLACE_ITEM", "BLOCKSDOOR", "MINEABLE", "EASY_DECONSTRUCT" ], "deconstruct": { "items": [ { "item": "afs_fridge", "count": 1 } ] }, "max_volume": "1000 L", @@ -42,7 +41,6 @@ "color": "light_blue", "move_cost_mod": -1, "required_str": 10, - "insulation": 3, "flags": [ "CONTAINER", "PLACE_ITEM", "BLOCKSDOOR", "MINEABLE", "EASY_DECONSTRUCT" ], "deconstruct": { "items": [ { "item": "afs_freezer", "count": 1 } ] }, "max_volume": "1000 L", diff --git a/data/mods/FictonalWeapons/fic_mods.json b/data/mods/FictonalWeapons/fic_mods.json index 0010bc74ef993..c699d66ae3be0 100644 --- a/data/mods/FictonalWeapons/fic_mods.json +++ b/data/mods/FictonalWeapons/fic_mods.json @@ -60,7 +60,6 @@ "bashing": 5, "handling_modifier": -5, "price": 20000, - "min_skills": [ [ "gun", 5 ] ], - "ups_charges": 5 + "min_skills": [ [ "gun", 5 ] ] } ] diff --git a/data/mods/FictonalWeapons/fic_weapons.json b/data/mods/FictonalWeapons/fic_weapons.json index 0096787d6edc6..b118ba98559c0 100644 --- a/data/mods/FictonalWeapons/fic_weapons.json +++ b/data/mods/FictonalWeapons/fic_weapons.json @@ -227,7 +227,6 @@ "material": [ "steel", "plastic" ], "flags": [ "NEVER_JAMS", "NO_UNLOAD", "NON-FOULING" ], "ammo_effects": [ "LIGHTNING", "BEANBAG" ], - "mode_modifier": [ [ "DEFAULT", "auto", 5 ] ], "ups_charges": 6, "skill": "smg", "weight": "2100 g", diff --git a/data/mods/Modular_Turrets/items.json b/data/mods/Modular_Turrets/items.json index e2acab25e34ce..9dce49a7fd94b 100644 --- a/data/mods/Modular_Turrets/items.json +++ b/data/mods/Modular_Turrets/items.json @@ -194,7 +194,6 @@ "use_action": { "type": "place_monster", "monster_id": "mon_turret_disarmed", - "use_message": "Error. No weapon systems found.", "difficulty": 4, "moves": 100, "skill1": "electronics", @@ -213,7 +212,6 @@ "use_action": { "type": "place_monster", "monster_id": "mon_milturret_disarmed", - "use_message": "Error. No weapon systems found.", "difficulty": 5, "moves": 100, "skill1": "electronics", @@ -232,7 +230,6 @@ "use_action": { "type": "place_monster", "monster_id": "mon_advturret_disarmed", - "use_message": "Error. No weapon systems found.", "difficulty": 6, "moves": 100, "skill1": "electronics", diff --git a/data/mods/Salvaged_Robots/monsters.json b/data/mods/Salvaged_Robots/monsters.json index 2cefef9242f74..56fa77f1125ef 100644 --- a/data/mods/Salvaged_Robots/monsters.json +++ b/data/mods/Salvaged_Robots/monsters.json @@ -276,7 +276,6 @@ "gun_type": "robogun_laser", "fake_skills": [ [ "gun", 6 ], [ "rifle", 6 ] ], "fake_dex": 10, - "range": 20, "ranges": [ [ 0, 30, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -348,7 +347,6 @@ "gun_type": "robogun_nail", "fake_skills": [ [ "gun", 0 ], [ "pistol", 2 ] ], "fake_dex": 8, - "range": 3, "ranges": [ [ 0, 3, "BURST" ] ] } ] @@ -373,7 +371,6 @@ "gun_type": "watercannon", "fake_skills": [ [ "gun", 2 ], [ "launcher", 2 ] ], "fake_dex": 8, - "range": 5, "ranges": [ [ 0, 5, "BURST" ] ] } ], @@ -439,7 +436,6 @@ "fake_skills": [ [ "gun", 3 ], [ "archery", 3 ] ], "fake_dex": 8, "no_ammo_sound": "click!", - "range": 10, "ranges": [ [ 0, 10, "DEFAULT" ] ] } ], @@ -637,7 +633,6 @@ "fake_skills": [ [ "gun", 5 ], [ "rifle", 6 ] ], "fake_dex": 10, "no_ammo_sound": "click!", - "range": 10, "ranges": [ [ 0, 10, "DEFAULT" ] ] } ] @@ -703,7 +698,6 @@ "fake_skills": [ [ "gun", 2 ], [ "shotgun", 2 ] ], "fake_dex": 9, "no_ammo_sound": "click click!", - "range": 8, "ranges": [ [ 0, 8, "DEFAULT" ] ] } ] @@ -764,7 +758,6 @@ "fake_skills": [ [ "gun", 4 ], [ "launcher", 4 ] ], "fake_dex": 9, "no_ammo_sound": "click!", - "range": 15, "ranges": [ [ 0, 15, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -796,7 +789,6 @@ "fake_skills": [ [ "gun", 5 ], [ "rifle", 5 ] ], "fake_dex": 10, "no_ammo_sound": "click!", - "range": 18, "ranges": [ [ 0, 4, "BURST" ], [ 5, 8, "AUTO" ], [ 9, 16, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -829,7 +821,6 @@ "fake_skills": [ [ "gun", 5 ], [ "rifle", 5 ] ], "fake_dex": 10, "no_ammo_sound": "click!", - "range": 20, "ranges": [ [ 0, 5, "DEFAULT" ], [ 6, 10, "BURST" ], [ 11, 20, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -861,7 +852,6 @@ "fake_skills": [ [ "gun", 5 ], [ "rifle", 5 ] ], "fake_dex": 10, "no_ammo_sound": "click!", - "range": 20, "ranges": [ [ 0, 5, "DEFAULT" ], [ 6, 10, "BURST" ], [ 11, 20, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -893,7 +883,6 @@ "fake_skills": [ [ "gun", 5 ], [ "rifle", 6 ] ], "fake_dex": 10, "no_ammo_sound": "whirrrr!", - "range": 24, "ranges": [ [ 0, 5, "BURST" ], [ 6, 10, "AUTO" ], [ 11, 24, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -925,7 +914,6 @@ "fake_skills": [ [ "gun", 5 ], [ "rifle", 5 ] ], "fake_dex": 10, "no_ammo_sound": "click!", - "range": 18, "ranges": [ [ 0, 4, "BURST" ], [ 4, 8, "AUTO" ], [ 9, 16, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -958,7 +946,6 @@ "fake_skills": [ [ "gun", 4 ], [ "launcher", 5 ] ], "fake_dex": 10, "no_ammo_sound": "click!", - "range": 30, "ranges": [ [ 6, 30, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -989,7 +976,6 @@ "fake_skills": [ [ "gun", 4 ], [ "launcher", 5 ] ], "fake_dex": 10, "no_ammo_sound": "hiss!", - "range": 10, "ranges": [ [ 0, 10, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -1038,7 +1024,6 @@ "gun_type": "robogun_laser", "fake_skills": [ [ "gun", 5 ], [ "rifle", 5 ] ], "fake_dex": 10, - "range": 18, "ranges": [ [ 0, 8, "AUTO" ], [ 8, 16, "BURST" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -1067,7 +1052,6 @@ "gun_type": "robogun_plasma", "fake_skills": [ [ "gun", 5 ], [ "rifle", 5 ] ], "fake_dex": 10, - "range": 18, "ranges": [ [ 4, 16, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -1096,7 +1080,6 @@ "fake_skills": [ [ "gun", 5 ], [ "rifle", 5 ] ], "fake_dex": 10, "no_ammo_sound": "buzz!", - "range": 18, "ranges": [ [ 0, 18, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -1125,7 +1108,6 @@ "gun_type": "robogun_lightning", "fake_skills": [ [ "gun", 5 ], [ "rifle", 5 ] ], "fake_dex": 10, - "range": 12, "ranges": [ [ 0, 12, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -1153,7 +1135,6 @@ "gun_type": "robogun_emp", "fake_skills": [ [ "gun", 5 ], [ "rifle", 5 ] ], "fake_dex": 10, - "range": 18, "ranges": [ [ 0, 4, "BURST" ], [ 4, 8, "AUTO" ], [ 9, 16, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -1192,7 +1173,6 @@ "fake_skills": [ [ "gun", 2 ], [ "shotgun", 2 ] ], "fake_dex": 9, "no_ammo_sound": "click!", - "range": 3, "ranges": [ [ 0, 3, "DEFAULT" ] ] } ] @@ -1255,7 +1235,6 @@ "fake_skills": [ [ "gun", 4 ], [ "launcher", 5 ] ], "fake_dex": 10, "no_ammo_sound": "hiss!", - "range": 10, "ranges": [ [ 0, 10, "DEFAULT" ] ] } ], @@ -1286,7 +1265,6 @@ "fake_skills": [ [ "gun", 3 ], [ "smg", 3 ] ], "fake_dex": 9, "no_ammo_sound": "click click!", - "range": "10", "ranges": [ [ 0, 10, "AUTO" ] ] } ] @@ -1325,7 +1303,6 @@ "fake_skills": [ [ "gun", 5 ], [ "rifle", 5 ] ], "fake_dex": 10, "no_ammo_sound": "click!", - "range": 18, "ranges": [ [ 0, 16, "BURST" ] ], "require_targeting_player": true } @@ -1357,7 +1334,6 @@ "fake_dex": 11, "fake_per": 10, "no_ammo_sound": "click!", - "range": 30, "ranges": [ [ 0, 30, "DEFAULT" ] ], "require_targeting_player": true, "require_targeting_npc": true, @@ -1391,7 +1367,6 @@ "gun_type": "robogun_laser", "fake_skills": [ [ "gun", 5 ], [ "rifle", 5 ] ], "fake_dex": 8, - "range": 5, "ranges": [ [ 0, 5, "AUTO" ] ] } ] @@ -1484,7 +1459,6 @@ "vision_day": 20, "vision_night": 10, "revert_to_itype": "bot_chickenbot_horror", - "remove:special_attack": [ "CHICKENBOT" ], "special_attacks": [ [ "SMASH", 30 ], [ "SHRIEK", 10 ], [ "SHRIEK_STUN", 10 ] ] }, { @@ -1503,7 +1477,6 @@ "vision_day": 20, "vision_night": 10, "revert_to_itype": "bot_chickenbot_terror", - "remove:special_attack": [ "CHICKENBOT" ], "special_attacks": [ [ "SMASH", 30 ], [ "SHRIEK", 10 ], [ "SHRIEK_STUN", 10 ] ] }, { @@ -1522,7 +1495,6 @@ "vision_day": 20, "vision_night": 10, "revert_to_itype": "bot_chickenbot_nightmare", - "remove:special_attack": [ "CHICKENBOT" ], "special_attacks": [ [ "SMASH", 30 ], [ "SHRIEK", 10 ], [ "SHRIEK_STUN", 10 ], [ "RANGED_PULL", 10 ], [ "GRAB_DRAG", 10 ] ], "extend": { "flags": [ "GRABS" ] } }, @@ -1583,7 +1555,6 @@ "attack_effs": [ { "id": "downed", "chance": 20, "duration": 10 }, { "id": "stunned", "chance": 20, "duration": 10 } ], "vision_day": 20, "revert_to_itype": "bot_tankbot_king", - "remove:special_attack": [ "MULTI_ROBOT" ], "special_attacks": [ [ "SMASH", 15 ] ] }, { @@ -1606,7 +1577,6 @@ "vision_day": 20, "revert_to_itype": "bot_tankbot_sultan", "emit_fields": [ "emit_nuclear_trail" ], - "remove:special_attack": [ "MULTI_ROBOT" ], "special_attacks": [ [ "SMASH", 30 ], [ "GRAB", 20 ] ], "extend": { "flags": [ "STUMBLES", "GRABS" ] } } From 8a944ce377fdb4736432bcc44ea9175d4b289208 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 21 Dec 2019 18:39:52 +0100 Subject: [PATCH 04/23] Actually read JSON object member instead of only checking their existence. This ensures the member type is checked and reported if it does not fit the expected type. It also means `"foo": false` is properly recognized as such (instead of being interpreted the same as `"foo": true`). --- src/condition.cpp | 2 +- src/flag.cpp | 2 +- src/mission_util.cpp | 2 +- src/npctalk.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/condition.cpp b/src/condition.cpp index 8a196f95fb223..6a1de477b1789 100644 --- a/src/condition.cpp +++ b/src/condition.cpp @@ -1030,7 +1030,7 @@ conditional_t::conditional_t( const JsonObject &jo ) set_npc_role_nearby( jo ); } else if( jo.has_int( "npc_allies" ) ) { set_npc_allies( jo ); - } else if( jo.has_int( "npc_service" ) ) { + } else if( jo.get_bool( "npc_service", false ) ) { set_npc_available(); } else if( jo.has_int( "u_has_cash" ) ) { set_u_has_cash( jo ); diff --git a/src/flag.cpp b/src/flag.cpp index a39b617ad5e21..611ccb45aac55 100644 --- a/src/flag.cpp +++ b/src/flag.cpp @@ -28,7 +28,7 @@ void json_flag::load( const JsonObject &jo ) // FIXME: most flags have a "context" field that isn't used for anything // Test for it here to avoid errors about unvisited members - jo.has_member( "context" ); + jo.get_member( "context" ); } void json_flag::check_consistency() diff --git a/src/mission_util.cpp b/src/mission_util.cpp index 105ec3306d78d..e06166ec02b3a 100644 --- a/src/mission_util.cpp +++ b/src/mission_util.cpp @@ -365,7 +365,7 @@ mission_target_params mission_util::parse_mission_om_target( const JsonObject &j if( jo.has_string( "om_terrain_match_type" ) ) { p.overmap_terrain_match_type = jo.get_enum_value( "om_terrain_match_type" ); } - if( jo.has_bool( "origin_npc" ) ) { + if( jo.get_bool( "origin_npc", false ) ) { p.origin_u = false; } if( jo.has_string( "om_terrain_replace" ) ) { diff --git a/src/npctalk.cpp b/src/npctalk.cpp index 454c47dd500a3..ddfdd371d5264 100644 --- a/src/npctalk.cpp +++ b/src/npctalk.cpp @@ -2886,11 +2886,11 @@ dynamic_line_t::dynamic_line_t( const JsonObject &jo ) } return all_lines; }; - } else if( jo.has_member( "give_hint" ) ) { + } else if( jo.get_bool( "give_hint", false ) ) { function = [&]( const dialogue & ) { return get_hint(); }; - } else if( jo.has_member( "use_reason" ) ) { + } else if( jo.get_bool( "use_reason", false ) ) { function = [&]( const dialogue & d ) { std::string tmp = d.reason; d.reason.clear(); From 5340c7439f5dffd86388a443a5ed76a88cbef607 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 21 Dec 2019 18:41:56 +0100 Subject: [PATCH 05/23] Only register JSON object members as visited when their value has been read. --- src/json.cpp | 26 ++++++++++++-------------- src/json.h | 4 ++++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/json.cpp b/src/json.cpp index 02a6592fa97ca..5c6a1b95d3eeb 100644 --- a/src/json.cpp +++ b/src/json.cpp @@ -156,13 +156,11 @@ int JsonObject::verify_position( const std::string &name, // so it will never indicate a valid member position return 0; } - visited_members.insert( name ); return iter->second; } bool JsonObject::has_member( const std::string &name ) const { - visited_members.insert( name ); return positions.count( name ) > 0; } @@ -233,6 +231,7 @@ void JsonObject::throw_error( std::string err ) const JsonIn *JsonObject::get_raw( const std::string &name ) const { int pos = verify_position( name ); + visited_members.insert( name ); jsin->seek( pos ); return jsin; } @@ -241,9 +240,7 @@ JsonIn *JsonObject::get_raw( const std::string &name ) const bool JsonObject::get_bool( const std::string &name ) const { - int pos = verify_position( name ); - jsin->seek( pos ); - return jsin->get_bool(); + return get_member( name ).get_bool(); } bool JsonObject::get_bool( const std::string &name, const bool fallback ) const @@ -252,15 +249,14 @@ bool JsonObject::get_bool( const std::string &name, const bool fallback ) const if( !pos ) { return fallback; } + visited_members.insert( name ); jsin->seek( pos ); return jsin->get_bool(); } int JsonObject::get_int( const std::string &name ) const { - int pos = verify_position( name ); - jsin->seek( pos ); - return jsin->get_int(); + return get_member( name ).get_int(); } int JsonObject::get_int( const std::string &name, const int fallback ) const @@ -269,15 +265,14 @@ int JsonObject::get_int( const std::string &name, const int fallback ) const if( !pos ) { return fallback; } + visited_members.insert( name ); jsin->seek( pos ); return jsin->get_int(); } double JsonObject::get_float( const std::string &name ) const { - int pos = verify_position( name ); - jsin->seek( pos ); - return jsin->get_float(); + return get_member( name ).get_float(); } double JsonObject::get_float( const std::string &name, const double fallback ) const @@ -286,15 +281,14 @@ double JsonObject::get_float( const std::string &name, const double fallback ) c if( !pos ) { return fallback; } + visited_members.insert( name ); jsin->seek( pos ); return jsin->get_float(); } std::string JsonObject::get_string( const std::string &name ) const { - int pos = verify_position( name ); - jsin->seek( pos ); - return jsin->get_string(); + return get_member( name ).get_string(); } std::string JsonObject::get_string( const std::string &name, const std::string &fallback ) const @@ -303,6 +297,7 @@ std::string JsonObject::get_string( const std::string &name, const std::string & if( !pos ) { return fallback; } + visited_members.insert( name ); jsin->seek( pos ); return jsin->get_string(); } @@ -315,6 +310,7 @@ JsonArray JsonObject::get_array( const std::string &name ) const if( !pos ) { return JsonArray(); } + visited_members.insert( name ); jsin->seek( pos ); return JsonArray( *jsin ); } @@ -343,6 +339,7 @@ JsonObject JsonObject::get_object( const std::string &name ) const if( !pos ) { return JsonObject(); } + visited_members.insert( name ); jsin->seek( pos ); return jsin->get_object(); } @@ -355,6 +352,7 @@ bool JsonObject::has_null( const std::string &name ) const if( !pos ) { return false; } + visited_members.insert( name ); jsin->seek( pos ); return jsin->test_null(); } diff --git a/src/json.h b/src/json.h index 259077859d27c..9414f22a5d625 100644 --- a/src/json.h +++ b/src/json.h @@ -856,11 +856,13 @@ class JsonObject if( !has_member( name ) ) { return fallback; } + visited_members.insert( name ); jsin->seek( verify_position( name ) ); return jsin->get_enum_value(); } template::value>::type> E get_enum_value( const std::string &name ) const { + visited_members.insert( name ); jsin->seek( verify_position( name ) ); return jsin->get_enum_value(); } @@ -904,6 +906,7 @@ class JsonObject if( !pos ) { return false; } + visited_members.insert( name ); jsin->seek( pos ); return jsin->read( t, throw_on_error ); } @@ -1290,6 +1293,7 @@ std::set JsonObject::get_tags( const std::string &name ) const if( !pos ) { return res; } + visited_members.insert( name ); jsin->seek( pos ); // allow single string as tag From f4ac936fe63532b55d88191fc11def4d68f3e513 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 21 Dec 2019 19:45:52 +0100 Subject: [PATCH 06/23] Change code to load "looks_like" to only read strings and fail if the member isn't a string --- src/item_factory.cpp | 4 +--- src/mapdata.cpp | 4 +--- src/monstergenerator.cpp | 4 +--- src/veh_type.cpp | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/item_factory.cpp b/src/item_factory.cpp index 513e76b70619b..7ef6551246c27 100644 --- a/src/item_factory.cpp +++ b/src/item_factory.cpp @@ -2165,9 +2165,7 @@ void Item_factory::load_basic_info( const JsonObject &jo, itype &def, const std: def.drop_action = usage_from_object( tmp ).second; } - if( jo.has_string( "looks_like" ) ) { - def.looks_like = jo.get_string( "looks_like" ); - } + jo.read( "looks_like", def.looks_like ); if( jo.has_member( "conditional_names" ) ) { def.conditional_names.clear(); diff --git a/src/mapdata.cpp b/src/mapdata.cpp index 51908adb959e0..6ac4e396e74cb 100644 --- a/src/mapdata.cpp +++ b/src/mapdata.cpp @@ -376,9 +376,7 @@ void map_data_common_t::load_symbol( const JsonObject &jo ) if( jo.has_member( "copy-from" ) && looks_like.empty() ) { looks_like = jo.get_string( "copy-from" ); } - if( jo.has_member( "looks_like" ) ) { - looks_like = jo.get_string( "looks_like" ); - } + jo.read( "looks_like", looks_like ); load_season_array( jo, "symbol", symbol_, [&jo]( const std::string & str ) { if( str == "LINE_XOXO" ) { diff --git a/src/monstergenerator.cpp b/src/monstergenerator.cpp index a03e930232131..fd50a23330c26 100644 --- a/src/monstergenerator.cpp +++ b/src/monstergenerator.cpp @@ -629,9 +629,7 @@ void mtype::load( const JsonObject &jo, const std::string &src ) if( was_loaded && jo.has_member( "copy-from" ) && looks_like.empty() ) { looks_like = jo.get_string( "copy-from" ); } - if( jo.has_member( "looks_like" ) ) { - looks_like = jo.get_string( "looks_like" ); - } + jo.read( "looks_like", looks_like ); assign( jo, "bodytype", bodytype ); assign( jo, "color", color ); diff --git a/src/veh_type.cpp b/src/veh_type.cpp index 6d62cfdcb1be9..1c47cbb693e45 100644 --- a/src/veh_type.cpp +++ b/src/veh_type.cpp @@ -376,9 +376,7 @@ void vpart_info::load( const JsonObject &jo, const std::string &src ) if( jo.has_member( "broken_symbol" ) ) { def.sym_broken = jo.get_string( "broken_symbol" )[ 0 ]; } - if( jo.has_member( "looks_like" ) ) { - def.looks_like = jo.get_string( "looks_like" ); - } + jo.read( "looks_like", def.looks_like ); if( jo.has_member( "color" ) ) { def.color = color_from_string( jo.get_string( "color" ) ); From 283bd1b6797b5b9e32b5245638a4a6fadf4dcaeb Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 21 Dec 2019 19:49:16 +0100 Subject: [PATCH 07/23] Change checks for JSON member existence to ignore the type. Now it only checks whether a member of the given name exists. The type is ignored hereby. The type is checked later, when the value of the member is read. If the type is not what we expect, an error will be generated. --- src/item_factory.cpp | 8 ++++---- src/mapgen.cpp | 2 +- src/mission_util.cpp | 42 +++++++++++++++++++++--------------------- src/npctalk.cpp | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/item_factory.cpp b/src/item_factory.cpp index 7ef6551246c27..b1726c48fa1c7 100644 --- a/src/item_factory.cpp +++ b/src/item_factory.cpp @@ -1713,19 +1713,19 @@ void Item_factory::load( islot_comestible &slot, const JsonObject &jo, const std bool got_calories = false; - if( jo.has_int( "calories" ) ) { + if( jo.has_member( "calories" ) ) { slot.default_nutrition.kcal = jo.get_int( "calories" ); got_calories = true; - } else if( relative.has_int( "calories" ) ) { + } else if( relative.has_member( "calories" ) ) { slot.default_nutrition.kcal += relative.get_int( "calories" ); got_calories = true; - } else if( proportional.has_float( "calories" ) ) { + } else if( proportional.has_member( "calories" ) ) { slot.default_nutrition.kcal *= proportional.get_float( "calories" ); got_calories = true; - } else if( jo.has_int( "nutrition" ) ) { + } else if( jo.has_member( "nutrition" ) ) { slot.default_nutrition.kcal = jo.get_int( "nutrition" ) * islot_comestible::kcal_per_nutr; } diff --git a/src/mapgen.cpp b/src/mapgen.cpp index dcb2210f5c8c9..c1386974467df 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -2085,7 +2085,7 @@ mapgen_palette mapgen_palette::load_internal( const JsonObject &jo, const std::s // mandatory: every character in rows must have matching entry, unless fill_ter is set // "terrain": { "a": "t_grass", "b": "t_lava" } - if( jo.has_object( "terrain" ) ) { + if( jo.has_member( "terrain" ) ) { JsonObject pjo = jo.get_object( "terrain" ); for( const auto &key : pjo.get_member_names() ) { if( key.size() != 1 ) { diff --git a/src/mission_util.cpp b/src/mission_util.cpp index e06166ec02b3a..4f5c160bf4553 100644 --- a/src/mission_util.cpp +++ b/src/mission_util.cpp @@ -359,56 +359,56 @@ tripoint mission_util::target_om_ter_random( const std::string &omter, int revea mission_target_params mission_util::parse_mission_om_target( const JsonObject &jo ) { mission_target_params p; - if( jo.has_string( "om_terrain" ) ) { + if( jo.has_member( "om_terrain" ) ) { p.overmap_terrain = jo.get_string( "om_terrain" ); } - if( jo.has_string( "om_terrain_match_type" ) ) { + if( jo.has_member( "om_terrain_match_type" ) ) { p.overmap_terrain_match_type = jo.get_enum_value( "om_terrain_match_type" ); } if( jo.get_bool( "origin_npc", false ) ) { p.origin_u = false; } - if( jo.has_string( "om_terrain_replace" ) ) { + if( jo.has_member( "om_terrain_replace" ) ) { p.replaceable_overmap_terrain = jo.get_string( "om_terrain_replace" ); } - if( jo.has_string( "om_special" ) ) { + if( jo.has_member( "om_special" ) ) { p.overmap_special = overmap_special_id( jo.get_string( "om_special" ) ); } - if( jo.has_int( "reveal_radius" ) ) { + if( jo.has_member( "reveal_radius" ) ) { p.reveal_radius = std::max( 1, jo.get_int( "reveal_radius" ) ); } - if( jo.has_bool( "must_see" ) ) { + if( jo.has_member( "must_see" ) ) { p.must_see = jo.get_bool( "must_see" ); } - if( jo.has_bool( "cant_see" ) ) { + if( jo.has_member( "cant_see" ) ) { p.cant_see = jo.get_bool( "cant_see" ); } - if( jo.has_bool( "exclude_seen" ) ) { + if( jo.has_member( "exclude_seen" ) ) { p.random = jo.get_bool( "exclude" ); } - if( jo.has_bool( "random" ) ) { + if( jo.has_member( "random" ) ) { p.random = jo.get_bool( "random" ); } - if( jo.has_int( "search_range" ) ) { + if( jo.has_member( "search_range" ) ) { p.search_range = std::max( 1, jo.get_int( "search_range" ) ); } - if( jo.has_int( "min_distance" ) ) { + if( jo.has_member( "min_distance" ) ) { p.min_distance = std::max( 1, jo.get_int( "min_distance" ) ); } - if( jo.has_int( "offset_x" ) || jo.has_int( "offset_y" ) || jo.has_int( "offset_z" ) ) { + if( jo.has_member( "offset_x" ) || jo.has_member( "offset_y" ) || jo.has_member( "offset_z" ) ) { tripoint offset; - if( jo.has_int( "offset_x" ) ) { + if( jo.has_member( "offset_x" ) ) { offset.x = jo.get_int( "offset_x" ); } - if( jo.has_int( "offset_y" ) ) { + if( jo.has_member( "offset_y" ) ) { offset.y = jo.get_int( "offset_y" ); } - if( jo.has_int( "offset_z" ) ) { + if( jo.has_member( "offset_z" ) ) { offset.z = jo.get_int( "offset_z" ); } p.offset = offset; } - if( jo.has_int( "z" ) ) { + if( jo.has_member( "z" ) ) { p.z = jo.get_int( "z" ); } return p; @@ -439,7 +439,7 @@ void mission_util::set_reveal_any( const JsonArray &ja, void mission_util::set_assign_om_target( const JsonObject &jo, std::vector> &funcs ) { - if( !jo.has_string( "om_terrain" ) ) { + if( !jo.has_member( "om_terrain" ) ) { jo.throw_error( "'om_terrain' is required for assign_mission_target" ); } mission_target_params p = parse_mission_om_target( jo ); @@ -461,7 +461,7 @@ bool mission_util::set_update_mapgen( const JsonObject &jo, return false; } - if( jo.has_string( "om_special" ) && jo.has_string( "om_terrain" ) ) { + if( jo.has_member( "om_special" ) && jo.has_member( "om_terrain" ) ) { const std::string om_terrain = jo.get_string( "om_terrain" ); const auto mission_func = [update_map, om_terrain]( mission * miss ) { tripoint update_pos3 = mission_util::reveal_om_ter( om_terrain, 1, false ); @@ -484,9 +484,9 @@ bool mission_util::load_funcs( const JsonObject &jo, if( jo.has_string( "reveal_om_ter" ) ) { const std::string target_terrain = jo.get_string( "reveal_om_ter" ); set_reveal( target_terrain, funcs ); - } else if( jo.has_array( "reveal_om_ter" ) ) { + } else if( jo.has_member( "reveal_om_ter" ) ) { set_reveal_any( jo.get_array( "reveal_om_ter" ), funcs ); - } else if( jo.has_object( "assign_mission_target" ) ) { + } else if( jo.has_member( "assign_mission_target" ) ) { JsonObject mission_target = jo.get_object( "assign_mission_target" ); set_assign_om_target( mission_target, funcs ); } @@ -496,7 +496,7 @@ bool mission_util::load_funcs( const JsonObject &jo, if( !set_update_mapgen( update_mapgen, funcs ) ) { return false; } - } else if( jo.has_array( "update_mapgen" ) ) { + } else { for( JsonObject update_mapgen : jo.get_array( "update_mapgen" ) ) { if( !set_update_mapgen( update_mapgen, funcs ) ) { return false; diff --git a/src/npctalk.cpp b/src/npctalk.cpp index ddfdd371d5264..a1dc0575de24c 100644 --- a/src/npctalk.cpp +++ b/src/npctalk.cpp @@ -1778,7 +1778,7 @@ talk_trial::talk_trial( const JsonObject &jo ) read_condition( jo, "condition", condition, false ); - if( jo.has_array( "mod" ) ) { + if( jo.has_member( "mod" ) ) { for( JsonArray jmod : jo.get_array( "mod" ) ) { trial_mod this_modifier; this_modifier.first = jmod.next_string(); From 8690cb41aae5e48fbfdfcbaed0859076872f34c2 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Tue, 24 Dec 2019 11:41:48 +0100 Subject: [PATCH 08/23] Remove generating explicit error message: The message will be shown anyway when the member is actually accessed. --- src/mission_util.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mission_util.cpp b/src/mission_util.cpp index 4f5c160bf4553..4eb571212b6de 100644 --- a/src/mission_util.cpp +++ b/src/mission_util.cpp @@ -439,9 +439,6 @@ void mission_util::set_reveal_any( const JsonArray &ja, void mission_util::set_assign_om_target( const JsonObject &jo, std::vector> &funcs ) { - if( !jo.has_member( "om_terrain" ) ) { - jo.throw_error( "'om_terrain' is required for assign_mission_target" ); - } mission_target_params p = parse_mission_om_target( jo ); const auto mission_func = [p]( mission * miss ) { mission_target_params mtp = p; From 328dd45deea2a77522b24d36a1be2fb48086d8c2 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Tue, 24 Dec 2019 11:42:07 +0100 Subject: [PATCH 09/23] Explicitly check the value of a boolean JSON object member. --- src/npctalk.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/npctalk.cpp b/src/npctalk.cpp index a1dc0575de24c..b0fa2e0c49064 100644 --- a/src/npctalk.cpp +++ b/src/npctalk.cpp @@ -2918,6 +2918,10 @@ dynamic_line_t::dynamic_line_t( const JsonObject &jo ) const dynamic_line_t no = from_member( jo, "no" ); for( const std::string &sub_member : dialogue_data::simple_string_conds ) { if( jo.has_bool( sub_member ) ) { + // This also marks the member as visited. + if( !jo.get_bool( sub_member ) ) { + jo.throw_error( "value must be true", sub_member ); + } dcondition = conditional_t( sub_member ); function = [dcondition, yes, no]( const dialogue & d ) { return ( dcondition( d ) ? yes : no )( d ); From 3480f2bc92a113c22327366bf8427621f67e400a Mon Sep 17 00:00:00 2001 From: BevapDin Date: Tue, 24 Dec 2019 23:44:59 +0100 Subject: [PATCH 10/23] Remove check for unused member. The JSON object member "om_special" is never actually loaded, so it should not be required. --- src/mission_util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mission_util.cpp b/src/mission_util.cpp index 4eb571212b6de..18f1c889605ed 100644 --- a/src/mission_util.cpp +++ b/src/mission_util.cpp @@ -458,7 +458,7 @@ bool mission_util::set_update_mapgen( const JsonObject &jo, return false; } - if( jo.has_member( "om_special" ) && jo.has_member( "om_terrain" ) ) { + if( jo.has_member( "om_terrain" ) ) { const std::string om_terrain = jo.get_string( "om_terrain" ); const auto mission_func = [update_map, om_terrain]( mission * miss ) { tripoint update_pos3 = mission_util::reveal_om_ter( om_terrain, 1, false ); From 8c2405fdb990ee724048a068a1ca61f43fd4d7ec Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 21 Dec 2019 19:40:12 +0100 Subject: [PATCH 11/23] Fix missing "context" member in "json_flag" objects --- data/json/flags.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/data/json/flags.json b/data/json/flags.json index d61ab7c6c3ea1..b95695769f0ec 100644 --- a/data/json/flags.json +++ b/data/json/flags.json @@ -7,6 +7,7 @@ }, { "id": "EFFECT_INVISIBLE", + "context": [ ], "type": "json_flag" }, { @@ -70,6 +71,7 @@ }, { "id": "EFFECT_NIGHT_VISION", + "context": [ ], "type": "json_flag" }, { @@ -144,6 +146,7 @@ { "id": "ETHEREAL_ITEM", "type": "json_flag", + "context": [ ], "info": "This item disappears as soon as its timer runs out whether it is food or not." }, { @@ -680,38 +683,47 @@ }, { "id": "EFFECT_FEATHER_FALL", + "context": [ ], "type": "json_flag" }, { "id": "EFFECT_BIO_IMMUNE", + "context": [ ], "type": "json_flag" }, { "id": "EFFECT_BASH_IMMUNE", + "context": [ ], "type": "json_flag" }, { "id": "EFFECT_CUT_IMMUNE", + "context": [ ], "type": "json_flag" }, { "id": "EFFECT_ACID_IMMUNE", + "context": [ ], "type": "json_flag" }, { "id": "EFFECT_STAB_IMMUNE", + "context": [ ], "type": "json_flag" }, { "id": "EFFECT_HEAT_IMMUNE", + "context": [ ], "type": "json_flag" }, { "id": "EFFECT_COLD_IMMUNE", + "context": [ ], "type": "json_flag" }, { "id": "ELECTRIC_IMMUNE", + "context": [ ], "type": "json_flag" }, { From e59baa00cec89b9a9cbbbb6284ebfc40b87ecdae Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 21 Dec 2019 19:40:39 +0100 Subject: [PATCH 12/23] Fix JSON members having the wrong type. --- data/json/items/comestibles/carnivore.json | 2 +- data/json/items/tool/deployable.json | 2 +- data/json/mapgen/steel_mill/steel_mill_z2.json | 2 +- data/json/npcs/TALK_TEST.json | 2 +- data/json/npcs/TALK_TRUE_FOODPERSON.json | 2 +- .../surface_visitors/NPC_old_guard_representative.json | 2 +- data/json/npcs/tacoma_ranch/NPC_ranch_nurse.json | 4 ++-- data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter1.json | 4 ++-- data/mods/Aftershock/items/afs__items.json | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/data/json/items/comestibles/carnivore.json b/data/json/items/comestibles/carnivore.json index ef5065ccb2cf5..56a002e66981e 100644 --- a/data/json/items/comestibles/carnivore.json +++ b/data/json/items/comestibles/carnivore.json @@ -500,7 +500,7 @@ "color": "brown", "healthy": -8, "quench": -5, - "calories": "54", + "calories": 54, "vitamins": [ [ "vitA", 6 ], [ "vitC", 2 ], [ "calcium", 0 ], [ "iron", 8 ], [ "vitB", 155 ] ] }, { diff --git a/data/json/items/tool/deployable.json b/data/json/items/tool/deployable.json index 545a15cfd1fae..bc74b04e9482b 100644 --- a/data/json/items/tool/deployable.json +++ b/data/json/items/tool/deployable.json @@ -173,7 +173,7 @@ "to_hit": -4, "bashing": 7, "material": [ "wood" ], - "looks_like": [ "f_wood_keg" ], + "looks_like": "f_wood_keg", "symbol": "u", "color": "light_gray", "use_action": { "type": "deploy_furn", "furn_type": "f_butter_churn" }, diff --git a/data/json/mapgen/steel_mill/steel_mill_z2.json b/data/json/mapgen/steel_mill/steel_mill_z2.json index b18b63b7901e9..f4b994053c9af 100644 --- a/data/json/mapgen/steel_mill/steel_mill_z2.json +++ b/data/json/mapgen/steel_mill/steel_mill_z2.json @@ -133,7 +133,7 @@ "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::", "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" ], - "terrain": [ { "M": "t_grate" }, { "8": "t_grate" } ], + "terrain": { "M": "t_grate", "8": "t_grate" }, "furniture": { }, "palettes": [ "steel_mill_palette" ], "place_monsters": [ diff --git a/data/json/npcs/TALK_TEST.json b/data/json/npcs/TALK_TEST.json index 3689139115853..93cdab41ac3b3 100644 --- a/data/json/npcs/TALK_TEST.json +++ b/data/json/npcs/TALK_TEST.json @@ -117,7 +117,7 @@ "responses": [ { "text": "This is a basic test response.", "topic": "TALK_DONE" }, { "text": "This is a cash test response.", "topic": "TALK_DONE", "condition": { "u_has_cash": 500 } }, - { "text": "This is an npc service test response.", "topic": "TALK_DONE", "condition": { "npc_service": 500 } }, + { "text": "This is an npc service test response.", "topic": "TALK_DONE", "condition": { "npc_service": true } }, { "text": "This is an npc available test response.", "topic": "TALK_DONE", "condition": "npc_available" } ] }, diff --git a/data/json/npcs/TALK_TRUE_FOODPERSON.json b/data/json/npcs/TALK_TRUE_FOODPERSON.json index 3af15cc0db5b0..c67aa640abab7 100644 --- a/data/json/npcs/TALK_TRUE_FOODPERSON.json +++ b/data/json/npcs/TALK_TRUE_FOODPERSON.json @@ -92,7 +92,7 @@ ] }, "text": "I am you but from an alternate reality.", - "trial": { "type": "LIE", "difficulty": 10, "mod": { "trust": 1, "value": 1 } }, + "trial": { "type": "LIE", "difficulty": 10, "mod": [ [ "TRUST", 1 ], [ "VALUE", 1 ] ] }, "success": { "topic": "TALK_FOODPERSON_MULTIVERSE", "opinion": { "trust": 2, "value": 2 } }, "failure": { "topic": "TALK_FOODPERSON_ONLYONE", "opinion": { "trust": -5, "value": -5 } } }, diff --git a/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json b/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json index f0830b5ebb9ec..0eaf670f9ca25 100644 --- a/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json +++ b/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json @@ -164,7 +164,7 @@ "difficulty": 5, "value": 100000, "start": { - "assign_mission_target": { "om_terrain": "field", "reveal_radius": 5, "random": true, "search_range": [ 10, 50 ] }, + "assign_mission_target": { "om_terrain": "field", "reveal_radius": 5, "random": true, "search_range": 30 }, "update_mapgen": { "place_monster": [ { "monster": "mon_graboid", "name": "Little Guy", "x": 12, "y": 12, "target": true }, diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_nurse.json b/data/json/npcs/tacoma_ranch/NPC_ranch_nurse.json index aae3288d31962..95486c4edb773 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_nurse.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_nurse.json @@ -77,13 +77,13 @@ "text": "[$200, 30m] I need you to patch me up.", "topic": "TALK_RANCH_NURSE_AID_DONE", "effect": [ "give_aid", { "u_spend_cash": 20000 } ], - "condition": { "npc_service": 20000 } + "condition": { "npc_service": true } }, { "text": "[$500, 1h] I need you to patch me up.", "topic": "TALK_RANCH_NURSE_AID_DONE", "effect": [ "give_all_aid", { "u_spend_cash": 50000 } ], - "condition": { "npc_service": 50000 } + "condition": { "npc_service": true } }, { "text": "I should be fine.", "topic": "TALK_RANCH_NURSE" } ] diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter1.json b/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter1.json index c13d1d1e28ad4..32b1003f822ea 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter1.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter1.json @@ -39,13 +39,13 @@ "text": "[$2000, 1d] 10 logs", "topic": "TALK_DONE", "effect": [ "buy_10_logs", { "u_spend_cash": 200000 } ], - "condition": { "npc_service": 200000 } + "condition": { "npc_service": true } }, { "text": "[$12000, 7d] 100 logs", "topic": "TALK_DONE", "effect": [ "buy_100_logs", { "u_spend_cash": 1200000 } ], - "condition": { "npc_service": 1200000 } + "condition": { "npc_service": true } }, { "text": "Maybe later.", "topic": "TALK_RANCH_WOODCUTTER", "condition": "npc_available" }, { "text": "I'll be back later.", "topic": "TALK_RANCH_WOODCUTTER" } diff --git a/data/mods/Aftershock/items/afs__items.json b/data/mods/Aftershock/items/afs__items.json index 57e4f2510b691..1f6ee95c5a98f 100644 --- a/data/mods/Aftershock/items/afs__items.json +++ b/data/mods/Aftershock/items/afs__items.json @@ -166,7 +166,7 @@ "volume": "11356 ml", "price": 5000, "price_postapoc": 45000, - "looks_like": [ "still" ], + "looks_like": "still", "symbol": "u", "color": "light_green", "use_action": { "type": "deploy_furn", "furn_type": "f_atomic_butter_churn" }, From 22a7ad28e77217b3d5d1320a92236b6174d6271e Mon Sep 17 00:00:00 2001 From: BevapDin Date: Tue, 24 Dec 2019 23:45:43 +0100 Subject: [PATCH 13/23] Temporarily comment out some JSON members that don't work as desired. "items" must be a string or an array of strings. --- data/json/vehicles/trucks.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/json/vehicles/trucks.json b/data/json/vehicles/trucks.json index cb0d0e76d604f..b316984ef4c5d 100644 --- a/data/json/vehicles/trucks.json +++ b/data/json/vehicles/trucks.json @@ -891,10 +891,10 @@ { "x": -2, "y": 1, "chance": 20, "items": [ "blanket" ] }, { "x": -3, "y": 0, "chance": 20, "items": [ "blanket" ] }, { "x": -3, "y": 1, "chance": 20, "items": [ "blanket" ] }, - { "x": -4, "y": 0, "chance": 10, "items": { "item": "dog_food", "container-item": "can_medium" } }, - { "x": -4, "y": 0, "chance": 10, "items": { "item": "dog_food", "container-item": "can_medium" } }, - { "x": -4, "y": 1, "chance": 10, "items": { "item": "cat_food", "container-item": "can_food" } }, - { "x": -4, "y": 1, "chance": 10, "items": { "item": "cat_food", "container-item": "can_food" } }, + { "x": -4, "y": 0, "chance": 10, "//": { "item": "dog_food", "container-item": "can_medium" } }, + { "x": -4, "y": 0, "chance": 10, "//": { "item": "dog_food", "container-item": "can_medium" } }, + { "x": -4, "y": 1, "chance": 10, "//": { "item": "cat_food", "container-item": "can_food" } }, + { "x": -4, "y": 1, "chance": 10, "//": { "item": "cat_food", "container-item": "can_food" } }, { "x": -4, "y": 0, "chance": 3, "items": [ "beartrap" ] } ] } From 5dbbb246ce72ee2e8345bd77d968cc791f777900 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Wed, 25 Dec 2019 00:09:09 +0100 Subject: [PATCH 14/23] Replace monster size entry with volume and mass entry. The "size" entry is no longer used and it is now ignored. --- data/mods/CRT_EXPANSION/monsters/monster.json | 2 -- data/mods/CrazyCataclysm/crazy_monsters.json | 3 +- data/mods/Modular_Turrets/monster.json | 3 +- .../Modular_Turrets/monster_override.json | 12 +++++--- data/mods/National_Guard_Camp/military.json | 3 +- data/mods/Salvaged_Robots/monsters.json | 30 ++++++++++++------- data/mods/blazemod/blaze_blob_monster.json | 9 ++++-- 7 files changed, 40 insertions(+), 22 deletions(-) diff --git a/data/mods/CRT_EXPANSION/monsters/monster.json b/data/mods/CRT_EXPANSION/monsters/monster.json index 4e1ef063455ae..61e07bd845c9a 100644 --- a/data/mods/CRT_EXPANSION/monsters/monster.json +++ b/data/mods/CRT_EXPANSION/monsters/monster.json @@ -13,7 +13,6 @@ "speed": 15, "material": [ "flesh" ], "symbol": "@", - "size": "medium", "color": "pink", "aggression": 100, "morale": 100, @@ -43,7 +42,6 @@ "speed": 15, "material": [ "flesh" ], "symbol": "D", - "size": "medium", "color": "light_red", "aggression": 100, "morale": 100, diff --git a/data/mods/CrazyCataclysm/crazy_monsters.json b/data/mods/CrazyCataclysm/crazy_monsters.json index a37833c89160d..f3d87a6d0a7d1 100644 --- a/data/mods/CrazyCataclysm/crazy_monsters.json +++ b/data/mods/CrazyCataclysm/crazy_monsters.json @@ -80,7 +80,8 @@ "description": "A smoking husk is all that remains of this once proud bear. Its black eyes gaze at you with malice… and hunger.", "default_faction": "bear", "species": [ "ZOMBIE" ], - "size": "LARGE", + "volume": "92500 ml", + "weight": "120 kg", "hp": 100, "speed": 90, "material": [ "flesh" ], diff --git a/data/mods/Modular_Turrets/monster.json b/data/mods/Modular_Turrets/monster.json index e927121adc646..4e27c2f7c4b28 100644 --- a/data/mods/Modular_Turrets/monster.json +++ b/data/mods/Modular_Turrets/monster.json @@ -5,7 +5,8 @@ "name": "automated turret", "default_faction": "defense_bot", "species": [ "ROBOT" ], - "size": "SMALL", + "volume": "30000 ml", + "weight": "40750 g", "hp": 30, "speed": 100, "material": [ "steel" ], diff --git a/data/mods/Modular_Turrets/monster_override.json b/data/mods/Modular_Turrets/monster_override.json index db549d4e9b2a2..229fe875507a2 100644 --- a/data/mods/Modular_Turrets/monster_override.json +++ b/data/mods/Modular_Turrets/monster_override.json @@ -30,7 +30,8 @@ "description": "One of the many models of utility robot formerly in use by government agencies, private corporations, and civilians alike.", "default_faction": "utility_bot", "species": [ "ROBOT" ], - "size": "MEDIUM", + "volume": "62500 ml", + "weight": "81500 g", "hp": 120, "speed": 70, "material": [ "steel" ], @@ -57,7 +58,8 @@ "default_faction": "cop_bot", "species": [ "ROBOT" ], "diff": 2, - "size": "SMALL", + "volume": "30000 ml", + "weight": "40750 g", "hp": 20, "speed": 120, "material": [ "steel" ], @@ -85,7 +87,8 @@ "default_faction": "defense_bot", "species": [ "ROBOT" ], "diff": 2, - "size": "SMALL", + "volume": "30000 ml", + "weight": "40750 g", "hp": 40, "speed": 130, "material": [ "steel" ], @@ -114,7 +117,8 @@ "default_faction": "cop_bot", "species": [ "ROBOT" ], "diff": 10, - "size": "MEDIUM", + "volume": "62500 ml", + "weight": "81500 g", "hp": 80, "speed": 100, "material": [ "steel" ], diff --git a/data/mods/National_Guard_Camp/military.json b/data/mods/National_Guard_Camp/military.json index 806a1375bb8b9..3161a47cd4278 100644 --- a/data/mods/National_Guard_Camp/military.json +++ b/data/mods/National_Guard_Camp/military.json @@ -7,7 +7,8 @@ "default_faction": "military", "species": [ "ROBOT" ], "diff": 20, - "size": "MEDIUM", + "volume": "62500 ml", + "weight": "81500 g", "hp": 50, "speed": 90, "material": [ "steel" ], diff --git a/data/mods/Salvaged_Robots/monsters.json b/data/mods/Salvaged_Robots/monsters.json index 56fa77f1125ef..4365fdadeb0c3 100644 --- a/data/mods/Salvaged_Robots/monsters.json +++ b/data/mods/Salvaged_Robots/monsters.json @@ -12,7 +12,8 @@ "description": "A mobile crafting station used by workers in mines, on oil rigs, and in other remote locales. In it's active state, the craftbuddy merely follows its user. In it's deactivated state, the craft buddy is useable as a toolbench and multipurpose workstation.", "default_faction": "utility_bot", "species": [ "ROBOT" ], - "size": "SMALL", + "volume": "30000 ml", + "weight": "40750 g", "hp": 150, "armor_fire": 6, "armor_acid": 6, @@ -42,7 +43,8 @@ "default_faction": "military", "species": [ "ROBOT" ], "diff": 10, - "size": "LARGE", + "volume": "92500 ml", + "weight": "120 kg", "hp": 120, "speed": 100, "material": [ "superalloy", "plastic" ], @@ -211,7 +213,8 @@ "default_faction": "cop_bot", "species": [ "ROBOT" ], "diff": 2, - "size": "SMALL", + "volume": "30000 ml", + "weight": "40750 g", "hp": 20, "speed": 120, "material": [ "steel" ], @@ -294,7 +297,8 @@ "description": "One of the many models of utility robot formerly in use by government agencies, private corporations, and civilians alike.", "default_faction": "utility_bot", "species": [ "ROBOT" ], - "size": "MEDIUM", + "volume": "62500 ml", + "weight": "81500 g", "hp": 120, "speed": 70, "material": [ "steel" ], @@ -450,7 +454,8 @@ "description": "A free roaming medical robot capable of administering powerful anesthetics and performing complex surgical operations, usually in that order. Faulty bio-diagnostic programs resulted in numerous lawsuits before the Cataclysm.", "default_faction": "utility_bot", "species": [ "ROBOT" ], - "size": "MEDIUM", + "volume": "62500 ml", + "weight": "81500 g", "hp": 70, "speed": 80, "material": [ "steel", "plastic" ], @@ -547,7 +552,8 @@ "default_faction": "defense_bot", "species": [ "ROBOT" ], "diff": 2, - "size": "SMALL", + "volume": "30000 ml", + "weight": "40750 g", "hp": 40, "speed": 130, "material": [ "steel" ], @@ -644,7 +650,8 @@ "description": "A robot body with the head of a human. All kinds of electronic wires and devices are implanted in its head. This cyborg moves erratically and has a confused and deranged look in its eyes.", "default_faction": "science", "species": [ "ROBOT" ], - "size": "MEDIUM", + "volume": "62500 ml", + "weight": "81500 g", "hp": 60, "speed": 90, "material": [ "steel" ], @@ -710,7 +717,8 @@ "description": "A military robot still operating due to its internal power core. This one is armed with an electric prod and an integrated 5.56mm firearm.", "default_faction": "military", "species": [ "ROBOT" ], - "size": "MEDIUM", + "volume": "62500 ml", + "weight": "81500 g", "hp": 80, "speed": 100, "material": [ "steel" ], @@ -1420,7 +1428,8 @@ "description": "The Northrup ATSV, a massive, heavily-armed and armored robot walking on a pair of reverse-jointed legs. Armed with a 40mm anti-vehicle grenade launcher, 5.56 anti-personnel gun, and the ability to electrify itself against attackers, it is an effective automated sentry, though production was limited due to a legal dispute.", "default_faction": "military", "species": [ "ROBOT" ], - "size": "LARGE", + "volume": "92500 ml", + "weight": "120 kg", "hp": 90, "speed": 115, "material": [ "steel" ], @@ -1514,7 +1523,8 @@ "description": "The Northrup Beagle is a refrigerator-sized urban warfare UGV. Sporting an anti-tank missile launcher, 40mm grenade launcher, and numerous anti-infantry weapons, it's designed for high-risk urban fighting.", "default_faction": "military", "species": [ "ROBOT" ], - "size": "HUGE", + "volume": "875000 ml", + "weight": "200 kg", "hp": 240, "speed": 75, "material": [ "steel" ], diff --git a/data/mods/blazemod/blaze_blob_monster.json b/data/mods/blazemod/blaze_blob_monster.json index 94cbccaaa4f2b..4447bd5afa78e 100644 --- a/data/mods/blazemod/blaze_blob_monster.json +++ b/data/mods/blazemod/blaze_blob_monster.json @@ -24,7 +24,8 @@ "description": "An escaping noisy blob, catch it before it brings in every zombie for miles!", "default_faction": "blob", "species": [ "BLOB" ], - "size": "SMALL", + "volume": "30000 ml", + "weight": "40750 g", "hp": 1, "speed": 60, "material": [ "flesh" ], @@ -53,7 +54,8 @@ "description": "An escaping noisy blob, catch it before it brings in every zombie for miles!", "default_faction": "blob", "species": [ "BLOB" ], - "size": "HUGE", + "volume": "875000 ml", + "weight": "200 kg", "hp": 1, "speed": 60, "material": [ "flesh" ], @@ -82,7 +84,8 @@ "description": "An escaping noisy blob, catch it before it brings in every zombie for miles!", "default_faction": "blob", "species": [ "BLOB" ], - "size": "LARGE", + "volume": "92500 ml", + "weight": "120 kg", "hp": 1, "speed": 60, "material": [ "flesh" ], From 9718a36627897d7830ea52b3d218be42a6d2d9c6 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Wed, 25 Dec 2019 00:10:29 +0100 Subject: [PATCH 15/23] Add two spaces after a period. As required by the style we use. --- .../CrazyCataclysm/crazy_comestibles.json | 2 +- data/mods/CrazyCataclysm/crazy_speech.json | 14 ++--- data/mods/Fuji_Mil_Prof/prof/spc.json | 2 +- .../captive_faction/TALK_CAPTIVE.json | 2 +- data/mods/More_Locations/factions.json | 4 +- data/mods/More_Locations/snippets.json | 38 ++++++------ data/mods/My_Sweet_Cataclysm/sweet_items.json | 2 +- data/mods/Salvaged_Robots/items.json | 2 +- data/mods/Salvaged_Robots/monsters.json | 60 +++++++++---------- data/mods/Salvaged_Robots/speech.json | 8 +-- 10 files changed, 67 insertions(+), 67 deletions(-) diff --git a/data/mods/CrazyCataclysm/crazy_comestibles.json b/data/mods/CrazyCataclysm/crazy_comestibles.json index f9113a0491b77..b68acd1742247 100644 --- a/data/mods/CrazyCataclysm/crazy_comestibles.json +++ b/data/mods/CrazyCataclysm/crazy_comestibles.json @@ -9,7 +9,7 @@ "symbol": "%", "quench": 25, "calories": 217, - "description": "The hit cookie from Mycus Industries! Now comes in addicting flavors such as Marloss, Chanterelle, and The Encroaching, Unavoidable Death of Human Civilization.", + "description": "The hit cookie from Mycus Industries! Now comes in addicting flavors such as Marloss, Chanterelle, and The Encroaching, Unavoidable Death of Human Civilization.", "price": 0, "material": [ "wheat", "fruit" ], "charges": 4, diff --git a/data/mods/CrazyCataclysm/crazy_speech.json b/data/mods/CrazyCataclysm/crazy_speech.json index 3796fefc2e2c5..0e836e861be28 100644 --- a/data/mods/CrazyCataclysm/crazy_speech.json +++ b/data/mods/CrazyCataclysm/crazy_speech.json @@ -38,7 +38,7 @@ { "type": "speech", "speaker": "aperture_potato", - "sound": "Fantastic! You remained resolute and resourceful in an atmosphere of extreme pessimism.", + "sound": "Fantastic! You remained resolute and resourceful in an atmosphere of extreme pessimism.", "volume": 10 }, { @@ -182,19 +182,19 @@ { "type": "speech", "speaker": "aperture_potato", - "sound": "What was that? Did you say something? ", + "sound": "What was that? Did you say something?", "volume": 20 }, { "type": "speech", "speaker": "aperture_potato", - "sound": "I'd just like to point out that you were given every opportunity to succeed. ", + "sound": "I'd just like to point out that you were given every opportunity to succeed.", "volume": 10 }, { "type": "speech", "speaker": "aperture_potato", - "sound": "What's your point, anyway? Survival?", + "sound": "What's your point, anyway? Survival?", "volume": 20 }, { @@ -254,7 +254,7 @@ { "type": "snippet", "category": "clickbait", - "text": "KEVIN SACRIFICING GAMEPLAY FOR REALISM? THE SHOCKING TRUTH REVEALED" + "text": "KEVIN SACRIFICING GAMEPLAY FOR REALISM? THE SHOCKING TRUTH REVEALED" }, { "type": "snippet", @@ -269,7 +269,7 @@ { "type": "snippet", "category": "clickbait", - "text": "TRIVIALIZE THE EARLY GAME WITH THIS ONE SIMPLE SPEAR WEAPON! CONTRIBUTORS HATE HIM" + "text": "TRIVIALIZE THE EARLY GAME WITH THIS ONE SIMPLE SPEAR WEAPON! CONTRIBUTORS HATE HIM" }, { "type": "snippet", @@ -378,7 +378,7 @@ { "type": "speech", "speaker": "mon_mi_go", - "sound": "\"It's alive! It's alive!\"", + "sound": "\"It's alive! It's alive!\"", "volume": 40 }, { diff --git a/data/mods/Fuji_Mil_Prof/prof/spc.json b/data/mods/Fuji_Mil_Prof/prof/spc.json index b83f614d63cc7..c536770a9c264 100644 --- a/data/mods/Fuji_Mil_Prof/prof/spc.json +++ b/data/mods/Fuji_Mil_Prof/prof/spc.json @@ -171,7 +171,7 @@ "type": "profession", "ident": "mil_cbrn", "name": "Operator CBRN", - "description": "Chemical weapons? Check. Biological outbreak? Check. Nuclear war? Check. Sounds like the perfect job for you!", + "description": "Chemical weapons? Check. Biological outbreak? Check. Nuclear war? Check. Sounds like the perfect job for you!", "points": 5, "skills": [ { "level": 1, "name": "survival" }, diff --git a/data/mods/More_Locations/captive_faction/TALK_CAPTIVE.json b/data/mods/More_Locations/captive_faction/TALK_CAPTIVE.json index fdc393077e62d..707eba10e73ae 100644 --- a/data/mods/More_Locations/captive_faction/TALK_CAPTIVE.json +++ b/data/mods/More_Locations/captive_faction/TALK_CAPTIVE.json @@ -6,7 +6,7 @@ "dynamic_line": "Are you part of the rescue team?", "responses": [ { "text": "Sorry, , the rescue has been delayed.", "topic": "TALK_DONE" }, - { "text": "Part? I AM the rescue team.", "topic": "TALK_CAPTIVE_FREE" } + { "text": "Part? I AM the rescue team.", "topic": "TALK_CAPTIVE_FREE" } ] }, { diff --git a/data/mods/More_Locations/factions.json b/data/mods/More_Locations/factions.json index eae14fa003326..e8105bb5168ec 100644 --- a/data/mods/More_Locations/factions.json +++ b/data/mods/More_Locations/factions.json @@ -10,7 +10,7 @@ "power": 1, "food_supply": 0, "wealth": 0, - "description": "These are hapless survivors who have been captured by raiders, slavers, mutants, or worse. Without your help, the remainder of their lives will be short and gruesome." + "description": "These are hapless survivors who have been captured by raiders, slavers, mutants, or worse. Without your help, the remainder of their lives will be short and gruesome." }, { "type": "faction", @@ -23,6 +23,6 @@ "power": 10, "food_supply": 1000, "wealth": 1000, - "description": "The scattered remnants of civilization, these lucky few managed to barricade themselves inside during the earliest stages of the Cataclysm. Although temporarily secure, they are short on supplies and lack the skills to obtain more. It's only a matter of time before they too become the prey of otherwordly creatures, or of all-too-human monsters." + "description": "The scattered remnants of civilization, these lucky few managed to barricade themselves inside during the earliest stages of the Cataclysm. Although temporarily secure, they are short on supplies and lack the skills to obtain more. It's only a matter of time before they too become the prey of otherwordly creatures, or of all-too-human monsters." } ] diff --git a/data/mods/More_Locations/snippets.json b/data/mods/More_Locations/snippets.json index ba7ecb9aab5b0..8343b27e3b9e5 100644 --- a/data/mods/More_Locations/snippets.json +++ b/data/mods/More_Locations/snippets.json @@ -47,17 +47,17 @@ { "type": "snippet", "category": "raider_grave", - "text": "Here Lies . What a Jerk." + "text": "Here Lies . What a Jerk." }, { "type": "snippet", "category": "raider_grave", - "text": " . Eaten by wolves." + "text": " . Eaten by wolves." }, { "type": "snippet", "category": "raider_grave", - "text": " . Infected." + "text": " . Infected." }, { "type": "snippet", @@ -72,67 +72,67 @@ { "type": "snippet", "category": "raider_grave", - "text": " . Roasting in Hell." + "text": " . Roasting in Hell." }, { "type": "snippet", "category": "raider_grave", - "text": " . Fallen Soldier." + "text": " . Fallen Soldier." }, { "type": "snippet", "category": "raider_grave", - "text": " . Ripped apart by a gross tentacle thing in the woods." + "text": " . Ripped apart by a gross tentacle thing in the woods." }, { "type": "snippet", "category": "raider_grave", - "text": " . Died as he lived, drunk and on fire." + "text": " . Died as he lived, drunk and on fire." }, { "type": "snippet", "category": "raider_grave", - "text": " & . Crashed their motorcycles at 120mph. Buried the pieces together." + "text": " & . Crashed their motorcycles at 120mph. Buried the pieces together." }, { "type": "snippet", "category": "raider", - "text": " . Friend, Lover, Cannibal." + "text": " . Friend, Lover, Cannibal." }, { "type": "snippet", "category": "raider_grave", - "text": " . Vaporized by Tank Bot." + "text": " . Vaporized by Tank Bot." }, { "type": "snippet", "category": "raider_grave", - "text": " . Died in his sleep. Lucky Bastard." + "text": " . Died in his sleep. Lucky Bastard." }, { "type": "snippet", "category": "raider_grave.", - "text": " Here lies . No Smoking near Molotov storage!" + "text": " Here lies . No Smoking near Molotov storage!" }, { "type": "snippet", "category": "raider_grave", - "text": " . Gunned down in his prime." + "text": " . Gunned down in his prime." }, { "type": "snippet", "category": "raider_grave", - "text": " . Drank a mystery serum and mutated to death." + "text": " . Drank a mystery serum and mutated to death." }, { "type": "snippet", "category": "raider_grave", - "text": " . We'll never see another like him." + "text": " . We'll never see another like him." }, { "type": "snippet", "category": "raider_grave", - "text": " . Done in by mutant wasps." + "text": " . Done in by mutant wasps." }, { "type": "snippet", @@ -147,7 +147,7 @@ { "type": "snippet", "category": "refugee_help", - "text": "Rooms Available. Rent Negotiable." + "text": "Rooms Available. Rent Negotiable." }, { "type": "snippet", @@ -177,12 +177,12 @@ { "type": "snippet", "category": "refugee_help", - "text": "No Power. No Food. Send Airdrops Please!" + "text": "No Power. No Food. Send Airdrops Please!" }, { "type": "snippet", "category": "refugee_help", - "text": "No more FEMA camp refugees. You're already dying." + "text": "No more FEMA camp refugees. You're already dying." }, { "type": "snippet", diff --git a/data/mods/My_Sweet_Cataclysm/sweet_items.json b/data/mods/My_Sweet_Cataclysm/sweet_items.json index 5a59653a5d2f8..0a6e70420e958 100644 --- a/data/mods/My_Sweet_Cataclysm/sweet_items.json +++ b/data/mods/My_Sweet_Cataclysm/sweet_items.json @@ -3,7 +3,7 @@ "id": "sugarkin_flyer", "type": "BOOK", "name": "SugarKin flyer", - "description": "A flyer for some kind of candy. It shows a picture of a gleaming human made of smooth candy looking at you in terror. \"SugarKin the first life-size human candy! Are you a real monster? Will you be able to devour it?\"\n On the back of the flyer you can see some hastily scribbled words:\n \"Hello, my child, welcome to this world. A world where you'll be able to thrive if you follow a few rules: \n1) Never ever get into contact with water, it would melt you! \n2) Avoid humans with clear eyes they are very dangerous! (You can ignore the ones with black eyes they are harmless to you.) \n3) Learn how to make caramel ointment, it's the only way to fix your body if you get hurt.\n There are many more things I'd like to tell you but I must leave before it's too late. I've made you a friend to keep you company, be kind to it. \n I love you,\n - F. \".", + "description": "A flyer for some kind of candy. It shows a picture of a gleaming human made of smooth candy looking at you in terror. \"SugarKin the first life-size human candy! Are you a real monster? Will you be able to devour it?\"\n On the back of the flyer you can see some hastily scribbled words:\n \"Hello, my child, welcome to this world. A world where you'll be able to thrive if you follow a few rules: \n1) Never ever get into contact with water, it would melt you! \n2) Avoid humans with clear eyes they are very dangerous! (You can ignore the ones with black eyes they are harmless to you.) \n3) Learn how to make caramel ointment, it's the only way to fix your body if you get hurt.\n There are many more things I'd like to tell you but I must leave before it's too late. I've made you a friend to keep you company, be kind to it. \n I love you,\n - F. \".", "weight": "3 g", "volume": 0, "price": 0, diff --git a/data/mods/Salvaged_Robots/items.json b/data/mods/Salvaged_Robots/items.json index cd8337200ddcf..cbc219d3f931a 100644 --- a/data/mods/Salvaged_Robots/items.json +++ b/data/mods/Salvaged_Robots/items.json @@ -310,7 +310,7 @@ "type": "place_monster", "monster_id": "mon_arson_hack", "friendly_msg": "The arson hack flies from your hand! Get clear!", - "hostile_msg": "You misprogram the arson hack! Run!", + "hostile_msg": "You misprogram the arson hack! Run!", "difficulty": 1, "moves": 60, "place_randomly": true, diff --git a/data/mods/Salvaged_Robots/monsters.json b/data/mods/Salvaged_Robots/monsters.json index 4365fdadeb0c3..46df1208da49c 100644 --- a/data/mods/Salvaged_Robots/monsters.json +++ b/data/mods/Salvaged_Robots/monsters.json @@ -39,7 +39,7 @@ "id": "mon_autoarmor_base", "type": "MONSTER", "name": "automated armor", - "description": "A suit of power armor temporarily controlled by an attached AI-core. Originally intended as a way to retrieve dead or wounded operators from combat, it was more commonly used for transporting the suit itself. The AI is limited, and makes a poor combatant.", + "description": "A suit of power armor temporarily controlled by an attached AI-core. Originally intended as a way to retrieve dead or wounded operators from combat, it was more commonly used for transporting the suit itself. The AI is limited, and makes a poor combatant.", "default_faction": "military", "species": [ "ROBOT" ], "diff": 10, @@ -152,7 +152,7 @@ "type": "MONSTER", "name": "arsonhack", "looks_like": "bot_manhack", - "description": "A salvaged drone repurposed to spread flame and cause property damage. It's almost as dangerous to its user as it is to the surroundings. The arsonhack cannot be recovered once activated. Only a reckless madman would dare to build this.", + "description": "A salvaged drone repurposed to spread flame and cause property damage. It's almost as dangerous to its user as it is to the surroundings. The arsonhack cannot be recovered once activated. Only a reckless madman would dare to build this.", "diff": 10, "speed": 250, "luminance": 5, @@ -199,7 +199,7 @@ "ammo_type": "water", "fake_skills": [ [ "gun", 2 ], [ "launcher", 2 ] ], "fake_dex": 9, - "no_ammo_sound": "drip. drip.", + "no_ammo_sound": "drip. drip.", "ranges": [ [ 0, 10, "BURST" ] ] } ] @@ -241,7 +241,7 @@ "color": "pink", "luminance": 8, "armor_fire": 10, - "description": "A salvaged eyebot repurposed into a floating space heater. It emits a constant jet of warm air to heat an enclosed space.", + "description": "A salvaged eyebot repurposed into a floating space heater. It emits a constant jet of warm air to heat an enclosed space.", "revert_to_itype": "bot_eyebot_heater", "fear_triggers": [ "HURT" ], "emit_fields": [ "emit_hot_air2_stream" ], @@ -270,7 +270,7 @@ "color": "red", "luminance": 100, "armor_fire": 12, - "description": "A salvaged eyebot refitted with a laser weapon. The lack of recoil allows the hovering robot to aim and fire without penalty. It has decent range and damage, but requires an extended recharge time between shots.", + "description": "A salvaged eyebot refitted with a laser weapon. The lack of recoil allows the hovering robot to aim and fire without penalty. It has decent range and damage, but requires an extended recharge time between shots.", "revert_to_itype": "bot_eyebot_burn", "special_attacks": [ { @@ -336,7 +336,7 @@ "type": "MONSTER", "copy-from": "mon_utilibot", "name": "construction robot", - "description": "One of the many models of construction robot formerly in use by government agencies and private corporations. It is equipped with an integrated welder, flashlight, nailgun, and jackhammer.", + "description": "One of the many models of construction robot formerly in use by government agencies and private corporations. It is equipped with an integrated welder, flashlight, nailgun, and jackhammer.", "color": "yellow", "luminance": 10, "melee_skill": 2, @@ -360,7 +360,7 @@ "type": "MONSTER", "copy-from": "mon_utilibot", "name": "firefighter robot", - "description": "One of the many models of fire-fighting robot formerly in use by local fire departments and emergency services. Designed for entering burning buildings and other situations deemed too dangerous for human firefighters.", + "description": "One of the many models of fire-fighting robot formerly in use by local fire departments and emergency services. Designed for entering burning buildings and other situations deemed too dangerous for human firefighters.", "color": "yellow", "luminance": 100, "melee_skill": 3, @@ -386,7 +386,7 @@ "copy-from": "mon_utilibot", "name": "blob breeder", "revert_to_itype": "bot_utilibot_blob", - "description": "A salvaged utility robot converted into a mobile incubator for the alien blob. It will intermittently release a group of living blobs. Why on Earth would you build this?", + "description": "A salvaged utility robot converted into a mobile incubator for the alien blob. It will intermittently release a group of living blobs. Why on Earth would you build this?", "armor_bash": 12, "reproduction": { "baby_monster": "mon_blob", "baby_count": 10, "baby_timer": 1 } }, @@ -405,7 +405,7 @@ "type": "MONSTER", "copy-from": "mon_utilibot", "name": "digestron", - "description": "A salvaged utility robot converted into an automated vacuum cleaner. It will suck stray items off the ground and dissolve them with its internal acid reserves. A useful helper for keeping your front lawn clean of debris… or corpses.", + "description": "A salvaged utility robot converted into an automated vacuum cleaner. It will suck stray items off the ground and dissolve them with its internal acid reserves. A useful helper for keeping your front lawn clean of debris… or corpses.", "speed": 100, "aggression": 10, "morale": 10, @@ -483,7 +483,7 @@ "type": "MONSTER", "copy-from": "mon_medibot", "name": "assassination robot", - "description": "A salvaged medical robot repurposed into a murder machine. Its surgical tools have been replaced with a fearsome set of blades, and its hypodermic needle now delivers powerful toxins.", + "description": "A salvaged medical robot repurposed into a murder machine. Its surgical tools have been replaced with a fearsome set of blades, and its hypodermic needle now delivers powerful toxins.", "speed": 120, "color": "red", "aggression": 100, @@ -511,7 +511,7 @@ "type": "MONSTER", "copy-from": "mon_medibot", "name": "elixirator", - "description": "This doesn't work yet. Don't build it… A salvaged medibot with its internal pharma-fabricators repurposed to produce mutagen.", + "description": "This doesn't work yet. Don't build it… A salvaged medibot with its internal pharma-fabricators repurposed to produce mutagen.", "color": "light_green", "aggression": 10, "morale": 10, @@ -578,7 +578,7 @@ "type": "MONSTER", "copy-from": "mon_skitterbot", "name": "rat snatcher", - "description": "A salvaged skitterbot repurposed for hunting small game. It's faster than the original model but far less sturdy.", + "description": "A salvaged skitterbot repurposed for hunting small game. It's faster than the original model but far less sturdy.", "color": "light_gray", "speed": 250, "hp": 30, @@ -619,7 +619,7 @@ "type": "MONSTER", "copy-from": "mon_skitterbot", "name": "pest hunter", - "description": "A salvaged skitterbot refitted with an 8mm integrated firearm. The robot's small size precludes rapid fire, due to recoil, and requires the use of lightweight caseless ammo.", + "description": "A salvaged skitterbot refitted with an 8mm integrated firearm. The robot's small size precludes rapid fire, due to recoil, and requires the use of lightweight caseless ammo.", "color": "dark_gray", "aggression": 100, "speed": 200, @@ -692,7 +692,7 @@ "type": "MONSTER", "copy-from": "mon_defbot_base", "name": "security robot", - "description": "An automated defense robot still active due to its internal power source. This one is equipped with an electric prod and an integrated shotgun.", + "description": "An automated defense robot still active due to its internal power source. This one is equipped with an electric prod and an integrated shotgun.", "melee_damage": [ { "damage_type": "electric", "amount": 6 } ], "starting_ammo": { "shot_00": 100 }, "special_attacks": [ @@ -714,7 +714,7 @@ "type": "MONSTER", "looks_like": "mon_secubot", "name": "military robot", - "description": "A military robot still operating due to its internal power core. This one is armed with an electric prod and an integrated 5.56mm firearm.", + "description": "A military robot still operating due to its internal power core. This one is armed with an electric prod and an integrated 5.56mm firearm.", "default_faction": "military", "species": [ "ROBOT" ], "volume": "62500 ml", @@ -938,7 +938,7 @@ "type": "MONSTER", "copy-from": "mon_milbot_base", "name": "grenadier robot", - "description": "A military robot still operating due to its internal power core. This one is armed with an electric prod and an integrated 40mm grenade launcher.", + "description": "A military robot still operating due to its internal power core. This one is armed with an electric prod and an integrated 40mm grenade launcher.", "diff": 20, "melee_damage": [ { "damage_type": "electric", "amount": 6 } ], "color": "dark_gray_red", @@ -970,7 +970,7 @@ "type": "MONSTER", "copy-from": "mon_milbot_base", "name": "military flame robot", - "description": "A military robot still operating due to its internal power core. This one is armed with an electric prod and an integrated flamethrower.", + "description": "A military robot still operating due to its internal power core. This one is armed with an electric prod and an integrated flamethrower.", "diff": 20, "melee_damage": [ { "damage_type": "electric", "amount": 6 } ], "starting_ammo": { "napalm": 200 }, @@ -1001,7 +1001,7 @@ "copy-from": "mon_defbot_base", "looks_like": "mon_copbot", "name": "advanced robot", - "description": "An advanced robot still functioning due to its internal fusion core. This model is armed with a powerful laser-emitter.", + "description": "An advanced robot still functioning due to its internal fusion core. This model is armed with a powerful laser-emitter.", "default_faction": "science", "species": [ "ROBOT" ], "hp": 100, @@ -1021,7 +1021,7 @@ "type": "MONSTER", "copy-from": "mon_advbot_base", "name": "laser-emitting robot", - "description": "An advanced robot still functioning due to its internal fusion core. This model is furnished with a powerful laser-emitter.", + "description": "An advanced robot still functioning due to its internal fusion core. This model is furnished with a powerful laser-emitter.", "diff": 20, "luminance": 120, "special_attacks": [ @@ -1048,7 +1048,7 @@ "type": "MONSTER", "copy-from": "mon_advbot_base", "name": "plasma-ejecting robot", - "description": "An advanced robot still functioning due to its internal fusion core. This model is furnished with a powerful plasma-ejector.", + "description": "An advanced robot still functioning due to its internal fusion core. This model is furnished with a powerful plasma-ejector.", "diff": 20, "color": "magenta", "luminance": 200, @@ -1077,7 +1077,7 @@ "type": "MONSTER", "copy-from": "mon_advbot_base", "name": "railgun robot", - "description": "An advanced robot still functioning due to its internal fusion core. This model is furnished with a powerful railgun.", + "description": "An advanced robot still functioning due to its internal fusion core. This model is furnished with a powerful railgun.", "diff": 30, "special_attacks": [ { @@ -1106,7 +1106,7 @@ "copy-from": "mon_advbot_base", "name": "electro-casting robot", "color": "white_cyan", - "description": "An advanced robot still functioning due to its internal fusion core. This model is furnished with a powerful electro-caster.", + "description": "An advanced robot still functioning due to its internal fusion core. This model is furnished with a powerful electro-caster.", "diff": 20, "luminance": 100, "special_attacks": [ @@ -1133,7 +1133,7 @@ "type": "MONSTER", "copy-from": "mon_advbot_base", "name": "EMP-projecting robot", - "description": "An advanced robot still functioning due to its internal fusion core. This model is furnished with a powerful EMP-projector.", + "description": "An advanced robot still functioning due to its internal fusion core. This model is furnished with a powerful EMP-projector.", "diff": 10, "luminance": 120, "special_attacks": [ @@ -1159,7 +1159,7 @@ "type": "MONSTER", "copy-from": "mon_defbot_base", "name": "junkyard cowboy", - "description": "A salvaged defense robot refitted with a shotgun and two circular buzzsaws. Due to bootleg targeting software, it can only attack nearby targets.", + "description": "A salvaged defense robot refitted with a shotgun and two circular buzzsaws. Due to bootleg targeting software, it can only attack nearby targets.", "speed": 100, "color": "brown", "luminance": 0, @@ -1214,7 +1214,7 @@ "type": "MONSTER", "copy-from": "mon_defbot_base", "name": "slapdash paladin", - "description": "A salvaged defense robot refitted with a homemade flamethrower and two searing hot blades. The burning fuel reserves make the robot noisy and smokey.", + "description": "A salvaged defense robot refitted with a homemade flamethrower and two searing hot blades. The burning fuel reserves make the robot noisy and smokey.", "speed": 100, "color": "red", "luminance": 30, @@ -1253,7 +1253,7 @@ "type": "MONSTER", "copy-from": "mon_milbot_base", "name": "robo-guardian", - "description": "A salvaged military robot refitted with a pair of integrated 9mm firearms. Multiple weapons provide a high rate of fire, but jury-rigged sensors limit the effective range and accuracy. It makes for a good close range bodyguard.", + "description": "A salvaged military robot refitted with a pair of integrated 9mm firearms. Multiple weapons provide a high rate of fire, but jury-rigged sensors limit the effective range and accuracy. It makes for a good close range bodyguard.", "diff": 10, "speed": 70, "color": "green", @@ -1292,7 +1292,7 @@ "type": "MONSTER", "copy-from": "mon_milbot_base", "name": "robo-protector", - "description": "A salvaged military robot refitted with an integrated 5.56mm rifle. The modified firearm is only capable of three round bursts, but range and accuracy are decent. It makes for a solid combat ally.", + "description": "A salvaged military robot refitted with an integrated 5.56mm rifle. The modified firearm is only capable of three round bursts, but range and accuracy are decent. It makes for a solid combat ally.", "diff": 20, "speed": 100, "color": "green", @@ -1321,7 +1321,7 @@ "type": "MONSTER", "copy-from": "mon_milbot_base", "name": "robo-defender", - "description": "A salvaged military robot refitted with an integrated 50bmg rifle. Improved optics provide nightvision and excellent range, but glitchy targeting software requires an extended pause between shots. It makes for a good long range sniper.", + "description": "A salvaged military robot refitted with an integrated 50bmg rifle. Improved optics provide nightvision and excellent range, but glitchy targeting software requires an extended pause between shots. It makes for a good long range sniper.", "diff": 30, "speed": 70, "color": "green", @@ -1475,7 +1475,7 @@ "type": "MONSTER", "name": "screeching terror", "copy-from": "mon_chickenbot_base", - "description": "A salvaged chickenwalker modified into a horrific monster adorned with skulls and spikes. It has traded its long range weapons for a set of piston-driven lances. A speaker system has been installed to blast terrifying shrieks of distorted music. No one in their right mind would craft such a hellish beast.", + "description": "A salvaged chickenwalker modified into a horrific monster adorned with skulls and spikes. It has traded its long range weapons for a set of piston-driven lances. A speaker system has been installed to blast terrifying shrieks of distorted music. No one in their right mind would craft such a hellish beast.", "diff": 5, "hp": 90, "speed": 115, @@ -1493,7 +1493,7 @@ "type": "MONSTER", "name": "hooked nightmare", "copy-from": "mon_chickenbot_base", - "description": "A salvaged chickenwalker modified into a horrific monster adorned with skulls and spikes. It has traded its long range weapons for a set of spinning chains terminating in bloody hooks. A speaker system has been installed to blast terrifying shrieks of distorted music. No one in their right mind would craft such a twisted abomination.", + "description": "A salvaged chickenwalker modified into a horrific monster adorned with skulls and spikes. It has traded its long range weapons for a set of spinning chains terminating in bloody hooks. A speaker system has been installed to blast terrifying shrieks of distorted music. No one in their right mind would craft such a twisted abomination.", "diff": 5, "hp": 90, "speed": 115, diff --git a/data/mods/Salvaged_Robots/speech.json b/data/mods/Salvaged_Robots/speech.json index 9ac2e4dfca90f..9c71c9e5601b5 100644 --- a/data/mods/Salvaged_Robots/speech.json +++ b/data/mods/Salvaged_Robots/speech.json @@ -170,19 +170,19 @@ { "type": "speech", "speaker": "mon_craftbuddy", - "sound": "\"Bedeep. Whurrrrrmmmm.\"", + "sound": "\"Bedeep. Whurrrrrmmmm.\"", "volume": 10 }, { "type": "speech", "speaker": "mon_craftbuddy", - "sound": "\"Pwwowm. Fsht fshrrrr.\"", + "sound": "\"Pwwowm. Fsht fshrrrr.\"", "volume": 10 }, { "type": "speech", "speaker": "mon_craftbuddy", - "sound": "\"Click. Clicliclick. Vrnnnk.\"", + "sound": "\"Click. Clicliclick. Vrnnnk.\"", "volume": 10 }, { @@ -212,7 +212,7 @@ { "type": "speech", "speaker": "mon_defbot_paladin", - "sound": "\"Creak! Clang clang.\"", + "sound": "\"Creak! Clang clang.\"", "volume": 50 }, { From 8fc5104d5a2ebf15c10e539959cb66a538449274 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Wed, 25 Dec 2019 00:11:01 +0100 Subject: [PATCH 16/23] Fix name of JSON member --- data/mods/Salvaged_Robots/recipe.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/mods/Salvaged_Robots/recipe.json b/data/mods/Salvaged_Robots/recipe.json index 2e51080582a10..720c3dd4443b4 100644 --- a/data/mods/Salvaged_Robots/recipe.json +++ b/data/mods/Salvaged_Robots/recipe.json @@ -9,7 +9,7 @@ "difficulty": 8, "time": 2500, "reversible": true, - "auto_learn": true, + "autolearn": true, "tools": [ [ [ "electrohack", 20 ] ] ], "using": [ [ "soldering_standard", 20 ], [ "welding_standard", 5 ] ], "qualities": [ { "id": "SCREW", "level": 1 }, { "id": "WRENCH", "level": 1 } ], @@ -33,7 +33,7 @@ "difficulty": 3, "time": 2500, "reversible": true, - "auto_learn": true, + "autolearn": true, "tools": [ [ [ "electrohack", 20 ] ] ], "qualities": [ { "id": "SCREW", "level": 1 } ] }, @@ -68,7 +68,7 @@ "difficulty": 6, "time": 25000, "reversible": false, - "auto_learn": true, + "autolearn": true, "tools": [ [ [ "electrohack", 20 ] ] ], "using": [ [ "soldering_standard", 20 ], [ "welding_standard", 5 ] ], "qualities": [ { "id": "SCREW", "level": 1 }, { "id": "WRENCH", "level": 1 } ] From 2434d62379c4f0b876c217ceaf74ffac3e474a7a Mon Sep 17 00:00:00 2001 From: BevapDin Date: Wed, 25 Dec 2019 09:11:24 +0100 Subject: [PATCH 17/23] Fix item flags being set on gun data (item flags need to be set on item types directly). --- data/mods/FictonalWeapons/fic_mods.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/mods/FictonalWeapons/fic_mods.json b/data/mods/FictonalWeapons/fic_mods.json index c699d66ae3be0..d47ab0891c21d 100644 --- a/data/mods/FictonalWeapons/fic_mods.json +++ b/data/mods/FictonalWeapons/fic_mods.json @@ -37,9 +37,9 @@ "skill": "launcher", "dispersion": 320, "durability": 10, - "clip_size": 300, - "flags": [ "FIRE_50" ] + "clip_size": 300 }, + "flags": [ "FIRE_50" ], "dispersion_modifier": 25, "min_skills": [ [ "weapon", 2 ], [ "launcher", 2 ] ] }, From 0a28ddd91e9c12fa9967c0ae2903599685c1d339 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Wed, 25 Dec 2019 09:14:21 +0100 Subject: [PATCH 18/23] Remove unnecessary spaces before end of line --- data/mods/My_Sweet_Cataclysm/sweet_items.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/My_Sweet_Cataclysm/sweet_items.json b/data/mods/My_Sweet_Cataclysm/sweet_items.json index 0a6e70420e958..74fd379c86565 100644 --- a/data/mods/My_Sweet_Cataclysm/sweet_items.json +++ b/data/mods/My_Sweet_Cataclysm/sweet_items.json @@ -3,7 +3,7 @@ "id": "sugarkin_flyer", "type": "BOOK", "name": "SugarKin flyer", - "description": "A flyer for some kind of candy. It shows a picture of a gleaming human made of smooth candy looking at you in terror. \"SugarKin the first life-size human candy! Are you a real monster? Will you be able to devour it?\"\n On the back of the flyer you can see some hastily scribbled words:\n \"Hello, my child, welcome to this world. A world where you'll be able to thrive if you follow a few rules: \n1) Never ever get into contact with water, it would melt you! \n2) Avoid humans with clear eyes they are very dangerous! (You can ignore the ones with black eyes they are harmless to you.) \n3) Learn how to make caramel ointment, it's the only way to fix your body if you get hurt.\n There are many more things I'd like to tell you but I must leave before it's too late. I've made you a friend to keep you company, be kind to it. \n I love you,\n - F. \".", + "description": "A flyer for some kind of candy. It shows a picture of a gleaming human made of smooth candy looking at you in terror. \"SugarKin the first life-size human candy! Are you a real monster? Will you be able to devour it?\"\n On the back of the flyer you can see some hastily scribbled words:\n \"Hello, my child, welcome to this world. A world where you'll be able to thrive if you follow a few rules:\n1) Never ever get into contact with water, it would melt you!\n2) Avoid humans with clear eyes they are very dangerous! (You can ignore the ones with black eyes they are harmless to you.)\n3) Learn how to make caramel ointment, it's the only way to fix your body if you get hurt.\n There are many more things I'd like to tell you but I must leave before it's too late. I've made you a friend to keep you company, be kind to it.\n I love you,\n - F. \".", "weight": "3 g", "volume": 0, "price": 0, From f9dbbd58e1fa3a6c11fe683b69762239b29b5e49 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Wed, 25 Dec 2019 00:12:20 +0100 Subject: [PATCH 19/23] Remove mods from blacklist as they load properly now. --- build-scripts/mod_test_blacklist | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build-scripts/mod_test_blacklist b/build-scripts/mod_test_blacklist index 2ed8c7cc710c6..c08830f779ff7 100644 --- a/build-scripts/mod_test_blacklist +++ b/build-scripts/mod_test_blacklist @@ -1,15 +1,10 @@ aftershock blazemod -crazy_cataclysm crt_expansion -FIC_Weapons generic_guns Graphical_Overmap mapgen_demo -modular_turrets more_locations -my_sweet_cataclysm -national_guard_camp no_medieval_items sees_player_hitbutton sees_player_retro From 4536d487d6a2900822207ff9cb0eb6262fc3934e Mon Sep 17 00:00:00 2001 From: BevapDin Date: Wed, 25 Dec 2019 10:29:29 +0100 Subject: [PATCH 20/23] Add subtype entry, so the loading code actually parses the "entries" array. --- data/json/mapgen/hazardous_waste_sarcophagus.json | 1 + 1 file changed, 1 insertion(+) diff --git a/data/json/mapgen/hazardous_waste_sarcophagus.json b/data/json/mapgen/hazardous_waste_sarcophagus.json index b94baa72cb922..3a5db729d2103 100644 --- a/data/json/mapgen/hazardous_waste_sarcophagus.json +++ b/data/json/mapgen/hazardous_waste_sarcophagus.json @@ -319,6 +319,7 @@ { "id": "nanomaterials", "type": "item_group", + "subtype": "collection", "entries": [ { "item": "nanomaterial", "prob": 100 } ] } ] From 097c266fca8aac89ad2a527dd6ce8713622b95da Mon Sep 17 00:00:00 2001 From: BevapDin Date: Wed, 25 Dec 2019 10:31:14 +0100 Subject: [PATCH 21/23] Ignore unvisited members when skipping an out-of-bounds entry --- src/mapgen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index c1386974467df..f4b5f8c7eb289 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -628,6 +628,7 @@ void mapgen_function_json_base::setup_setmap( const JsonArray &parray ) tmp_x2 = jmapgen_int( pjo, "x2" ); tmp_y2 = jmapgen_int( pjo, "y2" ); if( !check_inbounds( tmp_x2, tmp_y2, pjo ) ) { + pjo.allow_omitted_members(); continue; } } From 15f1d0fd243202bc34a6f066b87e2464d8ebb138 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Thu, 26 Dec 2019 10:57:28 +0100 Subject: [PATCH 22/23] Commit changes after running `make style-all-json` --- .../isherwood_farm/NPC_Carlos_Isherwood.json | 7 +--- .../isherwood_farm/NPC_Chris_Isherwood.json | 7 +--- .../NPC_old_guard_representative.json | 5 +-- .../npcs/tacoma_ranch/NPC_ranch_foreman.json | 40 ++++--------------- data/mods/FictonalWeapons/fic_mods.json | 8 +--- 5 files changed, 12 insertions(+), 55 deletions(-) diff --git a/data/json/npcs/isherwood_farm/NPC_Carlos_Isherwood.json b/data/json/npcs/isherwood_farm/NPC_Carlos_Isherwood.json index c9427af5c6c52..2057b0d5855e5 100644 --- a/data/json/npcs/isherwood_farm/NPC_Carlos_Isherwood.json +++ b/data/json/npcs/isherwood_farm/NPC_Carlos_Isherwood.json @@ -195,12 +195,7 @@ "end": { "opinion": { "trust": 1, "value": 1 }, "effect": [ { "u_buy_item": "leather_armor_horse", "count": 1 } ], - "update_mapgen": [ - { - "om_terrain": "horse_farm_isherwood_4", - "set": [ { "point": "furniture", "id": "f_anvil", "x": 6, "y": 12 } ] - } - ] + "update_mapgen": [ { "om_terrain": "horse_farm_isherwood_4", "set": [ { "point": "furniture", "id": "f_anvil", "x": 6, "y": 12 } ] } ] } }, { diff --git a/data/json/npcs/isherwood_farm/NPC_Chris_Isherwood.json b/data/json/npcs/isherwood_farm/NPC_Chris_Isherwood.json index 57d907bf2f3ad..5ac7a4e57e4aa 100644 --- a/data/json/npcs/isherwood_farm/NPC_Chris_Isherwood.json +++ b/data/json/npcs/isherwood_farm/NPC_Chris_Isherwood.json @@ -186,12 +186,7 @@ }, "end": { "opinion": { "trust": 5, "value": 5 }, - "update_mapgen": [ - { - "om_terrain": "cabin_isherwood", - "place_nested": [ { "chunks": [ "cabin_isherwood_update" ], "x": 3, "y": 1 } ] - } - ] + "update_mapgen": [ { "om_terrain": "cabin_isherwood", "place_nested": [ { "chunks": [ "cabin_isherwood_update" ], "x": 3, "y": 1 } ] } ] } } ] diff --git a/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json b/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json index 0eaf670f9ca25..67d19d4b8f4d5 100644 --- a/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json +++ b/data/json/npcs/refugee_center/surface_visitors/NPC_old_guard_representative.json @@ -131,10 +131,7 @@ "value": 50000, "start": { "update_mapgen": [ - { - "om_terrain": "evac_center_19", - "place_npcs": [ { "class": "evac_guard3", "x": 12, "y": 12, "target": true } ] - }, + { "om_terrain": "evac_center_19", "place_npcs": [ { "class": "evac_guard3", "x": 12, "y": 12, "target": true } ] }, { "om_terrain": "evac_center_7", "place_npcs": [ { "class": "scavenger_hunter", "x": [ 9, 15 ], "y": [ 9, 15 ] } ] diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json b/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json index 752c45aa6cded..0ced7bbef4fd4 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json @@ -251,10 +251,7 @@ "place_furniture": [ { "furn": "f_bookcase", "x": 17, "y": 11 } ], "place_npcs": [ { "class": "ranch_farmer_1", "x": 19, "y": 20 } ] }, - { - "om_terrain": "ranch_camp_66", - "place_npcs": [ { "class": "ranch_woodcutter_1", "x": 4, "y": 11 } ] - } + { "om_terrain": "ranch_camp_66", "place_npcs": [ { "class": "ranch_woodcutter_1", "x": 4, "y": 11 } ] } ] } }, @@ -586,10 +583,7 @@ }, "end": { "update_mapgen": [ - { - "om_terrain": "ranch_camp_59", - "place_nested": [ { "chunks": [ "tacoma_commune_clinic_10" ], "x": 0, "y": 2 } ] - }, + { "om_terrain": "ranch_camp_59", "place_nested": [ { "chunks": [ "tacoma_commune_clinic_10" ], "x": 0, "y": 2 } ] }, { "om_terrain": "ranch_camp_60", "place_nested": [ { "chunks": [ "tacoma_commune_chopshop_10" ], "x": 0, "y": 4 } ] @@ -621,10 +615,7 @@ }, "end": { "update_mapgen": [ - { - "om_terrain": "ranch_camp_59", - "place_nested": [ { "chunks": [ "tacoma_commune_clinic_11" ], "x": 0, "y": 2 } ] - }, + { "om_terrain": "ranch_camp_59", "place_nested": [ { "chunks": [ "tacoma_commune_clinic_11" ], "x": 0, "y": 2 } ] }, { "om_terrain": "ranch_camp_60", "place_nested": [ { "chunks": [ "tacoma_commune_chopshop_11" ], "x": 0, "y": 4 } ] @@ -674,10 +665,7 @@ }, "end": { "update_mapgen": [ - { - "om_terrain": "ranch_camp_49", - "place_nested": [ { "chunks": [ "tacoma_commune_junk_shop_12" ], "x": 0, "y": 9 } ] - }, + { "om_terrain": "ranch_camp_49", "place_nested": [ { "chunks": [ "tacoma_commune_junk_shop_12" ], "x": 0, "y": 9 } ] }, { "om_terrain": "ranch_camp_60", "place_nested": [ { "chunks": [ "tacoma_commune_chopshop_12_done" ], "x": 0, "y": 4 } ] @@ -714,14 +702,8 @@ }, "end": { "update_mapgen": [ - { - "om_terrain": "ranch_camp_49", - "place_nested": [ { "chunks": [ "tacoma_commune_junk_shop_13" ], "x": 0, "y": 9 } ] - }, - { - "om_terrain": "ranch_camp_66", - "place_npcs": [ { "class": "ranch_barber", "x": 5, "y": 3 } ] - }, + { "om_terrain": "ranch_camp_49", "place_nested": [ { "chunks": [ "tacoma_commune_junk_shop_13" ], "x": 0, "y": 9 } ] }, + { "om_terrain": "ranch_camp_66", "place_npcs": [ { "class": "ranch_barber", "x": 5, "y": 3 } ] }, { "om_terrain": "ranch_camp_70", "translate_ter": [ { "from": "t_underbrush", "to": "t_dirt", "x": 0, "y": 0 } ], @@ -793,10 +775,7 @@ "failure": "It was a lost cause anyways..." }, "end": { - "update_mapgen": { - "om_terrain": "ranch_camp_51", - "place_nested": [ { "chunks": [ "tacoma_commune_bar_15" ], "x": 0, "y": 0 } ] - } + "update_mapgen": { "om_terrain": "ranch_camp_51", "place_nested": [ { "chunks": [ "tacoma_commune_bar_15" ], "x": 0, "y": 0 } ] } } }, { @@ -823,10 +802,7 @@ }, "end": { "update_mapgen": [ - { - "om_terrain": "ranch_camp_51", - "place_nested": [ { "chunks": [ "tacoma_commune_bar_16_done" ], "x": 0, "y": 0 } ] - }, + { "om_terrain": "ranch_camp_51", "place_nested": [ { "chunks": [ "tacoma_commune_bar_16_done" ], "x": 0, "y": 0 } ] }, { "om_terrain": "ranch_camp_52", "place_nested": [ { "chunks": [ "tacoma_commune_greenhouse_16" ], "x": 2, "y": 10 } ] diff --git a/data/mods/FictonalWeapons/fic_mods.json b/data/mods/FictonalWeapons/fic_mods.json index d47ab0891c21d..5c3312217625d 100644 --- a/data/mods/FictonalWeapons/fic_mods.json +++ b/data/mods/FictonalWeapons/fic_mods.json @@ -32,13 +32,7 @@ "color": "light_gray", "location": "underbarrel", "mod_targets": [ "pistol", "smg" ], - "gun_data": { - "ammo": "flammable", - "skill": "launcher", - "dispersion": 320, - "durability": 10, - "clip_size": 300 - }, + "gun_data": { "ammo": "flammable", "skill": "launcher", "dispersion": 320, "durability": 10, "clip_size": 300 }, "flags": [ "FIRE_50" ], "dispersion_modifier": 25, "min_skills": [ [ "weapon", 2 ], [ "launcher", 2 ] ] From 040ae761772e3ec4d5cd36380c1dd936ee2bf58d Mon Sep 17 00:00:00 2001 From: BevapDin Date: Fri, 27 Dec 2019 13:29:23 +0100 Subject: [PATCH 23/23] Fix spelling mistake. Thanks for pointing that out. Co-Authored-By: ZhilkinSerg --- src/color_loader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/color_loader.h b/src/color_loader.h index cbc396092edf9..9099f6b9ab59e 100644 --- a/src/color_loader.h +++ b/src/color_loader.h @@ -71,7 +71,7 @@ class color_loader try { load_colorfile( custom_path ); } catch( const JsonError &err ) { - debgmsg( "Failed to load color data from \"%s\": %s", custom_path, err.what() ); + debugmsg( "Failed to load color data from \"%s\": %s", custom_path, err.what() ); // this should succeed, otherwise the installation is botched load_colorfile( default_path );