Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(holomap) #11278

Merged
merged 14 commits into from
Dec 31, 2023
4 changes: 4 additions & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,10 @@
#include "code\modules\holodeck\HolodeckControl.dm"
#include "code\modules\holodeck\HolodeckObjects.dm"
#include "code\modules\holodeck\HolodeckPrograms.dm"
#include "code\modules\holomaps\_holomap_defines.dm"
#include "code\modules\holomaps\holochip.dm"
#include "code\modules\holomaps\holomap.dm"
#include "code\modules\holomaps\holomarker_component.dm"
#include "code\modules\hydroponics\grown.dm"
#include "code\modules\hydroponics\grown_inedible.dm"
#include "code\modules\hydroponics\grown_predefined.dm"
Expand Down
2 changes: 2 additions & 0 deletions code/__defines/__renderer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
#define HUD_CLICKABLE_LAYER 2
#define HUD_ITEM_LAYER 3
#define HUD_ABOVE_ITEM_LAYER 4
#define HUD_HOLOMARKER_LAYER 5
#define HUD_HOLOMARKER_SELF_LAYER 6

#define ABOVE_HUD_PLANE 8
#define ABOVE_HUD_LAYER 5
Expand Down
3 changes: 3 additions & 0 deletions code/__defines/ces/signals_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@

/// From base of atom/proc/Initialize(): sent any time a new atom is created in this atom
#define SIGNAL_ATOM_INITIALIZED_ON "atom_initialized_on"

/// Called on 'atom/Move' (/atom, old_turf, new_turf)
#define SIGNAL_Z_CHANGED "movable_z_changed"
1 change: 1 addition & 0 deletions code/__defines/items_clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#define ACCESSORY_SLOT_ARMOR_S "Armor storage"
#define ACCESSORY_SLOT_ARMOR_M "Misc armor"
#define ACCESSORY_SLOT_HELM_C "Helmet cover"
#define ACCESSORY_SLOT_HELM_H "Helmet holochip"

// Bitmasks for the flags_inv variable. These determine when a piece of clothing hides another, i.e. a helmet hiding glasses.
// WARNING: The following flags apply only to the external suit!
Expand Down
16 changes: 16 additions & 0 deletions code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
/// List of all buttons that never exit the view
var/list/obj/screen/always_visible_inventory

var/obj/screen/holomap_obj

/datum/hud/New(mob/owner)
mymob = owner
instantiate()
Expand All @@ -63,6 +65,10 @@
always_visible_inventory = null
mymob = null

/obj/screen/holomap
icon = 'icons/480x480.dmi'
icon_state = "blank"

/datum/hud/proc/hidden_inventory_update()
if(!mymob) return
if(ishuman(mymob))
Expand Down Expand Up @@ -155,6 +161,16 @@
var/ui_color = mymob.client.prefs.UI_style_color
var/ui_alpha = mymob.client.prefs.UI_style_alpha

holomap_obj = new /obj/screen/holomap
holomap_obj.name = "holomap"
holomap_obj.icon = null
holomap_obj.icon_state = ""
holomap_obj.screen_loc = "SOUTH,WEST"
holomap_obj.mouse_opacity = 0
holomap_obj.alpha = 255

mymob.client.screen += src.holomap_obj

FinalizeInstantiation(ui_style, ui_color, ui_alpha)

/datum/hud/proc/FinalizeInstantiation(ui_style, ui_color, ui_alpha)
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystems/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ SUBSYSTEM_DEF(atoms)
/datum/controller/subsystem/atoms/Initialize(timeofday)
init_state = INITIALIZATION_INNEW_MAPLOAD
InitializeAtoms()
generate_holomaps()

// Mannequins refuse to spawn prior to atoms init, so refresh them in case anyone connected before init finished.
for(var/client/C)
Expand Down
3 changes: 3 additions & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
if(is_new_area && is_destination_turf)
destination.loc.Entered(src, origin)

if(origin?.z != destination?.z)
SEND_SIGNAL(src, SIGNAL_Z_CHANGED, src, origin, destination)

SEND_SIGNAL(src, SIGNAL_MOVED, src, origin, destination)

return 1
Expand Down
11 changes: 11 additions & 0 deletions code/game/machinery/navbeacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ Transponder Codes:<UL>"}
location = "SEC"
codes = list("patrol" = 1, "next_patrol" = "SE1")

/obj/machinery/navbeacon/frontier/SEC/Initialize()
. = ..()
AddComponent(/datum/component/holomap, "Security")

/obj/machinery/navbeacon/frontier/SE1
location = "SE1"
codes = list("patrol" = 1, "next_patrol" = "DOME_E1")
Expand Down Expand Up @@ -295,6 +299,9 @@ Transponder Codes:<UL>"}
location = "ENG"
codes = list("patrol" = 1, "next_patrol" = "DOME_W2")

/obj/machinery/navbeacon/frontier/ENG/Initialize()
. = ..()
AddComponent(/datum/component/holomap, "Engineering")
/obj/machinery/navbeacon/frontier/DOME_W2
location = "DOME_W2"
codes = list("patrol" = 1, "next_patrol" = "DOME_NW")
Expand All @@ -319,6 +326,10 @@ Transponder Codes:<UL>"}
location = "BAR"
codes = list("patrol" = 1, "next_patrol" = "CRYO")

