Skip to content

Commit

Permalink
Merge remote-tracking branch 'cmss13-devs/master' into forest/rankfinish
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Jan 19, 2024
2 parents 9690bc9 + 84dc482 commit 9c637ba
Show file tree
Hide file tree
Showing 305 changed files with 6,370 additions and 12,837 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/signals_mind.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
///from mind/transfer_to. Sent after the mind has been transferred to a different body: (mob/previous_body)
#define COMSIG_MIND_TRANSFERRED "mind_transferred"
3 changes: 1 addition & 2 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@
#define INTERRUPT_MIDDLECLICK (1<<15)
#define INTERRUPT_DAZED (1<<16)
#define INTERRUPT_EMOTE (1<<17)
// By default not in INTERRUPT_ALL (too niche)
#define INTERRUPT_CHANGED_LYING (1<<18)

#define INTERRUPT_ALL (INTERRUPT_DIFF_LOC|INTERRUPT_DIFF_TURF|INTERRUPT_UNCONSCIOUS|INTERRUPT_KNOCKED_DOWN|INTERRUPT_STUNNED|INTERRUPT_NEEDHAND|INTERRUPT_RESIST)
#define INTERRUPT_ALL (INTERRUPT_DIFF_LOC|INTERRUPT_DIFF_TURF|INTERRUPT_UNCONSCIOUS|INTERRUPT_KNOCKED_DOWN|INTERRUPT_STUNNED|INTERRUPT_NEEDHAND|INTERRUPT_RESIST|INTERRUPT_CHANGED_LYING)
#define INTERRUPT_ALL_OUT_OF_RANGE (INTERRUPT_ALL & (~INTERRUPT_DIFF_TURF)|INTERRUPT_OUT_OF_RANGE)
#define INTERRUPT_MOVED (INTERRUPT_DIFF_LOC|INTERRUPT_DIFF_TURF|INTERRUPT_RESIST)
#define INTERRUPT_NO_NEEDHAND (INTERRUPT_ALL & (~INTERRUPT_NEEDHAND))
Expand Down
6 changes: 0 additions & 6 deletions code/__DEFINES/typecheck/mobs_generic.dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#define isAI(A) (istype(A, /mob/living/silicon/ai))
#define isARES(A) (istype(A, /mob/living/silicon/decoy/ship_ai))
#define isSilicon(A) (istype(A, /mob/living/silicon))
#define isRemoteControlling(M) (M && M.client && M.client.remote_control)
#define isRemoteControllingOrAI(M) ((M && M.client && M.client.remote_control) || (istype(M, /mob/living/silicon/ai)))

#define isbrain(A) (istype(A, /mob/living/brain))
#define isrobot(A) (istype(A, /mob/living/silicon/robot))
#define isanimal(A) (istype(A, /mob/living/simple_animal))
#define isanimalhostile(A) (istype(A, /mob/living/simple_animal/hostile))
#define isanimalretaliate(A) (istype(A, /mob/living/simple_animal/hostile/retaliate))
Expand All @@ -17,12 +14,9 @@
#define iscarp(A) (istype(A, /mob/living/simple_animal/hostile/carp))
#define isclown(A) (istype(A, /mob/living/simple_animal/hostile/retaliate/clown))
#define iscarbon(A) (istype(A, /mob/living/carbon))
#define isborg(A) (isrobot(A) && !ismaintdrone(A))
#define ishighersilicon(A) (isborg(A) || isRemoteControllingOrAI(A))
#define isliving(A) (istype(A, /mob/living))
#define isobserver(A) (istype(A, /mob/dead/observer))
#define isorgan(A) (istype(A, /obj/limb))
#define isnewplayer(A) (istype(A, /mob/new_player))
#define ismaintdrone(A) (istype(A,/mob/living/silicon/robot/drone))
#define isHellhound(A) (istype(A, /mob/living/carbon/xenomorph/hellhound))
#define isaghost(A) (copytext(A.key, 1, 2) == "@")
10 changes: 0 additions & 10 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,6 @@
var/list/speaker_coverage = list()
for(var/obj/item/device/radio/R in radios)
if(R)
//Cyborg checks. Receiving message uses a bit of cyborg's charge.
var/obj/item/device/radio/borg/BR = R
if(istype(BR) && BR.myborg)
var/mob/living/silicon/robot/borg = BR.myborg
var/datum/robot_component/CO = borg.get_component("radio")
if(!CO)
continue //No radio component (Shouldn't happen)
if(!borg.is_component_functioning("radio") || !borg.cell_use_power(CO.active_usage))
continue //No power.

