Skip to content

Commit

Permalink
Merge branch 'master' into brigareaupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsVyzo authored Feb 24, 2024
2 parents 36a7ad5 + 65ee67b commit ae8f046
Show file tree
Hide file tree
Showing 50 changed files with 3,436 additions and 2,795 deletions.
8 changes: 6 additions & 2 deletions code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@
#define COMSIG_MOB_PRE_CLICK "mob_pre_click"
#define COMPONENT_INTERRUPT_CLICK (1<<0)

///from base of /mob/Login(): ()
/// From base of /mob/Login(), called when a client logs into this mob: ()
/// Not to be confused with [COMSIG_MOB_LOGGED_IN]
#define COMSIG_MOB_LOGIN "mob_login"
///from base of /mob/Logout(): ()
/// From base of /mob/Login(), called after a client logs into this mob: ()
/// Not to be confused with [COMSIG_MOB_LOGIN]
#define COMSIG_MOB_LOGGED_IN "mob_logged_in"
/// From base of /mob/Logout(): ()
#define COMSIG_MOB_LOGOUT "mob_logout"

/// From /mob/proc/change_real_name(): (old_name, new_name)
Expand Down
4 changes: 2 additions & 2 deletions code/__DEFINES/dcs/signals/signals_client.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
/// Called after one or more verbs are added: (list of verbs added)
#define COMSIG_CLIENT_VERB_REMOVED "client_verb_removed"

/// Called after a client logs into a mob: (mob)
#define COMSIG_CLIENT_MOB_LOGIN "client_mob_changed"
/// Called from /mob/Login() after a client logs into a mob: (mob)
#define COMSIG_CLIENT_MOB_LOGGED_IN "client_mob_logged_in"

/// Called when something is added to a client's screen : /client/proc/add_to_screen(screen_add)
#define COMSIG_CLIENT_SCREEN_ADD "client_screen_add"
Expand Down
6 changes: 4 additions & 2 deletions code/__DEFINES/dcs/signals/signals_global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@

#define COMSIG_GLOB_REMOVE_VOTE_BUTTON "!remove_vote_button"

#define COMSIG_GLOB_CLIENT_LOGIN "!client_login"
/// Called from /client/New() when a client logs in to the game: (client)
#define COMSIG_GLOB_CLIENT_LOGGED_IN "!client_logged_in"

#define COMSIG_GLOB_MOB_LOGIN "!mob_login"
/// Called from /mob/Login() when a client logs into a mob: (mob)
#define COMSIG_GLOB_MOB_LOGGED_IN "!mob_logged_in"

///from /datum/controller/subsystem/ticker/PostSetup
#define COMSIG_GLOB_POST_SETUP "!post_setup"
Expand Down
7 changes: 5 additions & 2 deletions code/controllers/configuration/config_entry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#define KEY_MODE_TEXT 0
#define KEY_MODE_TYPE 1
#define KEY_MODE_TEXT_UNALTERED 2

/datum/config_entry
var/name //read-only, this is determined by the last portion of the derived entry type
Expand Down Expand Up @@ -153,15 +154,17 @@
var/key_value = null

if(key_pos || value_mode == VALUE_MODE_FLAG)
key_name = lowertext(copytext(str_val, 1, key_pos))
key_name = copytext(str_val, 1, key_pos)
if(key_mode != KEY_MODE_TEXT_UNALTERED)
key_name = lowertext(key_name)
if(key_pos)
key_value = copytext(str_val, key_pos + length(str_val[key_pos]))
var/new_key
var/new_value
var/continue_check_value
var/continue_check_key
switch(key_mode)
if(KEY_MODE_TEXT)
if(KEY_MODE_TEXT, KEY_MODE_TEXT_UNALTERED)
new_key = key_name
continue_check_key = new_key
if(KEY_MODE_TYPE)
Expand Down
11 changes: 11 additions & 0 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -629,3 +629,14 @@ This maintains a list of ip addresses that are able to bypass topic filtering.
/datum/config_entry/flag/guest_ban

/datum/config_entry/flag/auto_profile

/// Relay Ping Browser configuration
/datum/config_entry/keyed_list/connection_relay_ping
splitter = "|"
key_mode = KEY_MODE_TEXT_UNALTERED
value_mode = VALUE_MODE_TEXT

