Skip to content

Commit

Permalink
Merge remote-tracking branch 'cmss13-devs/master' into project/ares/l…
Browse files Browse the repository at this point in the history
…ogging_changes
  • Loading branch information
realforest2001 committed Aug 24, 2023
2 parents d264e65 + 4a04528 commit 9a5fa2a
Show file tree
Hide file tree
Showing 43 changed files with 461 additions and 285 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

// Nutrition levels
#define NUTRITION_MAX 550
#define NUTRITION_HIGH 540
#define NUTRITION_NORMAL 400
#define NUTRITION_LOW 250
#define NUTRITION_VERYLOW 50
Expand Down
4 changes: 3 additions & 1 deletion code/__DEFINES/conflict.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
#define GUN_ANTIQUE (1<<13)
/// Whether the gun has been fired by its current user (reset upon `dropped()`)
#define GUN_RECOIL_BUILDUP (1<<14)
/// support weapon, bipod will grant IFF
/// support weapon, bipod will grant autofire
#define GUN_SUPPORT_PLATFORM (1<<15)
/// No gun description, only base desc
#define GUN_NO_DESCRIPTION (1<<16)
Expand Down Expand Up @@ -99,6 +99,8 @@
#define AMMUNITION_HANDFUL_BOX (1<<2)
#define AMMUNITION_HIDE_AMMO (1<<3)
#define AMMUNITION_CANNOT_REMOVE_BULLETS (1<<4)
/// If this magazine can transfer to other magazines of the same type by slapping one with the other
#define AMMUNITION_SLAP_TRANSFER (1<<5)
//Slowdown from various armors.

/// How much shoes slow you down by default. Negative values speed you up
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@
#define COMSIG_GUN_AUTOFIREDELAY_MODIFIED "gun_autofiredelay_modified"
#define COMSIG_GUN_BURST_SHOTS_TO_FIRE_MODIFIED "gun_burst_shots_to_fire_modified"
#define COMSIG_GUN_BURST_SHOT_DELAY_MODIFIED "gun_burst_shot_delay_modified"

/// from /obj/item/weapon/gun/proc/recalculate_attachment_bonuses() : ()
#define COMSIG_GUN_RECALCULATE_ATTACHMENT_BONUSES "gun_recalculate_attachment_bonuses"

/// from /obj/item/weapon/gun/proc/load_into_chamber() : ()
#define COMSIG_GUN_INTERRUPT_FIRE "gun_interrupt_fire"
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/signals_global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@

/// From
#define COMSIG_GLOB_YAUTJA_ARMORY_OPENED "yautja_armory_opened"

/// From /proc/biohazard_lockdown()
#define COMSIG_GLOB_RESEARCH_LOCKDOWN "research_lockdown_closed"
#define COMSIG_GLOB_RESEARCH_LIFT "research_lockdown_opened"
2 changes: 1 addition & 1 deletion code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
#define SS_INIT_INPUT 85
#define SS_INIT_FAIL_TO_TOPIC 84
#define SS_INIT_TOPIC 83
#define SS_INIT_LOBBYART 82
#define SS_INIT_RUST 30
#define SS_INIT_INFLUXDRIVER 28
#define SS_INIT_SUPPLY_SHUTTLE 25
Expand Down Expand Up @@ -162,7 +163,6 @@
#define SS_INIT_PLAYTIME -29
#define SS_INIT_PREDSHIPS -30
#define SS_INIT_OBJECTIVES -31
#define SS_INIT_LOBBYART -33
#define SS_INIT_MINIMAP -34
#define SS_INIT_STATPANELS -98
#define SS_INIT_CHAT -100 //Should be last to ensure chat remains smooth during init.
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ DEFINE_BITFIELD(flags_magazine, list(
"AMMUNITION_HANDFUL_BOX" = AMMUNITION_HANDFUL_BOX,
"AMMUNITION_HIDE_AMMO" = AMMUNITION_HIDE_AMMO,
"AMMUNITION_CANNOT_REMOVE_BULLETS" = AMMUNITION_CANNOT_REMOVE_BULLETS,
"AMMUNITION_SLAP_TRANSFER" = AMMUNITION_SLAP_TRANSFER,
))

