mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Makes drills report faults over supply channel (#4989)
* Makes drills report faults over supply channel * too chatte * caps and punctuation are important
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
var/supported = 0
|
var/supported = 0
|
||||||
var/active = 0
|
var/active = 0
|
||||||
var/list/resource_field = list()
|
var/list/resource_field = list()
|
||||||
|
var/obj/item/device/radio/intercom/faultreporter = new /obj/item/device/radio/intercom{channels=list("Supply")}(null)
|
||||||
|
|
||||||
var/ore_types = list(
|
var/ore_types = list(
|
||||||
"hematite" = /obj/item/weapon/ore/iron,
|
"hematite" = /obj/item/weapon/ore/iron,
|
||||||
@@ -60,7 +61,7 @@
|
|||||||
if(!active) return
|
if(!active) return
|
||||||
|
|
||||||
if(!anchored || !use_cell_power())
|
if(!anchored || !use_cell_power())
|
||||||
system_error("system configuration or charge error")
|
system_error("System configuration or charge error.")
|
||||||
return
|
return
|
||||||
|
|
||||||
if(need_update_field)
|
if(need_update_field)
|
||||||
@@ -85,7 +86,10 @@
|
|||||||
harvesting.has_resources = 0
|
harvesting.has_resources = 0
|
||||||
harvesting.resources = null
|
harvesting.resources = null
|
||||||
resource_field -= harvesting
|
resource_field -= harvesting
|
||||||
harvesting = pick(resource_field)
|
if(resource_field.len) // runtime protection
|
||||||
|
harvesting = pick(resource_field)
|
||||||
|
else
|
||||||
|
harvesting = null
|
||||||
|
|
||||||
if(!harvesting) return
|
if(!harvesting) return
|
||||||
|
|
||||||
@@ -95,7 +99,7 @@
|
|||||||
for(var/metal in ore_types)
|
for(var/metal in ore_types)
|
||||||
|
|
||||||
if(contents.len >= capacity)
|
if(contents.len >= capacity)
|
||||||
system_error("insufficient storage space")
|
system_error("Insufficient storage space.")
|
||||||
active = 0
|
active = 0
|
||||||
need_player_check = 1
|
need_player_check = 1
|
||||||
update_icon()
|
update_icon()
|
||||||
@@ -131,12 +135,19 @@
|
|||||||
active = 0
|
active = 0
|
||||||
need_player_check = 1
|
need_player_check = 1
|
||||||
update_icon()
|
update_icon()
|
||||||
|
system_error("Resources depleted.")
|
||||||
|
|
||||||
/obj/machinery/mining/drill/attack_ai(var/mob/user as mob)
|
/obj/machinery/mining/drill/attack_ai(var/mob/user as mob)
|
||||||
return src.attack_hand(user)
|
return src.attack_hand(user)
|
||||||
|
|
||||||
/obj/machinery/mining/drill/attackby(obj/item/O as obj, mob/user as mob)
|
/obj/machinery/mining/drill/attackby(obj/item/O as obj, mob/user as mob)
|
||||||
if(!active)
|
if(!active)
|
||||||
|
if(istype(O, /obj/item/device/multitool))
|
||||||
|
var/newtag = text2num(sanitizeSafe(input(user, "Enter new ID number or leave empty to cancel.", "Assign ID number") as text, 4))
|
||||||
|
if(newtag)
|
||||||
|
name = "[initial(name)] #[newtag]"
|
||||||
|
to_chat(user, "<span class='notice'>You changed the drill ID to: [newtag]</span>")
|
||||||
|
return
|
||||||
if(default_deconstruction_screwdriver(user, O))
|
if(default_deconstruction_screwdriver(user, O))
|
||||||
return
|
return
|
||||||
if(default_deconstruction_crowbar(user, O))
|
if(default_deconstruction_crowbar(user, O))
|
||||||
@@ -234,6 +245,7 @@
|
|||||||
|
|
||||||
if(error)
|
if(error)
|
||||||
src.visible_message("<span class='notice'>\The [src] flashes a '[error]' warning.</span>")
|
src.visible_message("<span class='notice'>\The [src] flashes a '[error]' warning.</span>")
|
||||||
|
faultreporter.autosay(error, src.name, "Supply")
|
||||||
need_player_check = 1
|
need_player_check = 1
|
||||||
active = 0
|
active = 0
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|||||||
Reference in New Issue
Block a user