Skip to content

Commit

Permalink
Merge pull request #9294 from MistakeNot4892/xenofauna
Browse files Browse the repository at this point in the history
Xenofauna Tech equipment update.
  • Loading branch information
Atermonera authored Dec 29, 2023
2 parents 9b15f9b + c390425 commit 85f157a
Show file tree
Hide file tree
Showing 29 changed files with 464 additions and 85 deletions.
9 changes: 8 additions & 1 deletion code/datums/outfits/jobs/science.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
id_type = /obj/item/card/id/science
suit = /obj/item/clothing/suit/storage/toggle/labcoat/science

/decl/hierarchy/outfit/job/science/xenofauna
name = OUTFIT_JOB_NAME("Xenofauna Technician")
uniform = /obj/item/clothing/under/xenofauna
id_type = /obj/item/card/id/science
suit = /obj/item/clothing/suit/storage/toggle/labcoat/science
shoes = /obj/item/clothing/shoes/boots/winter

/decl/hierarchy/outfit/job/science/roboticist
name = OUTFIT_JOB_NAME("Roboticist")
uniform = /obj/item/clothing/under/rank/roboticist
Expand All @@ -40,4 +47,4 @@
pda_type = /obj/item/pda/roboticist
backpack = /obj/item/storage/backpack
satchel_one = /obj/item/storage/backpack/satchel/norm
suit = /obj/item/clothing/suit/storage/toggle/labcoat/roboticist
suit = /obj/item/clothing/suit/storage/toggle/labcoat/roboticist
1 change: 1 addition & 0 deletions code/game/jobs/job/science.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
title = "Xenofauna Technician"
title_blurb = "A Xenofauna Technician works with the alien fauna living in the territory around the station, heading out in the field to tag and assess the \
local animal populations. They are also responsible for training and tending to the station's small drake population."
title_outfit = /decl/hierarchy/outfit/job/science/xenofauna

//////////////////////////////////
// Roboticist
Expand Down
56 changes: 36 additions & 20 deletions code/game/objects/items/devices/gps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ var/global/list/GPS_list = list()
origin_tech = list(TECH_MATERIAL = 2, TECH_BLUESPACE = 2, TECH_MAGNET = 1)
matter = list(MAT_STEEL = 500)

var/tag_category // Any special category for this tracker to sit in (used by xenofauna tags)
var/list/tag_categories // Any special categories this tracker should show (used in xenofauna GPS)

var/gps_tag = "GEN0"
var/emped = FALSE
var/tracking = FALSE // Will not show other signals or emit its own signal if false.
Expand All @@ -26,21 +29,25 @@ var/global/list/GPS_list = list()

/obj/item/gps/Initialize()
. = ..()
compass = new(src)
create_compass()
GPS_list += src
name = "global positioning system ([gps_tag])"
name = "[initial(name)] ([gps_tag])"
update_holder()
update_icon()

/obj/item/gps/proc/create_compass()
compass = new(src)

/obj/item/gps/proc/check_visible_to_holder()
. = (holder && (holder.get_active_hand() == src || holder.get_inactive_hand() == src))
. = istype(compass) && holder && (holder.get_active_hand() == src || holder.get_inactive_hand() == src)

/obj/item/gps/proc/update_holder()

if(holder && loc != holder)
GLOB.moved_event.unregister(holder, src)
GLOB.dir_set_event.unregister(holder, src)
holder.client?.screen -= compass
if(compass)
holder.client?.screen -= compass
holder = null

if(istype(loc, /mob))
Expand All @@ -55,12 +62,12 @@ var/global/list/GPS_list = list()
if(holder.client)
if(check_visible_to_holder())
holder.client.screen |= compass
else
else if(compass)
holder.client.screen -= compass
else
STOP_PROCESSING(SSobj, src)
is_in_processing_list = FALSE
if(holder?.client)
if(holder?.client && compass)
holder.client.screen -= compass

/obj/item/gps/pickup()
Expand Down Expand Up @@ -96,7 +103,7 @@ var/global/list/GPS_list = list()
QDEL_NULL(compass)

/obj/item/gps/proc/can_track(var/obj/item/gps/other, var/reachable_z_levels)
if(!other.tracking || other.emped || other.hide_signal)
if(!other.tracking || other.emped || other.hide_signal || (other.tag_category && !(other.tag_category in tag_categories)))
return FALSE
var/turf/origin = get_turf(src)
var/turf/target = get_turf(other)
Expand All @@ -110,7 +117,8 @@ var/global/list/GPS_list = list()
return (target.z in reachable_z_levels)

