Merge remote-tracking branch 'citadel/master' into mobility_flags
This commit is contained in:
@@ -57,14 +57,16 @@
|
||||
playsound(loc, 'sound/items/eatfood.ogg', 50, 1, -1)
|
||||
return (TOXLOSS)
|
||||
|
||||
/obj/item/storage/bag/trash/update_icon()
|
||||
if(contents.len == 0)
|
||||
icon_state = "[initial(icon_state)]"
|
||||
else if(contents.len < 12)
|
||||
icon_state = "[initial(icon_state)]1"
|
||||
else if(contents.len < 21)
|
||||
icon_state = "[initial(icon_state)]2"
|
||||
else icon_state = "[initial(icon_state)]3"
|
||||
/obj/item/storage/bag/trash/update_icon_state()
|
||||
switch(contents.len)
|
||||
if(0)
|
||||
icon_state = "[initial(icon_state)]"
|
||||
if(0 to 11)
|
||||
icon_state = "[initial(icon_state)]1"
|
||||
if(11 to 20)
|
||||
icon_state = "[initial(icon_state)]2"
|
||||
else
|
||||
icon_state = "[initial(icon_state)]3"
|
||||
|
||||
/obj/item/storage/bag/trash/cyborg
|
||||
insertable = FALSE
|
||||
@@ -355,10 +357,13 @@
|
||||
M.DefaultCombatKnockdown(40)
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/bag/tray/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/storage/bag/tray/update_overlays()
|
||||
. = ..()
|
||||
for(var/obj/item/I in contents)
|
||||
add_overlay(new /mutable_appearance(I))
|
||||
var/mutable_appearance/I_copy = new(I)
|
||||
I_copy.plane = FLOAT_PLANE
|
||||
I_copy.layer = FLOAT_LAYER
|
||||
. += I_copy
|
||||
|
||||
/obj/item/storage/bag/tray/Entered()
|
||||
. = ..()
|
||||
|
||||
@@ -10,23 +10,21 @@
|
||||
attack_verb = list("whipped", "lashed", "disciplined")
|
||||
max_integrity = 300
|
||||
var/content_overlays = FALSE //If this is true, the belt will gain overlays based on what it's holding
|
||||
var/worn_overlays = FALSE //worn counterpart of the above.
|
||||
var/onmob_overlays = FALSE //worn counterpart of the above.
|
||||
|
||||
/obj/item/storage/belt/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins belting [user.p_them()]self with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/storage/belt/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/storage/belt/update_overlays()
|
||||
. = ..()
|
||||
if(content_overlays)
|
||||
for(var/obj/item/I in contents)
|
||||
var/mutable_appearance/M = I.get_belt_overlay()
|
||||
add_overlay(M)
|
||||
..()
|
||||
. += I.get_belt_overlay()
|
||||
|
||||
/obj/item/storage/belt/worn_overlays(isinhands, icon_file, style_flags = NONE)
|
||||
. = ..()
|
||||
if(!isinhands && worn_overlays)
|
||||
if(!isinhands && onmob_overlays)
|
||||
for(var/obj/item/I in contents)
|
||||
. += I.get_worn_belt_overlay(icon_file)
|
||||
|
||||
@@ -34,6 +32,11 @@
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/belt/ComponentInitialize()
|
||||
. = ..()
|
||||
if(onmob_overlays)
|
||||
AddElement(/datum/element/update_icon_updates_onmob)
|
||||
|
||||
/obj/item/storage/belt/utility
|
||||
name = "toolbelt" //Carn: utility belt is nicer, but it bamboozles the text parsing.
|
||||
desc = "Holds tools."
|
||||
@@ -769,7 +772,7 @@
|
||||
item_state = "sheath"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
content_overlays = TRUE
|
||||
worn_overlays = TRUE
|
||||
onmob_overlays = TRUE
|
||||
var/list/fitting_swords = list(/obj/item/melee/sabre, /obj/item/melee/baton/stunsword)
|
||||
var/starting_sword = /obj/item/melee/sabre
|
||||
|
||||
@@ -787,12 +790,6 @@
|
||||
if(length(contents))
|
||||
. += "<span class='notice'>Alt-click it to quickly draw the blade.</span>"
|
||||
|
||||
/obj/item/storage/belt/sabre/update_icon()
|
||||
. = ..()
|
||||
if(isliving(loc))
|
||||
var/mob/living/L = loc
|
||||
L.regenerate_icons()
|
||||
|
||||
/obj/item/storage/belt/sabre/PopulateContents()
|
||||
new starting_sword(src)
|
||||
|
||||
|
||||
@@ -50,11 +50,10 @@
|
||||
user.visible_message("<span class='suicide'>[user] beating [user.p_them()]self with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/storage/box/update_icon()
|
||||
/obj/item/storage/box/update_overlays()
|
||||
. = ..()
|
||||
if(illustration)
|
||||
cut_overlays()
|
||||
add_overlay(illustration)
|
||||
. += illustration
|
||||
|
||||
/obj/item/storage/box/attack_self(mob/user)
|
||||
..()
|
||||
@@ -866,10 +865,11 @@
|
||||
foldable = null
|
||||
var/design = NODESIGN
|
||||
|
||||
/obj/item/storage/box/papersack/update_icon()
|
||||
/obj/item/storage/box/papersack/update_icon_state()
|
||||
if(contents.len == 0)
|
||||
icon_state = "[item_state]"
|
||||
else icon_state = "[item_state]_closed"
|
||||
else
|
||||
icon_state = "[item_state]_closed"
|
||||
|
||||
/obj/item/storage/box/papersack/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pen))
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
for(var/i = 1 to STR.max_items)
|
||||
new spawn_type(src)
|
||||
|
||||
/obj/item/storage/fancy/update_icon()
|
||||
/obj/item/storage/fancy/update_icon_state()
|
||||
if(fancy_open)
|
||||
icon_state = "[icon_type]box[contents.len]"
|
||||
else
|
||||
@@ -160,30 +160,31 @@
|
||||
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/update_icon()
|
||||
if(fancy_open || !contents.len)
|
||||
cut_overlays()
|
||||
if(!contents.len)
|
||||
icon_state = "[initial(icon_state)]_empty"
|
||||
/obj/item/storage/fancy/cigarettes/update_icon_state()
|
||||
if(!contents.len)
|
||||
icon_state = "[initial(icon_state)]_empty"
|
||||
else if(fancy_open)
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/update_overlays()
|
||||
. = ..()
|
||||
if(!fancy_open || !contents.len)
|
||||
return
|
||||
. *= "[icon_state]_open"
|
||||
var/cig_position = 1
|
||||
for(var/C in contents)
|
||||
var/mutable_appearance/inserted_overlay = mutable_appearance(icon)
|
||||
|
||||
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
|
||||
icon_state = initial(icon_state)
|
||||
add_overlay("[icon_state]_open")
|
||||
var/cig_position = 1
|
||||
for(var/C in contents)
|
||||
var/mutable_appearance/inserted_overlay = mutable_appearance(icon)
|
||||
inserted_overlay.icon_state = "cigarette"
|
||||
|
||||
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"
|
||||
|
||||
inserted_overlay.icon_state = "[inserted_overlay.icon_state]_[cig_position]"
|
||||
add_overlay(inserted_overlay)
|
||||
cig_position++
|
||||
else
|
||||
cut_overlays()
|
||||
inserted_overlay.icon_state = "[inserted_overlay.icon_state]_[cig_position]"
|
||||
. += inserted_overlay
|
||||
cig_position++
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!ismob(M))
|
||||
@@ -282,10 +283,10 @@
|
||||
STR.max_items = 10
|
||||
STR.can_hold = typecacheof(list(/obj/item/rollingpaper))
|
||||
|
||||
/obj/item/storage/fancy/rollingpapers/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/storage/fancy/rollingpapers/update_overlays()
|
||||
. = ..()
|
||||
if(!contents.len)
|
||||
add_overlay("[icon_state]_empty")
|
||||
. += "[icon_state]_empty"
|
||||
|
||||
/////////////
|
||||
//CIGAR BOX//
|
||||
@@ -306,21 +307,23 @@
|
||||
STR.max_items = 5
|
||||
STR.can_hold = typecacheof(list(/obj/item/clothing/mask/cigarette/cigar))
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/storage/fancy/cigarettes/cigars/update_icon_state()
|
||||
if(fancy_open)
|
||||
icon_state = "[initial(icon_state)]_open"
|
||||
|
||||
var/cigar_position = 0 //to keep track of the pixel_x offset of each new overlay.
|
||||
for(var/obj/item/clothing/mask/cigarette/cigar/smokes in contents)
|
||||
var/mutable_appearance/cigar_overlay = mutable_appearance(icon, "[smokes.icon_off]")
|
||||
cigar_overlay.pixel_x = 3 * cigar_position
|
||||
add_overlay(cigar_overlay)
|
||||
cigar_position++
|
||||
|
||||
else
|
||||
icon_state = "[initial(icon_state)]"
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/update_overlays()
|
||||
. = ..()
|
||||
if(!fancy_open)
|
||||
return
|
||||
var/cigar_position = 0 //to keep track of the pixel_x offset of each new overlay.
|
||||
for(var/obj/item/clothing/mask/cigarette/cigar/smokes in contents)
|
||||
var/mutable_appearance/cigar_overlay = mutable_appearance(icon, "[smokes.icon_off]")
|
||||
cigar_overlay.pixel_x = 3 * cigar_position
|
||||
. += cigar_overlay
|
||||
cigar_position++
|
||||
|
||||
/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."
|
||||
@@ -382,4 +385,4 @@
|
||||
icon_state = "silver ringbox"
|
||||
icon_type = "silver ring"
|
||||
spawn_type = /obj/item/clothing/gloves/ring/silver
|
||||
|
||||
|
||||
|
||||
@@ -132,29 +132,34 @@
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/conduct(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/storage/lockbox/medal/update_icon_state()
|
||||
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
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/update_overlays()
|
||||
. = ..()
|
||||
if(!contents || !open)
|
||||
return
|
||||
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
if(locked)
|
||||
return
|
||||
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)
|
||||
. += medalicon
|
||||
|
||||
/obj/item/storage/lockbox/medal/sec
|
||||
name = "security medal box"
|
||||
|
||||
@@ -33,14 +33,11 @@ GLOBAL_LIST_EMPTY(rubber_toolbox_icons)
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/toolbox/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
if(length(blood_DNA))
|
||||
add_blood_overlay()
|
||||
/obj/item/storage/toolbox/update_overlays()
|
||||
. = ..()
|
||||
if(has_latches)
|
||||
var/icon/I = icon('icons/obj/storage.dmi', latches)
|
||||
add_overlay(I)
|
||||
. += I
|
||||
|
||||
|
||||
/obj/item/storage/toolbox/suicide_act(mob/user)
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
. = ..()
|
||||
refreshID()
|
||||
|
||||
/obj/item/storage/wallet/update_icon()
|
||||
/obj/item/storage/wallet/update_icon_state()
|
||||
var/new_state = "wallet"
|
||||
if(front_id)
|
||||
new_state = "wallet_id"
|
||||
|
||||
Reference in New Issue
Block a user