mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 11:38:12 +01:00
Merge pull request #9202 from Zuhayr/customitems
Custom items refactor.
This commit is contained in:
@@ -1010,6 +1010,46 @@ var/global/floorIsLava = 0
|
||||
var/datum/seed/S = plant_controller.seeds[seedtype]
|
||||
S.harvest(usr,0,0,1)
|
||||
|
||||
/datum/admins/proc/spawn_custom_item()
|
||||
set category = "Debug"
|
||||
set desc = "Spawn a custom item."
|
||||
set name = "Spawn Custom Item"
|
||||
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
|
||||
var/owner = input("Select a ckey.", "Spawn Custom Item") as null|anything in custom_items
|
||||
if(!owner|| !custom_items[owner])
|
||||
return
|
||||
|
||||
var/list/possible_items = custom_items[owner]
|
||||
var/datum/custom_item/item_to_spawn = input("Select an item to spawn.", "Spawn Custom Item") as null|anything in possible_items
|
||||
if(!item_to_spawn)
|
||||
return
|
||||
|
||||
item_to_spawn.spawn_item(get_turf(usr))
|
||||
|
||||
/datum/admins/proc/check_custom_items()
|
||||
|
||||
set category = "Debug"
|
||||
set desc = "Check the custom item list."
|
||||
set name = "Check Custom Items"
|
||||
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
|
||||
if(!custom_items)
|
||||
usr << "Custom item list is null."
|
||||
return
|
||||
|
||||
if(!custom_items.len)
|
||||
usr << "Custom item list not populated."
|
||||
return
|
||||
|
||||
for(var/assoc_key in custom_items)
|
||||
usr << "[assoc_key] has:"
|
||||
var/list/current_items = custom_items[assoc_key]
|
||||
for(var/datum/custom_item/item in current_items)
|
||||
usr << "- name: [item.name] icon: [item.item_icon] path: [item.item_path] desc: [item.item_desc]"
|
||||
|
||||
/datum/admins/proc/spawn_plant()
|
||||
set category = "Debug"
|
||||
set desc = "Spawn a spreading plant effect."
|
||||
|
||||
@@ -115,6 +115,8 @@ var/list/admin_verbs_fun = list(
|
||||
)
|
||||
var/list/admin_verbs_spawn = list(
|
||||
/datum/admins/proc/spawn_fruit,
|
||||
/datum/admins/proc/spawn_custom_item,
|
||||
/datum/admins/proc/check_custom_items,
|
||||
/datum/admins/proc/spawn_plant,
|
||||
/datum/admins/proc/spawn_atom, /*allows us to spawn instances*/
|
||||
/client/proc/respawn_character,
|
||||
|
||||
@@ -4,7 +4,7 @@ var/const/commandos_possible = 6 //if more Commandos are needed in the future
|
||||
/client/proc/strike_team()
|
||||
set category = "Fun"
|
||||
set name = "Spawn Strike Team"
|
||||
set desc = "Spawns a death squad if you want to run an admin event."
|
||||
set desc = "Spawns a strike team if you want to run an admin event."
|
||||
|
||||
if(!src.holder)
|
||||
src << "Only administrators may use this command."
|
||||
@@ -20,12 +20,12 @@ var/const/commandos_possible = 6 //if more Commandos are needed in the future
|
||||
|
||||
var/datum/antagonist/deathsquad/team
|
||||
|
||||
var/choice = input(usr, "Select type of strike team:") as null|anything in list("Death Squad", "Mercenaries")
|
||||
var/choice = input(usr, "Select type of strike team:") as null|anything in list("Heavy Asset Protection", "Mercenaries")
|
||||
if(!choice)
|
||||
return
|
||||
|
||||
switch(choice)
|
||||
if("Death Squad")
|
||||
if("Heavy Asset Protection")
|
||||
team = deathsquad
|
||||
if("Mercenaries")
|
||||
team = commandos
|
||||
|
||||
@@ -279,7 +279,7 @@ var/global/list/gear_datums = list()
|
||||
|
||||
/datum/gear/scanning_goggles
|
||||
display_name = "scanning goggles"
|
||||
path = /obj/item/clothing/glasses/fluff/uzenwa_sissra_1
|
||||
path = /obj/item/clothing/glasses/science/scanners
|
||||
cost = 1
|
||||
slot = slot_glasses
|
||||
|
||||
@@ -893,7 +893,7 @@ var/global/list/gear_datums = list()
|
||||
|
||||
/datum/gear/toeless_jackboots
|
||||
display_name = "toe-less jackboots"
|
||||
path = /obj/item/clothing/shoes/jackboots/fluff/kecer_eldraran
|
||||
path = /obj/item/clothing/shoes/jackboots/unathi
|
||||
cost = 1
|
||||
slot = slot_shoes
|
||||
|
||||
|
||||
@@ -62,6 +62,11 @@
|
||||
..()
|
||||
overlay = global_hud.science
|
||||
|
||||
/obj/item/clothing/glasses/science/scanners
|
||||
name = "Scanning Goggles"
|
||||
desc = "A very oddly shaped pair of goggles with bits of wire poking out the sides. A soft humming sound emanates from it."
|
||||
icon_state = "uzenwa_sissra_1"
|
||||
|
||||
/obj/item/clothing/glasses/night
|
||||
name = "Night Vision Goggles"
|
||||
desc = "You can totally see in the dark now!"
|
||||
|
||||
@@ -89,6 +89,13 @@
|
||||
force = 3
|
||||
siemens_coefficient = 0.7
|
||||
|
||||
/obj/item/clothing/shoes/jackboots/unathi
|
||||
name = "toe-less jackboots"
|
||||
desc = "Modified pair of jackboots, particularly friendly to those species whose toes hold claws."
|
||||
item_state = "digiboots"
|
||||
icon_state = "digiboots"
|
||||
species_restricted = null
|
||||
|
||||
/obj/item/clothing/shoes/cult
|
||||
name = "boots"
|
||||
desc = "A pair of boots worn by the followers of Nar-Sie."
|
||||
|
||||
@@ -185,6 +185,14 @@
|
||||
/obj/item/device/healthanalyzer, /obj/item/device/flashlight, /obj/item/device/radio, /obj/item/weapon/tank/emergency_oxygen)
|
||||
body_parts_covered = UPPER_TORSO|ARMS
|
||||
|
||||
/obj/item/clothing/suit/storage/toggle/fr_jacket/ems
|
||||
name = "\improper EMS jacket"
|
||||
desc = "A dark blue, martian-pattern, EMS jacket. It sports high-visibility reflective stripes and a star of life on the back."
|
||||
icon_state = "ems_jacket_closed"
|
||||
item_state = "ems_jacket_closed"
|
||||
icon_open = "ems_jacket_open"
|
||||
icon_closed = "ems_jacket_closed"
|
||||
|
||||
//Mime
|
||||
/obj/item/clothing/suit/suspenders
|
||||
name = "suspenders"
|
||||
|
||||
@@ -140,78 +140,3 @@
|
||||
/obj/item/clothing/accessory/medal/gold/heroism
|
||||
name = "medal of exceptional heroism"
|
||||
desc = "An extremely rare golden medal awarded only by CentComm. To recieve such a medal is the highest honor and as such, very few exist. This medal is almost never awarded to anybody but commanders."
|
||||
|
||||
/*
|
||||
Holobadges are worn on the belt or neck, and can be used to show that the holder is an authorized
|
||||
Security agent - the user details can be imprinted on the badge with a Security-access ID card,
|
||||
or they can be emagged to accept any ID for use in disguises.
|
||||
*/
|
||||
|
||||
/obj/item/clothing/accessory/holobadge
|
||||
name = "holobadge"
|
||||
desc = "This glowing blue badge marks the holder as THE LAW."
|
||||
icon_state = "holobadge"
|
||||
slot_flags = SLOT_BELT | SLOT_TIE
|
||||
|
||||
var/emagged = 0 //Emagging removes Sec check.
|
||||
var/stored_name = null
|
||||
|
||||
/obj/item/clothing/accessory/holobadge/cord
|
||||
icon_state = "holobadge-cord"
|
||||
slot_flags = SLOT_MASK | SLOT_TIE
|
||||
|
||||
/obj/item/clothing/accessory/holobadge/attack_self(mob/user as mob)
|
||||
if(!stored_name)
|
||||
user << "Waving around a badge before swiping an ID would be pretty pointless."
|
||||
return
|
||||
if(isliving(user))
|
||||
user.visible_message("\red [user] displays their NanoTrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], NT Security.","\red You display your NanoTrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], NT Security.")
|
||||
|
||||
/obj/item/clothing/accessory/holobadge/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
|
||||
if (istype(O, /obj/item/weapon/card/emag))
|
||||
if (emagged)
|
||||
user << "\red [src] is already cracked."
|
||||
return
|
||||
else
|
||||
emagged = 1
|
||||
user << "\red You swipe [O] and crack the holobadge security checks."
|
||||
return
|
||||
|
||||
else if(istype(O, /obj/item/weapon/card/id) || istype(O, /obj/item/device/pda))
|
||||
|
||||
var/obj/item/weapon/card/id/id_card = null
|
||||
|
||||
if(istype(O, /obj/item/weapon/card/id))
|
||||
id_card = O
|
||||
else
|
||||
var/obj/item/device/pda/pda = O
|
||||
id_card = pda.id
|
||||
|
||||
if(access_security in id_card.access || emagged)
|
||||
user << "You imprint your ID details onto the badge."
|
||||
stored_name = id_card.registered_name
|
||||
name = "holobadge ([stored_name])"
|
||||
desc = "This glowing blue badge marks [stored_name] as THE LAW."
|
||||
else
|
||||
user << "[src] rejects your insufficient access rights."
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/clothing/accessory/holobadge/attack(mob/living/carbon/human/M, mob/living/user)
|
||||
if(isliving(user))
|
||||
user.visible_message("\red [user] invades [M]'s personal space, thrusting [src] into their face insistently.","\red You invade [M]'s personal space, thrusting [src] into their face insistently. You are the law.")
|
||||
|
||||
/obj/item/weapon/storage/box/holobadge
|
||||
name = "holobadge box"
|
||||
desc = "A box claiming to contain holobadges."
|
||||
New()
|
||||
new /obj/item/clothing/accessory/holobadge(src)
|
||||
new /obj/item/clothing/accessory/holobadge(src)
|
||||
new /obj/item/clothing/accessory/holobadge(src)
|
||||
new /obj/item/clothing/accessory/holobadge(src)
|
||||
new /obj/item/clothing/accessory/holobadge/cord(src)
|
||||
new /obj/item/clothing/accessory/holobadge/cord(src)
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
Badges are worn on the belt or neck, and can be used to show that the holder is an authorized
|
||||
Security agent - the user details can be imprinted on holobadges with a Security-access ID card,
|
||||
or they can be emagged to accept any ID for use in disguises.
|
||||
*/
|
||||
|
||||
/obj/item/clothing/accessory/badge
|
||||
name = "detective's badge"
|
||||
desc = "NanoTrasen Security Department detective's badge, made from gold."
|
||||
icon_state = "badge"
|
||||
slot_flags = SLOT_BELT | SLOT_TIE
|
||||
|
||||
var/stored_name
|
||||
var/badge_string = "NanoTrasen Security Department"
|
||||
|
||||
/obj/item/clothing/accessory/badge/old
|
||||
name = "faded badge"
|
||||
desc = "A faded badge, backed with leather. It bears the emblem of the Forensic division."
|
||||
icon_state = "badge_round"
|
||||
|
||||
/obj/item/clothing/accessory/badge/proc/set_name(var/new_name)
|
||||
stored_name = new_name
|
||||
name = "[initial(name)] ([stored_name])"
|
||||
|
||||
/obj/item/clothing/accessory/badge/attack_self(mob/user as mob)
|
||||
|
||||
if(!stored_name)
|
||||
user << "You polish your old badge fondly, shining up the surface."
|
||||
set_name(user.real_name)
|
||||
return
|
||||
|
||||
if(isliving(user))
|
||||
if(stored_name)
|
||||
user.visible_message("<span class='notice'>[user] displays their [src.name].\nIt reads: [stored_name], [badge_string].</span>","<span class='notice'>You display your [src.name].\nIt reads: [stored_name], [badge_string].</span>")
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] displays their [src.name].\nIt reads: [badge_string].</span>","<span class='notice'>You display your [src.name]. It reads: [badge_string].</span>")
|
||||
|
||||
/obj/item/clothing/accessory/badge/attack(mob/living/carbon/human/M, mob/living/user)
|
||||
if(isliving(user))
|
||||
user.visible_message("<span class='danger'>[user] invades [M]'s personal space, thrusting [src] into their face insistently.</span>","<span class='danger'>You invade [M]'s personal space, thrusting [src] into their face insistently.</span>")
|
||||
|
||||
//.Holobadges.
|
||||
/obj/item/clothing/accessory/badge/holo
|
||||
name = "holobadge"
|
||||
desc = "This glowing blue badge marks the holder as THE LAW."
|
||||
var/emagged = 0 //Emagging removes Sec check.
|
||||
|
||||
/obj/item/clothing/accessory/badge/holo/cord
|
||||
icon_state = "holobadge-cord"
|
||||
slot_flags = SLOT_MASK | SLOT_TIE
|
||||
|
||||
/obj/item/clothing/accessory/badge/holo/attack_self(mob/user as mob)
|
||||
if(!stored_name)
|
||||
user << "Waving around a holobadge before swiping an ID would be pretty pointless."
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/accessory/badge/holo/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
|
||||
if (istype(O, /obj/item/weapon/card/emag))
|
||||
if (emagged)
|
||||
user << "<span class='danger'>[src] is already cracked.</span>"
|
||||
return
|
||||
else
|
||||
emagged = 1
|
||||
user << "<span class='danger'>You swipe [O] and crack the holobadge security checks.</span>"
|
||||
return
|
||||
|
||||
else if(istype(O, /obj/item/weapon/card/id) || istype(O, /obj/item/device/pda))
|
||||
|
||||
var/obj/item/weapon/card/id/id_card = null
|
||||
|
||||
if(istype(O, /obj/item/weapon/card/id))
|
||||
id_card = O
|
||||
else
|
||||
var/obj/item/device/pda/pda = O
|
||||
id_card = pda.id
|
||||
|
||||
if(access_security in id_card.access || emagged)
|
||||
user << "You imprint your ID details onto the badge."
|
||||
set_name(user.real_name)
|
||||
else
|
||||
user << "[src] rejects your insufficient access rights."
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/storage/box/holobadge
|
||||
name = "holobadge box"
|
||||
desc = "A box claiming to contain holobadges."
|
||||
New()
|
||||
new /obj/item/clothing/accessory/badge/holo(src)
|
||||
new /obj/item/clothing/accessory/badge/holo(src)
|
||||
new /obj/item/clothing/accessory/badge/holo(src)
|
||||
new /obj/item/clothing/accessory/badge/holo(src)
|
||||
new /obj/item/clothing/accessory/badge/holo/cord(src)
|
||||
new /obj/item/clothing/accessory/badge/holo/cord(src)
|
||||
..()
|
||||
return
|
||||
@@ -0,0 +1,46 @@
|
||||
/obj/item/clothing/accessory/locket
|
||||
name = "silver locket"
|
||||
desc = "This oval shaped, argentium sterling silver locket hangs on an incredibly fine, refractive string, almost thin as hair and microweaved from links to a deceptive strength, of similar material. The edges are engraved very delicately with an elegant curving design, but overall the main is unmarked and smooth to the touch, leaving room for either remaining as a stolid piece or future alterations. There is an obvious internal place for a picture or lock of some sort, but even behind that is a very thin compartment unhinged with the pinch of a thumb and forefinger."
|
||||
icon_state = "locket"
|
||||
item_state = "locket"
|
||||
slot_flags = 0
|
||||
w_class = 2
|
||||
slot_flags = SLOT_MASK | SLOT_TIE
|
||||
var/base_icon
|
||||
var/open
|
||||
var/obj/item/held //Item inside locket.
|
||||
|
||||
/obj/item/clothing/accessory/locket/heart
|
||||
name = "heart-shaped locket"
|
||||
desc = " A silver, heart-shaped locket. It flips open to reveal two pictures, one of a young red-headed woman and one of a brunette of similar age. Small writing is etched onto the back, reading 'M+L'. Some may regard it as cheesy."
|
||||
icon_state = "heartlocket"
|
||||
|
||||
/obj/item/clothing/accessory/locket/attack_self(mob/user as mob)
|
||||
if(!base_icon)
|
||||
base_icon = icon_state
|
||||
open = !open
|
||||
user << "You flip \the [src] [open?"open":"closed"]."
|
||||
if(open)
|
||||
icon_state = "[base_icon]_open"
|
||||
if(held)
|
||||
user << "\The [held] falls out!"
|
||||
held.loc = get_turf(user)
|
||||
src.held = null
|
||||
else
|
||||
icon_state = "[base_icon]"
|
||||
|
||||
/obj/item/clothing/accessory/locket/attackby(var/obj/item/O as obj, mob/user as mob)
|
||||
if(!open)
|
||||
user << "You have to open it first."
|
||||
return
|
||||
|
||||
if(istype(O,/obj/item/weapon/paper) || istype(O, /obj/item/weapon/photo))
|
||||
if(held)
|
||||
usr << "[src] already has something inside it."
|
||||
else
|
||||
usr << "You slip [O] into [src]."
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
src.held = O
|
||||
return
|
||||
..()
|
||||
@@ -113,6 +113,13 @@
|
||||
permeability_coefficient = 0.50
|
||||
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 10, rad = 0)
|
||||
|
||||
/obj/item/clothing/under/rank/medical/paramedic
|
||||
name = "short sleeve medical jumpsuit"
|
||||
desc = "It's made of a special fiber that provides minor protection against biohazards. This one has a cross on the chest denoting that the wearer is trained medical personnel."
|
||||
icon_state = "medical_short"
|
||||
item_state = "medical_short"
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS
|
||||
|
||||
/obj/item/clothing/under/rank/medical/blue
|
||||
name = "medical scrubs"
|
||||
desc = "It's made of a special fiber that provides minor protection against biohazards. This one is in baby blue."
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,95 +1,190 @@
|
||||
//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
|
||||
// Switch this out to use a database at some point. Each ckey is
|
||||
// associated with a list of custom item datums. When the character
|
||||
// spawns, the list is checked and all appropriate datums are spawned.
|
||||
// See config/example/custom_items.txt for a more detailed overview
|
||||
// of how the config system works.
|
||||
|
||||
// CUSTOM ITEM ICONS:
|
||||
// Inventory icons must be in CUSTOM_ITEM_OBJ with state name [item_icon].
|
||||
// On-mob icons must be in CUSTOM_ITEM_MOB with state name [item_icon].
|
||||
// Inhands must be in CUSTOM_ITEM_MOB as [icon_state]_l and [icon_state]_r.
|
||||
|
||||
// Kits must have mech icons in CUSTOM_ITEM_OBJ under [kit_icon].
|
||||
// Broken must be [kit_icon]-broken and open must be [kit_icon]-open.
|
||||
|
||||
// Kits must also have hardsuit icons in CUSTOM_ITEM_MOB as [kit_icon]_suit
|
||||
// and [kit_icon]_helmet, and in CUSTOM_ITEM_OBJ as [kit_icon].
|
||||
|
||||
/var/list/custom_items = list()
|
||||
|
||||
/hook/startup/proc/loadCustomItems()
|
||||
var/custom_items_file = file2text("config/custom_items.txt")
|
||||
custom_items = text2list(custom_items_file, "\n")
|
||||
/datum/custom_item
|
||||
var/assoc_key
|
||||
var/character_name
|
||||
var/item_icon
|
||||
var/item_desc
|
||||
var/name
|
||||
var/item_path = /obj/item
|
||||
var/req_access = 0
|
||||
var/list/req_titles = list()
|
||||
var/kit_name
|
||||
var/kit_desc
|
||||
var/kit_icon
|
||||
var/additional_data
|
||||
|
||||
/datum/custom_item/proc/spawn_item(var/newloc)
|
||||
var/obj/item/citem = new item_path(newloc)
|
||||
apply_to_item(citem)
|
||||
return citem
|
||||
|
||||
/datum/custom_item/proc/apply_to_item(var/obj/item/item)
|
||||
if(!item)
|
||||
return
|
||||
if(name)
|
||||
item.name = name
|
||||
if(item_desc)
|
||||
item.desc = item_desc
|
||||
if(item_icon)
|
||||
item.icon = CUSTOM_ITEM_OBJ
|
||||
item.icon_state = item_icon
|
||||
if(istype(item, /obj/item))
|
||||
item.icon_override = CUSTOM_ITEM_MOB
|
||||
|
||||
// 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
|
||||
K.new_name = kit_name
|
||||
K.new_desc = kit_desc
|
||||
K.new_icon = kit_icon
|
||||
K.new_icon_file = CUSTOM_ITEM_OBJ
|
||||
if(istype(item, /obj/item/device/kit/paint))
|
||||
var/obj/item/device/kit/paint/kit = item
|
||||
kit.allowed_types = text2list(additional_data, ", ")
|
||||
else if(istype(item, /obj/item/device/kit/suit))
|
||||
var/obj/item/device/kit/suit/kit = item
|
||||
kit.new_light_overlay = additional_data
|
||||
kit.new_mob_icon_file = CUSTOM_ITEM_MOB
|
||||
|
||||
return item
|
||||
|
||||
|
||||
// Parses the config file into the custom_items list.
|
||||
/hook/startup/proc/load_custom_items()
|
||||
|
||||
var/datum/custom_item/current_data
|
||||
for(var/line in text2list(file2text("config/custom_items.txt"), "\n"))
|
||||
|
||||
line = trim(line)
|
||||
if(line == "" || !line || findtext(line, "#", 1, 2))
|
||||
continue
|
||||
|
||||
if(findtext(line, "{", 1, 2) || findtext(line, "}", 1, 2)) // New block!
|
||||
if(current_data && current_data.assoc_key)
|
||||
if(!custom_items[current_data.assoc_key])
|
||||
custom_items[current_data.assoc_key] = list()
|
||||
var/list/L = custom_items[current_data.assoc_key]
|
||||
L |= current_data
|
||||
current_data = null
|
||||
|
||||
var/split = findtext(line,":")
|
||||
if(!split)
|
||||
continue
|
||||
var/field = trim(copytext(line,1,split))
|
||||
var/field_data = trim(copytext(line,(split+1)))
|
||||
if(!field || !field_data)
|
||||
continue
|
||||
|
||||
if(!current_data)
|
||||
current_data = new()
|
||||
|
||||
switch(field)
|
||||
if("ckey")
|
||||
current_data.assoc_key = lowertext(field_data)
|
||||
if("character_name")
|
||||
current_data.character_name = lowertext(field_data)
|
||||
if("item_path")
|
||||
current_data.item_path = text2path(field_data)
|
||||
if("item_name")
|
||||
current_data.name = field_data
|
||||
if("item_icon")
|
||||
if(field_data in icon_states(CUSTOM_ITEM_OBJ))
|
||||
current_data.item_icon = field_data
|
||||
if("item_desc")
|
||||
current_data.item_desc = field_data
|
||||
if("req_access")
|
||||
current_data.req_access = text2num(field_data)
|
||||
if("req_titles")
|
||||
current_data.req_titles = text2list(field_data,", ")
|
||||
if("kit_name")
|
||||
current_data.kit_name = field_data
|
||||
if("kit_desc")
|
||||
current_data.kit_desc = field_data
|
||||
if("kit_icon")
|
||||
current_data.kit_icon = field_data
|
||||
if("additional_data")
|
||||
current_data.additional_data = field_data
|
||||
return 1
|
||||
|
||||
/proc/EquipCustomItems(mob/living/carbon/human/M)
|
||||
for(var/line in custom_items)
|
||||
// split & clean up
|
||||
var/list/Entry = text2list(line, ":")
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
//gets the relevant list for the key from the listlist if it exists, check to make sure they are meant to have it and then calls the giving function
|
||||
/proc/equip_custom_items(mob/living/carbon/human/M)
|
||||
var/list/key_list = custom_items[M.ckey]
|
||||
if(!key_list || key_list.len < 1)
|
||||
return
|
||||
|
||||
if(Entry.len < 3)
|
||||
continue;
|
||||
for(var/datum/custom_item/citem in key_list)
|
||||
|
||||
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)
|
||||
if(!path) continue
|
||||
// Check for requisite ckey and character name.
|
||||
if((lowertext(citem.assoc_key) != lowertext(M.ckey)) || (lowertext(citem.character_name) != lowertext(M.real_name)))
|
||||
continue
|
||||
|
||||
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
|
||||
qdel(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
|
||||
// Check for required access.
|
||||
var/obj/item/weapon/card/id/current_id = M.wear_id
|
||||
if(citem.req_access && citem.req_access > 0)
|
||||
if(!(istype(current_id) && (citem.req_access in current_id.access)))
|
||||
continue
|
||||
|
||||
//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])"
|
||||
// Check for required job title.
|
||||
if(citem.req_titles && citem.req_titles.len > 0)
|
||||
var/has_title
|
||||
var/current_title = M.mind.role_alt_title ? M.mind.role_alt_title : M.mind.assigned_role
|
||||
for(var/title in citem.req_titles)
|
||||
if(title == current_title)
|
||||
has_title = 1
|
||||
break
|
||||
if(!has_title)
|
||||
continue
|
||||
|
||||
//replace old ID
|
||||
qdel(C)
|
||||
ok = M.equip_to_slot_if_possible(I, slot_wear_id, 0) //if 1, last argument deletes on fail
|
||||
break
|
||||
else if(istype(Item,/obj/item/weapon/storage/belt))
|
||||
if(M.ckey == "jakksergal" && M.real_name == "Nashi Ra'hal" && M.mind.role_alt_title && M.mind.role_alt_title != "Nurse" && M.mind.role_alt_title != "Chemist")
|
||||
ok = 1
|
||||
qdel(Item)
|
||||
goto skip
|
||||
var/obj/item/weapon/storage/belt/medical/fluff/nashi_belt/I = Item
|
||||
if(istype(M.belt,/obj/item/weapon/storage/belt))
|
||||
for(var/obj/item/weapon/storage/belt/B in M)
|
||||
qdel(B)
|
||||
M.belt=null
|
||||
ok = M.equip_to_slot_if_possible(I, slot_belt, 0)
|
||||
break
|
||||
if(istype(M.belt,/obj/item/device/pda))
|
||||
for(var/obj/item/device/pda/Pda in M)
|
||||
M.belt=null
|
||||
M.equip_to_slot_if_possible(Pda, slot_l_store, 0)
|
||||
ok = M.equip_to_slot_if_possible(I, slot_belt, 0)
|
||||
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
|
||||
// ID cards and PDAs are applied directly to the existing object rather than spawned fresh.
|
||||
var/obj/item/existing_item
|
||||
if(citem.item_path == /obj/item/weapon/card/id && istype(current_id)) //Set earlier.
|
||||
existing_item = M.wear_id
|
||||
else if(citem.item_path == /obj/item/device/pda)
|
||||
existing_item = locate(/obj/item/device/pda) in M.contents
|
||||
|
||||
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
|
||||
// Spawn and equip the item.
|
||||
if(existing_item)
|
||||
citem.apply_to_item(existing_item)
|
||||
else
|
||||
place_custom_item(M,citem)
|
||||
|
||||
skip:
|
||||
if (ok == 0) // Finally, since everything else failed, place it on the ground
|
||||
Item.loc = get_turf(M.loc)
|
||||
// Places the item on the target mob.
|
||||
/proc/place_custom_item(mob/living/carbon/human/M, var/datum/custom_item/citem)
|
||||
|
||||
if(!citem) return
|
||||
var/obj/item/newitem = citem.spawn_item()
|
||||
|
||||
if(M.equip_to_appropriate_slot(newitem))
|
||||
return newitem
|
||||
|
||||
if(istype(M.back,/obj/item/weapon/storage))
|
||||
var/obj/item/weapon/storage/backpack = M.back
|
||||
if(backpack.contents.len < backpack.storage_slots)
|
||||
newitem.loc = M.back
|
||||
return newitem
|
||||
|
||||
// Try to place it in any item that can store stuff, on the mob.
|
||||
for(var/obj/item/weapon/storage/S in M.contents)
|
||||
if (S.contents.len < S.storage_slots)
|
||||
newitem.loc = S
|
||||
return newitem
|
||||
newitem.loc = get_turf(M.loc)
|
||||
return newitem
|
||||
|
||||
@@ -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)
|
||||
..()
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -41,3 +41,24 @@
|
||||
name = input
|
||||
M << "You name the gun [input]. Say hello to your new friend."
|
||||
return 1
|
||||
|
||||
// Blade Runner pistol.
|
||||
/obj/item/weapon/gun/projectile/revolver/deckard
|
||||
name = "Deckard .44"
|
||||
desc = "A custom-built revolver, based off the semi-popular Detective Special model."
|
||||
icon_state = "deckard-empty"
|
||||
ammo_type = /obj/item/ammo_magazine/c38/rubber
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/deckard/update_icon()
|
||||
..()
|
||||
if(loaded.len)
|
||||
icon_state = "deckard-loaded"
|
||||
else
|
||||
icon_state = "deckard-empty"
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/deckard/load_ammo(var/obj/item/A, mob/user)
|
||||
if(istype(A, /obj/item/ammo_magazine))
|
||||
flick("deckard-reload",src)
|
||||
..()
|
||||
|
||||
|
||||
|
||||
@@ -268,6 +268,15 @@
|
||||
volume = 120
|
||||
center_of_mass = list("x"=17, "y"=10)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/teapot
|
||||
name = "teapot"
|
||||
desc = "An elegant teapot. It simply oozes class."
|
||||
icon_state = "teapot"
|
||||
item_state = "teapot"
|
||||
amount_per_transfer_from_this = 10
|
||||
volume = 120
|
||||
center_of_mass = list("x"=17, "y"=7)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask
|
||||
name = "Captain's Flask"
|
||||
desc = "A metal flask belonging to the captain"
|
||||
@@ -275,6 +284,16 @@
|
||||
volume = 60
|
||||
center_of_mass = list("x"=17, "y"=7)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/shiny
|
||||
name = "shiny flask"
|
||||
desc = "A shiny metal flask. It appears to have a Greek symbol inscribed on it."
|
||||
icon_state = "shinyflask"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/lithium
|
||||
name = "lithium flask"
|
||||
desc = "A flask with a Lithium Atom symbol on it."
|
||||
icon_state = "lithiumflask"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/detflask
|
||||
name = "Detective's Flask"
|
||||
desc = "A metal flask with a leather band and golden badge belonging to the detective."
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/clothing/under/rank/scientist(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat(src)
|
||||
new /obj/item/clothing/suit/storage/toggle/labcoat(src)
|
||||
new /obj/item/clothing/shoes/white(src)
|
||||
new /obj/item/clothing/glasses/science(src)
|
||||
new /obj/item/device/radio/headset/headset_sci(src)
|
||||
|
||||
Reference in New Issue
Block a user