/obj/item/gps/proc/update_compass(var/update_compass_icon)
compass.hide_waypoints(FALSE)
if(compass)
compass.hide_waypoints(FALSE)
var/turf/my_turf = get_turf(src)
for(var/thing in tracking_devices)
var/obj/item/gps/gps = locate(thing)
Expand All @@ -120,13 +128,15 @@ var/global/list/GPS_list = list()
continue
var/turf/gps_turf = get_turf(gps)
var/gps_tag = LAZYACCESS(showing_tracked_names, thing) ? gps.gps_tag : null
if(istype(gps_turf))
compass.set_waypoint("\ref[gps]", gps_tag, gps_turf.x, gps_turf.y, gps_turf.z, LAZYACCESS(tracking_devices, "\ref[gps]"))
else
compass.set_waypoint("\ref[gps]", gps_tag, 0, 0, 0, LAZYACCESS(tracking_devices, "\ref[gps]"))
if(can_track(gps) && gps_turf && my_turf && gps_turf.z == my_turf.z)
compass.show_waypoint("\ref[gps]")
compass.rebuild_overlay_lists(update_compass_icon)
if(compass)
if(istype(gps_turf))
compass.set_waypoint("\ref[gps]", gps_tag, gps_turf.x, gps_turf.y, gps_turf.z, LAZYACCESS(tracking_devices, "\ref[gps]"))
else
compass.set_waypoint("\ref[gps]", gps_tag, 0, 0, 0, LAZYACCESS(tracking_devices, "\ref[gps]"))
if(can_track(gps) && gps_turf && my_turf && gps_turf.z == my_turf.z)
compass.show_waypoint("\ref[gps]")
if(compass)
compass.rebuild_overlay_lists(update_compass_icon)

/obj/item/gps/AltClick(mob/user)
toggletracking(user)
Expand All @@ -137,7 +147,7 @@ var/global/list/GPS_list = list()
if(emped)
to_chat(user, "It's busted!")
return

toggle_tracking()
if(tracking)
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
Expand Down Expand Up @@ -194,7 +204,7 @@ var/global/list/GPS_list = list()
dat["curr_z"] = curr.z
dat["curr_z_name"] = strip_improper(using_map.get_zlevel_name(curr.z))
dat["z_level_detection"] = using_map.get_map_levels(curr.z, long_range)

var/list/gps_list = list()
for(var/obj/item/gps/G in GPS_list - src)

Expand Down Expand Up @@ -250,7 +260,7 @@ var/global/list/GPS_list = list()
dat += "<tr>"
var/gps_ref = "\ref[gps["ref"]]"
dat += "<td>[gps["gps_tag"]]</td><td>[gps["area_name"]]</td>"

if(istype(gps_data["ref"], /obj/item/gps/internal/poi))
dat += "<td>[gps["local"] ? "[gps["direction"]] Dist: [round(gps["distance"], 10)]m" : "[gps["z_name"]]"]</td>"
else
Expand Down Expand Up @@ -294,7 +304,8 @@ var/global/list/GPS_list = list()
if(href_list["stop_track"])
var/gps_ref = href_list["stop_track"]
var/obj/item/gps/gps = locate(gps_ref)
compass.clear_waypoint(gps_ref)
if(compass)
compass.clear_waypoint(gps_ref)
LAZYREMOVE(tracking_devices, gps_ref)
LAZYREMOVE(showing_tracked_names, gps_ref)
if(istype(gps) && !QDELETED(gps))
Expand Down Expand Up @@ -347,7 +358,7 @@ var/global/list/GPS_list = list()

/obj/item/gps/proc/SetTag(new_tag)
gps_tag = uppertext(copytext(sanitize(new_tag), 1, 11))
name = "global positioning system ([gps_tag])"
name = "[initial(name)] ([gps_tag])"


/obj/item/gps/on // Defaults to off to avoid polluting the signal list with a bunch of GPSes without owners. If you need to spawn active ones, use these.
Expand Down Expand Up @@ -392,6 +403,11 @@ var/global/list/GPS_list = list()
icon_state = "gps-sci"
gps_tag = "SCI0"

/obj/item/gps/xenofauna
icon_state = "gps-sci"
gps_tag = "XEN0"
tag_categories = list("XENOFAUNA")

