diff --git a/code/modules/heavy_vehicle/equipment/mining.dm b/code/modules/heavy_vehicle/equipment/mining.dm index b7e30e43abb..736d1164fa3 100644 --- a/code/modules/heavy_vehicle/equipment/mining.dm +++ b/code/modules/heavy_vehicle/equipment/mining.dm @@ -118,3 +118,65 @@ ABSTRACT_TYPE(/obj/item/mecha_equipment/mounted_system/mining) return null return "[exosuit_ka.get_ammo()]/[exosuit_ka.installed_cell.cell_increase / exosuit_ka.cost_increase]" + +/obj/item/mecha_equipment/ore_summoner + name = "mounted ore summoner" + desc = "A large back-mounted ore summoner, capable of pulling ore into an ore box held within a clamp. If no ore box is found, the ore will be deposited beneath the exosuit." + icon_state = "mecha_ore_summoner" + restricted_hardpoints = list(HARDPOINT_BACK) + restricted_software = list(MECH_SOFTWARE_UTILITY) + w_class = WEIGHT_CLASS_HUGE + origin_tech = list(TECH_BLUESPACE = 4, TECH_ENGINEERING = 3) + + /// When last the summoner was used + var/last_use = 0 + + /// How long the cooldown is before the ore can be pulsed again + var/cooldown_time = 5 SECONDS + + /// How many chunks of ore can be moved at one time + var/static/ore_limit = 50 + +/obj/item/mecha_equipment/ore_summoner/afterattack(var/atom/target, var/mob/living/user, var/inrange, var/params) + return FALSE + +/obj/item/mecha_equipment/ore_summoner/attack_self(var/mob/user) + . = ..() + if(.) + summon_ore(user) + +/obj/item/mecha_equipment/ore_summoner/proc/summon_ore(var/mob/user) + if(last_use + cooldown_time >= world.time) + to_chat(user, SPAN_WARNING("The ore summoner is recalibrating...")) + return + + var/obj/structure/ore_box/ore_box + for(var/hardpoint in owner.hardpoints) + var/obj/item/mecha_equipment/clamp/clamp = owner.hardpoints[hardpoint] + if(!istype(clamp)) + continue + var/obj/structure/ore_box/box = locate() in clamp + if(box) + ore_box = box + break + + var/turf/our_turf = get_turf(owner) + + var/limit = ore_limit + for(var/obj/item/ore/ore in range(7, owner)) + if(limit <= 0) + break + if(ore_box) + ore.forceMove(ore_box) + else + ore.forceMove(our_turf) + limit -= 1 + CHECK_TICK + + last_use = world.time + +/obj/item/mecha_equipment/ore_summoner/get_hardpoint_status_value() + return last_use + cooldown_time < world.time ? 1 : 0 + +/obj/item/mecha_equipment/ore_summoner/get_hardpoint_maptext() + return last_use + cooldown_time < world.time ? "Ready" : "Recharging" diff --git a/code/modules/heavy_vehicle/premade/miner.dm b/code/modules/heavy_vehicle/premade/miner.dm index d84b035599b..d1818ba36a7 100644 --- a/code/modules/heavy_vehicle/premade/miner.dm +++ b/code/modules/heavy_vehicle/premade/miner.dm @@ -11,6 +11,7 @@ h_l_hand = /obj/item/mecha_equipment/drill h_r_hand = /obj/item/mecha_equipment/clamp h_l_shoulder = /obj/item/mecha_equipment/mounted_system/mining/kinetic_accelerator + h_back = /obj/item/mecha_equipment/ore_summoner /mob/living/heavy_vehicle/premade/miner/remote name = "remote mining mecha" diff --git a/code/modules/research/designs/mechfab/mechs/designs_exosuit_equipment.dm b/code/modules/research/designs/mechfab/mechs/designs_exosuit_equipment.dm index 66a514dfba9..95b89d58624 100644 --- a/code/modules/research/designs/mechfab/mechs/designs_exosuit_equipment.dm +++ b/code/modules/research/designs/mechfab/mechs/designs_exosuit_equipment.dm @@ -154,3 +154,9 @@ materials = list(MATERIAL_STEEL = 25000, MATERIAL_GLASS = 5000) req_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 3, TECH_POWER = 3) build_path = /obj/item/mecha_equipment/mounted_system/mining/kinetic_accelerator + +/datum/design/item/mechfab/exosuit_equipment/ore_summoner + name = "Mounted Ore Summoner" + materials = list(MATERIAL_STEEL = 10000, MATERIAL_GLASS = 5000) + req_tech = list(TECH_MATERIAL = 3, TECH_BLUESPACE = 3) + build_path = /obj/item/mecha_equipment/ore_summoner diff --git a/html/changelogs/mech_ore_summoner.yml b/html/changelogs/mech_ore_summoner.yml new file mode 100644 index 00000000000..c274467f6a1 --- /dev/null +++ b/html/changelogs/mech_ore_summoner.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Added an exosuit compatible ore summoner, capable of pulling ore directly into an ore box held within the exosuit's clamp. Machinists can print them at the cost of steel and glass, and the mining mech dropped from the dropper comes with it equipped." diff --git a/icons/mecha/mech_equipment.dmi b/icons/mecha/mech_equipment.dmi index 20589dbb784..f40cc23e795 100644 Binary files a/icons/mecha/mech_equipment.dmi and b/icons/mecha/mech_equipment.dmi differ