Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /obj/structure/shipsystem/attackby(var/obj/item/P, var/mob/user)//if(!do_after(user, 10, target = src))
- if(user.a_intent == INTENT_HARM)
- return ..()
- var/skillcheck
- if(istype(P, /obj/item/screwdriver))
- if(panel == OPEN)
- if(repair_stage == 0 && failed)
- to_chat(user, "<span class='info'>You begin to unscrew the electronics panel..</span>")
- if(!do_after(user, 5, target=src))
- return
- repair_stage++
- to_chat(user, "<span class='info'>You unscrew the electronics panel.</span>")
- return
- if(repair_stage == 1)
- to_chat(user, "<span class='info'>You begin to screw the electronics panel into place..</span>")
- if(!do_after(user, 5, target=src))
- return
- repair_stage--
- to_chat(user, "<span class='info'>You screw the electronics panel back into place.</span>")
- return
- to_chat(user, "<span class='info'>You [panel ? "un" : ""]screw the panel[panel ? " in." : "."]</span>")
- playsound(src.loc, P.usesound, 50, 1)
- if(panel == SCREWSHUT)
- to_chat(user, "<span class='info'>You unscrew the panel.</span>")
- panel = CLOSED
- return
- panel = SCREWSHUT
- return
- if(istype(P, /obj/item/wirecutters))
- if(panel == OPEN)
- if(repair_stage == 1)
- to_chat(user, "<span class='info'>You begin to rewire the elecronics..</span>")
- if(!do_after(user, 10, target=src))
- return
- skillcheck = user.skills.skillcheck(user, "construction and maintenance", 4)
- if(skillcheck == 2)
- return
- if(skillcheck == 4)
- damage(15, "BURN")
- return
- to_chat(user, "<span class='info'>You rewire the elecronics.</span>")
- repair_stage ++
- return
- if(!failed)
- playsound(src.loc, P.usesound, 50, 1)
- if(!active)
- start()
- else
- active = FALSE
- to_chat(user, "<span class='info'>You [active ? "activate" : "deactivate"] [src].</span>")
- update_icon()
- else
- to_chat(user, "<span class='warning'>It's broken.. Activating it now would be an fool's choice.</span>")
- if(istype(P, /obj/item/weldingtool))
- var/obj/item/weldingtool/W = P
- if(W.welding != 1)
- ..()
- return
- skillcheck = user.skills.skillcheck(user, "construction and maintenance", 3)
- playsound(src.loc, P.usesound, 50, 1)
- if(panel != OPEN)
- if(obj_integrity < max_integrity)
- if(skillcheck == 2)
- return
- if(skillcheck == 4)
- obj_integrity -= 10
- return
- var/end_result = integrity + 50
- if(end_result > max_integrity)
- integrity = max_integrity
- to_chat(user, "<span class='info'>You repair some of [src]'s exterior structuring.</span>")
- return
- integrity += 50
- to_chat(user, "<span class='info'>You repair some of [src]'s exterior structuring.</span>")
- else
- to_chat(user, "<span class='warning'>[src] does not require any exterior repairs.</span>")
- if(brute_damage < maximum_integrity)
- if(skillcheck == (2))
- return
- if(skillcheck == 4)
- damage(30)
- return
- if(!repair(20))
- return
- to_chat(user, "<span class='info'>You repair some of [src]'s internal structuring..</span>")
- repair(20)
- else
- to_chat(user, "<span class='info'>[src] does not require interior structural repairs.</span>")
- if(istype(P, /obj/item/wrench))
- if(panel == OPEN)
- if(repair_stage == 2)
- to_chat(user, "<span class='info'>You resecure the electronics back into place.</span>")
- repair_stage++
- return
- ..()
- if(istype(P, /obj/item/stack/cable_coil))
- var/obj/item/stack/cable_coil/C = P
- if(repair_stage == 3)
- if(!C.amount > 2)
- to_chat(user, "<span class='info'>You begin to wire the electronics to the rest of [src].</span>")
- if(!do_after(user, 25, target=src))
- return
- skillcheck = user.skills.skillcheck(user, "construction and maintenance", 6)
- if(skillcheck == 2)
- return
- if(skillcheck == 4)
- damage(35, "BURN")
- return
- to_chat(user, "<span class='info'>You wire the electronics to the rest of [src].</span>")
- failed = FALSE
- repair_stage = 0
- emit_rads = FALSE
- heat = 0
- integrity = maximum_integrity
- brute_damage = 0
- electric_damage = 0
- ..()
Advertisement
Add Comment
Please, Sign In to add comment