Advertisement
EditorRUS

screen.dm

Nov 27th, 2012
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.46 KB | None | 0 0
  1. /obj/screen
  2. name = "screen"
  3. icon = 'screen1.dmi'
  4. layer = 20.0
  5. unacidable = 1
  6. var/id = 0.0
  7. var/obj/master
  8. var/gun_click_time = -100 //I'm lazy.
  9.  
  10. /obj/screen/close
  11. name = "close"
  12. master = null
  13.  
  14. /obj/screen/close/DblClick()
  15. if (src.master)
  16. src.master:close(usr)
  17. return
  18.  
  19. /obj/screen/grab
  20. name = "grab"
  21. master = null
  22.  
  23. /obj/screen/storage
  24. name = "storage"
  25. master = null
  26.  
  27. /obj/screen/storage/attackby(W, mob/user as mob)
  28. src.master.attackby(W, user)
  29. return
  30.  
  31. /obj/screen/zone_sel
  32. name = "Damage Zone"
  33. icon = 'zone_sel.dmi'
  34. icon_state = "blank"
  35. var/selecting = "chest"
  36. screen_loc = ui_zonesel
  37.  
  38. /obj/screen/gun
  39. name = "gun"
  40. icon = 'screen1.dmi'
  41. master = null
  42. dir = 2
  43.  
  44. move
  45. name = "Allow Walking"
  46. icon_state = "no_walk"
  47. screen_loc = ui_gun2
  48.  
  49. run
  50. name = "Allow Running"
  51. icon_state = "no_run"
  52. screen_loc = ui_gun3
  53.  
  54. item
  55. name = "Allow Item Use"
  56. icon_state = "no_item"
  57. screen_loc = ui_gun1
  58.  
  59. mode
  60. name = "Toggle Gun Mode"
  61. desc = "The shortcut key for this is \"F6\""
  62. icon_state = "gun"
  63. screen_loc = ui_gun_select
  64. dir = 1
  65.  
  66. /obj/screen/zone_sel/MouseDown(location, control,params)
  67. // Changes because of 4.0
  68. var/list/PL = params2list(params)
  69. var/icon_x = text2num(PL["icon-x"])
  70. var/icon_y = text2num(PL["icon-y"])
  71.  
  72. if (icon_y < 2)
  73. return
  74. else if (icon_y < 5)
  75. if ((icon_x > 9 && icon_x < 23))
  76. if (icon_x < 16)
  77. selecting = "r_foot"
  78. else
  79. selecting = "l_foot"
  80. else if (icon_y < 11)
  81. if ((icon_x > 11 && icon_x < 21))
  82. if (icon_x < 16)
  83. selecting = "r_leg"
  84. else
  85. selecting = "l_leg"
  86. else if (icon_y < 12)
  87. if ((icon_x > 11 && icon_x < 21))
  88. if (icon_x < 14)
  89. selecting = "r_leg"
  90. else if (icon_x < 19)
  91. selecting = "groin"
  92. else
  93. selecting = "l_leg"
  94. else
  95. return
  96. else if (icon_y < 13)
  97. if ((icon_x > 7 && icon_x < 25))
  98. if (icon_x < 12)
  99. selecting = "r_hand"
  100. else if (icon_x < 13)
  101. selecting = "r_leg"
  102. else if (icon_x < 20)
  103. selecting = "groin"
  104. else if (icon_x < 21)
  105. selecting = "l_leg"
  106. else
  107. selecting = "l_hand"
  108. else
  109. return
  110. else if (icon_y < 14)
  111. if ((icon_x > 7 && icon_x < 25))
  112. if (icon_x < 12)
  113. selecting = "r_hand"
  114. else if (icon_x < 21)
  115. selecting = "groin"
  116. else
  117. selecting = "l_hand"
  118. else
  119. return
  120. else if (icon_y < 16)
  121. if ((icon_x > 7 && icon_x < 25))
  122. if (icon_x < 13)
  123. selecting = "r_hand"
  124. else if (icon_x < 20)
  125. selecting = "chest"
  126. else
  127. selecting = "l_hand"
  128. else
  129. return
  130. else if (icon_y < 23)
  131. if ((icon_x > 7 && icon_x < 25))
  132. if (icon_x < 12)
  133. selecting = "r_arm"
  134. else if (icon_x < 21)
  135. selecting = "chest"
  136. else
  137. selecting = "l_arm"
  138. else
  139. return
  140. else if (icon_y < 24)
  141. if ((icon_x > 11 && icon_x < 21))
  142. selecting = "chest"
  143. else
  144. return
  145. else if (icon_y < 25)
  146. if ((icon_x > 11 && icon_x < 21))
  147. if (icon_x < 16)
  148. selecting = "head"
  149. else if (icon_x < 17)
  150. selecting = "mouth"
  151. else
  152. selecting = "head"
  153. else
  154. return
  155. else if (icon_y < 26)
  156. if ((icon_x > 11 && icon_x < 21))
  157. if (icon_x < 15)
  158. selecting = "head"
  159. else if (icon_x < 18)
  160. selecting = "mouth"
  161. else
  162. selecting = "head"
  163. else
  164. return
  165. else if (icon_y < 27)
  166. if ((icon_x > 11 && icon_x < 21))
  167. if (icon_x < 15)
  168. selecting = "head"
  169. else if (icon_x < 16)
  170. selecting = "eyes"
  171. else if (icon_x < 17)
  172. selecting = "mouth"
  173. else if (icon_x < 18)
  174. selecting = "eyes"
  175. else
  176. selecting = "head"
  177. else
  178. return
  179. else if (icon_y < 28)
  180. if ((icon_x > 11 && icon_x < 21))
  181. if (icon_x < 14)
  182. selecting = "head"
  183. else if (icon_x < 19)
  184. selecting = "eyes"
  185. else
  186. selecting = "head"
  187. else
  188. return
  189. else if (icon_y < 29)
  190. if ((icon_x > 11 && icon_x < 21))
  191. if (icon_x < 15)
  192. selecting = "head"
  193. else if (icon_x < 16)
  194. selecting = "eyes"
  195. else if (icon_x < 17)
  196. selecting = "head"
  197. else if (icon_x < 18)
  198. selecting = "eyes"
  199. else
  200. selecting = "head"
  201. else
  202. return
  203. else if (icon_y < 31)
  204. if ((icon_x > 11 && icon_x < 21))
  205. selecting = "head"
  206. else
  207. return
  208. else
  209. return
  210.  
  211. overlays = null
  212. overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", selecting))
  213.  
  214. return
  215.  
  216. /obj/screen/grab/Click()
  217. master:s_click(src)
  218. return
  219.  
  220. /obj/screen/grab/DblClick()
  221. master:s_dbclick(src)
  222. return
  223.  
  224. /obj/screen/grab/attack_hand()
  225. return
  226.  
  227. /obj/screen/grab/attackby()
  228. return
  229.  
  230. /obj/screen/MouseEntered(object,location,control,params)
  231. if(!ishuman(usr) && !istype(usr,/mob/living/carbon/alien/humanoid) && !islarva(usr) && !ismonkey(usr))
  232. return
  233. switch(name)
  234. /*
  235. if("other")
  236. if (usr.hud_used.show_otherinventory)
  237. usr.hud_used.show_otherinventory = 0
  238. usr.client.screen -= usr.hud_used.other
  239. else
  240. usr.hud_used.show_otherinventory = 1
  241. usr.client.screen += usr.hud_used.other
  242.  
  243. usr.hud_used.other_update()*/
  244. if("act_intent")
  245. if(!usr.hud_used.show_intent_icons)
  246. usr.hud_used.show_intent_icons = 1
  247. usr.client.screen += usr.hud_used.intent_small_hud_objects
  248. if("harm")
  249. if(!usr.hud_used.show_intent_icons)
  250. usr.hud_used.show_intent_icons = 1
  251. usr.client.screen += usr.hud_used.intent_small_hud_objects
  252. if("help")
  253. if(!usr.hud_used.show_intent_icons)
  254. usr.hud_used.show_intent_icons = 1
  255. usr.client.screen += usr.hud_used.intent_small_hud_objects
  256. if("disarm")
  257. if(!usr.hud_used.show_intent_icons)
  258. usr.hud_used.show_intent_icons = 1
  259. usr.client.screen += usr.hud_used.intent_small_hud_objects
  260. if("grab")
  261. if(!usr.hud_used.show_intent_icons)
  262. usr.hud_used.show_intent_icons = 1
  263. usr.client.screen += usr.hud_used.intent_small_hud_objects
  264.  
  265.  
  266. /obj/screen/MouseExited(object,location,control,params)
  267. if(!ishuman(usr) && !istype(usr,/mob/living/carbon/alien/humanoid) && !islarva(usr) && !ismonkey(usr))
  268. return
  269. switch(name)
  270. if("act_intent")
  271. if (usr.hud_used.show_intent_icons)
  272. usr.hud_used.show_intent_icons = 0
  273. usr.client.screen -= usr.hud_used.intent_small_hud_objects
  274. if("harm")
  275. if (usr.hud_used.show_intent_icons)
  276. usr.hud_used.show_intent_icons = 0
  277. usr.client.screen -= usr.hud_used.intent_small_hud_objects
  278. if("help")
  279. if (usr.hud_used.show_intent_icons)
  280. usr.hud_used.show_intent_icons = 0
  281. usr.client.screen -= usr.hud_used.intent_small_hud_objects
  282. if("disarm")
  283. if (usr.hud_used.show_intent_icons)
  284. usr.hud_used.show_intent_icons = 0
  285. usr.client.screen -= usr.hud_used.intent_small_hud_objects
  286. if("grab")
  287. if (usr.hud_used.show_intent_icons)
  288. usr.hud_used.show_intent_icons = 0
  289. usr.client.screen -= usr.hud_used.intent_small_hud_objects
  290.  
  291. /obj/screen/Click(location, control, params)
  292. switch(name)
  293. if("map")
  294. usr.clearmap()
  295.  
  296. if("other")
  297. if (usr.hud_used.show_otherinventory)
  298. usr.hud_used.show_otherinventory = 0
  299. usr.client.screen -= usr.hud_used.other
  300. else
  301. usr.hud_used.show_otherinventory = 1
  302. usr.client.screen += usr.hud_used.other
  303.  
  304. usr.hud_used.other_update()
  305.  
  306. if("equip")
  307. var/obj/item/I = usr.get_active_hand()
  308. if(!I)
  309. usr << "\blue You are not holding anything to equip."
  310. return
  311. if(ishuman(usr))
  312. var/mob/living/carbon/human/H = usr
  313. H.equip_to_appropriate_slot(I)
  314.  
  315. if("maprefresh")
  316. var/obj/machinery/computer/security/seccomp = usr.machine
  317.  
  318. if(seccomp!=null)
  319. seccomp.drawmap(usr)
  320. else
  321. usr.clearmap()
  322.  
  323. if("arrowleft")
  324. switch(usr.a_intent)
  325. if("help")
  326. if(issilicon(usr))
  327. usr.a_intent = "hurt"
  328. usr.hud_used.action_intent.icon_state = "harm"
  329. else
  330. usr.a_intent = "grab"
  331. usr.hud_used.action_intent.icon_state = "grab"
  332.  
  333. if("disarm")
  334. usr.a_intent = "help"
  335. usr.hud_used.action_intent.icon_state = "help"
  336.  
  337. if("hurt")
  338. if(issilicon(usr))
  339. usr.a_intent = "help"
  340. usr.hud_used.action_intent.icon_state = "help"
  341. else
  342. usr.a_intent = "disarm"
  343. usr.hud_used.action_intent.icon_state = "disarm"
  344.  
  345. if("grab")
  346. usr.a_intent = "hurt"
  347. usr.hud_used.action_intent.icon_state = "harm"
  348.  
  349. if("arrowright")
  350. switch(usr.a_intent)
  351. if("help")
  352. if(issilicon(usr))
  353. usr.a_intent = "hurt"
  354. usr.hud_used.action_intent.icon_state = "harm"
  355. else
  356. usr.a_intent = "disarm"
  357. usr.hud_used.action_intent.icon_state = "disarm"
  358.  
  359. if("disarm")
  360. usr.a_intent = "hurt"
  361. usr.hud_used.action_intent.icon_state = "harm"
  362.  
  363. if("hurt")
  364. if(issilicon(usr))
  365. usr.a_intent = "help"
  366. usr.hud_used.action_intent.icon_state = "help"
  367. else
  368. usr.a_intent = "grab"
  369. usr.hud_used.action_intent.icon_state = "grab"
  370.  
  371. if("grab")
  372. usr.a_intent = "help"
  373. usr.hud_used.action_intent.icon_state = "help"
  374.  
  375. if("mov_intent")
  376. switch(usr.m_intent)
  377. if("run")
  378. usr.m_intent = "walk"
  379. usr.hud_used.move_intent.icon_state = "walking"
  380. if("walk")
  381. usr.m_intent = "run"
  382. usr.hud_used.move_intent.icon_state = "running"
  383. if("m_intent")
  384. if (!( usr.m_int ))
  385. switch(usr.m_intent)
  386. if("run")
  387. usr.m_int = "13,14"
  388. if("walk")
  389. usr.m_int = "14,14"
  390. if("face")
  391. usr.m_int = "15,14"
  392. else
  393. usr.m_int = null
  394. if("walk")
  395. usr.m_intent = "walk"
  396. usr.m_int = "14,14"
  397. if("face")
  398. usr.m_intent = "face"
  399. usr.m_int = "15,14"
  400. if("run")
  401. usr.m_intent = "run"
  402. usr.m_int = "13,14"
  403. if("Reset Machine")
  404. usr.machine = null
  405. if("internal")
  406. if ((!( usr.stat ) && usr.canmove && !( usr.restrained() )))
  407. if (usr.internal)
  408. usr.internal = null
  409. usr << "\blue No longer running on internals."
  410. if (usr.internals)
  411. usr.internals.icon_state = "internal0"
  412. else
  413. if(ishuman(usr))
  414. if (!( istype(usr.wear_mask, /obj/item/clothing/mask) ))
  415. usr << "\red You are not wearing a mask"
  416. return
  417. else
  418. if (istype(usr.back, /obj/item/weapon/tank))
  419. usr << "\blue You are now running on internals from the [usr.back] on your back."
  420. usr.internal = usr.back
  421. else if (ishuman(usr) && istype(usr:s_store, /obj/item/weapon/tank))
  422. usr << "\blue You are now running on internals from the [usr:s_store] on your [usr:wear_suit]."
  423. usr.internal = usr:s_store
  424. else if (ishuman(usr) && istype(usr:belt, /obj/item/weapon/tank))
  425. usr << "\blue You are now running on internals from the [usr:belt] on your belt."
  426. usr.internal = usr:belt
  427. else if (istype(usr:l_store, /obj/item/weapon/tank))
  428. usr << "\blue You are now running on internals from the [usr:l_store] in your left pocket."
  429. usr.internal = usr:l_store
  430. else if (istype(usr:r_store, /obj/item/weapon/tank))
  431. usr << "\blue You are now running on internals from the [usr:r_store] in your right pocket."
  432. usr.internal = usr:r_store
  433. else if (istype(usr.l_hand, /obj/item/weapon/tank))
  434. usr << "\blue You are now running on internals from the [usr.l_hand] on your left hand."
  435. usr.internal = usr.l_hand
  436. else if (istype(usr.r_hand, /obj/item/weapon/tank))
  437. usr << "\blue You are now running on internals from the [usr.r_hand] on your right hand."
  438. usr.internal = usr.r_hand
  439. if (usr.internal)
  440. //for(var/mob/M in viewers(usr, 1))
  441. // M.show_message(text("[] is now running on internals.", usr), 1)
  442. if (usr.internals)
  443. usr.internals.icon_state = "internal1"
  444. else
  445. usr << "\blue You don't have an oxygen tank."
  446. if("act_intent")
  447. if(ishuman(usr) || istype(usr,/mob/living/carbon/alien/humanoid) || islarva(usr))
  448. if (usr.hud_used.show_intent_icons)
  449. usr.hud_used.show_intent_icons = 0
  450. usr.client.screen -= usr.hud_used.intent_small_hud_objects
  451. else
  452. usr.hud_used.show_intent_icons = 1
  453. usr.client.screen += usr.hud_used.intent_small_hud_objects
  454. if(issilicon(usr))
  455. if(usr.a_intent == "help")
  456. usr.a_intent = "hurt"
  457. usr.hud_used.action_intent.icon_state = "harm"
  458. else
  459. usr.a_intent = "help"
  460. usr.hud_used.action_intent.icon_state = "help"
  461. if("help")
  462. usr.a_intent = "help"
  463. usr.hud_used.action_intent.icon_state = "help"
  464. usr.hud_used.hurt_intent.icon_state = "harm_small"
  465. usr.hud_used.help_intent.icon_state = "help_small_active"
  466. usr.hud_used.grab_intent.icon_state = "grab_small"
  467. usr.hud_used.disarm_intent.icon_state = "disarm_small"
  468. usr.hud_used.show_intent_icons = 0
  469. usr.client.screen -= usr.hud_used.intent_small_hud_objects
  470. if("harm")
  471. usr.a_intent = "hurt"
  472. usr.hud_used.action_intent.icon_state = "harm"
  473. usr.hud_used.hurt_intent.icon_state = "harm_small_active"
  474. usr.hud_used.help_intent.icon_state = "help_small"
  475. usr.hud_used.grab_intent.icon_state = "grab_small"
  476. usr.hud_used.disarm_intent.icon_state = "disarm_small"
  477. usr.hud_used.show_intent_icons = 0
  478. usr.client.screen -= usr.hud_used.intent_small_hud_objects
  479. if("grab")
  480. usr.a_intent = "grab"
  481. usr.hud_used.action_intent.icon_state = "grab"
  482. usr.hud_used.hurt_intent.icon_state = "harm_small"
  483. usr.hud_used.help_intent.icon_state = "help_small"
  484. usr.hud_used.grab_intent.icon_state = "grab_small_active"
  485. usr.hud_used.disarm_intent.icon_state = "disarm_small"
  486. usr.hud_used.show_intent_icons = 0
  487. usr.client.screen -= usr.hud_used.intent_small_hud_objects
  488. if("disarm")
  489. usr.a_intent = "disarm"
  490. usr.hud_used.action_intent.icon_state = "disarm"
  491. usr.hud_used.hurt_intent.icon_state = "harm_small"
  492. usr.hud_used.help_intent.icon_state = "help_small"
  493. usr.hud_used.grab_intent.icon_state = "grab_small"
  494. usr.hud_used.disarm_intent.icon_state = "disarm_small_active"
  495. usr.hud_used.show_intent_icons = 0
  496. usr.client.screen -= usr.hud_used.intent_small_hud_objects
  497. if("pull")
  498. usr.pulling = null
  499. if("throw")
  500. if (!usr.stat && isturf(usr.loc) && !usr.restrained())
  501. usr:toggle_throw_mode()
  502. if("drop")
  503. usr.drop_item_v()
  504. if("swap")
  505. usr:swap_hand()
  506. if("hand")
  507. usr:swap_hand()
  508. if("r_hand")
  509. if(iscarbon(usr))
  510. var/mob/living/carbon/C = usr
  511. C.activate_hand("r")
  512. if("l_hand")
  513. if(iscarbon(usr))
  514. var/mob/living/carbon/C = usr
  515. C.activate_hand("l")
  516. if("module")
  517. if(issilicon(usr))
  518. if(usr:module)
  519. return
  520. usr:pick_module()
  521.  
  522. if("radio")
  523. if(issilicon(usr))
  524. usr:radio_menu()
  525. if("panel")
  526. if(issilicon(usr))
  527. usr:installed_modules()
  528.  
  529. if("store")
  530. if(issilicon(usr))
  531. usr:uneq_active()
  532.  
  533. if("module1")
  534. if(usr:module_state_1)
  535. if(usr:module_active != usr:module_state_1)
  536. usr:inv1.icon_state = "inv1 +a"
  537. usr:inv2.icon_state = "inv2"
  538. usr:inv3.icon_state = "inv3"
  539. usr:module_active = usr:module_state_1
  540. else
  541. usr:inv1.icon_state = "inv1"
  542. usr:module_active = null
  543.  
  544. if("module2")
  545. if(usr:module_state_2)
  546. if(usr:module_active != usr:module_state_2)
  547. usr:inv1.icon_state = "inv1"
  548. usr:inv2.icon_state = "inv2 +a"
  549. usr:inv3.icon_state = "inv3"
  550. usr:module_active = usr:module_state_2
  551. else
  552. usr:inv2.icon_state = "inv2"
  553. usr:module_active = null
  554.  
  555. if("module3")
  556. if(usr:module_state_3)
  557. if(usr:module_active != usr:module_state_3)
  558. usr:inv1.icon_state = "inv1"
  559. usr:inv2.icon_state = "inv2"
  560. usr:inv3.icon_state = "inv3 +a"
  561. usr:module_active = usr:module_state_3
  562. else
  563. usr:inv3.icon_state = "inv3"
  564. usr:module_active = null
  565.  
  566. if("radar")
  567. usr:close_radar()
  568.  
  569. if("radar closed")
  570. usr:start_radar()
  571.  
  572. if("Allow Walking")
  573. if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
  574. return
  575. if(!istype(usr.equipped(),/obj/item/weapon/gun))
  576. usr << "You need your gun in your active hand to do that!"
  577. return
  578. usr.client.AllowTargetMove()
  579. gun_click_time = world.time
  580.  
  581. if("Disallow Walking")
  582. if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
  583. return
  584. if(!istype(usr.equipped(),/obj/item/weapon/gun))
  585. usr << "You need your gun in your active hand to do that!"
  586. return
  587. usr.client.AllowTargetMove()
  588. gun_click_time = world.time
  589.  
  590. if("Allow Running")
  591. if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
  592. return
  593. if(!istype(usr.equipped(),/obj/item/weapon/gun))
  594. usr << "You need your gun in your active hand to do that!"
  595. return
  596. usr.client.AllowTargetRun()
  597. gun_click_time = world.time
  598.  
  599. if("Disallow Running")
  600. if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
  601. return
  602. if(!istype(usr.equipped(),/obj/item/weapon/gun))
  603. usr << "You need your gun in your active hand to do that!"
  604. return
  605. usr.client.AllowTargetRun()
  606. gun_click_time = world.time
  607.  
  608. if("Allow Item Use")
  609. if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
  610. return
  611. if(!istype(usr.equipped(),/obj/item/weapon/gun))
  612. usr << "You need your gun in your active hand to do that!"
  613. return
  614. usr.client.AllowTargetClick()
  615. gun_click_time = world.time
  616.  
  617.  
  618. if("Disallow Item Use")
  619. if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
  620. return
  621. if(!istype(usr.equipped(),/obj/item/weapon/gun))
  622. usr << "You need your gun in your active hand to do that!"
  623. return
  624. usr.client.AllowTargetClick()
  625. gun_click_time = world.time
  626.  
  627. if("Toggle Gun Mode")
  628. usr.client.ToggleGunMode()
  629.  
  630. else
  631. DblClick()
  632. return
  633.  
  634. /obj/screen/attack_hand(mob/user as mob, using)
  635. user.db_click(name, using)
  636. return
  637.  
  638. /obj/screen/attack_paw(mob/user as mob, using)
  639. user.db_click(name, using)
  640. return
  641.  
  642.  
  643. /mob/living/verb/mob_sleep()
  644. set name = "Sleep"
  645. set category = "IC"
  646.  
  647. if(usr.sleeping && usr.sleeping_willingly)
  648. usr << "\blue You start to wake up..."
  649. usr.sleeping = 0
  650. usr.sleeping_willingly = 0
  651. else if(usr.sleeping)
  652. usr << "\red You feel unable to wake up..."
  653. return
  654. else if(!usr.sleeping)
  655. usr << "\blue You start to fall asleep..."
  656. usr.sleeping = 20 //Short nap
  657. usr.sleeping_willingly = 1
  658.  
  659. /mob/living/verb/lay_down()
  660. set name = "Lay down / Get up"
  661. set category = "IC"
  662.  
  663. usr.resting = !( usr.resting )
  664. usr << "\blue You are now [(usr.resting) ? "resting" : "getting up"]"
  665.  
  666. /mob/living/verb/resist()
  667. set name = "Resist"
  668. set category = "IC"
  669.  
  670. if(usr.next_move > world.time)
  671. return
  672. usr.next_move = world.time + 20
  673. if ((!( usr.stat ) && usr.canmove && !( usr.restrained() )))
  674. var/resisting = 0
  675. for(var/obj/O in usr.requests)
  676. del(O)
  677. resisting++
  678. for(var/obj/item/weapon/grab/G in usr.grabbed_by)
  679. resisting++
  680. if (G.state == 1)
  681. del(G)
  682. else
  683. if (G.state == 2)
  684. if (prob(25))
  685. for(var/mob/O in viewers(usr, null))
  686. O.show_message(text("\red [] has broken free of []'s grip!", usr, G.assailant), 1)
  687. del(G)
  688. else
  689. if (G.state == 3)
  690. if (prob(5))
  691. for(var/mob/O in viewers(usr, null))
  692. O.show_message(text("\red [] has broken free of []'s headlock!", usr, G.assailant), 1)
  693. del(G)
  694. if(resisting)
  695. for(var/mob/O in viewers(usr, null))
  696. O.show_message(text("\red <B>[] resists!</B>", usr), 1)
  697.  
  698.  
  699.  
  700. //breaking out of handcuffs
  701. if(usr:handcuffed && usr:canmove && (usr.last_special <= world.time))
  702. var/breakouttime = 1200 //A default in case you are somehow handcuffed with something that isn't an obj/item/weapon/handcuffs type
  703. var/displaytime = 2 //Minutes to display in the "this will take X minutes."
  704. if(!usr:canmove)
  705. breakouttime = 2400
  706. displaytime = 4
  707. usr.next_move = world.time + 100
  708. usr.last_special = world.time + 100
  709. if(isalienadult(usr) || (HULK in usr.mutations) || (SUPRSTR in usr.augmentations))//Don't want to do a lot of logic gating here.
  710. usr << "\green You attempt to break \the [usr:handcuffed]. (This will take around 5 seconds and you need to stand still)"
  711. for(var/mob/O in viewers(usr))
  712. O.show_message(text("\red <B>[] is trying to break \the [usr:handcuffed]!</B>", usr), 1)
  713. spawn(0)
  714. if(do_after(usr, 50))
  715. if(!usr:handcuffed || usr:buckled)
  716. return
  717. for(var/mob/O in viewers(usr))
  718. O.show_message(text("\red <B>[] manages to break \the [usr:handcuffed]!</B>", usr), 1)
  719. usr << "\green You successfully break \the [usr:handcuffed]."
  720. del(usr:handcuffed)
  721. usr:handcuffed = null
  722. else
  723. var/obj/item/weapon/handcuffs/HC = usr:handcuffed
  724. if(istype(HC)) //If you are handcuffed with actual handcuffs... Well what do I know, maybe someone will want to handcuff you with toilet paper in the future...
  725. breakouttime = HC.breakouttime
  726. displaytime = breakouttime / 600 //Minutes
  727. usr << "\red You attempt to remove \the [HC]. (This will take around [displaytime] minutes and you need to stand still)"
  728. for(var/mob/O in viewers(usr))
  729. O.show_message(text("\red <B>[] attempts to remove \the [usr:handcuffed]!</B>", usr), 1)
  730. spawn(0)
  731. var/increment = 150
  732. for(var/i = 0, i < breakouttime, i += increment)
  733. if(!do_after(usr, increment))
  734. return
  735.  
  736. else
  737. usr << pick("You hear something click, but it doesn't open yet.", // - Uristqwerty
  738. "The latch resists!", // - IRC: BowlSoldier
  739. "The chain is starting to give!", // - IRC: BowlSoldier
  740. "The chain bends a little.", // - IRC: STALKER
  741. "Your wrist hurts.", // - IRC: STALKER
  742. "Unnng", // - IRC: Doug_H_Nuts
  743. "The chain jangles a bit.", // - SkyMarshal
  744. "\red Hurry up, dammit!", // - SkyMarshal
  745. "This is exhausting!") // - SkyMarshal
  746. for(var/mob/O in viewers(usr))
  747. if(prob(50)) //Reduces spam slightly
  748. O.show_message(text("\red [] continues to struggle in \the [usr:handcuffed]!", usr), 1)
  749. if(!usr:handcuffed) return
  750. for(var/mob/O in viewers(usr))
  751. O.show_message(text("\red <B>[] manages to remove \the [usr:handcuffed]!</B>", usr), 1)
  752. usr << "\blue You successfully remove \the [usr:handcuffed]."
  753. usr:handcuffed:loc = usr:loc
  754. usr:handcuffed = null
  755. usr.update_clothing()
  756.  
  757. if(istype(usr, /mob/living/carbon/human) && istype(usr:wear_suit, /obj/item/clothing/suit/straight_jacket) && usr:canmove && (usr.last_special <= world.time))
  758. usr.next_move = world.time + 200
  759. usr.last_special = world.time + 200
  760. if(isalienadult(usr) || (HULK in usr.mutations) || (SUPRSTR in usr.augmentations))//Don't want to do a lot of logic gating here.
  761. usr << "\green You attempt to break out of your straight jacket. (This will take around 5 seconds and you need to stand still)"
  762. for(var/mob/O in viewers(usr))
  763. O.show_message(text("\red <B>[] is trying to break out of \his straight jacket!</B>", usr), 1)
  764. spawn(0)
  765. if(do_after(usr, 50))
  766. if(!istype(usr:wear_suit, /obj/item/clothing/suit/straight_jacket)) return
  767. for(var/mob/O in viewers(usr))
  768. O.show_message(text("\red <B>[] manages to break out of the straight jacket!</B>", usr), 1)
  769. usr << "\green You successfully break out of your straight jacket."
  770. var/obj/sj = usr:wear_suit
  771. usr.remove_from_mob(sj)
  772. sj.loc = usr.loc
  773. else
  774. usr << "\red You attempt to get out of your straight jacket. (This will take around 4 minutes and you need to stand still)"
  775. for(var/mob/O in viewers(usr))
  776. O.show_message(text("\red <B>[] attempts to get out \his straight jacket!</B>", usr), 1)
  777. spawn(0)
  778. if(do_after(usr, 1200))
  779. if(!istype(usr:wear_suit, /obj/item/clothing/suit/straight_jacket)) return
  780. for(var/mob/O in viewers(usr))
  781. O.show_message(text("\red <B>[] manages to wriggle out of the straight jacket!</B>", usr), 1)
  782. usr << "\blue You successfully get out of your straight jacket."
  783. var/obj/sj = usr:wear_suit
  784. usr.remove_from_mob(sj)
  785. sj.loc = usr.loc
  786. if(usr:handcuffed && (usr.last_special <= world.time) && usr:buckled)
  787. usr.next_move = world.time + 100
  788. usr.last_special = world.time + 100
  789. usr << "\red You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)"
  790. for(var/mob/O in viewers(usr))
  791. O.show_message(text("\red <B>[] attempts to unbuckle themself!</B>", usr), 1)
  792. spawn(0)
  793. if(do_after(usr, 1200))
  794. if(!usr:buckled)
  795. return
  796. for(var/mob/O in viewers(usr))
  797. O.show_message(text("\red <B>[] manages to unbuckle themself!</B>", usr), 1)
  798. usr << "\blue You successfully unbuckle yourself."
  799. usr:buckled.manual_unbuckle(usr)
  800.  
  801. for(var/obj/structure/closet/C in get_turf(usr))
  802. usr.next_move = world.time + 100
  803. usr.last_special = world.time + 100
  804. if(usr in C.contents)
  805. if(!C:opened && C:welded)
  806. //Oh, that box are closed...
  807. if(!usr:lying)
  808. if(usr:updateshock() > 40)
  809. usr << "\red Every blow into door cause huge pain to you... you can't do it."
  810. return
  811. var/time = 600 //Every point of damage should add time. And pain after every blow.
  812. for(var/mob/O in viewers(usr))
  813. O.show_message(text("\red <b>[] attempts to kick out door from []</b>",usr, C),1)
  814. if(do_after(usr, round(time * ((usr:updateshock() / 5) + 1)))) //40 points = 9 minutes
  815. if(!(usr in C.contents) || usr:updateshock() > 40 || !(C.welded))
  816. return
  817. C.welded = 0
  818. C.open()
  819. usr << "\green You kick out door from [C]"
  820. return
  821.  
  822. /mob/living/carbon/human/verb/Shout()
  823. set name = "Shout"
  824. set category = "IC"
  825.  
  826. if (usr:speech_allowed && !usr:silent)
  827. var/message = input(usr, "What are you wanna shout?")
  828. var/mob/V = range(rand(15,22),usr)
  829. for(var/mob/X in hearers(rand(15,22),usr))
  830. if(X in V)
  831. V -= X
  832. X << "\red <font size=10> [usr] shout - [message] </font>"
  833. for(var/mob/Y in V)
  834. Y.show_message("\red You hear someone shout - [message]",1)
  835. var/dirname = ""
  836. switch(get_dir(Y, usr))
  837. if(NORTH)
  838. dirname = "north"
  839. if(SOUTH)
  840. dirname = "south"
  841. if(EAST)
  842. dirname = "east"
  843. if(WEST)
  844. dirname = "west"
  845. if(SOUTHWEST)
  846. dirname = "southwest"
  847. if(NORTHWEST)
  848. dirname = "northwest"
  849. if(SOUTHEAST)
  850. dirname = "southeast"
  851. if(NORTHEAST)
  852. dirname = "northeast"
  853. Y.show_message("\red You hear that from [dirname].",1)
  854. //Special effect
  855. if(prob(50))
  856. usr << "\blue \bold Your throat dry after that"
  857. return
  858. if(prob(30))
  859. usr << "\red \bold You lose your voice, but you can whisper!"
  860. usr:silent = rand(60,150)
  861. return
  862. if(prob(20))
  863. usr << "\red \bold You lose your voice completely..."
  864. usr:speech_allowed = 0
  865. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement