Skip to content

Commit

Permalink
Merge branch 'Fluffy-Frontier:master' into NTpolice
Browse files Browse the repository at this point in the history
  • Loading branch information
RaShCAt authored Mar 27, 2024
2 parents c2b05b9 + 81959fa commit ddbe345
Show file tree
Hide file tree
Showing 34 changed files with 1,931 additions and 1,724 deletions.
3,398 changes: 1,697 additions & 1,701 deletions _maps/map_files/tramstation/tramstation.dmm

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions code/__DEFINES/bitrunning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@
#define BITRUNNER_DIFFICULTY_MEDIUM 2
/// Red with skull. I am trying to kill bitrunners.
#define BITRUNNER_DIFFICULTY_HIGH 3

/// Camera network bitrunner bodycams are on
#define BITRUNNER_CAMERA_NET "bitrunner"
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_mouse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@
#define COMSIG_MOUSEDROPPED_ONTO "mousedropped_onto"
///from base of mob/MouseWheelOn(): (/atom, delta_x, delta_y, params)
#define COMSIG_MOUSE_SCROLL_ON "mousescroll_on"
/// From /atom/movable/screen/click(): (atom/target, atom/location, control, params, mob/user)
#define COMSIG_SCREEN_ELEMENT_CLICK "screen_element_click"
3 changes: 3 additions & 0 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,9 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
return TRUE

/atom/movable/screen/alert/Click(location, control, params)
SHOULD_CALL_PARENT(TRUE)

..()
if(!usr || !usr.client)
return FALSE
if(usr != owner)
Expand Down
15 changes: 12 additions & 3 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@

/// If FALSE, this will not be cleared when calling /client/clear_screen()
var/clear_with_screen = TRUE
/// If TRUE, clicking the screen element will fall through and perform a default "Click" call
/// Obviously this requires your Click override, if any, to call parent on their own.
/// This is set to FALSE to default to dissade you from doing this.
/// Generally we don't want default Click stuff, which results in bugs like using Telekinesis on a screen element
/// or trying to point your gun at your screen.
var/default_click = FALSE

/atom/movable/screen/Initialize(mapload, datum/hud/hud_owner)
. = ..()
Expand All @@ -46,6 +52,12 @@
hud = null
return ..()

/atom/movable/screen/Click(location, control, params)
if(flags_1 & INITIALIZED_1)
SEND_SIGNAL(src, COMSIG_SCREEN_ELEMENT_CLICK, location, control, params, usr)
if(default_click)
return ..()

/atom/movable/screen/examine(mob/user)
return list()

Expand Down Expand Up @@ -654,9 +666,6 @@
icon_state = "mood5"
screen_loc = ui_mood

/atom/movable/screen/mood/attack_tk()
return

/atom/movable/screen/splash
icon = 'icons/blanks/blank_title.png'
icon_state = ""
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/crafting/crafting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
C.icon = H.ui_style
H.static_inventory += C
CL.screen += C
RegisterSignal(C, COMSIG_CLICK, PROC_REF(component_ui_interact))
RegisterSignal(C, COMSIG_SCREEN_ELEMENT_CLICK, PROC_REF(component_ui_interact))

#define COOKING TRUE
#define CRAFTING FALSE
Expand Down
56 changes: 56 additions & 0 deletions code/datums/components/simple_bodycam.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/// Simple component to integrate a bodycam into a mob
/datum/component/simple_bodycam
/// The actual camera, in our mob's contents
VAR_PRIVATE/obj/machinery/camera/bodycam
/// How fast we update
var/camera_update_time = 0.5 SECONDS

/datum/component/simple_bodycam/Initialize(
camera_name = "bodycam",
c_tag = capitalize(camera_name),
network = "ss13",
emp_proof = FALSE,
camera_update_time = 0.5 SECONDS,
)
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE

src.camera_update_time = camera_update_time

bodycam = new(parent)
bodycam.network = list(network)
bodycam.name = camera_name
bodycam.c_tag = c_tag
if(emp_proof)
bodycam.AddElement(/datum/element/empprotection, EMP_PROTECT_ALL)

RegisterSignal(parent, COMSIG_MOVABLE_MOVED, PROC_REF(update_cam))
RegisterSignal(parent, COMSIG_ATOM_DIR_CHANGE, PROC_REF(rotate_cam))
RegisterSignals(bodycam, list(COMSIG_QDELETING, COMSIG_MOVABLE_MOVED), PROC_REF(camera_gone))

do_update_cam()

/datum/component/simple_bodycam/Destroy()
if(QDELETED(bodycam))
bodycam = null
else
QDEL_NULL(bodycam)
return ..()

/datum/component/simple_bodycam/proc/update_cam(datum/source, atom/old_loc, ...)
SIGNAL_HANDLER

if(get_turf(old_loc) != get_turf(parent))
do_update_cam()

/datum/component/simple_bodycam/proc/do_update_cam()
GLOB.cameranet.updatePortableCamera(bodycam, camera_update_time)

/datum/component/simple_bodycam/proc/rotate_cam(datum/source, old_dir, new_dir)
SIGNAL_HANDLER
// I don't actually think cameras care about dir but just in case
bodycam.setDir(new_dir)

/datum/component/simple_bodycam/proc/camera_gone(datum/source)
SIGNAL_HANDLER
qdel(src)
2 changes: 1 addition & 1 deletion code/datums/mood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
mood_screen_object.color = "#4b96c4"
hud.infodisplay += mood_screen_object
RegisterSignal(hud, COMSIG_QDELETING, PROC_REF(unmodify_hud))
RegisterSignal(mood_screen_object, COMSIG_CLICK, PROC_REF(hud_click))
RegisterSignal(mood_screen_object, COMSIG_SCREEN_ELEMENT_CLICK, PROC_REF(hud_click))

/// Removes the mood HUD object
/datum/mood/proc/unmodify_hud(datum/source)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/station_traits/_station_trait.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ GLOBAL_LIST_EMPTY(lobby_station_traits)
SHOULD_CALL_PARENT(TRUE)
lobby_buttons |= lobby_button
RegisterSignal(lobby_button, COMSIG_ATOM_UPDATE_ICON, PROC_REF(on_lobby_button_update_icon))
RegisterSignal(lobby_button, COMSIG_CLICK, PROC_REF(on_lobby_button_click))
RegisterSignal(lobby_button, COMSIG_SCREEN_ELEMENT_CLICK, PROC_REF(on_lobby_button_click))
RegisterSignal(lobby_button, COMSIG_QDELETING, PROC_REF(on_lobby_button_destroyed))
lobby_button.update_appearance(UPDATE_ICON)

Expand Down
3 changes: 3 additions & 0 deletions code/datums/status_effects/debuffs/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,9 @@
icon_state = "antalert"

/atom/movable/screen/alert/status_effect/ants/Click()
. = ..()
if(!.)
return
var/mob/living/living = owner
if(!istype(living) || !living.can_resist() || living != owner)
return
Expand Down
3 changes: 3 additions & 0 deletions code/datums/status_effects/debuffs/hooked.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
icon_state = "hooked"

/atom/movable/screen/alert/status_effect/hooked/Click()
. = ..()
if(!.)
return
if(!owner.can_resist())
return
owner.balloon_alert(owner, "removing hook...")
Expand Down
50 changes: 48 additions & 2 deletions code/game/machinery/computer/telescreen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,53 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/security/telescreen/entertai

notify(network.len, announcement)

/**
* Adds a camera network to all entertainment monitors.
*
* * camera_net - The camera network ID to add to the monitors.
* * announcement - Optional, what announcement to make when the show starts.
*/
/proc/start_broadcasting_network(camera_net, announcement)
for(var/obj/machinery/computer/security/telescreen/entertainment/tv as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/computer/security/telescreen/entertainment))
tv.update_shows(
is_show_active = TRUE,
tv_show_id = camera_net,
announcement = announcement,
)

