Skip to content

Commit

Permalink
Merge branch 'master' into rts-control
Browse files Browse the repository at this point in the history
  • Loading branch information
xDanilcusx committed Aug 15, 2024
2 parents d012e45 + e1e6502 commit 8da5954
Show file tree
Hide file tree
Showing 51 changed files with 1,020 additions and 326 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"
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 @@ -72,9 +72,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/on_deafness_gain()
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
3 changes: 3 additions & 0 deletions code/__DEFINES/sounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
#define SOUND_ENVIRONMENT_DIZZY 24
#define SOUND_ENVIRONMENT_PSYCHOTIC 25

#define SOUND_ECHO_REVERB_ON list(0, 0, 0, 0, 0, 0.0, 0, 0.25, 1.5, 1.0, 0, 1.0, 0, 0.0, 0.0, 0.0, 1.0, 0)
#define SOUND_ECHO_REVERB_OFF list(0, 0, -10000, -10000, 0, 0.0, 0, 0.25, 1.5, 1.0, 0, 1.0, 0, 0.0, 0.0, 0.0, 1.0, 0) //-10000 to Room & RoomHF makes enviromental reverb effectively inaudible

#define AMBIENCE_SHIP 'sound/ambience/shipambience.ogg'
#define AMBIENCE_JUNGLE 'sound/ambience/ambienceLV624.ogg'
#define AMBIENCE_RIVER 'sound/ambience/ambienceriver.ogg'
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ GLOBAL_VAR(xeno_queue_candidate_count)
GLOBAL_VAR(obfs_x)
/// A number between -500 and 500.
GLOBAL_VAR(obfs_y)

GLOBAL_VAR_INIT(ai_xeno_weeding, TRUE)
10 changes: 6 additions & 4 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
/atom/movable/screen/action_button/attack_ghost(mob/dead/observer/user)
return

/atom/movable/screen/action_button/clicked(mob/user)
/atom/movable/screen/action_button/clicked(mob/user, list/mods)
if(!user || !source_action)
return TRUE
if(source_action.owner != user)
return TRUE

if(source_action.can_use_action())
source_action.action_activate()
Expand Down Expand Up @@ -97,7 +99,7 @@
icon_state = "hide"
var/hidden = 0

/atom/movable/screen/action_button/hide_toggle/clicked(mob/user, mods)
/atom/movable/screen/action_button/hide_toggle/clicked(mob/user, list/mods)
user.hud_used.action_buttons_hidden = !user.hud_used.action_buttons_hidden
hidden = user.hud_used.action_buttons_hidden
if(hidden)
Expand All @@ -107,7 +109,7 @@
name = "Hide Buttons"
icon_state = "hide"
user.update_action_buttons()
return 1
return TRUE

/atom/movable/screen/action_button/ghost/minimap/get_button_screen_loc(button_number)
return "SOUTH:6,CENTER+1:24"
Expand Down Expand Up @@ -214,7 +216,7 @@
/atom/movable/screen/zone_sel/robot
icon = 'icons/mob/hud/screen1_robot.dmi'

/atom/movable/screen/clicked(mob/user)
/atom/movable/screen/clicked(mob/user, list/mods)
if(!user)
return TRUE

Expand Down
10 changes: 10 additions & 0 deletions code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ SUBSYSTEM_DEF(minimaps)
user.client.register_map_obj(map_holder.map)
ui = new(user, src, "TacticalMap")
ui.open()
RegisterSignal(user.mind, COMSIG_MIND_TRANSFERRED, PROC_REF(on_mind_transferred))

/datum/tacmap/drawing/tgui_interact(mob/user, datum/tgui/ui)
var/mob/living/carbon/xenomorph/xeno = user
Expand Down Expand Up @@ -755,6 +756,7 @@ SUBSYSTEM_DEF(minimaps)
tacmap_ready_time = SSminimaps.next_fire + 2 SECONDS
addtimer(CALLBACK(src, PROC_REF(on_tacmap_fire), faction), SSminimaps.next_fire - world.time + 1 SECONDS)
user.client.register_map_obj(map_holder.map)
RegisterSignal(user.mind, COMSIG_MIND_TRANSFERRED, PROC_REF(on_mind_transferred))

ui = new(user, src, "TacticalMap")
ui.open()
Expand Down Expand Up @@ -835,6 +837,9 @@ SUBSYSTEM_DEF(minimaps)

return data

/datum/tacmap/ui_close(mob/user)
UnregisterSignal(user.mind, COMSIG_MIND_TRANSFERRED)

/datum/tacmap/drawing/ui_close(mob/user)
. = ..()
action_queue_change = 0
Expand Down Expand Up @@ -950,6 +955,11 @@ SUBSYSTEM_DEF(minimaps)

return UI_INTERACTIVE

// This gets removed when the player changes bodies (i.e. xeno evolution), so re-register it when that happens.
/datum/tacmap/proc/on_mind_transferred(datum/mind/source, mob/previous_body)
SIGNAL_HANDLER
source.current.client.register_map_obj(map_holder.map)

