From 0c818b0d8e86c08ca9560a30ae668db35eeea7f3 Mon Sep 17 00:00:00 2001 From: Citinited Date: Fri, 2 Mar 2018 22:33:03 +0000 Subject: [PATCH 1/4] Russian revolver refactor; you can no longer play RR without a head --- code/game/objects/items/toys.dm | 42 +++++++++++++++++---------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 4979b94eb92..5877012eb87 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1368,10 +1368,9 @@ obj/item/toy/cards/deck/syndicate/black origin_tech = "combat=1" attack_verb = list("struck", "hit", "bashed") var/bullet_position = 1 - var/is_empty = 0 /obj/item/toy/russian_revolver/suicide_act(mob/user) - user.visible_message("[user] quickly loads six bullets into the [src.name]'s cylinder and points it at \his head before pulling the trigger! It looks like they are trying to commit suicide.") + user.visible_message("[user] quickly loads six bullets into [src]'s cylinder and points it at \his head before pulling the trigger! It looks like they are trying to commit suicide.") playsound(loc, 'sound/weapons/Gunshot.ogg', 50, 1) return (BRUTELOSS) @@ -1381,35 +1380,38 @@ obj/item/toy/cards/deck/syndicate/black /obj/item/toy/russian_revolver/attack_self(mob/user) - if(is_empty) - user.visible_message("[user] loads a bullet into the [src]'s cylinder.") - is_empty = 0 + if(!bullet_position) + user.visible_message("[user] loads a bullet into [src]'s cylinder.") + bullet_position = 1 else spin_cylinder() - user.visible_message("[user] spins the cylinder on the [src]!") + user.visible_message("[user] spins the cylinder on [src]!") -/obj/item/toy/russian_revolver/attack(mob/living/carbon/M, mob/user) - if(M != user) //can't use this on other people +/obj/item/toy/russian_revolver/attack(atom/target, mob/living/carbon/human/user) + if(target != user) //can't use this on other people return - if(is_empty) - to_chat(user, "The [src] is empty.") + if(!bullet_position) + to_chat(user, "[src] is empty.") return - user.visible_message("[user] points the [src] at their head, ready to pull the trigger!") - if(do_after(user, 30, target = M)) - if(bullet_position != 1) + if(!(user.has_organ("head"))) //For sanity + to_chat(user, "Playing this game without a head would be classed as cheating.") + return + user.visible_message("[user] points [src] at their head, ready to pull the trigger!") + if(do_after(user, 30, target = user)) + if(bullet_position > 1) user.visible_message("*click*") playsound(src, 'sound/weapons/empty.ogg', 100, 1) - bullet_position -= 1 + bullet_position -- return - if(bullet_position == 1) - is_empty = 1 + else + bullet_position = null playsound(src, 'sound/weapons/Gunshot.ogg', 50, 1) - user.visible_message("The [src] goes off!") - M.apply_damage(200, BRUTE, "head", sharp =1, used_weapon = "Self-inflicted gunshot wound to the head.") - M.death() + user.visible_message("[src] goes off!") + user.apply_damage(200, BRUTE, "head", sharp =1, used_weapon = "Self-inflicted gunshot wound to the head.") + user.death() else - user.visible_message("[user] lowers the [src] from their head.") + user.visible_message("[user] lowers [src] from their head.") /obj/item/toy/russian_revolver/proc/spin_cylinder() From ec407fcf996994146f2dae945119a839a5c60208 Mon Sep 17 00:00:00 2001 From: Citinited Date: Sat, 3 Mar 2018 19:04:25 +0000 Subject: [PATCH 2/4] Formatting changes --- code/game/objects/items/toys.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 5877012eb87..8f50c16ba61 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1402,13 +1402,13 @@ obj/item/toy/cards/deck/syndicate/black if(bullet_position > 1) user.visible_message("*click*") playsound(src, 'sound/weapons/empty.ogg', 100, 1) - bullet_position -- + bullet_position-- return else bullet_position = null playsound(src, 'sound/weapons/Gunshot.ogg', 50, 1) user.visible_message("[src] goes off!") - user.apply_damage(200, BRUTE, "head", sharp =1, used_weapon = "Self-inflicted gunshot wound to the head.") + user.apply_damage(200, BRUTE, "head", sharp = 1, used_weapon = "Self-inflicted gunshot wound to the head.") user.death() else user.visible_message("[user] lowers [src] from their head.") From 466ffefbc6a3384889f9dd8f9b51968706f34fee Mon Sep 17 00:00:00 2001 From: Citinited Date: Tue, 6 Mar 2018 20:17:12 +0000 Subject: [PATCH 3/4] changes atom/target back to mob/living/human/M --- code/game/objects/items/toys.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 8f50c16ba61..35196d38d20 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1388,8 +1388,8 @@ obj/item/toy/cards/deck/syndicate/black user.visible_message("[user] spins the cylinder on [src]!") -/obj/item/toy/russian_revolver/attack(atom/target, mob/living/carbon/human/user) - if(target != user) //can't use this on other people +/obj/item/toy/russian_revolver/attack(mob/living/carbon/M, mob/living/carbon/human/user) + if(M != user) //can't use this on other people return if(!bullet_position) to_chat(user, "[src] is empty.") @@ -1398,7 +1398,7 @@ obj/item/toy/cards/deck/syndicate/black to_chat(user, "Playing this game without a head would be classed as cheating.") return user.visible_message("[user] points [src] at their head, ready to pull the trigger!") - if(do_after(user, 30, target = user)) + if(do_after(user, 30, M = user)) if(bullet_position > 1) user.visible_message("*click*") playsound(src, 'sound/weapons/empty.ogg', 100, 1) From e961a8fb86f749c011e46d6abadba4b7e3804a6e Mon Sep 17 00:00:00 2001 From: Citinited Date: Thu, 8 Mar 2018 01:18:37 +0000 Subject: [PATCH 4/4] hitsound for russian revolver, and you can hit people with it --- code/game/objects/items/toys.dm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 35196d38d20..e7e6bb7082f 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1357,6 +1357,7 @@ obj/item/toy/cards/deck/syndicate/black item_state = "gun" lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi' righthand_file = 'icons/mob/inhands/guns_righthand.dmi' + hitsound = "swing_hit" flags = CONDUCT slot_flags = SLOT_BELT materials = list(MAT_METAL=2000) @@ -1364,7 +1365,7 @@ obj/item/toy/cards/deck/syndicate/black throwforce = 5 throw_speed = 4 throw_range = 5 - force = 5.0 + force = 5 origin_tech = "combat=1" attack_verb = list("struck", "hit", "bashed") var/bullet_position = 1 @@ -1387,10 +1388,9 @@ obj/item/toy/cards/deck/syndicate/black spin_cylinder() user.visible_message("[user] spins the cylinder on [src]!") - -/obj/item/toy/russian_revolver/attack(mob/living/carbon/M, mob/living/carbon/human/user) +/obj/item/toy/russian_revolver/attack(mob/living/carbon/human/M, mob/living/carbon/human/user) if(M != user) //can't use this on other people - return + return ..() if(!bullet_position) to_chat(user, "[src] is empty.") return @@ -1398,7 +1398,7 @@ obj/item/toy/cards/deck/syndicate/black to_chat(user, "Playing this game without a head would be classed as cheating.") return user.visible_message("[user] points [src] at their head, ready to pull the trigger!") - if(do_after(user, 30, M = user)) + if(do_after(user, 30, target = user)) if(bullet_position > 1) user.visible_message("*click*") playsound(src, 'sound/weapons/empty.ogg', 100, 1) @@ -1413,7 +1413,6 @@ obj/item/toy/cards/deck/syndicate/black else user.visible_message("[user] lowers [src] from their head.") - /obj/item/toy/russian_revolver/proc/spin_cylinder() bullet_position = rand(1,6)