Merge pull request #9202 from Zuhayr/customitems

Custom items refactor.
This commit is contained in:
Chinsky
2015-05-14 21:47:04 +03:00
64 changed files with 845 additions and 1805 deletions
@@ -116,7 +116,7 @@ This saves us from having to call add_fingerprint() any time something is put in
update_inv_glasses()
else if (W == head)
head = null
var/update_hair = 0
if((W.flags & BLOCKHAIR) || (W.flags & BLOCKHEADHAIR))
update_hair = 1
@@ -128,7 +128,7 @@ This saves us from having to call add_fingerprint() any time something is put in
update_hair(0) //rebuild hair
update_inv_ears(0)
update_inv_wear_mask(0)
update_inv_head()
else if (W == l_ear)
l_ear = null
@@ -168,9 +168,9 @@ This saves us from having to call add_fingerprint() any time something is put in
back = null
update_inv_back()
else if (W == handcuffed)
handcuffed = null
handcuffed = null
if(buckled && buckled.buckle_require_restraints)
buckled.unbuckle_mob()
buckled.unbuckle_mob()
update_inv_handcuffed()
else if (W == legcuffed)
legcuffed = null
@@ -183,7 +183,7 @@ This saves us from having to call add_fingerprint() any time something is put in
update_inv_l_hand()
else
return 0
update_action_buttons()
return 1
@@ -321,7 +321,7 @@ This saves us from having to call add_fingerprint() any time something is put in
/mob/living/carbon/human/slot_is_accessible(var/slot, var/obj/item/I, mob/user=null)
var/obj/item/covering = null
var/check_flags = 0
switch(slot)
if(slot_wear_mask)
covering = src.head
@@ -331,7 +331,7 @@ This saves us from having to call add_fingerprint() any time something is put in
check_flags = HEADCOVERSEYES
if(slot_gloves, slot_w_uniform)
covering = src.wear_suit
if(covering)
if((covering.body_parts_covered & I.body_parts_covered) || (covering.flags & check_flags))
user << "<span class='warning'>\The [covering] is in the way.</span>"
@@ -534,7 +534,7 @@ This saves us from having to call add_fingerprint() any time something is put in
var/obj/item/clothing/accessory/A = suit.accessories[1]
target.attack_log += "\[[time_stamp()]\] <font color='orange'>Has had their accessory ([A]) removed by [source.name] ([source.ckey])</font>"
source.attack_log += "\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) accessory ([A])</font>"
if(istype(A, /obj/item/clothing/accessory/holobadge) || istype(A, /obj/item/clothing/accessory/medal))
if(istype(A, /obj/item/clothing/accessory/badge) || istype(A, /obj/item/clothing/accessory/medal))
for(var/mob/M in viewers(target, null))
M.show_message("\red <B>[source] tears off \the [A] from [target]'s [suit]!</B>" , 1)
done()
@@ -799,7 +799,7 @@ It can still be worn/put on as normal.
target.drop_from_inventory(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store.
else
source << "<span class='warning'>You fail to remove \the [strip_item] from [target]!</span>"
else if(item)
else if(item)
if(target.has_organ_for_slot(slot_to_process) && item.mob_can_equip(target, slot_to_process, 0)) //Placing an item on the mob
source.drop_from_inventory(item)
target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1)
@@ -468,7 +468,7 @@ var/global/list/damage_icon_parts = list()
under_icon = w_uniform.item_icons[slot_w_uniform_str]
else
under_icon = INV_W_UNIFORM_DEF_ICON
//determine state to use
var/under_state
if(w_uniform.item_state_slots && w_uniform.item_state_slots[slot_w_uniform_str])
@@ -480,7 +480,7 @@ var/global/list/damage_icon_parts = list()
//need to append _s to the icon state for legacy compatibility
var/image/standing = image(icon = under_icon, icon_state = "[under_state]_s")
//apply blood overlay
if(w_uniform.blood_DNA)
var/image/bloodsies = image(icon = species.blood_mask, icon_state = "uniformblood")
@@ -499,7 +499,7 @@ var/global/list/damage_icon_parts = list()
overlays_standing[UNIFORM_LAYER] = null
if(update_icons)
update_icons()
update_icons()
/mob/living/carbon/human/update_inv_wear_id(var/update_icons=1)
if(wear_id)
@@ -754,7 +754,7 @@ var/global/list/damage_icon_parts = list()
/mob/living/carbon/human/update_inv_back(var/update_icons=1)
if(back)
back.screen_loc = ui_back //TODO
//determine the icon to use
var/icon/overlay_icon
if(back.icon_override)
@@ -769,7 +769,7 @@ var/global/list/damage_icon_parts = list()
overlay_icon = back.item_icons[slot_back_str]
else
overlay_icon = INV_BACK_DEF_ICON
//determine state to use
var/overlay_state
if(back.item_state_slots && back.item_state_slots[slot_back_str])
@@ -778,13 +778,13 @@ var/global/list/damage_icon_parts = list()
overlay_state = back.item_state
else
overlay_state = back.icon_state
//create the image
overlays_standing[BACK_LAYER] = image(icon = overlay_icon, icon_state = overlay_state)
else
overlays_standing[BACK_LAYER] = null
if(update_icons)
if(update_icons)
update_icons()
@@ -822,15 +822,6 @@ var/global/list/damage_icon_parts = list()
if(r_hand)
r_hand.screen_loc = ui_rhand //TODO
//determine icon to use
var/icon/t_icon
if(r_hand.icon_override)
t_icon = r_hand.icon_override
else if(r_hand.item_icons && (slot_r_hand_str in r_hand.item_icons))
t_icon = r_hand.item_icons[slot_r_hand_str]
else
t_icon = INV_R_HAND_DEF_ICON
//determine icon state to use
var/t_state
if(r_hand.item_state_slots && r_hand.item_state_slots[slot_r_hand_str])
@@ -839,7 +830,17 @@ var/global/list/damage_icon_parts = list()
t_state = r_hand.item_state
else
t_state = r_hand.icon_state
//determine icon to use
var/icon/t_icon
if(r_hand.icon_override)
t_state += "_r"
t_icon = r_hand.icon_override
else if(r_hand.item_icons && (slot_r_hand_str in r_hand.item_icons))
t_icon = r_hand.item_icons[slot_r_hand_str]
else
t_icon = INV_R_HAND_DEF_ICON
overlays_standing[R_HAND_LAYER] = image(icon = t_icon, icon_state = t_state)
if (handcuffed) drop_r_hand() //this should be moved out of icon code
@@ -853,15 +854,6 @@ var/global/list/damage_icon_parts = list()
if(l_hand)
l_hand.screen_loc = ui_lhand //TODO
//determine icon to use
var/icon/t_icon
if(l_hand.icon_override)
t_icon = l_hand.icon_override
else if(l_hand.item_icons && (slot_l_hand_str in l_hand.item_icons))
t_icon = l_hand.item_icons[slot_l_hand_str]
else
t_icon = INV_L_HAND_DEF_ICON
//determine icon state to use
var/t_state
if(l_hand.item_state_slots && l_hand.item_state_slots[slot_l_hand_str])
@@ -870,7 +862,17 @@ var/global/list/damage_icon_parts = list()
t_state = l_hand.item_state
else
t_state = l_hand.icon_state
//determine icon to use
var/icon/t_icon
if(l_hand.icon_override)
t_state += "_l"
t_icon = l_hand.icon_override
else if(l_hand.item_icons && (slot_l_hand_str in l_hand.item_icons))
t_icon = l_hand.item_icons[slot_l_hand_str]
else
t_icon = INV_L_HAND_DEF_ICON
overlays_standing[L_HAND_LAYER] = image(icon = t_icon, icon_state = t_state)
if (handcuffed) drop_l_hand() //This probably should not be here
@@ -228,6 +228,23 @@
icon_dead = "kitten_dead"
gender = NEUTER
// Leaving this here for now.
/obj/item/weapon/holder/cat/fluff/bones
name = "Bones"
desc = "It's Bones! Meow."
gender = MALE
icon_state = "cat3"
/mob/living/simple_animal/cat/fluff/bones
name = "Bones"
desc = "That's Bones the cat. He's a laid back, black cat. Meow."
gender = MALE
icon_state = "cat3"
icon_living = "cat3"
icon_dead = "cat3_dead"
holder_type = /obj/item/weapon/holder/cat/fluff/bones
var/friend_name = "Erstatz Vryroxes"
/mob/living/simple_animal/cat/kitten/New()
gender = pick(MALE, FEMALE)
..()
+1 -1
View File
@@ -314,7 +314,7 @@
var/mob/living/character = create_character() //creates the human and transfers vars and mind
character = job_master.EquipRank(character, rank, 1) //equips the human
UpdateFactionList(character)
EquipCustomItems(character)
equip_custom_items(character)
// AIs don't need a spawnpoint, they must spawn at an empty core
if(character.mind.assigned_role == "AI")