Skip to content

Commit

Permalink
Merge branch 'master220' into Delta_Northwest_maintenance_bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravgolin authored Feb 4, 2025
2 parents 97c7087 + 5e35d40 commit b2b1c09
Show file tree
Hide file tree
Showing 92 changed files with 1,906 additions and 616 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,5 @@ stddef.dm
#Ignore cached sound files.
/sound/tts_cache/**/*
/sound/tts_scrambled/**/*
.vscode/launch.json
.gitignore
18 changes: 14 additions & 4 deletions _maps/map_files/Delta/delta.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -27970,7 +27970,6 @@
network = list("Engineering","SS13");
pixel_y = -22
},
/obj/machinery/station_map/engineering/directional/west,
/turf/simulated/floor/plasteel{
dir = 8;
icon_state = "yellow"
Expand Down Expand Up @@ -90277,6 +90276,13 @@
icon_state = "dark"
},
/area/crew_quarters/serviceyard)
"pPA" = (
/obj/machinery/station_map/engineering/directional/north,
/turf/simulated/floor/plasteel{
dir = 1;
icon_state = "yellow"
},
/area/engineering/break_room)
"pPB" = (
/obj/structure/safe,
/obj/item/soap,
Expand Down Expand Up @@ -112221,6 +112227,10 @@
/obj/effect/decal/warning_stripes/yellow/hollow,
/turf/simulated/floor/plasteel,
/area/storage/primary)
"uQJ" = (
/obj/machinery/status_display,
/turf/simulated/wall,
/area/engineering/break_room)
"uQL" = (
/obj/machinery/camera{
c_tag = "Robotics Lab";
Expand Down Expand Up @@ -150139,7 +150149,7 @@ kLP
rZU
sMk
bPK
lsT
uQJ
uOE
pqZ
cTM
Expand Down Expand Up @@ -152193,8 +152203,8 @@ frD
frD
frD
frD
jJA
cKe
frD
pPA
ofQ
oPZ
aLM
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals_silicon.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
///from base of /mob/camera/aiEye/setLoc: (/turf/destination)
#define COMSIG_AI_EYE_MOVED "ai_eye_moved"
7 changes: 7 additions & 0 deletions code/__DEFINES/ert.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#define ERT_ROLE_COMMANDER "Командир"
#define ERT_ROLE_SECURITY "Боец"
#define ERT_ROLE_MEDIC "Медик"
#define ERT_ROLE_ENGINEER "Инженер"
#define ERT_ROLE_JANITOR "Уборщик"
#define ERT_ROLE_PARANORMAL "Паранормал"
#define ERT_ROLE_CYBORG "Борг"
2 changes: 2 additions & 0 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
#define INIT_ORDER_NIGHTSHIFT -24
#define INIT_ORDER_GAME_EVENTS -26
#define INIT_ORDER_PATH -50
#define INIT_ORDER_EXPLOSIONS -69
#define INIT_ORDER_PERSISTENCE -95
#define INIT_ORDER_STATPANELS -98
#define INIT_ORDER_DEMO -99 // To avoid a bunch of changes related to initialization being written, do this last
Expand Down Expand Up @@ -139,6 +140,7 @@
#define FIRE_PRIORITY_CHAT 400
#define FIRE_PRIORITY_RUNECHAT 410 // I hate how high the fire priority on this is -aa
#define FIRE_PRIORITY_OVERLAYS 500
#define FIRE_PRIORITY_EXPLOSIONS 666
#define FIRE_PRIORITY_TIMER 700
#define FIRE_PRIORITY_SPEECH_CONTROLLER 900
#define FIRE_PRIORITY_DELAYED_VERBS 950
Expand Down
69 changes: 69 additions & 0 deletions code/__HELPERS/data_struct/priority_queue.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/priority_queue
var/list/priority_node/heap = list()

/priority_node
var/item
var/priority

/priority_node/New(item, priority)
. = ..()
src.item = item
src.priority = priority

/priority_queue/proc/enqueue(value, priority)
heap += list(new /priority_node(value, priority))
bubble_up(heap.len)

/priority_queue/proc/dequeue()
if (heap.len == 0)
return null

var/priority_node/top = heap[1]
var/bottom = heap[heap.len]
var/item = top.item
heap -= bottom
if(!heap.len)
qdel(top)
return item
heap[1] = bottom
bubble_down(1)
qdel(top)
return item

/priority_queue/proc/peek()
if (heap.len == 0)
return null
return heap[1].item

/priority_queue/proc/is_empty()
return heap.len == 0

/priority_queue/proc/bubble_up(index)
while(index > 1)
var/parent = round(index / 2)

if (heap[parent].priority < heap[index].priority)
break

swap(index, parent)
index = parent


/priority_queue/proc/bubble_down(index)
while(index * 2 <= heap.len)
var/child = index * 2

if (child + 1 <= heap.len && heap[child + 1].priority < heap[child].priority)
child++

if (heap[index].priority < heap[child].priority)
break

swap(index, child)
index = child


/priority_queue/proc/swap(a, b)
var/list/temp = heap[a]
heap[a] = heap[b]
heap[b] = temp
73 changes: 73 additions & 0 deletions code/__HELPERS/data_struct/queue.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Double linked list node
*/
/node
var/value
var/prev
var/next

/*
* Defining a queue based on a double linked list
*/
/queue
/// Link to the beginning of the list
var/node/head
/// Link to end of list
var/node/tail
/// Number of elements in queue
var/count = 0

/*
* Adding an element to the end of the queue
*/
/queue/proc/enqueue(value)
var/node/new_node = new
new_node.value = value

if (!tail)
head = new_node
tail = new_node
else
tail.next = new_node
new_node.prev = tail
tail = new_node
count++
/*
* Retrieving an element from the head of the queue
*/
/queue/proc/dequeue()
if (!head)
return null

var/value = head.value
var/node/old_head = head

head = head.next
if (head)
head.prev = null
else
tail = null
old_head.value = null
old_head.next = null
qdel(old_head)
count--
return value
/*
* Returns an element from the beginning of the queue without removing it
*/
/queue/proc/peek()
if (!head)
return null
return head.value

/*
* Checking if the queue is empty
*/
/queue/proc/is_empty()
return count == 0

/*
* Returns the number of elements in the queue
*/
/queue/proc/size()
return count
20 changes: 0 additions & 20 deletions code/__HELPERS/level_check.dm

This file was deleted.

8 changes: 8 additions & 0 deletions code/__HELPERS/level_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,11 @@ GLOBAL_LIST_INIT(default_map_traits, MAP_TRANSITION_CONFIG)
if(SL.linkage == CROSSLINKED && !is_taipan(SL.zpos))
znums |= SL.zpos
return znums

/// Checks if both atoms are in same z or in connected z-levels.
/proc/are_zs_connected(atom/A, atom/B)
A = get_turf(A)
B = get_turf(B)
if(A.z == B.z)
return TRUE
return (B.z in SSmapping.get_connected_levels(A))
6 changes: 3 additions & 3 deletions code/_globalvars/lists/holomaps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ GLOBAL_LIST_INIT(holomap_color_to_name, list(
HOLOMAP_AREACOLOR_CARGO = "Снабжение",
HOLOMAP_AREACOLOR_HALLWAYS = "Коридоры",
HOLOMAP_AREACOLOR_MAINTENANCE = "Тех. тоннели",
HOLOMAP_AREACOLOR_ARRIVALS = "Зона прибытия",
HOLOMAP_AREACOLOR_ESCAPE = "Зона отбытия",
HOLOMAP_AREACOLOR_DORMS = "Зона отдыха",
HOLOMAP_AREACOLOR_ARRIVALS = "Прибытие",
HOLOMAP_AREACOLOR_ESCAPE = "Отбытие",
HOLOMAP_AREACOLOR_DORMS = "Дормиторий",
HOLOMAP_AREACOLOR_SERVICE = "Сервис",
HOLOMAP_AREACOLOR_HANGAR = "Ангар",
))
78 changes: 78 additions & 0 deletions code/controllers/subsystem/augury.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
SUBSYSTEM_DEF(augury)
name = "Augury"
flags = SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME

var/list/watchers = list()
var/list/doombringers = list()

var/list/observers_given_action = list()

/datum/controller/subsystem/augury/stat_entry(msg)
msg = "W:[watchers.len]|D:[length(doombringers)]"
return ..()

/datum/controller/subsystem/augury/proc/register_doom(atom/A, severity)
doombringers[A] = severity
RegisterSignal(A, COMSIG_QDELETING, PROC_REF(unregister_doom))

/datum/controller/subsystem/augury/proc/unregister_doom(atom/A)
SIGNAL_HANDLER
UnregisterSignal(A, COMSIG_QDELETING)
doombringers -= A

/datum/controller/subsystem/augury/fire()
var/biggest_doom = null
var/biggest_threat = null

for(var/db in doombringers)
var/datum/d = db
if(!d || QDELETED(d))
doombringers -= d
continue
var/threat = doombringers[d]
if((biggest_threat == null) || (biggest_threat < threat))
biggest_doom = d
biggest_threat = threat

if(doombringers.len)
for(var/i in GLOB.player_list)
if(isobserver(i) && (!(observers_given_action[i])))
var/datum/action/innate/augury/A = new
A.Grant(i)
observers_given_action[i] = TRUE
else
for(var/i in observers_given_action)
if(observers_given_action[i] && isobserver(i))
var/mob/dead/observer/O = i
for(var/datum/action/innate/augury/A in O.actions)
qdel(A)
observers_given_action -= i

for(var/w in watchers)
if(!w)
watchers -= w
continue
var/mob/dead/observer/O = w
if(biggest_doom && (!O.orbiting || O.orbiting != biggest_doom))
O.ManualFollow(biggest_doom)

/datum/action/innate/augury
name = "Авто-отслеживание обломок"
icon_icon = 'icons/obj/meteor.dmi'
button_icon_state = "flaming"

/datum/action/innate/augury/Destroy()
if(owner)
SSaugury.watchers -= owner
return ..()

/datum/action/innate/augury/Activate()
SSaugury.watchers += owner
to_chat(owner, span_notice("Вы теперь автоматически отслеживаете обломки."))
active = TRUE

/datum/action/innate/augury/Deactivate()
SSaugury.watchers -= owner
to_chat(owner, span_notice("Вы больше не отслеживаете обломки."))
active = FALSE
Loading

0 comments on commit b2b1c09

Please sign in to comment.