-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master220' into Delta_Northwest_maintenance_bugfix
- Loading branch information
Showing
92 changed files
with
1,906 additions
and
616 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "Борг" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.