sync
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,273 +1,273 @@
|
||||
/*
|
||||
* The 'fancy' path is for objects like donut boxes that show how many items are in the storage item on the sprite itself
|
||||
* .. Sorry for the shitty path name, I couldnt think of a better one.
|
||||
*
|
||||
* WARNING: var/icon_type is used for both examine text and sprite name. Please look at the procs below and adjust your sprite names accordingly
|
||||
* TODO: Cigarette boxes should be ported to this standard
|
||||
*
|
||||
* Contains:
|
||||
* Donut Box
|
||||
* Egg Box
|
||||
* Candle Box
|
||||
* Cigarette Box
|
||||
* Cigar Case
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
icon_state = "donutbox6"
|
||||
name = "donut box"
|
||||
resistance_flags = FLAMMABLE
|
||||
var/icon_type = "donut"
|
||||
var/spawn_type = null
|
||||
var/fancy_open = FALSE
|
||||
|
||||
/obj/item/storage/fancy/PopulateContents()
|
||||
for(var/i = 1 to storage_slots)
|
||||
new spawn_type(src)
|
||||
|
||||
/obj/item/storage/fancy/update_icon(itemremoved = 0)
|
||||
if(fancy_open)
|
||||
var/total_contents = src.contents.len - itemremoved
|
||||
icon_state = "[icon_type]box[total_contents]"
|
||||
else
|
||||
icon_state = "[icon_type]box"
|
||||
|
||||
/obj/item/storage/fancy/examine(mob/user)
|
||||
..()
|
||||
if(fancy_open)
|
||||
if(contents.len == 1)
|
||||
to_chat(user, "There is one [src.icon_type] left.")
|
||||
else
|
||||
to_chat(user, "There are [contents.len <= 0 ? "no" : "[src.contents.len]"] [src.icon_type]s left.")
|
||||
|
||||
/obj/item/storage/fancy/attack_self(mob/user)
|
||||
fancy_open = !fancy_open
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/fancy/content_can_dump(atom/dest_object, mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
fancy_open = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/fancy/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
|
||||
fancy_open = TRUE
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/fancy/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
|
||||
fancy_open = TRUE
|
||||
return ..()
|
||||
|
||||
/*
|
||||
* Donut Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/donut_box
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
icon_state = "donutbox6"
|
||||
icon_type = "donut"
|
||||
name = "donut box"
|
||||
storage_slots = 6
|
||||
can_hold = list(/obj/item/reagent_containers/food/snacks/donut)
|
||||
spawn_type = /obj/item/reagent_containers/food/snacks/donut
|
||||
fancy_open = TRUE
|
||||
|
||||
/*
|
||||
* Egg Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/egg_box
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
icon_state = "eggbox"
|
||||
icon_type = "egg"
|
||||
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
|
||||
name = "egg box"
|
||||
storage_slots = 12
|
||||
can_hold = list(/obj/item/reagent_containers/food/snacks/egg)
|
||||
spawn_type = /obj/item/reagent_containers/food/snacks/egg
|
||||
|
||||
/*
|
||||
* Candle Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/candle_box
|
||||
name = "candle pack"
|
||||
desc = "A pack of red candles."
|
||||
icon = 'icons/obj/candle.dmi'
|
||||
icon_state = "candlebox5"
|
||||
icon_type = "candle"
|
||||
item_state = "candlebox5"
|
||||
storage_slots = 5
|
||||
throwforce = 2
|
||||
slot_flags = SLOT_BELT
|
||||
spawn_type = /obj/item/candle
|
||||
fancy_open = TRUE
|
||||
|
||||
/obj/item/storage/fancy/candle_box/attack_self(mob_user)
|
||||
return
|
||||
|
||||
////////////
|
||||
//CIG PACK//
|
||||
////////////
|
||||
/obj/item/storage/fancy/cigarettes
|
||||
name = "\improper Space Cigarettes packet"
|
||||
desc = "The most popular brand of cigarettes, sponsors of the Space Olympics."
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cig"
|
||||
item_state = "cigpacket"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
throwforce = 0
|
||||
slot_flags = SLOT_BELT
|
||||
storage_slots = 6
|
||||
can_hold = list(/obj/item/clothing/mask/cigarette, /obj/item/lighter)
|
||||
icon_type = "cigarette"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/space_cigarette
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/AltClick(mob/user)
|
||||
if(user.get_active_held_item())
|
||||
return
|
||||
for(var/obj/item/lighter/lighter in src)
|
||||
remove_from_storage(lighter, user.loc)
|
||||
user.put_in_active_hand(lighter)
|
||||
break
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/update_icon()
|
||||
if(fancy_open || !contents.len)
|
||||
cut_overlays()
|
||||
if(!contents.len)
|
||||
icon_state = "[initial(icon_state)]_empty"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
add_overlay("[icon_state]_open")
|
||||
var/i = contents.len
|
||||
for(var/C in contents)
|
||||
var/mutable_appearance/inserted_overlay = mutable_appearance(icon)
|
||||
inserted_overlay.pixel_x = 1 * (i - 1)
|
||||
if(istype(C, /obj/item/lighter/greyscale))
|
||||
inserted_overlay.icon_state = "lighter_in"
|
||||
else if(istype(C, /obj/item/lighter))
|
||||
inserted_overlay.icon_state = "zippo_in"
|
||||
else
|
||||
inserted_overlay.icon_state = "cigarette"
|
||||
add_overlay(inserted_overlay)
|
||||
i--
|
||||
else
|
||||
cut_overlays()
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!ismob(M))
|
||||
return
|
||||
var/obj/item/clothing/mask/cigarette/cig = locate(/obj/item/clothing/mask/cigarette) in contents
|
||||
if(cig)
|
||||
if(M == user && contents.len > 0 && !user.wear_mask)
|
||||
var/obj/item/clothing/mask/cigarette/W = cig
|
||||
remove_from_storage(W, M)
|
||||
M.equip_to_slot_if_possible(W, slot_wear_mask)
|
||||
contents -= W
|
||||
to_chat(user, "<span class='notice'>You take a [icon_type] out of the pack.</span>")
|
||||
else
|
||||
..()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/dromedaryco
|
||||
name = "\improper DromedaryCo packet"
|
||||
desc = "A packet of six imported DromedaryCo cancer sticks. A label on the packaging reads, \"Wouldn't a slow death make a change?\""
|
||||
icon_state = "dromedary"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/dromedary
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_uplift
|
||||
name = "\improper Uplift Smooth packet"
|
||||
desc = "Your favorite brand, now menthol flavored."
|
||||
icon_state = "uplift"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/uplift
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_robust
|
||||
name = "\improper Robust packet"
|
||||
desc = "Smoked by the robust."
|
||||
icon_state = "robust"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/robust
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_robustgold
|
||||
name = "\improper Robust Gold packet"
|
||||
desc = "Smoked by the truly robust."
|
||||
icon_state = "robustg"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/robustgold
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_carp
|
||||
name = "\improper Carp Classic packet"
|
||||
desc = "Since 2313."
|
||||
icon_state = "carp"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/carp
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_syndicate
|
||||
name = "cigarette packet"
|
||||
desc = "An obscure brand of cigarettes."
|
||||
icon_state = "syndie"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/syndicate
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_midori
|
||||
name = "\improper Midori Tabako packet"
|
||||
desc = "You can't understand the runes, but the packet smells funny."
|
||||
icon_state = "midori"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/rollie
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_shadyjims
|
||||
name = "\improper Shady Jim's Super Slims packet"
|
||||
desc = "Is your weight slowing you down? Having trouble running away from gravitational singularities? Can't stop stuffing your mouth? Smoke Shady Jim's Super Slims and watch all that fat burn away. Guaranteed results!"
|
||||
icon_state = "shadyjim"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/shadyjims
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers
|
||||
name = "rolling paper pack"
|
||||
desc = "A pack of NanoTrasen brand rolling papers."
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cig_paper_pack"
|
||||
storage_slots = 10
|
||||
icon_type = "rolling paper"
|
||||
can_hold = list(/obj/item/rollingpaper)
|
||||
spawn_type = /obj/item/rollingpaper
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers/update_icon()
|
||||
cut_overlays()
|
||||
if(!contents.len)
|
||||
add_overlay("[icon_state]_empty")
|
||||
|
||||
/////////////
|
||||
//CIGAR BOX//
|
||||
/////////////
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars
|
||||
name = "\improper premium cigar case"
|
||||
desc = "A case of premium cigars. Very expensive."
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cigarcase"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
storage_slots = 5
|
||||
can_hold = list(/obj/item/clothing/mask/cigarette/cigar)
|
||||
icon_type = "premium cigar"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/update_icon()
|
||||
cut_overlays()
|
||||
if(fancy_open)
|
||||
add_overlay("[icon_state]_open")
|
||||
var/mutable_appearance/cigar_overlay = mutable_appearance(icon, icon_type)
|
||||
for(var/c = contents.len, c >= 1, c--)
|
||||
cigar_overlay.pixel_x = 4 * (c - 1)
|
||||
add_overlay(cigar_overlay)
|
||||
else
|
||||
icon_state = "cigarcase"
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/cohiba
|
||||
name = "\improper cohiba robusto cigar case"
|
||||
desc = "A case of imported Cohiba cigars, renowned for their strong flavor."
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar/cohiba
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/havana
|
||||
name = "\improper premium havanian cigar case"
|
||||
desc = "A case of classy Havanian cigars."
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar/havana
|
||||
/*
|
||||
* The 'fancy' path is for objects like donut boxes that show how many items are in the storage item on the sprite itself
|
||||
* .. Sorry for the shitty path name, I couldnt think of a better one.
|
||||
*
|
||||
* WARNING: var/icon_type is used for both examine text and sprite name. Please look at the procs below and adjust your sprite names accordingly
|
||||
* TODO: Cigarette boxes should be ported to this standard
|
||||
*
|
||||
* Contains:
|
||||
* Donut Box
|
||||
* Egg Box
|
||||
* Candle Box
|
||||
* Cigarette Box
|
||||
* Cigar Case
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
icon_state = "donutbox6"
|
||||
name = "donut box"
|
||||
resistance_flags = FLAMMABLE
|
||||
var/icon_type = "donut"
|
||||
var/spawn_type = null
|
||||
var/fancy_open = FALSE
|
||||
|
||||
/obj/item/storage/fancy/PopulateContents()
|
||||
for(var/i = 1 to storage_slots)
|
||||
new spawn_type(src)
|
||||
|
||||
/obj/item/storage/fancy/update_icon(itemremoved = 0)
|
||||
if(fancy_open)
|
||||
var/total_contents = src.contents.len - itemremoved
|
||||
icon_state = "[icon_type]box[total_contents]"
|
||||
else
|
||||
icon_state = "[icon_type]box"
|
||||
|
||||
/obj/item/storage/fancy/examine(mob/user)
|
||||
..()
|
||||
if(fancy_open)
|
||||
if(contents.len == 1)
|
||||
to_chat(user, "There is one [src.icon_type] left.")
|
||||
else
|
||||
to_chat(user, "There are [contents.len <= 0 ? "no" : "[src.contents.len]"] [src.icon_type]s left.")
|
||||
|
||||
/obj/item/storage/fancy/attack_self(mob/user)
|
||||
fancy_open = !fancy_open
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/fancy/dump_content_at(atom/dest_object, mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
fancy_open = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/fancy/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
|
||||
fancy_open = TRUE
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/fancy/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
|
||||
fancy_open = TRUE
|
||||
return ..()
|
||||
|
||||
/*
|
||||
* Donut Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/donut_box
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
icon_state = "donutbox6"
|
||||
icon_type = "donut"
|
||||
name = "donut box"
|
||||
storage_slots = 6
|
||||
can_hold = list(/obj/item/reagent_containers/food/snacks/donut)
|
||||
spawn_type = /obj/item/reagent_containers/food/snacks/donut
|
||||
fancy_open = TRUE
|
||||
|
||||
/*
|
||||
* Egg Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/egg_box
|
||||
icon = 'icons/obj/food/containers.dmi'
|
||||
icon_state = "eggbox"
|
||||
icon_type = "egg"
|
||||
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
|
||||
name = "egg box"
|
||||
storage_slots = 12
|
||||
can_hold = list(/obj/item/reagent_containers/food/snacks/egg)
|
||||
spawn_type = /obj/item/reagent_containers/food/snacks/egg
|
||||
|
||||
/*
|
||||
* Candle Box
|
||||
*/
|
||||
|
||||
/obj/item/storage/fancy/candle_box
|
||||
name = "candle pack"
|
||||
desc = "A pack of red candles."
|
||||
icon = 'icons/obj/candle.dmi'
|
||||
icon_state = "candlebox5"
|
||||
icon_type = "candle"
|
||||
item_state = "candlebox5"
|
||||
storage_slots = 5
|
||||
throwforce = 2
|
||||
slot_flags = SLOT_BELT
|
||||
spawn_type = /obj/item/candle
|
||||
fancy_open = TRUE
|
||||
|
||||
/obj/item/storage/fancy/candle_box/attack_self(mob_user)
|
||||
return
|
||||
|
||||
////////////
|
||||
//CIG PACK//
|
||||
////////////
|
||||
/obj/item/storage/fancy/cigarettes
|
||||
name = "\improper Space Cigarettes packet"
|
||||
desc = "The most popular brand of cigarettes, sponsors of the Space Olympics."
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cig"
|
||||
item_state = "cigpacket"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
throwforce = 0
|
||||
slot_flags = SLOT_BELT
|
||||
storage_slots = 6
|
||||
can_hold = list(/obj/item/clothing/mask/cigarette, /obj/item/lighter)
|
||||
icon_type = "cigarette"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/space_cigarette
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/AltClick(mob/user)
|
||||
if(user.get_active_held_item())
|
||||
return
|
||||
for(var/obj/item/lighter/lighter in src)
|
||||
remove_from_storage(lighter, user.loc)
|
||||
user.put_in_active_hand(lighter)
|
||||
break
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/update_icon()
|
||||
if(fancy_open || !contents.len)
|
||||
cut_overlays()
|
||||
if(!contents.len)
|
||||
icon_state = "[initial(icon_state)]_empty"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
add_overlay("[icon_state]_open")
|
||||
var/i = contents.len
|
||||
for(var/C in contents)
|
||||
var/mutable_appearance/inserted_overlay = mutable_appearance(icon)
|
||||
inserted_overlay.pixel_x = 1 * (i - 1)
|
||||
if(istype(C, /obj/item/lighter/greyscale))
|
||||
inserted_overlay.icon_state = "lighter_in"
|
||||
else if(istype(C, /obj/item/lighter))
|
||||
inserted_overlay.icon_state = "zippo_in"
|
||||
else
|
||||
inserted_overlay.icon_state = "cigarette"
|
||||
add_overlay(inserted_overlay)
|
||||
i--
|
||||
else
|
||||
cut_overlays()
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!ismob(M))
|
||||
return
|
||||
var/obj/item/clothing/mask/cigarette/cig = locate(/obj/item/clothing/mask/cigarette) in contents
|
||||
if(cig)
|
||||
if(M == user && contents.len > 0 && !user.wear_mask)
|
||||
var/obj/item/clothing/mask/cigarette/W = cig
|
||||
remove_from_storage(W, M)
|
||||
M.equip_to_slot_if_possible(W, slot_wear_mask)
|
||||
contents -= W
|
||||
to_chat(user, "<span class='notice'>You take a [icon_type] out of the pack.</span>")
|
||||
else
|
||||
..()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/dromedaryco
|
||||
name = "\improper DromedaryCo packet"
|
||||
desc = "A packet of six imported DromedaryCo cancer sticks. A label on the packaging reads, \"Wouldn't a slow death make a change?\""
|
||||
icon_state = "dromedary"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/dromedary
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_uplift
|
||||
name = "\improper Uplift Smooth packet"
|
||||
desc = "Your favorite brand, now menthol flavored."
|
||||
icon_state = "uplift"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/uplift
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_robust
|
||||
name = "\improper Robust packet"
|
||||
desc = "Smoked by the robust."
|
||||
icon_state = "robust"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/robust
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_robustgold
|
||||
name = "\improper Robust Gold packet"
|
||||
desc = "Smoked by the truly robust."
|
||||
icon_state = "robustg"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/robustgold
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_carp
|
||||
name = "\improper Carp Classic packet"
|
||||
desc = "Since 2313."
|
||||
icon_state = "carp"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/carp
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_syndicate
|
||||
name = "cigarette packet"
|
||||
desc = "An obscure brand of cigarettes."
|
||||
icon_state = "syndie"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/syndicate
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_midori
|
||||
name = "\improper Midori Tabako packet"
|
||||
desc = "You can't understand the runes, but the packet smells funny."
|
||||
icon_state = "midori"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/rollie
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigpack_shadyjims
|
||||
name = "\improper Shady Jim's Super Slims packet"
|
||||
desc = "Is your weight slowing you down? Having trouble running away from gravitational singularities? Can't stop stuffing your mouth? Smoke Shady Jim's Super Slims and watch all that fat burn away. Guaranteed results!"
|
||||
icon_state = "shadyjim"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/shadyjims
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers
|
||||
name = "rolling paper pack"
|
||||
desc = "A pack of Nanotrasen brand rolling papers."
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cig_paper_pack"
|
||||
storage_slots = 10
|
||||
icon_type = "rolling paper"
|
||||
can_hold = list(/obj/item/rollingpaper)
|
||||
spawn_type = /obj/item/rollingpaper
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers/update_icon()
|
||||
cut_overlays()
|
||||
if(!contents.len)
|
||||
add_overlay("[icon_state]_empty")
|
||||
|
||||
/////////////
|
||||
//CIGAR BOX//
|
||||
/////////////
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars
|
||||
name = "\improper premium cigar case"
|
||||
desc = "A case of premium cigars. Very expensive."
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "cigarcase"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
storage_slots = 5
|
||||
can_hold = list(/obj/item/clothing/mask/cigarette/cigar)
|
||||
icon_type = "premium cigar"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/update_icon()
|
||||
cut_overlays()
|
||||
if(fancy_open)
|
||||
add_overlay("[icon_state]_open")
|
||||
var/mutable_appearance/cigar_overlay = mutable_appearance(icon, icon_type)
|
||||
for(var/c = contents.len, c >= 1, c--)
|
||||
cigar_overlay.pixel_x = 4 * (c - 1)
|
||||
add_overlay(cigar_overlay)
|
||||
else
|
||||
icon_state = "cigarcase"
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/cohiba
|
||||
name = "\improper cohiba robusto cigar case"
|
||||
desc = "A case of imported Cohiba cigars, renowned for their strong flavor."
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar/cohiba
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/havana
|
||||
name = "\improper premium havanian cigar case"
|
||||
desc = "A case of classy Havanian cigars."
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar/havana
|
||||
|
||||
@@ -1,182 +1,182 @@
|
||||
/obj/item/storage/lockbox
|
||||
name = "lockbox"
|
||||
desc = "A locked box."
|
||||
icon_state = "lockbox+l"
|
||||
item_state = "syringe_kit"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
max_w_class = WEIGHT_CLASS_NORMAL
|
||||
max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
|
||||
storage_slots = 4
|
||||
req_access = list(ACCESS_ARMORY)
|
||||
var/locked = TRUE
|
||||
var/broken = FALSE
|
||||
var/open = FALSE
|
||||
var/icon_locked = "lockbox+l"
|
||||
var/icon_closed = "lockbox"
|
||||
var/icon_broken = "lockbox+b"
|
||||
|
||||
|
||||
/obj/item/storage/lockbox/attackby(obj/item/W, mob/user, params)
|
||||
if(W.GetID())
|
||||
if(broken)
|
||||
to_chat(user, "<span class='danger'>It appears to be broken.</span>")
|
||||
return
|
||||
if(allowed(user))
|
||||
locked = !locked
|
||||
if(locked)
|
||||
icon_state = icon_locked
|
||||
to_chat(user, "<span class='danger'>You lock the [src.name]!</span>")
|
||||
close_all()
|
||||
return
|
||||
else
|
||||
icon_state = icon_closed
|
||||
to_chat(user, "<span class='danger'>You unlock the [src.name]!</span>")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='danger'>Access Denied.</span>")
|
||||
return
|
||||
if(!locked)
|
||||
return ..()
|
||||
else
|
||||
to_chat(user, "<span class='danger'>It's locked!</span>")
|
||||
|
||||
/obj/item/storage/lockbox/MouseDrop(over_object, src_location, over_location)
|
||||
if (locked)
|
||||
src.add_fingerprint(usr)
|
||||
to_chat(usr, "<span class='warning'>It's locked!</span>")
|
||||
return 0
|
||||
..()
|
||||
|
||||
/obj/item/storage/lockbox/emag_act(mob/user)
|
||||
if(!broken)
|
||||
broken = TRUE
|
||||
locked = FALSE
|
||||
desc += "It appears to be broken."
|
||||
icon_state = src.icon_broken
|
||||
if(user)
|
||||
visible_message("<span class='warning'>\The [src] has been broken by [user] with an electromagnetic card!</span>")
|
||||
return
|
||||
|
||||
/obj/item/storage/lockbox/show_to(mob/user)
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>It's locked!</span>")
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
//Check the destination item type for contentto.
|
||||
/obj/item/storage/lockbox/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>It's locked!</span>")
|
||||
return 0
|
||||
open = TRUE
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/lockbox/can_be_inserted(obj/item/W, stop_messages = 0)
|
||||
if(locked)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/lockbox/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
|
||||
open = TRUE
|
||||
update_icon()
|
||||
return ..()
|
||||
/obj/item/storage/lockbox/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
|
||||
open = TRUE
|
||||
update_icon()
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/lockbox/loyalty
|
||||
name = "lockbox of mindshield implants"
|
||||
req_access = list(ACCESS_SECURITY)
|
||||
|
||||
/obj/item/storage/lockbox/loyalty/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/implantcase/mindshield(src)
|
||||
new /obj/item/implanter/mindshield(src)
|
||||
|
||||
|
||||
/obj/item/storage/lockbox/clusterbang
|
||||
name = "lockbox of clusterbangs"
|
||||
desc = "You have a bad feeling about opening this."
|
||||
req_access = list(ACCESS_SECURITY)
|
||||
|
||||
/obj/item/storage/lockbox/clusterbang/PopulateContents()
|
||||
new /obj/item/grenade/clusterbuster(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal
|
||||
name = "medal box"
|
||||
desc = "A locked box used to store medals of honor."
|
||||
icon_state = "medalbox+l"
|
||||
item_state = "syringe_kit"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
max_w_class = WEIGHT_CLASS_SMALL
|
||||
storage_slots = 10
|
||||
max_combined_w_class = 20
|
||||
req_access = list(ACCESS_CAPTAIN)
|
||||
icon_locked = "medalbox+l"
|
||||
icon_closed = "medalbox"
|
||||
icon_broken = "medalbox+b"
|
||||
can_hold = list(/obj/item/clothing/accessory/medal)
|
||||
|
||||
/obj/item/storage/lockbox/medal/AltClick()
|
||||
if(!locked)
|
||||
open = (open ? FALSE : TRUE)
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/obj/item/storage/lockbox/medal/PopulateContents()
|
||||
new /obj/item/clothing/accessory/medal/gold/captain(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/valor(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/valor(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/security(src)
|
||||
new /obj/item/clothing/accessory/medal/bronze_heart(src)
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/conduct(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/update_icon()
|
||||
cut_overlays()
|
||||
if(locked)
|
||||
icon_state = "medalbox+l"
|
||||
open = FALSE
|
||||
else
|
||||
icon_state = "medalbox"
|
||||
if(open)
|
||||
icon_state += "open"
|
||||
if(broken)
|
||||
icon_state += "+b"
|
||||
if(contents && open)
|
||||
for (var/i in 1 to contents.len)
|
||||
var/obj/item/clothing/accessory/medal/M = contents[i]
|
||||
var/mutable_appearance/medalicon = mutable_appearance(initial(icon), M.medaltype)
|
||||
if(i > 1 && i <= 5)
|
||||
medalicon.pixel_x += ((i-1)*3)
|
||||
else if(i > 5)
|
||||
medalicon.pixel_y -= 7
|
||||
medalicon.pixel_x -= 2
|
||||
medalicon.pixel_x += ((i-6)*3)
|
||||
add_overlay(medalicon)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sec
|
||||
name = "security medal box"
|
||||
desc = "A locked box used to store medals to be given to members of the security department."
|
||||
req_access = list(ACCESS_HOS)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sec/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/silver/security(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sci
|
||||
name = "science medal box"
|
||||
desc = "A locked box used to store medals to be given to members of the science department."
|
||||
req_access = list(ACCESS_RD)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sci/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
/obj/item/storage/lockbox
|
||||
name = "lockbox"
|
||||
desc = "A locked box."
|
||||
icon_state = "lockbox+l"
|
||||
item_state = "syringe_kit"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
max_w_class = WEIGHT_CLASS_NORMAL
|
||||
max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
|
||||
storage_slots = 4
|
||||
req_access = list(ACCESS_ARMORY)
|
||||
var/locked = TRUE
|
||||
var/broken = FALSE
|
||||
var/open = FALSE
|
||||
var/icon_locked = "lockbox+l"
|
||||
var/icon_closed = "lockbox"
|
||||
var/icon_broken = "lockbox+b"
|
||||
|
||||
|
||||
/obj/item/storage/lockbox/attackby(obj/item/W, mob/user, params)
|
||||
if(W.GetID())
|
||||
if(broken)
|
||||
to_chat(user, "<span class='danger'>It appears to be broken.</span>")
|
||||
return
|
||||
if(allowed(user))
|
||||
locked = !locked
|
||||
if(locked)
|
||||
icon_state = icon_locked
|
||||
to_chat(user, "<span class='danger'>You lock the [src.name]!</span>")
|
||||
close_all()
|
||||
return
|
||||
else
|
||||
icon_state = icon_closed
|
||||
to_chat(user, "<span class='danger'>You unlock the [src.name]!</span>")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='danger'>Access Denied.</span>")
|
||||
return
|
||||
if(!locked)
|
||||
return ..()
|
||||
else
|
||||
to_chat(user, "<span class='danger'>It's locked!</span>")
|
||||
|
||||
/obj/item/storage/lockbox/MouseDrop(over_object, src_location, over_location)
|
||||
if (locked)
|
||||
src.add_fingerprint(usr)
|
||||
to_chat(usr, "<span class='warning'>It's locked!</span>")
|
||||
return 0
|
||||
..()
|
||||
|
||||
/obj/item/storage/lockbox/emag_act(mob/user)
|
||||
if(!broken)
|
||||
broken = TRUE
|
||||
locked = FALSE
|
||||
desc += "It appears to be broken."
|
||||
icon_state = src.icon_broken
|
||||
if(user)
|
||||
visible_message("<span class='warning'>\The [src] has been broken by [user] with an electromagnetic card!</span>")
|
||||
return
|
||||
|
||||
/obj/item/storage/lockbox/show_to(mob/user)
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>It's locked!</span>")
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
//Check the destination item type for contentto.
|
||||
/obj/item/storage/lockbox/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>It's locked!</span>")
|
||||
return null
|
||||
open = TRUE
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/lockbox/can_be_inserted(obj/item/W, stop_messages = 0)
|
||||
if(locked)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/lockbox/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
|
||||
open = TRUE
|
||||
update_icon()
|
||||
return ..()
|
||||
/obj/item/storage/lockbox/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
|
||||
open = TRUE
|
||||
update_icon()
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/lockbox/loyalty
|
||||
name = "lockbox of mindshield implants"
|
||||
req_access = list(ACCESS_SECURITY)
|
||||
|
||||
/obj/item/storage/lockbox/loyalty/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/implantcase/mindshield(src)
|
||||
new /obj/item/implanter/mindshield(src)
|
||||
|
||||
|
||||
/obj/item/storage/lockbox/clusterbang
|
||||
name = "lockbox of clusterbangs"
|
||||
desc = "You have a bad feeling about opening this."
|
||||
req_access = list(ACCESS_SECURITY)
|
||||
|
||||
/obj/item/storage/lockbox/clusterbang/PopulateContents()
|
||||
new /obj/item/grenade/clusterbuster(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal
|
||||
name = "medal box"
|
||||
desc = "A locked box used to store medals of honor."
|
||||
icon_state = "medalbox+l"
|
||||
item_state = "syringe_kit"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
max_w_class = WEIGHT_CLASS_SMALL
|
||||
storage_slots = 10
|
||||
max_combined_w_class = 20
|
||||
req_access = list(ACCESS_CAPTAIN)
|
||||
icon_locked = "medalbox+l"
|
||||
icon_closed = "medalbox"
|
||||
icon_broken = "medalbox+b"
|
||||
can_hold = list(/obj/item/clothing/accessory/medal)
|
||||
|
||||
/obj/item/storage/lockbox/medal/AltClick()
|
||||
if(!locked)
|
||||
open = (open ? FALSE : TRUE)
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/obj/item/storage/lockbox/medal/PopulateContents()
|
||||
new /obj/item/clothing/accessory/medal/gold/captain(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/valor(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/valor(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/security(src)
|
||||
new /obj/item/clothing/accessory/medal/bronze_heart(src)
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/conduct(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/update_icon()
|
||||
cut_overlays()
|
||||
if(locked)
|
||||
icon_state = "medalbox+l"
|
||||
open = FALSE
|
||||
else
|
||||
icon_state = "medalbox"
|
||||
if(open)
|
||||
icon_state += "open"
|
||||
if(broken)
|
||||
icon_state += "+b"
|
||||
if(contents && open)
|
||||
for (var/i in 1 to contents.len)
|
||||
var/obj/item/clothing/accessory/medal/M = contents[i]
|
||||
var/mutable_appearance/medalicon = mutable_appearance(initial(icon), M.medaltype)
|
||||
if(i > 1 && i <= 5)
|
||||
medalicon.pixel_x += ((i-1)*3)
|
||||
else if(i > 5)
|
||||
medalicon.pixel_y -= 7
|
||||
medalicon.pixel_x -= 2
|
||||
medalicon.pixel_x += ((i-6)*3)
|
||||
add_overlay(medalicon)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sec
|
||||
name = "security medal box"
|
||||
desc = "A locked box used to store medals to be given to members of the security department."
|
||||
req_access = list(ACCESS_HOS)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sec/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/silver/security(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sci
|
||||
name = "science medal box"
|
||||
desc = "A locked box used to store medals to be given to members of the science department."
|
||||
req_access = list(ACCESS_RD)
|
||||
|
||||
/obj/item/storage/lockbox/medal/sci/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
@@ -1,197 +1,197 @@
|
||||
/*
|
||||
* Absorbs /obj/item/secstorage.
|
||||
* Reimplements it only slightly to use existing storage functionality.
|
||||
*
|
||||
* Contains:
|
||||
* Secure Briefcase
|
||||
* Wall Safe
|
||||
*/
|
||||
|
||||
// -----------------------------
|
||||
// Generic Item
|
||||
// -----------------------------
|
||||
/obj/item/storage/secure
|
||||
name = "secstorage"
|
||||
var/icon_locking = "secureb"
|
||||
var/icon_sparking = "securespark"
|
||||
var/icon_opened = "secure0"
|
||||
var/locked = TRUE
|
||||
var/code = ""
|
||||
var/l_code = null
|
||||
var/l_set = 0
|
||||
var/l_setshort = 0
|
||||
var/l_hacking = 0
|
||||
var/open = FALSE
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
max_w_class = WEIGHT_CLASS_SMALL
|
||||
max_combined_w_class = 14
|
||||
|
||||
/obj/item/storage/secure/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, text("The service panel is [src.open ? "open" : "closed"]."))
|
||||
|
||||
/obj/item/storage/secure/attackby(obj/item/W, mob/user, params)
|
||||
if(locked)
|
||||
if (istype(W, /obj/item/screwdriver))
|
||||
if (do_after(user, 20*W.toolspeed, target = src))
|
||||
src.open =! src.open
|
||||
user.show_message("<span class='notice'>You [open ? "open" : "close"] the service panel.</span>", 1)
|
||||
return
|
||||
if ((istype(W, /obj/item/device/multitool)) && (src.open == 1)&& (!src.l_hacking))
|
||||
user.show_message("<span class='danger'>Now attempting to reset internal memory, please hold.</span>", 1)
|
||||
src.l_hacking = 1
|
||||
if (do_after(usr, 100*W.toolspeed, target = src))
|
||||
if (prob(33))
|
||||
src.l_setshort = 1
|
||||
src.l_set = 0
|
||||
user.show_message("<span class='danger'>Internal memory reset. Please give it a few seconds to reinitialize.</span>", 1)
|
||||
sleep(80)
|
||||
src.l_setshort = 0
|
||||
src.l_hacking = 0
|
||||
else
|
||||
user.show_message("<span class='danger'>Unable to reset internal memory.</span>", 1)
|
||||
src.l_hacking = 0
|
||||
else
|
||||
src.l_hacking = 0
|
||||
return
|
||||
//At this point you have exhausted all the special things to do when locked
|
||||
// ... but it's still locked.
|
||||
return
|
||||
|
||||
// -> storage/attackby() what with handle insertion, etc
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/secure/MouseDrop(over_object, src_location, over_location)
|
||||
if (locked)
|
||||
src.add_fingerprint(usr)
|
||||
to_chat(usr, "<span class='warning'>It's locked!</span>")
|
||||
return 0
|
||||
..()
|
||||
|
||||
/obj/item/storage/secure/attack_self(mob/user)
|
||||
user.set_machine(src)
|
||||
var/dat = text("<TT><B>[]</B><BR>\n\nLock Status: []",src, (src.locked ? "LOCKED" : "UNLOCKED"))
|
||||
var/message = "Code"
|
||||
if ((src.l_set == 0) && (!src.l_setshort))
|
||||
dat += text("<p>\n<b>5-DIGIT PASSCODE NOT SET.<br>ENTER NEW PASSCODE.</b>")
|
||||
if (src.l_setshort)
|
||||
dat += text("<p>\n<font color=red><b>ALERT: MEMORY SYSTEM ERROR - 6040 201</b></font>")
|
||||
message = text("[]", src.code)
|
||||
if (!src.locked)
|
||||
message = "*****"
|
||||
dat += text("<HR>\n>[]<BR>\n<A href='?src=\ref[];type=1'>1</A>-<A href='?src=\ref[];type=2'>2</A>-<A href='?src=\ref[];type=3'>3</A><BR>\n<A href='?src=\ref[];type=4'>4</A>-<A href='?src=\ref[];type=5'>5</A>-<A href='?src=\ref[];type=6'>6</A><BR>\n<A href='?src=\ref[];type=7'>7</A>-<A href='?src=\ref[];type=8'>8</A>-<A href='?src=\ref[];type=9'>9</A><BR>\n<A href='?src=\ref[];type=R'>R</A>-<A href='?src=\ref[];type=0'>0</A>-<A href='?src=\ref[];type=E'>E</A><BR>\n</TT>", message, src, src, src, src, src, src, src, src, src, src, src, src)
|
||||
user << browse(dat, "window=caselock;size=300x280")
|
||||
|
||||
/obj/item/storage/secure/Topic(href, href_list)
|
||||
..()
|
||||
if ((usr.stat || usr.restrained()) || (get_dist(src, usr) > 1))
|
||||
return
|
||||
if (href_list["type"])
|
||||
if (href_list["type"] == "E")
|
||||
if ((src.l_set == 0) && (length(src.code) == 5) && (!src.l_setshort) && (src.code != "ERROR"))
|
||||
src.l_code = src.code
|
||||
src.l_set = 1
|
||||
else if ((src.code == src.l_code) && (src.l_set == 1))
|
||||
src.locked = FALSE
|
||||
cut_overlays()
|
||||
add_overlay(icon_opened)
|
||||
src.code = null
|
||||
else
|
||||
src.code = "ERROR"
|
||||
else
|
||||
if ((href_list["type"] == "R") && (!src.l_setshort))
|
||||
src.locked = TRUE
|
||||
cut_overlays()
|
||||
src.code = null
|
||||
src.close(usr)
|
||||
else
|
||||
src.code += text("[]", sanitize_text(href_list["type"]))
|
||||
if (length(src.code) > 5)
|
||||
src.code = "ERROR"
|
||||
src.add_fingerprint(usr)
|
||||
for(var/mob/M in viewers(1, src.loc))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_self(M)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/storage/secure/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>It's locked!</span>")
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/secure/can_be_inserted(obj/item/W, stop_messages = 0)
|
||||
if(locked)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
|
||||
// -----------------------------
|
||||
// Secure Briefcase
|
||||
// -----------------------------
|
||||
/obj/item/storage/secure/briefcase
|
||||
name = "secure briefcase"
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "secure"
|
||||
item_state = "sec-case"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/briefcase_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/briefcase_righthand.dmi'
|
||||
desc = "A large briefcase with a digital locking system."
|
||||
force = 8
|
||||
hitsound = "swing_hit"
|
||||
throw_speed = 2
|
||||
throw_range = 4
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
max_w_class = WEIGHT_CLASS_NORMAL
|
||||
max_combined_w_class = 21
|
||||
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
|
||||
|
||||
/obj/item/storage/secure/briefcase/PopulateContents()
|
||||
new /obj/item/paper(src)
|
||||
new /obj/item/pen(src)
|
||||
|
||||
/obj/item/storage/secure/briefcase/attack_hand(mob/user)
|
||||
if ((src.loc == user) && (src.locked == 1))
|
||||
to_chat(usr, "<span class='warning'>[src] is locked and cannot be opened!</span>")
|
||||
add_fingerprint(user)
|
||||
else
|
||||
..()
|
||||
|
||||
//Syndie variant of Secure Briefcase. Contains space cash, slightly more robust.
|
||||
/obj/item/storage/secure/briefcase/syndie
|
||||
force = 15
|
||||
|
||||
/obj/item/storage/secure/briefcase/syndie/PopulateContents()
|
||||
..()
|
||||
for(var/i = 0, i < storage_slots - 2, i++)
|
||||
new /obj/item/stack/spacecash/c1000(src)
|
||||
|
||||
|
||||
// -----------------------------
|
||||
// Secure Safe
|
||||
// -----------------------------
|
||||
|
||||
/obj/item/storage/secure/safe
|
||||
name = "secure safe"
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "safe"
|
||||
icon_opened = "safe0"
|
||||
icon_locking = "safeb"
|
||||
icon_sparking = "safespark"
|
||||
force = 8
|
||||
w_class = WEIGHT_CLASS_GIGANTIC
|
||||
max_w_class = 8
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
cant_hold = list(/obj/item/storage/secure/briefcase)
|
||||
|
||||
/obj/item/storage/secure/safe/PopulateContents()
|
||||
new /obj/item/paper(src)
|
||||
new /obj/item/pen(src)
|
||||
|
||||
/obj/item/storage/secure/safe/attack_hand(mob/user)
|
||||
return attack_self(user)
|
||||
|
||||
/obj/item/storage/secure/safe/HoS
|
||||
name = "head of security's safe"
|
||||
/*
|
||||
* Absorbs /obj/item/secstorage.
|
||||
* Reimplements it only slightly to use existing storage functionality.
|
||||
*
|
||||
* Contains:
|
||||
* Secure Briefcase
|
||||
* Wall Safe
|
||||
*/
|
||||
|
||||
// -----------------------------
|
||||
// Generic Item
|
||||
// -----------------------------
|
||||
/obj/item/storage/secure
|
||||
name = "secstorage"
|
||||
var/icon_locking = "secureb"
|
||||
var/icon_sparking = "securespark"
|
||||
var/icon_opened = "secure0"
|
||||
var/locked = TRUE
|
||||
var/code = ""
|
||||
var/l_code = null
|
||||
var/l_set = 0
|
||||
var/l_setshort = 0
|
||||
var/l_hacking = 0
|
||||
var/open = FALSE
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
max_w_class = WEIGHT_CLASS_SMALL
|
||||
max_combined_w_class = 14
|
||||
|
||||
/obj/item/storage/secure/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, text("The service panel is [src.open ? "open" : "closed"]."))
|
||||
|
||||
/obj/item/storage/secure/attackby(obj/item/W, mob/user, params)
|
||||
if(locked)
|
||||
if (istype(W, /obj/item/screwdriver))
|
||||
if (do_after(user, 20*W.toolspeed, target = src))
|
||||
src.open =! src.open
|
||||
user.show_message("<span class='notice'>You [open ? "open" : "close"] the service panel.</span>", 1)
|
||||
return
|
||||
if ((istype(W, /obj/item/device/multitool)) && (src.open == 1)&& (!src.l_hacking))
|
||||
user.show_message("<span class='danger'>Now attempting to reset internal memory, please hold.</span>", 1)
|
||||
src.l_hacking = 1
|
||||
if (do_after(usr, 100*W.toolspeed, target = src))
|
||||
if (prob(33))
|
||||
src.l_setshort = 1
|
||||
src.l_set = 0
|
||||
user.show_message("<span class='danger'>Internal memory reset. Please give it a few seconds to reinitialize.</span>", 1)
|
||||
sleep(80)
|
||||
src.l_setshort = 0
|
||||
src.l_hacking = 0
|
||||
else
|
||||
user.show_message("<span class='danger'>Unable to reset internal memory.</span>", 1)
|
||||
src.l_hacking = 0
|
||||
else
|
||||
src.l_hacking = 0
|
||||
return
|
||||
//At this point you have exhausted all the special things to do when locked
|
||||
// ... but it's still locked.
|
||||
return
|
||||
|
||||
// -> storage/attackby() what with handle insertion, etc
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/secure/MouseDrop(over_object, src_location, over_location)
|
||||
if (locked)
|
||||
src.add_fingerprint(usr)
|
||||
to_chat(usr, "<span class='warning'>It's locked!</span>")
|
||||
return 0
|
||||
..()
|
||||
|
||||
/obj/item/storage/secure/attack_self(mob/user)
|
||||
user.set_machine(src)
|
||||
var/dat = text("<TT><B>[]</B><BR>\n\nLock Status: []",src, (src.locked ? "LOCKED" : "UNLOCKED"))
|
||||
var/message = "Code"
|
||||
if ((src.l_set == 0) && (!src.l_setshort))
|
||||
dat += text("<p>\n<b>5-DIGIT PASSCODE NOT SET.<br>ENTER NEW PASSCODE.</b>")
|
||||
if (src.l_setshort)
|
||||
dat += text("<p>\n<font color=red><b>ALERT: MEMORY SYSTEM ERROR - 6040 201</b></font>")
|
||||
message = text("[]", src.code)
|
||||
if (!src.locked)
|
||||
message = "*****"
|
||||
dat += text("<HR>\n>[]<BR>\n<A href='?src=\ref[];type=1'>1</A>-<A href='?src=\ref[];type=2'>2</A>-<A href='?src=\ref[];type=3'>3</A><BR>\n<A href='?src=\ref[];type=4'>4</A>-<A href='?src=\ref[];type=5'>5</A>-<A href='?src=\ref[];type=6'>6</A><BR>\n<A href='?src=\ref[];type=7'>7</A>-<A href='?src=\ref[];type=8'>8</A>-<A href='?src=\ref[];type=9'>9</A><BR>\n<A href='?src=\ref[];type=R'>R</A>-<A href='?src=\ref[];type=0'>0</A>-<A href='?src=\ref[];type=E'>E</A><BR>\n</TT>", message, src, src, src, src, src, src, src, src, src, src, src, src)
|
||||
user << browse(dat, "window=caselock;size=300x280")
|
||||
|
||||
/obj/item/storage/secure/Topic(href, href_list)
|
||||
..()
|
||||
if ((usr.stat || usr.restrained()) || (get_dist(src, usr) > 1))
|
||||
return
|
||||
if (href_list["type"])
|
||||
if (href_list["type"] == "E")
|
||||
if ((src.l_set == 0) && (length(src.code) == 5) && (!src.l_setshort) && (src.code != "ERROR"))
|
||||
src.l_code = src.code
|
||||
src.l_set = 1
|
||||
else if ((src.code == src.l_code) && (src.l_set == 1))
|
||||
src.locked = FALSE
|
||||
cut_overlays()
|
||||
add_overlay(icon_opened)
|
||||
src.code = null
|
||||
else
|
||||
src.code = "ERROR"
|
||||
else
|
||||
if ((href_list["type"] == "R") && (!src.l_setshort))
|
||||
src.locked = TRUE
|
||||
cut_overlays()
|
||||
src.code = null
|
||||
src.close(usr)
|
||||
else
|
||||
src.code += text("[]", sanitize_text(href_list["type"]))
|
||||
if (length(src.code) > 5)
|
||||
src.code = "ERROR"
|
||||
src.add_fingerprint(usr)
|
||||
for(var/mob/M in viewers(1, src.loc))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_self(M)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/storage/secure/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>It's locked!</span>")
|
||||
return null
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/secure/can_be_inserted(obj/item/W, stop_messages = 0)
|
||||
if(locked)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
|
||||
// -----------------------------
|
||||
// Secure Briefcase
|
||||
// -----------------------------
|
||||
/obj/item/storage/secure/briefcase
|
||||
name = "secure briefcase"
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "secure"
|
||||
item_state = "sec-case"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/briefcase_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/briefcase_righthand.dmi'
|
||||
desc = "A large briefcase with a digital locking system."
|
||||
force = 8
|
||||
hitsound = "swing_hit"
|
||||
throw_speed = 2
|
||||
throw_range = 4
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
max_w_class = WEIGHT_CLASS_NORMAL
|
||||
max_combined_w_class = 21
|
||||
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
|
||||
|
||||
/obj/item/storage/secure/briefcase/PopulateContents()
|
||||
new /obj/item/paper(src)
|
||||
new /obj/item/pen(src)
|
||||
|
||||
/obj/item/storage/secure/briefcase/attack_hand(mob/user)
|
||||
if ((src.loc == user) && (src.locked == 1))
|
||||
to_chat(usr, "<span class='warning'>[src] is locked and cannot be opened!</span>")
|
||||
add_fingerprint(user)
|
||||
else
|
||||
..()
|
||||
|
||||
//Syndie variant of Secure Briefcase. Contains space cash, slightly more robust.
|
||||
/obj/item/storage/secure/briefcase/syndie
|
||||
force = 15
|
||||
|
||||
/obj/item/storage/secure/briefcase/syndie/PopulateContents()
|
||||
..()
|
||||
for(var/i = 0, i < storage_slots - 2, i++)
|
||||
new /obj/item/stack/spacecash/c1000(src)
|
||||
|
||||
|
||||
// -----------------------------
|
||||
// Secure Safe
|
||||
// -----------------------------
|
||||
|
||||
/obj/item/storage/secure/safe
|
||||
name = "secure safe"
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "safe"
|
||||
icon_opened = "safe0"
|
||||
icon_locking = "safeb"
|
||||
icon_sparking = "safespark"
|
||||
force = 8
|
||||
w_class = WEIGHT_CLASS_GIGANTIC
|
||||
max_w_class = 8
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
cant_hold = list(/obj/item/storage/secure/briefcase)
|
||||
|
||||
/obj/item/storage/secure/safe/PopulateContents()
|
||||
new /obj/item/paper(src)
|
||||
new /obj/item/pen(src)
|
||||
|
||||
/obj/item/storage/secure/safe/attack_hand(mob/user)
|
||||
return attack_self(user)
|
||||
|
||||
/obj/item/storage/secure/safe/HoS
|
||||
name = "head of security's safe"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+223
-221
@@ -1,228 +1,230 @@
|
||||
/obj
|
||||
var/crit_fail = FALSE
|
||||
animate_movement = 2
|
||||
var/throwforce = 0
|
||||
var/in_use = 0 // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING!
|
||||
|
||||
var/damtype = BRUTE
|
||||
var/force = 0
|
||||
|
||||
var/list/armor
|
||||
/obj
|
||||
var/crit_fail = FALSE
|
||||
animate_movement = 2
|
||||
var/throwforce = 0
|
||||
var/in_use = 0 // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING!
|
||||
|
||||
var/damtype = BRUTE
|
||||
var/force = 0
|
||||
|
||||
var/list/armor
|
||||
var/obj_integrity //defaults to max_integrity
|
||||
var/max_integrity = 500
|
||||
var/integrity_failure = 0 //0 if we have no special broken behavior
|
||||
|
||||
var/resistance_flags = 0 // INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ON_FIRE | UNACIDABLE | ACID_PROOF
|
||||
|
||||
var/acid_level = 0 //how much acid is on that obj
|
||||
|
||||
var/being_shocked = FALSE
|
||||
|
||||
var/on_blueprints = FALSE //Are we visible on the station blueprints at roundstart?
|
||||
var/force_blueprints = FALSE //forces the obj to be on the blueprints, regardless of when it was created.
|
||||
|
||||
var/persistence_replacement //have something WAY too amazing to live to the next round? Set a new path here. Overuse of this var will make me upset.
|
||||
var/unique_rename = FALSE // can you customize the description/name of the thing?
|
||||
var/current_skin //Has the item been reskinned?
|
||||
var/list/unique_reskin //List of options to reskin.
|
||||
var/dangerous_possession = FALSE //Admin possession yes/no
|
||||
|
||||
/obj/vv_edit_var(vname, vval)
|
||||
switch(vname)
|
||||
if("dangerous_possession")
|
||||
return FALSE
|
||||
if("control_object")
|
||||
var/obj/O = vval
|
||||
if(istype(O) && O.dangerous_possession)
|
||||
return FALSE
|
||||
..()
|
||||
|
||||
/obj/Initialize()
|
||||
. = ..()
|
||||
if (!armor)
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0)
|
||||
var/max_integrity = 500
|
||||
var/integrity_failure = 0 //0 if we have no special broken behavior
|
||||
|
||||
var/resistance_flags = 0 // INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ON_FIRE | UNACIDABLE | ACID_PROOF
|
||||
|
||||
var/acid_level = 0 //how much acid is on that obj
|
||||
|
||||
var/being_shocked = FALSE
|
||||
|
||||
var/on_blueprints = FALSE //Are we visible on the station blueprints at roundstart?
|
||||
var/force_blueprints = FALSE //forces the obj to be on the blueprints, regardless of when it was created.
|
||||
|
||||
var/persistence_replacement //have something WAY too amazing to live to the next round? Set a new path here. Overuse of this var will make me upset.
|
||||
var/unique_rename = FALSE // can you customize the description/name of the thing?
|
||||
var/current_skin //Has the item been reskinned?
|
||||
var/list/unique_reskin //List of options to reskin.
|
||||
var/dangerous_possession = FALSE //Admin possession yes/no
|
||||
|
||||
/obj/vv_edit_var(vname, vval)
|
||||
switch(vname)
|
||||
if("dangerous_possession")
|
||||
return FALSE
|
||||
if("control_object")
|
||||
var/obj/O = vval
|
||||
if(istype(O) && O.dangerous_possession)
|
||||
return FALSE
|
||||
..()
|
||||
|
||||
/obj/Initialize()
|
||||
. = ..()
|
||||
if (!armor)
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0)
|
||||
if(obj_integrity == null)
|
||||
obj_integrity = max_integrity
|
||||
if(on_blueprints && isturf(loc))
|
||||
var/turf/T = loc
|
||||
if(force_blueprints)
|
||||
T.add_blueprints(src)
|
||||
else
|
||||
T.add_blueprints_preround(src)
|
||||
|
||||
/obj/Destroy(force=FALSE)
|
||||
if(!istype(src, /obj/machinery))
|
||||
STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
|
||||
SStgui.close_uis(src)
|
||||
. = ..()
|
||||
|
||||
/obj/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
|
||||
..()
|
||||
if(on_blueprints && isturf(loc))
|
||||
var/turf/T = loc
|
||||
if(force_blueprints)
|
||||
T.add_blueprints(src)
|
||||
else
|
||||
T.add_blueprints_preround(src)
|
||||
|
||||
/obj/Destroy(force=FALSE)
|
||||
if(!istype(src, /obj/machinery))
|
||||
STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
|
||||
SStgui.close_uis(src)
|
||||
. = ..()
|
||||
|
||||
/obj/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
|
||||
..()
|
||||
if(flags_2 & FROZEN_2)
|
||||
visible_message("<span class='danger'>[src] shatters into a million pieces!</span>")
|
||||
qdel(src)
|
||||
|
||||
/obj/assume_air(datum/gas_mixture/giver)
|
||||
if(loc)
|
||||
return loc.assume_air(giver)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/remove_air(amount)
|
||||
if(loc)
|
||||
return loc.remove_air(amount)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/return_air()
|
||||
if(loc)
|
||||
return loc.return_air()
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request)
|
||||
//Return: (NONSTANDARD)
|
||||
// null if object handles breathing logic for lifeform
|
||||
// datum/air_group to tell lifeform to process using that breath return
|
||||
//DEFAULT: Take air from turf to give to have mob process
|
||||
|
||||
if(breath_request>0)
|
||||
var/datum/gas_mixture/environment = return_air()
|
||||
var/breath_percentage = BREATH_VOLUME / environment.return_volume()
|
||||
return remove_air(environment.total_moles() * breath_percentage)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/proc/updateUsrDialog()
|
||||
if(in_use)
|
||||
var/is_in_use = 0
|
||||
var/list/nearby = viewers(1, src)
|
||||
for(var/mob/M in nearby)
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = 1
|
||||
src.attack_hand(M)
|
||||
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr))
|
||||
if (!(usr in nearby))
|
||||
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
|
||||
is_in_use = 1
|
||||
src.attack_ai(usr)
|
||||
|
||||
// check for TK users
|
||||
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(!(usr in nearby))
|
||||
if(usr.client && usr.machine==src)
|
||||
if(H.dna.check_mutation(TK))
|
||||
is_in_use = 1
|
||||
src.attack_hand(usr)
|
||||
in_use = is_in_use
|
||||
|
||||
/obj/proc/updateDialog()
|
||||
// Check that people are actually using the machine. If not, don't update anymore.
|
||||
if(in_use)
|
||||
var/list/nearby = viewers(1, src)
|
||||
var/is_in_use = 0
|
||||
for(var/mob/M in nearby)
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = 1
|
||||
src.interact(M)
|
||||
var/ai_in_use = AutoUpdateAI(src)
|
||||
|
||||
if(!ai_in_use && !is_in_use)
|
||||
in_use = 0
|
||||
|
||||
|
||||
/obj/attack_ghost(mob/user)
|
||||
if(ui_interact(user) != -1)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/proc/container_resist(mob/living/user)
|
||||
return
|
||||
|
||||
/obj/proc/update_icon()
|
||||
return
|
||||
|
||||
/mob/proc/unset_machine()
|
||||
if(machine)
|
||||
machine.on_unset_machine(src)
|
||||
machine = null
|
||||
|
||||
//called when the user unsets the machine.
|
||||
/atom/movable/proc/on_unset_machine(mob/user)
|
||||
return
|
||||
|
||||
/mob/proc/set_machine(obj/O)
|
||||
if(src.machine)
|
||||
unset_machine()
|
||||
src.machine = O
|
||||
if(istype(O))
|
||||
O.in_use = 1
|
||||
|
||||
/obj/item/proc/updateSelfDialog()
|
||||
var/mob/M = src.loc
|
||||
if(istype(M) && M.client && M.machine == src)
|
||||
src.attack_self(M)
|
||||
|
||||
/obj/proc/hide(h)
|
||||
return
|
||||
|
||||
/obj/singularity_pull(S, current_size)
|
||||
if(!anchored || current_size >= STAGE_FIVE)
|
||||
step_towards(src,S)
|
||||
|
||||
/obj/get_spans()
|
||||
return ..() | SPAN_ROBOT
|
||||
|
||||
/obj/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
|
||||
var/turf/T = get_turf(src)
|
||||
return T.storage_contents_dump_act(src_object, user)
|
||||
|
||||
/obj/proc/CanAStarPass()
|
||||
. = !density
|
||||
|
||||
/obj/proc/check_uplink_validity()
|
||||
return 1
|
||||
|
||||
/obj/proc/on_mob_move(dir, mob, oldLoc)
|
||||
return
|
||||
|
||||
/obj/proc/on_mob_turn(dir, mob)
|
||||
return
|
||||
|
||||
visible_message("<span class='danger'>[src] shatters into a million pieces!</span>")
|
||||
qdel(src)
|
||||
|
||||
/obj/assume_air(datum/gas_mixture/giver)
|
||||
if(loc)
|
||||
return loc.assume_air(giver)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/remove_air(amount)
|
||||
if(loc)
|
||||
return loc.remove_air(amount)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/return_air()
|
||||
if(loc)
|
||||
return loc.return_air()
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request)
|
||||
//Return: (NONSTANDARD)
|
||||
// null if object handles breathing logic for lifeform
|
||||
// datum/air_group to tell lifeform to process using that breath return
|
||||
//DEFAULT: Take air from turf to give to have mob process
|
||||
|
||||
if(breath_request>0)
|
||||
var/datum/gas_mixture/environment = return_air()
|
||||
var/breath_percentage = BREATH_VOLUME / environment.return_volume()
|
||||
return remove_air(environment.total_moles() * breath_percentage)
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/proc/updateUsrDialog()
|
||||
if(in_use)
|
||||
var/is_in_use = 0
|
||||
var/list/nearby = viewers(1, src)
|
||||
for(var/mob/M in nearby)
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = 1
|
||||
src.attack_hand(M)
|
||||
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr))
|
||||
if (!(usr in nearby))
|
||||
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
|
||||
is_in_use = 1
|
||||
src.attack_ai(usr)
|
||||
|
||||
// check for TK users
|
||||
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(!(usr in nearby))
|
||||
if(usr.client && usr.machine==src)
|
||||
if(H.dna.check_mutation(TK))
|
||||
is_in_use = 1
|
||||
src.attack_hand(usr)
|
||||
in_use = is_in_use
|
||||
|
||||
/obj/proc/updateDialog()
|
||||
// Check that people are actually using the machine. If not, don't update anymore.
|
||||
if(in_use)
|
||||
var/list/nearby = viewers(1, src)
|
||||
var/is_in_use = 0
|
||||
for(var/mob/M in nearby)
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = 1
|
||||
src.interact(M)
|
||||
var/ai_in_use = AutoUpdateAI(src)
|
||||
|
||||
if(!ai_in_use && !is_in_use)
|
||||
in_use = 0
|
||||
|
||||
|
||||
/obj/attack_ghost(mob/user)
|
||||
if(ui_interact(user) != -1)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/proc/container_resist(mob/living/user)
|
||||
return
|
||||
|
||||
/obj/proc/update_icon()
|
||||
return
|
||||
|
||||
/mob/proc/unset_machine()
|
||||
if(machine)
|
||||
machine.on_unset_machine(src)
|
||||
machine = null
|
||||
|
||||
//called when the user unsets the machine.
|
||||
/atom/movable/proc/on_unset_machine(mob/user)
|
||||
return
|
||||
|
||||
/mob/proc/set_machine(obj/O)
|
||||
if(src.machine)
|
||||
unset_machine()
|
||||
src.machine = O
|
||||
if(istype(O))
|
||||
O.in_use = 1
|
||||
|
||||
/obj/item/proc/updateSelfDialog()
|
||||
var/mob/M = src.loc
|
||||
if(istype(M) && M.client && M.machine == src)
|
||||
src.attack_self(M)
|
||||
|
||||
/obj/proc/hide(h)
|
||||
return
|
||||
|
||||
/obj/singularity_pull(S, current_size)
|
||||
if(!anchored || current_size >= STAGE_FIVE)
|
||||
step_towards(src,S)
|
||||
|
||||
/obj/get_spans()
|
||||
return ..() | SPAN_ROBOT
|
||||
|
||||
/obj/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
|
||||
return
|
||||
|
||||
/obj/get_dumping_location(obj/item/storage/source,mob/user)
|
||||
return get_turf(src)
|
||||
|
||||
/obj/proc/CanAStarPass()
|
||||
. = !density
|
||||
|
||||
/obj/proc/check_uplink_validity()
|
||||
return 1
|
||||
|
||||
/obj/proc/on_mob_move(dir, mob, oldLoc)
|
||||
return
|
||||
|
||||
/obj/proc/on_mob_turn(dir, mob)
|
||||
return
|
||||
|
||||
/obj/proc/intercept_user_move(dir, mob, newLoc, oldLoc)
|
||||
return
|
||||
|
||||
/obj/vv_get_dropdown()
|
||||
. = ..()
|
||||
.["Delete all of type"] = "?_src_=vars;delall=\ref[src]"
|
||||
|
||||
/obj/examine(mob/user)
|
||||
..()
|
||||
if(unique_rename)
|
||||
to_chat(user, "<span class='notice'>Use a pen on it to rename it or change its description.</span>")
|
||||
if(unique_reskin && !current_skin)
|
||||
to_chat(user, "<span class='notice'>Alt-click it to reskin it.</span>")
|
||||
|
||||
/obj/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(unique_reskin && !current_skin && in_range(user,src))
|
||||
if(user.incapacitated())
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
reskin_obj(user)
|
||||
|
||||
/obj/proc/reskin_obj(mob/M)
|
||||
if(!LAZYLEN(unique_reskin))
|
||||
return
|
||||
var/choice = input(M,"Warning, you can only reskin [src] once!","Reskin Object") as null|anything in unique_reskin
|
||||
if(!QDELETED(src) && choice && !current_skin && !M.incapacitated() && in_range(M,src))
|
||||
if(!unique_reskin[choice])
|
||||
return
|
||||
current_skin = choice
|
||||
icon_state = unique_reskin[choice]
|
||||
to_chat(M, "[src] is now skinned as '[choice].'")
|
||||
|
||||
/obj/proc/gang_contraband_value()
|
||||
return 0
|
||||
/obj/vv_get_dropdown()
|
||||
. = ..()
|
||||
.["Delete all of type"] = "?_src_=vars;delall=\ref[src]"
|
||||
|
||||
/obj/examine(mob/user)
|
||||
..()
|
||||
if(unique_rename)
|
||||
to_chat(user, "<span class='notice'>Use a pen on it to rename it or change its description.</span>")
|
||||
if(unique_reskin && !current_skin)
|
||||
to_chat(user, "<span class='notice'>Alt-click it to reskin it.</span>")
|
||||
|
||||
/obj/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(unique_reskin && !current_skin && in_range(user,src))
|
||||
if(user.incapacitated())
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
reskin_obj(user)
|
||||
|
||||
/obj/proc/reskin_obj(mob/M)
|
||||
if(!LAZYLEN(unique_reskin))
|
||||
return
|
||||
var/choice = input(M,"Warning, you can only reskin [src] once!","Reskin Object") as null|anything in unique_reskin
|
||||
if(!QDELETED(src) && choice && !current_skin && !M.incapacitated() && in_range(M,src))
|
||||
if(!unique_reskin[choice])
|
||||
return
|
||||
current_skin = choice
|
||||
icon_state = unique_reskin[choice]
|
||||
to_chat(M, "[src] is now skinned as '[choice].'")
|
||||
|
||||
/obj/proc/gang_contraband_value()
|
||||
return 0
|
||||
|
||||
@@ -137,8 +137,8 @@
|
||||
new mineral(loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/falsewall/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
|
||||
return 0
|
||||
/obj/structure/falsewall/get_dumping_location(obj/item/storage/source,mob/user)
|
||||
return null
|
||||
|
||||
/obj/structure/falsewall/examine_status(mob/user) //So you can't detect falsewalls by examine.
|
||||
return null
|
||||
|
||||
@@ -226,8 +226,8 @@
|
||||
C.powernet.load += C.powernet.avail * 0.0375 // you can gain up to 3.5 via the 4x upgrades power is halved by the pole so thats 2x then 1X then .5X for 3.5x the 3 bounces shock.
|
||||
return ..()
|
||||
|
||||
/obj/structure/grille/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
|
||||
return 0
|
||||
/obj/structure/grille/get_dumping_location(obj/item/storage/source,mob/user)
|
||||
return null
|
||||
|
||||
/obj/structure/grille/broken // Pre-broken grilles for map placement
|
||||
icon_state = "brokengrille"
|
||||
|
||||
Reference in New Issue
Block a user