mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
More Crowbar Acts (#24986)
* crowbar acts part 1 * livings checked * convert istypes to tool behaviour * solars * use tool_volume * Update code/modules/research/server.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: larentoun <31931237+larentoun@users.noreply.github.com> * Update code/modules/power/generators/portable generators/pacman.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: larentoun <31931237+larentoun@users.noreply.github.com> * return * return returns * Update code/modules/mob/living/simple_animal/bot/mulebot.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> Signed-off-by: larentoun <31931237+larentoun@users.noreply.github.com> * Update code/game/objects/structures/janicart.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> Signed-off-by: larentoun <31931237+larentoun@users.noreply.github.com> --------- Signed-off-by: larentoun <31931237+larentoun@users.noreply.github.com> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
This commit is contained in:
co-authored by
Luc
Henri215
parent
a2e7d95306
commit
7daf219ec0
@@ -26,11 +26,6 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/proc/iscrowbar(O)
|
||||
if(istype(O, /obj/item/crowbar))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/proc/iscoil(O)
|
||||
if(istype(O, /obj/item/stack/cable_coil))
|
||||
return TRUE
|
||||
|
||||
@@ -536,6 +536,7 @@
|
||||
if(reagents)
|
||||
reagents.temperature_reagents(exposed_temperature)
|
||||
|
||||
/// If it returns TRUE, attack chain stops
|
||||
/atom/proc/tool_act(mob/living/user, obj/item/I, tool_type)
|
||||
switch(tool_type)
|
||||
if(TOOL_CROWBAR)
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
A.amount = 5
|
||||
return
|
||||
if(3)
|
||||
if(istype(P, /obj/item/crowbar))
|
||||
if(P.tool_behaviour == TOOL_CROWBAR)
|
||||
playsound(src.loc, P.usesound, 50, 1)
|
||||
state = 2
|
||||
circuit.loc = src.loc
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
return FALSE
|
||||
|
||||
if(4) // Grille in place
|
||||
if(istype(W, /obj/item/crowbar))
|
||||
if(W.tool_behaviour == TOOL_CROWBAR)
|
||||
to_chat(user, "You begin to pry off the grille from \the [src]...")
|
||||
playsound(get_turf(src), W.usesound, 50, 1)
|
||||
if(do_after(user, 30 * W.toolspeed, target = src) && (build == 4))
|
||||
|
||||
@@ -334,7 +334,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
|
||||
|
||||
/obj/machinery/porta_turret/attackby(obj/item/I, mob/user)
|
||||
if((stat & BROKEN) && !syndicate)
|
||||
if(istype(I, /obj/item/crowbar))
|
||||
if(I.tool_behaviour == TOOL_CROWBAR)
|
||||
//If the turret is destroyed, you can remove it with a crowbar to
|
||||
//try and salvage its components
|
||||
to_chat(user, "<span class='notice'>You begin prying the metal coverings off.</span>")
|
||||
@@ -861,7 +861,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
|
||||
build_step = 1
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/crowbar) && !anchored)
|
||||
else if(I.tool_behaviour == TOOL_CROWBAR && !anchored)
|
||||
playsound(loc, I.usesound, 75, 1)
|
||||
to_chat(user, "<span class='notice'>You dismantle the turret construction.</span>")
|
||||
new /obj/item/stack/sheet/metal( loc, 5)
|
||||
@@ -955,7 +955,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
|
||||
return
|
||||
|
||||
if(7)
|
||||
if(istype(I, /obj/item/crowbar))
|
||||
if(I.tool_behaviour == TOOL_CROWBAR)
|
||||
playsound(loc, I.usesound, 75, 1)
|
||||
to_chat(user, "<span class='notice'>You pry off the turret's exterior armor.</span>")
|
||||
new /obj/item/stack/sheet/metal(loc, 2)
|
||||
|
||||
@@ -347,16 +347,6 @@
|
||||
to_chat(usr, "<span class='warning'>The unit is not operational.</span>")
|
||||
return
|
||||
if(panel_open)
|
||||
if(istype(I, /obj/item/crowbar))
|
||||
if(occupant || helmet || suit || storage || boots)
|
||||
to_chat(user, "<span class='warning'>There are contents that prevent you from deconstructing [src]!</span>")
|
||||
return
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>The security system prevents you from deconstructing [src]!</span>")
|
||||
return
|
||||
dump_contents() // probably still a good idea for just incase?
|
||||
default_deconstruction_crowbar(user, I)
|
||||
return
|
||||
wires.Interact(user)
|
||||
return
|
||||
if(state_open)
|
||||
@@ -369,10 +359,25 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/suit_storage_unit/screwdriver_act(mob/user, obj/item/I)
|
||||
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
|
||||
/obj/machinery/suit_storage_unit/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!panel_open)
|
||||
return
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, volume = I.tool_volume))
|
||||
return
|
||||
if(occupant || helmet || suit || storage || boots)
|
||||
to_chat(user, "<span class='warning'>There are contents that prevent you from deconstructing [src]!</span>")
|
||||
return
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>The security system prevents you from deconstructing [src]!</span>")
|
||||
return
|
||||
dump_contents() // probably still a good idea for just incase?
|
||||
default_deconstruction_crowbar(user, I)
|
||||
|
||||
/obj/machinery/suit_storage_unit/screwdriver_act(mob/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
if(shocked && !(stat & NOPOWER))
|
||||
if(shock(user, 100))
|
||||
return
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
to_chat(user, "<span class='warning'>Turn off [src] before you perform this action!</span>")
|
||||
return FALSE
|
||||
user.visible_message("<span class='notice'>[user] unscrews [src]'s maintenance panel and begins fiddling with its innards...</span>", "<span class='notice'>You begin resetting [src]...</span>")
|
||||
if(!I.use_tool(src, user, 40, volume = 50))
|
||||
if(!I.use_tool(src, user, 40, I.tool_volume))
|
||||
return FALSE
|
||||
user.visible_message("<span class='notice'>[user] refastens [src]'s maintenance panel!</span>", "<span class='notice'>You reset [src] to its factory settings!</span>")
|
||||
emagged = FALSE
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// Called when a mob tries to use the item as a tool.
|
||||
// Handles most checks.
|
||||
/**
|
||||
* Called when a mob tries to use the item as a tool.
|
||||
* Handles most checks.
|
||||
*/
|
||||
/obj/item/proc/use_tool(atom/target, mob/living/user, delay, amount=0, volume=0, datum/callback/extra_checks)
|
||||
// No delay means there is no start message, and no reason to call tool_start_check before use_tool.
|
||||
// Run the start check here so we wouldn't have to call it manually.
|
||||
|
||||
@@ -30,25 +30,27 @@
|
||||
return
|
||||
|
||||
/obj/structure/largecrate/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/crowbar))
|
||||
if(manifest)
|
||||
manifest.forceMove(loc)
|
||||
manifest = null
|
||||
update_icon()
|
||||
new /obj/item/stack/sheet/wood(src)
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/O in contents)
|
||||
var/atom/movable/A = O
|
||||
A.forceMove(T)
|
||||
user.visible_message("<span class='notice'>[user] pries \the [src] open.</span>", \
|
||||
"<span class='notice'>You pry open \the [src].</span>", \
|
||||
"<span class='notice'>You hear splitting wood.</span>")
|
||||
qdel(src)
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
if(user.a_intent != INTENT_HARM)
|
||||
attack_hand(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/largecrate/crowbar_act(mob/living/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(manifest)
|
||||
manifest.forceMove(loc)
|
||||
manifest = null
|
||||
update_icon()
|
||||
new /obj/item/stack/sheet/wood(src)
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/O in contents)
|
||||
var/atom/movable/A = O
|
||||
A.forceMove(T)
|
||||
user.visible_message("<span class='notice'>[user] pries [src] open.</span>", \
|
||||
"<span class='notice'>You pry open [src].</span>", \
|
||||
"<span class='notice'>You hear splitting wood.</span>")
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/largecrate/Destroy()
|
||||
var/turf/src_turf = get_turf(src)
|
||||
for(var/obj/O in contents)
|
||||
@@ -60,54 +62,60 @@
|
||||
/obj/structure/largecrate/lisa
|
||||
icon_state = "lisacrate"
|
||||
|
||||
/obj/structure/largecrate/lisa/attackby(obj/item/W as obj, mob/user as mob) //ugly but oh well
|
||||
if(istype(W, /obj/item/crowbar))
|
||||
new /mob/living/simple_animal/pet/dog/corgi/Lisa(loc)
|
||||
/obj/structure/largecrate/lisa/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
new /mob/living/simple_animal/pet/dog/corgi/Lisa(loc)
|
||||
return ..()
|
||||
|
||||
/obj/structure/largecrate/cow
|
||||
name = "cow crate"
|
||||
icon_state = "lisacrate"
|
||||
|
||||
/obj/structure/largecrate/cow/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/crowbar))
|
||||
new /mob/living/simple_animal/cow(loc)
|
||||
/obj/structure/largecrate/cow/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
new /mob/living/simple_animal/cow(loc)
|
||||
return ..()
|
||||
|
||||
/obj/structure/largecrate/goat
|
||||
name = "goat crate"
|
||||
icon_state = "lisacrate"
|
||||
|
||||
/obj/structure/largecrate/goat/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/crowbar))
|
||||
new /mob/living/simple_animal/hostile/retaliate/goat(loc)
|
||||
/obj/structure/largecrate/goat/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
new /mob/living/simple_animal/hostile/retaliate/goat(loc)
|
||||
return ..()
|
||||
|
||||
/obj/structure/largecrate/chick
|
||||
name = "chicken crate"
|
||||
icon_state = "lisacrate"
|
||||
|
||||
/obj/structure/largecrate/chick/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/crowbar))
|
||||
var/num = rand(4, 6)
|
||||
for(var/i in 1 to num)
|
||||
new /mob/living/simple_animal/chick(loc)
|
||||
/obj/structure/largecrate/chick/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
var/num = rand(4, 6)
|
||||
for(var/i in 1 to num)
|
||||
new /mob/living/simple_animal/chick(loc)
|
||||
return ..()
|
||||
|
||||
/obj/structure/largecrate/cat
|
||||
name = "cat crate"
|
||||
icon_state = "lisacrate"
|
||||
|
||||
/obj/structure/largecrate/cat/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/crowbar))
|
||||
new /mob/living/simple_animal/pet/cat(loc)
|
||||
/obj/structure/largecrate/cat/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
new /mob/living/simple_animal/pet/cat(loc)
|
||||
return ..()
|
||||
|
||||
/obj/structure/largecrate/secway
|
||||
name = "secway crate"
|
||||
|
||||
/obj/structure/largecrate/secway/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/crowbar))
|
||||
new /obj/vehicle/secway(loc)
|
||||
new /obj/item/key/security(loc)
|
||||
/obj/structure/largecrate/secway/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
new /obj/vehicle/secway(loc)
|
||||
new /obj/item/key/security(loc)
|
||||
return ..()
|
||||
|
||||
@@ -87,32 +87,40 @@
|
||||
put_in_cart(I, user)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[src] can't hold any more signs.</span>")
|
||||
else if(istype(I, /obj/item/crowbar))
|
||||
user.visible_message("<span class='warning'>[user] begins to empty the contents of [src].</span>")
|
||||
if(do_after(user, 30 * I.toolspeed, target = src))
|
||||
to_chat(usr, "<span class='notice'>You empty the contents of [src]'s bucket onto the floor.</span>")
|
||||
reagents.reaction(src.loc)
|
||||
src.reagents.clear_reagents()
|
||||
else if(istype(I, /obj/item/wrench))
|
||||
if(!anchored && !isinspace())
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
user.visible_message( \
|
||||
"[user] tightens \the [src]'s casters.", \
|
||||
"<span class='notice'> You have tightened \the [src]'s casters.</span>", \
|
||||
"You hear ratchet.")
|
||||
anchored = TRUE
|
||||
else if(anchored)
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
user.visible_message( \
|
||||
"[user] loosens \the [src]'s casters.", \
|
||||
"<span class='notice'> You have loosened \the [src]'s casters.</span>", \
|
||||
"You hear ratchet.")
|
||||
anchored = FALSE
|
||||
else if(mybag)
|
||||
mybag.attackby(I, user, params)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>You cannot interface your modules [src]!</span>")
|
||||
|
||||
/obj/structure/janitorialcart/crowbar_act(mob/living/user, obj/item/I)
|
||||
. = TRUE
|
||||
user.visible_message("<span class='warning'>[user] begins to empty the contents of [src].</span>")
|
||||
if(!I.use_tool(src, user, 3 SECONDS, I.tool_volume))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You empty the contents of [src]'s bucket onto the floor.</span>")
|
||||
reagents.reaction(loc)
|
||||
reagents.clear_reagents()
|
||||
|
||||
/obj/structure/janitorialcart/wrench_act(mob/living/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(!anchored && !isinspace())
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
user.visible_message( \
|
||||
"[user] tightens [src]'s casters.", \
|
||||
"<span class='notice'>You have tightened [src]'s casters.</span>", \
|
||||
"You hear ratchet.")
|
||||
anchored = TRUE
|
||||
return
|
||||
if(anchored)
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
user.visible_message( \
|
||||
"[user] loosens [src]'s casters.", \
|
||||
"<span class='notice'>You have loosened [src]'s casters.</span>", \
|
||||
"You hear ratchet.")
|
||||
anchored = FALSE
|
||||
|
||||
/obj/structure/janitorialcart/attack_hand(mob/user)
|
||||
var/list/cart_items = list()
|
||||
|
||||
|
||||
@@ -68,21 +68,22 @@
|
||||
..()
|
||||
|
||||
/obj/structure/kitchenspike/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/crowbar))
|
||||
if(!has_buckled_mobs())
|
||||
playsound(loc, I.usesound, 100, 1)
|
||||
if(do_after(user, 20 * I.toolspeed, target = src))
|
||||
to_chat(user, "<span class='notice'>You pry the spikes out of the frame.</span>")
|
||||
deconstruct(TRUE)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You can't do that while something's on the spike!</span>")
|
||||
return
|
||||
else if(istype(I, /obj/item/grab))
|
||||
if(istype(I, /obj/item/grab))
|
||||
var/obj/item/grab/G = I
|
||||
if(G.affecting && isliving(G.affecting))
|
||||
start_spike(G.affecting, user)
|
||||
return ..()
|
||||
|
||||
/obj/structure/kitchenspike/crowbar_act(mob/living/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(has_buckled_mobs())
|
||||
to_chat(user, "<span class='notice'>You can't do that while something's on the spike!</span>")
|
||||
return
|
||||
if(!I.use_tool(src, user, 2 SECONDS, I.tool_volume))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You pry the spikes out of the frame.</span>")
|
||||
deconstruct(TRUE)
|
||||
|
||||
/obj/structure/kitchenspike/MouseDrop_T(mob/living/victim, mob/living/user)
|
||||
if(!user.Adjacent(src) || !user.Adjacent(victim) || isAI(user) || !ismob(victim))
|
||||
return
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
if(!I.tool_start_check(user, amount = 0))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
|
||||
if(I.use_tool(src, user, 40, volume = 50))
|
||||
if(I.use_tool(src, user, 4 SECONDS, I.tool_volume))
|
||||
obj_integrity = max_integrity
|
||||
to_chat(user, "<span class='notice'>You repair [src].</span>")
|
||||
|
||||
|
||||
@@ -93,24 +93,33 @@
|
||||
to_chat(user, "<span class='warning'>\The [T] seems stuck to your hand!</span>")
|
||||
return
|
||||
if(panel_open)
|
||||
if(istype(O, /obj/item/wrench))
|
||||
default_unfasten_wrench(user, O, time = 6 SECONDS)
|
||||
if(component_parts && istype(O, /obj/item/crowbar))
|
||||
if(tickets) //save the tickets!
|
||||
print_tickets()
|
||||
default_deconstruction_crowbar(user, O)
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/prize_counter/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!panel_open || !component_parts)
|
||||
return
|
||||
. = TRUE
|
||||
if(tickets) //save the tickets!
|
||||
print_tickets()
|
||||
default_deconstruction_crowbar(user, I)
|
||||
|
||||
/obj/machinery/prize_counter/screwdriver_act(mob/living/user, obj/item/I)
|
||||
if(!anchored)
|
||||
return
|
||||
I.play_tool_sound(src)
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
panel_open = !panel_open
|
||||
to_chat(user, "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance panel.</span>")
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/prize_counter/wrench_act(mob/living/user, obj/item/I)
|
||||
if(!panel_open)
|
||||
return
|
||||
. = TRUE
|
||||
default_unfasten_wrench(user, I, time = 6 SECONDS)
|
||||
|
||||
/obj/machinery/prize_counter/attack_hand(mob/user)
|
||||
if(..())
|
||||
|
||||
@@ -209,12 +209,7 @@
|
||||
add_fingerprint()
|
||||
|
||||
/obj/machinery/mineral/equipment_vendor/attackby(obj/item/I, mob/user, params)
|
||||
if(default_deconstruction_screwdriver(user, "mining-open", "mining", I))
|
||||
return
|
||||
if(panel_open)
|
||||
if(istype(I, /obj/item/crowbar))
|
||||
remove_id()
|
||||
default_deconstruction_crowbar(user, I)
|
||||
return TRUE
|
||||
if(istype(I, /obj/item/mining_voucher))
|
||||
if(!has_power())
|
||||
@@ -234,6 +229,17 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/mineral/equipment_vendor/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!panel_open)
|
||||
return
|
||||
. = TRUE
|
||||
remove_id()
|
||||
default_deconstruction_crowbar(user, I)
|
||||
|
||||
/obj/machinery/mineral/equipment_vendor/screwdriver_act(mob/living/user, obj/item/I)
|
||||
if(default_deconstruction_screwdriver(user, "mining-open", "mining", I))
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Called when someone slaps the machine with a mining voucher
|
||||
*
|
||||
|
||||
@@ -21,15 +21,16 @@
|
||||
S.remove_from_storage(O, src) //This will move the item to this item's contents
|
||||
CHECK_TICK
|
||||
to_chat(user, "<span class='notice'>You empty the satchel into the box.</span>")
|
||||
else if(istype(W, /obj/item/crowbar))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
var/obj/item/crowbar/C = W
|
||||
if(do_after(user, 50 * C.toolspeed, target = src))
|
||||
user.visible_message("<span class='notice'>[user] pries [src] apart.</span>", "<span class='notice'>You pry apart [src].</span>", "<span class='italics'>You hear splitting wood.</span>")
|
||||
deconstruct(TRUE, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/ore_box/crowbar_act(mob/living/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, 5 SECONDS, I.tool_volume))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] pries [src] apart.</span>", "<span class='notice'>You pry apart [src].</span>", "<span class='italics'>You hear splitting wood.</span>")
|
||||
deconstruct(TRUE, user)
|
||||
|
||||
/obj/structure/ore_box/attack_hand(mob/user)
|
||||
if(Adjacent(user))
|
||||
show_contents(user)
|
||||
|
||||
@@ -157,10 +157,6 @@
|
||||
to_chat(user, "<span class='warning'>The maintenance drone chassis is not compatible with [I].</span>")
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/crowbar))
|
||||
to_chat(user, "<span class='warning'>The machine is hermetically sealed. You can't open the case.</span>")
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda))
|
||||
if(stat == DEAD)
|
||||
// Currently not functional, so commenting out until it's fixed to avoid confusion
|
||||
@@ -206,6 +202,10 @@
|
||||
|
||||
..()
|
||||
|
||||
/mob/living/silicon/robot/drone/crowbar_act(mob/user, obj/item/I)
|
||||
. = TRUE
|
||||
to_chat(user, "<span class='warning'>The machine is hermetically sealed. You can't open the case.</span>")
|
||||
|
||||
/mob/living/silicon/robot/drone/Destroy()
|
||||
. = ..()
|
||||
QDEL_NULL(stack_glass)
|
||||
|
||||
@@ -106,25 +106,6 @@
|
||||
visible_message("[user] inserts a cell into [src].",
|
||||
"<span class='notice'>You insert the new cell into [src].</span>")
|
||||
update_controls()
|
||||
else if(istype(I, /obj/item/crowbar) && open && cell)
|
||||
cell.add_fingerprint(usr)
|
||||
cell.forceMove(loc)
|
||||
cell = null
|
||||
visible_message("[user] crowbars out the power cell from [src].",
|
||||
"<span class='notice'>You pry the powercell out of [src].</span>")
|
||||
update_controls()
|
||||
else if(istype(I, /obj/item/wrench))
|
||||
if(health < maxHealth)
|
||||
adjustBruteLoss(-25)
|
||||
updatehealth()
|
||||
user.visible_message(
|
||||
"<span class='notice'>[user] repairs [src]!</span>",
|
||||
"<span class='notice'>You repair [src]!</span>"
|
||||
)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[src] does not need a repair!</span>")
|
||||
else if((istype(I, /obj/item/multitool) || istype(I, /obj/item/wirecutters)) && open)
|
||||
return attack_hand(user)
|
||||
else if(load && ismob(load)) // chance to knock off rider
|
||||
if(prob(1 + I.force * 2))
|
||||
unload(0)
|
||||
@@ -138,16 +119,58 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!open || !cell)
|
||||
return
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
cell.add_fingerprint(user)
|
||||
cell.forceMove(loc)
|
||||
cell = null
|
||||
visible_message("[user] crowbars out the power cell from [src].",
|
||||
"<span class='notice'>You pry the powercell out of [src].</span>")
|
||||
update_controls()
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/multitool_act(mob/living/user, obj/item/I)
|
||||
if(!open)
|
||||
return
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
attack_hand(user)
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/screwdriver_act(mob/living/user, obj/item/I)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
|
||||
if(open)
|
||||
on = FALSE
|
||||
update_controls()
|
||||
update_icon()
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/wrench_act(mob/living/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(health >= maxHealth)
|
||||
to_chat(user, "<span class='notice'>[src] does not need a repair!</span>")
|
||||
return
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
adjustBruteLoss(-25)
|
||||
updatehealth()
|
||||
user.visible_message(
|
||||
"<span class='notice'>[user] repairs [src]!</span>",
|
||||
"<span class='notice'>You repair [src]!</span>"
|
||||
)
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/wirecutter_act(mob/living/user, obj/item/I)
|
||||
if(!open)
|
||||
return
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
attack_hand(user)
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/emag_act(mob/user)
|
||||
if(!emagged)
|
||||
emagged = TRUE
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
loaded_tank = I
|
||||
I.forceMove(src)
|
||||
update_icons()
|
||||
else if(iscrowbar(I))
|
||||
else if(I.tool_behaviour == TOOL_CROWBAR)
|
||||
if(loaded_tank && !locked)
|
||||
eject()
|
||||
return TRUE
|
||||
|
||||
@@ -201,38 +201,43 @@
|
||||
addstack.use(amount)
|
||||
SStgui.update_uis(src)
|
||||
return
|
||||
else if(!active)
|
||||
if(istype(O, /obj/item/wrench))
|
||||
|
||||
if(!anchored)
|
||||
connect_to_network()
|
||||
to_chat(user, "<span class='notice'>You secure the generator to the floor.</span>")
|
||||
else
|
||||
disconnect_from_network()
|
||||
to_chat(user, "<span class='notice'>You unsecure the generator from the floor.</span>")
|
||||
|
||||
playsound(src.loc, O.usesound, 50, 1)
|
||||
anchored = !anchored
|
||||
|
||||
else if(istype(O, /obj/item/storage/part_replacer) && panel_open)
|
||||
if(!active)
|
||||
if(istype(O, /obj/item/storage/part_replacer) && panel_open)
|
||||
exchange_parts(user, O)
|
||||
return
|
||||
else if(istype(O, /obj/item/crowbar) && panel_open)
|
||||
default_deconstruction_crowbar(user, O)
|
||||
else
|
||||
return ..()
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(active || !panel_open)
|
||||
return
|
||||
. = TRUE
|
||||
default_deconstruction_crowbar(user, I)
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/screwdriver_act(mob/living/user, obj/item/I)
|
||||
if(active)
|
||||
return
|
||||
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
panel_open = !panel_open
|
||||
I.play_tool_sound(src)
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='notice'>You open the access panel.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You close the access panel.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/wrench_act(mob/living/user, obj/item/I)
|
||||
if(active)
|
||||
return
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
if(!anchored)
|
||||
connect_to_network()
|
||||
to_chat(user, "<span class='notice'>You secure the generator to the floor.</span>")
|
||||
else
|
||||
disconnect_from_network()
|
||||
to_chat(user, "<span class='notice'>You unsecure the generator from the floor.</span>")
|
||||
anchored = !anchored
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/attack_hand(mob/user as mob)
|
||||
..()
|
||||
|
||||
@@ -211,19 +211,7 @@
|
||||
|
||||
/obj/item/solar_assembly/attackby(obj/item/W, mob/user, params)
|
||||
|
||||
if(!anchored && isturf(loc))
|
||||
if(istype(W, /obj/item/wrench))
|
||||
anchored = TRUE
|
||||
user.visible_message("[user] wrenches the solar assembly into place.", "<span class='notice'>You wrench the solar assembly into place.</span>")
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
return 1
|
||||
else
|
||||
if(istype(W, /obj/item/wrench))
|
||||
anchored = FALSE
|
||||
user.visible_message("[user] unwrenches the solar assembly from its place.", "<span class='notice'>You unwrench the solar assembly from its place.</span>")
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
return 1
|
||||
|
||||
if(anchored || !isturf(loc))
|
||||
if(istype(W, /obj/item/stack/sheet/glass) || istype(W, /obj/item/stack/sheet/rglass))
|
||||
var/obj/item/stack/sheet/S = W
|
||||
if(S.use(2))
|
||||
@@ -237,25 +225,41 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need two sheets of glass to put them into a solar panel.</span>")
|
||||
return
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
if(!tracker)
|
||||
if(istype(W, /obj/item/tracker_electronics))
|
||||
if(!user.drop_item())
|
||||
return
|
||||
tracker = 1
|
||||
tracker = TRUE
|
||||
qdel(W)
|
||||
user.visible_message("[user] inserts the electronics into the solar assembly.", "<span class='notice'>You insert the electronics into the solar assembly.</span>")
|
||||
return 1
|
||||
else if(istype(W, /obj/item/crowbar))
|
||||
new /obj/item/tracker_electronics(src.loc)
|
||||
tracker = 0
|
||||
playsound(loc, W.usesound, 50, 1)
|
||||
user.visible_message("[user] takes out the electronics from the solar assembly.", "<span class='notice'>You take out the electronics from the solar assembly.</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/solar_assembly/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!tracker)
|
||||
return
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, I.tool_volume))
|
||||
return
|
||||
new /obj/item/tracker_electronics(loc)
|
||||
tracker = FALSE
|
||||
user.visible_message("[user] takes out the electronics from the solar assembly.", "<span class='notice'>You take out the electronics from the solar assembly.</span>")
|
||||
|
||||
/obj/item/solar_assembly/wrench_act(mob/living/user, obj/item/I)
|
||||
if(!anchored && isturf(loc))
|
||||
if(I.use_tool(src, user, I.tool_volume))
|
||||
anchored = TRUE
|
||||
user.visible_message("[user] wrenches the solar assembly into place.", "<span class='notice'>You wrench the solar assembly into place.</span>")
|
||||
return TRUE
|
||||
else
|
||||
if(I.use_tool(src, user, I.tool_volume))
|
||||
anchored = FALSE
|
||||
user.visible_message("[user] unwrenches the solar assembly from its place.", "<span class='notice'>You unwrench the solar assembly from its place.</span>")
|
||||
return TRUE
|
||||
|
||||
//
|
||||
// Solar Control Computer
|
||||
//
|
||||
|
||||
@@ -75,28 +75,31 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
return round(A / max(1, (all_materials[M] * efficiency_coeff)))
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/attackby(obj/item/O as obj, mob/user as mob, params)
|
||||
if(default_deconstruction_screwdriver(user, "circuit_imprinter_t", "circuit_imprinter", O))
|
||||
if(linked_console)
|
||||
linked_console.linked_imprinter = null
|
||||
linked_console = null
|
||||
return
|
||||
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
|
||||
if(panel_open)
|
||||
if(istype(O, /obj/item/crowbar))
|
||||
for(var/obj/I in component_parts)
|
||||
if(istype(I, /obj/item/reagent_containers/glass/beaker))
|
||||
reagents.trans_to(I, reagents.total_volume)
|
||||
I.loc = src.loc
|
||||
materials.retrieve_all()
|
||||
default_deconstruction_crowbar(user, O)
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You can't load [src] while it's opened.</span>")
|
||||
return
|
||||
to_chat(user, "<span class='warning'>You can't load [src] while it's opened.</span>")
|
||||
return
|
||||
if(O.is_open_container())
|
||||
return FALSE
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!panel_open)
|
||||
return
|
||||
. = TRUE
|
||||
for(var/obj/component in component_parts)
|
||||
if(istype(component, /obj/item/reagent_containers/glass/beaker))
|
||||
reagents.trans_to(component, reagents.total_volume)
|
||||
component.loc = src.loc
|
||||
materials.retrieve_all()
|
||||
default_deconstruction_crowbar(user, I)
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/screwdriver_act(mob/living/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(!default_deconstruction_screwdriver(user, "circuit_imprinter_t", "circuit_imprinter", I))
|
||||
return
|
||||
if(linked_console)
|
||||
linked_console.linked_imprinter = null
|
||||
linked_console = null
|
||||
|
||||
@@ -87,21 +87,23 @@ Note: Must be placed west/left of and R&D console to function.
|
||||
return FALSE
|
||||
|
||||
if(panel_open)
|
||||
if(istype(O, /obj/item/crowbar))
|
||||
for(var/obj/I in component_parts)
|
||||
if(istype(I, /obj/item/reagent_containers/glass/beaker))
|
||||
reagents.trans_to(I, reagents.total_volume)
|
||||
I.loc = src.loc
|
||||
for(var/obj/item/reagent_containers/glass/G in component_parts)
|
||||
reagents.trans_to(G, G.reagents.maximum_volume)
|
||||
materials.retrieve_all()
|
||||
default_deconstruction_crowbar(user, O)
|
||||
return TRUE
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You can't load [src] while it's opened.</span>")
|
||||
return TRUE
|
||||
to_chat(user, "<span class='warning'>You can't load [src] while it's opened.</span>")
|
||||
return TRUE
|
||||
|
||||
if(O.is_open_container())
|
||||
return FALSE
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!panel_open)
|
||||
return
|
||||
. = TRUE
|
||||
for(var/obj/component in component_parts)
|
||||
if(istype(component, /obj/item/reagent_containers/glass/beaker))
|
||||
reagents.trans_to(component, reagents.total_volume)
|
||||
component.loc = src.loc
|
||||
for(var/obj/item/reagent_containers/glass/G in component_parts)
|
||||
reagents.trans_to(G, G.reagents.maximum_volume)
|
||||
materials.retrieve_all()
|
||||
default_deconstruction_crowbar(user, I)
|
||||
|
||||
@@ -142,15 +142,15 @@
|
||||
|
||||
/obj/machinery/r_n_d/server/attackby(obj/item/O as obj, mob/user as mob, params)
|
||||
if(exchange_parts(user, O))
|
||||
return 1
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
if(panel_open)
|
||||
if(istype(O, /obj/item/crowbar))
|
||||
griefProtection()
|
||||
default_deconstruction_crowbar(user, O)
|
||||
return 1
|
||||
else
|
||||
return ..()
|
||||
/obj/machinery/r_n_d/server/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(!panel_open)
|
||||
return
|
||||
. = TRUE
|
||||
griefProtection()
|
||||
default_deconstruction_crowbar(user, I)
|
||||
|
||||
/obj/machinery/r_n_d/server/screwdriver_act(mob/living/user, obj/item/I)
|
||||
default_deconstruction_screwdriver(user, "RD-server-on_t", "RD-server-on", I)
|
||||
|
||||
Reference in New Issue
Block a user