/datum/config_entry/keyed_list/connection_relay_con
splitter = "|"
key_mode = KEY_MODE_TEXT_UNALTERED
value_mode = VALUE_MODE_TEXT
2 changes: 1 addition & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ SUBSYSTEM_DEF(ticker)
CHECK_TICK
mode.announce()
if(mode.taskbar_icon)
RegisterSignal(SSdcs, COMSIG_GLOB_CLIENT_LOGIN, PROC_REF(handle_mode_icon))
RegisterSignal(SSdcs, COMSIG_GLOB_CLIENT_LOGGED_IN, PROC_REF(handle_mode_icon))
set_clients_taskbar_icon(mode.taskbar_icon)

if(GLOB.perf_flags & PERF_TOGGLE_LAZYSS)
Expand Down
4 changes: 2 additions & 2 deletions code/controllers/subsystem/vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ SUBSYSTEM_DEF(vote)
voting.Cut()
remove_action_buttons()

UnregisterSignal(SSdcs, COMSIG_GLOB_CLIENT_LOGIN)
UnregisterSignal(SSdcs, COMSIG_GLOB_CLIENT_LOGGED_IN)

for(var/c in GLOB.player_list)
update_static_data(c)
Expand Down Expand Up @@ -373,7 +373,7 @@ SUBSYSTEM_DEF(vote)
if(send_clients_vote)
C.mob.vote()