/datum/tacmap_holder
var/map_ref
var/atom/movable/screen/minimap/map
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 @@ -180,7 +180,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 @@ -370,7 +370,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
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
6 changes: 3 additions & 3 deletions code/datums/ammo/bullet/special_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@
icon_state = "bullet" // Keeping it bog standard with the turret but allows it to be changed

accurate_range = 12
damage = 35
damage = 40
penetration= ARMOR_PENETRATION_TIER_10 //Bumped the penetration to serve a different role from sentries, MGs are a bit more offensive
accuracy = HIT_ACCURACY_TIER_3
accuracy = HIT_ACCURACY_TIER_5

/datum/ammo/bullet/machinegun/set_bullet_traits()
. = ..()
Expand Down Expand Up @@ -158,7 +158,7 @@
accurate_range = 12

/datum/ammo/bullet/m60
name = "M60 bullet"
name = "Mk70 bullet"
headshot_state = HEADSHOT_OVERLAY_MEDIUM

accuracy = HIT_ACCURACY_TIER_2
Expand Down
21 changes: 16 additions & 5 deletions code/datums/components/overlay_lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@
get_new_turfs()


///Adds the luminosity and source for the afected movable atoms to keep track of their visibility.
///Adds the luminosity and source for the affected movable atoms to keep track of their visibility.
/datum/component/overlay_lighting/proc/add_dynamic_lumi()
LAZYSET(current_holder.affected_movable_lights, src, lumcount_range + 1)
current_holder.underlays += visible_mask
current_holder.update_dynamic_luminosity()
if(directional)
current_holder.underlays += cone

///Removes the luminosity and source for the afected movable atoms to keep track of their visibility.
///Removes the luminosity and source for the affected movable atoms to keep track of their visibility.
/datum/component/overlay_lighting/proc/remove_dynamic_lumi()
LAZYREMOVE(current_holder.affected_movable_lights, src)
current_holder.underlays -= visible_mask
Expand Down Expand Up @@ -267,6 +267,9 @@
///Used to determine the new valid current_holder from the parent's loc.
/datum/component/overlay_lighting/proc/check_holder()
var/atom/movable/movable_parent = GET_PARENT
if(QDELETED(movable_parent))
set_holder(null)
return
if(isturf(movable_parent.loc))
set_holder(movable_parent)
return
Expand All @@ -275,13 +278,21 @@
set_holder(null)
return
if(isturf(inside.loc))
set_holder(inside)
// storage items block light, also don't be moving into a qdeleted item
if(QDELETED(inside) || istype(inside, /obj/item/storage))
set_holder(null)
else
set_holder(inside)
return
set_holder(null)


///Called when the current_holder is qdeleted, to remove the light effect.
/datum/component/overlay_lighting/proc/on_holder_qdel(atom/movable/source, force)
SIGNAL_HANDLER
if(QDELETED(current_holder))
set_holder(null)
return
UnregisterSignal(current_holder, list(COMSIG_PARENT_QDELETING, COMSIG_MOVABLE_MOVED))
if(directional)
UnregisterSignal(current_holder, COMSIG_ATOM_DIR_CHANGE)
Expand All @@ -290,6 +301,7 @@

///Called when current_holder changes loc.
/datum/component/overlay_lighting/proc/on_holder_moved(atom/movable/source, OldLoc, Dir, Forced)
SIGNAL_HANDLER
if(!(overlay_lighting_flags & LIGHTING_ON))
return
make_luminosity_update()
Expand Down Expand Up @@ -450,8 +462,7 @@
. = lum_power
lum_power = new_lum_power
var/difference = . - lum_power
for(var/t in affected_turfs)
var/turf/lit_turf = t
for(var/turf/lit_turf as anything in affected_turfs)
lit_turf.dynamic_lumcount -= difference

