diff --git a/code/datums/action.dm b/code/datums/action.dm index 2f7e6296f80..8457a7fc825 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -173,6 +173,9 @@ /datum/action/item_action/toggle_mister name = "Toggle Mister" +/datum/action/item_action/toggle_headphones + name = "Toggle Headphones" + /datum/action/item_action/toggle_helmet_light name = "Toggle Helmet Light" diff --git a/code/modules/client/preference/loadout/loadout_general.dm b/code/modules/client/preference/loadout/loadout_general.dm index 6447c2bed2a..347447f892f 100644 --- a/code/modules/client/preference/loadout/loadout_general.dm +++ b/code/modules/client/preference/loadout/loadout_general.dm @@ -39,6 +39,10 @@ display_name = "a deck of cards" path = /obj/item/toy/cards/deck +/datum/gear/headphones + display_name = "a pair of headphones" + path = /obj/item/clothing/ears/headphones + /datum/gear/blackbandana display_name = "bandana, black" path = /obj/item/clothing/mask/bandana/black diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 379e4616e7b..cb52efb2a24 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -85,10 +85,11 @@ slot_flags = SLOT_EARS burn_state = FIRE_PROOF -/obj/item/clothing/ears/attack_hand(mob/user as mob) - if(!user) return +/obj/item/clothing/ears/attack_hand(mob/user) + if(!user) + return - if(src.loc != user || !istype(user,/mob/living/carbon/human)) + if(loc != user || !ishuman(user)) ..() return @@ -104,7 +105,7 @@ if(slot_flags & SLOT_TWOEARS ) O = (H.l_ear == src ? H.r_ear : H.l_ear) user.unEquip(O) - if(!istype(src,/obj/item/clothing/ears/offear)) + if(!istype(src, /obj/item/clothing/ears/offear)) qdel(O) O = src else @@ -116,9 +117,10 @@ user.put_in_hands(O) O.add_fingerprint(user) - if(istype(src,/obj/item/clothing/ears/offear)) + if(istype(src, /obj/item/clothing/ears/offear)) qdel(src) + /obj/item/clothing/ears/offear name = "Other ear" w_class = 5 @@ -126,22 +128,13 @@ icon_state = "block" slot_flags = SLOT_EARS | SLOT_TWOEARS - New(var/obj/O) - name = O.name - desc = O.desc - icon = O.icon - icon_state = O.icon_state - dir = O.dir +/obj/item/clothing/ears/offear/New(var/obj/O) + name = O.name + desc = O.desc + icon = O.icon + icon_state = O.icon_state + dir = O.dir -/obj/item/clothing/ears/earmuffs - name = "earmuffs" - desc = "Protects your hearing from loud noises, and quiet ones as well." - icon_state = "earmuffs" - item_state = "earmuffs" - flags = EARBANGPROTECT - strip_delay = 15 - put_on_delay = 25 - burn_state = FLAMMABLE //Glasses /obj/item/clothing/glasses diff --git a/code/modules/clothing/ears/ears.dm b/code/modules/clothing/ears/ears.dm new file mode 100644 index 00000000000..672df573858 --- /dev/null +++ b/code/modules/clothing/ears/ears.dm @@ -0,0 +1,28 @@ +/obj/item/clothing/ears/earmuffs + name = "earmuffs" + desc = "Protects your hearing from loud noises, and quiet ones as well." + icon_state = "earmuffs" + item_state = "earmuffs" + flags = EARBANGPROTECT + strip_delay = 15 + put_on_delay = 25 + burn_state = FLAMMABLE + +/obj/item/clothing/ears/headphones + name = "headphones" + desc = "Unce unce unce unce." + var/on = 0 + icon_state = "headphones0" + item_state = "earmuffs" + actions_types = list(/datum/action/item_action/toggle_headphones) + burn_state = FLAMMABLE + +/obj/item/clothing/ears/headphones/attack_self(mob/user) + on = !on + icon_state = "headphones[on]" + + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() + + user.update_inv_ears() \ No newline at end of file diff --git a/icons/mob/ears.dmi b/icons/mob/ears.dmi index 2e50f21be4e..13d5981c458 100644 Binary files a/icons/mob/ears.dmi and b/icons/mob/ears.dmi differ diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index f81f4ab555a..863c25a7aee 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ diff --git a/paradise.dme b/paradise.dme index 050e18920fe..c346f801178 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1130,6 +1130,7 @@ #include "code\modules\client\preference\loadout\loadout_suit.dm" #include "code\modules\client\preference\loadout\loadout_uniform.dm" #include "code\modules\clothing\clothing.dm" +#include "code\modules\clothing\ears\ears.dm" #include "code\modules\clothing\glasses\glasses.dm" #include "code\modules\clothing\glasses\hud.dm" #include "code\modules\clothing\gloves\boxing.dm"