Skip to content

Commit

Permalink
Merge remote-tracking branch 'cmss13-devs/master' into project/ares/a…
Browse files Browse the repository at this point in the history
…dmin_console
  • Loading branch information
realforest2001 committed Jan 2, 2024
2 parents c01698a + 27bbddf commit d3c4173
Show file tree
Hide file tree
Showing 318 changed files with 3,150 additions and 735 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ most of them are tied into map-placed objects. This should be reworked in the fu
/// Ancients only
#define ACCESS_YAUTJA_ANCIENT 392

/// Anything in a tutorial sequence that shouldn't be accessed
#define ACCESS_TUTORIAL_LOCKED 998
///Temporary, just so I can flag places I need to change
#define ACCESS_COME_BACK_TO_ME 999

Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@
#define COMSIG_HUMAN_SURGERY_APPLY_MODIFIERS "human_surgery_apply_modifiers"
/// From /mob/living/carbon/human/proc/get_flags_cold_protection()
#define COMSIG_HUMAN_COLD_PROTECTION_APPLY_MODIFIERS "human_cold_protection_apply_modifiers"

/// From /obj/item/proc/dig_out_shrapnel() : ()
#define COMSIG_HUMAN_SHRAPNEL_REMOVED "human_shrapnel_removed"
12 changes: 12 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,19 @@
#define COMSIG_LIVING_PRE_COLLIDE "living_pre_collide"
#define COMPONENT_LIVING_COLLIDE_HANDLED (1<<0)

/// From /mob/living/proc/do_ghost() : (mob/dead/observer/ghost)
#define COMSIG_LIVING_GHOSTED "living_ghosted"

/// From /mob/living/carbon/human/attack_hand() : (mob/living/carbon/human/attacked_mob)
#define COMSIG_LIVING_ATTACKHAND_HUMAN "living_attackhand_human"

/// From /obj/item/reagent_container/hypospray/attack() : (obj/item/reagent_container/hypospray/injector)
#define COMSIG_LIVING_HYPOSPRAY_INJECTED "living_hypospray_injected"

///from base of mob/living/set_buckled(): (new_buckled)
#define COMSIG_LIVING_SET_BUCKLED "living_set_buckled"
///from base of mob/living/set_body_position()
#define COMSIG_LIVING_SET_BODY_POSITION "living_set_body_position"

/// from base of /mob/living/apply_status_effect(): (datum/status_effect/new_effect)
#define COMSIG_LIVING_APPLY_EFFECT "living_apply_effect"
40 changes: 40 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
///from base of /mob/Logout(): ()
#define COMSIG_MOB_LOGOUT "mob_logout"

/// From /mob/proc/change_real_name(): (old_name, new_name)
#define COMSIG_MOB_REAL_NAME_CHANGED "mob_real_name_changed"

//from /mob/proc/on_deafness_gain()
#define COMSIG_MOB_DEAFENED "mob_deafened"
//from /mob/proc/on_deafness_loss()
Expand Down Expand Up @@ -128,5 +131,42 @@
/// From /obj/item/proc/pickup() : (obj/item/picked_up)
#define COMSIG_MOB_PICKUP_ITEM "mob_pickup_item"

/// From /obj/item/proc/attack_self() : (obj/item/used)
#define COMSIG_MOB_ITEM_ATTACK_SELF "mob_item_attack_self"

/// From /obj/item/proc/dropped() : (obj/item/dropped)
#define COMSIG_MOB_ITEM_DROPPED "mob_item_dropped"


/// From /obj/item/reagent_container/food/snacks/proc/on_Consume() : (obj/item/reagent_container/food/snacks/eaten_food)
#define COMSIG_MOB_EATEN_SNACK "mob_eaten_snack"

/// From /atom/proc/attackby() : (atom/attacked, obj/item/attacked_with)
#define COMSIG_MOB_PARENT_ATTACKBY "mob_parent_attackby"

/// From /obj/item/weapon/gun/proc/reload_into_chamber() : (obj/item/weapon/gun/empty_gun)
#define COMSIG_MOB_GUN_EMPTY "mob_gun_empty"

/// From /obj/item/weapon/gun/proc/reload() : (obj/item/weapon/gun/reloaded)
#define COMSIG_MOB_RELOADED_GUN "mob_reloaded_gun"

/// From /mob/proc/get_status_tab_items() : (list/status_list)
#define COMSIG_MOB_GET_STATUS_TAB_ITEMS "mob_get_status_tab_items"

/// From /datum/tutorial/proc/update_objective() : (new_objective)
#define COMSIG_MOB_TUTORIAL_UPDATE_OBJECTIVE "mob_tutorial_update_objective"

/// From /mob/proc/swap_hand() : ()
#define COMSIG_MOB_SWAPPED_HAND "mob_swapped_hand"

/// From /mob/proc/a_intent_change() : (new_intent)
#define COMSIG_MOB_INTENT_CHANGE "mob_intent_change"

/// From /obj/item/grab/proc/progress_passive() : (mob/living/carbon/human/grabber)
#define COMSIG_MOB_AGGRESSIVELY_GRABBED "mob_aggressively_grabbed"
#define COMSIG_MOB_AGGRESIVE_GRAB_CANCEL (1<<0)

/// Cancels all running cloaking effects on target
#define COMSIG_MOB_EFFECT_CLOAK_CANCEL "mob_effect_cloak_cancel"

#define COMSIG_MOB_END_TUTORIAL "mob_end_tutorial"
10 changes: 10 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
/// from /obj/proc/afterbuckle()
#define COSMIG_OBJ_AFTER_BUCKLE "signal_obj_after_buckle"

/// from /obj/structure/machinery/cryopod/go_out()
#define COMSIG_CRYOPOD_GO_OUT "cryopod_go_out"

/// from /proc/vendor_successful_vend() : (obj/structure/machinery/cm_vending/vendor, list/itemspec, mob/living/carbon/human/user)
#define COMSIG_VENDOR_SUCCESSFUL_VEND "vendor_successful_vend"

/// from /obj/limb/proc/remove_all_bleeding() : (external, internal)
#define COMSIG_LIMB_STOP_BLEEDING "limb_stop_bleeding"

#define COMSIG_DROPSHIP_ADD_EQUIPMENT "dropship_add_equipment"
#define COMSIG_DROPSHIP_REMOVE_EQUIPMENT "dropship_remove_equipment"

#define COMSIG_STRUCTURE_CRATE_SQUAD_LAUNCHED "structure_crate_squad_launched"
3 changes: 0 additions & 3 deletions code/__DEFINES/dcs/signals/signals_client.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,3 @@

/// Called when something is removed from a client's screen : /client/proc/remove_from_screen(screen_remove)
#define COMSIG_CLIENT_SCREEN_REMOVE "client_screen_remove"

/// When a mind is transfered to another mob at /datum/mind/proc/transfer_to()
#define COMSIG_CLIENT_MIND_TRANSFER "mind_transfer"
1 change: 1 addition & 0 deletions code/__DEFINES/mob.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define DEFAULT_MOB_STATUS_FLAGS CANKNOCKDOWN|CANPUSH|STATUS_FLAGS_DEBILITATE
5 changes: 5 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@
#define TRAIT_HARDCORE "t_hardcore"
/// If the mob is able to use the vulture rifle or spotting scope
#define TRAIT_VULTURE_USER "t_vulture_user"
/// If the mob is currently loading a tutorial
#define TRAIT_IN_TUTORIAL "t_IN_TUTORIAL"
/// If the mob is cloaked in any form
#define TRAIT_CLOAKED "t_cloaked"

Expand Down Expand Up @@ -297,6 +299,7 @@ GLOBAL_LIST_INIT(mob_traits, list(
TRAIT_REAGENT_SCANNER,
TRAIT_ABILITY_BURROWED,
TRAIT_VULTURE_USER,
TRAIT_IN_TUTORIAL,
))