///Here we append the behavior associated to changing lum_power.
Expand Down
3 changes: 0 additions & 3 deletions code/datums/emergency_calls/cryo_marines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
leader = human
leaders++
human.client?.prefs.copy_all_to(human, JOB_SQUAD_LEADER, TRUE, TRUE)
arm_equipment(human, /datum/equipment_preset/uscm/leader/cryo, mind == null, TRUE)
to_chat(human, SPAN_ROLE_HEADER("You are a Squad Leader in the USCM"))
to_chat(human, SPAN_ROLE_BODY("You are here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]. Listen to the chain of command."))
to_chat(human, SPAN_BOLDWARNING("If you wish to cryo or ghost upon spawning in, you must ahelp and inform staff so you can be replaced."))
Expand All @@ -62,7 +61,6 @@
else if (medics < max_medics && (!mind || (HAS_FLAG(human.client.prefs.toggles_ert, PLAY_MEDIC) && check_timelock(human.client, JOB_SQUAD_MEDIC, time_required_for_job))))
medics++
human.client?.prefs.copy_all_to(human, JOB_SQUAD_MEDIC, TRUE, TRUE)
arm_equipment(human, /datum/equipment_preset/uscm/medic/cryo, mind == null, TRUE)
to_chat(human, SPAN_ROLE_HEADER("You are a Hospital Corpsman in the USCM"))
to_chat(human, SPAN_ROLE_BODY("You are here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]. Listen to the chain of command."))
to_chat(human, SPAN_BOLDWARNING("If you wish to cryo or ghost upon spawning in, you must ahelp and inform staff so you can be replaced."))
Expand All @@ -75,7 +73,6 @@
to_chat(human, SPAN_BOLDWARNING("If you wish to cryo or ghost upon spawning in, you must ahelp and inform staff so you can be replaced."))
else
human.client?.prefs.copy_all_to(human, JOB_SQUAD_MARINE, TRUE, TRUE)
arm_equipment(human, /datum/equipment_preset/uscm/pfc/cryo, mind == null, TRUE)
to_chat(human, SPAN_ROLE_HEADER("You are a Rifleman in the USCM"))
to_chat(human, SPAN_ROLE_BODY("You are here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]. Listen to the chain of command."))
to_chat(human, SPAN_BOLDWARNING("If you wish to cryo or ghost upon spawning in, you must ahelp and inform staff so you can be replaced."))
Expand Down
4 changes: 0 additions & 4 deletions code/datums/emergency_calls/cryo_marines_heavy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
if(leaders < cryo_squad.max_leaders && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(H.client, JOB_SQUAD_LEADER, time_required_for_job))
leader = H
leaders++
arm_equipment(H, /datum/equipment_preset/uscm/leader_equipped/cryo, TRUE, TRUE)
to_chat(H, SPAN_ROLE_HEADER("You are a Squad Leader in the USCM"))
to_chat(H, SPAN_ROLE_BODY("Your squad is here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]."))
else if (heavies < max_heavies && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_HEAVY) && check_timelock(H.client, JOB_SQUAD_SPECIALIST, time_required_for_job))
Expand All @@ -49,7 +48,6 @@
to_chat(H, SPAN_ROLE_BODY("Your squad is here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]."))
else if(smartgunners < max_smartgunners && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_SMARTGUNNER) && check_timelock(H.client, JOB_SQUAD_SMARTGUN, time_required_for_job))
smartgunners++
arm_equipment(H, /datum/equipment_preset/uscm/smartgunner_equipped/cryo, TRUE, TRUE)
to_chat(H, SPAN_ROLE_HEADER("You are a Smartgunner in the USCM"))
to_chat(H, SPAN_ROLE_BODY("Your squad is here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]."))
else if(engineers < max_engineers && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_ENGINEER) && check_timelock(H.client, JOB_SQUAD_ENGI, time_required_for_job))
Expand All @@ -59,11 +57,9 @@
to_chat(H, SPAN_ROLE_BODY("Your squad is here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]."))
else if (medics < max_medics && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_MEDIC) && check_timelock(H.client, JOB_SQUAD_MEDIC, time_required_for_job))
medics++
arm_equipment(H, /datum/equipment_preset/uscm/medic_equipped/cryo, TRUE, TRUE)
to_chat(H, SPAN_ROLE_HEADER("You are a Hospital Corpsman in the USCM"))
to_chat(H, SPAN_ROLE_BODY("Your squad is here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]."))
else
arm_equipment(H, /datum/equipment_preset/uscm/private_equipped/cryo, TRUE, TRUE)
to_chat(H, SPAN_ROLE_HEADER("You are a Rifleman in the USCM"))
to_chat(H, SPAN_ROLE_BODY("Your squad is here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]."))

Expand Down
2 changes: 0 additions & 2 deletions code/datums/fluff_emails.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
var/title //email title
var/entry_text //email content


//emails for the Almayer computers
/datum/fluff_email/almayer


/datum/fluff_email/almayer/iwantout
title = "RE: I want out."
entry_text = {"<html>
Expand Down
5 changes: 3 additions & 2 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
msg_admin_niche("[key]/[ckey] has tried to transfer to deleted [new_character].")
return

SEND_SIGNAL(current.client, COMSIG_CLIENT_MIND_TRANSFER, new_character)

var/mob/old_current = current
if(current)
current.mind = null //remove ourself from our old body's mind variable
nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user
SStgui.on_transfer(current, new_character) // and active TGUI instances

if(key)
if(new_character.key != key)
Expand Down Expand Up @@ -66,6 +66,7 @@
continue
player_entity = setup_player_entity(ckey)

SEND_SIGNAL(src, COMSIG_MIND_TRANSFERRED, old_current)
SEND_SIGNAL(new_character, COMSIG_MOB_NEW_MIND, current.client)

new_character.refresh_huds(current) //inherit the HUDs from the old body
Expand Down
1 change: 1 addition & 0 deletions code/datums/skills/uscm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ COMMAND STAFF
SKILL_INTEL = SKILL_INTEL_TRAINED,
SKILL_SURGERY = SKILL_SURGERY_NOVICE,
SKILL_PILOT = SKILL_PILOT_EXPERT,
SKILL_NAVIGATIONS = SKILL_NAVIGATIONS_TRAINED,
)

/datum/skills/SEA
Expand Down
Loading

0 comments on commit 8da5954

Please sign in to comment.