Skip to content

Commit

Permalink
Merge remote-tracking branch 'cmss13-devs/master' into forest/pred/we…
Browse files Browse the repository at this point in the history
…apons_overhaul
  • Loading branch information
realforest2001 committed May 8, 2024
2 parents 79cf5eb + 92655a0 commit 9b96092
Show file tree
Hide file tree
Showing 176 changed files with 4,280 additions and 3,034 deletions.
8 changes: 3 additions & 5 deletions code/__DEFINES/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
#define NOTE_ADMIN 1
///This note is used by staff for positive record keeping.
#define NOTE_MERIT 2
///These notes are used by respective whitelist councils for record keeping.
#define NOTE_COMMANDER 3
#define NOTE_SYNTHETIC 4
#define NOTE_YAUTJA 5
///These notes are automatically applied by the Whitelist Panel.
#define NOTE_WHITELIST 3
///Note categories in text form, in order of their numerical #defines.
GLOBAL_LIST_INIT(note_categories, list("Admin", "Merit", "Commanding Officer", "Synthetic", "Yautja"))
GLOBAL_LIST_INIT(note_categories, list("Admin", "Merit", "Whitelist"))

#define ADMIN_FLW(user) "(<a href='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];adminplayerobservefollow=[REF(user)]'>FLW</a>)"
#define ADMIN_PP(user) "(<a href='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];adminplayeropts=[REF(user)]'>PP</a>)"
Expand Down
4 changes: 3 additions & 1 deletion code/__DEFINES/dcs/signals/atom/signals_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@

#define COMSIG_ITEM_PICKUP "item_pickup"

///from /obj/item/device/camera/broadcasting/attack_self
///from /obj/item/device/camera/broadcasting
#define COMSIG_BROADCAST_GO_LIVE "broadcast_live"
#define COMSIG_BROADCAST_HEAR_TALK "broadcast_hear_talk"
#define COMSIG_BROADCAST_SEE_EMOTE "broadcast_see_emote"

/// from /obj/item/proc/mob_can_equip
#define COMSIG_ITEM_ATTEMPTING_EQUIP "item_attempting_equip"
Expand Down
10 changes: 9 additions & 1 deletion code/__DEFINES/dcs/signals/atom/signals_obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,16 @@
#define COMSIG_TENT_COLLAPSING "tent_collapsing"

/// from /obj/proc/afterbuckle()
#define COSMIG_OBJ_AFTER_BUCKLE "signal_obj_after_buckle"
#define COMSIG_OBJ_AFTER_BUCKLE "signal_obj_after_buckle"

/// from /datum/cm_objective/retrieve_data/disk/process()
#define COMSIG_INTEL_DISK_LOST_POWER "intel_disk_lost_power"

/// from /datum/cm_objective/retrieve_data/disk/complete()
#define COMSIG_INTEL_DISK_COMPLETED "intel_disk_completed"

/// from /obj/vehicle/multitile/arc/toggle_antenna()
#define COMSIG_ARC_ANTENNA_TOGGLED "arc_antenna_toggled"
/// from /obj/structure/machinery/cryopod/go_out()
#define COMSIG_CRYOPOD_GO_OUT "cryopod_go_out"

Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/signals_global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
/// From /proc/biohazard_lockdown()
#define COMSIG_GLOB_RESEARCH_LOCKDOWN "!research_lockdown_closed"
#define COMSIG_GLOB_RESEARCH_LIFT "!research_lockdown_opened"
/// From /proc/aicore_lockdown()
#define COMSIG_GLOB_AICORE_LOCKDOWN "!aicore_lockdown_closed"
#define COMSIG_GLOB_AICORE_LIFT "!aicore_lockdown_opened"

/// From /obj/structure/machinery/power/reactor/proc/set_overloading() : (set_overloading)
#define COMSIG_GLOB_GENERATOR_SET_OVERLOADING "!generator_set_overloading"
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#define USES_HEARING (1<<17)
/// Should we use the initial icon for display? Mostly used by overlay only objects
#define HTML_USE_INITAL_ICON (1<<18)
// Whether or not the object sees emotes
#define USES_SEEING (1<<19)

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

Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ GLOBAL_LIST_INIT(job_command_roles, JOB_COMMAND_ROLES_LIST)