DEFINE_BITFIELD(flags_atom, list(
Expand Down
9 changes: 7 additions & 2 deletions code/datums/components/autofire/autofire.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
var/have_to_reset_at_burst_end = FALSE
///If we are in a burst
var/bursting = FALSE
/// The multiplier for how much slower the parent should fire in automatic mode. 1 is normal, 1.2 is 20% slower, 2 is 100% slower, etc.
var/automatic_delay_mult = 1
///Callback to set bursting mode on the parent
var/datum/callback/callback_bursting
///Callback to ask the parent to reset its firing vars
Expand All @@ -26,7 +28,7 @@
///Callback to set parent's fa_firing
var/datum/callback/callback_set_firing

/datum/component/automatedfire/autofire/Initialize(auto_fire_shot_delay = 0.3 SECONDS, burstfire_shot_delay, burst_shots_to_fire = 3, fire_mode = GUN_FIREMODE_SEMIAUTO, datum/callback/callback_bursting, datum/callback/callback_reset_fire, datum/callback/callback_fire, datum/callback/callback_display_ammo, datum/callback/callback_set_firing)
/datum/component/automatedfire/autofire/Initialize(auto_fire_shot_delay = 0.3 SECONDS, burstfire_shot_delay, burst_shots_to_fire = 3, fire_mode = GUN_FIREMODE_SEMIAUTO, automatic_delay_mult = 1, datum/callback/callback_bursting, datum/callback/callback_reset_fire, datum/callback/callback_fire, datum/callback/callback_display_ammo, datum/callback/callback_set_firing)
. = ..()

RegisterSignal(parent, COMSIG_GUN_FIRE_MODE_TOGGLE, PROC_REF(modify_fire_mode))
Expand All @@ -35,11 +37,13 @@
RegisterSignal(parent, COMSIG_GUN_BURST_SHOT_DELAY_MODIFIED, PROC_REF(modify_burstfire_shot_delay))
RegisterSignal(parent, COMSIG_GUN_FIRE, PROC_REF(initiate_shot))
RegisterSignal(parent, COMSIG_GUN_STOP_FIRE, PROC_REF(stop_firing))
RegisterSignal(parent, COMSIG_GUN_INTERRUPT_FIRE, PROC_REF(hard_reset))

src.auto_fire_shot_delay = auto_fire_shot_delay
src.burstfire_shot_delay = burstfire_shot_delay
src.burst_shots_to_fire = burst_shots_to_fire
src.fire_mode = fire_mode
src.automatic_delay_mult = automatic_delay_mult
src.callback_bursting = callback_bursting
src.callback_reset_fire = callback_reset_fire
src.callback_fire = callback_fire
Expand Down Expand Up @@ -96,6 +100,7 @@

///Hard reset the autofire, happens when the shooter fall/is thrown, at the end of a burst or when it runs out of ammunition
/datum/component/automatedfire/autofire/proc/hard_reset()
SIGNAL_HANDLER
callback_reset_fire.Invoke() //resets the gun
shots_fired = 0
have_to_reset_at_burst_end = FALSE
Expand Down Expand Up @@ -131,7 +136,7 @@
next_fire = world.time + burstfire_shot_delay
if(GUN_FIREMODE_AUTOMATIC)
callback_set_firing.Invoke(TRUE)
next_fire = world.time + auto_fire_shot_delay
next_fire = world.time + (auto_fire_shot_delay * automatic_delay_mult)
if(GUN_FIREMODE_SEMIAUTO)
return
schedule_shot()
10 changes: 0 additions & 10 deletions code/datums/supply_packs/ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,6 @@
containername = "\improper M39 AP magazines crate"
group = "Ammo"

/datum/supply_packs/ammo_smg_mag_box_ext
name = "Magazine box (M39, 10x extended mags)"
contains = list(
/obj/item/ammo_box/magazine/m39/ext,
)
cost = 30
containertype = /obj/structure/closet/crate/ammo
containername = "\improper M39 extended magazines crate"
group = "Ammo"

//------------------------For M4RA----------------

/datum/supply_packs/ammo_m4ra_mag_box
Expand Down
7 changes: 3 additions & 4 deletions code/datums/supply_packs/black_market.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,9 @@ Non-USCM items, from CLF, UPP, colonies, etc. Mostly combat-related.
new /obj/item/ammo_magazine/rifle/mar40/extended(src)
new /obj/item/ammo_magazine/rifle/mar40(src)
else
new /obj/item/weapon/gun/rifle/m41aMK1/tactical(src)
new /obj/item/ammo_magazine/rifle/m41aMK1/ap(src)
new /obj/item/ammo_magazine/rifle/m41aMK1(src)
new /obj/item/ammo_magazine/rifle/m41aMK1(src)
new /obj/item/weapon/gun/rifle/mar40/lmg(src)
new /obj/item/ammo_magazine/rifle/mar40/lmg(src)
new /obj/item/ammo_magazine/rifle/mar40/lmg(src)

/* Misc. Individual Guns */

Expand Down
109 changes: 109 additions & 0 deletions code/game/machinery/biohazard_lockdown.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#define LOCKDOWN_READY 0
#define LOCKDOWN_ACTIVE 1
GLOBAL_VAR_INIT(lockdown_state, LOCKDOWN_READY)

/obj/structure/machinery/biohazard_lockdown
name = "Emergency Containment Breach"
icon_state = "big_red_button_tablev"
unslashable = TRUE
unacidable = TRUE
COOLDOWN_DECLARE(containment_lockdown)

/obj/structure/machinery/biohazard_lockdown/ex_act(severity)
return FALSE

/obj/structure/machinery/biohazard_lockdown/attack_remote(mob/user as mob)
return FALSE

/obj/structure/machinery/biohazard_lockdown/attack_alien(mob/user as mob)
return FALSE

/obj/structure/machinery/biohazard_lockdown/attackby(obj/item/attacking_item, mob/user)
return attack_hand(user)

/obj/structure/machinery/biohazard_lockdown/attack_hand(mob/living/user)
if(isxeno(user))
return FALSE
if(!allowed(user))
to_chat(user, SPAN_DANGER("Access Denied"))
flick(initial(icon_state) + "-denied", src)
return FALSE

if(!COOLDOWN_FINISHED(src, containment_lockdown))
to_chat(user, SPAN_BOLDWARNING("Biohazard Lockdown procedures are on cooldown! They will be ready in [COOLDOWN_SECONDSLEFT(src, containment_lockdown)] seconds!"))
return FALSE

add_fingerprint(user)
biohazard_lockdown(user)
COOLDOWN_START(src, containment_lockdown, 5 MINUTES)

/obj/structure/machinery/door/poddoor/almayer/biohazard
name = "Biohazard Containment Airlock"
density = FALSE

/obj/structure/machinery/door/poddoor/almayer/biohazard/Initialize()
. = ..()
RegisterSignal(SSdcs, COMSIG_GLOB_RESEARCH_LOCKDOWN, PROC_REF(close))
RegisterSignal(SSdcs, COMSIG_GLOB_RESEARCH_LIFT, PROC_REF(open))

/obj/structure/machinery/door/poddoor/almayer/biohazard/white
icon_state = "w_almayer_pdoor1"
base_icon_state = "w_almayer_pdoor"

/client/proc/admin_biohazard_alert()
set name = "Containment Breach Alert"
set category = "Admin.Ship"

if(!admin_holder ||!check_rights(R_EVENT))
return FALSE

var/prompt = tgui_alert(src, "Are you sure you want to trigger a containment breach alert? This will force red alert, and lockdown research.", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt != "Yes")
return FALSE

prompt = tgui_alert(src, "Do you want to use a custom announcement?", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt == "Yes")
var/whattoannounce = tgui_input_text(src, "Please enter announcement text.", "what?")
biohazard_lockdown(usr, whattoannounce, TRUE)
else
biohazard_lockdown(usr, admin = TRUE)
return TRUE

/proc/biohazard_lockdown(mob/user, message, admin = FALSE)
if(IsAdminAdvancedProcCall())
return PROC_BLOCKED

var/log = "[key_name(user)] triggered research bio lockdown!"
var/ares_log = "[user.name] triggered Medical Research Biohazard Containment Lockdown."
if(!message)
message = "ATTENTION! \n\nBIOHAZARD CONTAINMENT BREACH. \n\nRESEARCH DEPARTMENT UNDER LOCKDOWN."
else
log = "[key_name(user)] triggered research bio lockdown! (Using a custom announcement)."
if(admin)
log += " (Admin Triggered)."
ares_log = "[MAIN_AI_SYSTEM] triggered Medical Research Biohazard Containment Lockdown."

switch(GLOB.lockdown_state)
if(LOCKDOWN_READY)
GLOB.lockdown_state = LOCKDOWN_ACTIVE
set_security_level(SEC_LEVEL_RED, TRUE, FALSE)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_RESEARCH_LOCKDOWN)
if(LOCKDOWN_ACTIVE)
GLOB.lockdown_state = LOCKDOWN_READY
message = "ATTENTION! \n\nBIOHAZARD CONTAINMENT LOCKDOWN LIFTED."
log = "[key_name(user)] lifted research bio lockdown!"
ares_log = "[user.name] lifted Medical Research Biohazard Containment Lockdown."
if(admin)
log += " (Admin Triggered)."
ares_log = "[MAIN_AI_SYSTEM] lifted Medical Research Biohazard Containment Lockdown."

set_security_level(SEC_LEVEL_BLUE, TRUE, FALSE)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_RESEARCH_LIFT)

