Skip to content

Commit

Permalink
Try 2.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
dictor31 committed Sep 12, 2024
1 parent c9ee220 commit 15b2e57
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
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

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)


/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
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3102,6 +3102,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

0 comments on commit 15b2e57

Please sign in to comment.