From f0864a192172c9f0c8ea63d8b28fc47f3fd6c35c Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 19 Sep 2023 03:38:08 +0200 Subject: [PATCH] [MIRROR] Fixes the interface list in the rock paper scissor game [MDB IGNORE] (#23793) * Fixes the interface list in the rock paper scissor game (#78391) ## About The Pull Request The rock-paper-scissors selection window was causing a TypeError in tgui_alert ![image](https://github.com/tgstation/tgstation/assets/103851341/f6e1bb5b-3fc0-4d5f-83d5-a43082edc543) ## Why It's Good For The Game One more achievement available ## Changelog :cl: fix: Fixes a selection window in the game rock-paper-scissors with death. /:cl: --------- Co-authored-by: BuildTools * Fixes the interface list in the rock paper scissor game --------- Co-authored-by: Hypernoblium <103851341+Hypernoblium@users.noreply.github.com> Co-authored-by: BuildTools --- .../reagents/cat2_medicine_reagents.dm | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm index 57e318698bd..693404431fa 100644 --- a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm @@ -46,12 +46,11 @@ if(good_kind_of_healing && !reaping && SPT_PROB(0.00005, seconds_per_tick)) //janken with the grim reaper! notify_ghosts("[affected_mob] has entered a game of rock-paper-scissors with death!", source = affected_mob, action = NOTIFY_ORBIT, header = "Who Will Win?") reaping = TRUE - var/list/RockPaperScissors = list("rock" = "paper", "paper" = "scissors", "scissors" = "rock") //choice = loses to if(affected_mob.apply_status_effect(/datum/status_effect/necropolis_curse, CURSE_BLINDING)) helbent = TRUE to_chat(affected_mob, span_hierophant("Malevolent spirits appear before you, bartering your life in a 'friendly' game of rock, paper, scissors. Which do you choose?")) var/timeisticking = world.time - var/RPSchoice = tgui_alert(affected_mob, "Janken Time! You have 60 Seconds to Choose!", "Rock Paper Scissors", RockPaperScissors, 60) + var/RPSchoice = tgui_alert(affected_mob, "Janken Time! You have 60 Seconds to Choose!", "Rock Paper Scissors", list("rock" , "paper" , "scissors"), 60) if(QDELETED(affected_mob) || (timeisticking+(1.1 MINUTES) < world.time)) reaping = FALSE return //good job, you ruined it @@ -59,21 +58,21 @@ to_chat(affected_mob, span_hierophant("You decide to not press your luck, but the spirits remain... hopefully they'll go away soon.")) reaping = FALSE return - var/grim = pick(RockPaperScissors) - if(grim == RPSchoice) //You Tied! - to_chat(affected_mob, span_hierophant("You tie, and the malevolent spirits disappear... for now.")) - reaping = FALSE - else if(RockPaperScissors[RPSchoice] == grim) //You lost! - to_chat(affected_mob, span_hierophant("You lose, and the malevolent spirits smirk eerily as they surround your body.")) - affected_mob.investigate_log("has lost rock paper scissors with the grim reaper and been dusted.", INVESTIGATE_DEATHS) - affected_mob.dust() - return - else //VICTORY ROYALE - to_chat(affected_mob, span_hierophant("You win, and the malevolent spirits fade away as well as your wounds.")) - affected_mob.client.give_award(/datum/award/achievement/jobs/helbitaljanken, affected_mob) - affected_mob.revive(HEAL_ALL) - holder.del_reagent(type) - return + switch(rand(1,3)) + if(1) //You Tied! + to_chat(affected_mob, span_hierophant("You tie, and the malevolent spirits disappear... for now.")) + reaping = FALSE + if(2) //You lost! + to_chat(affected_mob, span_hierophant("You lose, and the malevolent spirits smirk eerily as they surround your body.")) + affected_mob.investigate_log("has lost rock paper scissors with the grim reaper and been dusted.", INVESTIGATE_DEATHS) + affected_mob.dust() + return + if(3) //VICTORY ROYALE + to_chat(affected_mob, span_hierophant("You win, and the malevolent spirits fade away as well as your wounds.")) + affected_mob.client.give_award(/datum/award/achievement/jobs/helbitaljanken, affected_mob) + affected_mob.revive(HEAL_ALL) + holder.del_reagent(type) + return ..() return