From f70ecb438738871aa2b78814b6e62b3fdc96aee6 Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Fri, 29 Mar 2019 23:33:46 -0400 Subject: [PATCH] Adds Trick Revolver --- code/datums/uplink_item.dm | 8 ++ code/game/objects/items/toys.dm | 91 +++++++++++++------- code/modules/examine/descriptions/weapons.dm | 5 ++ 3 files changed, 71 insertions(+), 33 deletions(-) diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index 392908127d0..4a67b7626d4 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -182,6 +182,14 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) cost = 3 job = list("Clown") +/datum/uplink_item/jobspecific/trick_revolver + name = "Trick Revolver" + desc = "A revolver that will fire backwards and kill whoever attempts to use it. Perfect for those pesky vigilante or just a good laugh." + reference = "CTR" + item = /obj/item/toy/russian_revolver/trick_revolver + cost = 1 + job = list("Clown") + //mime /datum/uplink_item/jobspecific/caneshotgun name = "Cane Shotgun and Assassination Shells" diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 7607ca52319..c719dfe6ad4 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1372,7 +1372,8 @@ obj/item/toy/cards/deck/syndicate/black force = 5 origin_tech = "combat=1" attack_verb = list("struck", "hit", "bashed") - var/bullet_position = 1 + var/bullets_left = 0 + var/max_shots = 6 /obj/item/toy/russian_revolver/suicide_act(mob/user) user.visible_message("[user] quickly loads six bullets into [src]'s cylinder and points it at [user.p_their()] head before pulling the trigger! It looks like [user.p_theyre()] trying to commit suicide.") @@ -1380,46 +1381,70 @@ obj/item/toy/cards/deck/syndicate/black return BRUTELOSS /obj/item/toy/russian_revolver/New() - spin_cylinder() ..() - + spin_cylinder() /obj/item/toy/russian_revolver/attack_self(mob/user) - if(!bullet_position) - user.visible_message("[user] loads a bullet into [src]'s cylinder.") - bullet_position = 1 - else + if(!bullets_left) + user.visible_message("[user] loads a bullet into [src]'s cylinder before spinning it.") spin_cylinder() - user.visible_message("[user] spins the cylinder on [src]!") - -/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 ..() - if(!bullet_position) - to_chat(user, "[src] is empty.") - return - 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 [user.p_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-- - return - else - bullet_position = null - playsound(src, 'sound/weapons/gunshots/gunshot_strong.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.death() else - user.visible_message("[user] lowers [src] from [user.p_their()] head.") + user.visible_message("[user] spins the cylinder on [src]!") + spin_cylinder() + +/obj/item/toy/russian_revolver/attack(mob/M, mob/living/user) + return + +/obj/item/toy/russian_revolver/afterattack(atom/target, mob/user, proximity) + shoot_gun(user) /obj/item/toy/russian_revolver/proc/spin_cylinder() - bullet_position = rand(1,6) + bullets_left = rand(1, max_shots) +/obj/item/toy/russian_revolver/proc/post_shot(mob/user) + return + +/obj/item/toy/russian_revolver/proc/shoot_gun(mob/living/carbon/human/user) + if(bullets_left > 1) + bullets_left-- + user.visible_message("*click*") + playsound(src, 'sound/weapons/empty.ogg', 100, 1) + return FALSE + if(bullets_left == 1) + bullets_left = 0 + var/zone = "head" + if(!(user.has_organ(zone))) // If they somehow don't have a head. + zone = "chest" + playsound(src, 'sound/weapons/gunshots/gunshot_strong.ogg', 50, 1) + user.visible_message("[src] goes off!") + post_shot(user) + user.apply_damage(300, BRUTE, zone, sharp = TRUE, used_weapon = "Self-inflicted gunshot wound to the [zone].") + user.bleed(BLOOD_VOLUME_NORMAL) + user.death() // Just in case + return TRUE + else + to_chat(user, "[src] needs to be reloaded.") + return FALSE + +/obj/item/toy/russian_revolver/trick_revolver + name = "\improper .357 revolver" + desc = "A suspicious revolver. Uses .357 ammo." + icon_state = "revolver" + max_shots = 1 + var/fake_bullets = 0 + +/obj/item/toy/russian_revolver/trick_revolver/New() + ..() + fake_bullets = rand(2, 7) + +/obj/item/toy/russian_revolver/trick_revolver/examine(mob/user) //Sneaky sneaky + ..() + to_chat(user, "Has [fake_bullets] round\s remaining.") + to_chat(user, "[fake_bullets] of those are live rounds.") + +/obj/item/toy/russian_revolver/trick_revolver/post_shot(user) + to_chat(user, "[src] did look pretty dodgey!") + SEND_SOUND(user, 'sound/misc/sadtrombone.ogg') //HONK /* * Rubber Chainsaw */ diff --git a/code/modules/examine/descriptions/weapons.dm b/code/modules/examine/descriptions/weapons.dm index 98f60d01ac4..286391f1387 100644 --- a/code/modules/examine/descriptions/weapons.dm +++ b/code/modules/examine/descriptions/weapons.dm @@ -55,6 +55,11 @@ then click where you want to fire. After firing, you will need to pump the gun, by clicking on the gun in your hand. To reload, load more shotgun \ shells into the gun." +/obj/item/toy/russian_revolver/trick_revolver //oh no + description_info = "This is a ballistic weapon. To fire the weapon, have your gun mode set to 'fire', \ + then click where you want to fire. To reload, click the weapon in your hand to unload (if needed), then add the appropriate ammo. The description \ + will tell you what caliber you need." + //******* //*Melee* //*******