Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /obj/machinery/door/airlock/proc/synhack(mob/user as mob)
- if (src.synHacking==0)
- src.synHacking=1
- spawn(20)
- user << "Jacking in. Stay close to the airlock or you'll rip the cables out and we'll have to start over."
- sleep(25)
- if (src.canSynControl())
- user << "Hack cancelled, control already possible."
- src.synHacking=0
- return
- else if (!src.canSynHack())
- user << "\red Connection lost. Stand still and stay near the airlock!"
- src.synHacking=0
- return
- user << "Connection established."
- sleep(10)
- user << "Attempting to hack into airlock. This may take some time."
- sleep(100)
- // Alerting the AIs
- var/list/cameras = list() // only do this and the next two rows once; do not repeat them if you want to send the AI another round of messages
- for (var/obj/machinery/camera/C in src.loc.loc.contents) // getting all cameras in the area
- cameras += C
- if(prob(15)) //15% chance of sending the AI all the details
- var/alertoption = 3
- else if (prob(18)) //18% chance of sending the AI just the area
- var/alertoption = 2
- else //100% chance of sending the AI a message that an airlock is being hacked, no other details
- var/alertoption = 1
- for (var/mob/living/silicon/ai/aiPlayer in world)
- if (aiPlayer.stat != 2)
- switch(alertoption)
- if(3) aiPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc, cameras)
- if(2) aiPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc)
- if(1) aiPlayer.triggerUnmarkedAlarm("AirlockHacking")
- // ...And done
- if (!src.canSynHack())
- user << "\red Hack aborted: landline connection lost. Stay closer to the airlock."
- src.synHacking=0
- return
- else if (src.canSynControl())
- user << "Local override already in place, hack aborted."
- src.synHacking=0
- return
- user << "Upload access confirmed. Loading control program into airlock software."
- sleep(85)
- if (!src.canSynHack())
- user << "\red Hack aborted: cable connection lost. Do not move away from the airlock."
- src.synHacking=0
- return
- else if (src.canSynControl())
- user << "Upload access aborted, local override already in place."
- src.synHacking=0
- return
- user << "Transfer complete. Forcing airlock to execute program."
- sleep(25)
- //disable blocked control
- src.synDoorHacked = 1
- user << "Bingo! We're in. Airlock control panel coming right up."
- sleep(5)
- //bring up airlock dialog
- src.synHacking = 0
- src.attack_hack(user)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement