From 45ee274ec6317dc70be68697505cf2b0d5717070 Mon Sep 17 00:00:00 2001 From: Bastian0930 <28938873+Bastian0930@users.noreply.github.com> Date: Sat, 6 Apr 2024 16:42:48 -0400 Subject: [PATCH 1/5] Fix Persuasion Rack Bugs Prevents basicmob torture, while also preventing the user from spamming the rack (which would make them lose a lot of blood) --- .../structures/bloodsucker_crypt.dm | 88 +++++++++++-------- 1 file changed, 51 insertions(+), 37 deletions(-) diff --git a/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm b/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm index 479aefd681bb..295855b16f5f 100644 --- a/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm +++ b/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm @@ -130,6 +130,8 @@ var/disloyalty_confirm = FALSE /// Prevents popup spam. var/disloyalty_offered = FALSE + // Prevent spamming torture via spam click. Otherwise they're able to lose a lot of blood quickly + var/torture_debounce = FALSE /obj/structure/bloodsucker/vassalrack/Initialize(mapload) . = ..() @@ -282,6 +284,9 @@ balloon_alert(user, "someone else's vassal!") return FALSE + if(isanimal_or_basicmob(target)) + balloon_alert(user, "you can't torture an animal or basic mob!") + return FALSE var/disloyalty_requires = RequireDisloyalty(user, target) if(HAS_TRAIT(target, TRAIT_MINDSHIELD)) @@ -294,44 +299,49 @@ // Conversion Process if(convert_progress) - balloon_alert(user, "spilling blood...") - bloodsuckerdatum.AddBloodVolume(-TORTURE_BLOOD_HALF_COST) - if(!do_torture(user, target)) - return FALSE - bloodsuckerdatum.AddBloodVolume(-TORTURE_BLOOD_HALF_COST) - // Prevent them from unbuckling themselves as long as we're torturing. - target.Paralyze(1 SECONDS) - convert_progress-- - - // We're done? Let's see if they can be Vassal. - if(convert_progress) - balloon_alert(user, "needs more persuasion...") - return - - if(disloyalty_requires) - balloon_alert(user, "has external loyalties! more persuasion required!") - else - balloon_alert(user, "ready for communion!") - return - - if(!disloyalty_confirm && disloyalty_requires) - if(!do_disloyalty(user, target)) + //Are we currently torturing this person? If so, do not spill blood more. + if(!torture_debounce) + //We're torturing. Do not start another torture on this rack. + torture_debounce = TRUE + balloon_alert(user, "spilling blood...") + bloodsuckerdatum.AddBloodVolume(-TORTURE_BLOOD_HALF_COST) + if(!do_torture(user, target)) + return FALSE + bloodsuckerdatum.AddBloodVolume(-TORTURE_BLOOD_HALF_COST) + // Prevent them from unbuckling themselves as long as we're torturing. + target.Paralyze(1 SECONDS) + convert_progress-- + + // We're done? Let's see if they can be Vassal. + if(convert_progress) + balloon_alert(user, "needs more persuasion...") + return + + if(disloyalty_requires) + balloon_alert(user, "has external loyalties! more persuasion required!") + else + balloon_alert(user, "ready for communion!") + return + + if(!disloyalty_confirm && disloyalty_requires) + if(!do_disloyalty(user, target)) + return + if(!disloyalty_confirm) + balloon_alert(user, "refused persuasion!") + else + balloon_alert(user, "ready for communion!") + return + //If they don't need any more torture, start converting them into a vassal! + else + user.balloon_alert_to_viewers("smears blood...", "painting bloody marks...") + if(!do_after(user, 5 SECONDS, target)) + balloon_alert(user, "interrupted!") return - if(!disloyalty_confirm) - balloon_alert(user, "refused persuasion!") - else - balloon_alert(user, "ready for communion!") - return - - user.balloon_alert_to_viewers("smears blood...", "painting bloody marks...") - if(!do_after(user, 5 SECONDS, target)) - balloon_alert(user, "interrupted!") - return - // Convert to Vassal! - bloodsuckerdatum.AddBloodVolume(-TORTURE_CONVERSION_COST) - if(bloodsuckerdatum.make_vassal(target)) - remove_loyalties(target) - SEND_SIGNAL(bloodsuckerdatum, BLOODSUCKER_MADE_VASSAL, user, target) + // Convert to Vassal! + bloodsuckerdatum.AddBloodVolume(-TORTURE_CONVERSION_COST) + if(bloodsuckerdatum.make_vassal(target)) + remove_loyalties(target) + SEND_SIGNAL(bloodsuckerdatum, BLOODSUCKER_MADE_VASSAL, user, target) /obj/structure/bloodsucker/vassalrack/proc/do_torture(mob/living/user, mob/living/carbon/target, mult = 1) // Fifteen seconds if you aren't using anything. Shorter with weapons and such. @@ -363,6 +373,8 @@ torture_time = max(5 SECONDS, torture_time * 10) // Now run process. if(!do_after(user, (torture_time * mult), target)) + //Torture failed. You can start again. + torture_debounce = FALSE return FALSE if(held_item) @@ -374,6 +386,8 @@ INVOKE_ASYNC(target, TYPE_PROC_REF(/mob, emote), "scream") target.set_timed_status_effect(5 SECONDS, /datum/status_effect/jitter, only_if_higher = TRUE) target.apply_damages(brute = torture_dmg_brute, burn = torture_dmg_burn, def_zone = selected_bodypart.body_zone) + //Torture succeeded. You may torture again. + torture_debounce = FALSE return TRUE /// Offer them the oppertunity to join now. From 73a04852f49b7006048dbe4ad91202bae68a4964 Mon Sep 17 00:00:00 2001 From: Bastian0930 Date: Sat, 6 Apr 2024 22:37:19 -0400 Subject: [PATCH 2/5] Update monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm Co-authored-by: wraith-54321 <69217972+wraith-54321@users.noreply.github.com> --- .../code/modules/bloodsuckers/structures/bloodsucker_crypt.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm b/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm index 295855b16f5f..685cd6a9a1fc 100644 --- a/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm +++ b/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm @@ -300,7 +300,8 @@ // Conversion Process if(convert_progress) //Are we currently torturing this person? If so, do not spill blood more. - if(!torture_debounce) + if(torture_debounce) + return //We're torturing. Do not start another torture on this rack. torture_debounce = TRUE balloon_alert(user, "spilling blood...") From c7a38142065450c25f268883440f6a26041fdf5c Mon Sep 17 00:00:00 2001 From: Bastian0930 Date: Sat, 6 Apr 2024 22:40:31 -0400 Subject: [PATCH 3/5] Update bloodsucker_crypt.dm --- .../bloodsuckers/structures/bloodsucker_crypt.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm b/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm index 685cd6a9a1fc..4f7ccdefb8fc 100644 --- a/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm +++ b/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm @@ -131,7 +131,7 @@ /// Prevents popup spam. var/disloyalty_offered = FALSE // Prevent spamming torture via spam click. Otherwise they're able to lose a lot of blood quickly - var/torture_debounce = FALSE + var/blood_draining = FALSE /obj/structure/bloodsucker/vassalrack/Initialize(mapload) . = ..() @@ -300,10 +300,10 @@ // Conversion Process if(convert_progress) //Are we currently torturing this person? If so, do not spill blood more. - if(torture_debounce) + if(blood_draining) return //We're torturing. Do not start another torture on this rack. - torture_debounce = TRUE + blood_draining = TRUE balloon_alert(user, "spilling blood...") bloodsuckerdatum.AddBloodVolume(-TORTURE_BLOOD_HALF_COST) if(!do_torture(user, target)) @@ -375,7 +375,7 @@ // Now run process. if(!do_after(user, (torture_time * mult), target)) //Torture failed. You can start again. - torture_debounce = FALSE + blood_draining = FALSE return FALSE if(held_item) @@ -388,7 +388,7 @@ target.set_timed_status_effect(5 SECONDS, /datum/status_effect/jitter, only_if_higher = TRUE) target.apply_damages(brute = torture_dmg_brute, burn = torture_dmg_burn, def_zone = selected_bodypart.body_zone) //Torture succeeded. You may torture again. - torture_debounce = FALSE + blood_draining = FALSE return TRUE /// Offer them the oppertunity to join now. From b742c199d31315faebf5a238c50b8bf02c8683e6 Mon Sep 17 00:00:00 2001 From: Bastian0930 <28938873+Bastian0930@users.noreply.github.com> Date: Sun, 7 Apr 2024 13:09:31 -0400 Subject: [PATCH 4/5] indentation changes --- .../structures/bloodsucker_crypt.dm | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm b/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm index 4f7ccdefb8fc..dd314d16cb66 100644 --- a/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm +++ b/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm @@ -302,36 +302,36 @@ //Are we currently torturing this person? If so, do not spill blood more. if(blood_draining) return - //We're torturing. Do not start another torture on this rack. - blood_draining = TRUE - balloon_alert(user, "spilling blood...") - bloodsuckerdatum.AddBloodVolume(-TORTURE_BLOOD_HALF_COST) - if(!do_torture(user, target)) - return FALSE - bloodsuckerdatum.AddBloodVolume(-TORTURE_BLOOD_HALF_COST) - // Prevent them from unbuckling themselves as long as we're torturing. - target.Paralyze(1 SECONDS) - convert_progress-- - - // We're done? Let's see if they can be Vassal. - if(convert_progress) - balloon_alert(user, "needs more persuasion...") - return + //We're torturing. Do not start another torture on this rack. + blood_draining = TRUE + balloon_alert(user, "spilling blood...") + bloodsuckerdatum.AddBloodVolume(-TORTURE_BLOOD_HALF_COST) + if(!do_torture(user, target)) + return FALSE + bloodsuckerdatum.AddBloodVolume(-TORTURE_BLOOD_HALF_COST) + // Prevent them from unbuckling themselves as long as we're torturing. + target.Paralyze(1 SECONDS) + convert_progress-- + + // We're done? Let's see if they can be Vassal. + if(convert_progress) + balloon_alert(user, "needs more persuasion...") + return - if(disloyalty_requires) - balloon_alert(user, "has external loyalties! more persuasion required!") - else - balloon_alert(user, "ready for communion!") - return + if(disloyalty_requires) + balloon_alert(user, "has external loyalties! more persuasion required!") + else + balloon_alert(user, "ready for communion!") + return - if(!disloyalty_confirm && disloyalty_requires) - if(!do_disloyalty(user, target)) - return - if(!disloyalty_confirm) - balloon_alert(user, "refused persuasion!") - else - balloon_alert(user, "ready for communion!") + if(!disloyalty_confirm && disloyalty_requires) + if(!do_disloyalty(user, target)) return + if(!disloyalty_confirm) + balloon_alert(user, "refused persuasion!") + else + balloon_alert(user, "ready for communion!") + return //If they don't need any more torture, start converting them into a vassal! else user.balloon_alert_to_viewers("smears blood...", "painting bloody marks...") From ddb1eb33445cc296c3c8b528385ef33c58f9128f Mon Sep 17 00:00:00 2001 From: Bastian0930 Date: Fri, 12 Apr 2024 16:50:55 -0400 Subject: [PATCH 5/5] Changes something to do effectively the same thing, but with different words. suggested by maintainer, changed it because I see no reason not to. plus looks nicer!! --- .../code/modules/bloodsuckers/structures/bloodsucker_crypt.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm b/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm index dd314d16cb66..0bcb6a479938 100644 --- a/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm +++ b/monkestation/code/modules/bloodsuckers/structures/bloodsucker_crypt.dm @@ -284,7 +284,7 @@ balloon_alert(user, "someone else's vassal!") return FALSE - if(isanimal_or_basicmob(target)) + if(!ishuman(target)) balloon_alert(user, "you can't torture an animal or basic mob!") return FALSE var/disloyalty_requires = RequireDisloyalty(user, target)