Skip to content

Commit

Permalink
Simulate hair growth (CleverRaven#70080)
Browse files Browse the repository at this point in the history
* Initial commit

* WIP part 2

* WIP Part 3

* Edit NPC's to accomodate changes

* Make red and white natural hair colors

* Note for future me.

* Add beard growth tracking

* Spellchecking

* Edit trait groups with new traits

* Set up on-start trait randomizations

* Bugfix 1

* Bugfix 2, keep natural color from constantly changing

* No growth trait, let Vanessa Toby toggle it for you.
  • Loading branch information
MNG-cataclysm authored Dec 16, 2023
1 parent 76827a1 commit 24e9f9e
Show file tree
Hide file tree
Showing 15 changed files with 627 additions and 820 deletions.
293 changes: 293 additions & 0 deletions data/json/effects_on_condition/npc_eocs/appearance_eocs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,293 @@
[
{
"type": "effect_on_condition",
"id": "EOC_hair_growth_tracking",
"//": "Hair usually grows at a rate of 1 cm per month. This is not a hard number, because hair growth is very complex.",
"//2": "For the purposes of this EOC right now, we'll assume this rate.",
"//3": "For ease of calculation, all math will be done with centimeters for hair growth.",
"//4": "For reference starting point, a buzzcut is 0.32 centimeters long.",
"//5": "1 inch is 2.54 centimeters.",
"recurrence": [ "75 days", "90 days" ],
"global": false,
"condition": { "not": { "u_has_trait": "no_hair_growth" } },
"effect": [
{
"if": { "u_has_trait": "hair_buzzcut" },
"then": [ { "u_lose_trait": "hair_buzzcut" }, { "u_add_trait": "hair_crewcut" } ],
"else": {
"if": { "u_has_trait": "hair_crewcut" },
"then": [ { "u_lose_trait": "hair_crewcut" }, { "u_add_trait": "hair_short" } ],
"else": {
"if": {
"or": [ { "u_has_trait": "hair_short" }, { "u_has_trait": "hair_short_no_fringe" }, { "u_has_trait": "hair_short_over_eye" } ]
},
"then": [
{ "u_lose_trait": "hair_short" },
{ "u_lose_trait": "hair_short_no_fringe" },
{ "u_lose_trait": "hair_short_over_eye" },
{ "u_add_trait": "hair_medium" }
],
"else": {
"if": { "or": [ { "u_has_trait": "hair_medium" } ] },
"then": [ { "u_lose_trait": "hair_medium" }, { "u_add_trait": "hair_long" } ],
"else": {
"if": { "u_has_trait": "hair_mohawk" },
"then": [ { "u_lose_trait": "hair_mohawk" }, { "u_add_trait": "hair_long_mohawk" } ],
"else": {
"if": {
"or": [
{ "u_has_trait": "hair_long" },
{ "u_has_trait": "hair_long_mohawk" },
{ "u_has_trait": "hair_mullet" },
{ "u_has_trait": "hair_long_over_eye" }
]
},
"then": [
{ "u_lose_trait": "hair_long" },
{ "u_lose_trait": "hair_mullet" },
{ "u_lose_trait": "hair_long_over_eye" },
{ "u_lose_trait": "hair_long_mohawk" },
{ "u_add_trait": "hair_messy" }
],
"else": {
"if": { "or": [ { "u_has_trait": "hair_messy" } ] },
"then": [ { "u_lose_trait": "hair_messy" }, { "u_add_trait": "hair_very_long" } ],
"else": {
"if": { "or": [ { "u_has_trait": "hair_very_long" } ] },
"then": [ { "u_lose_trait": "hair_very_long" }, { "u_add_trait": "hair_extremely_long" } ],
"else": {
"if": { "or": [ { "u_has_trait": "hair_extremely_long" } ] },
"then": [ { "u_lose_trait": "hair_extremely_long" }, { "u_add_trait": "hair_body_length" } ]
}
}
}
}
}
}
}
}
},
{ "run_eocs": "reset_hair_dye_color" }
]
},
{
"type": "effect_on_condition",
"id": "EOC_beard_growth_tracking",
"//": "Use the same notes as hair growth. However, facial hair grows faster than head hair, averaging 1.25 inches per month.",
"recurrence": [ "4 days", "7 days" ],
"global": false,
"condition": { "not": { "u_has_trait": "no_hair_growth" } },
"effect": [
{
"if": { "u_has_trait": "FACIAL_HAIR_NONE" },
"then": [ { "u_lose_trait": "FACIAL_HAIR_NONE" }, { "u_add_trait": "FACIAL_HAIR_NECKBEARD" } ],
"else": {
"if": {
"or": [
{ "u_has_trait": "FACIAL_HAIR_NECKBEARD" },
{ "u_has_trait": "FACIAL_HAIR_SIDEBURNS" },
{ "u_has_trait": "FACIAL_HAIR_SOUL_PATCH" },
{ "u_has_trait": "FACIAL_HAIR_CHIN_STRIP" }
]
},
"then": [
{ "u_lose_trait": "FACIAL_HAIR_NECKBEARD" },
{ "u_lose_trait": "FACIAL_HAIR_SIDEBURNS" },
{ "u_lose_trait": "FACIAL_HAIR_SOUL_PATCH" },
{ "u_lose_trait": "FACIAL_HAIR_CHIN_STRIP" },
{ "u_add_trait": "FACIAL_HAIR_3DAYSTUBBLE" }
],
"else": {
"if": {
"or": [
{ "u_has_trait": "FACIAL_HAIR_3DAYSTUBBLE" },
{ "u_has_trait": "FACIAL_HAIR_TOOTHBRUSH" },
{ "u_has_trait": "FACIAL_HAIR_CHIN_STRAP" },
{ "u_has_trait": "FACIAL_HAIR_MUSTACHE" },
{ "u_has_trait": "FACIAL_HAIR_NECKBEARD" },
{ "u_has_trait": "FACIAL_HAIR_WALRUS" },
{ "u_has_trait": "FACIAL_HAIR_ZAPPA" }
]
},
"then": [
{ "u_lose_trait": "FACIAL_HAIR_3DAYSTUBBLE" },
{ "u_lose_trait": "FACIAL_HAIR_TOOTHBRUSH" },
{ "u_lose_trait": "FACIAL_HAIR_CHIN_STRAP" },
{ "u_lose_trait": "FACIAL_HAIR_MUSTACHE" },
{ "u_lose_trait": "FACIAL_HAIR_NECKBEARD" },
{ "u_lose_trait": "FACIAL_HAIR_WALRUS" },
{ "u_lose_trait": "FACIAL_HAIR_ZAPPA" },
{ "u_add_trait": "FACIAL_HAIR_GOATEE" }
],
"else": {
"if": {
"or": [
{ "u_has_trait": "FACIAL_HAIR_GOATEE" },
{ "u_has_trait": "FACIAL_HAIR_CIRCLE" },
{ "u_has_trait": "FACIAL_HAIR_SHORTBOXED" },
{ "u_has_trait": "FACIAL_HAIR_HORSESHOE" },
{ "u_has_trait": "FACIAL_HAIR_MUTTONCHOPS" },
{ "u_has_trait": "FACIAL_HAIR_GUNSLINGER" },
{ "u_has_trait": "FACIAL_HAIR_CHIN_CURTAIN" },
{ "u_has_trait": "FACIAL_HAIR_HANDLEBAR" },
{ "u_has_trait": "FACIAL_HAIR_VANDYKE" }
]
},
"then": [
{ "u_lose_trait": "FACIAL_HAIR_GOATEE" },
{ "u_lose_trait": "FACIAL_HAIR_CIRCLE" },
{ "u_lose_trait": "FACIAL_HAIR_SHORTBOXED" },
{ "u_lose_trait": "FACIAL_HAIR_HORSESHOE" },
{ "u_lose_trait": "FACIAL_HAIR_MUTTONCHOPS" },
{ "u_lose_trait": "FACIAL_HAIR_GUNSLINGER" },
{ "u_lose_trait": "FACIAL_HAIR_CHIN_CURTAIN" },
{ "u_lose_trait": "FACIAL_HAIR_HANDLEBAR" },
{ "u_lose_trait": "FACIAL_HAIR_VANDYKE" },
{ "u_add_trait": "FACIAL_HAIR_BEARD" }
],
"else": {
"if": {
"or": [
{ "u_has_trait": "FACIAL_HAIR_BEARD" },
{ "u_has_trait": "FACIAL_HAIR_ANCHOR" },
{ "u_has_trait": "FACIAL_HAIR_ROYALE" }
]
},
"then": [
{ "u_lose_trait": "FACIAL_HAIR_BEARD" },
{ "u_lose_trait": "FACIAL_HAIR_ANCHOR" },
{ "u_lose_trait": "FACIAL_HAIR_ROYALE" },
{ "u_add_trait": "FACIAL_HAIR_SHENANDOAH" }
],
"else": {
"if": { "or": [ { "u_has_trait": "FACIAL_HAIR_SHENANDOAH" } ] },
"then": [ { "u_lose_trait": "FACIAL_HAIR_SHENANDOAH" }, { "u_add_trait": "FACIAL_HAIR_BEARD_LONG" } ],
"else": {
"if": { "or": [ { "u_has_trait": "FACIAL_HAIR_BEARD_LONG" } ] },
"then": [ { "u_lose_trait": "FACIAL_HAIR_BEARD_LONG" }, { "u_add_trait": "FACIAL_HAIR_BEARD_VERY_LONG" } ]
}
}
}
}
}
}
}
]
},
{
"type": "effect_on_condition",
"id": "reset_hair_dye_color",
"effect": {
"if": { "u_has_var": "natural_hair_color_black", "type": "mutation", "context": "hair_color", "value": "yes" },
"then": [ { "run_eocs": "remove_all_hair_color" }, { "u_add_trait": "hair_color_black" } ],
"else": {
"if": { "u_has_var": "natural_hair_color_blond", "type": "mutation", "context": "hair_color", "value": "yes" },
"then": [ { "run_eocs": "remove_all_hair_color" }, { "u_add_trait": "hair_color_blond" } ],
"else": {
"if": { "u_has_var": "natural_hair_color_brown", "type": "mutation", "context": "hair_color", "value": "yes" },
"then": [ { "run_eocs": "remove_all_hair_color" }, { "u_add_trait": "hair_color_brown" } ],
"else": {
"if": { "u_has_var": "natural_hair_color_gray", "type": "mutation", "context": "hair_color", "value": "yes" },
"then": [ { "run_eocs": "remove_all_hair_color" }, { "u_add_trait": "hair_color_gray" } ],
"else": {
"if": { "u_has_var": "natural_hair_color_red", "type": "mutation", "context": "hair_color", "value": "yes" },
"then": [ { "run_eocs": "remove_all_hair_color" }, { "u_add_trait": "hair_color_red" } ],
"else": {
"if": { "u_has_var": "natural_hair_color_white", "type": "mutation", "context": "hair_color", "value": "yes" },
"then": [ { "run_eocs": "remove_all_hair_color" }, { "u_add_trait": "hair_color_white" } ],
"else": { "run_eocs": "assign_random_natural_hair_color" }
}
}
}
}
}
}
},
{
"type": "effect_on_condition",
"id": "remove_all_hair_color",
"effect": [
{ "u_lose_trait": "hair_color_black" },
{ "u_lose_trait": "hair_color_blond" },
{ "u_lose_trait": "hair_color_blue" },
{ "u_lose_trait": "hair_color_brown" },
{ "u_lose_trait": "hair_color_gray" },
{ "u_lose_trait": "hair_color_green" },
{ "u_lose_trait": "hair_color_pink" },
{ "u_lose_trait": "hair_color_purple" },
{ "u_lose_trait": "hair_color_red" },
{ "u_lose_trait": "hair_color_white" }
]
},
{
"type": "effect_on_condition",
"id": "assign_random_natural_hair_color",
"effect": [
{
"weighted_list_eocs": [
[ { "id": "black_hair", "effect": { "u_add_trait": "hair_color_black" } }, { "const": 1 } ],
[ { "id": "blond_hair", "effect": { "u_add_trait": "hair_color_blond" } }, { "const": 1 } ],
[ { "id": "brown_hair", "effect": { "u_add_trait": "hair_color_brown" } }, { "const": 1 } ],
[ { "id": "gray_hair", "effect": { "u_add_trait": "hair_color_gray" } }, { "const": 1 } ],
[ { "id": "white_hair", "effect": { "u_add_trait": "hair_color_gray" } }, { "const": 1 } ],
[ { "id": "red_hair", "effect": { "u_add_trait": "hair_color_gray" } }, { "const": 1 } ]
]
},
{ "run_eocs": "reset_hair_dye_color" }
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_black",
"condition": { "not": { "u_has_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" } },
"effect": [
{ "u_add_var": "natural_hair_color_black", "type": "mutation", "context": "hair_color", "value": "yes" },
{ "u_add_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" }
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_blond",
"condition": { "not": { "u_has_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" } },
"effect": [
{ "u_add_var": "natural_hair_color_blond", "type": "mutation", "context": "hair_color", "value": "yes" },
{ "u_add_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" }
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_brown",
"condition": { "not": { "u_has_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" } },
"effect": [
{ "u_add_var": "natural_hair_color_brown", "type": "mutation", "context": "hair_color", "value": "yes" },
{ "u_add_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" }
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_gray",
"condition": { "not": { "u_has_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" } },
"effect": [
{ "u_add_var": "natural_hair_color_gray", "type": "mutation", "context": "hair_color", "value": "yes" },
{ "u_add_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" }
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_white",
"condition": { "not": { "u_has_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" } },
"effect": [
{ "u_add_var": "natural_hair_color_white", "type": "mutation", "context": "hair_color", "value": "yes" },
{ "u_add_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" }
]
},
{
"type": "effect_on_condition",
"id": "natural_hair_color_red",
"condition": { "not": { "u_has_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" } },
"effect": [
{ "u_add_var": "natural_hair_color_red", "type": "mutation", "context": "hair_color", "value": "yes" },
{ "u_add_var": "picked_hair_color", "type": "mutation", "context": "hair_color", "value": "yes" }
]
}
]
Loading

0 comments on commit 24e9f9e

Please sign in to comment.