-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
bed.dm
190 lines (162 loc) · 5.31 KB
/
bed.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/* Beds... get your mind out of the gutter, they're for sleeping!
* Contains:
* Beds
* Roller beds
* Dog Beds
*/
/*
* Beds
*/
/obj/structure/bed
name = "bed"
desc = "This is used to lie in, sleep in or strap on."
icon = 'icons/obj/objects.dmi'
icon_state = "bed"
can_buckle = TRUE
anchored = TRUE
buckle_lying = TRUE
resistance_flags = FLAMMABLE
max_integrity = 100
integrity_failure = 30
var/buildstacktype = /obj/item/stack/sheet/metal
var/buildstackamount = 2
buckle_offset = -6
var/comfort = 2 // default comfort
/obj/structure/bed/psych
name = "psych bed"
desc = "For prime comfort during psychiatric evaluations."
icon_state = "psychbed"
buildstackamount = 5
/obj/structure/bed/wooden_lounge_chair
name = "wooden lounge chair"
desc = "Time to lay back and soak in the solar rays."
icon_state = "wooden_lounge_chair"
can_buckle = TRUE
anchored = TRUE
buckle_lying = TRUE
resistance_flags = FLAMMABLE
max_integrity = 100
integrity_failure = 30
buildstacktype = /obj/item/stack/sheet/wood
buildstackamount = 5
/obj/structure/bed/alien
name = "resting contraption"
desc = "This looks similar to contraptions from Earth. Could aliens be stealing our technology?"
icon_state = "abed"
comfort = 0.3
/obj/structure/bed/proc/handle_rotation()
return
/obj/structure/bed/wrench_act(mob/user, obj/item/I)
. = TRUE
if(flags & NODECONSTRUCT)
to_chat(user, "<span class='warning'>You can't figure out how to deconstruct [src]!</span>")
return
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
deconstruct(TRUE)
/obj/structure/bed/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
if(buildstacktype)
new buildstacktype(loc, buildstackamount)
..()
/*
* Roller beds
*/
/obj/structure/bed/roller
name = "roller bed"
icon = 'icons/obj/rollerbed.dmi'
icon_state = "down"
resistance_flags = NONE
anchored = FALSE
comfort = 1
/obj/structure/bed/roller/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/roller_holder))
if(has_buckled_mobs())
if(buckled_mobs.len > 1)
unbuckle_all_mobs()
user.visible_message("<span class='notice'>[user] unbuckles all creatures from [src].</span>")
else
user_unbuckle_mob(buckled_mobs[1], user)
else
user.visible_message("<span class='notice'>[user] collapses \the [name].</span>", "<span class='notice'>You collapse \the [name].</span>")
new/obj/item/roller(get_turf(src))
qdel(src)
else
return ..()
/obj/structure/bed/roller/post_buckle_mob(mob/living/M)
density = TRUE
icon_state = "up"
M.pixel_y = initial(M.pixel_y)
/obj/structure/bed/roller/post_unbuckle_mob(mob/living/M)
density = FALSE
icon_state = "down"
M.pixel_x = M.get_standard_pixel_x_offset(M.lying)
M.pixel_y = M.get_standard_pixel_y_offset(M.lying)
/obj/item/roller
name = "roller bed"
desc = "A collapsed roller bed that can be carried around."
icon = 'icons/obj/rollerbed.dmi'
icon_state = "folded"
w_class = WEIGHT_CLASS_BULKY // Can't be put in backpacks.
/obj/item/roller/attack_self(mob/user)
var/obj/structure/bed/roller/R = new /obj/structure/bed/roller(user.loc)
R.add_fingerprint(user)
qdel(src)
/obj/item/roller/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/roller_holder))
var/obj/item/roller_holder/RH = W
if(!RH.held)
user.visible_message("<span class='notice'>[user] collects \the [name].</span>", "<span class='notice'>You collect \the [name].</span>")
forceMove(RH)
RH.held = src
/obj/structure/bed/roller/MouseDrop(over_object, src_location, over_location)
..()
if(over_object == usr && Adjacent(usr) && (in_range(src, usr) || usr.contents.Find(src)))
if(!ishuman(usr))
return
if(has_buckled_mobs())
return 0
usr.visible_message("<span class='notice'>[usr] collapses \the [name].</span>", "<span class='notice'>You collapse \the [name].</span>")
new/obj/item/roller(get_turf(src))
qdel(src)
/obj/item/roller_holder
name = "roller bed rack"
desc = "A rack for carrying a collapsed roller bed."
icon = 'icons/obj/rollerbed.dmi'
icon_state = "folded"
var/obj/item/roller/held
/obj/item/roller_holder/New()
..()
held = new /obj/item/roller(src)
/obj/item/roller_holder/attack_self(mob/user as mob)
if(!held)
to_chat(user, "<span class='info'> The rack is empty.</span>")
return
to_chat(user, "<span class='notice'>You deploy the roller bed.</span>")
var/obj/structure/bed/roller/R = new /obj/structure/bed/roller(user.loc)
R.add_fingerprint(user)
QDEL_NULL(held)
/*
* Dog beds
*/
/obj/structure/bed/dogbed
name = "dog bed"
icon_state = "dogbed"
desc = "A comfy-looking dog bed. You can even strap your pet in, just in case the gravity turns off."
anchored = FALSE
buildstackamount = 10
buildstacktype = /obj/item/stack/sheet/wood
buckle_offset = 0
comfort = 0.5
/obj/structure/bed/dogbed/ian
name = "Ian's bed"
desc = "Ian's bed! Looks comfy."
anchored = TRUE
/obj/structure/bed/dogbed/renault
desc = "Renault's bed! Looks comfy. A foxy person needs a foxy pet."
name = "Renault's bed"
anchored = TRUE
/obj/structure/bed/dogbed/runtime
desc = "A comfy-looking cat bed. You can even strap your pet in, in case the gravity turns off."
name = "Runtime's bed"
anchored = TRUE