Cdey78

Untitled

Jun 27th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.14 KB | None | 0 0
  1. /obj/structure/shipsystem/attackby(var/obj/item/P, var/mob/user)//if(!do_after(user, 10, target = src))
  2.     if(user.a_intent == INTENT_HARM)
  3.         return ..()
  4.  
  5.     var/skillcheck
  6.  
  7.     if(istype(P, /obj/item/screwdriver))
  8.  
  9.         if(panel == OPEN)
  10.             if(repair_stage == 0 && failed)
  11.                 to_chat(user, "<span class='info'>You begin to unscrew the electronics panel..</span>")
  12.                 if(!do_after(user, 5, target=src))
  13.                     return
  14.                 repair_stage++
  15.                 to_chat(user, "<span class='info'>You unscrew the electronics panel.</span>")
  16.                 return
  17.             if(repair_stage == 1)
  18.                 to_chat(user, "<span class='info'>You begin to screw the electronics panel into place..</span>")
  19.                 if(!do_after(user, 5, target=src))
  20.                     return
  21.                 repair_stage--
  22.                 to_chat(user, "<span class='info'>You screw the electronics panel back into place.</span>")
  23.                 return
  24.  
  25.         to_chat(user, "<span class='info'>You [panel ? "un" : ""]screw the panel[panel ? " in." : "."]</span>")
  26.         playsound(src.loc, P.usesound, 50, 1)
  27.         if(panel == SCREWSHUT)
  28.             to_chat(user, "<span class='info'>You unscrew the panel.</span>")
  29.             panel = CLOSED
  30.             return
  31.         panel = SCREWSHUT
  32.         return
  33.  
  34.     if(istype(P, /obj/item/wirecutters))
  35.         if(panel == OPEN)
  36.             if(repair_stage == 1)
  37.                 to_chat(user, "<span class='info'>You begin to rewire the elecronics..</span>")
  38.                 if(!do_after(user, 10, target=src))
  39.                     return
  40.  
  41.                 skillcheck = user.skills.skillcheck(user, "construction and maintenance", 4)
  42.  
  43.                 if(skillcheck == 2)
  44.                     return
  45.                 if(skillcheck == 4)
  46.                     damage(15, "BURN")
  47.                     return
  48.  
  49.                 to_chat(user, "<span class='info'>You rewire the elecronics.</span>")
  50.                 repair_stage ++
  51.                 return
  52.  
  53.             if(!failed)
  54.                 playsound(src.loc, P.usesound, 50, 1)
  55.                 if(!active)
  56.                     start()
  57.                 else
  58.                     active = FALSE
  59.                 to_chat(user, "<span class='info'>You [active ? "activate" : "deactivate"] [src].</span>")
  60.                 update_icon()
  61.             else
  62.                 to_chat(user, "<span class='warning'>It's broken.. Activating it now would be an fool's choice.</span>")
  63.  
  64.     if(istype(P, /obj/item/weldingtool))
  65.         var/obj/item/weldingtool/W = P
  66.         if(W.welding != 1)
  67.             ..()
  68.             return
  69.  
  70.         skillcheck = user.skills.skillcheck(user, "construction and maintenance", 3)
  71.         playsound(src.loc, P.usesound, 50, 1)
  72.  
  73.         if(panel != OPEN)
  74.             if(obj_integrity < max_integrity)
  75.                 if(skillcheck == 2)
  76.                     return
  77.                 if(skillcheck == 4)
  78.                     obj_integrity -= 10
  79.                     return
  80.                 var/end_result = integrity + 50
  81.                 if(end_result > max_integrity)
  82.                     integrity = max_integrity
  83.                     to_chat(user, "<span class='info'>You repair some of [src]'s exterior structuring.</span>")
  84.                     return
  85.                 integrity += 50
  86.                 to_chat(user, "<span class='info'>You repair some of [src]'s exterior structuring.</span>")
  87.             else
  88.                 to_chat(user, "<span class='warning'>[src] does not require any exterior repairs.</span>")
  89.  
  90.         if(brute_damage < maximum_integrity)
  91.  
  92.             if(skillcheck == (2))
  93.                 return
  94.             if(skillcheck == 4)
  95.                 damage(30)
  96.                 return
  97.  
  98.             if(!repair(20))
  99.                 return
  100.  
  101.             to_chat(user, "<span class='info'>You repair some of [src]'s internal structuring..</span>")
  102.             repair(20)
  103.  
  104.         else
  105.             to_chat(user, "<span class='info'>[src] does not require interior structural repairs.</span>")
  106.            
  107.            
  108.     if(istype(P, /obj/item/wrench))
  109.         if(panel == OPEN)
  110.             if(repair_stage == 2)
  111.                 to_chat(user, "<span class='info'>You resecure the electronics back into place.</span>")
  112.                 repair_stage++
  113.                 return
  114.         ..()
  115.        
  116.     if(istype(P, /obj/item/stack/cable_coil))
  117.         var/obj/item/stack/cable_coil/C = P
  118.         if(repair_stage == 3)
  119.             if(!C.amount > 2)
  120.  
  121.                 to_chat(user, "<span class='info'>You begin to wire the electronics to the rest of [src].</span>")
  122.                 if(!do_after(user, 25, target=src))
  123.                     return
  124.  
  125.                 skillcheck = user.skills.skillcheck(user, "construction and maintenance", 6)
  126.                 if(skillcheck == 2)
  127.                     return
  128.                 if(skillcheck == 4)
  129.                     damage(35, "BURN")
  130.                     return
  131.                 to_chat(user, "<span class='info'>You wire the electronics to the rest of [src].</span>")
  132.                
  133.                 failed = FALSE
  134.                 repair_stage = 0
  135.                 emit_rads = FALSE
  136.                 heat = 0
  137.                 integrity = maximum_integrity
  138.                 brute_damage = 0
  139.                 electric_damage = 0
  140.         ..()
Advertisement
Add Comment
Please, Sign In to add comment