Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Entertainment monitor #5900

Merged
merged 21 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
if(isturf(A) && get_dist(src, A) <= 1)
Move_Pulled(A)

A.view_act(src)


/**
* Checks if this mob is in a valid state to punch someone.
Expand Down
3 changes: 3 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@
/atom/proc/mech_melee_attack(obj/mecha/M)
return

/atom/proc/view_act(mob/user)
return

/atom/proc/CheckParts(list/parts_list)
for(var/A in parts_list)
if(istype(A, /datum/reagent))
Expand Down
19 changes: 19 additions & 0 deletions code/game/machinery/computer/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,25 @@
icon_screen = length(GLOB.active_video_cameras) ? icon_screen_on : initial(icon_screen)
return ..()

/obj/machinery/computer/security/telescreen/entertainment/ui_state(mob/user)
if(issilicon(user))
if(isAI(user))
var/mob/living/silicon/ai/AI = user
if(!AI.lacks_power() || AI.apc_override)
return GLOB.always_state
if(isrobot(user))
return GLOB.always_state
dictor31 marked this conversation as resolved.
Show resolved Hide resolved

else if(ishuman(user))
for(var/obj/machinery/computer/security/telescreen/entertainment/TV in range(6, user))
if(!TV.stat)
return GLOB.range_state

return GLOB.default_state

/obj/machinery/computer/security/telescreen/entertainment/view_act(mob/user)
attack_hand(user)
dictor31 marked this conversation as resolved.
Show resolved Hide resolved


/obj/machinery/computer/security/telescreen/singularity
name = "Singularity Engine Telescreen"
Expand Down
12 changes: 12 additions & 0 deletions code/modules/tgui/states/range.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
GLOBAL_DATUM_INIT(range_state, /datum/ui_state/range_state, new)

/datum/ui_state/range_state/can_use_topic(src_object, mob/user)
. = user.default_can_use_topic(src_object)
var/dist = get_dist(src_object, user)
if(dist <= 1)
return UI_INTERACTIVE

else if(dist <= 6)
return UI_UPDATE

return UI_CLOSE
dictor31 marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3103,6 +3103,7 @@
#include "code\modules\tgui\plugins\modal.dm"
#include "code\modules\tgui\states\admin.dm"
#include "code\modules\tgui\states\always.dm"
#include "code\modules\tgui\states\range.dm"
#include "code\modules\tgui\states\conscious.dm"
#include "code\modules\tgui\states\contained.dm"
#include "code\modules\tgui\states\deep_inventory.dm"
Expand Down
Loading