//-------- WY Goons --------//
#define JOB_WY_GOON "WY Corporate Security"
#define JOB_WY_GOON_TECH "WY Corporate Security Technician"
#define JOB_WY_GOON_LEAD "WY Corporate Security Lead"
#define JOB_WY_GOON_RESEARCHER "WY Research Consultant"

Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
#define CANDAZE (1<<18)
#define CANSLOW (1<<19)
#define NO_PERMANENT_DAMAGE (1<<20)
#define CORRUPTED_ALLY (1<<21)

// =============================
// hive types
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/vehicle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define HDPT_TURRET "turret"
#define HDPT_SPECIAL "special" //special pre-installed hardpoints with unique behaviour

#define HDPT_LAYER_WHEELS 1
#define HDPT_LAYER_WHEELS 0.01 // so it appears below xenomorphs and other mobs
#define HDPT_LAYER_SUPPORT 2
#define HDPT_LAYER_ARMOR 3
#define HDPT_LAYER_TURRET 4
Expand Down
3 changes: 2 additions & 1 deletion code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
return FALSE

/atom/movable/attackby(obj/item/W, mob/living/user)
if(W)
. = ..()
if(W && !.)
if(!(W.flags_item & NOBLUDGEON))
visible_message(SPAN_DANGER("[src] has been hit by [user] with [W]."), null, null, 5, CHAT_TYPE_MELEE_HIT)
user.animation_attack_on(src)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ SUBSYSTEM_DEF(ticker)

var/totalPlayers = 0 //used for pregame stats on statpanel
var/totalPlayersReady = 0 //used for pregame stats on statpanel
var/tutorial_disabled = FALSE //zonenote
var/tutorial_disabled = FALSE

/datum/controller/subsystem/ticker/Initialize(timeofday)
load_mode()
Expand Down
14 changes: 14 additions & 0 deletions code/datums/ammo/bullet/arc.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/datum/ammo/bullet/re700
name = "rotary cannon bullet"
icon_state = "autocannon"
damage_falloff = 0
flags_ammo_behavior = AMMO_BALLISTIC

accuracy = HIT_ACCURACY_TIER_7
scatter = 0
damage = 30
damage_var_high = PROJECTILE_VARIANCE_TIER_8
penetration = ARMOR_PENETRATION_TIER_2
accurate_range = 10
max_range = 12
shell_speed = AMMO_SPEED_TIER_6
87 changes: 87 additions & 0 deletions code/datums/components/disk_reader.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/datum/component/disk_reader
dupe_mode = COMPONENT_DUPE_UNIQUE
/// Ref to the inserted disk
var/obj/item/disk/objective/disk

/datum/component/disk_reader/Initialize()
. = ..()
if(!istype(parent, /obj/structure/machinery))
return COMPONENT_INCOMPATIBLE

/datum/component/disk_reader/Destroy(force, silent)
handle_qdel()
return ..()

/datum/component/disk_reader/RegisterWithParent()
..()
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, PROC_REF(on_disk_insert))
RegisterSignal(parent, COMSIG_PARENT_QDELETING, PROC_REF(handle_qdel))
RegisterSignal(parent, COMSIG_INTEL_DISK_COMPLETED, PROC_REF(on_disk_complete))
RegisterSignal(parent, COMSIG_INTEL_DISK_LOST_POWER, PROC_REF(on_power_lost))

/datum/component/disk_reader/UnregisterFromParent()
..()
handle_qdel()

/datum/component/disk_reader/proc/handle_qdel()
SIGNAL_HANDLER
QDEL_NULL(disk)

/datum/component/disk_reader/proc/on_disk_insert(datum/source, obj/item/disk/objective/potential_disk, mob/living/inserter, params)
SIGNAL_HANDLER

if(!istype(potential_disk) || !potential_disk.objective)
return

