Skip to content

Commit

Permalink
Merge branch 'master' into reqcentralization
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar authored Jan 23, 2024
2 parents 71a4fad + 085ca70 commit f756754
Show file tree
Hide file tree
Showing 365 changed files with 13,746 additions and 18,368 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"
2 changes: 2 additions & 0 deletions code/__DEFINES/layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@
#define FLOOR_PLANE -7
/// Game Plane, where most of the game objects reside
#define GAME_PLANE -6
/// Above Game Plane. For things which are above game objects, but below screen effects.
#define ABOVE_GAME_PLANE -5
/// Roof plane, disappearing when entering buildings
#define ROOF_PLANE -4

Expand Down
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
42 changes: 35 additions & 7 deletions code/__DEFINES/mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ GLOBAL_LIST_INIT(ROLES_UNASSIGNED, list(JOB_SQUAD_MARINE))
GLOBAL_LIST_INIT(whitelist_hierarchy, list(WHITELIST_NORMAL, WHITELIST_COUNCIL, WHITELIST_LEADER))

//=================================================

#define WHITELIST_YAUTJA (1<<0)
///Old holders of YAUTJA_ELDER
#define WHITELIST_YAUTJA_LEGACY (1<<1)
Expand All @@ -170,23 +171,50 @@ GLOBAL_LIST_INIT(whitelist_hierarchy, list(WHITELIST_NORMAL, WHITELIST_COUNCIL,
///Old holders of COMMANDER_COUNCIL for 3 months
#define WHITELIST_COMMANDER_COUNCIL_LEGACY (1<<7)
#define WHITELIST_COMMANDER_LEADER (1<<8)
///Former CO senator/whitelist overseer award
#define WHITELIST_COMMANDER_COLONEL (1<<9)

#define WHITELIST_JOE (1<<9)
#define WHITELIST_SYNTHETIC (1<<10)
#define WHITELIST_SYNTHETIC_COUNCIL (1<<11)
#define WHITELIST_JOE (1<<10)
#define WHITELIST_SYNTHETIC (1<<11)
#define WHITELIST_SYNTHETIC_COUNCIL (1<<12)
///Old holders of SYNTHETIC_COUNCIL for 3 months
#define WHITELIST_SYNTHETIC_COUNCIL_LEGACY (1<<12)
#define WHITELIST_SYNTHETIC_LEADER (1<<13)
#define WHITELIST_SYNTHETIC_COUNCIL_LEGACY (1<<13)
#define WHITELIST_SYNTHETIC_LEADER (1<<14)

///Senior Enlisted Advisor, auto granted by R_MENTOR
#define WHITELIST_MENTOR (1<<15)


#define WHITELIST_MENTOR (1<<14)
#define WHITELISTS_GENERAL (WHITELIST_YAUTJA|WHITELIST_COMMANDER|WHITELIST_SYNTHETIC|WHITELIST_MENTOR|WHITELIST_JOE)
#define WHITELISTS_COUNCIL (WHITELIST_YAUTJA_COUNCIL|WHITELIST_COMMANDER_COUNCIL|WHITELIST_SYNTHETIC_COUNCIL)
#define WHITELISTS_LEGACY_COUNCIL (WHITELIST_YAUTJA_COUNCIL_LEGACY|WHITELIST_COMMANDER_COUNCIL_LEGACY|WHITELIST_SYNTHETIC_COUNCIL_LEGACY)
#define WHITELISTS_LEADER (WHITELIST_YAUTJA_LEADER|WHITELIST_COMMANDER_LEADER|WHITELIST_SYNTHETIC_LEADER)

#define WHITELIST_EVERYTHING (WHITELISTS_GENERAL|WHITELISTS_COUNCIL|WHITELISTS_LEADER)

#define isCouncil(A) (GLOB.RoleAuthority.roles_whitelist[A.ckey] & WHITELIST_YAUTJA_COUNCIL) || (GLOB.RoleAuthority.roles_whitelist[A.ckey] & WHITELIST_SYNTHETIC_COUNCIL) || (GLOB.RoleAuthority.roles_whitelist[A.ckey] & WHITELIST_COMMANDER_COUNCIL)
#define COUNCIL_LIST list(WHITELIST_COMMANDER_COUNCIL, WHITELIST_SYNTHETIC_COUNCIL, WHITELIST_YAUTJA_COUNCIL)
#define SENATOR_LIST list(WHITELIST_COMMANDER_LEADER, WHITELIST_SYNTHETIC_LEADER, WHITELIST_YAUTJA_LEADER)
#define isCouncil(A) (A.check_whitelist_status_list(COUNCIL_LIST))
#define isSenator(A) (A.check_whitelist_status_list(SENATOR_LIST))

DEFINE_BITFIELD(whitelist_status, list(
"WHITELIST_YAUTJA" = WHITELIST_YAUTJA,
"WHITELIST_YAUTJA_LEGACY" = WHITELIST_YAUTJA_LEGACY,
"WHITELIST_YAUTJA_COUNCIL" = WHITELIST_YAUTJA_COUNCIL,
"WHITELIST_YAUTJA_COUNCIL_LEGACY" = WHITELIST_YAUTJA_COUNCIL_LEGACY,
"WHITELIST_YAUTJA_LEADER" = WHITELIST_YAUTJA_LEADER,
"WHITELIST_COMMANDER" = WHITELIST_COMMANDER,
"WHITELIST_COMMANDER_COUNCIL" = WHITELIST_COMMANDER_COUNCIL,
"WHITELIST_COMMANDER_COUNCIL_LEGACY" = WHITELIST_COMMANDER_COUNCIL_LEGACY,
"WHITELIST_COMMANDER_COLONEL" = WHITELIST_COMMANDER_COLONEL,
"WHITELIST_COMMANDER_LEADER" = WHITELIST_COMMANDER_LEADER,
"WHITELIST_JOE" = WHITELIST_JOE,
"WHITELIST_SYNTHETIC" = WHITELIST_SYNTHETIC,
"WHITELIST_SYNTHETIC_COUNCIL" = WHITELIST_SYNTHETIC_COUNCIL,
"WHITELIST_SYNTHETIC_COUNCIL_LEGACY" = WHITELIST_SYNTHETIC_COUNCIL_LEGACY,
"WHITELIST_SYNTHETIC_LEADER" = WHITELIST_SYNTHETIC_LEADER,
"WHITELIST_MENTOR" = WHITELIST_MENTOR,
))

//=================================================

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
76 changes: 18 additions & 58 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 Expand Up @@ -933,103 +893,103 @@ GLOBAL_DATUM(action_purple_power_up, /image)
if(!GLOB.busy_indicator_clock)
GLOB.busy_indicator_clock = image('icons/mob/mob.dmi', null, "busy_generic", "pixel_y" = 22)
GLOB.busy_indicator_clock.layer = FLY_LAYER
GLOB.busy_indicator_clock.plane = ABOVE_HUD_PLANE
GLOB.busy_indicator_clock.plane = ABOVE_GAME_PLANE
return GLOB.busy_indicator_clock
else if(busy_type == BUSY_ICON_MEDICAL)
if(!GLOB.busy_indicator_medical)
GLOB.busy_indicator_medical = image('icons/mob/mob.dmi', null, "busy_medical", "pixel_y" = 0) //This shows directly on top of the mob, no offset!
GLOB.busy_indicator_medical.layer = FLY_LAYER
GLOB.busy_indicator_medical.plane = ABOVE_HUD_PLANE
GLOB.busy_indicator_medical.plane = ABOVE_GAME_PLANE
return GLOB.busy_indicator_medical
else if(busy_type == BUSY_ICON_BUILD)
if(!GLOB.busy_indicator_build)
GLOB.busy_indicator_build = image('icons/mob/mob.dmi', null, "busy_build", "pixel_y" = 22)
GLOB.busy_indicator_build.layer = FLY_LAYER
GLOB.busy_indicator_build.plane = ABOVE_HUD_PLANE
GLOB.busy_indicator_build.plane = ABOVE_GAME_PLANE
return GLOB.busy_indicator_build
else if(busy_type == BUSY_ICON_FRIENDLY)
if(!GLOB.busy_indicator_friendly)
GLOB.busy_indicator_friendly = image('icons/mob/mob.dmi', null, "busy_friendly", "pixel_y" = 22)
GLOB.busy_indicator_friendly.layer = FLY_LAYER
GLOB.busy_indicator_friendly.plane = ABOVE_HUD_PLANE
GLOB.busy_indicator_friendly.plane = ABOVE_GAME_PLANE
return GLOB.busy_indicator_friendly
else if(busy_type == BUSY_ICON_HOSTILE)
if(!GLOB.busy_indicator_hostile)
GLOB.busy_indicator_hostile = image('icons/mob/mob.dmi', null, "busy_hostile", "pixel_y" = 22)
GLOB.busy_indicator_hostile.layer = FLY_LAYER
GLOB.busy_indicator_hostile.plane = ABOVE_HUD_PLANE
GLOB.busy_indicator_hostile.plane = ABOVE_GAME_PLANE
return GLOB.busy_indicator_hostile
else if(busy_type == EMOTE_ICON_HIGHFIVE)
if(!GLOB.emote_indicator_highfive)
GLOB.emote_indicator_highfive = image('icons/mob/mob.dmi', null, "emote_highfive", "pixel_y" = 22)
GLOB.emote_indicator_highfive.layer = FLY_LAYER
GLOB.emote_indicator_highfive.plane = ABOVE_HUD_PLANE
GLOB.emote_indicator_highfive.plane = ABOVE_GAME_PLANE
return GLOB.emote_indicator_highfive
else if(busy_type == EMOTE_ICON_FISTBUMP)
if(!GLOB.emote_indicator_fistbump)
GLOB.emote_indicator_fistbump = image('icons/mob/mob.dmi', null, "emote_fistbump", "pixel_y" = 22)
GLOB.emote_indicator_fistbump.layer = FLY_LAYER
GLOB.emote_indicator_fistbump.plane = ABOVE_HUD_PLANE
GLOB.emote_indicator_fistbump.plane = ABOVE_GAME_PLANE
return GLOB.emote_indicator_fistbump
else if(busy_type == EMOTE_ICON_ROCK_PAPER_SCISSORS)
if(!GLOB.emote_indicator_rock_paper_scissors)
GLOB.emote_indicator_rock_paper_scissors = image('icons/mob/mob.dmi', null, "emote_rps", "pixel_y" = 22)
GLOB.emote_indicator_rock_paper_scissors.layer = FLY_LAYER
GLOB.emote_indicator_rock_paper_scissors.plane = ABOVE_HUD_PLANE
GLOB.emote_indicator_rock_paper_scissors.plane = ABOVE_GAME_PLANE
return GLOB.emote_indicator_rock_paper_scissors
else if(busy_type == EMOTE_ICON_ROCK)
if(!GLOB.emote_indicator_rock)
GLOB.emote_indicator_rock = image('icons/mob/mob.dmi', null, "emote_rock", "pixel_y" = 22)
GLOB.emote_indicator_rock.layer = FLY_LAYER
GLOB.emote_indicator_rock.plane = ABOVE_HUD_PLANE
GLOB.emote_indicator_rock.plane = ABOVE_GAME_PLANE
return GLOB.emote_indicator_rock
else if(busy_type == EMOTE_ICON_PAPER)
if(!GLOB.emote_indicator_paper)
GLOB.emote_indicator_paper = image('icons/mob/mob.dmi', null, "emote_paper", "pixel_y" = 22)
GLOB.emote_indicator_paper.layer = FLY_LAYER
GLOB.emote_indicator_paper.plane = ABOVE_HUD_PLANE
GLOB.emote_indicator_paper.plane = ABOVE_GAME_PLANE
return GLOB.emote_indicator_paper
else if(busy_type == EMOTE_ICON_SCISSORS)
if(!GLOB.emote_indicator_scissors)
GLOB.emote_indicator_scissors = image('icons/mob/mob.dmi', null, "emote_scissors", "pixel_y" = 22)
GLOB.emote_indicator_scissors.layer = FLY_LAYER
GLOB.emote_indicator_scissors.plane = ABOVE_HUD_PLANE
GLOB.emote_indicator_scissors.plane = ABOVE_GAME_PLANE
return GLOB.emote_indicator_scissors
else if(busy_type == EMOTE_ICON_HEADBUTT)
if(!GLOB.emote_indicator_headbutt)
GLOB.emote_indicator_headbutt = image('icons/mob/mob.dmi', null, "emote_headbutt", "pixel_y" = 22)
GLOB.emote_indicator_headbutt.layer = FLY_LAYER
GLOB.emote_indicator_headbutt.plane = ABOVE_HUD_PLANE
GLOB.emote_indicator_headbutt.plane = ABOVE_GAME_PLANE
return GLOB.emote_indicator_headbutt
else if(busy_type == EMOTE_ICON_TAILSWIPE)
if(!GLOB.emote_indicator_tailswipe)
GLOB.emote_indicator_tailswipe = image('icons/mob/mob.dmi', null, "emote_tailswipe", "pixel_y" = 22)
GLOB.emote_indicator_tailswipe.layer = FLY_LAYER
GLOB.emote_indicator_tailswipe.plane = ABOVE_HUD_PLANE
GLOB.emote_indicator_tailswipe.plane = ABOVE_GAME_PLANE
return GLOB.emote_indicator_tailswipe
else if(busy_type == ACTION_RED_POWER_UP)
if(!GLOB.action_red_power_up)
GLOB.action_red_power_up = image('icons/effects/effects.dmi', null, "anger", "pixel_x" = 16)
GLOB.action_red_power_up.layer = FLY_LAYER
GLOB.action_red_power_up.plane = ABOVE_HUD_PLANE
GLOB.action_red_power_up.plane = ABOVE_GAME_PLANE
return GLOB.action_red_power_up
else if(busy_type == ACTION_GREEN_POWER_UP)
if(!GLOB.action_green_power_up)
GLOB.action_green_power_up = image('icons/effects/effects.dmi', null, "vitality", "pixel_x" = 16)
GLOB.action_green_power_up.layer = FLY_LAYER
GLOB.action_green_power_up.plane = ABOVE_HUD_PLANE
GLOB.action_green_power_up.plane = ABOVE_GAME_PLANE
return GLOB.action_green_power_up
else if(busy_type == ACTION_BLUE_POWER_UP)
if(!GLOB.action_blue_power_up)
GLOB.action_blue_power_up = image('icons/effects/effects.dmi', null, "shock", "pixel_x" = 16)
GLOB.action_blue_power_up.layer = FLY_LAYER
GLOB.action_blue_power_up.plane = ABOVE_HUD_PLANE
GLOB.action_blue_power_up.plane = ABOVE_GAME_PLANE
return GLOB.action_blue_power_up
else if(busy_type == ACTION_PURPLE_POWER_UP)
if(!GLOB.action_purple_power_up)
GLOB.action_purple_power_up = image('icons/effects/effects.dmi', null, "pain", "pixel_x" = 16)
GLOB.action_purple_power_up.layer = FLY_LAYER
GLOB.action_purple_power_up.plane = ABOVE_HUD_PLANE
GLOB.action_purple_power_up.plane = ABOVE_GAME_PLANE
return GLOB.action_purple_power_up


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
Loading

0 comments on commit f756754

Please sign in to comment.