Merge pull request #9007 from Ghommie/Ghommie-cit168
Fixes and standarizes sword sheaths/scabbards overlays.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
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.
|
||||
|
||||
/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>")
|
||||
@@ -23,6 +24,12 @@
|
||||
add_overlay(M)
|
||||
..()
|
||||
|
||||
/obj/item/storage/belt/worn_overlays(isinhands, icon_file)
|
||||
. = ..()
|
||||
if(!isinhands && worn_overlays)
|
||||
for(var/obj/item/I in contents)
|
||||
. += I.get_worn_belt_overlay(icon_file)
|
||||
|
||||
/obj/item/storage/belt/Initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
@@ -653,9 +660,10 @@
|
||||
icon_state = "sheath"
|
||||
item_state = "sheath"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
content_overlays = TRUE
|
||||
worn_overlays = TRUE
|
||||
var/list/fitting_swords = list(/obj/item/melee/sabre, /obj/item/melee/baton/stunsword)
|
||||
var/starting_sword = /obj/item/melee/sabre
|
||||
var/sword_overlay
|
||||
|
||||
/obj/item/storage/belt/sabre/ComponentInitialize()
|
||||
. = ..()
|
||||
@@ -682,27 +690,13 @@
|
||||
to_chat(user, "[src] is empty.")
|
||||
|
||||
/obj/item/storage/belt/sabre/update_icon()
|
||||
icon_state = initial(icon_state)
|
||||
item_state = initial(item_state)
|
||||
sword_overlay = null
|
||||
if(contents.len)
|
||||
var/obj/item/I = contents[1]
|
||||
sword_overlay = initial(I.icon_state)
|
||||
add_overlay("-[sword_overlay]")
|
||||
item_state += "-[I.icon_state]"
|
||||
if(loc && isliving(loc))
|
||||
. = ..()
|
||||
if(isliving(loc))
|
||||
var/mob/living/L = loc
|
||||
L.regenerate_icons()
|
||||
..()
|
||||
|
||||
/obj/item/storage/belt/sabre/worn_overlays(isinhands, icon_file)
|
||||
. = ..()
|
||||
if(!isinhands)
|
||||
. += mutable_appearance(icon_file, "-[sword_overlay]")
|
||||
|
||||
/obj/item/storage/belt/sabre/PopulateContents()
|
||||
new starting_sword(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/storage/belt/sabre/rapier
|
||||
name = "rapier sheath"
|
||||
|
||||
Reference in New Issue
Block a user