RegisterSignal(SSdcs, COMSIG_GLOB_CLIENT_LOGIN, PROC_REF(handle_client_joining))
RegisterSignal(SSdcs, COMSIG_GLOB_CLIENT_LOGGED_IN, PROC_REF(handle_client_joining))
SStgui.update_uis(src)
return TRUE
return FALSE
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/devices/radio/headset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
), PROC_REF(turn_on))
wearer = user
RegisterSignal(user, COMSIG_MOB_STAT_SET_ALIVE, PROC_REF(update_minimap_icon))
RegisterSignal(user, COMSIG_MOB_LOGIN, PROC_REF(add_hud_tracker))
RegisterSignal(user, COMSIG_MOB_LOGGED_IN, PROC_REF(add_hud_tracker))
RegisterSignal(user, COMSIG_MOB_DEATH, PROC_REF(update_minimap_icon))
RegisterSignal(user, COMSIG_HUMAN_SET_UNDEFIBBABLE, PROC_REF(update_minimap_icon))
if(headset_hud_on)
Expand All @@ -250,7 +250,7 @@
UnregisterSignal(user, list(
COMSIG_LIVING_REJUVENATED,
COMSIG_HUMAN_REVIVED,
COMSIG_MOB_LOGIN,
COMSIG_MOB_LOGGED_IN,
COMSIG_MOB_DEATH,
COMSIG_HUMAN_SET_UNDEFIBBABLE,
COMSIG_MOB_STAT_SET_ALIVE
Expand Down
33 changes: 24 additions & 9 deletions code/game/objects/structures/barricade/barricade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,8 @@
if(50 to 75) damage_state = BARRICADE_DMG_SLIGHT
if(75 to INFINITY) damage_state = BARRICADE_DMG_NONE

/obj/structure/barricade/proc/weld_cade(obj/item/tool/weldingtool/welder, mob/user)
if(!metallic)
user.visible_message(SPAN_WARNING("You can't weld \the [src]!"))
/obj/structure/barricade/proc/try_weld_cade(obj/item/tool/weldingtool/welder, mob/user, repeat = TRUE, skip_check = FALSE)
if(!skip_check && !can_weld(welder, user))
return FALSE

if(!(welder.remove_fuel(2, user)))
Expand All @@ -387,6 +386,14 @@
user.count_niche_stat(STATISTICS_NICHE_REPAIR_CADES)
update_health(-200)
playsound(src.loc, 'sound/items/Welder2.ogg', 25, TRUE)

welder = user.get_active_hand()
if(repeat && can_weld(welder, user, silent = TRUE))
// Assumption: The implementation of can_weld will return false if fully repaired
if(!try_weld_cade(welder, user, repeat = TRUE, skip_check = TRUE))
// If this returned false, then we were interrupted or ran out of fuel, so stop looping
return TRUE

return TRUE

/obj/structure/barricade/verb/count_rotate()
Expand Down Expand Up @@ -476,20 +483,28 @@
nailgun.load_into_chamber()
return TRUE

// This proc is to check a bunch of condition to cancel the action that a welder user is trying to do while giving
// a explanation on why...
/obj/structure/barricade/proc/can_weld(obj/item/item, mob/user, silent)
if(user.action_busy)
return FALSE

if(!metallic)
if(!silent)
user.visible_message(SPAN_WARNING("You can't weld \the [src]!"))
return FALSE

/obj/structure/barricade/proc/attackby_welder(obj/item/item, mob/user)
if(!HAS_TRAIT(item, TRAIT_TOOL_BLOWTORCH))
to_chat(user, SPAN_WARNING("You need a stronger blowtorch!"))
if(!silent)
to_chat(user, SPAN_WARNING("You need a stronger blowtorch!"))
return FALSE

if(health == maxhealth)
to_chat(user, SPAN_WARNING("[src] doesn't need repairs."))
if(!silent)
to_chat(user, SPAN_WARNING("[src] doesn't need repairs."))
return FALSE

if(!(isnull(damage_state)) && !(isnull(welder_lower_damage_limit)) && damage_state >= welder_lower_damage_limit)
to_chat(user, SPAN_WARNING("[src] has sustained too much structural damage to be repaired."))
if(!silent)
to_chat(user, SPAN_WARNING("[src] has sustained too much structural damage to be repaired."))
return FALSE

return TRUE
28 changes: 11 additions & 17 deletions code/game/objects/structures/barricade/deployable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,28 @@
. += SPAN_INFO("Drag its sprite onto yourself to undeploy.")

/obj/structure/barricade/deployable/attackby(obj/item/item, mob/user)

if(iswelder(item))
if(!attackby_welder(item, user))
return FALSE


weld_cade(item, user)
try_weld_cade(item, user)
return

else if(HAS_TRAIT(item, TRAIT_TOOL_CROWBAR))
if(HAS_TRAIT(item, TRAIT_TOOL_CROWBAR))
if(user.action_busy)
return
if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_TRAINED))
to_chat(user, SPAN_WARNING("You do not know how to collapse [src] using a crowbar..."))
return
user.visible_message(SPAN_NOTICE("[user] starts collapsing [src]."), \
SPAN_NOTICE("You begin collapsing [src]..."))
playsound(loc, 'sound/items/Crowbar.ogg', 25, 1)
if(do_after(user, 1.5 SECONDS, INTERRUPT_NO_NEEDHAND, BUSY_ICON_FRIENDLY, src))
collapse(usr)
else
user.visible_message(SPAN_NOTICE("[user] starts collapsing [src]."), \
SPAN_NOTICE("You begin collapsing [src]..."))
playsound(loc, 'sound/items/Crowbar.ogg', 25, 1)
if(do_after(user, 1.5 SECONDS, INTERRUPT_NO_NEEDHAND, BUSY_ICON_FRIENDLY, src))
collapse(usr)
else
to_chat(user, SPAN_WARNING("You stop collapsing [src]."))
to_chat(user, SPAN_WARNING("You stop collapsing [src]."))

if(try_nailgun_usage(item, user))
return

. = ..()
return ..()

/obj/structure/barricade/deployable/MouseDrop(obj/over_object as obj)
if(!ishuman(usr))
Expand Down Expand Up @@ -196,7 +190,7 @@
to_chat(user, SPAN_INFO("You transfer [to_transfer] between the stacks."))
return

else if(iswelder(item))
if(iswelder(item))
if(!HAS_TRAIT(item, TRAIT_TOOL_BLOWTORCH))
to_chat(user, SPAN_WARNING("You need a stronger blowtorch!"))
return
Expand Down Expand Up @@ -242,7 +236,7 @@
playsound(loc, 'sound/items/Welder2.ogg', 25, TRUE)
return

. = ..()
return ..()

/obj/item/stack/folding_barricade/attack_hand(mob/user)
var/mob/living/carbon/human/human = user
Expand Down
34 changes: 21 additions & 13 deletions code/game/objects/structures/barricade/metal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,20 @@
if(BARRICADE_UPGRADE_ANTIFF)
. += SPAN_NOTICE("The cade is protected by a composite upgrade.")