/*
Expand Down Expand Up @@ -403,6 +406,8 @@ GLOBAL_LIST(trait_name_map)
#define TRAIT_SOURCE_JOB "t_s_job"
///Status trait forced by staff
#define TRAIT_SOURCE_ADMIN "t_s_admin"
/// Status trait coming from a tutorial
#define TRAIT_SOURCE_TUTORIAL "t_s_tutorials"
///Status trait coming from equipment
#define TRAIT_SOURCE_EQUIPMENT(slot) "t_s_equipment_[slot]"
///Status trait coming from skill
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/tutorial.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#define TUTORIAL_ATOM_FROM_TRACKING(path, varname) var##path/##varname = tracking_atoms[##path]

#define TUTORIAL_CATEGORY_BASE "Base" // Shouldn't be used outside of base types
#define TUTORIAL_CATEGORY_SS13 "Space Station 13"
#define TUTORIAL_CATEGORY_MARINE "Marine"
#define TUTORIAL_CATEGORY_XENO "Xenomorph"
1 change: 0 additions & 1 deletion code/__HELPERS/level_traits.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#define is_admin_level(z) SSmapping.level_trait(z, ZTRAIT_ADMIN)

#define is_ground_level(z) SSmapping.level_trait(z, ZTRAIT_GROUND)
Expand Down
2 changes: 2 additions & 0 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
/mob/proc/change_real_name(mob/M, new_name)
if(!new_name)
return FALSE
var/old_name = M.real_name

M.real_name = new_name
M.name = new_name
Expand All @@ -83,6 +84,7 @@
// If we are humans, we need to update our voice as well
M.change_mob_voice(new_name)

SEND_SIGNAL(src, COMSIG_MOB_REAL_NAME_CHANGED, old_name, new_name)
return TRUE

/mob/proc/change_mind_name(new_mind_name)
Expand Down
12 changes: 12 additions & 0 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2088,3 +2088,15 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(

if(NORTHWEST)
return list(NORTHWEST, NORTH, WEST)

/// Returns TRUE if the target is somewhere that the game should not interact with if possible
/// In this case, admin Zs and tutorial areas
/proc/should_block_game_interaction(atom/target)
if(is_admin_level(target.z))
return TRUE

var/area/target_area = get_area(target)
if(target_area?.block_game_interaction)
return TRUE

return FALSE
2 changes: 2 additions & 0 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/obj/item/proc/attack_self(mob/user)
SHOULD_CALL_PARENT(TRUE)
SEND_SIGNAL(src, COMSIG_ITEM_ATTACK_SELF, user)
SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK_SELF, src)

if(flags_item & CAN_DIG_SHRAPNEL && ishuman(user))
dig_out_shrapnel(user)
Expand All @@ -11,6 +12,7 @@
/atom/proc/attackby(obj/item/W, mob/living/user,list/mods)
if(SEND_SIGNAL(src, COMSIG_PARENT_ATTACKBY, W, user, mods) & COMPONENT_NO_AFTERATTACK)
return TRUE
SEND_SIGNAL(user, COMSIG_MOB_PARENT_ATTACKBY, src, W)
return FALSE

/atom/movable/attackby(obj/item/W, mob/living/user)
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
if(ismob(target) || isVehicle(target))
if(isxeno(target) && SSticker.mode.check_xeno_late_join(src)) //if it's a xeno and all checks are alright, we are gonna try to take their body
var/mob/living/carbon/xenomorph/xeno = target
if(xeno.stat == DEAD || is_admin_level(xeno.z) || xeno.aghosted)
if(xeno.stat == DEAD || should_block_game_interaction(xeno) || xeno.aghosted)
to_chat(src, SPAN_WARNING("You cannot join as [xeno]."))
do_observe(xeno)
return FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ so that it doesn't double up on the delays) so that it applies the delay immedia
if(alt_pressed && shift_pressed)
if(istype(target, /mob/living/carbon/xenomorph))
var/mob/living/carbon/xenomorph/xeno = target
if(!QDELETED(xeno) && xeno.stat != DEAD && !is_admin_level(xeno.z) && xeno.check_state(TRUE) && xeno.hivenumber == hivenumber)
if(!QDELETED(xeno) && xeno.stat != DEAD && !should_block_game_interaction(xeno) && xeno.check_state(TRUE) && xeno.hivenumber == hivenumber)
overwatch(xeno)
next_move = world.time + 3 // Some minimal delay so this isn't crazy spammy
return TRUE
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,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

/datum/controller/subsystem/ticker/Initialize(timeofday)
load_mode()
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ SUBSYSTEM_DEF(vote)
log_vote(text)
var/vp = CONFIG_GET(number/vote_period)
SEND_SOUND(world, sound(vote_sound, channel = SOUND_CHANNEL_VOX, volume = vote_sound_vol))
to_chat(world, SPAN_CENTERBOLD("<br><br><font color='purple'<b>[text]</b><br>Type <b>vote</b> or click <a href='?src=[REF(src)]'>here</a> to place your votes.<br>You have [DisplayTimeText(vp)] to vote.</font><br><br>"))
to_chat(world, SPAN_CENTERBOLD("<br><br><font color='purple'><b>[text]</b><br>Type <b>vote</b> or click <a href='?src=[REF(src)]'>here</a> to place your votes.<br>You have [DisplayTimeText(vp)] to vote.</font><br><br>"))
time_remaining = round(vp/10)
for(var/c in GLOB.clients)
var/client/C = c
Expand Down
8 changes: 4 additions & 4 deletions code/datums/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
var/cost = 0 // By default an action has no cost -> will be utilized by skill actions/xeno actions
var/action_flags = 0 // Check out __game.dm for flags
/// Whether the action is hidden from its owner
/// Useful for when you want to preserve action state while preventing
/// a mob from using said action
var/hidden = FALSE
var/hidden = FALSE //Preserve action state while preventing mob from using action
///Hide the action from the owner without preventing them from using it (incase of keybind listen_signal)
var/player_hidden = FALSE
var/unique = TRUE
/// A signal on the mob that will cause the action to activate
var/listen_signal
Expand Down Expand Up @@ -227,7 +227,7 @@
var/atom/movable/screen/action_button/B = A.button
if(reload_screen)
client.add_to_screen(B)
if(A.hidden)
if(A.hidden || A.player_hidden)
B.screen_loc = null
continue
button_number++
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ammo/ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
SHOULD_NOT_SLEEP(TRUE)
return

/datum/ammo/proc/on_embed(mob/embedded_mob, obj/limb/target_organ)
/datum/ammo/proc/on_embed(mob/embedded_mob, obj/limb/target_organ, silent = FALSE)
return

/datum/ammo/proc/do_at_max_range(obj/projectile/P)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ammo/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
accurate_range = 12
shell_speed = AMMO_SPEED_TIER_1

/datum/ammo/souto/on_embed(mob/embedded_mob, obj/limb/target_organ)
/datum/ammo/souto/on_embed(mob/embedded_mob, obj/limb/target_organ, silent = FALSE)
if(ishuman(embedded_mob) && !isyautja(embedded_mob))
if(istype(target_organ))
target_organ.embed(new can_type)
Expand Down
25 changes: 25 additions & 0 deletions code/datums/components/tutorial_status.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/datum/component/tutorial_status
dupe_mode = COMPONENT_DUPE_UNIQUE
/// What the mob's current tutorial status is, displayed in the status panel
var/tutorial_status = ""

/datum/component/tutorial_status/Initialize()
. = ..()
if(!ismob(parent))
return COMPONENT_INCOMPATIBLE

/datum/component/tutorial_status/RegisterWithParent()
..()
RegisterSignal(parent, COMSIG_MOB_TUTORIAL_UPDATE_OBJECTIVE, PROC_REF(update_objective))
RegisterSignal(parent, COMSIG_MOB_GET_STATUS_TAB_ITEMS, PROC_REF(get_status_tab_item))

/datum/component/tutorial_status/proc/update_objective(datum/source, objective_text)
SIGNAL_HANDLER

tutorial_status = objective_text

/datum/component/tutorial_status/proc/get_status_tab_item(datum/source, list/status_tab_items)
SIGNAL_HANDLER

if(tutorial_status)
status_tab_items += "Tutorial Objective: " + tutorial_status
4 changes: 2 additions & 2 deletions code/datums/datacore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
sleep(40)

var/list/jobs_to_check = GLOB.ROLES_CIC + GLOB.ROLES_AUXIL_SUPPORT + GLOB.ROLES_MISC + GLOB.ROLES_POLICE + GLOB.ROLES_ENGINEERING + GLOB.ROLES_REQUISITION + GLOB.ROLES_MEDICAL + GLOB.ROLES_MARINES
for(var/mob/living/carbon/human/H in GLOB.human_mob_list)
if(is_admin_level(H.z))
for(var/mob/living/carbon/human/H as anything in GLOB.human_mob_list)
if(should_block_game_interaction(H))
continue
if(H.job in jobs_to_check)
manifest_inject(H)
Expand Down
Loading

0 comments on commit d3c4173

Please sign in to comment.