/**
* Removes a camera network from all entertainment monitors.
*
* * camera_net - The camera network ID to remove from the monitors.
* * announcement - Optional, what announcement to make when the show ends.
*/
/proc/stop_broadcasting_network(camera_net, announcement)
for(var/obj/machinery/computer/security/telescreen/entertainment/tv as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/computer/security/telescreen/entertainment))
tv.update_shows(
is_show_active = FALSE,
tv_show_id = camera_net,
announcement = announcement,
)

/**
* Sets the camera network status on all entertainment monitors.
* A way to force a network to a status if you are unsure of the current state.
*
* * camera_net - The camera network ID to set on the monitors.
* * is_show_active - Whether the show is active or not.
* * announcement - Optional, what announcement to make.
* Note this announcement will be made regardless of the current state of the show:
* This means if it's currently on and you set it to on, the announcement will still be made.
* Likewise, there's no way to differentiate off -> on and on -> off, unless you handle that yourself.
*/
/proc/set_network_broadcast_status(camera_net, is_show_active, announcement)
for(var/obj/machinery/computer/security/telescreen/entertainment/tv as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/computer/security/telescreen/entertainment))
tv.update_shows(
is_show_active = is_show_active,
tv_show_id = camera_net,
announcement = announcement,
)

/obj/machinery/computer/security/telescreen/rd
name = "\improper Research Director's telescreen"
desc = "Used for watching the AI and the RD's goons from the safety of his office."
Expand Down Expand Up @@ -270,5 +317,4 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/security/telescreen/entertai
is_show_active = !is_show_active
say("The [tv_show_name] show has [is_show_active ? "begun" : "ended"]")
var/announcement = is_show_active ? pick(tv_starters) : pick(tv_enders)
for(var/obj/machinery/computer/security/telescreen/entertainment/tv as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/computer/security/telescreen/entertainment))
tv.update_shows(is_show_active, tv_network_id, announcement)
set_network_broadcast_status(tv_network_id, is_show_active, announcement)
1 change: 1 addition & 0 deletions code/game/objects/effects/cursor_catcher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
icon_state = "fullscreen_blocker" // Fullscreen semi transparent icon
plane = HUD_PLANE
mouse_opacity = MOUSE_OPACITY_ICON
default_click = TRUE
/// The mob whose cursor we are tracking.
var/mob/owner
/// Client view size of the scoping mob.
Expand Down
5 changes: 5 additions & 0 deletions code/modules/bitrunning/objects/quantum_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
data["ready"] = server.is_ready && server.is_operational
data["scanner_tier"] = server.scanner_tier
data["retries_left"] = length(server.exit_turfs) - server.retries_spent
data["broadcasting"] = server.broadcasting
data["broadcasting_on_cd"] = !COOLDOWN_FINISHED(server, broadcast_toggle_cd)

return data

Expand Down Expand Up @@ -83,6 +85,9 @@
if("stop_domain")
server.begin_shutdown(usr)
return TRUE
if("broadcast")
server.toggle_broadcast()
return TRUE

return FALSE

Expand Down
4 changes: 4 additions & 0 deletions code/modules/bitrunning/server/_parent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
var/threat = 0
/// The turfs we can place a hololadder on.
var/turf/exit_turfs = list()
/// Determines if we broadcast to entertainment monitors or not
var/broadcasting = FALSE
/// Cooldown between being able to toggle broadcasting
COOLDOWN_DECLARE(broadcast_toggle_cd)

/obj/machinery/quantum_server/Initialize(mapload)
. = ..()
Expand Down
11 changes: 8 additions & 3 deletions code/modules/bitrunning/server/map_handling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
return FALSE

if(isnull(map_key))
balloon_alert_to_viewers("no domain specified.")
balloon_alert_to_viewers("no domain specified!")
return FALSE

if(generated_domain)
balloon_alert_to_viewers("stop the current domain first.")
balloon_alert_to_viewers("stop the current domain first!")
return FALSE

if(length(avatar_connection_refs))
Expand All @@ -46,7 +46,7 @@

/// If any one of these fail, it reverts the entire process
if(!load_domain(map_key) || !load_map_items() || !load_mob_segments())
balloon_alert_to_viewers("initialization failed.")
balloon_alert_to_viewers("initialization failed!")
scrub_vdom()
is_ready = TRUE
return FALSE
Expand All @@ -63,6 +63,9 @@
update_use_power(ACTIVE_POWER_USE)
update_appearance()

