|
5 | 5 | var/material
|
6 | 6 | var/datum/paint_overlay/paint_overlay = null
|
7 | 7 | var/list/stacked_paint = list()
|
| 8 | + var/active |
| 9 | + |
| 10 | +/obj/item/stack/tile/Destroy() |
| 11 | + ..() |
| 12 | + if(active) |
| 13 | + QDEL_NULL(active) |
| 14 | + |
| 15 | +/obj/item/stack/tile/dropped() |
| 16 | + ..() |
| 17 | + if(active) |
| 18 | + QDEL_NULL(active) |
8 | 19 |
|
9 | 20 | /obj/item/stack/tile/transfer_data_from(var/obj/item/stack/tile/S, var/amount)
|
10 | 21 | while(amount > 0)
|
|
67 | 78 | stacked_paint.len = 0
|
68 | 79 | update_icon()
|
69 | 80 |
|
70 |
| -/obj/item/stack/tile/metal |
71 |
| - name = "floor tile" |
72 |
| - singular_name = "floor tile" |
73 |
| - desc = "Those could work as a pretty decent throwing weapon." |
74 |
| - icon_state = "tile" |
75 |
| - w_class = W_CLASS_MEDIUM |
76 |
| - force = 6.0 |
77 |
| - starting_materials = list(MAT_IRON = 937.5) |
78 |
| - w_type = RECYK_METAL |
79 |
| - melt_temperature = MELTPOINT_STEEL |
80 |
| - throwforce = 10 |
81 |
| - throw_speed = 4 |
82 |
| - throw_range = 20 |
83 |
| - flags = FPRINT |
84 |
| - siemens_coefficient = 1 |
85 |
| - max_amount = 60 |
86 |
| - material = "metal" |
87 |
| - var/active |
88 |
| - |
89 |
| -/obj/item/stack/tile/metal/New(var/loc, var/amount=null) |
90 |
| - . = ..() |
91 |
| - pixel_x = rand(1, 14) * PIXEL_MULTIPLIER |
92 |
| - pixel_y = rand(1, 14) * PIXEL_MULTIPLIER |
93 |
| - |
94 |
| -/obj/item/stack/tile/metal/Destroy() |
95 |
| - ..() |
96 |
| - if(active) |
97 |
| - QDEL_NULL(active) |
| 81 | +/obj/item/stack/tile/proc/build() |
| 82 | + return |
98 | 83 |
|
99 |
| -/obj/item/stack/tile/metal/attack_self(mob/user) |
| 84 | +/obj/item/stack/tile/attack_self(mob/user) |
100 | 85 | if(!active) //Start click drag construction
|
101 | 86 | active = new /obj/abstract/screen/draggable(src, user)
|
102 | 87 | to_chat(user, "Beginning plating construction mode, click and hold to use.")
|
103 | 88 | return
|
104 | 89 | else //End click drag construction, create grille
|
105 |
| - qdel(active) |
| 90 | + QDEL_NULL(active) |
106 | 91 |
|
107 |
| -/obj/item/stack/tile/metal/can_drag_use(mob/user, turf/T) |
| 92 | +/obj/item/stack/tile/can_drag_use(mob/user, turf/T) |
108 | 93 | if(user.Adjacent(T)) //can we place here
|
109 | 94 | var/canbuild = T.canBuildPlating()
|
110 | 95 | if(canbuild == BUILD_SUCCESS || canbuild == BUILD_IGNORE || T.canBuildFloortile(src.type))
|
|
113 | 98 | else
|
114 | 99 | QDEL_NULL(active) //otherwise remove the draggable screen
|
115 | 100 |
|
116 |
| -/obj/item/stack/tile/metal/drag_use(mob/user, turf/T) |
| 101 | +/obj/item/stack/tile/drag_use(mob/user, turf/T) |
117 | 102 | if(T.canBuildFloortile(src.type) && istype(T,/turf/simulated/floor))
|
118 | 103 | var/turf/simulated/floor/F = T
|
119 | 104 | F.make_tiled_floor(src)
|
|
127 | 112 | playsound(T, 'sound/weapons/Genhit.ogg', 25, 1)
|
128 | 113 | build(T)
|
129 | 114 |
|
130 |
| -/obj/item/stack/tile/metal/end_drag_use() |
131 |
| - active = null |
| 115 | +/obj/item/stack/tile/end_drag_use() |
| 116 | + QDEL_NULL(active) |
132 | 117 |
|
133 |
| -/obj/item/stack/tile/metal/dropped() |
134 |
| - ..() |
135 |
| - if(active) |
136 |
| - QDEL_NULL(active) |
| 118 | +/obj/item/stack/tile/metal |
| 119 | + name = "floor tile" |
| 120 | + singular_name = "floor tile" |
| 121 | + desc = "Those could work as a pretty decent throwing weapon." |
| 122 | + icon_state = "tile" |
| 123 | + w_class = W_CLASS_MEDIUM |
| 124 | + force = 6.0 |
| 125 | + starting_materials = list(MAT_IRON = 937.5) |
| 126 | + w_type = RECYK_METAL |
| 127 | + melt_temperature = MELTPOINT_STEEL |
| 128 | + throwforce = 10 |
| 129 | + throw_speed = 4 |
| 130 | + throw_range = 20 |
| 131 | + flags = FPRINT |
| 132 | + siemens_coefficient = 1 |
| 133 | + max_amount = 60 |
| 134 | + material = "metal" |
| 135 | + |
| 136 | +/obj/item/stack/tile/metal/New(var/loc, var/amount=null) |
| 137 | + . = ..() |
| 138 | + pixel_x = rand(1, 14) * PIXEL_MULTIPLIER |
| 139 | + pixel_y = rand(1, 14) * PIXEL_MULTIPLIER |
137 | 140 |
|
138 |
| -/obj/item/stack/tile/metal/proc/build(turf/S as turf) |
| 141 | +/obj/item/stack/tile/metal/build(turf/S as turf) |
139 | 142 | if(S.air)
|
140 | 143 | var/datum/gas_mixture/GM = S.air
|
141 | 144 | if(GM.pressure > HALF_ATM)
|
|
189 | 192 | to_chat(user, "<span class='warning'>The plating is going to need some support.</span>")
|
190 | 193 | return
|
191 | 194 |
|
192 |
| - |
193 |
| -/obj/item/stack/tile/rglass/afterattack(atom/target, mob/user, adjacent, params) |
194 |
| - if(adjacent) |
195 |
| - if(isturf(target) || istype(target, /obj/structure/lattice)) |
196 |
| - var/turf/T = get_turf(target) |
197 |
| - switch(T.canBuildPlating()) |
198 |
| - if(BUILD_SUCCESS) |
199 |
| - playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) |
200 |
| - build(T) |
201 |
| - use(1) |
202 |
| - |
203 | 195 | /obj/item/stack/tile/rglass
|
204 | 196 | name = "glass tile"
|
205 |
| - singular_name = "tile" |
206 | 197 | desc = "A relatively clear reinforced glass tile."
|
207 | 198 | icon_state = "tile_rglass"
|
208 | 199 | max_amount = 60
|
| 200 | + var/air_type = /turf/simulated/floor/glass |
| 201 | + var/airless_type = /turf/simulated/floor/glass/airless |
209 | 202 |
|
210 |
| -/obj/item/stack/tile/rglass/proc/build(turf/S as turf) |
| 203 | +/obj/item/stack/tile/rglass/build(turf/S as turf) |
211 | 204 | var/obj/structure/lattice/L = S.canBuildCatwalk(src)
|
212 | 205 | if(istype(L))
|
213 |
| - playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) |
214 | 206 | qdel(L)
|
215 |
| - if(S.air) |
216 |
| - var/datum/gas_mixture/GM = S.air |
217 |
| - if(GM.pressure > HALF_ATM) |
218 |
| - S.ChangeTurf(/turf/simulated/floor/glass) |
219 |
| - return |
220 |
| - S.ChangeTurf(/turf/simulated/floor/glass/airless) |
221 |
| - |
| 207 | + if(S.air) |
| 208 | + var/datum/gas_mixture/GM = S.air |
| 209 | + if(GM.pressure > HALF_ATM) |
| 210 | + S.ChangeTurf(air_type) |
| 211 | + return |
| 212 | + S.ChangeTurf(airless_type) |
222 | 213 |
|
| 214 | +/obj/item/stack/tile/rglass/afterattack(atom/target, mob/user, adjacent, params) |
| 215 | + if(adjacent) |
| 216 | + if(isturf(target) || istype(target, /obj/structure/lattice)) |
| 217 | + var/turf/T = get_turf(target) |
| 218 | + switch(T.canBuildPlating()) |
| 219 | + if(BUILD_SUCCESS) |
| 220 | + playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) |
| 221 | + build(T) |
| 222 | + use(1) |
223 | 223 |
|
224 | 224 | /obj/item/stack/tile/rglass/plasma
|
225 | 225 | name = "plasma glass tile"
|
226 | 226 | singular_name = "tile"
|
227 | 227 | desc = "A relatively clear reinforced plasma glass tile."
|
228 | 228 | icon_state = "tile_plasmarglass"
|
229 |
| - |
230 |
| -/obj/item/stack/tile/rglass/plasma/build(turf/S as turf) |
231 |
| - var/obj/structure/lattice/L = S.canBuildCatwalk(src) |
232 |
| - if(istype(L)) |
233 |
| - playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) |
234 |
| - qdel(L) |
235 |
| - if(S.air) |
236 |
| - var/datum/gas_mixture/GM = S.air |
237 |
| - if(GM.pressure > HALF_ATM) |
238 |
| - S.ChangeTurf(/turf/simulated/floor/glass/plasma) |
239 |
| - return |
240 |
| - S.ChangeTurf(/turf/simulated/floor/glass/plasma/airless) |
| 229 | + air_type = /turf/simulated/floor/glass/plasma |
| 230 | + airless_type = /turf/simulated/floor/glass/plasma/airless |
241 | 231 |
|
242 | 232 | /obj/item/stack/tile/metal/plasteel
|
243 | 233 | name = "reinforced floor tile"
|
|
0 commit comments