Merge pull request #13378 from swankcookie/cakehat_fix

Redo of #13304 (Cakehat fix)
This commit is contained in:
duncathan salt
2015-12-02 09:37:27 -06:00
8 changed files with 39 additions and 38 deletions
+10 -5
View File
@@ -20,10 +20,10 @@
item_state = "hardhat[on]_[item_color]"
user.update_inv_head() //so our mob-overlays update
if(on)
user.AddLuminosity(brightness_on)
else
user.AddLuminosity(-brightness_on)
if(on)
turn_on(user)
else
turn_off(user)
/obj/item/clothing/head/hardhat/pickup(mob/user)
if(on)
@@ -35,6 +35,11 @@
user.AddLuminosity(-brightness_on)
SetLuminosity(brightness_on)
/obj/item/clothing/head/hardhat/proc/turn_on(mob/user)
user.AddLuminosity(brightness_on)
/obj/item/clothing/head/hardhat/proc/turn_off(mob/user)
user.AddLuminosity(-brightness_on)
/obj/item/clothing/head/hardhat/orange
icon_state = "hardhat0_orange"
@@ -78,4 +83,4 @@
heat_protection = HEAD
max_heat_protection_temperature = FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT
cold_protection = HEAD
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
+25 -29
View File
@@ -42,22 +42,21 @@
/*
* Cakehat
*/
/obj/item/clothing/head/cakehat
name = "cake-hat"
desc = "It's tasty looking!"
icon_state = "cake0"
/obj/item/clothing/head/hardhat/cakehat
name = "cakehat"
desc = "You put the cake on your head. Brilliant."
icon_state = "hardhat0_cakehat"
item_state = "hardhat0_cakehat"
item_color = "cakehat"
flags = BLOCKHAIR
flags_inv = HIDEEARS
action_button_name = "Toggle Candle"
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
brightness_on = 2 //luminosity when on
flags_cover = HEADCOVERSEYES
var/onfire = 0
var/brightness_on = 1 // luminosity when lit
var/status = 0
var/fire_resist = T0C+1300 //this is the max temp it can stand before you start to cook. although it might not burn away, you take damage
var/processing = 0 //I dont think this is used anywhere.
/obj/item/clothing/head/cakehat/process()
if(!onfire)
SSobj.processing.Remove(src)
return
heat = 1000
/obj/item/clothing/head/hardhat/cakehat/process()
var/turf/location = src.loc
if(istype(location, /mob/))
var/mob/living/carbon/human/M = location
@@ -67,23 +66,20 @@
if (istype(location, /turf))
location.hotspot_expose(700, 1)
/obj/item/clothing/head/cakehat/attack_self(mob/user)
if(status > 1) return
src.onfire = !( src.onfire )
if (src.onfire)
src.force = 15
src.AddLuminosity(brightness_on)
src.damtype = "fire"
src.icon_state = "cake1"
SSobj.processing |= src
else
src.force = null
src.AddLuminosity(-brightness_on)
src.damtype = "brute"
src.icon_state = "cake0"
return
/obj/item/clothing/head/hardhat/cakehat/turn_on()
..()
force = 15
damtype = BURN
SSobj.processing |= src
/obj/item/clothing/head/hardhat/cakehat/turn_off()
..()
force = 0
damtype = BRUTE
SSobj.processing -= src
/obj/item/clothing/head/hardhat/cakehat/is_hot()
return on * heat
/*
* Ushanka
*/
@@ -69,7 +69,7 @@
/datum/table_recipe/birthdaycake
name = "Birthday cake"
reqs = list(
/obj/item/clothing/head/cakehat = 1,
/obj/item/clothing/head/hardhat/cakehat = 1,
/obj/item/weapon/reagent_containers/food/snacks/store/cake/plain = 1
)
result = /obj/item/weapon/reagent_containers/food/snacks/store/cake/birthday