/obj/item/gps/science/on
tracking = TRUE

Expand Down
44 changes: 20 additions & 24 deletions code/modules/catalogue/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
if(!LAZYLEN(data))
to_chat(user, span("warning", "\The [src] is not interesting enough to catalogue."))
return FALSE
else
// Check if this has nothing new on it.
var/has_new_data = FALSE
for(var/t in data)
var/datum/category_item/catalogue/item = GLOB.catalogue_data.resolve_item(t)
if(!item.visible)
has_new_data = TRUE
break

if(!has_new_data)
to_chat(user, span("warning", "Scanning \the [src] would provide no new information."))
return FALSE
// Check if this has nothing new on it.
var/has_new_data = FALSE
for(var/t in data)
var/datum/category_item/catalogue/item = GLOB.catalogue_data.resolve_item(t)
if(!item.visible)
has_new_data = TRUE
break

if(!has_new_data)
to_chat(user, span("warning", "Scanning \the [src] would provide no new information."))
return FALSE

return TRUE

Expand All @@ -53,29 +53,25 @@
return catalogue_data

/mob/living/carbon/human/get_catalogue_data()
var/list/data = list()
// First, handle robot-ness.
var/beep_boop = get_FBP_type()
switch(beep_boop)
if(FBP_CYBORG)
data += /datum/category_item/catalogue/technology/cyborgs
LAZYADD(., /datum/category_item/catalogue/technology/cyborgs)
if(FBP_POSI)
data += /datum/category_item/catalogue/technology/positronics
LAZYADD(., /datum/category_item/catalogue/technology/positronics)
if(FBP_DRONE)
data += /datum/category_item/catalogue/technology/drone/drones
LAZYADD(., /datum/category_item/catalogue/technology/drone/drones)
// Now for species.
if(!(beep_boop in list(FBP_POSI, FBP_DRONE))) // Don't give the species entry if they are a posi or drone.
if(species && LAZYLEN(species.catalogue_data))
data += species.catalogue_data
return data
// Don't give the species entry if they are a posi or drone.
if(!(beep_boop in list(FBP_POSI, FBP_DRONE)) && species && LAZYLEN(species.catalogue_data))
LAZYADD(., species.catalogue_data)

/mob/living/silicon/robot/get_catalogue_data()
var/list/data = list()
switch(braintype)
if(BORG_BRAINTYPE_CYBORG)
data += /datum/category_item/catalogue/technology/cyborgs
LAZYADD(., /datum/category_item/catalogue/technology/cyborgs)
if(BORG_BRAINTYPE_POSI)
data += /datum/category_item/catalogue/technology/positronics
LAZYADD(., /datum/category_item/catalogue/technology/positronics)
if(BORG_BRAINTYPE_DRONE)
data += /datum/category_item/catalogue/technology/drone/drones
return data
LAZYADD(., /datum/category_item/catalogue/technology/drone/drones)
7 changes: 7 additions & 0 deletions code/modules/clothing/head/hood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@
siemens_coefficient = 0.9
armor = list(melee = 30, bullet = 20, laser = 20, energy = 20, bomb = 35, bio = 75, rad = 35)

/obj/item/clothing/head/hood/explorer/xenofauna
name = "xenofauna field hood"
desc = "A lightly armoured hood for surveying harsh environments."
icon_state = "xenofauna"
siemens_coefficient = 0.5
armor = list(melee = 20, bullet = 10, laser = 10, energy = 10, bomb = 25, bio = 90, rad = 60)

// Costumes
/obj/item/clothing/head/hood/carp_hood
name = "carp hood"
Expand Down
15 changes: 13 additions & 2 deletions code/modules/clothing/suits/hooded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -425,5 +425,16 @@
/obj/item/material/knife,
/obj/item/tank,
/obj/item/radio,
/obj/item/pickaxe
)
/obj/item/pickaxe,
/obj/item/cataloguer,
/obj/item/specimen_tagger
)

/obj/item/clothing/suit/storage/hooded/explorer/xenofauna
name = "xenofauna field suit"
desc = "A lightly armoured suit for surveying harsh environments."
icon_state = "xenofauna"
item_state = "xenofauna"
siemens_coefficient = 0.5
armor = list(melee = 20, bullet = 10, laser = 10, energy = 10, bomb = 25, bio = 90, rad = 60) // Better bio/rad protection than explo, but less armour.
hoodtype = /obj/item/clothing/head/hood/explorer/xenofauna
9 changes: 7 additions & 2 deletions code/modules/clothing/under/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1210,12 +1210,17 @@ Uniforms and such
worn_state = "bathrobe"