if(disk)
to_chat(inserter, SPAN_WARNING("There's already a disk inside [parent], wait for it to finish first!"))
return COMPONENT_NO_AFTERATTACK

if(potential_disk.objective.state == OBJECTIVE_COMPLETE)
to_chat(inserter, SPAN_WARNING("The reader displays a message stating this disk has already been read and refuses to accept it."))
return COMPONENT_NO_AFTERATTACK

INVOKE_ASYNC(src, PROC_REF(handle_disk_insert), potential_disk, inserter)
return COMPONENT_NO_AFTERATTACK

/datum/component/disk_reader/proc/handle_disk_insert(obj/item/disk/objective/potential_disk, mob/living/inserter)
if(tgui_input_text(inserter, "Enter the encryption key", "Decrypting [potential_disk]", "") != potential_disk.objective.decryption_password)
to_chat(inserter, SPAN_WARNING("The reader buzzes, ejecting the disk."))
return

if(disk)
to_chat(inserter, SPAN_WARNING("There's already a disk inside [parent], wait for it to finish first!"))
return

if(!(potential_disk in inserter.contents))
return

potential_disk.objective.activate()

inserter.drop_inv_item_to_loc(potential_disk, parent)
disk = potential_disk
to_chat(inserter, SPAN_NOTICE("You insert [potential_disk] and enter the decryption key."))
inserter.count_niche_stat(STATISTICS_NICHE_DISK)

/datum/component/disk_reader/proc/on_disk_complete(datum/source)
SIGNAL_HANDLER
var/atom/atom_parent = parent

atom_parent.visible_message("[atom_parent] pings softly as the upload finishes and ejects [disk].")
playsound(atom_parent, 'sound/machines/screen_output1.ogg', 25, 1)
disk.forceMove(get_turf(atom_parent))
disk.name = "[disk.name] (complete)"
disk.objective.award_points()
disk.retrieve_objective.state = OBJECTIVE_ACTIVE
disk.retrieve_objective.activate()
disk = null

/datum/component/disk_reader/proc/on_power_lost(datum/source)
SIGNAL_HANDLER
var/atom/atom_parent = parent

atom_parent.visible_message(SPAN_WARNING("[atom_parent] powers down mid-operation as the area loses power."))
playsound(atom_parent, 'sound/machines/terminal_shutdown.ogg', 25, 1)
SSobjectives.stop_processing_objective(src)
disk.forceMove(get_turf(atom_parent))
disk = null
22 changes: 11 additions & 11 deletions code/datums/components/weed_food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
parent_buckle = null

