Files
Paradise/code/modules/tgui/states/default.dm
GDN f13586300f pulse demon reopened PR (#21969)
* proof-of-concept implementation

* clear being_hijacked on death

* it glows in the dark

* oops

* machinery interactions and some fixes

* consistency, correctness, fixes

* stop usage of the \the text macro

* list inits in Initialize

* fix control flow spacing

* review compliance

* event code and some tweaks

* upgradable spell abilities and some tweaks

* how did that happen

* cycle cameras spell

* stat upgrades (no sprites for now)

* tweaking

* sounds

* jecties code

* more tweaks and fixes

* some review stuff

* alt-click user param and charger icon fix

* Remove unused default amounts in objectives

* Comply with sirryan review (part 1)

* Move isapc definition

* Add autodoc comments to all pulse_demon vars

* Give random number in name on init

* Fix merge conflicts

* Remove pulse demon from traitors on Destroy

* Fix mulebot relaymove override

* Fix airlock TGUI actions

* Fix loop over mobs in cablehop

* Attempt to fix overload runtime

* Half-fix gun cooldown issue

* Fix chat related issues

* Attempt to fix overload runtime (take 2)

* Make ion projectiles collide

* Tweak pulse demon speed

* Make demon survive loc being deleted

* Send message when saved by self-sustaining

* Fix vv_edit_var for charge

* Stop people disabling hijacked bots

* Make demon lose more health when not on wires

* Increase costs of stat upgrades

* Allow demon to change its drain speed

* Stop demon obliterating xenos

* Comply with review (partial)

* Fix issues pointed out in reviews

* Allow demon to drain charge of reachable items

* Adjust volume of demon sounds

* Improve cell interactions

* Bump up event weight (for testmerge)

* Give pulse demon a highlight section on orbit menu

* Give demon an experimental soft-counter to insuls

* Reduce volume of most common sounds (again)

* Update demon cable overlay when required

* Stop AI using its tracking ability on pulse demons

* Add wizard spawner for pulse demon

* Tweak EMP behaviour and numbers

* Clear references in Destroy

* Make appear on end of round credits even when dead

* Prevent pulse demon from detonating cyborgs

* Generalise insulated structure check

* Clean up remaining review requests

* Add new sprites

* some addressed reviews

* Typepath changes, GC fixes

* I blame charlie

* good enough

* die or something

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon_interactions.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon_interactions.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* even more changes

* final tweaks

* what

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon_interactions.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon_abilities.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* bam

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* to_chatn't

* deconflicted

---------

Co-authored-by: unknownuser782 <126365777+unknownuser782@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
2023-09-20 16:25:13 +01:00

77 lines
2.7 KiB
Plaintext

/**
* tgui state: default_state
*
* Checks a number of things -- mostly physical distance for humans and view for robots.
*/
GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
/datum/ui_state/default/can_use_topic(src_object, mob/user)
return user.default_can_use_topic(src_object) // Call the individual mob-overridden procs.
/mob/proc/default_can_use_topic(src_object)
return STATUS_CLOSE // Don't allow interaction by default.
/mob/living/default_can_use_topic(src_object)
. = shared_ui_interaction(src_object)
if(. > STATUS_CLOSE && loc)
. = min(., loc.contents_ui_distance(src_object, src)) // Check the distance...
if(. == STATUS_INTERACTIVE) // Non-human living mobs can only look, not touch.
return STATUS_UPDATE
/mob/living/carbon/human/default_can_use_topic(src_object)
. = shared_ui_interaction(src_object)
if(. > STATUS_CLOSE)
. = min(., shared_living_ui_distance(src_object)) // Check the distance...
/mob/living/silicon/robot/default_can_use_topic(src_object)
. = shared_ui_interaction(src_object)
if(. <= STATUS_DISABLED)
return
// Robots can interact with anything they can see.
var/list/clientviewlist = getviewsize(client.view)
if((src_object in view(src)) && (get_dist(src, src_object) <= max(clientviewlist[1], clientviewlist[2])))
return STATUS_INTERACTIVE
return STATUS_DISABLED // Otherwise they can keep the UI open.
/mob/living/silicon/ai/default_can_use_topic(src_object)
. = shared_ui_interaction(src_object)
if(. < STATUS_INTERACTIVE)
return
// The AI can interact with anything it can see nearby, or with cameras while wireless control is enabled.
if(!control_disabled && can_see(src_object))
return STATUS_INTERACTIVE
return STATUS_CLOSE
/mob/living/simple_animal/revenant/default_can_use_topic(src_object)
return STATUS_UPDATE
/mob/living/simple_animal/demon/pulse_demon/default_can_use_topic(src_object)
. = shared_ui_interaction(src_object)
if(. < STATUS_INTERACTIVE)
return
// anything in its APC's area
if(get_area(src_object) == controlling_area)
return STATUS_INTERACTIVE
return STATUS_CLOSE
/mob/living/simple_animal/default_can_use_topic(src_object)
. = shared_ui_interaction(src_object)
if(. > STATUS_CLOSE)
. = min(., shared_living_ui_distance(src_object)) //simple animals can only use things they're near.
/mob/living/silicon/pai/default_can_use_topic(src_object)
// pAIs can only use themselves and the owner's radio.
if((src_object == src || src_object == radio) && !stat)
return STATUS_INTERACTIVE
else
return ..()
/mob/dead/observer/default_can_use_topic()
if(can_admin_interact())
return STATUS_INTERACTIVE // Admins are more equal
return STATUS_UPDATE // Ghosts can view updates