if(broadcasting)
start_broadcasting_network(BITRUNNER_CAMERA_NET)

return TRUE

/// Initializes a new domain if the given key is valid and the user has enough points
Expand Down Expand Up @@ -147,6 +150,8 @@
domain_randomized = FALSE
retries_spent = 0

stop_broadcasting_network(BITRUNNER_CAMERA_NET)

/// Tries to clean up everything in the domain
/obj/machinery/quantum_server/proc/scrub_vdom()
sever_connections() /// just in case someone's connected
Expand Down
7 changes: 7 additions & 0 deletions code/modules/bitrunning/server/obj_generation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@

SSid_access.apply_trim_to_card(outfit_id, /datum/id_trim/bit_avatar)

avatar.AddComponent( \
/datum/component/simple_bodycam, \
camera_name = "bitrunner bodycam", \
c_tag = "Avatar [avatar.real_name]", \
network = BITRUNNER_CAMERA_NET, \
emp_proof = TRUE, \
)
return avatar

/// Generates a new hololadder for the bitrunner. Effectively a respawn attempt.
Expand Down
14 changes: 14 additions & 0 deletions code/modules/bitrunning/server/util.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,17 @@
return chosen_turf

#undef MAX_DISTANCE

/// Toggles broadcast on and off
/obj/machinery/quantum_server/proc/toggle_broadcast()
if(!COOLDOWN_FINISHED(src, broadcast_toggle_cd))
return FALSE

broadcasting = !broadcasting

if(generated_domain)
// The cooldown only really matter is we're flipping TVs
COOLDOWN_START(src, broadcast_toggle_cd, 5 SECONDS)
// And we only flip TVs when there's a domain, because otherwise there's no cams to watch
set_network_broadcast_status(BITRUNNER_CAMERA_NET, broadcasting)
return TRUE
2 changes: 1 addition & 1 deletion code/modules/mod/modules/module_kinesis.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
kinesis_beam = mod.wearer.Beam(grabbed_atom, "kinesis")
kinesis_catcher = mod.wearer.overlay_fullscreen("kinesis", /atom/movable/screen/fullscreen/cursor_catcher/kinesis, 0)
kinesis_catcher.assign_to_mob(mod.wearer)
RegisterSignal(kinesis_catcher, COMSIG_CLICK, PROC_REF(on_catcher_click))
RegisterSignal(kinesis_catcher, COMSIG_SCREEN_ELEMENT_CLICK, PROC_REF(on_catcher_click))
soundloop.start()
START_PROCESSING(SSfastprocess, src)

Expand Down
8 changes: 5 additions & 3 deletions code/modules/projectiles/ammunition/ballistic/rocket.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/obj/item/ammo_casing/rocket
name = "\improper PM-9HE"
name = "\improper Dardo HE rocket"
desc = "An 84mm High Explosive rocket. Fire at people and pray."
caliber = CALIBER_84MM
icon_state = "srm-8"
Expand All @@ -15,15 +15,17 @@
icon_state = "[base_icon_state]"

/obj/item/ammo_casing/rocket/heap
name = "\improper PM-9HEAP"
name = "\improper Dardo HE-AP rocket"
desc = "An 84mm High Explosive All Purpose rocket. For when you just need something to not exist anymore."
icon_state = "84mm-heap"
base_icon_state = "84mm-heap"
projectile_type = /obj/projectile/bullet/rocket/heap

/obj/item/ammo_casing/rocket/weak
name = "\improper PM-9HE Low-Yield"
name = "\improper Dardo HE Low-Yield rocket"
desc = "An 84mm High Explosive rocket. This one isn't quite as devastating."
icon_state = "low_yield_rocket"
base_icon_state = "low_yield_rocket"
projectile_type = /obj/projectile/bullet/rocket/weak

/obj/item/ammo_casing/a75
Expand Down
Loading

0 comments on commit ddbe345

Please sign in to comment.