/obj/machinery/navbeacon/frontier/BAR/Initialize()
. = ..()
AddComponent(/datum/component/holomap, "Bar")

/obj/machinery/navbeacon/frontier/CRYO
location = "CRYO"
codes = list("patrol" = 1, "next_patrol" = "BHALLWAY")
Expand Down
94 changes: 58 additions & 36 deletions code/game/machinery/wayfinding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,17 @@
var/owner = null
var/list/beacons = list()

/obj/item/pinpointer/wayfinding/attack_self(mob/living/user)
if(active)
..()
return
if(!owner)
owner = user.real_name

if(length(beacons))
beacons.Cut()
for(var/obj/machinery/navbeacon/B in GLOB.wayfindingbeacons)
beacons[B.codes["wayfinding"]] = B

if(!length(beacons))
to_chat(user, SPAN_NOTICE("Your pinpointer fails to detect a signal."))
return

var/A = input(user, "", "Pinpoint") as null|anything in sortList(beacons)
if(!A || QDELETED(src) || !user || !src.Adjacent(user) || user.incapacitated())
return

target = acquire_target(beacons[A])
..()
/obj/item/pinpointer/wayfinding/Initialize()
. = ..()
var/datum/component/holomap/toggleable/H = AddComponent(/datum/component/holomap/toggleable)
H.should_have_legend = TRUE

/obj/item/pinpointer/wayfinding/acquire_target(way_target)
if(!way_target)
/obj/item/pinpointer/wayfinding/attack_self(mob/living/user)
var/datum/component/holomap/toggleable/H = get_component(/datum/component/holomap/toggleable)
if(isnull(H))
return
return weakref(way_target)

/obj/item/pinpointer/wayfinding/_examine_text(mob/user)
. = ..()
var/msg = " Its tracking indicator reads "
if(target)
var/obj/machinery/navbeacon/wayfinding/B = target.resolve()
msg += "\"[B.codes["wayfinding"]]\"."
else
msg = " Its tracking indicator is blank."
if(owner)
msg += " It belongs to [owner]."
. += msg
H.toggle(user)

//Navbeacon that initialises with wayfinding codes
/obj/machinery/navbeacon/wayfinding
Expand All @@ -55,6 +27,11 @@
/obj/machinery/navbeacon/wayfinding/bridge
location = "Bridge"

/obj/machinery/navbeacon/wayfinding/bridge/Initialize()
. = ..()
var/datum/component/holomap/holomap = AddComponent(/datum/component/holomap, location)
holomap.marker_id = location

/obj/machinery/navbeacon/wayfinding/vault
location = "Vault"

Expand All @@ -67,16 +44,31 @@
/obj/machinery/navbeacon/wayfinding/eva
location = "EVA Storage"

/obj/machinery/navbeacon/wayfinding/eva/Initialize()
. = ..()
var/datum/component/holomap/holomap = AddComponent(/datum/component/holomap, location)
holomap.marker_id = location

/obj/machinery/navbeacon/wayfinding/aiupload
location = "AI Upload"

/obj/machinery/navbeacon/wayfinding/aiupload/Initialize()
. = ..()
var/datum/component/holomap/holomap = AddComponent(/datum/component/holomap, location)
holomap.marker_id = location

// head of staff offices
/obj/machinery/navbeacon/wayfinding/hos
location = "Head of Security's Office"

/obj/machinery/navbeacon/wayfinding/hop
location = "Head of Personnel's Office"

/obj/machinery/navbeacon/wayfinding/hop/Initialize()
. = ..()
var/datum/component/holomap/holomap = AddComponent(/datum/component/holomap, location)
holomap.marker_id = location

/obj/machinery/navbeacon/wayfinding/agent
location = "IIA's Office"

Expand All @@ -90,6 +82,11 @@
/obj/machinery/navbeacon/wayfinding/sec
location = "Security"

/obj/machinery/navbeacon/wayfinding/sec/Initialize()
. = ..()
var/datum/component/holomap/holomap = AddComponent(/datum/component/holomap, location)
holomap.marker_id = location

/obj/machinery/navbeacon/wayfinding/det
location = "Detective's Office"

Expand All @@ -99,6 +96,11 @@
/obj/machinery/navbeacon/wayfinding/engineering
location = "Engineering"

/obj/machinery/navbeacon/wayfinding/engineering/Initialize()
. = ..()
var/datum/component/holomap/holomap = AddComponent(/datum/component/holomap, location)
holomap.marker_id = location

/obj/machinery/navbeacon/wayfinding/techstorage
location = "Technical Storage"

Expand All @@ -108,13 +110,23 @@
/obj/machinery/navbeacon/wayfinding/med
location = "Medical"

/obj/machinery/navbeacon/wayfinding/med/Initialize()
. = ..()
var/datum/component/holomap/holomap = AddComponent(/datum/component/holomap, location)
holomap.marker_id = location

