mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 00:55:20 +01:00
Arcmining: Chemical Boosting (#95530)
This commit is contained in:
@@ -23,6 +23,12 @@
|
||||
///The action verb to display to players
|
||||
var/action = "processing"
|
||||
|
||||
|
||||
/// What list of reagents should we look at when we boost the effectiveness of this machinery? Assign a value to a chem as well, eg: /datum/reagent/water = 1 is a 10% boost
|
||||
var/list/booster_list = list()
|
||||
/// What reagent should be produced when a boost chemical is replaced by the booster_reagent?
|
||||
var/datum/reagent/waste_chemical = /datum/reagent/water
|
||||
|
||||
/// Cooldown associated with the sound played for collecting mining points.
|
||||
COOLDOWN_DECLARE(sound_cooldown)
|
||||
/// Cooldown associated with taking in boulds.
|
||||
@@ -75,14 +81,18 @@
|
||||
|
||||
/obj/machinery/bouldertech/examine(mob/user)
|
||||
. = ..()
|
||||
. += span_notice("The machine reads that it has [span_bold("[points_held] mining points")] stored. Swipe an ID to claim them.")
|
||||
. += span_notice("Click to remove a stored boulder.")
|
||||
|
||||
. += span_suppradio("The machine reads that it has [EXAMINE_HINT("[points_held] mining points")] stored. Swipe an ID to claim them.")
|
||||
|
||||
var/boulder_count = 0
|
||||
for(var/obj/item/boulder/potential_boulder in contents)
|
||||
boulder_count += 1
|
||||
. += span_notice("Storage capacity = <b>[boulder_count]/[boulders_held_max] boulders</b>.")
|
||||
. += span_notice("Can process up to <b>[boulders_processing_count] boulders</b> at a time.")
|
||||
|
||||
if(boulder_count >= 1)
|
||||
. += span_notice("[EXAMINE_HINT("Right Click")] to manually remove a stored boulder.<br />")
|
||||
|
||||
. += span_info("Storage capacity = <b>[boulder_count]/[boulders_held_max] boulders</b>.")
|
||||
. += span_info("This machine can process up to [EXAMINE_HINT("[boulders_processing_count] boulders")] at a time.")
|
||||
|
||||
if(anchored)
|
||||
. += span_notice("It's [EXAMINE_HINT("anchored")] in place.")
|
||||
@@ -94,6 +104,15 @@
|
||||
if(panel_open)
|
||||
. += span_notice("The whole machine can be [EXAMINE_HINT("pried")] apart.")
|
||||
|
||||
/obj/machinery/bouldertech/examine_more(mob/user)
|
||||
. = ..()
|
||||
|
||||
if(length(booster_list))
|
||||
. += span_notice("This machine's output is boosted by <b>chemical intake:</b><br>")
|
||||
for(var/datum/reagent/increment as anything in booster_list)
|
||||
. += span_info("• [increment::name]: Provides [booster_list[increment] * 10]% Boost")
|
||||
. += span_notice("<br>Upon being boosted successfully, \the [src] will produce [EXAMINE_HINT("[waste_chemical.name]")].")
|
||||
|
||||
/obj/machinery/bouldertech/update_icon_state()
|
||||
. = ..()
|
||||
var/suffix = ""
|
||||
@@ -338,7 +357,8 @@
|
||||
|
||||
//if boulders are kept inside because there is no space to eject them, then they could be reprocessed, lets avoid that
|
||||
if(!chosen_boulder.processed_by)
|
||||
check_for_boosts()
|
||||
if(length(reagents.reagent_list))
|
||||
check_for_boosts() //Handles the mineral boosting, as well as creating waste. Must have reagents in the machine.
|
||||
|
||||
//here we loop through the boulder's ores
|
||||
var/list/rejected_mats = list()
|
||||
@@ -347,7 +367,7 @@
|
||||
if(!can_process_material(possible_mat))
|
||||
rejected_mats[possible_mat] = quantity
|
||||
continue
|
||||
points_held = round(points_held + (quantity * possible_mat.points_per_unit * MINING_POINT_MACHINE_MULTIPLIER)) // put point total here into machine
|
||||
points_held += round(quantity * possible_mat.points_per_boulder_unit) // put point total here into machine
|
||||
if(isnull(silo_materials.silo) || !silo_materials.mat_container.insert_amount_mat(quantity, possible_mat))
|
||||
new possible_mat.sheet_type(drop_location(), floor(quantity / SHEET_MATERIAL_AMOUNT))
|
||||
|
||||
@@ -358,7 +378,7 @@
|
||||
if(!length(chosen_boulder.custom_materials))
|
||||
playsound(loc, usage_sound, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
if(istype(chosen_boulder, /obj/item/boulder/artifact))
|
||||
points_held = round((points_held + MINER_POINT_MULTIPLIER) * MINING_POINT_MACHINE_MULTIPLIER) /// Artifacts give bonus points!
|
||||
points_held = round((points_held + MINER_POINT_MULTIPLIER)) /// Artifacts give bonus points!
|
||||
chosen_boulder.break_apart()
|
||||
return//We've processed all the materials in the boulder, so we can just destroy it in break_apart.
|
||||
|
||||
@@ -387,7 +407,7 @@
|
||||
breakdown_boulder(potential_boulder)
|
||||
boulders_found = FALSE
|
||||
|
||||
//when the boulder is removed it plays sound and displays a balloon alert. don't overlap when that happens
|
||||
//when the boulder is removed it plays sound and displays a balloon alert. Don't overlap when that happens
|
||||
if(boulders_found)
|
||||
playsound(loc, usage_sound, 29, FALSE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
balloon_alert_to_viewers(action)
|
||||
|
||||
@@ -5,12 +5,21 @@
|
||||
*/
|
||||
/obj/machinery/bouldertech/refinery
|
||||
name = "boulder refinery"
|
||||
desc = "BR for short. Accepts boulders and refines non-metallic ores into sheets using internal chemicals."
|
||||
desc = "Accepts boulders and refines non-metallic ores into sheets using internal chemicals."
|
||||
icon_state = "stacker"
|
||||
base_icon_state = "stacker"
|
||||
circuit = /obj/item/circuitboard/machine/refinery
|
||||
usage_sound = 'sound/machines/mining/refinery.ogg'
|
||||
action = "crushing"
|
||||
waste_chemical = /datum/reagent/toxin/acid/industrial_waste
|
||||
|
||||
/// What list of reagents should we look at when we boost the effectiveness of this machinery?
|
||||
booster_list = list(
|
||||
/datum/reagent/toxin/acid = 1,
|
||||
/datum/reagent/toxin/acid/fluacid = 2,
|
||||
/datum/reagent/toxin/acid/nitracid = 3,
|
||||
/datum/reagent/teslium = 5,
|
||||
)
|
||||
|
||||
/obj/machinery/bouldertech/refinery/can_process_material(datum/material/possible_mat)
|
||||
var/static/list/processable_materials
|
||||
@@ -37,6 +46,56 @@
|
||||
boulders_processing_count += servo.tier
|
||||
boulders_processing_count = ROUND_UP((boulders_processing_count / 8) * boulders_held_max)
|
||||
|
||||
var/new_volume = 0
|
||||
for(var/obj/item/reagent_containers/beaker in component_parts)
|
||||
new_volume += beaker.volume
|
||||
if(!reagents)
|
||||
create_reagents(new_volume, OPENCONTAINER)
|
||||
reagents.maximum_volume = new_volume
|
||||
|
||||
|
||||
/obj/machinery/bouldertech/refinery/Initialize(mapload)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/boulder_reactions)
|
||||
AddElement(/datum/element/simple_rotation)
|
||||
update_appearance(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/machinery/bouldertech/refinery/check_for_boosts()
|
||||
. = ..() //resets to 1.00 efficiency in the parent
|
||||
var/highest_boost = 0
|
||||
var/datum/reagent/biggest_booster
|
||||
for(var/datum/reagent/chem in reagents.reagent_list)
|
||||
if(!booster_list[chem.type])
|
||||
continue
|
||||
if(!reagents.has_reagent(chem.type, booster_list[chem.type])) //check that we have the associated quantity of the chem in order to perform the boost.
|
||||
continue
|
||||
if(booster_list[chem.type] > highest_boost)
|
||||
highest_boost = booster_list[chem.type]
|
||||
biggest_booster = chem.type
|
||||
|
||||
if(!biggest_booster)
|
||||
return
|
||||
|
||||
reagents.remove_reagent(biggest_booster, highest_boost) //remove the associated amount from the reagents
|
||||
refining_efficiency = 1 + (highest_boost / 10) //Results in a boost from 10-30%
|
||||
reagents.add_reagent(waste_chemical, highest_boost)
|
||||
|
||||
/obj/machinery/bouldertech/refinery/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/screwdriver)
|
||||
. = ..()
|
||||
set_light_on(TRUE)
|
||||
|
||||
/obj/machinery/bouldertech/refinery/default_unfasten_wrench(mob/user, obj/item/wrench, time)
|
||||
. = ..()
|
||||
set_light_on(TRUE)
|
||||
|
||||
/obj/machinery/bouldertech/refinery/plunger_act(obj/item/plunger/attacking_plunger, mob/living/user, reinforced)
|
||||
. = ..()
|
||||
balloon_alert(user, "emptying...")
|
||||
if(do_after(user, 2 SECONDS, src))
|
||||
reagents.expose(drop_location())
|
||||
reagents.clear_reagents()
|
||||
|
||||
|
||||
/**
|
||||
* Your other new favorite industrial waste magnet!
|
||||
* Accepts boulders and produces sheets of metallic materials.
|
||||
@@ -44,7 +103,7 @@
|
||||
*/
|
||||
/obj/machinery/bouldertech/refinery/smelter
|
||||
name = "boulder smelter"
|
||||
desc = "BS for short. Accept boulders and refines metallic ores into sheets."
|
||||
desc = "Accept boulders and refines metallic ores into sheets."
|
||||
icon_state = "smelter"
|
||||
base_icon_state = "smelter"
|
||||
light_system = OVERLAY_LIGHT
|
||||
@@ -54,6 +113,12 @@
|
||||
circuit = /obj/item/circuitboard/machine/smelter
|
||||
usage_sound = 'sound/machines/mining/smelter.ogg'
|
||||
action = "smelting"
|
||||
booster_list = list(
|
||||
/datum/reagent/fuel = 1,
|
||||
/datum/reagent/thermite = 2,
|
||||
/datum/reagent/gunpowder = 3,
|
||||
/datum/reagent/liquid_dark_matter = 5,
|
||||
)
|
||||
|
||||
/obj/machinery/bouldertech/refinery/smelter/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user