shipwide_ai_announcement(message, MAIN_AI_SYSTEM, 'sound/effects/biohazard.ogg')
message_admins(log)
var/datum/ares_link/link = GLOB.ares_link
link.log_ares_security("Containment Lockdown", ares_log)

#undef LOCKDOWN_READY
#undef LOCKDOWN_ACTIVE
2 changes: 2 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ cases. Override_icon_state should be a list.*/
UnregisterSignal(src, list(
COMSIG_ITEM_DROPPED,
COMSIG_ITEM_UNWIELD,
COMSIG_PARENT_QDELETING,
))
UnregisterSignal(user, COMSIG_MOB_MOVE_OR_LOOK)
//General reset in case anything goes wrong, the view will always reset to default unless zooming in.
Expand Down Expand Up @@ -861,6 +862,7 @@ cases. Override_icon_state should be a list.*/
RegisterSignal(src, list(
COMSIG_ITEM_DROPPED,
COMSIG_ITEM_UNWIELD,
COMSIG_PARENT_QDELETING,
), PROC_REF(unzoom_dropped_callback))
RegisterSignal(user, COMSIG_MOB_MOVE_OR_LOOK, PROC_REF(zoom_handle_mob_move_or_look))

Expand Down
16 changes: 8 additions & 8 deletions code/game/objects/items/reagent_containers/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
if(istype(M, /mob/living/carbon))
var/mob/living/carbon/C = M
var/fullness = M.nutrition + (M.reagents.get_reagent_amount("nutriment") * 25)
if(fullness > 540 && world.time < C.overeat_cooldown)
if(fullness > NUTRITION_HIGH && world.time < C.overeat_cooldown)
to_chat(user, SPAN_WARNING("[user == M ? "You" : "They"] don't feel like eating more right now."))
return
if(issynth(C))
Expand All @@ -70,22 +70,22 @@
to_chat(user, SPAN_DANGER("[user == M ? "You are" : "[M] is"] unable to eat!"))
return