/obj/machinery/navbeacon/wayfinding/cargo
location = "Cargo"

//Common areas
/obj/machinery/navbeacon/wayfinding/bar
location = "Bar"

/obj/machinery/navbeacon/wayfinding/bar/Initialize()
. = ..()
var/datum/component/holomap/holomap = AddComponent(/datum/component/holomap, location)
holomap.marker_id = location

/obj/machinery/navbeacon/wayfinding/dorms
location = "Dormitories"

Expand All @@ -127,9 +139,19 @@
/obj/machinery/navbeacon/wayfinding/library
location = "Library"

/obj/machinery/navbeacon/wayfinding/library/Initialize()
. = ..()
var/datum/component/holomap/holomap = AddComponent(/datum/component/holomap, location)
holomap.marker_id = location

/obj/machinery/navbeacon/wayfinding/chapel
location = "Chapel"

/obj/machinery/navbeacon/wayfinding/chapel/Initialize()
. = ..()
var/datum/component/holomap/holomap = AddComponent(/datum/component/holomap, location)
holomap.marker_id = location

/obj/machinery/navbeacon/wayfinding/cryo
location = "Cryo Chambers"

Expand Down
4 changes: 2 additions & 2 deletions code/modules/clothing/head/helmet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
slot_l_hand_str = "helmet",
slot_r_hand_str = "helmet",
)
valid_accessory_slots = list(ACCESSORY_SLOT_HELM_C)
restricted_accessory_slots = list(ACCESSORY_SLOT_HELM_C)
valid_accessory_slots = list(ACCESSORY_SLOT_HELM_C, ACCESSORY_SLOT_HELM_H)
restricted_accessory_slots = list(ACCESSORY_SLOT_HELM_C, ACCESSORY_SLOT_HELM_H)
item_flags = ITEM_FLAG_THICKMATERIAL
body_parts_covered = HEAD|EYES
armor = list(melee = 50, bullet = 50, laser = 50, energy = 25, bomb = 35, bio = 0)
Expand Down
47 changes: 47 additions & 0 deletions code/modules/holomaps/_holomap_defines.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
GLOBAL_LIST_EMPTY(holomarkers)
GLOBAL_LIST_EMPTY(holocache)
GLOBAL_LIST_EMPTY(holomaps)

#define HOLOMAP_WALKABLE_TILE "#66666699"
#define HOLOMAP_CONCRETE_TILE "#FFFFFFDD"
#define HOLOMAP_GLASS_TILE "#b0d0ffdd"

#define HOLOMAP_AREACOLOR_COM "#447FC299"
#define HOLOMAP_AREACOLOR_SEC "#AE121299"
#define HOLOMAP_AREACOLOR_MED "#35803099"
#define HOLOMAP_AREACOLOR_RND "#A154A699"
#define HOLOMAP_AREACOLOR_ENG "#F1C23199"
#define HOLOMAP_AREACOLOR_CRG "#E06F0099"
#define HOLOMAP_AREACOLOR_CIV "#63f04799"
#define HOLOMAP_AREACOLOR_ARRIVALS "#0000FFCC"
#define HOLOMAP_AREACOLOR_ESCAPE "#FF0000CC"
#define HOLOMAP_AREACOLOR_HALLWAYS "#FFFFFF66"

#define HOLOMAP_FILTER_DEATHSQUAD 1
#define HOLOMAP_FILTER_ERT 2
#define HOLOMAP_FILTER_NUKEOPS 4
#define HOLOMAP_FILTER_ELITESYNDICATE 8
#define HOLOMAP_FILTER_VOX 16
/// For use with area markers and wayfinding pinpointers
#define HOLOMAP_FILTER_STATIONMAP 32

#define HOLOMAP_OFFSET_X 127.5
#define HOLOMAP_OFFSET_Y 127.5

///Holomap offset for small images
#define HOLOMAP_CORRECTOR_X_SMALL 6
#define HOLOMAP_CORRECTOR_Y_SMALL 6

///Holomap offset for big (32x32) images
#define HOLOMAP_CORRECTOR_X_BIG 16
#define HOLOMAP_CORRECTOR_Y_BIG 16

#define COLOR_HMAP_DEAD "#d3212d"
#define COLOR_HMAP_INCAPACITATED "#ffef00"
#define COLOR_HMAP_DEFAULT "#006e4e"

GLOBAL_LIST_INIT(holomap_frequency_deathsquad, list("frequency" = rand(1200, 1600), "encryption" = rand(1, 100)))
GLOBAL_LIST_INIT(holomap_frequency_ert, list("frequency" = rand(1200, 1600), "encryption" = rand(1, 100)))
GLOBAL_LIST_INIT(holomap_frequency_nuke, list("frequency" = rand(1200, 1600), "encryption" = rand(1, 100)))
GLOBAL_LIST_INIT(holomap_frequency_elitesyndie, list("frequency" = rand(1200, 1600), "encryption" = rand(1, 100)))
GLOBAL_LIST_INIT(holomap_frequency_vox, list("frequency" = rand(1200, 1600), "encryption" = rand(1, 100)))
Loading
Loading