var/turf/speaker = get_turf(R)
if(speaker)
for(var/turf/T in hear(R.canhear_range,speaker))
Expand Down
13 changes: 13 additions & 0 deletions code/__HELPERS/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,19 @@
original += result
return original

/// Returns a list of atoms sorted by each entry's distance to `target`.
/proc/sort_list_dist(list/atom/list_to_sort, atom/target)
var/list/distances = list()
for(var/atom/A as anything in list_to_sort)
// Just in case this happens anyway.
if(!istype(A))
stack_trace("sort_list_dist() was called with a list containing a non-atom object. ([A.type])")
return list_to_sort

distances[A] = get_dist_sqrd(A, target)

return sortTim(distances, GLOBAL_PROC_REF(cmp_numeric_asc), TRUE)

//Converts a bitfield to a list of numbers (or words if a wordlist is provided)
/proc/bitfield2list(bitfield = 0, list/wordlist)
var/list/r = list()
Expand Down
42 changes: 1 addition & 41 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -324,56 +324,17 @@
if(!newname) //we'll stick with the oldname then
return

if(cmptext("ai",role))
if(isAI(src))
var/mob/living/silicon/ai/A = src
oldname = null//don't bother with the records update crap
A.SetName(newname)

fully_replace_character_name(oldname,newname)



//When a borg is activated, it can choose which AI it wants to be slaved to
/proc/active_ais()
. = list()
for(var/mob/living/silicon/ai/A in GLOB.alive_mob_list)
if(A.stat == DEAD)
continue
if(A.control_disabled == 1)
continue
. += A
return .

//Find an active ai with the least borgs. VERBOSE PROCNAME HUH!
/proc/select_active_ai_with_fewest_borgs()
var/mob/living/silicon/ai/selected
var/list/active = active_ais()
for(var/mob/living/silicon/ai/A in active)
if(!selected || (selected.connected_robots > A.connected_robots))
selected = A

return selected

/proc/select_active_ai(mob/user)
var/list/ais = active_ais()
if(ais.len)
if(user) . = tgui_input_list(usr,"AI signals detected:", "AI selection", ais)
else . = pick(ais)
return .

/proc/get_sorted_mobs()
var/list/old_list = getmobs()
var/list/AI_list = list()
var/list/Dead_list = list()
var/list/keyclient_list = list()
var/list/key_list = list()
var/list/logged_list = list()
for(var/named in old_list)
var/mob/M = old_list[named]
if(isSilicon(M))
AI_list |= M
else if(isobserver(M) || M.stat == 2)
if(isobserver(M) || M.stat == 2)
Dead_list |= M
else if(M.key && M.client)
keyclient_list |= M
Expand All @@ -383,7 +344,6 @@
logged_list |= M
old_list.Remove(named)
var/list/new_list = list()
new_list += AI_list
new_list += keyclient_list
new_list += key_list
new_list += logged_list
Expand Down
4 changes: 0 additions & 4 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ GLOBAL_LIST_INIT(reverse_dir, list(2, 1, 3, 8, 10, 9, 11, 4, 6, 5, 7, 12, 14, 13
GLOBAL_VAR(join_motd)
GLOBAL_VAR(current_tms)

GLOBAL_LIST_INIT(BorgWireColorToFlag, RandomBorgWires())
GLOBAL_LIST(BorgIndexToFlag)
GLOBAL_LIST(BorgIndexToWireColor)
GLOBAL_LIST(BorgWireColorToIndex)
GLOBAL_LIST_INIT(AAlarmWireColorToFlag, RandomAAlarmWires())
GLOBAL_LIST(AAlarmIndexToFlag)
GLOBAL_LIST(AAlarmIndexToWireColor)
Expand Down
143 changes: 0 additions & 143 deletions code/_onclick/cyborg.dm

This file was deleted.

Loading

0 comments on commit 9c637ba

Please sign in to comment.