Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix loading of inline EoCs, enchantments, and allow recipe_categories to extend #74514

Merged
merged 8 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions build-scripts/get_all_mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
mods_this_time = []

exclusions = [
# #74443 - incompatibility between mindovermatter and aftershock due to bug
('mindovermatter', 'aftershock')
# Tuple of (mod_id, mod_id) - these two mods will be incompatible
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@
"case": 7,
"effect": {
"run_eocs": [
{ "id": "EOC_PORTAL_DUNGEON_REWARD_ITEM" },
"EOC_PORTAL_DUNGEON_REWARD_ITEM",
{
"id": "EOC_PORTAL_DEPENDENT_DUNGEON_FINAL",
"condition": { "u_has_trait": "PORTAL_DEPENDENT" },
Expand Down
4 changes: 1 addition & 3 deletions data/json/npcs/missiondef.json
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,7 @@
"end": {
"effect": [
"stop_following",
{
"weighted_list_eocs": [ [ { "id": "get_katana" }, 5 ], [ { "id": "get_deagle_44" }, 10 ], [ { "id": "get_m4_carbine" }, 6 ] ]
}
{ "weighted_list_eocs": [ [ "get_katana", 5 ], [ "get_deagle_44", 10 ], [ "get_m4_carbine", 6 ] ] }
]
},
"origins": [ "ORIGIN_SECONDARY" ],
Expand Down
3 changes: 3 additions & 0 deletions data/json/recipes/recipes.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"type": "recipe_category",
"id": "CC_*",
"//": "This is just a dummy category. No recipes should be added in here.",
"is_wildcard": true,
"recipe_subcategories": [ "CSC_*_FAVORITE", "CSC_*_RECENT", "CSC_*_HIDDEN", "CSC_*_NESTED" ]
},
{
Expand Down Expand Up @@ -125,11 +126,13 @@
"type": "recipe_category",
"id": "CC_BUILDING",
"recipe_subcategories": [ "CSC_ALL", "CSC_BUILDING_BASES", "CSC_BUILDING_EXPANSIONS" ],
"is_building": true,
"is_hidden": true
},
{
"type": "recipe_category",
"id": "CC_PRACTICE",
"is_practice": true,
"recipe_subcategories": [
"CSC_ALL",
"CSC_PRACTICE_SCIENCE",
Expand Down
5 changes: 0 additions & 5 deletions data/mods/Aftershock/effects_on_condition.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@
{ "u_teleport": { "global_val": "new_map" }, "force": true }
]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_ESCAPE_POD_CARGO_TP",
"effect": [ { "u_teleport": { "global_val": "new_map" }, "force": true } ]
},
{
"type": "effect_on_condition",
"id": "EOC_CRASHING_SHIP_SETUP",
Expand Down
31 changes: 4 additions & 27 deletions data/mods/Aftershock/recipes/recipes_categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,13 @@
{
"type": "recipe_category",
"id": "CC_ELECTRONIC",
"recipe_subcategories": [
"CSC_ALL",
"CSC_ELECTRONIC_CBMS",
"CSC_ELECTRONIC_TOOLS",
"CSC_ELECTRONIC_PARTS",
"CSC_ELECTRONIC_LIGHTING",
"CSC_ELECTRONIC_COMPONENTS",
"CSC_ELECTRONIC_OTHER"
]
"copy-from": "CC_ELECTRONIC",
"extend": { "recipe_subcategories": [ "CSC_ELECTRONIC_CBMS" ] }
},
{
"type": "recipe_category",
"id": "CC_PRACTICE",
"recipe_subcategories": [
"CSC_ALL",
"CSC_PRACTICE_SCIENCE",
"CSC_PRACTICE_ELECTRONICS",
"CSC_PRACTICE_FABRICATION",
"CSC_PRACTICE_FOOD",
"CSC_PRACTICE_SURVIVAL",
"CSC_PRACTICE_TAILORING",
"CSC_PRACTICE_ATHLETICS",
"CSC_PRACTICE_COMPUTERS",
"CSC_PRACTICE_DEVICES",
"CSC_PRACTICE_HEALTH",
"CSC_PRACTICE_MECHANICS",
"CSC_PRACTICE_SOCIAL",
"CSC_PRACTICE_MELEE",
"CSC_PRACTICE_RANGED",
"CSC_PRACTICE_PSI"
]
"copy-from": "CC_PRACTICE",
"extend": { "recipe_subcategories": [ "CSC_PRACTICE_PSI" ] }
}
]
12 changes: 2 additions & 10 deletions data/mods/DinoMod/recipes/recipes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@
{
"type": "recipe_category",
"id": "CC_ANIMALS",
"recipe_subcategories": [
"CSC_ALL",
"CSC_ANIMALS_BOVINE ARMOR",
"CSC_ANIMALS_CANINE ARMOR",
"CSC_ANIMALS_EQUINE ARMOR",
"CSC_ANIMALS_ELEPHANT ARMOR",
"CSC_ANIMALS_OSTRICH ARMOR",
"CSC_ANIMALS_BEAR ARMOR",
"CSC_ANIMALS_EQUINE STORAGE"
]
"copy-from": "CC_ANIMALS",
"extend": { "recipe_subcategories": [ "CSC_ANIMALS_ELEPHANT ARMOR", "CSC_ANIMALS_OSTRICH ARMOR", "CSC_ANIMALS_BEAR ARMOR" ] }
}
]
20 changes: 2 additions & 18 deletions data/mods/MindOverMatter/recipes/psionics_practice.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,8 @@
{
"type": "recipe_category",
"id": "CC_PRACTICE",
"recipe_subcategories": [
"CSC_ALL",
"CSC_PRACTICE_SCIENCE",
"CSC_PRACTICE_ELECTRONICS",
"CSC_PRACTICE_FABRICATION",
"CSC_PRACTICE_FOOD",
"CSC_PRACTICE_SURVIVAL",
"CSC_PRACTICE_TAILORING",
"CSC_PRACTICE_ATHLETICS",
"CSC_PRACTICE_COMPUTERS",
"CSC_PRACTICE_DEVICES",
"CSC_PRACTICE_HEALTH",
"CSC_PRACTICE_MECHANICS",
"CSC_PRACTICE_SOCIAL",
"CSC_PRACTICE_MELEE",
"CSC_PRACTICE_RANGED",
"CSC_PRACTICE_METAPHYSICS"
]
"copy-from": "CC_PRACTICE",
"extend": { "recipe_subcategories": [ "CSC_PRACTICE_METAPHYSICS" ] }
},
{
"id": "prac_psionics_begin",
Expand Down
3 changes: 2 additions & 1 deletion src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "contents_change_handler.h"
#include "coordinates.h"
#include "craft_command.h"
#include "crafting_gui.h"
#include "creature.h"
#include "creature_tracker.h"
#include "debug.h"
Expand Down Expand Up @@ -3768,7 +3769,7 @@ void craft_activity_actor::canceled( player_activity &/*act*/, Character &/*who*
}
const recipe item_recipe = craft->get_making();
// practice recipe items with no components can be safely removed
if( item_recipe.category == "CC_PRACTICE" && craft->components.empty() ) {
if( item_recipe.category->is_practice && craft->components.empty() ) {
craft_item.remove_item();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/crafting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static bool crafting_allowed( const Character &p, const recipe &rec )
return false;
}

if( rec.category == "CC_BUILDING" ) {
if( rec.category->is_building ) {
add_msg( m_info, _( "Overmap terrain building recipes are not implemented yet!" ) );
return false;
}
Expand Down
Loading
Loading