Various Tweaks and Changes (#9222)

This commit is contained in:
Geeves
2020-06-30 18:19:54 +02:00
committed by GitHub
parent 734ad579a2
commit 972c0ae9db
6 changed files with 97 additions and 16 deletions
+52 -9
View File
@@ -196,11 +196,33 @@
if(!active)
if(default_deconstruction_screwdriver(user, O))
return
if (!panel_open)
if(default_deconstruction_crowbar(user, O))
return
if(default_part_replacement(user, O))
if(default_part_replacement(user, O))
return
if(istype(O, /obj/item/mining_scanner))
if(!length(resource_field))
to_chat(user, SPAN_WARNING("\The [src] has no resource field to draw data from!"))
return
to_chat(user, SPAN_NOTICE("You start drawing the data from \the [src]..."))
if(do_after(user, 50, TRUE))
if(!length(resource_field))
to_chat(user, SPAN_WARNING("\The [src] has no resource field to draw data from!"))
return
var/list/ore_data = list()
for(var/ore_type in ore_types)
ore_data[ore_type] = 0
for(var/field in resource_field)
var/turf/T = field
if(!T.resources)
continue
for(var/ore in ore_types)
if(T.resources[ore])
ore_data[ore] += T.resources[ore]
to_chat(user, SPAN_NOTICE("\The [src] has found this ore in the vicinity, and is able to gather it:"))
for(var/entry in ore_data)
to_chat(user, SPAN_NOTICE(" | <b>[entry]</b> - <b>[ore_data[entry]]</b>"))
return
if(active)
return ..()
@@ -237,16 +259,37 @@
return
if(O.iscrowbar())
if (panel_open)
if(panel_open)
if(cell)
to_chat(user, SPAN_NOTICE("You wrench out \the [cell]."))
to_chat(user, SPAN_NOTICE("You shimmy out \the [cell]."))
cell.forceMove(get_turf(user))
component_parts -= cell
user.put_in_hands(cell)
cell = null
return
else
to_chat(user, SPAN_WARNING("There's no cell to remove!"))
return
else
to_chat(user, SPAN_WARNING("The hatch must be open to take out a power cell."))
return
if(istype(O, /obj/item/gripper/miner)) // the gripper will always be empty, because it passes its wrapped object's attack if it has one
var/obj/item/gripper/miner/M = O
if(panel_open)
if(cell)
to_chat(user, SPAN_NOTICE("You use your gripper to squeeze the cell out of its case."))
cell.forceMove(get_turf(user))
component_parts -= cell
M.grip_item(cell, user, FALSE)
cell = null
return
else
to_chat(user, SPAN_WARNING("There's no cell to remove!"))
return
else
to_chat(user, SPAN_WARNING("The hatch must be open to take out a power cell."))
return
if(istype(O, /obj/item/cell))
if(panel_open)
@@ -259,11 +302,11 @@
cell = O
component_parts += O
O.add_fingerprint(user)
visible_message(span("notice", "\The [user] inserts a power cell into \the [src]."),
span("notice", "You insert the power cell into \the [src]."))
visible_message("<b>\The [user]</b> inserts a power cell into \the [src].",
SPAN_NOTICE("You insert the power cell into \the [src]."))
power_change()
else
to_chat(user, span("notice", "The hatch must be open to insert a power cell."))
to_chat(user, SPAN_WARNING("The hatch must be open to insert a power cell."))
return
else
..()