/obj/structure/barricade/metal/attackby(obj/item/item, mob/user)
if(iswelder(item))
if(!attackby_welder(item, user))
return FALSE
/obj/structure/barricade/metal/can_weld(obj/item/item, mob/user, silent)
if(!..())
return FALSE


if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_TRAINED))
if(!skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_TRAINED))
if(!silent)
to_chat(user, SPAN_WARNING("You're not trained to repair [src]..."))
return FALSE
return FALSE

weld_cade(item, user)
return TRUE

/obj/structure/barricade/metal/attackby(obj/item/item, mob/user)
if(iswelder(item))
try_weld_cade(item, user)
return

if(try_nailgun_usage(item, user))
Expand Down Expand Up @@ -198,25 +200,29 @@
to_chat(user, SPAN_WARNING("You are not trained to assemble [src]..."))
return
playsound(src.loc, 'sound/items/Screwdriver.ogg', 25, 1)
if(!do_after(user, 10, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD, src)) return
if(!do_after(user, 10, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD, src))
return
user.visible_message(SPAN_NOTICE("[user] set [src]'s protection panel back."),
SPAN_NOTICE("You set [src]'s protection panel back."))
build_state = BARRICADE_BSTATE_SECURED
return

if(HAS_TRAIT(item, TRAIT_TOOL_WRENCH))
if(user.action_busy)
return
if(!skillcheck(user, SKILL_CONSTRUCTION, SKILL_CONSTRUCTION_TRAINED))
to_chat(user, SPAN_WARNING("You are not trained to disassemble [src]..."))
return
playsound(src.loc, 'sound/items/Ratchet.ogg', 25, 1)
if(!do_after(user, 10, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD, src)) return
if(!do_after(user, 10, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD, src))
return
user.visible_message(SPAN_NOTICE("[user] loosens [src]'s anchor bolts."),
SPAN_NOTICE("You loosen [src]'s anchor bolts."))
anchored = FALSE
build_state = BARRICADE_BSTATE_MOVABLE
update_icon() //unanchored changes layer
return

if(BARRICADE_BSTATE_MOVABLE) //Anchor bolts loosened step. Apply crowbar to unseat the panel and take apart the whole thing. Apply wrench to resecure anchor bolts
if(HAS_TRAIT(item, TRAIT_TOOL_WRENCH))
if(user.action_busy)
Expand All @@ -233,13 +239,15 @@
to_chat(user, SPAN_WARNING("[src] must be secured on a proper surface!"))
return
playsound(src.loc, 'sound/items/Ratchet.ogg', 25, 1)
if(!do_after(user, 10, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD, src)) return
if(!do_after(user, 10, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD, src))
return
user.visible_message(SPAN_NOTICE("[user] secures [src]'s anchor bolts."),
SPAN_NOTICE("You secure [src]'s anchor bolts."))
build_state = BARRICADE_BSTATE_UNSECURED
anchored = TRUE
update_icon() //unanchored changes layer
return

if(HAS_TRAIT(item, TRAIT_TOOL_CROWBAR))
if(user.action_busy)
return
Expand All @@ -256,7 +264,7 @@
deconstruct(TRUE) //Note : Handles deconstruction too !
return

. = ..()
return ..()

/obj/structure/barricade/metal/wired/New()
maxhealth += 50
Expand All @@ -265,7 +273,7 @@
is_wired = TRUE
climbable = FALSE
update_icon()
. = ..()
return ..()

/obj/structure/barricade/metal/wired/initialize_pass_flags(datum/pass_flags_container/PF)
..()
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/structures/barricade/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
user.visible_message(SPAN_NOTICE("\The [user] removes \the [src]."))
deconstruct(TRUE)
return
else
. = ..()

return ..()

/obj/structure/barricade/snow/hit_barricade(obj/item/I)
switch(I.damtype)
Expand Down Expand Up @@ -101,7 +101,7 @@
if(try_nailgun_usage(W, user))
return

. = ..()
return ..()

/obj/structure/barricade/wooden/hit_barricade(obj/item/I)
switch(I.damtype)
Expand Down
Loading

0 comments on commit ae8f046

Please sign in to comment.