-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
hardhat.dm
185 lines (159 loc) · 6.44 KB
/
hardhat.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
/obj/item/clothing/head/hardhat
name = "hard hat"
desc = "A piece of headgear used in dangerous working conditions to protect the head. Comes with a built-in flashlight."
icon_state = "hardhat0_yellow"
item_state = "hardhat0_yellow"
worn_icon = 'icons/mob/clothing/head/head.dmi'
armor = list(MELEE = 15, BULLET = 5, LASER = 20, ENERGY = 10, BOMB = 20, BIO = 10, RAD = 20, FIRE = 100, ACID = 50, WOUND = 10, ELECTRIC = 100) // now OSHA-compliant!
flags_inv = 0
actions_types = list(/datum/action/item_action/toggle_helmet_light)
resistance_flags = FIRE_PROOF
dynamic_hair_suffix = "+generic"
hattable = FALSE
light_system = MOVABLE_LIGHT
light_range = 4
light_power = 0.8
light_on = FALSE
dog_fashion = /datum/dog_fashion/head
//Determines used sprites: hardhat[on]_[hat_type]
var/hat_type = "yellow"
///Whether the headlamp is on or off.
var/on = FALSE
/obj/item/clothing/head/hardhat/attack_self(mob/living/user)
toggle_helmet_light(user)
/obj/item/clothing/head/hardhat/proc/toggle_helmet_light(mob/living/user)
on = !on
if(on)
turn_on(user)
else
turn_off(user)
update_appearance(UPDATE_ICON)
/obj/item/clothing/head/hardhat/update_icon_state()
. = ..()
icon_state = "hardhat[on]_[hat_type]"
item_state = "hardhat[on]_[hat_type]"
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.update_inv_head()
for(var/datum/action/A as anything in actions)
A.build_all_button_icons(force = TRUE)
/obj/item/clothing/head/hardhat/proc/turn_on(mob/user)
set_light_on(TRUE)
/obj/item/clothing/head/hardhat/proc/turn_off(mob/user)
set_light_on(FALSE)
/obj/item/clothing/head/hardhat/orange
icon_state = "hardhat0_orange"
item_state = "hardhat0_orange"
hat_type = "orange"
dog_fashion = null
/obj/item/clothing/head/hardhat/red
icon_state = "hardhat0_red"
item_state = "hardhat0_red"
hat_type = "red"
dog_fashion = null
name = "firefighter helmet"
clothing_flags = STOPSHIGHPRESSURE
heat_protection = HEAD
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
cold_protection = HEAD
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
/obj/item/clothing/head/hardhat/red/upgraded
name = "workplace-ready firefighter helmet"
desc = "By applying state of the art lighting technology to a fire helmet, and using photo-chemical hardening methods, this hardhat will protect you from robust workplace hazards."
icon_state = "hardhat0_purple"
item_state = "hardhat0_purple"
light_range = 5
heat_protection = HEAD
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
cold_protection = HEAD
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
custom_materials = list(/datum/material/iron = 4000, /datum/material/glass = 1000, /datum/material/plastic = 3000, /datum/material/silver = 500)
hat_type = "purple"
/obj/item/clothing/head/hardhat/white
icon_state = "hardhat0_white"
item_state = "hardhat0_white"
hat_type = "white"
clothing_flags = STOPSHIGHPRESSURE
heat_protection = HEAD
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
cold_protection = HEAD
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
dog_fashion = /datum/dog_fashion/head
/obj/item/clothing/head/hardhat/dblue
icon_state = "hardhat0_dblue"
item_state = "hardhat0_dblue"
hat_type = "dblue"
dog_fashion = null
/obj/item/clothing/head/hardhat/atmos
icon_state = "hardhat0_atmos"
item_state = "hardhat0_atmos"
hat_type = "atmos"
dog_fashion = null
name = "atmospheric technician's firefighting helmet"
desc = "A firefighter's helmet, able to keep the user cool in any situation."
clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL | BLOCK_GAS_SMOKE_EFFECT | HEADINTERNALS
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
heat_protection = HEAD
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
cold_protection = HEAD
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
/obj/item/clothing/head/hardhat/weldhat
name = "welding hard hat"
desc = "A piece of headgear used in dangerous working conditions to protect the head. Comes with a built-in flashlight AND welding shield! The bulb seems a little smaller though."
light_range = 3 //Needs a little bit of tradeoff
dog_fashion = null
actions_types = list(/datum/action/item_action/toggle_helmet_light, /datum/action/item_action/toggle_welding_screen)
flash_protect = 2
tint = 2
flags_inv = HIDEEYES | HIDEFACE
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT
visor_flags_inv = HIDEEYES | HIDEFACE
visor_flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
/obj/item/clothing/head/hardhat/weldhat/Initialize(mapload)
. = ..()
update_appearance(UPDATE_ICON)
/obj/item/clothing/head/hardhat/weldhat/attack_self(mob/living/user)
toggle_helmet_light(user)
/obj/item/clothing/head/hardhat/weldhat/AltClick(mob/user)
if(user.canUseTopic(src, BE_CLOSE))
toggle_welding_screen(user)
/obj/item/clothing/head/hardhat/weldhat/ui_action_click(mob/user, actiontype)
if(istype(actiontype, /datum/action/item_action/toggle_welding_screen))
toggle_welding_screen(user)
return
return ..()
/obj/item/clothing/head/hardhat/weldhat/proc/toggle_welding_screen(mob/living/user)
if(weldingvisortoggle(user))
playsound(src, 'sound/mecha/mechmove03.ogg', 50, 1) //Visors don't just come from nothing
update_appearance(UPDATE_ICON)
/obj/item/clothing/head/hardhat/weldhat/worn_overlays(mutable_appearance/standing, isinhands = FALSE, icon_file)
. = ..()
if(isinhands)
return
if(!up)
. += mutable_appearance('icons/mob/clothing/head/head.dmi', "weldvisor")
/obj/item/clothing/head/hardhat/weldhat/update_overlays()
. = ..()
if(!up)
. += "weldvisor"
/obj/item/clothing/head/hardhat/weldhat/orange
icon_state = "hardhat0_orange"
item_state = "hardhat0_orange"
hat_type = "orange"
/obj/item/clothing/head/hardhat/weldhat/white
desc = "A piece of headgear used in dangerous working conditions to protect the head. Comes with a built-in flashlight AND welding shield!" //This bulb is not smaller
icon_state = "hardhat0_white"
item_state = "hardhat0_white"
light_range = 4 //Boss always takes the best stuff
hat_type = "white"
clothing_flags = STOPSPRESSUREDAMAGE
heat_protection = HEAD
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
cold_protection = HEAD
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
/obj/item/clothing/head/hardhat/weldhat/dblue
icon_state = "hardhat0_dblue"
item_state = "hardhat0_dblue"
hat_type = "dblue"