hijack implant
This commit is contained in:
@@ -701,7 +701,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
return
|
||||
|
||||
/obj/item/pda/proc/remove_id(mob/user)
|
||||
if(issilicon(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
if(hasSiliconAccessInArea(user,get_area(src)) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
do_remove_id(user)
|
||||
|
||||
@@ -869,7 +869,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
remove_pen()
|
||||
|
||||
/obj/item/pda/proc/toggle_light()
|
||||
if(issilicon(usr) || !usr.canUseTopic(src, BE_CLOSE))
|
||||
if(hasSiliconAccessInArea(usr,get_area(src)) || !usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if(fon)
|
||||
fon = FALSE
|
||||
@@ -881,7 +881,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
|
||||
/obj/item/pda/proc/remove_pen()
|
||||
|
||||
if(issilicon(usr) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
if(hasSiliconAccessInArea(usr,get_area(src)) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
|
||||
if(inserted_item)
|
||||
|
||||
@@ -587,7 +587,7 @@ Code:
|
||||
/obj/item/cartridge/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if(!usr.canUseTopic(src, !issilicon(usr)))
|
||||
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
|
||||
usr.unset_machine()
|
||||
usr << browse(null, "window=pda")
|
||||
return
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
#define HIJACK_APC_MAX_AMOUNT 4
|
||||
|
||||
/obj/item/implant/hijack
|
||||
name = "hijack implant"
|
||||
desc = "Allows you to control the machinery in a room by hacking into the APC."
|
||||
actions_types = list(/datum/action/item_action/hands_free/activate, /datum/action/item_action/removeAPCs, /datum/action/item_action/accessAPCs)
|
||||
activated = 1
|
||||
var/toggled = FALSE
|
||||
icon_state = "hijack"
|
||||
var/eye_color
|
||||
|
||||
/obj/item/implant/hijack/activate()
|
||||
. = ..()
|
||||
toggled = !toggled
|
||||
if (toggled)
|
||||
imp_in.click_intercept = src
|
||||
imp_in.siliconaccesstoggle = TRUE
|
||||
to_chat(imp_in,"<span class='notice'>You turn on [src]'s silicon interactions.</span>")
|
||||
if (ishuman(imp_in))
|
||||
var/mob/living/carbon/human/H = imp_in
|
||||
H.eye_color = "ff0"
|
||||
H.dna.update_ui_block(DNA_EYE_COLOR_BLOCK)
|
||||
H.update_body()
|
||||
else
|
||||
imp_in.click_intercept = null
|
||||
imp_in.siliconaccesstoggle = FALSE
|
||||
to_chat(imp_in,"<span class='notice'>You turn off [src]'s silicon interactions.</span>")
|
||||
if (ishuman(imp_in))
|
||||
var/mob/living/carbon/human/H = imp_in
|
||||
H.eye_color = eye_color
|
||||
H.dna.update_ui_block(DNA_EYE_COLOR_BLOCK)
|
||||
H.update_body()
|
||||
|
||||
/obj/item/implant/hijack/implant(mob/living/target, mob/user, silent = FALSE)
|
||||
if(..())
|
||||
ADD_TRAIT(target, TRAIT_HIJACKER, "implant")
|
||||
if (ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
eye_color = H.eye_color
|
||||
return TRUE
|
||||
|
||||
/obj/item/implant/hijack/removed(mob/target, silent = FALSE, special = 0)
|
||||
if(..())
|
||||
REMOVE_TRAIT(target, TRAIT_HIJACKER, "implant")
|
||||
if (ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
H.eye_color = eye_color
|
||||
return TRUE
|
||||
|
||||
/obj/item/implant/hijack/proc/InterceptClickOn(mob/living/user,params,atom/object)
|
||||
if (!toggled)
|
||||
return
|
||||
if (user.get_active_held_item())
|
||||
return
|
||||
if (isitem(object))
|
||||
return
|
||||
var/area/a = get_area(object)
|
||||
if (!hasSiliconAccessInArea(imp_in,a))
|
||||
return
|
||||
var/list/modifiers = params2list(params)
|
||||
imp_in.face_atom(object)
|
||||
if (modifiers["shift"] && modifiers["ctrl"])
|
||||
object.AICtrlShiftClick(imp_in)
|
||||
return TRUE
|
||||
if (modifiers["shift"])
|
||||
object.AIShiftClick(imp_in)
|
||||
return TRUE
|
||||
if (modifiers["ctrl"])
|
||||
object.AICtrlClick(imp_in)
|
||||
return TRUE
|
||||
if (modifiers["alt"])
|
||||
object.AIAltClick(imp_in)
|
||||
return TRUE
|
||||
object.attack_ai(imp_in)
|
||||
return TRUE
|
||||
@@ -74,4 +74,8 @@
|
||||
|
||||
/obj/item/implanter/stealth
|
||||
name = "implanter (stealth)"
|
||||
imp_type = /obj/item/implant/stealth
|
||||
imp_type = /obj/item/implant/stealth
|
||||
|
||||
/obj/item/implanter/hijack
|
||||
name = "implanter (hijack)"
|
||||
imp_type = /obj/item/implant/hijack
|
||||
@@ -125,7 +125,7 @@
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = TRUE
|
||||
ui_interact(M)
|
||||
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr))
|
||||
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr) || hasSiliconAccessInArea(usr,get_area(src)))
|
||||
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 = TRUE
|
||||
|
||||
@@ -168,7 +168,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
|
||||
|
||||
/obj/structure/bodycontainer/morgue/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, !issilicon(user)))
|
||||
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
|
||||
return
|
||||
beeper = !beeper
|
||||
to_chat(user, "<span class='notice'>You turn the speaker function [beeper ? "on" : "off"].</span>")
|
||||
|
||||
Reference in New Issue
Block a user