Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
fcc0290
Update monster_drops.json
Maleclypse Jan 15, 2025
3caee0f
Merge branch 'master' of https://github.com/Maleclypse/Cataclysm-DDA
Maleclypse Jan 18, 2025
6aebb20
Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
Maleclypse Feb 1, 2025
d581f04
Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
Maleclypse Feb 5, 2025
fae339b
Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
Maleclypse Mar 21, 2025
89eeb59
Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
Maleclypse May 16, 2025
d21c703
Quick and dirty craft failure explosions
Maleclypse Jun 7, 2025
1d8df85
Update crafting.cpp
Maleclypse Jun 7, 2025
80c50be
Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
Maleclypse Jul 19, 2025
46c095a
Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
Maleclypse Sep 3, 2025
558cbcb
Update mutation.cpp
Maleclypse Aug 28, 2025
ba5a3d5
Update src/mutation.cpp
Maleclypse Aug 28, 2025
025c438
Update src/mutation.cpp
Maleclypse Aug 28, 2025
3fc92a0
Update mutation.cpp
Maleclypse Aug 28, 2025
1d2df46
Update mutation.cpp
Maleclypse Aug 28, 2025
cec7d30
Apply suggestions from code review
Maleclypse Aug 28, 2025
027dbf9
Apply suggestions from code review
Maleclypse Aug 28, 2025
0932044
Update src/mutation.cpp
Maleclypse Aug 30, 2025
1a4253a
Apply suggestions from code review
Maleclypse Aug 30, 2025
d1e3493
items work again
Maleclypse Aug 31, 2025
a0503f0
Fix EOC not respecting mutation type
Maleclypse Aug 31, 2025
99c4d0e
Test
Maleclypse Aug 31, 2025
b3549bb
Update src/npctalk.cpp
Maleclypse Aug 31, 2025
4b83970
Update npctalk.cpp
Maleclypse Aug 31, 2025
dd9274f
Apply suggestions from code review
Maleclypse Aug 31, 2025
d4810f3
Update src/npctalk.cpp
Maleclypse Aug 31, 2025
be1c006
Update src/npctalk.cpp
Maleclypse Aug 31, 2025
7334df3
Update src/npctalk.cpp
Maleclypse Sep 1, 2025
5a261e1
Update iuse_test.cpp
Maleclypse Sep 1, 2025
994421c
Apply suggestions from code review
Maleclypse Sep 3, 2025
9f9f01a
Update iuse_test.cpp
Maleclypse Sep 3, 2025
cf95b79
Merge branch 'Gracken-get-their-crap-working' of https://github.com/M…
Maleclypse Sep 3, 2025
5ca89e1
Update src/mutation.cpp
Maleclypse Sep 3, 2025
5544f1d
Update tests/iuse_test.cpp
Maleclypse Sep 3, 2025
d1ad2ea
Merge branch 'Gracken-get-their-crap-working' of https://github.com/M…
Maleclypse Sep 3, 2025
12b3e13
Apply suggestions from code review
Maleclypse Sep 13, 2025
b7bbdf6
Update npctalk.cpp
Maleclypse Sep 20, 2025
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
113 changes: 86 additions & 27 deletions data/mods/Xedra_Evolved/items/gracken_trait_improvements.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
{
"abstract": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"comestible_type": "INVALID",
"subtypes": [ "TOOL" ],
"category": "MED",
"name": { "str": "abstract gracken improvement", "//~": "NO_I18N" },
"weight": "2041 g",
Expand All @@ -12,17 +11,22 @@
"symbol": "!",
"color": "light_gray",
"price_postapoc": "10 USD",
"flags": [ "NO_INGEST", "EDIBLE_FROZEN" ]
"flags": [ "SINGLE_USE" ]
},
{
"id": "gracken_shade_arms",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Shade Arms" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their arms back to a base state.",
"consumption_effect_on_conditions": [ "shade_arms" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "shade_arms" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -35,11 +39,16 @@
"id": "gracken_strong_arms",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Strong Arms" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their arms to a stronger form.",
"consumption_effect_on_conditions": [ "strong_arms" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "strong_arms" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -52,11 +61,16 @@
"id": "gracken_long_arms",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Long Arms" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their arms to a longer form.",
"consumption_effect_on_conditions": [ "long_arms" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "long_arms" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -69,11 +83,16 @@
"id": "gracken_shade_hands",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Shade Hands" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their hands back to a base state.",
"consumption_effect_on_conditions": [ "shade_hands" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "shade_hands" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -86,11 +105,16 @@
"id": "gracken_sharp_nails",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Sharp Nails" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their hands to a sharper form.",
"consumption_effect_on_conditions": [ "sharp_nails" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "sharp_nails" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -103,11 +127,16 @@
"id": "gracken_dextrous_hands",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Dextrous Hands" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their hands to a more agile form.",
"consumption_effect_on_conditions": [ "dextrous_hands" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "dextrous_hands" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -120,11 +149,16 @@
"id": "gracken_herbivorous_stomach",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Herbivorous Stomach" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their diet to an herbivorous one.",
"consumption_effect_on_conditions": [ "herbivorous_stomach" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "herbivorous_stomach" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -137,11 +171,16 @@
"id": "gracken_omnivorous_stomach",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Dextrous Hands" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their diet to an omnivorous one.",
"consumption_effect_on_conditions": [ "omnivorous_stomach" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "omnivorous_stomach" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -154,11 +193,16 @@
"id": "gracken_carnivorous_stomach",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Dextrous Hands" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their diet to an carnivorous one.",
"consumption_effect_on_conditions": [ "carnivorous_stomach" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "carnivorous_stomach" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -171,11 +215,16 @@
"id": "gracken_shade_legs",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Shade Legs" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their legs back to a base state.",
"consumption_effect_on_conditions": [ "shade_legs" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "shade_legs" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -188,11 +237,16 @@
"id": "gracken_short_legs",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Short Legs" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their legs to a shorter form.",
"consumption_effect_on_conditions": [ "short_legs" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "short_legs" ]
}
},
{
"type": "effect_on_condition",
Expand All @@ -205,11 +259,16 @@
"id": "gracken_long_legs",
"copy-from": "gracken_improvement_general",
"type": "ITEM",
"subtypes": [ "COMESTIBLE" ],
"subtypes": [ "TOOL" ],
"name": { "str_sp": "Gracken Long Legs" },
"looks_like": "offal",
"description": "An organ that allows a mature Gracken to convert their legs to a longer form.",
"consumption_effect_on_conditions": [ "long_legs" ]
"use_action": {
"type": "effect_on_conditions",
"consume": true,
"description": "You graft this organ onto your body replacing whatever was there before.",
"effect_on_conditions": [ "long_legs" ]
}
},
{
"type": "effect_on_condition",
Expand Down
27 changes: 27 additions & 0 deletions src/npctalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3491,6 +3491,33 @@ talk_effect_fun_t::func f_add_trait( const JsonObject &jo, std::string_view memb
const trait_id trait = trait_id( new_trait.evaluate( d ) );
const mutation_variant *variant = trait->variant( new_variant.evaluate( d ) );

Character *guy = d.actor( is_npc )->get_character();
if( !guy ) {
debugmsg( "f_add_trait: No valid character." );
return;
}

const auto &new_types = trait->types;

for( const trait_id &existing : guy->get_mutations() ) {
if( existing == trait ) {
continue;
}
const auto &existing_types = existing->types;
for( const std::string &t : existing_types ) {
bool match = false;
if constexpr( std::is_same_v<decltype( new_types ), const std::set<std::string> &> ) {
match = new_types.count( t ) > 0;
} else {
match = new_types.find( t ) != new_types.end();
}
if( match ) {
guy->unset_mutation( existing );
break;
}
}
}

d.actor( is_npc )->set_mutation( trait, variant );
};
}
Expand Down
Loading