Converts jobs and admin equipment to use outfits (#5827)

Converts the jobs and admin equipment to use outfit datums.
This commit is contained in:
Werner
2019-02-19 23:58:05 +02:00
committed by Erki
parent 1bc27306a0
commit b823b4eb05
38 changed files with 1802 additions and 1447 deletions
@@ -425,9 +425,6 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
if(mind)
mind.active = 0 //we wish to transfer the key manually
if(mind.assigned_role == "Clown") //give them a clownname if they are a clown
new_character.real_name = pick(clown_names) //I hate this being here of all places but unfortunately dna is based on real_name!
new_character.rename_self("clown")
mind.original = new_character
mind.transfer_to(new_character) //won't transfer key since the mind is not active
+51 -2
View File
@@ -29,7 +29,7 @@
qdel(W)
else
if(!disable_warning)
src << "<span class='warning'>You are unable to equip that.</span>" //Only print if del_on_fail is false
to_chat(src, "<span class='warning'>You are unable to equip [W].</span>") //Only print if del_on_fail is false
return 0
equip_to_slot(W, slot, redraw_mob) //This proc should not ever fail.
@@ -43,7 +43,29 @@
//This is just a commonly used configuration for the equip_to_slot_if_possible() proc, used to equip people when the rounds tarts and when events happen and such.
/mob/proc/equip_to_slot_or_del(obj/item/W as obj, slot)
. = equip_to_slot_if_possible(W, slot, TRUE, TRUE, FALSE, ignore_blocked = TRUE)
. = equip_to_slot_if_possible(W, slot, TRUE, TRUE, FALSE, TRUE)
// Convinience proc. Collects crap that fails to equip either onto the mob's back, or drops it.
// Used in job equipping so shit doesn't pile up at the start loc.
/mob/living/carbon/human/proc/equip_or_collect(var/obj/item/W, var/slot)
if(!istype(W))
log_debug("MobEquip: Error when equipping [W] for [src] in [slot]")
return
if(W.mob_can_equip(src, slot, TRUE, TRUE))
//Mob can equip. Equip it.
equip_to_slot_or_del(W, slot)
else
//Mob can't equip it. Put it their backpack or toss it on the floor
if(istype(back, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = back
//Now, B represents a container we can insert W into.
S.handle_item_insertion(W,1)
return S
var/turf/T = get_turf(src)
if(istype(T))
W.forceMove(T)
return T
//The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot.
var/list/slot_equipment_priority = list( \
@@ -345,3 +367,30 @@ var/list/slot_equipment_priority = list( \
qdel(entry)
/mob/living/carbon/human/proc/equipOutfit(outfit, visualsOnly = FALSE)
var/datum/outfit/O = null
if(ispath(outfit))
O = new outfit
else
O = outfit
if(!istype(O))
return FALSE
if(!O)
return FALSE
return O.equip(src, visualsOnly)
/mob/living/carbon/human/proc/preEquipOutfit(outfit, visualsOnly = FALSE)
var/datum/outfit/O = null
if(ispath(outfit))
O = new outfit
else
O = outfit
if(!istype(O))
return FALSE
if(!O)
return FALSE
return O.pre_equip(src, visualsOnly)
+1 -1
View File
@@ -320,7 +320,7 @@
/mob/living/bot/farmbot/proc/check_tank()
if(!tank)
return FALSE
return ((!target && refills_water && tank.reagents.total_volume < tank.reagents.maximum_volume) || ((tank.reagents.total_volume ) / reagents.maximum_volume) <= 0.3)
return ((!target && refills_water && tank.reagents.total_volume < tank.reagents.maximum_volume) || ((tank.reagents.total_volume ) / tank.reagents.maximum_volume) <= 0.3)
/obj/item/weapon/farmbot_arm_assembly
name = "water tank/robot arm assembly"
@@ -70,7 +70,7 @@
default_h_style = "Short Vox Quills"
/datum/species/vox/equip_survival_gear(var/mob/living/carbon/human/H)
/datum/species/vox/before_equip(mob/living/carbon/human/H, visualsOnly, datum/job/J)
H.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(H), slot_wear_mask)
if(H.backbag == 1)
H.equip_to_slot_or_del(new /obj/item/weapon/tank/nitrogen(H), slot_back)
@@ -267,13 +267,11 @@
return "unknown"
return species_language.get_random_name(gender)
/datum/species/proc/equip_survival_gear(var/mob/living/carbon/human/H,var/extendedtank = 1)
if(H.backbag == 1)
if (extendedtank) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H), slot_r_hand)
else H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
else
if (extendedtank) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H.back), slot_in_backpack)
else H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
/datum/species/proc/before_equip(mob/living/carbon/human/H, visualsOnly = FALSE, datum/job/J)
return
/datum/species/proc/after_equip(mob/living/carbon/human/H, visualsOnly = FALSE, datum/job/J)
return
/datum/species/proc/create_organs(var/mob/living/carbon/human/H) //Handles creation of mob organs.
@@ -65,7 +65,8 @@
/datum/species/machine/shell/handle_death(var/mob/living/carbon/human/H)
return
/datum/species/machine/shell/equip_survival_gear(var/mob/living/carbon/human/H)
/datum/species/machine/shell/before_equip(var/mob/living/carbon/human/H)
. = ..()
check_tag(H, H.client)
/datum/species/machine/industrial
@@ -119,8 +119,8 @@
move_trail = /obj/effect/decal/cleanable/blood/tracks/claw
/datum/species/unathi/equip_survival_gear(var/mob/living/carbon/human/H)
..()
/datum/species/unathi/before_equip(var/mob/living/carbon/human/H)
. = ..()
var/obj/item/clothing/shoes/sandal/S = new /obj/item/clothing/shoes/sandal(H)
if(H.equip_to_slot_or_del(S,slot_shoes))
S.autodrobe_no_remove = 1
@@ -191,8 +191,8 @@
default_h_style = "Tajaran Ears"
/datum/species/tajaran/equip_survival_gear(var/mob/living/carbon/human/H)
..()
/datum/species/tajaran/before_equip(var/mob/living/carbon/human/H)
. = ..()
var/obj/item/clothing/shoes/sandal/S = new /obj/item/clothing/shoes/sandal(H)
if(H.equip_to_slot_or_del(S,slot_shoes))
S.autodrobe_no_remove = 1
@@ -379,7 +379,8 @@
return 1
return 0
/datum/species/diona/equip_survival_gear(var/mob/living/carbon/human/H)
/datum/species/diona/before_equip(var/mob/living/carbon/human/H)
. = ..()
var/obj/item/device/flashlight/flare/F = new /obj/item/device/flashlight/flare(H)
if(H.backbag == 1)
H.equip_to_slot_or_del(F, slot_r_hand)
@@ -641,7 +642,8 @@ datum/species/machine/handle_post_spawn(var/mob/living/carbon/human/H)
if ("yellow IPC screen")
return LIGHT_COLOR_YELLOW
/datum/species/machine/equip_survival_gear(var/mob/living/carbon/human/H)
/datum/species/machine/before_equip(var/mob/living/carbon/human/H)
. = ..()
check_tag(H, H.client)
H.gender = NEUTER
@@ -746,7 +748,8 @@ datum/species/machine/handle_post_spawn(var/mob/living/carbon/human/H)
move_trail = /obj/effect/decal/cleanable/blood/tracks/claw
/datum/species/bug/equip_survival_gear(var/mob/living/carbon/human/H)
/datum/species/bug/before_equip(var/mob/living/carbon/human/H)
. = ..()
H.gender = NEUTER
if(H.backbag == 1)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/vaurca(H), slot_r_hand)
@@ -78,9 +78,6 @@
/mob/living/carbon/human/proc/hivenet
)
/datum/species/bug/type_c/equip_survival_gear(var/mob/living/carbon/human/H)
return
/datum/species/bug/type_c/handle_post_spawn(var/mob/living/carbon/human/H)
..()
H.gender = FEMALE
@@ -154,9 +151,6 @@
"filtration bit" = /obj/item/organ/vaurca/filtrationbit
)
/datum/species/bug/type_big/equip_survival_gear(var/mob/living/carbon/human/H)
return
/datum/species/bug/type_big/handle_post_spawn(var/mob/living/carbon/human/H)
H.mutations.Add(HULK)
return ..()