/obj/item/clothing/under/explorer
desc = "A green uniform for operating in hazardous environments."
desc = "A grey and cyan uniform for working in the field."
name = "explorer's jumpsuit"
icon_state = "explorer"

/obj/item/clothing/under/xenofauna
desc = "A grey and purple uniform for working in the field."
name = "xenofauna technician's jumpsuit"
icon_state = "xenofauna"

/obj/item/clothing/under/explorer/armored
desc = "A green uniform for operating in hazardous environments. This one looks like it's been modified."
desc = "A grey and green uniform for operating in hazardous environments. This one looks like it's been modified."
armor = list(melee = 10, bullet = 10, laser = 10,energy = 10, bomb = 10, bio = 10, rad = 30)
armorsoak = list(melee = 5, bullet = 5, laser = 5,energy = 5, bomb = 5, bio = 5, rad = 0)

Expand Down
13 changes: 8 additions & 5 deletions code/modules/persistence/datum/persistence_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
var/entries_decay_at // Set in rounds. This controls when item messages start getting scrambled.
var/entry_decay_weight = 0.5
var/has_admin_data
var/area_restricted = TRUE
var/station_restricted = TRUE

/datum/persistent/New()
SetFilename()
Expand Down Expand Up @@ -71,14 +73,15 @@
/datum/persistent/proc/IsValidEntry(var/atom/entry)
if(!istype(entry))
return FALSE
if(GetEntryAge(entry) >= entries_expire_at)
if(!isnull(entries_expire_at) && GetEntryAge(entry) >= entries_expire_at)
return FALSE
var/turf/T = get_turf(entry)
if(!T || !(T.z in using_map.station_levels) )
return FALSE
var/area/A = get_area(T)
if(!A || (A.area_flags & AREA_FLAG_IS_NOT_PERSISTENT))
if(station_restricted && (!T || !(T.z in using_map.station_levels) ))
return FALSE
if(area_restricted)
var/area/A = get_area(T)
if(!A || (A.area_flags & AREA_FLAG_IS_NOT_PERSISTENT))
return FALSE
return TRUE

/datum/persistent/proc/GetEntryAge(var/atom/entry)
Expand Down
44 changes: 44 additions & 0 deletions code/modules/persistence/items/specimen.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Currently unticked pending full implementation of the required data structures
// and tracking/load logic. Needs to account for DMMS load, critters spawning in POIs,
// critters spawning on station, etc. Fair bit of design work to consider.
/datum/persistent/specimen
name = "specimen"
entries_expire_at = 10
area_restricted = FALSE
station_restricted = FALSE

/datum/persistent/specimen/CreateEntryInstance(var/turf/creating, var/list/token)
new /obj/item/gps/specimen_tag(
creating,
token["age"]+1,
token["implanted_by"],
token["specimen_id"],
token["specimen_gender"],
token["physical_info"],
token["behavior_info"],
text2path(token["specimen_type"])
)

/datum/persistent/specimen/GetEntryAge(var/atom/entry)
var/obj/item/gps/specimen_tag/save_specimen = entry
if(!istype(save_specimen))
return 0
return save_specimen.age

/datum/persistent/specimen/IsValidEntry(atom/entry)
. = ..()
var/obj/item/gps/specimen_tag/save_specimen = entry
return istype(save_specimen) && save_specimen.has_been_implanted() && save_specimen.implanted_in.stat != DEAD

/datum/persistent/specimen/CompileEntry(var/atom/entry, var/write_file)
. = ..()
var/obj/item/gps/specimen_tag/save_specimen = entry
if(!istype(save_specimen))
return
save_specimen.update_from_animal()
LAZYADDASSOC(., "implanted_by", save_specimen.implanted_by)
LAZYADDASSOC(., "specimen_id", save_specimen.gps_tag)
LAZYADDASSOC(., "specimen_type", save_specimen.implanted_in.type)
LAZYADDASSOC(., "specimen_gender", save_specimen.gender)
LAZYADDASSOC(., "physical_info", save_specimen.physical_info)
LAZYADDASSOC(., "behavior_info", save_specimen.behavioral_info)
Loading

0 comments on commit 85f157a

Please sign in to comment.