Fixes Atmos fire helmets spawning in the wardrobe closet instead of the atmos closet.

Fixes Toggle Helmet light verb on security helmet with seclite attached being usable while dead.
Fixes Lizard snout is poking through helmet
Fixes Space helmets not hiding masks and glasses (especially the large gar glasses)
Eva harsuit helmet no longer has a semi transparent part (incompatible with hiding masks and glasses, and causes lizard snout protruding from that helmet)
Made equip_to_slot() and unEquip proc more OOP at the carbon level which removes some duplicate code between monkey and human.
Readding code\modules\mob\living\carbon\brain\login.dm that someone (probably me) unchecked some time ago by mistake.
This commit is contained in:
phil235
2015-10-12 21:50:59 +02:00
parent ca0df28f9a
commit 3c788fcc59
15 changed files with 156 additions and 188 deletions
@@ -188,9 +188,6 @@
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/head/hardhat/atmos(src)
new /obj/item/clothing/head/hardhat/atmos(src)
new /obj/item/clothing/head/hardhat/atmos(src)
return
/obj/structure/closet/wardrobe/engineering_yellow
@@ -89,4 +89,5 @@
new /obj/item/tapeproj/engineering(src)
new /obj/item/weapon/watertank/atmos(src)
new /obj/item/clothing/suit/fire/atmos(src)
new /obj/item/clothing/head/hardhat/atmos(src)
new /obj/item/clothing/glasses/meson/engine/tray(src)
+1 -1
View File
@@ -73,7 +73,7 @@
item_color = "atmos"
name = "atmospheric technician's firefighting helmet"
desc = "A firefighter's helmet, able to keep the user cool in any situation."
flags = STOPSPRESSUREDMAGE
flags = BLOCKHAIR | STOPSPRESSUREDMAGE | THICKMATERIAL
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
heat_protection = HEAD
max_heat_protection_temperature = FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT
+3 -1
View File
@@ -231,7 +231,9 @@
if(!F)
return
var/mob/living/carbon/human/user = usr
var/mob/user = usr
if(user.incapacitated())
return
if(!isturf(user.loc))
user << "<span class='warning'>You cannot turn the light on while in this [user.loc]!</span>"
F.on = !F.on
@@ -226,7 +226,6 @@ Contains:
item_state = "space"
desc = "A lightweight space helmet with the basic ability to protect the wearer from the vacuum of space during emergencies."
flash_protect = 0
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 20)
/obj/item/clothing/head/helmet/space/freedom
@@ -85,12 +85,56 @@
return null
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
/mob/living/carbon/human/equip_to_slot(obj/item/I, slot)
if(!..()) //a check failed or the item has already found its slot
return
switch(slot)
if(slot_belt)
belt = I
update_inv_belt()
if(slot_wear_id)
wear_id = I
sec_hud_set_ID()
update_inv_wear_id()
if(slot_ears)
ears = I
update_inv_ears()
if(slot_glasses)
glasses = I
update_inv_glasses()
if(slot_gloves)
gloves = I
update_inv_gloves()
if(slot_shoes)
shoes = I
update_inv_shoes()
if(slot_wear_suit)
wear_suit = I
if(I.flags_inv & HIDEJUMPSUIT)
update_inv_w_uniform()
update_inv_wear_suit()
if(slot_w_uniform)
w_uniform = I
update_suit_sensors()
update_inv_w_uniform()
if(slot_l_store)
l_store = I
update_inv_pockets()
if(slot_r_store)
r_store = I
update_inv_pockets()
if(slot_s_store)
s_store = I
update_inv_s_store()
else
src << "<span class='danger'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>"
/mob/living/carbon/human/unEquip(obj/item/I)
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
if(!. || !I)
return
if(I == wear_suit)
if(s_store)
unEquip(s_store, 1) //It makes no sense for your suit storage to stay on you if you drop your suit.
@@ -125,16 +169,6 @@
else if(I == belt)
belt = null
update_inv_belt()
else if(I == wear_mask)
wear_mask = null
if(I.flags & BLOCKHAIR)
update_hair() //rebuild hair
if(internal)
if(internals)
internals.icon_state = "internal0"
internal = null
sec_hud_set_ID()
update_inv_wear_mask()
else if(I == wear_id)
wear_id = null
sec_hud_set_ID()
@@ -149,95 +183,27 @@
s_store = null
update_inv_s_store()
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc.
/mob/living/carbon/human/equip_to_slot(obj/item/I, slot, redraw_mob = 1)
if(!slot) return
if(!istype(I)) return
/mob/living/carbon/human/wear_mask_update(obj/item/I, unequip = 1)
if(I.flags & BLOCKHAIR)
update_hair()
if(unequip && internal)
if(internals)
internals.icon_state = "internal0"
internal = null
sec_hud_set_ID()
..()
/mob/living/carbon/human/head_update(obj/item/I)
if(I.flags & BLOCKHAIR)
update_hair()
if(I.flags_inv & HIDEEYES)
update_inv_glasses()
if(I.flags_inv & HIDEEARS)
update_body()
..()
if(I == l_hand)
l_hand = null
else if(I == r_hand)
r_hand = null
I.screen_loc = null // will get moved if inventory is visible
I.loc = src
I.equipped(src, slot)
I.layer = 20
switch(slot)
if(slot_back)
back = I
update_inv_back(redraw_mob)
if(slot_wear_mask)
wear_mask = I
if(wear_mask.flags & BLOCKHAIR)
update_hair(redraw_mob) //rebuild hair
sec_hud_set_ID()
update_inv_wear_mask(redraw_mob)
if(slot_handcuffed)
handcuffed = I
update_inv_handcuffed(redraw_mob)
if(slot_legcuffed)
legcuffed = I
update_inv_legcuffed(redraw_mob)
if(slot_l_hand)
l_hand = I
update_inv_l_hand(redraw_mob)
if(slot_r_hand)
r_hand = I
update_inv_r_hand(redraw_mob)
if(slot_belt)
belt = I
update_inv_belt(redraw_mob)
if(slot_wear_id)
wear_id = I
sec_hud_set_ID()
update_inv_wear_id(redraw_mob)
if(slot_ears)
ears = I
update_inv_ears(redraw_mob)
if(slot_glasses)
glasses = I
update_inv_glasses(redraw_mob)
if(slot_gloves)
gloves = I
update_inv_gloves(redraw_mob)
if(slot_head)
head = I
if(head.flags & BLOCKHAIR)
update_hair(redraw_mob) //rebuild hair
if(head.flags_inv & HIDEEARS)
update_body(redraw_mob)
update_inv_head(redraw_mob)
if(slot_shoes)
shoes = I
update_inv_shoes(redraw_mob)
if(slot_wear_suit)
wear_suit = I
if(I.flags_inv & HIDEJUMPSUIT)
update_inv_w_uniform()
update_inv_wear_suit(redraw_mob)
if(slot_w_uniform)
w_uniform = I
update_suit_sensors()
update_inv_w_uniform(redraw_mob)
if(slot_l_store)
l_store = I
update_inv_pockets(redraw_mob)
if(slot_r_store)
r_store = I
update_inv_pockets(redraw_mob)
if(slot_s_store)
s_store = I
update_inv_s_store(redraw_mob)
if(slot_in_backpack)
if(get_active_hand() == I)
unEquip(I)
I.loc = back
else
src << "<span class='danger'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>"
return
//Cycles through all clothing slots and tests them for destruction
/mob/living/carbon/human/proc/shred_clothing(bomb,shock)
@@ -308,7 +308,7 @@
bodyparts_to_add -= "waggingspines"
if("snout" in mutant_bodyparts) //Take a closer look at that snout!
if(H.wear_mask && (H.wear_mask.flags_inv & HIDEFACE))
if((H.wear_mask && (H.wear_mask.flags_inv & HIDEFACE)) || (H.head && (H.head.flags_inv & HIDEFACE)))
bodyparts_to_add -= "snout"
if("frills" in mutant_bodyparts)
@@ -275,19 +275,20 @@ Please contact me on #coderbus IRC. ~Carnie x
glasses.screen_loc = ui_glasses //...draw the item in the inventory screen
client.screen += glasses //Either way, add the item to the HUD
var/layer2use
if(glasses.alternate_worn_layer)
layer2use = glasses.alternate_worn_layer
if(!layer2use)
layer2use = GLASSES_LAYER
if(!(head && (head.flags_inv & HIDEEYES)))
var/layer2use
if(glasses.alternate_worn_layer)
layer2use = glasses.alternate_worn_layer
if(!layer2use)
layer2use = GLASSES_LAYER
var/image/standing
if(glasses.alternate_worn_icon)
standing = image("icon"=glasses.alternate_worn_icon, "icon_state"="[glasses.icon_state]","layer"=-layer2use)
if(!standing)
standing = image("icon"='icons/mob/eyes.dmi', "icon_state"="[glasses.icon_state]", "layer"=-layer2use)
var/image/standing
if(glasses.alternate_worn_icon)
standing = image("icon"=glasses.alternate_worn_icon, "icon_state"="[glasses.icon_state]","layer"=-layer2use)
if(!standing)
standing = image("icon"='icons/mob/eyes.dmi', "icon_state"="[glasses.icon_state]", "layer"=-layer2use)
overlays_standing[GLASSES_LAYER] = standing
overlays_standing[GLASSES_LAYER] = standing
apply_overlay(GLASSES_LAYER)
+59 -7
View File
@@ -17,24 +17,67 @@
return null
/mob/living/carbon/unEquip(obj/item/I) //THIS PROC DID NOT CALL ..() AND THAT COST ME AN ENTIRE DAY OF DEBUGGING.
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
/mob/living/carbon/equip_to_slot(obj/item/I, slot)
if(!slot)
return
if(!istype(I))
return
if(I == l_hand)
l_hand = null
else if(I == r_hand)
r_hand = null
I.screen_loc = null // will get moved if inventory is visible
I.loc = src
I.equipped(src, slot)
I.layer = 20
switch(slot)
if(slot_back)
back = I
update_inv_back()
if(slot_wear_mask)
wear_mask = I
wear_mask_update(I, unequip=0)
if(slot_head)
head = I
head_update(I)
if(slot_handcuffed)
handcuffed = I
update_inv_handcuffed()
if(slot_legcuffed)
legcuffed = I
update_inv_legcuffed()
if(slot_l_hand)
l_hand = I
update_inv_l_hand()
if(slot_r_hand)
r_hand = I
update_inv_r_hand()
if(slot_in_backpack)
if(I == get_active_hand())
unEquip(I)
I.loc = back
else
return 1
/mob/living/carbon/unEquip(obj/item/I)
. = ..() //Sets the default return value to what the parent returns.
if(!. || !I) //We don't want to set anything to null if the parent returned 0.
return
if(I == head)
head = null
if(I.flags & BLOCKHAIR)
update_hair()
update_inv_head()
head_update(I)
else if(I == back)
back = null
update_inv_back()
else if(I == wear_mask)
if(istype(src, /mob/living/carbon/human)) //If we don't do this hair won't be properly rebuilt.
return
wear_mask = null
update_inv_wear_mask()
wear_mask_update(I, unequip=1)
else if(I == handcuffed)
handcuffed = null
if(buckled && buckled.buckle_requires_restraints)
@@ -44,3 +87,12 @@
legcuffed = null
update_inv_legcuffed()
//handle stuff to update when a mob equips/unequips a mask.
/mob/living/carbon/proc/wear_mask_update(obj/item/I, unequip = 1)
update_inv_wear_mask()
//handle stuff to update when a mob equips/unequips a headgear.
/mob/living/carbon/proc/head_update(obj/item/I)
if(I.flags_inv & HIDEMASK)
update_inv_wear_mask()
update_inv_head()
@@ -29,57 +29,4 @@
return 0 //Unsupported slot
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc.
/mob/living/carbon/monkey/equip_to_slot(obj/item/I, slot, redraw_mob = 1)
if(!slot) return
if(!istype(I)) return
if(I == l_hand)
l_hand = null
else if(I == r_hand)
r_hand = null
switch(slot)
if(slot_back)
back = I
I.equipped(src, slot)
update_inv_back(redraw_mob)
if(slot_wear_mask)
wear_mask = I
I.equipped(src, slot)
update_inv_wear_mask(redraw_mob)
if(slot_head)
head = I
I.equipped(src, slot)
update_inv_head(redraw_mob)
if(slot_handcuffed)
handcuffed = I
update_inv_handcuffed(redraw_mob)
if(slot_legcuffed)
legcuffed = I
I.equipped(src, slot)
update_inv_legcuffed(redraw_mob)
if(slot_l_hand)
l_hand = I
I.equipped(src, slot)
update_inv_l_hand(redraw_mob)
if(slot_r_hand)
r_hand = I
I.equipped(src, slot)
update_inv_r_hand(redraw_mob)
if(slot_in_backpack)
if(I == get_active_hand())
unEquip(I)
I.loc = back
return
else
usr << "<span class='danger'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder.</span>"
return
I.loc = src
I.equipped(src, slot)
I.layer = 20
+15 -13
View File
@@ -101,24 +101,26 @@
/mob/living/carbon/update_inv_wear_mask()
remove_overlay(FACEMASK_LAYER)
if(istype(wear_mask, /obj/item/clothing/mask))
var/layer2use
if(wear_mask.alternate_worn_layer)
layer2use = wear_mask.alternate_worn_layer
if(!layer2use)
layer2use = FACEMASK_LAYER
if(!(head && (head.flags_inv & HIDEMASK)))
var/layer2use
if(wear_mask.alternate_worn_layer)
layer2use = wear_mask.alternate_worn_layer
if(!layer2use)
layer2use = FACEMASK_LAYER
var/image/standing
if(wear_mask.alternate_worn_icon)
standing = image("icon"=wear_mask.alternate_worn_icon, "icon_state"="[wear_mask.icon_state]", "layer"=-layer2use)
if(!standing)
standing = image("icon"='icons/mob/mask.dmi', "icon_state"="[wear_mask.icon_state]", "layer"=-layer2use)
var/image/standing
if(wear_mask.alternate_worn_icon)
standing = image("icon"=wear_mask.alternate_worn_icon, "icon_state"="[wear_mask.icon_state]", "layer"=-layer2use)
if(!standing)
standing = image("icon"='icons/mob/mask.dmi', "icon_state"="[wear_mask.icon_state]", "layer"=-layer2use)
overlays_standing[FACEMASK_LAYER] = standing
overlays_standing[FACEMASK_LAYER] = standing
if(wear_mask.blood_DNA && (wear_mask.body_parts_covered & HEAD))
standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="maskblood")
if(wear_mask.blood_DNA && (wear_mask.body_parts_covered & HEAD))
standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="maskblood")
return wear_mask
/mob/living/carbon/update_inv_back()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 259 KiB

+1
View File
@@ -1183,6 +1183,7 @@
#include "code\modules\mob\living\carbon\brain\death.dm"
#include "code\modules\mob\living\carbon\brain\emote.dm"
#include "code\modules\mob\living\carbon\brain\life.dm"
#include "code\modules\mob\living\carbon\brain\login.dm"
#include "code\modules\mob\living\carbon\brain\MMI.dm"
#include "code\modules\mob\living\carbon\brain\posibrain.dm"
#include "code\modules\mob\living\carbon\brain\say.dm"