if(fullness > 540)
if(fullness > NUTRITION_HIGH)
C.overeat_cooldown = world.time + OVEREAT_TIME

if(M == user)//If you're eating it yourself
if (fullness <= 50)
if (fullness <= NUTRITION_VERYLOW)
to_chat(M, SPAN_WARNING("You hungrily chew out a piece of [src] and gobble it!"))
if (fullness > 50 && fullness <= 150)
if (fullness > NUTRITION_VERYLOW && fullness <= NUTRITION_LOW)
to_chat(M, SPAN_NOTICE(" You hungrily begin to eat [src]."))
if (fullness > 150 && fullness <= 350)
if (fullness > NUTRITION_LOW && fullness <= NUTRITION_NORMAL)
to_chat(M, SPAN_NOTICE(" You take a bite of [src]."))
if (fullness > 350 && fullness <= 540)
if (fullness > NUTRITION_NORMAL && fullness <= NUTRITION_HIGH)
to_chat(M, SPAN_NOTICE(" You unwillingly chew a bit of [src]."))
if (fullness > 540)
if (fullness > NUTRITION_HIGH)
to_chat(M, SPAN_WARNING("You reluctantly force more of [src] to go down your throat."))
else
if (fullness <= 540)
if (fullness <= NUTRITION_HIGH)
user.affected_message(M,
SPAN_HELPFUL("You <b>start feeding</b> [user == M ? "yourself" : "[M]"] <b>[src]</b>."),
SPAN_HELPFUL("[user] <b>starts feeding</b> you <b>[src]</b>."),
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/tools/kitchen_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
return ..()

if (reagents.total_volume > 0)
var/fullness = M.nutrition + (M.reagents.get_reagent_amount("nutriment") * 25)
if(fullness > NUTRITION_HIGH)
to_chat(user, SPAN_WARNING("[user == M ? "You" : "They"] don't feel like eating more right now."))
return ..()
reagents.set_source_mob(user)
reagents.trans_to_ingest(M, reagents.total_volume)
if(M == user)
Expand Down
2 changes: 2 additions & 0 deletions code/game/turfs/walls/wall_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@
icon_state = "fakewindows"
opacity = FALSE

INITIALIZE_IMMEDIATE(/turf/closed/wall/indestructible/splashscreen)

/turf/closed/wall/indestructible/splashscreen
name = "Lobby Art"
desc = "Assorted artworks."
Expand Down
3 changes: 2 additions & 1 deletion code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ var/list/admin_verbs_minor_event = list(
/client/proc/toggle_shipside_sd,
/client/proc/shakeshipverb,
/client/proc/adminpanelweapons,
/client/proc/adminpanelgq,
/client/proc/admin_general_quarters,
/client/proc/admin_biohazard_alert,
/client/proc/toggle_hardcore_perma
)

Expand Down
36 changes: 19 additions & 17 deletions code/modules/admin/verbs/adminpanelgq.dm
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
/client/proc/adminpanelgq()
/client/proc/admin_general_quarters()
set name = "Call General Quarters"
set category = "Admin.Ship"

if(security_level == SEC_LEVEL_RED || security_level == SEC_LEVEL_DELTA)
tgui_alert(src, "Security is already red or above, General Quarters cannot be called.", "Acknowledge!", list("ok."), 10 SECONDS)
else
var/whattoannounce = "ATTENTION! GENERAL QUARTERS. ALL HANDS, MAN YOUR BATTLESTATIONS."
var/prompt = tgui_alert(src, "Do you want to leave the announcement as the default one?", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt == "No")
whattoannounce = tgui_input_text(src, "Please enter announcement text.", "what?")
prompt = tgui_alert(src, "Are you sure you want to send General Quarters? This will force red alert.", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt == "Yes")
set_security_level(2, no_sound=1, announce=0)
shipwide_ai_announcement(whattoannounce, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg')
message_admins("[key_name_admin(src)] Sent General Quarters with a custom announcement!")
else
prompt = tgui_alert(src, "Are you sure you want to send General Quarters? This will force red alert.", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt == "Yes")
set_security_level(2, no_sound=1, announce=0)
shipwide_ai_announcement(whattoannounce, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg')
message_admins("[key_name_admin(src)] Sent General Quarters!")
return FALSE

var/prompt = tgui_alert(src, "Are you sure you want to send General Quarters? This will force red alert.", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt != "Yes")
return FALSE

var/whattoannounce = "ATTENTION! GENERAL QUARTERS. ALL HANDS, MAN YOUR BATTLESTATIONS."
var/log = "[key_name_admin(src)] Sent General Quarters!"

prompt = tgui_alert(src, "Do you want to use a custom announcement?", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt == "Yes")
whattoannounce = tgui_input_text(src, "Please enter announcement text.", "what?")
log = "[key_name_admin(src)] Sent General Quarters! (Using a custom announcement)"

set_security_level(SEC_LEVEL_RED, TRUE, FALSE)
shipwide_ai_announcement(whattoannounce, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg')
message_admins(log)
return TRUE
4 changes: 2 additions & 2 deletions code/modules/clothing/shoes/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
max_heat_protection_temperature = SHOE_MAX_HEAT_PROT

/obj/item/clothing/shoes/souto
name = "\improper Souto Man's boots. Harder than the kick of Souto Red."
desc = "Souto Man boots"
name = "Souto Man boots"
desc = "\improper Souto Man's boots. Harder than the kick of Souto Red"
icon_state = "souto_man"
item_state = "souto_man"
flags_inventory = CANTSTRIP|NOSLIPPING
Expand Down
Loading

0 comments on commit 9a5fa2a

Please sign in to comment.