Files
CHOMPStation2/code/modules/clothing/head/hardhat.dm
Mloc-Argent e9bf414820 Refactors code to work with BYOND 500.
500 adds a "color" var to /atom, which conflicts with /obj/item/color, /obj/atmospherics/color and various simple_animals.
  /obj/item/color is now item_color
  /obj/atmospherics/color is now pipe_color
  simple_animals color is now body_color
Removes transformer.dm since it conflicted with transform() and was never used.

Signed-off-by: Mloc-Argent <colmohici@gmail.com>
2013-09-22 12:39:48 +01:00

66 lines
2.1 KiB
Plaintext

/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"
flags = FPRINT | TABLEPASS
item_state = "hardhat0_yellow"
var/brightness_on = 4 //luminosity when on
var/on = 0
item_color = "yellow" //Determines used sprites: hardhat[on]_[color] and hardhat[on]_[color]2 (lying down sprite)
armor = list(melee = 30, bullet = 5, laser = 20,energy = 10, bomb = 20, bio = 10, rad = 20)
flags_inv = 0
icon_action_button = "action_hardhat"
siemens_coefficient = 0.9
attack_self(mob/user)
if(!isturf(user.loc))
user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities.
return
on = !on
icon_state = "hardhat[on]_[item_color]"
item_state = "hardhat[on]_[item_color]"
if(on) user.SetLuminosity(user.luminosity + brightness_on)
else user.SetLuminosity(user.luminosity - brightness_on)
pickup(mob/user)
if(on)
user.SetLuminosity(user.luminosity + brightness_on)
// user.UpdateLuminosity() //TODO: Carn
SetLuminosity(0)
dropped(mob/user)
if(on)
user.SetLuminosity(user.luminosity - brightness_on)
// user.UpdateLuminosity()
SetLuminosity(brightness_on)
/obj/item/clothing/head/hardhat/orange
icon_state = "hardhat0_orange"
item_state = "hardhat0_orange"
item_color = "orange"
/obj/item/clothing/head/hardhat/red
icon_state = "hardhat0_red"
item_state = "hardhat0_red"
item_color = "red"
name = "firefighter helmet"
flags = FPRINT | TABLEPASS | STOPSPRESSUREDMAGE
heat_protection = HEAD
max_heat_protection_temperature = FIRE_HELMET_MAX_HEAT_PROTECITON_TEMPERATURE
/obj/item/clothing/head/hardhat/white
icon_state = "hardhat0_white"
item_state = "hardhat0_white"
item_color = "white"
flags = FPRINT | TABLEPASS | STOPSPRESSUREDMAGE
heat_protection = HEAD
max_heat_protection_temperature = FIRE_HELMET_MAX_HEAT_PROTECITON_TEMPERATURE
/obj/item/clothing/head/hardhat/dblue
icon_state = "hardhat0_dblue"
item_state = "hardhat0_dblue"
item_color = "dblue"