[MIRROR] silicons can now use machines again (#4212)

* silicons can now use machines again

* Update _machinery.dm

Co-authored-by: ATH1909 <42606352+ATH1909@users.noreply.github.com>
Co-authored-by: KathrinBailey <53862927+KathrinBailey@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-03-17 12:30:15 +00:00
committed by GitHub
co-authored by ATH1909 KathrinBailey
parent 85c5edb794
commit c76e70cafc
+31 -25
View File
@@ -336,15 +336,13 @@
if((machine_stat & (NOPOWER|BROKEN)) && !(interaction_flags_machine & INTERACT_MACHINE_OFFLINE)) // Check if the machine is broken, and if we can still interact with it if so
return FALSE
var/silicon = issilicon(user)
if(panel_open && !(interaction_flags_machine & INTERACT_MACHINE_OPEN)) // Check if we can interact with an open panel machine, if the panel is open
if(!silicon || !(interaction_flags_machine & INTERACT_MACHINE_OPEN_SILICON))
return FALSE
if(isAdminGhostAI(user))
return TRUE //if you're an admin, you probably know what you're doing (or at least have permission to do what you're doing)
if(silicon || isAdminGhostAI(user)) // If we are an AI or adminghsot, make sure the machine allows silicons to interact
if(!(interaction_flags_machine & INTERACT_MACHINE_ALLOW_SILICON))
return FALSE
return TRUE // SKYRAT EDIT - This allows AIs to interact with machines again.
if(!isliving(user))
return FALSE //no ghosts in the machine allowed, sorry
var/mob/living/living_user = user
var/is_dextrous = FALSE
if(isanimal(user))
@@ -352,29 +350,37 @@
if (user_as_animal.dextrous)
is_dextrous = TRUE
if(is_dextrous || user.can_hold_items()) // If we are a living mob with hand slots or a dextrous simple animal.
var/mob/living/L = user
if(interaction_flags_machine & INTERACT_MACHINE_REQUIRES_SILICON) // First make sure the machine doesn't require silicon interaction
if(!issilicon(user) && !is_dextrous && !user.can_hold_items())
return FALSE //spiders gtfo
if(issilicon(user)) // If we are a silicon, make sure the machine allows silicons to interact with it
if(!(interaction_flags_machine & INTERACT_MACHINE_ALLOW_SILICON))
return FALSE
if(interaction_flags_machine & INTERACT_MACHINE_REQUIRES_SIGHT)
if(user.is_blind())
to_chat(user, "<span class='warning'>This machine requires sight to use.</span>")
return FALSE
if(!Adjacent(user)) // Next make sure we are next to the machine unless we have telekinesis
var/mob/living/carbon/H = L
if(!(istype(H) && H.has_dna() && H.dna.check_mutation(TK)))
return FALSE
if(L.incapacitated()) // Finally make sure we aren't incapacitated
if(panel_open && !(interaction_flags_machine & INTERACT_MACHINE_OPEN) && !(interaction_flags_machine & INTERACT_MACHINE_OPEN_SILICON))
return FALSE
else // If we aren't a silicon, living, or admin ghost, bad!
return TRUE //silicons don't care about petty mortal concerns like needing to be next to a machine to use it
if(living_user.incapacitated()) //idk why silicons aren't supposed to care about incapacitation when interacting with machines, but it was apparently like this before
return FALSE
return TRUE // If we pass all these checks, woohoo! We can interact
if((interaction_flags_machine & INTERACT_MACHINE_REQUIRES_SIGHT) && user.is_blind())
to_chat(user, "<span class='warning'>This machine requires sight to use.</span>")
return FALSE
if(panel_open && !(interaction_flags_machine & INTERACT_MACHINE_OPEN))
return FALSE
if(interaction_flags_machine & INTERACT_MACHINE_REQUIRES_SILICON) //if the user was a silicon, we'd have returned out earlier, so the user must not be a silicon
return FALSE
if(!Adjacent(user)) // Next make sure we are next to the machine unless we have telekinesis
var/mob/living/carbon/carbon_user = living_user
if(!istype(carbon_user) || !carbon_user.has_dna() || !carbon_user.dna.check_mutation(TK))
return FALSE
return TRUE // If we passed all of those checks, woohoo! We can interact with this machine.
/obj/machinery/proc/check_nap_violations()
if(!SSeconomy.full_ancap)