Russian revolver refactor; you can no longer play RR without a head

This commit is contained in:
Citinited
2018-03-02 22:33:03 +00:00
parent 1ef0c8e2c0
commit 0c818b0d8e
+22 -20
View File
@@ -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("<span class='suicide'>[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.</span>")
user.visible_message("<span class='suicide'>[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.</span>")
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("<span class='warning'>[user] loads a bullet into the [src]'s cylinder.</span>")
is_empty = 0
if(!bullet_position)
user.visible_message("<span class='warning'>[user] loads a bullet into [src]'s cylinder.</span>")
bullet_position = 1
else
spin_cylinder()
user.visible_message("<span class='warning'>[user] spins the cylinder on the [src]!</span>")
user.visible_message("<span class='warning'>[user] spins the cylinder on [src]!</span>")
/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, "<span class='notice'>The [src] is empty.</span>")
if(!bullet_position)
to_chat(user, "<span class='notice'>[src] is empty.</span>")
return
user.visible_message("<span class='danger'>[user] points the [src] at their head, ready to pull the trigger!</span>")
if(do_after(user, 30, target = M))
if(bullet_position != 1)
if(!(user.has_organ("head"))) //For sanity
to_chat(user, "<span class='notice'>Playing this game without a head would be classed as cheating.</span>")
return
user.visible_message("<span class='danger'>[user] points [src] at their head, ready to pull the trigger!</span>")
if(do_after(user, 30, target = user))
if(bullet_position > 1)
user.visible_message("<span class='danger'>*click*</span>")
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("<span class='danger'>The [src] goes off!</span>")
M.apply_damage(200, BRUTE, "head", sharp =1, used_weapon = "Self-inflicted gunshot wound to the head.")
M.death()
user.visible_message("<span class='danger'>[src] goes off!</span>")
user.apply_damage(200, BRUTE, "head", sharp =1, used_weapon = "Self-inflicted gunshot wound to the head.")
user.death()
else
user.visible_message("<span class='danger'>[user] lowers the [src] from their head.</span>")
user.visible_message("<span class='danger'>[user] lowers [src] from their head.</span>")
/obj/item/toy/russian_revolver/proc/spin_cylinder()