[MIRROR] Ports more operations to "tool_act" (#5718)

* Merge pull request #35854 from ACCount12/more_tool_act

Ports more operations to "tool_act"

* Ports more operations to "tool_act"
This commit is contained in:
CitadelStationBot
2018-02-27 05:04:27 -06:00
committed by Poojawa
parent f74ceb582c
commit 5f6c41fa30
12 changed files with 271 additions and 271 deletions

View File

@@ -134,78 +134,92 @@
toggle_cam(null, 0)
..()
/obj/machinery/camera/attackby(obj/item/W, mob/living/user, params)
var/msg = "<span class='notice'>You attach [W] into the assembly's inner circuits.</span>"
var/msg2 = "<span class='notice'>[src] already has that upgrade!</span>"
// Construction/Deconstruction
/obj/machinery/camera/screwdriver_act(mob/living/user, obj/item/I)
panel_open = !panel_open
to_chat(user, "<span class='notice'>You screw the camera's panel [panel_open ? "open" : "closed"].</span>")
I.play_tool_sound(src)
return TRUE
// DECONSTRUCTION
if(istype(W, /obj/item/screwdriver))
panel_open = !panel_open
to_chat(user, "<span class='notice'>You screw the camera's panel [panel_open ? "open" : "closed"].</span>")
W.play_tool_sound(src)
return
/obj/machinery/camera/wirecutter_act(mob/living/user, obj/item/I)
if(!panel_open)
return FALSE
toggle_cam(user, 1)
obj_integrity = max_integrity //this is a pretty simplistic way to heal the camera, but there's no reason for this to be complex.
I.play_tool_sound(src)
return TRUE
/obj/machinery/camera/multitool_act(mob/living/user, obj/item/I)
if(!panel_open)
return FALSE
setViewRange((view_range == initial(view_range)) ? short_range : initial(view_range))
to_chat(user, "<span class='notice'>You [(view_range == initial(view_range)) ? "restore" : "mess up"] the camera's focus.</span>")
return
/obj/machinery/camera/welder_act(mob/living/user, obj/item/I)
if(!panel_open)
return FALSE
if(!I.tool_start_check(user, amount=0))
return TRUE
to_chat(user, "<span class='notice'>You start to weld [src]...</span>")
if(I.use_tool(src, user, 100, volume=50))
user.visible_message("<span class='warning'>[user] unwelds [src], leaving it as just a frame bolted to the wall.</span>",
"<span class='warning'>You unweld [src], leaving it as just a frame bolted to the wall</span>")
deconstruct(TRUE)
return TRUE
/obj/machinery/camera/attackby(obj/item/I, mob/living/user, params)
// UPGRADES
if(panel_open)
if(istype(W, /obj/item/wirecutters)) //enable/disable the camera
toggle_cam(user, 1)
obj_integrity = max_integrity //this is a pretty simplistic way to heal the camera, but there's no reason for this to be complex.
return
else if(istype(W, /obj/item/device/multitool)) //change focus
setViewRange((view_range == initial(view_range)) ? short_range : initial(view_range))
to_chat(user, "<span class='notice'>You [(view_range == initial(view_range)) ? "restore" : "mess up"] the camera's focus.</span>")
return
else if(istype(W, /obj/item/weldingtool))
if(weld(W, user))
visible_message("<span class='warning'>[user] unwelds [src], leaving it as just a frame bolted to the wall.</span>", "<span class='warning'>You unweld [src], leaving it as just a frame bolted to the wall</span>")
deconstruct(TRUE)
return
else if(istype(W, /obj/item/device/analyzer))
if(istype(I, /obj/item/device/analyzer))
if(!isXRay())
if(!user.temporarilyRemoveItemFromInventory(W))
if(!user.temporarilyRemoveItemFromInventory(I))
return
qdel(W)
qdel(I)
upgradeXRay()
to_chat(user, "[msg]")
to_chat(user, "<span class='notice'>You attach [I] into the assembly's inner circuits.</span>")
else
to_chat(user, "[msg2]")
to_chat(user, "<span class='notice'>[src] already has that upgrade!</span>")
return
else if(istype(W, /obj/item/stack/sheet/mineral/plasma))
else if(istype(I, /obj/item/stack/sheet/mineral/plasma))
if(!isEmpProof())
var/obj/item/stack/sheet/mineral/plasma/P = W
upgradeEmpProof()
to_chat(user, "[msg]")
P.use(1)
if(I.use_tool(src, user, 0, amount=1))
upgradeEmpProof()
to_chat(user, "<span class='notice'>You attach [I] into the assembly's inner circuits.</span>")
else
to_chat(user, "[msg2]")
to_chat(user, "<span class='notice'>[src] already has that upgrade!</span>")
return
else if(istype(W, /obj/item/device/assembly/prox_sensor))
else if(istype(I, /obj/item/device/assembly/prox_sensor))
if(!isMotion())
if(!user.temporarilyRemoveItemFromInventory(I))
return
upgradeMotion()
to_chat(user, "[msg]")
qdel(W)
to_chat(user, "<span class='notice'>You attach [I] into the assembly's inner circuits.</span>")
qdel(I)
else
to_chat(user, "[msg2]")
to_chat(user, "<span class='notice'>[src] already has that upgrade!</span>")
return
// OTHER
if((istype(W, /obj/item/paper) || istype(W, /obj/item/device/pda)) && isliving(user))
if((istype(I, /obj/item/paper) || istype(I, /obj/item/device/pda)) && isliving(user))
var/mob/living/U = user
var/obj/item/paper/X = null
var/obj/item/device/pda/P = null
var/itemname = ""
var/info = ""
if(istype(W, /obj/item/paper))
X = W
if(istype(I, /obj/item/paper))
X = I
itemname = X.name
info = X.info
else
P = W
P = I
itemname = P.name
info = P.notehtml
to_chat(U, "<span class='notice'>You hold \the [itemname] up to the camera...</span>")
@@ -225,7 +239,7 @@
O << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", itemname, info), text("window=[]", itemname))
return
else if(istype(W, /obj/item/device/camera_bug))
else if(istype(I, /obj/item/device/camera_bug))
if(!can_use())
to_chat(user, "<span class='notice'>Camera non-functional.</span>")
return
@@ -235,12 +249,12 @@
bug = null
else
to_chat(user, "<span class='notice'>Camera bugged.</span>")
bug = W
bug = I
bug.bugged_cameras[src.c_tag] = src
return
else if(istype(W, /obj/item/pai_cable))
var/obj/item/pai_cable/cable = W
else if(istype(I, /obj/item/pai_cable))
var/obj/item/pai_cable/cable = I
cable.plugin(src, user)
return
@@ -370,20 +384,6 @@
return null
/obj/machinery/camera/proc/weld(obj/item/weldingtool/W, mob/living/user)
if(busy)
return FALSE
if(!W.tool_start_check(user, amount=0))
return FALSE
to_chat(user, "<span class='notice'>You start to weld [src]...</span>")
busy = TRUE
if(W.use_tool(src, user, 100, volume=50))
busy = FALSE
return TRUE
busy = FALSE
return FALSE
/obj/machinery/camera/proc/Togglelight(on=0)
for(var/mob/living/silicon/ai/A in GLOB.ai_list)
for(var/obj/machinery/camera/cam in A.lit_cameras)

View File

@@ -244,32 +244,33 @@
dish_quants[S.name] = 1
sortList(dish_quants)
/obj/machinery/vending/attackby(obj/item/W, mob/user, params)
/obj/machinery/vending/crowbar_act(mob/living/user, obj/item/I)
if(!component_parts)
return FALSE
default_deconstruction_crowbar(I)
return TRUE
/obj/machinery/vending/wrench_act(mob/living/user, obj/item/I)
if(panel_open)
if(default_unfasten_wrench(user, W, time = 60))
return
default_unfasten_wrench(user, I, time = 60)
return TRUE
if(component_parts)
if(default_deconstruction_crowbar(W))
return
if(istype(W, /obj/item/screwdriver))
if(anchored)
panel_open = !panel_open
to_chat(user, "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance panel.</span>")
cut_overlays()
if(panel_open)
add_overlay("[initial(icon_state)]-panel")
W.play_tool_sound(src)
updateUsrDialog()
else
to_chat(user, "<span class='warning'>You must first secure [src].</span>")
return
else if(istype(W, /obj/item/device/multitool)||istype(W, /obj/item/wirecutters))
/obj/machinery/vending/screwdriver_act(mob/living/user, obj/item/I)
if(anchored)
default_deconstruction_screwdriver(user, icon_state, icon_state, I)
cut_overlays()
if(panel_open)
attack_hand(user)
add_overlay("[initial(icon_state)]-panel")
updateUsrDialog()
else
to_chat(user, "<span class='warning'>You must first secure [src].</span>")
return TRUE
/obj/machinery/vending/attackby(obj/item/I, mob/user, params)
if(panel_open && is_wire_tool(I))
wires.interact(user)
return
else if(istype(W, /obj/item/coin))
else if(istype(I, /obj/item/coin))
if(coin)
to_chat(user, "<span class='warning'>[src] already has [coin] inserted</span>")
return
@@ -279,32 +280,32 @@
if(!premium.len)
to_chat(user, "<span class='warning'>[src] doesn't have a coin slot.</span>")
return
if(!user.transferItemToLoc(W, src))
if(!user.transferItemToLoc(I, src))
return
coin = W
to_chat(user, "<span class='notice'>You insert [W] into [src].</span>")
coin = I
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
return
else if(istype(W, /obj/item/stack/spacecash))
else if(istype(I, /obj/item/stack/spacecash))
if(coin)
to_chat(user, "<span class='warning'>[src] already has [coin] inserted</span>")
return
if(bill)
to_chat(user, "<span class='warning'>[src] already has [bill] inserted</span>")
return
var/obj/item/stack/S = W
var/obj/item/stack/S = I
if(!premium.len)
to_chat(user, "<span class='warning'>[src] doesn't have a bill slot.</span>")
return
S.use(1)
bill = new S.type(src,1)
to_chat(user, "<span class='notice'>You insert [W] into [src].</span>")
bill = new S.type(src, 1)
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
return
else if(istype(W, refill_canister) && refill_canister != null)
else if(istype(I, refill_canister) && refill_canister != null)
if(stat & (BROKEN|NOPOWER))
to_chat(user, "<span class='notice'>It does nothing.</span>")
else if(panel_open)
//if the panel is open we attempt to refill the machine
var/obj/item/vending_refill/canister = W
var/obj/item/vending_refill/canister = I
if(canister.charges[STANDARD_CHARGE] == 0)
to_chat(user, "<span class='notice'>This [canister.name] is empty!</span>")
else

View File

@@ -26,7 +26,7 @@
return FAILED_UNFASTEN
return ..()
/obj/structure/shuttle/engine/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
/obj/structure/shuttle/engine/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
. = ..()
if(. == SUCCESSFUL_UNFASTEN)
if(anchored)
@@ -34,42 +34,40 @@
else
state = ENGINE_UNWRENCHED
/obj/structure/shuttle/engine/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
if(default_unfasten_wrench(user, I))
return
else if(istype(I, /obj/item/weldingtool))
switch(state)
if(ENGINE_UNWRENCHED)
to_chat(user, "<span class='warning'>The [src.name] needs to be wrenched to the floor!</span>")
if(EM_SECURED)
if(!I.tool_start_check(user, amount=0))
return
/obj/structure/shuttle/engine/wrench_act(mob/living/user, obj/item/I)
default_unfasten_wrench(user, I)
return TRUE
user.visible_message("[user.name] starts to weld the [name] to the floor.", \
"<span class='notice'>You start to weld \the [src] to the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
/obj/structure/shuttle/engine/welder_act(mob/living/user, obj/item/I)
switch(state)
if(ENGINE_UNWRENCHED)
to_chat(user, "<span class='warning'>The [src.name] needs to be wrenched to the floor!</span>")
if(EM_SECURED)
if(!I.tool_start_check(user, amount=0))
return TRUE
if(I.use_tool(src, user, ENGINE_WELDTIME, volume=50))
state = ENGINE_WELDED
to_chat(user, "<span class='notice'>You weld \the [src] to the floor.</span>")
alter_engine_power(engine_power)
user.visible_message("[user.name] starts to weld the [name] to the floor.", \
"<span class='notice'>You start to weld \the [src] to the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
if(EM_WELDED)
if(!I.tool_start_check(user, amount=0))
return
if(I.use_tool(src, user, ENGINE_WELDTIME, volume=50))
state = ENGINE_WELDED
to_chat(user, "<span class='notice'>You weld \the [src] to the floor.</span>")
alter_engine_power(engine_power)
user.visible_message("[user.name] starts to cut the [name] free from the floor.", \
"<span class='notice'>You start to cut \the [src] free from the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
if(EM_WELDED)
if(!I.tool_start_check(user, amount=0))
return TRUE
if(I.use_tool(src, user, ENGINE_WELDTIME, volume=50))
state = ENGINE_WRENCHED
to_chat(user, "<span class='notice'>You cut \the [src] free from the floor.</span>")
alter_engine_power(-engine_power)
return
else
return ..()
user.visible_message("[user.name] starts to cut the [name] free from the floor.", \
"<span class='notice'>You start to cut \the [src] free from the floor...</span>", \
"<span class='italics'>You hear welding.</span>")
if(I.use_tool(src, user, ENGINE_WELDTIME, volume=50))
state = ENGINE_WRENCHED
to_chat(user, "<span class='notice'>You cut \the [src] free from the floor.</span>")
alter_engine_power(-engine_power)
return TRUE
/obj/structure/shuttle/engine/Destroy()
if(state == ENGINE_WELDED)

View File

@@ -38,26 +38,26 @@
aggressiveness = 1 //Borgs are nicecurity!
actions_types = list(/datum/action/item_action/halt)
/obj/item/clothing/mask/gas/sechailer/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
switch(aggressiveness)
if(1)
to_chat(user, "<span class='notice'>You set the restrictor to the middle position.</span>")
aggressiveness = 2
if(2)
to_chat(user, "<span class='notice'>You set the restrictor to the last position.</span>")
aggressiveness = 3
if(3)
to_chat(user, "<span class='notice'>You set the restrictor to the first position.</span>")
aggressiveness = 1
if(4)
to_chat(user, "<span class='danger'>You adjust the restrictor but nothing happens, probably because it's broken.</span>")
else if(istype(W, /obj/item/wirecutters))
if(aggressiveness != 4)
to_chat(user, "<span class='danger'>You broke the restrictor!</span>")
aggressiveness = 4
else
..()
/obj/item/clothing/mask/gas/sechailer/screwdriver_act(mob/living/user, obj/item/I)
switch(aggressiveness)
if(1)
to_chat(user, "<span class='notice'>You set the restrictor to the middle position.</span>")
aggressiveness = 2
if(2)
to_chat(user, "<span class='notice'>You set the restrictor to the last position.</span>")
aggressiveness = 3
if(3)
to_chat(user, "<span class='notice'>You set the restrictor to the first position.</span>")
aggressiveness = 1
if(4)
to_chat(user, "<span class='danger'>You adjust the restrictor but nothing happens, probably because it's broken.</span>")
return TRUE
/obj/item/clothing/mask/gas/sechailer/wirecutter_act(mob/living/user, obj/item/I)
if(aggressiveness != 4)
to_chat(user, "<span class='danger'>You broke the restrictor!</span>")
aggressiveness = 4
return TRUE
/obj/item/clothing/mask/gas/sechailer/ui_action_click(mob/user, action)
if(istype(action, /datum/action/item_action/halt))

View File

@@ -93,7 +93,7 @@
return FAILED_UNFASTEN
return ..()
/obj/machinery/power/rad_collector/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
/obj/machinery/power/rad_collector/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
. = ..()
if(. == SUCCESSFUL_UNFASTEN)
if(anchored)
@@ -128,11 +128,11 @@
else
return ..()
/obj/machinery/power/rad_collector/wrench_act(mob/living/user, obj/item/wrench)
default_unfasten_wrench(user, wrench, 0)
/obj/machinery/power/rad_collector/wrench_act(mob/living/user, obj/item/I)
default_unfasten_wrench(user, I, 0)
return TRUE
/obj/machinery/power/rad_collector/crowbar_act(mob/living/user, obj/item/crowbar)
/obj/machinery/power/rad_collector/crowbar_act(mob/living/user, obj/item/I)
if(loaded_tank)
if(locked)
to_chat(user, "<span class='warning'>The controls are locked!</span>")
@@ -142,7 +142,7 @@
to_chat(user, "<span class='warning'>There isn't a tank loaded!</span>")
return TRUE
/obj/machinery/power/rad_collector/multitool_act(mob/living/user, obj/item/multitool)
/obj/machinery/power/rad_collector/multitool_act(mob/living/user, obj/item/I)
if(!is_station_level(z) && !SSresearch.science_tech)
to_chat(user, "<span class='warning'>[src] isn't linked to a research system!</span>")
return TRUE

View File

@@ -219,7 +219,7 @@
return ..()
/obj/machinery/power/emitter/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
/obj/machinery/power/emitter/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
. = ..()
if(. == SUCCESSFUL_UNFASTEN)
if(anchored)

View File

@@ -89,7 +89,7 @@ field_generator power level display
return ..()
/obj/machinery/field/generator/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
/obj/machinery/field/generator/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
. = ..()
if(. == SUCCESSFUL_UNFASTEN)
if(anchored)

View File

@@ -74,9 +74,6 @@
to_chat(user, "<span class='notice'>You cut the cables and dismantle the power terminal.</span>")
qdel(src)
/obj/machinery/power/terminal/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/wirecutters))
dismantle(user, W)
else
return ..()
/obj/machinery/power/terminal/wirecutter_act(mob/living/user, obj/item/I)
dismantle(user, I)
return TRUE

View File

@@ -30,7 +30,7 @@
zap_cooldown -= (C.rating * 20)
input_power_multiplier = power_multiplier
/obj/machinery/power/tesla_coil/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
/obj/machinery/power/tesla_coil/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
. = ..()
if(. == SUCCESSFUL_UNFASTEN)
if(panel_open)
@@ -103,7 +103,7 @@
buckle_lying = FALSE
buckle_requires_restraints = TRUE
/obj/machinery/power/grounding_rod/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
/obj/machinery/power/grounding_rod/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
. = ..()
if(. == SUCCESSFUL_UNFASTEN)
if(panel_open)

View File

@@ -106,73 +106,68 @@
return FALSE
return TRUE
// attackby item
// construction/deconstruction
// wrench: (un)anchor
// weldingtool: convert to real pipe
/obj/structure/disposalconstruct/wrench_act(mob/living/user, obj/item/I)
if(anchored)
anchored = FALSE
density = FALSE
to_chat(user, "<span class='notice'>You detach the [pipename] from the underfloor.</span>")
else
var/ispipe = is_pipe() // Indicates if we should change the level of this pipe
/obj/structure/disposalconstruct/attackby(obj/item/I, mob/user, params)
var/ispipe = is_pipe() // Indicates if we should change the level of this pipe
var/turf/T = get_turf(src)
if(T.intact && isfloorturf(T))
to_chat(user, "<span class='warning'>You can only attach the [pipename] if the floor plating is removed!</span>")
return TRUE
add_fingerprint(user)
if(!ispipe && iswallturf(T))
to_chat(user, "<span class='warning'>You can't build [pipename]s on walls, only disposal pipes!</span>")
return TRUE
var/turf/T = get_turf(src)
if(T.intact && isfloorturf(T))
to_chat(user, "<span class='warning'>You can only attach the [pipename] if the floor plating is removed!</span>")
return
if(ispipe)
var/dpdir = get_disposal_dir()
for(var/obj/structure/disposalpipe/CP in T)
var/pdir = CP.dpdir
if(istype(CP, /obj/structure/disposalpipe/broken))
pdir = CP.dir
if(pdir & dpdir)
to_chat(user, "<span class='warning'>There is already a disposal pipe at that location!</span>")
return TRUE
if(!ispipe && iswallturf(T))
to_chat(user, "<span class='warning'>You can't build [pipename]s on walls, only disposal pipes!</span>")
return
else // Disposal or outlet
var/found_trunk = FALSE
for(var/obj/structure/disposalpipe/CP in T)
if(istype(CP, /obj/structure/disposalpipe/trunk))
found_trunk = TRUE
break
if(istype(I, /obj/item/wrench))
if(anchored)
anchored = FALSE
density = FALSE
to_chat(user, "<span class='notice'>You detach the [pipename] from the underfloor.</span>")
else
if(ispipe)
var/dpdir = get_disposal_dir()
for(var/obj/structure/disposalpipe/CP in T)
var/pdir = CP.dpdir
if(istype(CP, /obj/structure/disposalpipe/broken))
pdir = CP.dir
if(pdir & dpdir)
to_chat(user, "<span class='warning'>There is already a disposal pipe at that location!</span>")
return
level = 1 // Pipes only, don't want disposal bins to disappear under the floors
if(!found_trunk)
to_chat(user, "<span class='warning'>The [pipename] requires a trunk underneath it in order to work!</span>")
return TRUE
else // Disposal or outlet
var/found_trunk = FALSE
for(var/obj/structure/disposalpipe/CP in T)
if(istype(CP, /obj/structure/disposalpipe/trunk))
found_trunk = TRUE
break
anchored = TRUE
density = initial(pipe_type.density)
to_chat(user, "<span class='notice'>You attach the [pipename] to the underfloor.</span>")
I.play_tool_sound(src, 100)
update_icon()
return TRUE
if(!found_trunk)
to_chat(user, "<span class='warning'>The [pipename] requires a trunk underneath it in order to work!</span>")
return
/obj/structure/disposalconstruct/welder_act(mob/living/user, obj/item/I)
if(anchored)
if(!I.tool_start_check(user, amount=0))
return TRUE
anchored = TRUE
density = initial(pipe_type.density)
to_chat(user, "<span class='notice'>You attach the [pipename] to the underfloor.</span>")
I.play_tool_sound(src, 100)
update_icon()
to_chat(user, "<span class='notice'>You start welding the [pipename] in place...</span>")
if(I.use_tool(src, user, 8, volume=50))
to_chat(user, "<span class='notice'>The [pipename] has been welded in place.</span>")
var/obj/O = new pipe_type(loc, src)
transfer_fingerprints_to(O)
else if(istype(I, /obj/item/weldingtool))
if(anchored)
if(!I.tool_start_check(user, amount=0))
return
to_chat(user, "<span class='notice'>You start welding the [pipename] in place...</span>")
if(I.use_tool(src, user, 8, volume=50))
to_chat(user, "<span class='notice'>The [pipename] has been welded in place.</span>")
var/obj/O = new pipe_type(loc, src)
transfer_fingerprints_to(O)
return
else
to_chat(user, "<span class='warning'>You need to attach it to the plating first!</span>")
return
else
to_chat(user, "<span class='warning'>You need to attach it to the plating first!</span>")
return TRUE
/obj/structure/disposalconstruct/proc/is_pipe()
return ispath(pipe_type, /obj/structure/disposalpipe)

View File

@@ -30,37 +30,37 @@
density = TRUE
anchored = TRUE
/obj/machinery/bsa/wrench_act(mob/living/user, obj/item/I)
default_unfasten_wrench(user, I, 10)
return TRUE
/obj/machinery/bsa/back
name = "Bluespace Artillery Generator"
desc = "Generates cannon pulse. Needs to be linked with a fusor."
icon_state = "power_box"
/obj/machinery/bsa/back/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/device/multitool))
var/obj/item/device/multitool/M = W
/obj/machinery/bsa/back/multitool_act(mob/living/user, obj/item/I)
if(istype(I, /obj/item/device/multitool)) // Only this multitool type has a data buffer.
var/obj/item/device/multitool/M = I
M.buffer = src
to_chat(user, "<span class='notice'>You store linkage information in [W]'s buffer.</span>")
else if(istype(W, /obj/item/wrench))
default_unfasten_wrench(user, W, 10)
return TRUE
to_chat(user, "<span class='notice'>You store linkage information in [I]'s buffer.</span>")
else
return ..()
to_chat(user, "<span class='warning'>[I] has no data buffer!</span>")
return TRUE
/obj/machinery/bsa/front
name = "Bluespace Artillery Bore"
desc = "Do not stand in front of cannon during operation. Needs to be linked with a fusor."
icon_state = "emitter_center"
/obj/machinery/bsa/front/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/device/multitool))
var/obj/item/device/multitool/M = W
/obj/machinery/bsa/front/multitool_act(mob/living/user, obj/item/I)
if(istype(I, /obj/item/device/multitool)) // Only this multitool type has a data buffer.
var/obj/item/device/multitool/M = I
M.buffer = src
to_chat(user, "<span class='notice'>You store linkage information in [W]'s buffer.</span>")
else if(istype(W, /obj/item/wrench))
default_unfasten_wrench(user, W, 10)
return TRUE
to_chat(user, "<span class='notice'>You store linkage information in [I]'s buffer.</span>")
else
return ..()
to_chat(user, "<span class='warning'>[I] has no data buffer!</span>")
return TRUE
/obj/machinery/bsa/middle
name = "Bluespace Artillery Fusor"
@@ -69,9 +69,9 @@
var/obj/machinery/bsa/back/back
var/obj/machinery/bsa/front/front
/obj/machinery/bsa/middle/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/device/multitool))
var/obj/item/device/multitool/M = W
/obj/machinery/bsa/middle/multitool_act(mob/living/user, obj/item/I)
if(istype(I, /obj/item/device/multitool)) // Only this multitool type has a data buffer.
var/obj/item/device/multitool/M = I
if(M.buffer)
if(istype(M.buffer, /obj/machinery/bsa/back))
back = M.buffer
@@ -81,11 +81,11 @@
front = M.buffer
M.buffer = null
to_chat(user, "<span class='notice'>You link [src] with [front].</span>")
else if(istype(W, /obj/item/wrench))
default_unfasten_wrench(user, W, 10)
return TRUE
else
to_chat(user, "<span class='warning'>[I]'s data buffer is empty!</span>")
else
return ..()
to_chat(user, "<span class='warning'>[I] has no data buffer!</span>")
return TRUE
/obj/machinery/bsa/middle/proc/check_completion()
if(!front || !back)
@@ -136,6 +136,9 @@
bound_x = -192
appearance_flags = NONE //Removes default TILE_BOUND
/obj/machinery/bsa/full/wrench_act(mob/living/user, obj/item/I)
return FALSE
/obj/machinery/bsa/full/proc/get_front_turf()
switch(dir)
if(WEST)

