Adds the reverse bear trap item, available to traitor clowns in the uplink for 5 TC (#34849)

* Do you want to play a game?

* removes leftover code from earlier dev

* Some things

* optimizations, from the heart, for the soul
This commit is contained in:
Ashe Higgs
2018-01-29 15:33:40 -05:00
committed by CitadelStationBot
parent 89fa4b0f28
commit 597b2864eb
8 changed files with 152 additions and 1 deletions
+11 -1
View File
@@ -34,4 +34,14 @@
#undef RAD_GEIGER_LOW
#undef RAD_GEIGER_MEDIUM
#undef RAD_GEIGER_HIGH
#undef RAD_GEIGER_HIGH
/datum/looping_sound/reverse_bear_trap
mid_sounds = list('sound/effects/clock_tick.ogg')
mid_length = 3.5
volume = 25
/datum/looping_sound/reverse_bear_trap_beep
mid_sounds = list('sound/machines/beep.ogg')
mid_length = 60
volume = 10
@@ -0,0 +1,131 @@
/obj/item/device/reverse_bear_trap
name = "reverse bear trap"
desc = "A horrifying set of shut metal jaws, rigged to a kitchen timer and secured by padlock to a head-mounted clamp. To apply, hit someone with it."
icon_state = "reverse_bear_trap"
slot_flags = SLOT_HEAD
flags_1 = CONDUCT_1
resistance_flags = FIRE_PROOF | UNACIDABLE
w_class = WEIGHT_CLASS_NORMAL
obj_integrity = 300
max_integrity = 300
item_state = "rack_parts"
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
var/ticking = FALSE
var/time_left = 60 //seconds remaining until pop
var/escape_chance = 0 //chance per "fiddle" to get the trap off your head
var/struggling = FALSE
var/time_since_last_beep = 0
var/datum/looping_sound/reverse_bear_trap/soundloop
var/datum/looping_sound/reverse_bear_trap_beep/soundloop2
/obj/item/device/reverse_bear_trap/Initialize()
. = ..()
soundloop = new(list(src))
soundloop2 = new(list(src))
/obj/item/device/reverse_bear_trap/Destroy()
QDEL_NULL(soundloop)
QDEL_NULL(soundloop2)
STOP_PROCESSING(SSprocessing, src)
return ..()
/obj/item/device/reverse_bear_trap/process()
if(!ticking)
return
time_left--
soundloop2.mid_length = max(0.5, time_left - 5) //beepbeepbeepbeepbeep
if(!time_left || !isliving(loc))
playsound(src, 'sound/machines/microwave/microwave-end.ogg', 100, FALSE)
soundloop.stop()
soundloop2.stop()
to_chat(loc, "<span class='userdanger'>*ding*</span>")
addtimer(CALLBACK(src, .proc/snap), 2)
/obj/item/device/reverse_bear_trap/attack_hand(mob/user)
if(iscarbon(user))
var/mob/living/carbon/C = user
if(C.get_item_by_slot(slot_head) == src)
if(flags_1 & NODROP_1 && !struggling)
struggling = TRUE
var/fear_string
switch(time_left)
if(0 to 5)
fear_string = "agonizingly"
if(5 to 20)
fear_string = "desperately"
if(20 to 40)
fear_string = "panickedly"
if(40 to 50)
fear_string = "shakily"
if(50 to 60)
fear_string = ""
C.visible_message("<span class='danger'>[C] fiddles with and pulls at [src]...</span>", \
"<span class='danger'>You [fear_string] try to pull at [src]...</span>", "<i>You hear clicking and ticking.</i>")
if(!do_after(user, 20, target = src))
struggling = FALSE
return
if(!prob(escape_chance))
to_chat(user, "<span class='warning'>It doesn't budge!</span>")
escape_chance++
else
user.visible_message("<span class='warning'>The lock on [user]'s [name] pops open!</span>", \
"<span class='userdanger'>You force open the padlock!</span>", "<i>You hear a single, pronounced click!</i>")
flags_1 &= ~NODROP_1
struggling = FALSE
else
..()
return
..()
/obj/item/device/reverse_bear_trap/attack(mob/living/target, mob/living/user)
if(target.get_item_by_slot(slot_head))
to_chat(user, "<span class='warning'>Remove their headgear first!</span>")
return
target.visible_message("<span class='warning'>[user] starts forcing [src] onto [target]'s head!</span>", \
"<span class='userdanger'>[target] starts forcing [src] onto your head!</span>", "<i>You hear clanking.</i>")
to_chat(user, "<span class='danger'>You start forcing [src] onto [target]'s head...</span>")
if(!do_after(user, 30, target = target) || target.get_item_by_slot(slot_head))
return
target.visible_message("<span class='warning'>[user] forces and locks [src] onto [target]'s head!</span>", \
"<span class='userdanger'>[target] locks [src] onto your head!</span>", "<i>You hear a click, and then a timer ticking down.</i>")
to_chat(user, "<span class='danger'>You force [src] onto [target]'s head and click the padlock shut.</span>")
user.dropItemToGround(src)
target.equip_to_slot_if_possible(src, slot_head)
arm()
notify_ghosts("[user] put a reverse bear trap on [target]!", source = src, action = NOTIFY_ORBIT, ghost_sound = 'sound/machines/beep.ogg')
/obj/item/device/reverse_bear_trap/proc/snap()
reset()
var/mob/living/carbon/human/H = loc
if(!istype(H) || H.get_item_by_slot(slot_head) != src)
visible_message("<span class='warning'>[src]'s jaws snap open with an ear-piercing crack!</span>")
playsound(src, 'sound/effects/snap.ogg', 75, TRUE)
else
var/mob/living/carbon/human/jill = loc
jill.visible_message("<span class='boldwarning'>[src] goes off in [jill]'s mouth, ripping their head apart!</span>", "<span class='userdanger'>[src] goes off!</span>")
jill.emote("scream")
playsound(src, 'sound/effects/snap.ogg', 75, TRUE, frequency = 0.5)
playsound(src, 'sound/effects/splat.ogg', 50, TRUE, frequency = 0.5)
jill.apply_damage(9999, BRUTE, "head")
jill.death() //just in case, for some reason, they're still alive
flash_color(jill, flash_color = "#FF0000", flash_time = 100)
/obj/item/device/reverse_bear_trap/proc/reset()
ticking = FALSE
flags_1 &= ~NODROP_1
soundloop.stop()
soundloop2.stop()
STOP_PROCESSING(SSprocessing, src)
/obj/item/device/reverse_bear_trap/proc/arm() //hulen
ticking = TRUE
escape_chance = initial(escape_chance) //we keep these vars until re-arm, for tracking purposes
time_left = initial(time_left)
flags_1 |= NODROP_1
soundloop.start()
soundloop2.mid_length = initial(soundloop2.mid_length)
soundloop2.start()
START_PROCESSING(SSprocessing, src)
+9
View File
@@ -1211,6 +1211,15 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once.
item = /obj/item/storage/box/hug/reverse_revolver
restricted_roles = list("Clown")
/datum/uplink_item/role_restricted/reverse_bear_trap
name = "Reverse Bear Trap"
desc = "An ingenious execution device worn on (or forced onto) the head. Arming it starts a 1-minute kitchen timer mounted on the bear trap. When it goes off, the trap's jaws will \
violently open, instantly killing anyone wearing it by tearing their jaws in half. To arm, attack someone with it while they're not wearing headgear, and you will force it onto their \
head after three seconds uninterrupted."
cost = 5
item = /obj/item/device/reverse_bear_trap
restricted_roles = list("Clown")
/datum/uplink_item/role_restricted/mimery
name = "Guide to Advanced Mimery Series"
desc = "The classical two part series on how to further hone your mime skills. Upon studying the series, the user should be able to make 3x1 invisible walls, and shoot bullets out of their fingers. Obviously only works for Mimes."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.
Binary file not shown.
+1
View File
@@ -953,6 +953,7 @@
#include "code\game\objects\items\devices\pipe_painter.dm"
#include "code\game\objects\items\devices\powersink.dm"
#include "code\game\objects\items\devices\pressureplates.dm"
#include "code\game\objects\items\devices\reverse_bear_trap.dm"
#include "code\game\objects\items\devices\scanners.dm"
#include "code\game\objects\items\devices\sensor_device.dm"
#include "code\game\objects\items\devices\taperecorder.dm"