Skip to content

Commit

Permalink
-Added welding goggles, sprites by WJohnston. Aren't on the map yet a…
Browse files Browse the repository at this point in the history
…s I'm waiting for it to be free.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4893 316c924e-a436-60f5-8080-3fe189b3f50e
  • Loading branch information
giacomand@gmail.com committed Oct 16, 2012
1 parent 2ae7aee commit 9e0d1ca
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 25 deletions.
33 changes: 33 additions & 0 deletions code/modules/clothing/glasses/glasses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,39 @@
item_state = "sunglasses"
darkness_view = -1

/obj/item/clothing/glasses/welding
name = "welding goggles"
desc = "Protects the eyes from welders, approved by the mad scientist association."
icon_state = "welding-g"
item_state = "welding-g"
icon_action_button = "action_welding_g"
var/up = 0

/obj/item/clothing/glasses/welding/attack_self()
toggle()


/obj/item/clothing/glasses/welding/verb/toggle()
set category = "Object"
set name = "Adjust welding goggles"
set src in usr

if(usr.canmove && !usr.stat && !usr.restrained())
if(src.up)
src.up = !src.up
src.flags |= GLASSESCOVERSEYES
flags_inv |= HIDEEYES
icon_state = initial(icon_state)
usr << "You flip the [src] down to protect your eyes."
else
src.up = !src.up
src.flags &= ~HEADCOVERSEYES
flags_inv &= ~HIDEEYES
icon_state = "[initial(icon_state)]up"
usr << "You push the [src] up out of your face."

usr.update_inv_glasses()

/obj/item/clothing/glasses/sunglasses/blindfold
name = "blindfold"
desc = "Covers the eyes, preventing sight."
Expand Down
46 changes: 23 additions & 23 deletions code/modules/clothing/head/misc_special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
icon_action_button = "action_welding"

attack_self()
toggle()


verb/toggle()
set category = "Object"
set name = "Adjust welding mask"
set src in usr

if(usr.canmove && !usr.stat && !usr.restrained())
if(src.up)
src.up = !src.up
src.flags |= HEADCOVERSEYES | HEADCOVERSMOUTH
flags_inv |= HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
icon_state = "welding"
usr << "You flip the mask down to protect your eyes."
else
src.up = !src.up
src.flags &= ~HEADCOVERSEYES | HEADCOVERSMOUTH
flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
icon_state = "weldingup"
usr << "You push the mask up out of your face."
usr.update_inv_head() //so our mob-overlays update
/obj/item/clothing/head/welding/attack_self()
toggle()


/obj/item/clothing/head/welding/verb/toggle()
set category = "Object"
set name = "Adjust welding mask"
set src in usr

if(usr.canmove && !usr.stat && !usr.restrained())
if(src.up)
src.up = !src.up
src.flags |= HEADCOVERSEYES | HEADCOVERSMOUTH
flags_inv |= HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
icon_state = initial(icon_state)
usr << "You flip the [src] down to protect your eyes."
else
src.up = !src.up
src.flags &= ~HEADCOVERSEYES | HEADCOVERSMOUTH
flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
icon_state = "[initial(icon_state)]up"
usr << "You push the [src] up out of your face."
usr.update_inv_head() //so our mob-overlays update


/*
Expand Down
8 changes: 6 additions & 2 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,14 @@
number += 2
if(istype(src.head, /obj/item/clothing/head/helmet/space))
number += 2
if(istype(src.glasses, /obj/item/clothing/glasses/sunglasses))
number += 1
if(istype(src.glasses, /obj/item/clothing/glasses/thermal))
number -= 1
if(istype(src.glasses, /obj/item/clothing/glasses/sunglasses))
number += 1
if(istype(src.glasses, /obj/item/clothing/glasses/welding))
var/obj/item/clothing/glasses/welding/W = src.glasses
if(!W.up)
number += 2
return number


Expand Down
8 changes: 8 additions & 0 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1164,10 +1164,18 @@
if(eye_blurry) client.screen += global_hud.blurry
if(druggy) client.screen += global_hud.druggy

var/masked = 0

if( istype(head, /obj/item/clothing/head/welding) )
var/obj/item/clothing/head/welding/O = head
if(!O.up && tinted_weldhelh)
client.screen += global_hud.darkMask
masked = 1

if(!masked && istype(glasses, /obj/item/clothing/glasses/welding) )
var/obj/item/clothing/glasses/welding/O = glasses
if(!O.up && tinted_weldhelh)
client.screen += global_hud.darkMask

if(eye_stat > 20)
if(eye_stat > 30) client.screen += global_hud.darkMask
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/screen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
switch(owner.icon_action_button)
if("action_hardhat", "action_welding")
usr.update_inv_head()
if("action_welding_g")
usr.update_inv_glasses()
if("action_jetpack")
usr.update_inv_back()

Expand Down
Binary file modified icons/mob/eyes.dmi
Binary file not shown.
Binary file modified icons/mob/items_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/items_righthand.dmi
Binary file not shown.
Binary file modified icons/mob/screen1_action.dmi
Binary file not shown.
Binary file modified icons/obj/clothing/glasses.dmi
Binary file not shown.

0 comments on commit 9e0d1ca

Please sign in to comment.