Skip to content

Commit

Permalink
[Bombastic Perks] Add overwriting perkchain support (#71898)
Browse files Browse the repository at this point in the history
* Add support for chains

* Add additional +1 perks

* Replace other u_add_trait with u_mutate_towards

* Fixes

* Make later perks visible as per documentation
  • Loading branch information
Standing-Storm authored Feb 23, 2024
1 parent 990012b commit b8a364a
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 10 deletions.
92 changes: 82 additions & 10 deletions data/mods/BombasticPerks/perkmenu.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dynamic_line": "Lifestyle Perks:\nLevel <u_val:current_level>.\n<u_val:num_perks> perk points to spend.\nCurrent EXP: <u_val:available_exp>.\nEXP to next level: <u_val:exp_to_perk>.",
"responses": [
{
"condition": { "not": { "u_has_trait": "perk_STR_UP" } },
"condition": { "and": [ { "not": { "u_has_trait": "perk_STR_UP" } }, { "not": { "u_has_trait": "perk_STR_UP_2" } } ] },
"text": "Gain [<trait_name:perk_STR_UP>]",
"effect": [
{ "set_string_var": "<trait_name:perk_STR_UP>", "target_var": { "context_val": "trait_name" } },
Expand All @@ -19,12 +19,30 @@
"target_var": { "context_val": "trait_requirement_description" },
"i18n": true
},
{ "set_condition": "perk_condition", "condition": { "math": [ "0", "==", "0" ] } }
{ "set_condition": "perk_condition", "condition": { "not": { "u_has_trait": "perk_STR_UP_2" } } }
],
"topic": "TALK_PERK_MENU_SELECT"
},
{
"condition": { "not": { "u_has_trait": "perk_STR_UP_2" } },
"text": "Gain [<trait_name:perk_STR_UP_2>]",
"effect": [
{ "set_string_var": "<trait_name:perk_STR_UP_2>", "target_var": { "context_val": "trait_name" } },
{
"set_string_var": "<trait_description:perk_STR_UP_2>",
"target_var": { "context_val": "trait_description" }
},
{ "set_string_var": "perk_STR_UP_2", "target_var": { "context_val": "trait_id" } },
{
"set_string_var": "Must have the Stronger perk.",
"target_var": { "context_val": "trait_requirement_description" }
},
{ "set_condition": "perk_condition", "condition": { "u_has_trait": "perk_STR_UP" } }
],
"topic": "TALK_PERK_MENU_SELECT"
},
{
"condition": { "not": { "u_has_trait": "perk_DEX_UP" } },
"condition": { "and": [ { "not": { "u_has_trait": "perk_DEX_UP" } }, { "not": { "u_has_trait": "perk_DEX_UP_2" } } ] },
"text": "Gain [<trait_name:perk_DEX_UP>]",
"effect": [
{ "set_string_var": "<trait_name:perk_DEX_UP>", "target_var": { "context_val": "trait_name" } },
Expand All @@ -38,12 +56,30 @@
"target_var": { "context_val": "trait_requirement_description" },
"i18n": true
},
{ "set_condition": "perk_condition", "condition": { "math": [ "0", "==", "0" ] } }
{ "set_condition": "perk_condition", "condition": { "not": { "u_has_trait": "perk_DEX_UP_2" } } }
],
"topic": "TALK_PERK_MENU_SELECT"
},
{
"condition": { "not": { "u_has_trait": "perk_DEX_UP_2" } },
"text": "Gain [<trait_name:perk_DEX_UP_2>]",
"effect": [
{ "set_string_var": "<trait_name:perk_DEX_UP_2>", "target_var": { "context_val": "trait_name" } },
{
"set_string_var": "<trait_description:perk_DEX_UP_2>",
"target_var": { "context_val": "trait_description" }
},
{ "set_string_var": "perk_DEX_UP_2", "target_var": { "context_val": "trait_id" } },
{
"set_string_var": "Must have the Faster perk",
"target_var": { "context_val": "trait_requirement_description" }
},
{ "set_condition": "perk_condition", "condition": { "u_has_trait": "perk_DEX_UP" } }
],
"topic": "TALK_PERK_MENU_SELECT"
},
{
"condition": { "not": { "u_has_trait": "perk_INT_UP" } },
"condition": { "and": [ { "not": { "u_has_trait": "perk_INT_UP" } }, { "not": { "u_has_trait": "perk_INT_UP_2" } } ] },
"text": "Gain [<trait_name:perk_INT_UP>]",
"effect": [
{ "set_string_var": "<trait_name:perk_INT_UP>", "target_var": { "context_val": "trait_name" } },
Expand All @@ -57,12 +93,30 @@
"target_var": { "context_val": "trait_requirement_description" },
"i18n": true
},
{ "set_condition": "perk_condition", "condition": { "math": [ "0", "==", "0" ] } }
{ "set_condition": "perk_condition", "condition": { "not": { "u_has_trait": "perk_INT_UP_2" } } }
],
"topic": "TALK_PERK_MENU_SELECT"
},
{
"condition": { "not": { "u_has_trait": "perk_INT_UP_2" } },
"text": "Gain [<trait_name:perk_INT_UP_2>]",
"effect": [
{ "set_string_var": "<trait_name:perk_INT_UP_2>", "target_var": { "context_val": "trait_name" } },
{
"set_string_var": "<trait_description:perk_INT_UP_2>",
"target_var": { "context_val": "trait_description" }
},
{ "set_string_var": "perk_INT_UP_2", "target_var": { "context_val": "trait_id" } },
{
"set_string_var": "Must have the Smarter perk",
"target_var": { "context_val": "trait_requirement_description" }
},
{ "set_condition": "perk_condition", "condition": { "u_has_trait": "perk_INT_UP" } }
],
"topic": "TALK_PERK_MENU_SELECT"
},
{
"condition": { "not": { "u_has_trait": "perk_PER_UP" } },
"condition": { "and": [ { "not": { "u_has_trait": "perk_PER_UP" } }, { "not": { "u_has_trait": "perk_PER_UP_2" } } ] },
"text": "Gain [<trait_name:perk_PER_UP>]",
"effect": [
{ "set_string_var": "<trait_name:perk_PER_UP>", "target_var": { "context_val": "trait_name" } },
Expand All @@ -76,7 +130,25 @@
"target_var": { "context_val": "trait_requirement_description" },
"i18n": true
},
{ "set_condition": "perk_condition", "condition": { "math": [ "0", "==", "0" ] } }
{ "set_condition": "perk_condition", "condition": { "not": { "u_has_trait": "perk_PER_UP_2" } } }
],
"topic": "TALK_PERK_MENU_SELECT"
},
{
"condition": { "not": { "u_has_trait": "perk_PER_UP_2" } },
"text": "Gain [<trait_name:perk_PER_UP_2>]",
"effect": [
{ "set_string_var": "<trait_name:perk_PER_UP_2>", "target_var": { "context_val": "trait_name" } },
{
"set_string_var": "<trait_description:perk_PER_UP_2>",
"target_var": { "context_val": "trait_description" }
},
{ "set_string_var": "perk_PER_UP_2", "target_var": { "context_val": "trait_id" } },
{
"set_string_var": "Must have the Sharper perk",
"target_var": { "context_val": "trait_requirement_description" }
},
{ "set_condition": "perk_condition", "condition": { "u_has_trait": "perk_PER_UP" } }
],
"topic": "TALK_PERK_MENU_SELECT"
},
Expand Down Expand Up @@ -991,7 +1063,7 @@
},
"failure_explanation": "Requirements Not Met",
"failure_topic": "TALK_PERK_MENU_FAIL",
"effect": [ { "u_add_trait": { "context_val": "trait_id" } }, { "math": [ "u_num_perks", "--" ] } ]
"effect": [ { "u_mutate_towards": { "context_val": "trait_id" } }, { "math": [ "u_num_perks", "--" ] } ]
},
{
"text": "Go Back.",
Expand All @@ -1017,7 +1089,7 @@
},
"failure_explanation": "Requirements Not Met",
"failure_topic": "TALK_PERK_MENU_FAIL",
"effect": [ { "u_add_trait": { "context_val": "trait_id" } }, { "math": [ "u_num_perks", "-=", "u_playstyle_cost + 1" ] } ]
"effect": [ { "u_mutate_towards": { "context_val": "trait_id" } }, { "math": [ "u_num_perks", "-=", "u_playstyle_cost + 1" ] } ]
},
{
"text": "Go Back.",
Expand Down
44 changes: 44 additions & 0 deletions data/mods/BombasticPerks/perks.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,80 @@
"name": { "str": "Stronger" },
"points": 0,
"description": "Have you been working out? +1 Strength.",
"changes_to": [ "perk_STR_UP_2" ],
"category": [ "perk" ],
"enchantments": [ { "condition": "ALWAYS", "values": [ { "value": "STRENGTH", "add": 1 } ] } ]
},
{
"type": "mutation",
"id": "perk_STR_UP_2",
"name": { "str": "Even Stronger" },
"points": 0,
"description": "You HAVE been working out. +2 Strength.",
"prereqs": [ "perk_STR_UP" ],
"category": [ "perk" ],
"enchantments": [ { "condition": "ALWAYS", "values": [ { "value": "STRENGTH", "add": 2 } ] } ]
},
{
"type": "mutation",
"id": "perk_DEX_UP",
"name": { "str": "Faster" },
"points": 0,
"description": "Have you been doing cardio? +1 Dexterity.",
"changes_to": [ "perk_DEX_UP_2" ],
"category": [ "perk" ],
"enchantments": [ { "condition": "ALWAYS", "values": [ { "value": "DEXTERITY", "add": 1 } ] } ]
},
{
"type": "mutation",
"id": "perk_DEX_UP_2",
"name": { "str": "Even Faster" },
"points": 0,
"description": "You HAVE been doing cardio. +2 Dexterity.",
"prereqs": [ "perk_DEX_UP" ],
"category": [ "perk" ],
"enchantments": [ { "condition": "ALWAYS", "values": [ { "value": "DEXTERITY", "add": 2 } ] } ]
},
{
"type": "mutation",
"id": "perk_INT_UP",
"name": { "str": "Smarter" },
"points": 0,
"description": "Have you been reading? +1 Intelligence.",
"changes_to": [ "perk_INT_UP_2" ],
"category": [ "perk" ],
"enchantments": [ { "condition": "ALWAYS", "values": [ { "value": "INTELLIGENCE", "add": 1 } ] } ]
},
{
"type": "mutation",
"id": "perk_INT_UP_2",
"name": { "str": "Even Smarter" },
"points": 0,
"description": "You HAVE been reading. +2 Intelligence.",
"prereqs": [ "perk_INT_UP" ],
"category": [ "perk" ],
"enchantments": [ { "condition": "ALWAYS", "values": [ { "value": "INTELLIGENCE", "add": 2 } ] } ]
},
{
"type": "mutation",
"id": "perk_PER_UP",
"name": { "str": "Sharper" },
"points": 0,
"description": "Have you been staring out into the middle distance? +1 Perception.",
"changes_to": [ "perk_PER_UP_2" ],
"category": [ "perk" ],
"enchantments": [ { "condition": "ALWAYS", "values": [ { "value": "PERCEPTION", "add": 1 } ] } ]
},
{
"type": "mutation",
"id": "perk_PER_UP_2",
"name": { "str": "Even Sharper" },
"points": 0,
"description": "You HAVE been staring out into the middle distance. +2 Perception.",
"prereqs": [ "perk_PER_UP" ],
"category": [ "perk" ],
"enchantments": [ { "condition": "ALWAYS", "values": [ { "value": "PERCEPTION", "add": 2 } ] } ]
},
{
"type": "mutation",
"id": "perk_holdout_pocket",
Expand Down

0 comments on commit b8a364a

Please sign in to comment.