Skip to content

Commit

Permalink
Fix more prosthetic-related issues (CleverRaven#70024)
Browse files Browse the repository at this point in the history
* Round 1 of code

* Hide the effect
  • Loading branch information
MNG-cataclysm authored Dec 7, 2023
1 parent 9880f6b commit 0033431
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 18 deletions.
74 changes: 74 additions & 0 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -4492,5 +4492,79 @@
"show_intensity": true,
"resist_traits": [ "GASTROPOD_BALANCE" ],
"show_in_info": true
},
{
"type": "effect_type",
"id": "prosthetic_leg_l_fake_blocker",
"name": [ "" ],
"desc": [ "" ],
"blocks_effects": [
"bite",
"poison",
"badpoison",
"paralyzepoison",
"frostbite",
"paincysts",
"spores",
"venom_dmg",
"venom_pain",
"venom_weaken"
]
},
{
"type": "effect_type",
"id": "prosthetic_leg_r_fake_blocker",
"name": [ "" ],
"desc": [ "" ],
"blocks_effects": [
"bite",
"poison",
"badpoison",
"paralyzepoison",
"frostbite",
"paincysts",
"spores",
"venom_dmg",
"venom_pain",
"venom_weaken"
]
},
{
"type": "effect_type",
"id": "prosthetic_arm_l_fake_blocker",
"name": [ "" ],
"desc": [ "" ],
"blocks_effects": [
"bite",
"poison",
"badpoison",
"paralyzepoison",
"frostbite",
"paincysts",
"spores",
"shakes",
"venom_dmg",
"venom_pain",
"venom_weaken"
]
},
{
"type": "effect_type",
"id": "prosthetic_arm_r_fake_blocker",
"name": [ "" ],
"desc": [ "" ],
"blocks_effects": [
"bite",
"poison",
"badpoison",
"paralyzepoison",
"frostbite",
"paincysts",
"spores",
"shakes",
"venom_dmg",
"venom_pain",
"venom_weaken"
]
}
]
66 changes: 66 additions & 0 deletions data/json/effects_on_condition/mutation_eocs/prosthetics_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,5 +421,71 @@
{ "u_lose_var": "missing_left_leg", "type": "traits", "context": "limbs" },
{ "u_lose_var": "missing_right_leg", "type": "traits", "context": "limbs" }
]
},
{
"type": "effect_on_condition",
"id": "EOC_PROSTHETIC_EFFECT_BLOCK_SETUP",
"effect": [
{
"if": { "or": [ { "u_has_trait": "RIGHT_PROSTHETIC_LEG" }, { "u_has_trait": "RIGHT_PEG_LEG" } ] },
"then": { "u_add_effect": "prosthetic_leg_r_fake_blocker", "duration": "PERMANENT", "target_part": "leg_prosthetic_r" },
"else": {
"if": { "and": [ { "not": { "u_has_trait": "RIGHT_PROSTHETIC_LEG" } }, { "not": { "u_has_trait": "RIGHT_PEG_LEG" } } ] },
"then": { "u_lose_effect": "prosthetic_leg_r_fake_blocker" }
}
},
{
"if": { "or": [ { "u_has_trait": "LEFT_PROSTHETIC_LEG" }, { "u_has_trait": "LEFT_PEG_LEG" } ] },
"then": { "u_add_effect": "prosthetic_leg_l_fake_blocker", "duration": "PERMANENT", "target_part": "leg_prosthetic_l" },
"else": {
"if": { "and": [ { "not": { "u_has_trait": "LEFT_PROSTHETIC_LEG" } }, { "not": { "u_has_trait": "LEFT_PEG_LEG" } } ] },
"then": { "u_lose_effect": "prosthetic_leg_l_fake_blocker" }
}
},
{
"if": { "u_has_trait": "RIGHT_PROSTHETIC_ARM" },
"then": { "u_add_effect": "prosthetic_arm_r_fake_blocker", "duration": "PERMANENT", "target_part": "arm_prosthetic_r" },
"else": {
"if": { "u_has_trait": "RIGHT_NEUROPROSTHETIC_ARM" },
"then": { "u_add_effect": "prosthetic_arm_r_fake_blocker", "duration": "PERMANENT", "target_part": "arm_neuroprosthetic_r" },
"else": {
"if": { "u_has_trait": "RIGHT_COSMETIC_PROSTHETIC_ARM" },
"then": { "u_add_effect": "prosthetic_arm_r_fake_blocker", "duration": "PERMANENT", "target_part": "arm_prosthetic_cosmetic_r" },
"else": {
"if": {
"and": [
{ "not": { "u_has_trait": "RIGHT_PROSTHETIC_ARM" } },
{ "not": { "u_has_trait": "RIGHT_NEUROPROSTHETIC_ARM" } },
{ "not": { "u_has_trait": "RIGHT_COSMETIC_PROSTHETIC_ARM" } }
]
},
"then": { "u_lose_effect": "prosthetic_arm_r_fake_blocker" }
}
}
}
},
{
"if": { "u_has_trait": "LEFT_PROSTHETIC_ARM" },
"then": { "u_add_effect": "prosthetic_arm_l_fake_blocker", "duration": "PERMANENT", "target_part": "arm_prosthetic_l" },
"else": {
"if": { "u_has_trait": "LEFT_NEUROPROSTHETIC_ARM" },
"then": { "u_add_effect": "prosthetic_arm_l_fake_blocker", "duration": "PERMANENT", "target_part": "arm_neuroprosthetic_l" },
"else": {
"if": { "u_has_trait": "LEFT_COSMETIC_PROSTHETIC_ARM" },
"then": { "u_add_effect": "prosthetic_arm_l_fake_blocker", "duration": "PERMANENT", "target_part": "arm_prosthetic_cosmetic_l" },
"else": {
"if": {
"and": [
{ "not": { "u_has_trait": "LEFT_PROSTHETIC_ARM" } },
{ "not": { "u_has_trait": "LEFT_NEUROPROSTHETIC_ARM" } },
{ "not": { "u_has_trait": "LEFT_COSMETIC_PROSTHETIC_ARM" } }
]
},
"then": { "u_lose_effect": "prosthetic_arm_l_fake_blocker" }
}
}
}
}
]
}
]
4 changes: 2 additions & 2 deletions data/json/enchantments.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
"type": "enchantment",
"id": "ENCH_RIGHT_PROSTHETIC",
"condition": "ALWAYS",
"modified_bodyparts": [ { "lose": "leg_stub_r" }, { "gain": "leg_prosthetic_r" } ]
"modified_bodyparts": [ { "lose": "leg_stub_r" }, { "gain": "leg_prosthetic_r" }, { "gain": "foot_prosthetic_r" } ]
},
{
"type": "enchantment",
"id": "ENCH_LEFT_PROSTHETIC",
"condition": "ALWAYS",
"modified_bodyparts": [ { "lose": "leg_stub_l" }, { "gain": "leg_prosthetic_l" } ]
"modified_bodyparts": [ { "lose": "leg_stub_l" }, { "gain": "leg_prosthetic_l" }, { "gain": "foot_prosthetic_l" } ]
},
{
"type": "enchantment",
Expand Down
8 changes: 4 additions & 4 deletions data/json/items/armor/legs_prosthetics.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"material_thickness": 1,
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "RIGHT_PROSTHETIC_LEG" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_r", "leg_prosthetic_r" ] } ]
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_r", "leg_prosthetic_r", "foot_prosthetic_r" ] } ]
},
{
"id": "left_leg_prosthetic",
Expand All @@ -37,7 +37,7 @@
"material_thickness": 1,
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "LEFT_PROSTHETIC_LEG" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_l", "leg_prosthetic_l" ] } ]
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_l", "leg_prosthetic_l", "foot_prosthetic_l" ] } ]
},
{
"id": "right_peg_leg",
Expand Down Expand Up @@ -97,7 +97,7 @@
"material_thickness": 2,
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "RIGHT_PROSTHETIC_LEG" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_r", "leg_prosthetic_r" ] } ]
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_r", "leg_prosthetic_r", "foot_prosthetic_r" ] } ]
},
{
"id": "left_leg_prosthetic_steel",
Expand All @@ -117,6 +117,6 @@
"material_thickness": 2,
"flags": [ "LEG_PROSTHETIC", "ONLY_ONE", "PADDED" ],
"relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "mutations": [ "LEFT_PROSTHETIC_LEG" ] } ] },
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_l", "leg_prosthetic_l" ] } ]
"armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "leg_stub_l", "leg_prosthetic_l", "foot_prosthetic_l" ] } ]
}
]
66 changes: 66 additions & 0 deletions data/json/mutations/mutation_limbs.json
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,72 @@
}
]
},
{
"id": "foot_prosthetic_l",
"type": "body_part",
"name": "left prosthetic foot",
"name_multiple": "feet",
"accusative": { "ctxt": "bodypart_accusative", "str": "left prosthetic foot" },
"accusative_multiple": { "ctxt": "bodypart_accusative", "str": "prosthetic feet" },
"heading": "l. pros foot",
"heading_multiple": "feet",
"encumbrance_text": "Running is slowed.",
"encumbrance_threshold": 5,
"main_part": "leg_prosthetic_l",
"opposite_part": "foot_prosthetic_r",
"hit_size": 2,
"hit_difficulty": 0.8,
"limb_type": "foot",
"limb_scores": [ [ "manip", 0 ], [ "footing", 0.5 ], [ "swim", 0.1 ] ],
"side": "left",
"stylish_bonus": 0.5,
"hot_morale_mod": 0,
"cold_morale_mod": 0,
"fire_warmth_bonus": 0,
"squeamish_penalty": 0,
"base_hp": 84,
"drench_capacity": 0,
"smash_message": "You kick down the %s, smashing it.",
"bionic_slots": 0,
"sub_parts": [ "foot_sole_l", "foot_arch_l", "foot_toes_l", "foot_ankle_l", "foot_heel_l" ],
"stat_hp_mods": { "str_mod": 0, "dex_mod": 0, "int_mod": 0, "per_mod": 0 },
"flags": [ "LIMB_LOWER", "HEAL_OVERRIDE" ],
"bmi_encumbrance_threshold": 0,
"bmi_encumbrance_scalar": 0
},
{
"id": "foot_prosthetic_r",
"type": "body_part",
"name": "right prosthetic foot",
"name_multiple": "feet",
"accusative": { "ctxt": "bodypart_accusative", "str": "right prosthetic foot" },
"accusative_multiple": { "ctxt": "bodypart_accusative", "str": "prosthetic feet" },
"heading": "r. pros foot",
"heading_multiple": "feet",
"encumbrance_text": "Running is slowed.",
"encumbrance_threshold": 5,
"main_part": "leg_prosthetic_r",
"opposite_part": "foot_prosthetic_l",
"hit_size": 2,
"hit_difficulty": 0.8,
"limb_type": "foot",
"limb_scores": [ [ "manip", 0 ], [ "footing", 0.5 ], [ "swim", 0.1 ] ],
"side": "right",
"stylish_bonus": 0.5,
"hot_morale_mod": 0,
"cold_morale_mod": 0,
"fire_warmth_bonus": 0,
"squeamish_penalty": 0,
"base_hp": 84,
"drench_capacity": 0,
"smash_message": "You kick down the %s, smashing it.",
"bionic_slots": 0,
"sub_parts": [ "foot_sole_r", "foot_arch_r", "foot_toes_r", "foot_ankle_r", "foot_heel_r" ],
"stat_hp_mods": { "str_mod": 0, "dex_mod": 0, "int_mod": 0, "per_mod": 0 },
"flags": [ "LIMB_LOWER", "HEAL_OVERRIDE" ],
"bmi_encumbrance_threshold": 0,
"bmi_encumbrance_scalar": 0
},
{
"id": "arm_prosthetic_r",
"type": "body_part",
Expand Down
24 changes: 12 additions & 12 deletions data/json/mutations/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@
"valid": false,
"purifiable": false,
"description": "You have a prosthetic on your right leg.",
"no_cbm_on_bp": [ "leg_knee_r", "leg_lower_r", "leg_draped_r", "foot_r" ],
"processed_eocs": [ "EOC_PROSTHETIC_RIGHT_WEAR" ],
"no_cbm_on_bp": [ "leg_knee_r", "leg_lower_r", "leg_draped_r", "foot_prosthetic_r" ],
"processed_eocs": [ "EOC_PROSTHETIC_RIGHT_WEAR", "EOC_PROSTHETIC_EFFECT_BLOCK_SETUP" ],
"enchantments": [ "ENCH_RIGHT_PROSTHETIC" ]
},
{
Expand All @@ -510,8 +510,8 @@
"valid": false,
"purifiable": false,
"description": "You have a prosthetic on your left leg.",
"no_cbm_on_bp": [ "leg_knee_l", "leg_lower_l", "leg_draped_l", "foot_l" ],
"processed_eocs": [ "EOC_PROSTHETIC_LEFT_WEAR" ],
"no_cbm_on_bp": [ "leg_knee_l", "leg_lower_l", "leg_draped_l", "foot_prosthetic_l" ],
"processed_eocs": [ "EOC_PROSTHETIC_LEFT_WEAR", "EOC_PROSTHETIC_EFFECT_BLOCK_SETUP" ],
"enchantments": [ "ENCH_LEFT_PROSTHETIC" ]
},
{
Expand All @@ -523,7 +523,7 @@
"purifiable": false,
"description": "You have a prosthetic on your right leg.",
"no_cbm_on_bp": [ "leg_knee_r", "leg_lower_r", "leg_draped_r", "foot_r" ],
"processed_eocs": [ "EOC_PROSTHETIC_RIGHT_WEAR" ],
"processed_eocs": [ "EOC_PROSTHETIC_RIGHT_WEAR", "EOC_PROSTHETIC_EFFECT_BLOCK_SETUP" ],
"enchantments": [ "ENCH_RIGHT_PEGLEG" ]
},
{
Expand All @@ -535,7 +535,7 @@
"purifiable": false,
"description": "You have a prosthetic on your left leg.",
"no_cbm_on_bp": [ "leg_knee_l", "leg_lower_l", "leg_draped_l", "foot_l" ],
"processed_eocs": [ "EOC_PROSTHETIC_LEFT_WEAR" ],
"processed_eocs": [ "EOC_PROSTHETIC_LEFT_WEAR", "EOC_PROSTHETIC_EFFECT_BLOCK_SETUP" ],
"enchantments": [ "ENCH_LEFT_PEGLEG" ]
},
{
Expand All @@ -547,7 +547,7 @@
"purifiable": false,
"description": "You have a prosthetic on your left arm.",
"no_cbm_on_bp": [ "arm_upper_l", "arm_elbow_l", "arm_lower_l", "hand_prosthetic_l" ],
"processed_eocs": [ "EOC_PROSTHETIC_LEFT_ARM_WEAR" ],
"processed_eocs": [ "EOC_PROSTHETIC_LEFT_ARM_WEAR", "EOC_PROSTHETIC_EFFECT_BLOCK_SETUP" ],
"enchantments": [ "ENCH_LEFT_ARM_PROSTHETIC" ]
},
{
Expand All @@ -559,7 +559,7 @@
"purifiable": false,
"description": "You have a prosthetic on your right arm.",
"no_cbm_on_bp": [ "arm_upper_r", "arm_elbow_r", "arm_lower_r", "hand_prosthetic_r" ],
"processed_eocs": [ "EOC_PROSTHETIC_RIGHT_ARM_WEAR" ],
"processed_eocs": [ "EOC_PROSTHETIC_RIGHT_ARM_WEAR", "EOC_PROSTHETIC_EFFECT_BLOCK_SETUP" ],
"enchantments": [ "ENCH_RIGHT_ARM_PROSTHETIC" ]
},
{
Expand All @@ -571,7 +571,7 @@
"purifiable": false,
"description": "You have a prosthetic on your left arm.",
"no_cbm_on_bp": [ "arm_upper_l", "arm_elbow_l", "arm_lower_l", "hand_neuroprosthetic_l" ],
"processed_eocs": [ "EOC_PROSTHETIC_LEFT_ARM_WEAR" ],
"processed_eocs": [ "EOC_PROSTHETIC_LEFT_ARM_WEAR", "EOC_PROSTHETIC_EFFECT_BLOCK_SETUP" ],
"enchantments": [ "ENCH_LEFT_ARM_NEUROPROSTHETIC" ]
},
{
Expand All @@ -583,7 +583,7 @@
"purifiable": false,
"description": "You have a prosthetic on your right arm.",
"no_cbm_on_bp": [ "arm_upper_r", "arm_elbow_r", "arm_lower_r", "hand_neuroprosthetic_r" ],
"processed_eocs": [ "EOC_PROSTHETIC_RIGHT_ARM_WEAR" ],
"processed_eocs": [ "EOC_PROSTHETIC_RIGHT_ARM_WEAR", "EOC_PROSTHETIC_EFFECT_BLOCK_SETUP" ],
"enchantments": [ "ENCH_RIGHT_ARM_NEUROPROSTHETIC" ]
},
{
Expand All @@ -595,7 +595,7 @@
"purifiable": false,
"description": "You have a prosthetic on your left arm.",
"no_cbm_on_bp": [ "arm_upper_l", "arm_elbow_l", "arm_lower_l", "hand_prosthetic_l" ],
"processed_eocs": [ "EOC_PROSTHETIC_LEFT_ARM_WEAR" ],
"processed_eocs": [ "EOC_PROSTHETIC_LEFT_ARM_WEAR", "EOC_PROSTHETIC_EFFECT_BLOCK_SETUP" ],
"enchantments": [ "ENCH_LEFT_ARM_COSMETIC_PROSTHETIC" ]
},
{
Expand All @@ -607,7 +607,7 @@
"purifiable": false,
"description": "You have a prosthetic on your right arm.",
"no_cbm_on_bp": [ "arm_upper_r", "arm_elbow_r", "arm_lower_r", "hand_prosthetic_r" ],
"processed_eocs": [ "EOC_PROSTHETIC_RIGHT_ARM_WEAR" ],
"processed_eocs": [ "EOC_PROSTHETIC_RIGHT_ARM_WEAR", "EOC_PROSTHETIC_EFFECT_BLOCK_SETUP" ],
"enchantments": [ "ENCH_RIGHT_ARM_COSMETIC_PROSTHETIC" ]
},
{
Expand Down

0 comments on commit 0033431

Please sign in to comment.