mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Conflicts: baystation12.dme code/__HELPERS/game.dm code/__HELPERS/type2type.dm code/datums/helper_datums/getrev.dm code/game/atoms.dm code/game/gamemodes/events.dm code/game/machinery/atmo_control.dm code/game/machinery/atmoalter/area_atmos_computer.dm code/game/machinery/computer/HolodeckControl.dm code/game/machinery/computer/atmos_alert.dm code/game/machinery/computer/card.dm code/game/machinery/computer/cloning.dm code/game/machinery/computer/computer.dm code/game/machinery/computer/pod.dm code/game/machinery/computer/prisoner.dm code/game/machinery/computer/syndicate_shuttle.dm code/game/machinery/newscaster.dm code/game/machinery/spaceheater.dm code/game/machinery/telecomms/broadcaster.dm code/game/machinery/telecomms/logbrowser.dm code/game/machinery/telecomms/machine_interactions.dm code/game/machinery/telecomms/telemonitor.dm code/game/machinery/telecomms/traffic_control.dm code/game/machinery/wishgranter.dm code/game/objects/items/devices/uplinks.dm code/game/objects/items/stacks/stack.dm code/game/objects/objs.dm code/modules/DetectiveWork/detective_work.dm code/modules/admin/IsBanned.dm code/modules/admin/admin.dm code/modules/admin/verbs/adminsay.dm code/modules/admin/verbs/getlogs.dm code/modules/awaymissions/zlevel.dm code/modules/client/client procs.dm code/modules/clothing/masks/miscellaneous.dm code/modules/clothing/spacesuits/miscellaneous.dm code/modules/flufftext/TextFilters.dm code/modules/mining/machine_processing.dm code/modules/mining/machine_stacking.dm code/modules/mining/mine_items.dm code/modules/mining/mint.dm code/modules/mining/satchel_ore_boxdm.dm code/modules/mob/living/carbon/monkey/life.dm code/modules/mob/living/living_defense.dm code/modules/mob/living/simple_animal/friendly/corgi.dm code/modules/mob/mob.dm code/modules/paperwork/filingcabinet.dm code/modules/paperwork/photocopier.dm code/modules/power/gravitygenerator.dm html/changelog.html icons/mob/head.dmi icons/mob/human_face.dmi icons/mob/mask.dmi icons/mob/suit.dmi icons/obj/clothing/hats.dmi icons/obj/clothing/masks.dmi icons/obj/clothing/suits.dmi Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
73 lines
3.1 KiB
Plaintext
73 lines
3.1 KiB
Plaintext
//switch this out to use a database at some point
|
|
//list of ckey/ real_name and item paths
|
|
//gives item to specific people when they join if it can
|
|
//for multiple items just add mutliple entries, unless i change it to be a listlistlist
|
|
//yes, it has to be an item, you can't pick up nonitems
|
|
|
|
/proc/EquipCustomItems(mob/living/carbon/human/M)
|
|
// load lines
|
|
var/file = file2text("config/custom_items.txt")
|
|
var/lines = text2list(file, "\n")
|
|
|
|
for(var/line in lines)
|
|
// split & clean up
|
|
var/list/Entry = text2list(line, ":")
|
|
for(var/i = 1 to Entry.len)
|
|
Entry[i] = trim(Entry[i])
|
|
|
|
if(Entry.len < 3)
|
|
continue;
|
|
|
|
if(Entry[1] == M.ckey && Entry[2] == M.real_name)
|
|
var/list/Paths = text2list(Entry[3], ",")
|
|
for(var/P in Paths)
|
|
var/ok = 0 // 1 if the item was placed successfully
|
|
P = trim(P)
|
|
var/path = text2path(P)
|
|
var/obj/item/Item = new path()
|
|
if(istype(Item,/obj/item/weapon/card/id))
|
|
//id card needs to replace the original ID
|
|
if(M.ckey == "nerezza" && M.real_name == "Asher Spock" && M.mind.role_alt_title && M.mind.role_alt_title != "Emergency Physician")
|
|
//only spawn ID if asher is joining as an emergency physician
|
|
ok = 1
|
|
del(Item)
|
|
goto skip
|
|
var/obj/item/weapon/card/id/I = Item
|
|
for(var/obj/item/weapon/card/id/C in M)
|
|
//default settings
|
|
I.name = "[M.real_name]'s ID Card ([M.mind.role_alt_title ? M.mind.role_alt_title : M.mind.assigned_role])"
|
|
I.registered_name = M.real_name
|
|
I.access = C.access
|
|
I.assignment = C.assignment
|
|
I.blood_type = C.blood_type
|
|
I.dna_hash = C.dna_hash
|
|
I.fingerprint_hash = C.fingerprint_hash
|
|
I.pin = C.pin
|
|
|
|
//custom stuff
|
|
if(M.ckey == "fastler" && M.real_name == "Fastler Greay") //This is a Lifetime ID
|
|
I.name = "[M.real_name]'s Lifetime ID Card ([M.mind.role_alt_title ? M.mind.role_alt_title : M.mind.assigned_role])"
|
|
else if(M.ckey == "nerezza" && M.real_name == "Asher Spock") //This is an Odysseus Specialist ID
|
|
I.name = "[M.real_name]'s Odysseus Specialist ID Card ([M.mind.role_alt_title ? M.mind.role_alt_title : M.mind.assigned_role])"
|
|
I.access += list(access_robotics) //Station-based mecha pilots need this to access the recharge bay.
|
|
else if(M.ckey == "roaper" && M.real_name == "Ian Colm") //This is a Technician ID
|
|
I.name = "[M.real_name]'s Technician ID ([M.mind.role_alt_title ? M.mind.role_alt_title : M.mind.assigned_role])"
|
|
|
|
//replace old ID
|
|
del(C)
|
|
ok = M.equip_if_possible(I, slot_wear_id, 0) //if 1, last argument deletes on fail
|
|
break
|
|
else if(istype(M.back,/obj/item/weapon/storage) && M.back:contents.len < M.back:storage_slots) // Try to place it in something on the mob's back
|
|
Item.loc = M.back
|
|
ok = 1
|
|
|
|
else
|
|
for(var/obj/item/weapon/storage/S in M.contents) // Try to place it in any item that can store stuff, on the mob.
|
|
if (S.contents.len < S.storage_slots)
|
|
Item.loc = S
|
|
ok = 1
|
|
break
|
|
|
|
skip:
|
|
if (ok == 0) // Finally, since everything else failed, place it on the ground
|
|
Item.loc = get_turf(M.loc) |