From 9dbbe1756e9ed3b4fde1c3890d69900afde094eb Mon Sep 17 00:00:00 2001 From: DerFlammenwerfer <7h3ph4nt0m@gmail.com> Date: Sat, 15 Jun 2024 09:37:37 -0400 Subject: [PATCH 1/4] Balances thievery around item weight class --- code/_onclick/other_mobs.dm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 4c9a3acd3e..ebd7625a22 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -408,18 +408,23 @@ if (V.get_item_by_slot(SLOT_BELT_R)) stealpos.Add(V.get_item_by_slot(SLOT_BELT_R)) if (V.get_item_by_slot(SLOT_BELT_L)) - stealpos.Add(V.get_item_by_slot(SLOT_BELT_L)) + stealpos.Add(V.get_item_by_slot(SLOT_BELT_L)) if("r_hand" || "l_hand") if (V.get_item_by_slot(SLOT_RING)) stealpos.Add(V.get_item_by_slot(SLOT_RING)) if (length(stealpos) > 0) var/obj/item/picked = pick(stealpos) - V.dropItemToGround(picked) - put_in_active_hand(picked) - to_chat(src, span_green("I stole [picked]!")) - V.log_message("has had \the [picked] stolen by [key_name(U)]", LOG_ATTACK, color="black") - U.log_message("has stolen \the [picked] from [key_name(V)]", LOG_ATTACK, color="black") - exp_to_gain *= src.mind.get_learning_boon(thiefskill) + if(stealroll > (targetperception + (picked.w_class * 3)))//Makes it exponentially harder to steal larger items, as every skill rank in thief adds 1d6 to the roll + V.dropItemToGround(picked) + put_in_active_hand(picked) + to_chat(src, span_green("I stole [picked]!")) + V.log_message("has had \the [picked] stolen by [key_name(U)]", LOG_ATTACK, color="black") + U.log_message("has stolen \the [picked] from [key_name(V)]", LOG_ATTACK, color="black") + exp_to_gain *= src.mind.get_learning_boon(thiefskill) + else + V.log_message("[key_name(U)] tried to steal my [picked.name]!", LOG_ATTACK, color="red") + U.log_message("has attempted to pickpocket [key_name(V)]!", LOG_ATTACK, color="red") + to_chat(src, span_danger("[picked.name] was too large to remove unnoticed!")) else exp_to_gain /= 2 // these can be removed or changed on reviewer's discretion to_chat(src, span_warning("I didn't find anything there. Perhaps I should look elsewhere.")) From 6c82d4fc25ac88354446e91f28cbbde93a3bc143 Mon Sep 17 00:00:00 2001 From: DerFlammenwerfer <7h3ph4nt0m@gmail.com> Date: Tue, 18 Jun 2024 23:35:47 -0400 Subject: [PATCH 2/4] Small and Tiny items have no penalty; weight penalty reduced in accordance with the law of averages. --- code/_onclick/other_mobs.dm | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index ebd7625a22..913469ff6a 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -394,7 +394,7 @@ to_chat(src, span_warning("What am I going to steal from there?")) return mobsbehind |= cone(V, list(turn(V.dir, 180)), list(src)) - if(mobsbehind.Find(src)) + if(mobsbehind.Find(src) || V.eyesclosed || V.stat >= UNCONSCIOUS) switch(U.zone_selected) if("chest") if (V.get_item_by_slot(SLOT_BACK_L)) @@ -414,17 +414,30 @@ stealpos.Add(V.get_item_by_slot(SLOT_RING)) if (length(stealpos) > 0) var/obj/item/picked = pick(stealpos) - if(stealroll > (targetperception + (picked.w_class * 3)))//Makes it exponentially harder to steal larger items, as every skill rank in thief adds 1d6 to the roll - V.dropItemToGround(picked) - put_in_active_hand(picked) - to_chat(src, span_green("I stole [picked]!")) - V.log_message("has had \the [picked] stolen by [key_name(U)]", LOG_ATTACK, color="black") - U.log_message("has stolen \the [picked] from [key_name(V)]", LOG_ATTACK, color="black") - exp_to_gain *= src.mind.get_learning_boon(thiefskill) + if(picked.w_class >= 3) + if(stealroll > (targetperception + (picked.w_class * 2)))//Law of averages puts 6d6 at between 17 and 25. Assuming a Perception of 10, the DC to steal bulky items is now 18. + V.dropItemToGround(picked) + put_in_active_hand(picked) + to_chat(src, span_green("I stole [picked]!")) + V.log_message("has had \the [picked] stolen by [key_name(U)]", LOG_ATTACK, color="black") + U.log_message("has stolen \the [picked] from [key_name(V)]", LOG_ATTACK, color="black") + exp_to_gain *= src.mind.get_learning_boon(thiefskill) + else + V.log_message("[key_name(U)] tried to steal my [picked.name]!", LOG_ATTACK, color="red") + U.log_message("has attempted to pickpocket [key_name(V)]!", LOG_ATTACK, color="red") + to_chat(src, span_danger("[picked.name] was too large to remove unnoticed!")) else - V.log_message("[key_name(U)] tried to steal my [picked.name]!", LOG_ATTACK, color="red") - U.log_message("has attempted to pickpocket [key_name(V)]!", LOG_ATTACK, color="red") - to_chat(src, span_danger("[picked.name] was too large to remove unnoticed!")) + if(stealroll > targetperception)//Small and Tiny items do not have a weight penalty + V.dropItemToGround(picked) + put_in_active_hand(picked) + to_chat(src, span_green("I stole [picked]!")) + V.log_message("has had \the [picked] stolen by [key_name(U)]", LOG_ATTACK, color="black") + U.log_message("has stolen \the [picked] from [key_name(V)]", LOG_ATTACK, color="black") + exp_to_gain *= src.mind.get_learning_boon(thiefskill) + else + V.log_message("[key_name(U)] tried to steal my [picked.name]!", LOG_ATTACK, color="red") + U.log_message("has attempted to pickpocket [key_name(V)]!", LOG_ATTACK, color="red") + to_chat(src, span_danger("[picked.name] was too large to remove unnoticed!")) else exp_to_gain /= 2 // these can be removed or changed on reviewer's discretion to_chat(src, span_warning("I didn't find anything there. Perhaps I should look elsewhere.")) From 4b2fb9ecbb219d949b34d35bf6d3eead01085b4a Mon Sep 17 00:00:00 2001 From: DerFlammenwerfer <7h3ph4nt0m@gmail.com> Date: Tue, 18 Jun 2024 23:45:48 -0400 Subject: [PATCH 3/4] some return statements to prevent multiple checks per attempt --- code/_onclick/other_mobs.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 913469ff6a..f40b056afe 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -385,6 +385,7 @@ var/list/stealpos = list() var/list/mobsbehind = list() var/exp_to_gain = STAINT + var/shuteye = 0 if(stealroll > targetperception) //TODO add exp here if(U.get_active_held_item()) @@ -414,6 +415,14 @@ stealpos.Add(V.get_item_by_slot(SLOT_RING)) if (length(stealpos) > 0) var/obj/item/picked = pick(stealpos) + if(V.stat >= UNCONSCIOUS)//If your victim is unconscious, you automatically succeed + V.dropItemToGround(picked) + put_in_active_hand(picked) + to_chat(src, span_green("I stole [picked]!")) + V.log_message("has had \the [picked] stolen by [key_name(U)]", LOG_ATTACK, color="black") + U.log_message("has stolen \the [picked] from [key_name(V)]", LOG_ATTACK, color="black") + exp_to_gain *= src.mind.get_learning_boon(thiefskill) + return if(picked.w_class >= 3) if(stealroll > (targetperception + (picked.w_class * 2)))//Law of averages puts 6d6 at between 17 and 25. Assuming a Perception of 10, the DC to steal bulky items is now 18. V.dropItemToGround(picked) @@ -422,6 +431,7 @@ V.log_message("has had \the [picked] stolen by [key_name(U)]", LOG_ATTACK, color="black") U.log_message("has stolen \the [picked] from [key_name(V)]", LOG_ATTACK, color="black") exp_to_gain *= src.mind.get_learning_boon(thiefskill) + return else V.log_message("[key_name(U)] tried to steal my [picked.name]!", LOG_ATTACK, color="red") U.log_message("has attempted to pickpocket [key_name(V)]!", LOG_ATTACK, color="red") @@ -434,6 +444,7 @@ V.log_message("has had \the [picked] stolen by [key_name(U)]", LOG_ATTACK, color="black") U.log_message("has stolen \the [picked] from [key_name(V)]", LOG_ATTACK, color="black") exp_to_gain *= src.mind.get_learning_boon(thiefskill) + return else V.log_message("[key_name(U)] tried to steal my [picked.name]!", LOG_ATTACK, color="red") U.log_message("has attempted to pickpocket [key_name(V)]!", LOG_ATTACK, color="red") From b86f55b343c8893d593a0ae30a5903bb1efce873 Mon Sep 17 00:00:00 2001 From: DerFlammenwerfer <7h3ph4nt0m@gmail.com> Date: Wed, 19 Jun 2024 00:04:13 -0400 Subject: [PATCH 4/4] removes unused variable --- code/_onclick/other_mobs.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index f40b056afe..df73a51720 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -385,7 +385,6 @@ var/list/stealpos = list() var/list/mobsbehind = list() var/exp_to_gain = STAINT - var/shuteye = 0 if(stealroll > targetperception) //TODO add exp here if(U.get_active_held_item())