Files
Bubberstation/code/game/objects/structures/kitchen_spike.dm
MrPerson 9dd81f1da8 Puts files in single quotes like they belong
This means they're included into the rsc and sent out althogh almost all of these files were already included elsewhere. Also DM will yell if the file couldn't be found for whatever reason like if someone moves or renames it.

I left out some file types for various reasons
dmis used in overlays: I have another pr I'll do later which will fix all of them and I don't want to conflict with myself
text files: they would get included in the rsc, which is completely unnecessary. However they're small, so they might be worth including anyway
2017-02-12 07:15:18 -08:00

154 lines
5.2 KiB
Plaintext

//////Kitchen Spike
#define VIABLE_MOB_CHECK(X) (isliving(X) && !issilicon(X) && !isbot(X))
/obj/structure/kitchenspike_frame
name = "meatspike frame"
icon = 'icons/obj/kitchen.dmi'
icon_state = "spikeframe"
desc = "The frame of a meat spike."
density = 1
anchored = 0
obj_integrity = 200
max_integrity = 200
/obj/structure/kitchenspike_frame/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
if(default_unfasten_wrench(user, I))
return
else if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I
if(R.get_amount() >= 4)
R.use(4)
user << "<span class='notice'>You add spikes to the frame.</span>"
var/obj/F = new /obj/structure/kitchenspike(src.loc)
transfer_fingerprints_to(F)
qdel(src)
else if(istype(I, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = I
if(!WT.remove_fuel(0, user))
return
user << "<span class='notice'>You begin cutting \the [src] apart...</span>"
playsound(src.loc, WT.usesound, 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(!WT.isOn())
return
playsound(src.loc, WT.usesound, 50, 1)
visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [WT].</span>",
"<span class='italics'>You hear welding.</span>")
new /obj/item/stack/sheet/metal(src.loc, 4)
qdel(src)
return
else
return ..()
/obj/structure/kitchenspike
name = "meat spike"
icon = 'icons/obj/kitchen.dmi'
icon_state = "spike"
desc = "A spike for collecting meat from animals"
density = 1
anchored = 1
buckle_lying = 0
can_buckle = 1
obj_integrity = 250
max_integrity = 250
/obj/structure/kitchenspike/attack_paw(mob/user)
return src.attack_hand(usr)
/obj/structure/kitchenspike/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/crowbar))
if(!has_buckled_mobs())
playsound(loc, I.usesound, 100, 1)
if(do_after(user, 20*I.toolspeed, target = src))
user << "<span class='notice'>You pry the spikes out of the frame.</span>"
deconstruct(TRUE)
else
user << "<span class='notice'>You can't do that while something's on the spike!</span>"
else
return ..()
/obj/structure/kitchenspike/attack_hand(mob/user)
if(VIABLE_MOB_CHECK(user.pulling) && user.a_intent == INTENT_GRAB && !has_buckled_mobs())
var/mob/living/L = user.pulling
if(do_mob(user, src, 120))
if(has_buckled_mobs()) //to prevent spam/queing up attacks
return
if(L.buckled)
return
if(user.pulling != L)
return
playsound(src.loc, 'sound/effects/splat.ogg', 25, 1)
L.visible_message("<span class='danger'>[user] slams [L] onto the meat spike!</span>", "<span class='userdanger'>[user] slams you onto the meat spike!</span>", "<span class='italics'>You hear a squishy wet noise.</span>")
L.loc = src.loc
L.emote("scream")
L.add_splatter_floor()
L.adjustBruteLoss(30)
L.setDir(2)
buckle_mob(L, force=1)
var/matrix/m180 = matrix(L.transform)
m180.Turn(180)
animate(L, transform = m180, time = 3)
L.pixel_y = L.get_standard_pixel_y_offset(180)
else if (has_buckled_mobs())
for(var/mob/living/L in buckled_mobs)
user_unbuckle_mob(L, user)
else
..()
/obj/structure/kitchenspike/user_buckle_mob(mob/living/M, mob/living/user) //Don't want them getting put on the rack other than by spiking
return
/obj/structure/kitchenspike/user_unbuckle_mob(mob/living/buckled_mob, mob/living/carbon/human/user)
if(buckled_mob)
var/mob/living/M = buckled_mob
if(M != user)
M.visible_message(\
"[user.name] tries to pull [M.name] free of the [src]!",\
"<span class='notice'>[user.name] is trying to pull you off the [src], opening up fresh wounds!</span>",\
"<span class='italics'>You hear a squishy wet noise.</span>")
if(!do_after(user, 300, target = src))
if(M && M.buckled)
M.visible_message(\
"[user.name] fails to free [M.name]!",\
"<span class='notice'>[user.name] fails to pull you off of the [src].</span>")
return
else
M.visible_message(\
"<span class='warning'>[M.name] struggles to break free from the [src]!</span>",\
"<span class='notice'>You struggle to break free from the [src], exacerbating your wounds! (Stay still for two minutes.)</span>",\
"<span class='italics'>You hear a wet squishing noise..</span>")
M.adjustBruteLoss(30)
if(!do_after(M, 1200, target = src))
if(M && M.buckled)
M << "<span class='warning'>You fail to free yourself!</span>"
return
if(!M.buckled)
return
var/matrix/m180 = matrix(M.transform)
m180.Turn(180)
animate(M, transform = m180, time = 3)
M.pixel_y = M.get_standard_pixel_y_offset(180)
M.adjustBruteLoss(30)
src.visible_message(text("<span class='danger'>[M] falls free of the [src]!</span>"))
unbuckle_mob(M,force=1)
M.emote("scream")
M.AdjustWeakened(10)
/obj/structure/kitchenspike/deconstruct(disassembled = TRUE)
if(disassembled)
var/obj/F = new /obj/structure/kitchenspike_frame(src.loc)
transfer_fingerprints_to(F)
else
new /obj/item/stack/sheet/metal(src.loc, 4)
new /obj/item/stack/rods(loc, 4)
qdel(src)
#undef VIABLE_MOB_CHECK