/datum/component/weed_food/RegisterWithParent()
RegisterSignal(parent_mob, COMSIG_MOVABLE_MOVED, PROC_REF(on_move))
RegisterSignal(parent_mob, COMSIG_MOVABLE_TURF_ENTERED, PROC_REF(on_move))
RegisterSignal(parent_mob, list(COMSIG_LIVING_REJUVENATED, COMSIG_HUMAN_REVIVED), PROC_REF(on_rejuv))
RegisterSignal(parent_mob, COMSIG_HUMAN_SET_UNDEFIBBABLE, PROC_REF(on_update))
RegisterSignal(parent_mob, COMSIG_LIVING_PREIGNITION, PROC_REF(on_preignition))
Expand All @@ -98,7 +98,7 @@
/datum/component/weed_food/UnregisterFromParent()
if(parent_mob)
UnregisterSignal(parent_mob, list(
COMSIG_MOVABLE_MOVED,
COMSIG_MOVABLE_TURF_ENTERED,
COMSIG_LIVING_REJUVENATED,
COMSIG_HUMAN_REVIVED,
COMSIG_HUMAN_SET_UNDEFIBBABLE,
Expand All @@ -109,12 +109,12 @@
if(parent_turf)
UnregisterSignal(parent_turf, COMSIG_WEEDNODE_GROWTH)
if(parent_buckle)
UnregisterSignal(parent_buckle, COSMIG_OBJ_AFTER_BUCKLE)
UnregisterSignal(parent_buckle, COMSIG_OBJ_AFTER_BUCKLE)
if(parent_nest)
UnregisterSignal(parent_nest, COMSIG_PARENT_QDELETING)
UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING)

/// SIGNAL_HANDLER for COMSIG_MOVABLE_MOVED
/// SIGNAL_HANDLER for COMSIG_MOVABLE_TURF_ENTERED
/datum/component/weed_food/proc/on_move()
SIGNAL_HANDLER

Expand Down Expand Up @@ -148,7 +148,7 @@

qdel(src)

/// SIGNAL_HANDLER for COSMIG_OBJ_AFTER_BUCKLE
/// SIGNAL_HANDLER for COMSIG_OBJ_AFTER_BUCKLE
/datum/component/weed_food/proc/on_after_buckle(obj/source, mob/buckled)
SIGNAL_HANDLER

Expand Down Expand Up @@ -220,12 +220,12 @@
return FALSE // Still buckled to the same thing
if(!istype(parent_mob.buckled, /obj/structure/bed/nest))
if(parent_buckle) // Still have a lingering reference somehow?
UnregisterSignal(parent_buckle, COSMIG_OBJ_AFTER_BUCKLE)
UnregisterSignal(parent_buckle, COMSIG_OBJ_AFTER_BUCKLE)
parent_buckle = parent_mob.buckled
RegisterSignal(parent_mob.buckled, COSMIG_OBJ_AFTER_BUCKLE, PROC_REF(on_after_buckle))
RegisterSignal(parent_mob.buckled, COMSIG_OBJ_AFTER_BUCKLE, PROC_REF(on_after_buckle))
return FALSE
if(parent_buckle)
UnregisterSignal(parent_buckle, COSMIG_OBJ_AFTER_BUCKLE)
UnregisterSignal(parent_buckle, COMSIG_OBJ_AFTER_BUCKLE)
parent_buckle = null

if(parent_mob.is_xeno_grabbable())
Expand Down Expand Up @@ -282,16 +282,16 @@
return FALSE // Still buckled to the same thing somehow?
if(!istype(parent_mob.buckled, /obj/structure/bed/nest))
if(parent_buckle) // Still have a lingering reference somehow?
UnregisterSignal(parent_buckle, COSMIG_OBJ_AFTER_BUCKLE)
UnregisterSignal(parent_buckle, COMSIG_OBJ_AFTER_BUCKLE)
parent_buckle = parent_mob.buckled
RegisterSignal(parent_mob.buckled, COSMIG_OBJ_AFTER_BUCKLE, PROC_REF(on_after_buckle))
RegisterSignal(parent_mob.buckled, COMSIG_OBJ_AFTER_BUCKLE, PROC_REF(on_after_buckle))
return FALSE
else
parent_nest = parent_mob.buckled
RegisterSignal(parent_nest, COMSIG_PARENT_QDELETING, PROC_REF(on_nest_deletion))

if(parent_buckle)
UnregisterSignal(parent_buckle, COSMIG_OBJ_AFTER_BUCKLE)
UnregisterSignal(parent_buckle, COMSIG_OBJ_AFTER_BUCKLE)
parent_buckle = null

if(SEND_SIGNAL(parent_mob, COMSIG_ATTEMPT_MOB_PULL) & COMPONENT_CANCEL_MOB_PULL)
Expand Down
4 changes: 4 additions & 0 deletions code/datums/effects/neurotoxin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
return FALSE
if(affected_mob.stat == DEAD)
return

if(issynth(affected_atom))
return

// General effects
affected_mob.last_damage_data = cause_data
affected_mob.apply_stamina_damage(stam_dam)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/bullet_trait/iff.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
// The cache is reset when the user drops their ID
/datum/element/bullet_trait_iff/proc/get_user_iff_group(mob/living/carbon/human/user)
if(!ishuman(user))
return user.faction_group
return user?.faction_group

var/iff_group = LAZYACCESS(iff_group_cache, user)
if(isnull(iff_group))
Expand Down
10 changes: 10 additions & 0 deletions code/datums/emotes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
var/paygrade = user.get_paygrade()
var/formatted_message = "<b>[paygrade][user]</b> [msg]"
var/user_turf = get_turf(user)
var/list/seeing_obj = list()
if (user.client)
for(var/mob/ghost as anything in GLOB.dead_mob_list)
if(!ghost.client || isnewplayer(ghost))
Expand All @@ -132,19 +133,28 @@
if(emote_type & EMOTE_VISIBLE)
var/list/viewers = get_mobs_in_view(7, user)
for(var/mob/current_mob in viewers)
for(var/obj/object in current_mob.contents)
if((object.flags_atom & USES_SEEING))
seeing_obj |= object
if(!(current_mob.client?.prefs.toggles_langchat & LANGCHAT_SEE_EMOTES))
viewers -= current_mob
run_langchat(user, viewers)
else if(emote_type & EMOTE_AUDIBLE)
var/list/heard = get_mobs_in_view(7, user)
for(var/mob/current_mob in heard)
for(var/obj/object in current_mob.contents)
if((object.flags_atom & USES_HEARING))
seeing_obj |= object
if(current_mob.ear_deaf)
heard -= current_mob
continue
if(!(current_mob.client?.prefs.toggles_langchat & LANGCHAT_SEE_EMOTES))
heard -= current_mob
run_langchat(user, heard)

for(var/obj/object as anything in seeing_obj)
object.see_emote(user, msg, (emote_type & EMOTE_AUDIBLE))

SEND_SIGNAL(user, COMSIG_MOB_EMOTED(key))


Expand Down
19 changes: 12 additions & 7 deletions code/datums/entities/player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ BSQL_PROTECT_DATUM(/datum/entity/player)
/datum/entity/player/proc/add_note(note_text, is_confidential, note_category = NOTE_ADMIN, is_ban = FALSE, duration = null)
var/client/admin = usr.client
// do all checks here, especially for sensitive stuff like this
if(!admin || !admin.player_data)
return FALSE
if(note_category == NOTE_ADMIN || is_confidential)
if (!AHOLD_IS_MOD(admin.admin_holder))
if(!(note_category == NOTE_WHITELIST))
if(!admin || !admin.player_data)
return FALSE
if(note_category == NOTE_ADMIN || is_confidential)
if (!AHOLD_IS_MOD(admin.admin_holder))
return FALSE

// this is here for a short transition period when we still are testing DB notes and constantly deleting the file
if(CONFIG_GET(flag/duplicate_notes_to_file))
Expand All @@ -119,7 +120,7 @@ BSQL_PROTECT_DATUM(/datum/entity/player)
note.note_category = note_category
note.is_ban = is_ban
note.ban_time = duration
note.admin_rank = admin.admin_holder.rank
note.admin_rank = admin.admin_holder ? admin.admin_holder.rank : "Non-Staff"
// since admin is in game, their player_data has to be populated. This is also checked above
note.admin_id = admin.player_data.id
note.admin = admin.player_data
Expand All @@ -134,13 +135,17 @@ BSQL_PROTECT_DATUM(/datum/entity/player)
notes.Add(note)
return TRUE

/datum/entity/player/proc/remove_note(note_id)
/datum/entity/player/proc/remove_note(note_id, whitelist = FALSE)
if(IsAdminAdvancedProcCall())
return PROC_BLOCKED
var/client/admin = usr.client
// do all checks here, especially for sensitive stuff like this
if(!admin || !admin.player_data)
return FALSE

if (!AHOLD_IS_MOD(admin.admin_holder))
if((!AHOLD_IS_MOD(admin.admin_holder)) && !whitelist)
return FALSE
if(whitelist && !(isSenator(admin) || CLIENT_HAS_RIGHTS(admin, R_PERMISSIONS)))
return FALSE

// this is here for a short transition period when we still are testing DB notes and constantly deleting the file
Expand Down
Loading

0 comments on commit 9b96092

Please sign in to comment.