Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. /obj/machinery/door/airlock/proc/synhack(mob/user as mob)
  2. if (src.synHacking==0)
  3. src.synHacking=1
  4. spawn(20)
  5. user << "Jacking in. Stay close to the airlock or you'll rip the cables out and we'll have to start over."
  6. sleep(25)
  7. if (src.canSynControl())
  8. user << "Hack cancelled, control already possible."
  9. src.synHacking=0
  10. return
  11. else if (!src.canSynHack())
  12. user << "\red Connection lost. Stand still and stay near the airlock!"
  13. src.synHacking=0
  14. return
  15. user << "Connection established."
  16. sleep(10)
  17. user << "Attempting to hack into airlock. This may take some time."
  18. sleep(100)
  19.  
  20. // Alerting the AIs
  21.  
  22. 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
  23. for (var/obj/machinery/camera/C in src.loc.loc.contents) // getting all cameras in the area
  24. cameras += C
  25.  
  26. if(prob(15)) //15% chance of sending the AI all the details
  27. var/alertoption = 3
  28. else if (prob(18)) //18% chance of sending the AI just the area
  29. var/alertoption = 2
  30. else //100% chance of sending the AI a message that an airlock is being hacked, no other details
  31. var/alertoption = 1
  32.  
  33. for (var/mob/living/silicon/ai/aiPlayer in world)
  34. if (aiPlayer.stat != 2)
  35. switch(alertoption)
  36. if(3) aiPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc, cameras)
  37. if(2) aiPlayer.triggerUnmarkedAlarm("AirlockHacking", src.loc)
  38. if(1) aiPlayer.triggerUnmarkedAlarm("AirlockHacking")
  39. // ...And done
  40.  
  41. if (!src.canSynHack())
  42. user << "\red Hack aborted: landline connection lost. Stay closer to the airlock."
  43. src.synHacking=0
  44. return
  45. else if (src.canSynControl())
  46. user << "Local override already in place, hack aborted."
  47. src.synHacking=0
  48. return
  49. user << "Upload access confirmed. Loading control program into airlock software."
  50. sleep(85)
  51. if (!src.canSynHack())
  52. user << "\red Hack aborted: cable connection lost. Do not move away from the airlock."
  53. src.synHacking=0
  54. return
  55. else if (src.canSynControl())
  56. user << "Upload access aborted, local override already in place."
  57. src.synHacking=0
  58. return
  59. user << "Transfer complete. Forcing airlock to execute program."
  60. sleep(25)
  61. //disable blocked control
  62. src.synDoorHacked = 1
  63. user << "Bingo! We're in. Airlock control panel coming right up."
  64. sleep(5)
  65. //bring up airlock dialog
  66. src.synHacking = 0
  67. src.attack_hack(user)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement