mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-23 16:42:13 +00:00
The station alert console no longer uses the old interact proc() to open the window interface. Makes the records computers use the ui_interact proc to show the window. This fixes https://github.com/PolarisSS13/Polaris/issues/537. The station alert console now registers alarms using the correct procs. The proper fingerprint type should now be applied during Topic() call (this means that admin observer object NanoUI interactions now have a degree of logging).
174 lines
4.8 KiB
Plaintext
174 lines
4.8 KiB
Plaintext
/obj
|
|
//Used to store information about the contents of the object.
|
|
var/list/matter
|
|
var/w_class // Size of the object.
|
|
var/list/origin_tech = null //Used by R&D to determine what research bonuses it grants.
|
|
var/unacidable = 0 //universal "unacidabliness" var, here so you can use it in any obj.
|
|
animate_movement = 2
|
|
var/throwforce = 1
|
|
var/list/attack_verb = list() //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"
|
|
var/sharp = 0 // whether this object cuts
|
|
var/edge = 0 // whether this object is more likely to dismember
|
|
var/in_use = 0 // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING!
|
|
var/damtype = "brute"
|
|
var/force = 0
|
|
var/armor_penetration = 0
|
|
|
|
/obj/Destroy()
|
|
processing_objects -= src
|
|
return ..()
|
|
|
|
/obj/Topic(href, href_list, var/datum/topic_state/state = default_state)
|
|
if(..())
|
|
return 1
|
|
|
|
// In the far future no checks are made in an overriding Topic() beyond if(..()) return
|
|
// Instead any such checks are made in CanUseTopic()
|
|
if(CanUseTopic(usr, state, href_list) == STATUS_INTERACTIVE)
|
|
CouldUseTopic(usr)
|
|
return 0
|
|
|
|
CouldNotUseTopic(usr)
|
|
return 1
|
|
|
|
/obj/CanUseTopic(var/mob/user, var/datum/topic_state/state)
|
|
if(user.CanUseObjTopic(src))
|
|
return ..()
|
|
user << "<span class='danger'>\icon[src]Access Denied!</span>"
|
|
return STATUS_CLOSE
|
|
|
|
/mob/living/silicon/CanUseObjTopic(var/obj/O)
|
|
var/id = src.GetIdCard()
|
|
return O.check_access(id)
|
|
|
|
/mob/proc/CanUseObjTopic()
|
|
return 1
|
|
|
|
/obj/proc/CouldUseTopic(var/mob/user)
|
|
user.AddTopicPrint(src)
|
|
|
|
/mob/proc/AddTopicPrint(var/obj/target)
|
|
target.add_hiddenprint(src)
|
|
|
|
/mob/living/AddTopicPrint(var/obj/target)
|
|
if(Adjacent(target))
|
|
target.add_fingerprint(src)
|
|
else
|
|
target.add_hiddenprint(src)
|
|
|
|
/mob/living/silicon/ai/AddTopicPrint(var/obj/target)
|
|
target.add_hiddenprint(src)
|
|
|
|
/obj/proc/CouldNotUseTopic(var/mob/user)
|
|
// Nada
|
|
|
|
/obj/item/proc/is_used_on(obj/O, mob/user)
|
|
|
|
/obj/proc/process()
|
|
processing_objects.Remove(src)
|
|
return 0
|
|
|
|
/obj/assume_air(datum/gas_mixture/giver)
|
|
if(loc)
|
|
return loc.assume_air(giver)
|
|
else
|
|
return null
|
|
|
|
/obj/remove_air(amount)
|
|
if(loc)
|
|
return loc.remove_air(amount)
|
|
else
|
|
return null
|
|
|
|
/obj/return_air()
|
|
if(loc)
|
|
return loc.return_air()
|
|
else
|
|
return null
|
|
|
|
/obj/proc/updateUsrDialog()
|
|
if(in_use)
|
|
var/is_in_use = 0
|
|
var/list/nearby = viewers(1, src)
|
|
for(var/mob/M in nearby)
|
|
if ((M.client && M.machine == src))
|
|
is_in_use = 1
|
|
src.attack_hand(M)
|
|
if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
|
|
if (!(usr in nearby))
|
|
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
|
|
is_in_use = 1
|
|
src.attack_ai(usr)
|
|
|
|
// check for TK users
|
|
|
|
if (istype(usr, /mob/living/carbon/human))
|
|
if(istype(usr.l_hand, /obj/item/tk_grab) || istype(usr.r_hand, /obj/item/tk_grab/))
|
|
if(!(usr in nearby))
|
|
if(usr.client && usr.machine==src)
|
|
is_in_use = 1
|
|
src.attack_hand(usr)
|
|
in_use = is_in_use
|
|
|
|
/obj/proc/updateDialog()
|
|
// Check that people are actually using the machine. If not, don't update anymore.
|
|
if(in_use)
|
|
var/list/nearby = viewers(1, src)
|
|
var/is_in_use = 0
|
|
for(var/mob/M in nearby)
|
|
if ((M.client && M.machine == src))
|
|
is_in_use = 1
|
|
src.interact(M)
|
|
var/ai_in_use = AutoUpdateAI(src)
|
|
|
|
if(!ai_in_use && !is_in_use)
|
|
in_use = 0
|
|
|
|
/obj/attack_ghost(mob/user)
|
|
ui_interact(user)
|
|
..()
|
|
|
|
/obj/proc/interact(mob/user)
|
|
return
|
|
|
|
/obj/proc/update_icon()
|
|
return
|
|
|
|
/mob/proc/unset_machine()
|
|
src.machine = null
|
|
|
|
/mob/proc/set_machine(var/obj/O)
|
|
if(src.machine)
|
|
unset_machine()
|
|
src.machine = O
|
|
if(istype(O))
|
|
O.in_use = 1
|
|
|
|
/obj/item/proc/updateSelfDialog()
|
|
var/mob/M = src.loc
|
|
if(istype(M) && M.client && M.machine == src)
|
|
src.attack_self(M)
|
|
|
|
/obj/proc/hide(var/hide)
|
|
invisibility = hide ? INVISIBILITY_MAXIMUM : initial(invisibility)
|
|
|
|
/obj/proc/hides_under_flooring()
|
|
return level == 1
|
|
|
|
/obj/proc/hear_talk(mob/M as mob, text, verb, datum/language/speaking)
|
|
if(talking_atom)
|
|
talking_atom.catchMessage(text, M)
|
|
/*
|
|
var/mob/mo = locate(/mob) in src
|
|
if(mo)
|
|
var/rendered = "<span class='game say'><span class='name'>[M.name]: </span> <span class='message'>[text]</span></span>"
|
|
mo.show_message(rendered, 2)
|
|
*/
|
|
return
|
|
|
|
/obj/proc/see_emote(mob/M as mob, text, var/emote_type)
|
|
return
|
|
|
|
/obj/proc/show_message(msg, type, alt, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2)
|
|
return
|