View File

@@ -9,18 +9,18 @@
D.set_riding_offsets(RIDING_OFFSET_ALL, list(TEXT_NORTH = list(0), TEXT_SOUTH = list(-2), TEXT_EAST = list(0), TEXT_WEST = list( 2)))
/obj/vehicle/ridden/scooter/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench))
to_chat(user, "<span class='notice'>You begin to remove the handlebars...</span>")
if(I.use_tool(src, user, 40, volume=50))
var/obj/vehicle/ridden/scooter/skateboard/S = new(drop_location())
new /obj/item/stack/rods(drop_location(), 2)
to_chat(user, "<span class='notice'>You remove the handlebars from [src].</span>")
if(has_buckled_mobs())
var/mob/living/carbon/H = buckled_mobs[1]
unbuckle_mob(H)
S.buckle_mob(H)
qdel(src)
/obj/vehicle/ridden/scooter/wrench_act(mob/living/user, obj/item/I)
to_chat(user, "<span class='notice'>You begin to remove the handlebars...</span>")
if(I.use_tool(src, user, 40, volume=50))
var/obj/vehicle/ridden/scooter/skateboard/S = new(drop_location())
new /obj/item/stack/rods(drop_location(), 2)
to_chat(user, "<span class='notice'>You remove the handlebars from [src].</span>")
if(has_buckled_mobs())
var/mob/living/carbon/H = buckled_mobs[1]
unbuckle_mob(H)
S.buckle_mob(H)
qdel(src)
return TRUE
/obj/vehicle/ridden/scooter/Moved()
. = ..()
@@ -100,14 +100,7 @@
w_class = WEIGHT_CLASS_NORMAL
/obj/item/scooter_frame/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench))
to_chat(user, "<span class='notice'>You deconstruct [src].</span>")
new /obj/item/stack/rods(drop_location(), 10)
I.play_tool_sound(src)
qdel(src)
return
else if(istype(I, /obj/item/stack/sheet/metal))
if(istype(I, /obj/item/stack/sheet/metal))
if(!I.tool_start_check(user, amount=5))
return
to_chat(user, "<span class='notice'>You begin to add wheels to [src].</span>")
@@ -115,20 +108,18 @@
to_chat(user, "<span class='notice'>You finish making wheels for [src].</span>")
new /obj/vehicle/ridden/scooter/skateboard(user.loc)
qdel(src)
else
return ..()
/obj/item/scooter_frame/wrench_act(mob/living/user, obj/item/I)
to_chat(user, "<span class='notice'>You deconstruct [src].</span>")
new /obj/item/stack/rods(drop_location(), 10)
I.play_tool_sound(src)
qdel(src)
return TRUE
/obj/vehicle/ridden/scooter/skateboard/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
to_chat(user, "<span class='notice'>You begin to deconstruct and remove the wheels on [src]...</span>")
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You deconstruct the wheels on [src].</span>")
new /obj/item/stack/sheet/metal(drop_location(), 5)
new /obj/item/scooter_frame(drop_location())
if(has_buckled_mobs())
var/mob/living/carbon/H = buckled_mobs[1]
unbuckle_mob(H)
qdel(src)
else if(istype(I, /obj/item/stack/rods))
if(istype(I, /obj/item/stack/rods))
if(!I.tool_start_check(user, amount=2))
return
to_chat(user, "<span class='notice'>You begin making handlebars for [src].</span>")
@@ -140,3 +131,18 @@
unbuckle_mob(H)
S.buckle_mob(H)
qdel(src)
else
return ..()
/obj/vehicle/ridden/scooter/skateboard/screwdriver_act(mob/living/user, obj/item/I)
to_chat(user, "<span class='notice'>You begin to deconstruct and remove the wheels on [src]...</span>")
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You deconstruct the wheels on [src].</span>")
new /obj/item/stack/sheet/metal(drop_location(), 5)
new /obj/item/scooter_frame(drop_location())
if(has_buckled_mobs())
var/mob/living/carbon/H = buckled_mobs[1]
unbuckle_mob(H)
qdel(src)
return TRUE