-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathkitchen_spike.dm
155 lines (139 loc) · 4.88 KB
/
kitchen_spike.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
//////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 = TRUE
anchored = FALSE
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))
if(!anchored)
to_chat(user, span_warning("[src] must be anchored first!"))
return
var/obj/item/stack/rods/R = I
if(R.get_amount() >= 4)
R.use(4)
to_chat(user, span_notice("You add spikes to the frame."))
var/obj/F = new /obj/structure/kitchenspike(src.loc)
transfer_fingerprints_to(F)
qdel(src)
else if(I.tool_behaviour == TOOL_WELDER)
if(!I.tool_start_check(user, amount=0))
return
to_chat(user, span_notice("You begin cutting \the [src] apart..."))
if(I.use_tool(src, user, 50, volume=50))
visible_message(span_notice("[user] slices apart \the [src]."),
span_notice("You cut \the [src] apart with \the [I]."),
span_italics("You hear welding."))
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 = TRUE
anchored = TRUE
buckle_lying = 0
can_buckle = 1
max_integrity = 250
/obj/structure/kitchenspike/attack_paw(mob/living/user, modifiers)
return attack_hand(user, modifiers)
/obj/structure/kitchenspike/crowbar_act(mob/living/user, obj/item/I, modifiers)
if(has_buckled_mobs())
to_chat(user, span_notice("You can't do that while something's on the spike!"))
return TRUE
if(I.use_tool(src, user, 20, volume=100))
to_chat(user, span_notice("You pry the spikes out of the frame."))
deconstruct(TRUE)
return TRUE
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/structure/kitchenspike/attack_hand(mob/living/user, modifiers)
if(VIABLE_MOB_CHECK(user.pulling) && user.combat_mode && !has_buckled_mobs())
var/mob/living/L = user.pulling
if(do_after(user, 12 SECONDS, src))
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_danger("[user] slams [L] onto the meat spike!"), span_userdanger("[user] slams you onto the meat spike!"), span_italics("You hear a squishy wet noise."))
L.forceMove(drop_location())
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 = 0.3 SECONDS)
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] tries to pull [M] free of [src]!",\
span_notice("[user] is trying to pull you off [src], opening up fresh wounds!"),\
span_italics("You hear a squishy wet noise."))
if(!do_after(user, 30 SECONDS, src))
if(M && M.buckled)
M.visible_message(\
"[user] fails to free [M]!",\
span_notice("[user] fails to pull you off of [src]."))
return
else
M.visible_message(\
span_warning("[M] struggles to break free from [src]!"),\
span_notice("You struggle to break free from [src], exacerbating your wounds! (Stay still for two minutes.)"),\
span_italics("You hear a wet squishing noise.."))
M.adjustBruteLoss(30)
if(!do_after(M, 2 MINUTES, src))
if(M && M.buckled)
to_chat(M, span_warning("You fail to free yourself!"))
return
if(!M.buckled)
return
release_mob(M)
/obj/structure/kitchenspike/proc/release_mob(mob/living/M)
var/matrix/m180 = matrix(M.transform)
m180.Turn(180)
animate(M, transform = m180, time = 0.3 SECONDS)
M.pixel_y = M.get_standard_pixel_y_offset(180)
M.adjustBruteLoss(30)
src.visible_message(span_danger("[M] falls free of [src]!"))
unbuckle_mob(M,force=1)
M.emote("scream")
M.AdjustParalyzed(2 SECONDS)
/obj/structure/kitchenspike/Destroy()
if(has_buckled_mobs())
for(var/mob/living/L in buckled_mobs)
release_mob(L)
return ..()
/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