From d689d924517fa25ac6b1de2452712e42b21eb3cd Mon Sep 17 00:00:00 2001 From: Chaosvolt Date: Tue, 21 Nov 2023 11:28:40 -0600 Subject: [PATCH] fix(balance): repair chance rebalancing --- data/json/items/tool/tailoring.json | 10 +++++----- src/iuse_actor.cpp | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/data/json/items/tool/tailoring.json b/data/json/items/tool/tailoring.json index 69b7179c5f81..a522bf5793c0 100644 --- a/data/json/items/tool/tailoring.json +++ b/data/json/items/tool/tailoring.json @@ -72,7 +72,7 @@ "item_action_type": "repair_fabric", "materials": [ "cotton", "leather", "nylon", "wool", "fur", "faux_fur", "nomex", "kevlar", "gutskin" ], "skill": "tailor", - "tool_quality": -1, + "tool_quality": 1, "cost_scaling": 0.1, "move_cost": 1300 }, @@ -101,7 +101,7 @@ "item_action_type": "repair_fabric", "materials": [ "neoprene" ], "skill": "tailor", - "tool_quality": 0, + "tool_quality": 1, "cost_scaling": 0.1, "move_cost": 1200 }, @@ -130,7 +130,7 @@ "item_action_type": "repair_fabric", "materials": [ "cotton", "nylon", "leather", "wool", "fur", "faux_fur", "nomex", "gutskin" ], "skill": "tailor", - "tool_quality": -1, + "tool_quality": 0, "cost_scaling": 0.1, "move_cost": 1500 }, @@ -160,7 +160,7 @@ "item_action_type": "repair_fabric", "materials": [ "cotton", "leather", "nylon", "wool", "fur", "faux_fur", "nomex", "kevlar", "gutskin" ], "skill": "tailor", - "tool_quality": 0, + "tool_quality": 2, "cost_scaling": 0.1, "move_cost": 1000 }, @@ -206,7 +206,7 @@ "item_action_type": "repair_fabric", "materials": [ "cotton", "leather", "nylon", "wool", "fur", "faux_fur", "nomex", "kevlar", "neoprene", "gutskin" ], "skill": "tailor", - "tool_quality": 1, + "tool_quality": 3, "cost_scaling": 0.1, "move_cost": 800 }, diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index 65f7e0f6dd05..361946f15407 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -3295,8 +3295,8 @@ std::pair repair_item_actor::repair_chance( action_difficulty = fix.max_damage() / itype::damage_scale; break; case RT_REINFORCE: - // Reinforcing is at least as hard as refitting - action_difficulty = std::max( fix.max_damage() / itype::damage_scale, recipe_difficulty ); + // Reinforcing is 50% harder than refitting + action_difficulty = fix.max_damage() / itype::damage_scale * 1.5; break; case RT_PRACTICE: // Skill gain scales with recipe difficulty, so practice difficulty should too @@ -3315,9 +3315,11 @@ std::pair repair_item_actor::repair_chance( // Duster | 2 | 5 | 5 | 10% | 0% // Duster | 2 | 2 | 10 | 4% | 1% // Duster | Refit | 2 | 10 | 0% | N/A - float success_chance = ( 10 + 2 * skill - 2 * difficulty + tool_quality / 5.0f ) / 100.0f; + float success_chance = ( 10 + 2 * ( skill * ( 1 + tool_quality / 10.0f ) ) - 2 * difficulty ) / + 100.0f; /** @EFFECT_DEX reduces the chances of damaging an item when repairing */ - float damage_chance = ( difficulty - skill - ( tool_quality + pl.dex_cur ) / 5.0f ) / 100.0f; + float damage_chance = ( difficulty - ( skill * ( 1 + tool_quality / 10.0f ) ) - pl.dex_cur / + 5.0f ) / 100.0f; damage_chance = std::max( 0.0f, std::min( 1.0f, damage_chance ) ); success_chance = std::max( 0.0f, std::min( 1.0f - damage_chance, success_chance ) );