Merge pull request #10457 from Zuhayr/dev-freeze

Custom item rolldown.
This commit is contained in:
mwerezak
2015-08-09 10:33:54 -04:00
7 changed files with 48 additions and 20 deletions

View File

@@ -396,10 +396,29 @@ BLIND // can't see anything
else
worn_state = icon_state
//autodetect rollability
if(rolled_down < 0)
if((worn_state + "_d_s") in icon_states('icons/mob/uniform.dmi'))
/obj/item/clothing/under/proc/update_rolldown_status()
var/mob/living/carbon/human/H
if(istype(src.loc, /mob/living/carbon/human))
H = src.loc
var/icon/under_icon
if(icon_override)
under_icon = icon_override
else if(H && sprite_sheets && sprite_sheets[H.species.name])
under_icon = sprite_sheets[H.species.name]
else if(item_icons && item_icons[slot_w_uniform_str])
under_icon = item_icons[slot_w_uniform_str]
else
under_icon = INV_W_UNIFORM_DEF_ICON
// The _s is because the icon update procs append it.
if(("[worn_state]_d_s") in icon_states(under_icon))
if(rolled_down != 1)
rolled_down = 0
else
rolled_down = -1
if(H) update_clothing_icon()
/obj/item/clothing/under/update_clothing_icon()
if (ismob(src.loc))
@@ -542,7 +561,8 @@ BLIND // can't see anything
if(!istype(usr, /mob/living)) return
if(usr.stat) return
if(rolled_down < 0)
update_rolldown_status()
if(rolled_down == -1)
usr << "<span class='notice'>You cannot roll down [src]!</span>"
return

View File

@@ -61,6 +61,11 @@
item.item_state = null
item.icon_override = CUSTOM_ITEM_MOB
var/obj/item/clothing/under/U = item
if(istype(U))
U.worn_state = U.icon_state
U.update_rolldown_status()
// Kits are dumb so this is going to have to be hardcoded/snowflake.
if(istype(item, /obj/item/device/kit))
var/obj/item/device/kit/K = item

View File

@@ -278,7 +278,7 @@ var/list/ai_verbs_default = list(
if(Entry[1] == src.ckey && Entry[2] == src.real_name)
custom_sprite = 1 //They're in the list? Custom sprite time
icon = 'icons/mob/custom-synthetic.dmi'
icon = CUSTOM_ITEM_ROBOT
//if(icon_state == initial(icon_state))
var/icontype = ""

View File

@@ -25,6 +25,6 @@ var/list/robot_custom_icons
var/rname = robot_custom_icons[ckey]
if(rname && rname == real_name)
custom_sprite = 1
icon = 'icons/mob/custom-synthetic.dmi'
icon = CUSTOM_ITEM_ROBOT
if(icon_state == "robot")
icon_state = "[ckey]-Standard"

View File

@@ -977,6 +977,9 @@ var/list/be_special_flags = list(
#ifndef CUSTOM_ITEM_MOB
#define CUSTOM_ITEM_MOB 'icons/mob/custom_items_mob.dmi'
#endif
#ifndef CUSTOM_ITEM_ROBOT
#define CUSTOM_ITEM_ROBOT 'icons/mob/custom_synthetic.dmi'
#endif
//default item on-mob icons
#define INV_HEAD_DEF_ICON 'icons/mob/head.dmi'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 KiB

View File