Skip to content

Commit

Permalink
Fix haircutting (#76106)
Browse files Browse the repository at this point in the history
* simplify random assignment of natural hair color

* Remove processed_eocs of natural hair color

* Add missing hair styles to be reset

* Remove duplicated entry of mullet
  • Loading branch information
cknight828 authored Sep 5, 2024
1 parent 365395d commit 5fca27f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 91 deletions.
5 changes: 4 additions & 1 deletion data/json/effects_on_condition/item_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@
{ "u_lose_trait": "hair_braid" },
{ "u_lose_trait": "hair_detective" },
{ "u_lose_trait": "hair_super_princess" },
{ "u_lose_trait": "hair_twintails" }
{ "u_lose_trait": "hair_twintails" },
{ "u_lose_trait": "hair_bald" },
{ "u_lose_trait": "hair_fro" },
{ "u_lose_trait": "hair_ponytail" }
]
},
{
Expand Down
84 changes: 16 additions & 68 deletions data/json/effects_on_condition/npc_eocs/appearance_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,22 @@
"effect": [
{ "run_eocs": "assign_random_natural_hair_color" },
{
"if": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_black" } ] },
"if": { "u_has_trait": "natural_hair_color_black" },
"then": [ { "u_add_trait": { "context_val": "trait_id" }, "variant": "black" } ],
"else": {
"if": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_blond" } ] },
"if": { "u_has_trait": "natural_hair_color_blond" },
"then": [ { "u_add_trait": { "context_val": "trait_id" }, "variant": "blond" } ],
"else": {
"if": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_brown" } ] },
"if": { "u_has_trait": "natural_hair_color_brown" },
"then": [ { "u_add_trait": { "context_val": "trait_id" }, "variant": "brown" } ],
"else": {
"if": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_gray" } ] },
"if": { "u_has_trait": "natural_hair_color_gray" },
"then": [ { "u_add_trait": { "context_val": "trait_id" }, "variant": "gray" } ],
"else": {
"if": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_red" } ] },
"if": { "u_has_trait": "natural_hair_color_red" },
"then": [ { "u_add_trait": { "context_val": "trait_id" }, "variant": "red" } ],
"else": {
"if": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_white" } ] },
"if": { "u_has_trait": "natural_hair_color_white" },
"then": [ { "u_add_trait": { "context_val": "trait_id" }, "variant": "white" } ]
}
}
Expand Down Expand Up @@ -392,14 +392,16 @@
"type": "effect_on_condition",
"id": "assign_random_natural_hair_color",
"condition": {
"and": [
{ "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_black" } ] } },
{ "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_blond" } ] } },
{ "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_brown" } ] } },
{ "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_gray" } ] } },
{ "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_red" } ] } },
{ "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_natural_hair_color_white" } ] } }
]
"not": {
"u_has_any_trait": [
"natural_hair_color_black",
"natural_hair_color_blond",
"natural_hair_color_brown",
"natural_hair_color_gray",
"natural_hair_color_red",
"natural_hair_color_white"
]
}
},
"effect": [
{
Expand All @@ -414,60 +416,6 @@
}
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_black",
"condition": { "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_picked_hair_color" } ] } },
"effect": [
{ "u_add_var": "mutation_hair_color_natural_hair_color_black", "value": "yes" },
{ "u_add_var": "mutation_hair_color_picked_hair_color", "value": "yes" }
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_blond",
"condition": { "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_picked_hair_color" } ] } },
"effect": [
{ "u_add_var": "mutation_hair_color_natural_hair_color_blond", "value": "yes" },
{ "u_add_var": "mutation_hair_color_picked_hair_color", "value": "yes" }
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_brown",
"condition": { "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_picked_hair_color" } ] } },
"effect": [
{ "u_add_var": "mutation_hair_color_natural_hair_color_brown", "value": "yes" },
{ "u_add_var": "mutation_hair_color_picked_hair_color", "value": "yes" }
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_gray",
"condition": { "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_picked_hair_color" } ] } },
"effect": [
{ "u_add_var": "mutation_hair_color_natural_hair_color_gray", "value": "yes" },
{ "u_add_var": "mutation_hair_color_picked_hair_color", "value": "yes" }
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_white",
"condition": { "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_picked_hair_color" } ] } },
"effect": [
{ "u_add_var": "mutation_hair_color_natural_hair_color_white", "value": "yes" },
{ "u_add_var": "mutation_hair_color_picked_hair_color", "value": "yes" }
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_red",
"condition": { "not": { "compare_string": [ "yes", { "u_val": "mutation_hair_color_picked_hair_color" } ] } },
"effect": [
{ "u_add_var": "mutation_hair_color_natural_hair_color_red", "value": "yes" },
{ "u_add_var": "mutation_hair_color_picked_hair_color", "value": "yes" }
]
},
{
"type": "effect_on_condition",
"id": "black_hair_dye",
Expand Down
6 changes: 0 additions & 6 deletions data/json/mutations/appearance_hair_styles.json
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,6 @@
"purifiable": false,
"player_display": false,
"vanity": true,
"processed_eocs": [ "natural_hair_color_black" ],
"types": [ "hair_color" ]
},
{
Expand All @@ -1891,7 +1890,6 @@
"purifiable": false,
"player_display": false,
"vanity": true,
"processed_eocs": [ "natural_hair_color_blond" ],
"types": [ "hair_color" ]
},
{
Expand All @@ -1905,7 +1903,6 @@
"purifiable": false,
"player_display": false,
"vanity": true,
"processed_eocs": [ "natural_hair_color_brown" ],
"types": [ "hair_color" ]
},
{
Expand All @@ -1919,7 +1916,6 @@
"purifiable": false,
"player_display": false,
"vanity": true,
"processed_eocs": [ "natural_hair_color_gray" ],
"types": [ "hair_color" ]
},
{
Expand All @@ -1933,7 +1929,6 @@
"purifiable": false,
"player_display": false,
"vanity": true,
"processed_eocs": [ "natural_hair_color_red" ],
"types": [ "hair_color" ]
},
{
Expand All @@ -1947,7 +1942,6 @@
"purifiable": false,
"player_display": false,
"vanity": true,
"processed_eocs": [ "natural_hair_color_white" ],
"types": [ "hair_color" ]
},
{
Expand Down
16 changes: 0 additions & 16 deletions data/json/npcs/EOC_talkers/haircutting.json
Original file line number Diff line number Diff line change
Expand Up @@ -1144,22 +1144,6 @@
],
"topic": "TALK_DONE"
},
{
"text": "Get a mullet.",
"condition": { "not": { "u_has_trait": "natural_hair_growth" } },
"effect": [
{ "run_eocs": "reset_all_hair_types" },
{
"u_add_morale": "morale_haircut",
"bonus": 3,
"max_bonus": 5,
"duration": "30 minutes",
"decay_start": "30 minutes"
},
{ "run_eoc_with": "reset_natural_hair_color", "variables": { "trait_id": "hair_mullet" } }
],
"topic": "TALK_DONE"
},
{
"text": "Get a bun cut.",
"condition": { "not": { "u_has_trait": "natural_hair_growth" } },
Expand Down

0 comments on commit 5fca27f

Please sign in to comment.