diff --git a/code/controllers/subsystem/research.dm b/code/controllers/subsystem/research.dm index c8d7a44edf7..c419d5eade7 100644 --- a/code/controllers/subsystem/research.dm +++ b/code/controllers/subsystem/research.dm @@ -334,3 +334,16 @@ SUBSYSTEM_DEF(research) continue valid_servers += server return valid_servers + +/// Returns true if you can make an anomaly core of the provided type +/datum/controller/subsystem/research/proc/is_core_available(core_type) + if (!ispath(core_type, /obj/item/assembly/signaler/anomaly)) + return FALSE // The fuck are you checking this random object for? + var/already_made = created_anomaly_types[core_type] || 0 + var/hard_limit = anomaly_hard_limit_by_type[core_type] + return already_made < hard_limit + +/// Increase our tracked number of cores of this type +/datum/controller/subsystem/research/proc/increment_existing_anomaly_cores(core_type) + var/existing = created_anomaly_types[core_type] || 0 + created_anomaly_types[core_type] = existing + 1 diff --git a/code/game/objects/effects/anomalies/_anomalies.dm b/code/game/objects/effects/anomalies/_anomalies.dm index a3f0b79044b..ee02cab9e03 100644 --- a/code/game/objects/effects/anomalies/_anomalies.dm +++ b/code/game/objects/effects/anomalies/_anomalies.dm @@ -8,7 +8,7 @@ anchored = TRUE light_range = 3 - var/obj/item/assembly/signaler/anomaly/aSignal = /obj/item/assembly/signaler/anomaly + var/obj/item/assembly/signaler/anomaly/anomaly_core = /obj/item/assembly/signaler/anomaly var/area/impact_area var/lifespan = ANOMALY_COUNTDOWN_TIMER @@ -37,12 +37,12 @@ return INITIALIZE_HINT_QDEL src.drops_core = drops_core - if(aSignal) - aSignal = new aSignal(src) - aSignal.code = rand(1,100) - aSignal.anomaly_type = type + if(anomaly_core) + anomaly_core = new anomaly_core(src) + anomaly_core.code = rand(1,100) + anomaly_core.anomaly_type = type - aSignal.set_frequency(sanitize_frequency(rand(MIN_FREE_FREQ, MAX_FREE_FREQ), free = TRUE)) + anomaly_core.set_frequency(sanitize_frequency(rand(MIN_FREE_FREQ, MAX_FREE_FREQ), free = TRUE)) if(new_lifespan) lifespan = new_lifespan @@ -72,7 +72,7 @@ /obj/effect/anomaly/Destroy() STOP_PROCESSING(SSobj, src) QDEL_NULL(countdown) - QDEL_NULL(aSignal) + QDEL_NULL(anomaly_core) return ..() /obj/effect/anomaly/proc/anomalyEffect(seconds_per_tick) @@ -97,18 +97,25 @@ new /obj/effect/particle_effect/fluid/smoke/bad(loc) if(drops_core) - if(isnull(aSignal)) + if(isnull(anomaly_core)) stack_trace("An anomaly ([src]) exists that drops a core, yet has no core!") else - aSignal.forceMove(drop_location()) - aSignal = null + var/anomaly_type = anomaly_core.type + if (SSresearch.is_core_available(anomaly_type)) + SSresearch.increment_existing_anomaly_cores(anomaly_type) + anomaly_core.forceMove(drop_location()) + anomaly_core = null + else // You exceeded the cap sorry + visible_message(span_warning("[anomaly_core] loses its lustre as it falls to the ground, there is too little ambient energy to support another core of this type.")) + new /obj/item/inert_anomaly(drop_location()) + // else, anomaly core gets deleted by qdel(src). qdel(src) /obj/effect/anomaly/attackby(obj/item/weapon, mob/user, params) - if(weapon.tool_behaviour == TOOL_ANALYZER && aSignal) - to_chat(user, span_notice("Analyzing... [src]'s unstable field is fluctuating along frequency [format_frequency(aSignal.frequency)], code [aSignal.code].")) + if(weapon.tool_behaviour == TOOL_ANALYZER && anomaly_core) + to_chat(user, span_notice("Analyzing... [src]'s unstable field is fluctuating along frequency [format_frequency(anomaly_core.frequency)], code [anomaly_core.code].")) return TRUE return ..() @@ -119,6 +126,6 @@ name = (has_core ? "stable " : "hollow ") + name if(!has_core) drops_core = FALSE - QDEL_NULL(aSignal) + QDEL_NULL(anomaly_core) if (anchor) move_chance = 0 diff --git a/code/game/objects/effects/anomalies/anomalies_bioscrambler.dm b/code/game/objects/effects/anomalies/anomalies_bioscrambler.dm index 3b7a0d17cc7..c57a629d85c 100644 --- a/code/game/objects/effects/anomalies/anomalies_bioscrambler.dm +++ b/code/game/objects/effects/anomalies/anomalies_bioscrambler.dm @@ -2,7 +2,7 @@ /obj/effect/anomaly/bioscrambler name = "bioscrambler anomaly" icon_state = "bioscrambler" - aSignal = /obj/item/assembly/signaler/anomaly/bioscrambler + anomaly_core = /obj/item/assembly/signaler/anomaly/bioscrambler immortal = TRUE pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE | PASSCLOSEDTURF | PASSMACHINE | PASSSTRUCTURE | PASSDOORS layer = ABOVE_MOB_LAYER diff --git a/code/game/objects/effects/anomalies/anomalies_bluespace.dm b/code/game/objects/effects/anomalies/anomalies_bluespace.dm index 49d59b9bcf7..b2270bd79c1 100644 --- a/code/game/objects/effects/anomalies/anomalies_bluespace.dm +++ b/code/game/objects/effects/anomalies/anomalies_bluespace.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/weapons/guns/projectiles.dmi' icon_state = "bluespace" density = TRUE - aSignal = /obj/item/assembly/signaler/anomaly/bluespace + anomaly_core = /obj/item/assembly/signaler/anomaly/bluespace ///range from which we can teleport someone var/teleport_range = 1 ///Distance we can teleport someone passively @@ -85,7 +85,7 @@ immortal = TRUE teleport_range = 2 teleport_distance = 12 - aSignal = null + anomaly_core = null /obj/effect/anomaly/bluespace/big/Initialize(mapload, new_lifespan, drops_core) . = ..() diff --git a/code/game/objects/effects/anomalies/anomalies_dimensional.dm b/code/game/objects/effects/anomalies/anomalies_dimensional.dm index 026c5974d5f..53129c0e9ce 100644 --- a/code/game/objects/effects/anomalies/anomalies_dimensional.dm +++ b/code/game/objects/effects/anomalies/anomalies_dimensional.dm @@ -2,7 +2,7 @@ /obj/effect/anomaly/dimensional name = "dimensional anomaly" icon_state = "dimensional" - aSignal = /obj/item/assembly/signaler/anomaly/dimensional + anomaly_core = /obj/item/assembly/signaler/anomaly/dimensional immortal = TRUE move_chance = 0 /// Range of effect, if left alone anomaly will convert a 2(range)+1 squared area. diff --git a/code/game/objects/effects/anomalies/anomalies_ectoplasm.dm b/code/game/objects/effects/anomalies/anomalies_ectoplasm.dm index 51a033f515f..e6c3e855386 100644 --- a/code/game/objects/effects/anomalies/anomalies_ectoplasm.dm +++ b/code/game/objects/effects/anomalies/anomalies_ectoplasm.dm @@ -2,7 +2,7 @@ name = "ectoplasm anomaly" desc = "It looks like the souls of the damned are trying to break into the realm of the living again. How upsetting." icon_state = "ectoplasm" - aSignal = /obj/item/assembly/signaler/anomaly/ectoplasm + anomaly_core = /obj/item/assembly/signaler/anomaly/ectoplasm lifespan = ANOMALY_COUNTDOWN_TIMER + 2 SECONDS //This one takes slightly longer, because it can run away. move_chance = 0 //prevents it from moving around so ghosts can actually move it with decent accuracy diff --git a/code/game/objects/effects/anomalies/anomalies_flux.dm b/code/game/objects/effects/anomalies/anomalies_flux.dm index 91f09095d6f..6a4d1e7cf8a 100644 --- a/code/game/objects/effects/anomalies/anomalies_flux.dm +++ b/code/game/objects/effects/anomalies/anomalies_flux.dm @@ -2,7 +2,7 @@ name = "flux wave anomaly" icon_state = "flux" density = TRUE - aSignal = /obj/item/assembly/signaler/anomaly/flux + anomaly_core = /obj/item/assembly/signaler/anomaly/flux var/canshock = FALSE var/shockdamage = 20 var/explosive = FLUX_EXPLOSIVE @@ -61,7 +61,7 @@ ///Bigger, meaner, immortal flux anomaly /obj/effect/anomaly/flux/big immortal = TRUE - aSignal = null + anomaly_core = null shockdamage = 30 ///range in whuich we zap diff --git a/code/game/objects/effects/anomalies/anomalies_gravity.dm b/code/game/objects/effects/anomalies/anomalies_gravity.dm index fa7c4f48a36..08becc48c75 100644 --- a/code/game/objects/effects/anomalies/anomalies_gravity.dm +++ b/code/game/objects/effects/anomalies/anomalies_gravity.dm @@ -12,7 +12,7 @@ icon = 'icons/effects/effects.dmi' icon_state = "shield2" density = FALSE - aSignal = /obj/item/assembly/signaler/anomaly/grav + anomaly_core = /obj/item/assembly/signaler/anomaly/grav var/boing = 0 ///Warp effect holder for displacement filter to "pulse" the anomaly var/atom/movable/warp_effect/warp @@ -104,7 +104,7 @@ ///Bigger, meaner, immortal gravity anomaly. although this is just the super grav anomaly but bigger and shattering move force /obj/effect/anomaly/grav/high/big immortal = TRUE - aSignal = null + anomaly_core = null move_force = MOVE_FORCE_OVERPOWERING /obj/effect/anomaly/grav/high/big/Initialize(mapload, new_lifespan, drops_core) diff --git a/code/game/objects/effects/anomalies/anomalies_hallucination.dm b/code/game/objects/effects/anomalies/anomalies_hallucination.dm index a6696070df1..4065d8c04a4 100644 --- a/code/game/objects/effects/anomalies/anomalies_hallucination.dm +++ b/code/game/objects/effects/anomalies/anomalies_hallucination.dm @@ -2,7 +2,7 @@ /obj/effect/anomaly/hallucination name = "hallucination anomaly" icon_state = "hallucination" - aSignal = /obj/item/assembly/signaler/anomaly/hallucination + anomaly_core = /obj/item/assembly/signaler/anomaly/hallucination /// Time passed since the last effect, increased by seconds_per_tick of the SSobj var/ticks = 0 /// How many seconds between each small hallucination pulses diff --git a/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm b/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm index 9cb92a6961d..6d65990b563 100644 --- a/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm +++ b/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm @@ -5,7 +5,7 @@ var/ticks = 0 /// How many seconds between each gas release var/releasedelay = 10 - aSignal = /obj/item/assembly/signaler/anomaly/pyro + anomaly_core = /obj/item/assembly/signaler/anomaly/pyro /obj/effect/anomaly/pyro/Initialize(mapload, new_lifespan, drops_core) . = ..() @@ -46,7 +46,7 @@ ///Bigger, meaner, immortal pyro anomaly /obj/effect/anomaly/pyro/big immortal = TRUE - aSignal = null + anomaly_core = null releasedelay = 2 move_force = MOVE_FORCE_OVERPOWERING diff --git a/code/game/objects/effects/anomalies/anomalies_vortex.dm b/code/game/objects/effects/anomalies/anomalies_vortex.dm index 935522fe901..0313f63146b 100644 --- a/code/game/objects/effects/anomalies/anomalies_vortex.dm +++ b/code/game/objects/effects/anomalies/anomalies_vortex.dm @@ -3,7 +3,7 @@ name = "vortex anomaly" icon_state = "vortex" desc = "That's a nice station you have there. It'd be a shame if something happened to it." - aSignal = /obj/item/assembly/signaler/anomaly/vortex + anomaly_core = /obj/item/assembly/signaler/anomaly/vortex /obj/effect/anomaly/bhole/anomalyEffect() ..() diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index 4e4e1db1f9a..c969b1dbe50 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -113,6 +113,9 @@ GLOBAL_LIST_INIT(diamond_recipes, list ( \ . = ..() . += GLOB.diamond_recipes +/obj/item/stack/sheet/mineral/diamond/five + amount = 5 + /* * Uranium */ diff --git a/code/modules/cargo/exports/anomaly.dm b/code/modules/cargo/exports/anomaly.dm new file mode 100644 index 00000000000..be197e9181c --- /dev/null +++ b/code/modules/cargo/exports/anomaly.dm @@ -0,0 +1,4 @@ +/datum/export/inert_anomaly + cost = CARGO_CRATE_VALUE * 8 // Worth a bit less than a normal anomaly core + unit_name = "inert anomaly core" + export_types = list(/obj/item/inert_anomaly) diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index e9c226731e7..d2a9af576ce 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -198,6 +198,9 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ scan_state = "rock_Diamond" merge_type = /obj/item/stack/ore/diamond +/obj/item/stack/ore/diamond/five + amount = 5 + /obj/item/stack/ore/bananium name = "bananium ore" icon_state = "bananium" diff --git a/code/modules/research/anomaly/anomaly_refinery.dm b/code/modules/research/anomaly/anomaly_refinery.dm index 1805a252318..bae2b4f1162 100644 --- a/code/modules/research/anomaly/anomaly_refinery.dm +++ b/code/modules/research/anomaly/anomaly_refinery.dm @@ -60,10 +60,12 @@ * * anomaly_type - anomaly type define */ /obj/machinery/research/anomaly_refinery/proc/get_required_radius(anomaly_type) + if(!SSresearch.is_core_available(anomaly_type)) + return //return null + var/already_made = SSresearch.created_anomaly_types[anomaly_type] var/hard_limit = SSresearch.anomaly_hard_limit_by_type[anomaly_type] - if(already_made >= hard_limit) - return //return null + // my crappy autoscale formula // linear scaling. var/radius_span = MAX_RADIUS_REQUIRED - MIN_RADIUS_REQUIRED diff --git a/code/modules/research/anomaly/raw_anomaly.dm b/code/modules/research/anomaly/raw_anomaly.dm index 2df844e4bb8..d86ed1f1d9d 100644 --- a/code/modules/research/anomaly/raw_anomaly.dm +++ b/code/modules/research/anomaly/raw_anomaly.dm @@ -91,7 +91,13 @@ /obj/item/raw_anomaly_core/proc/create_core(newloc, del_self = FALSE, count_towards_limit = FALSE) . = new anomaly_type(newloc) if(count_towards_limit) - var/existing = SSresearch.created_anomaly_types[anomaly_type] || 0 - SSresearch.created_anomaly_types[anomaly_type] = existing + 1 + SSresearch.increment_existing_anomaly_cores(anomaly_type) if(del_self) qdel(src) + +/// Doesn't do anything, consolation prize if you neu +/obj/item/inert_anomaly + name = "inert anomaly core" + desc = "A chunk of fused exotic materials. Useless to you, but some other lab might purchase it." + icon = 'icons/obj/devices/new_assemblies.dmi' + icon_state = "rawcore_inert" diff --git a/icons/obj/devices/new_assemblies.dmi b/icons/obj/devices/new_assemblies.dmi index 411ad8b61df..1de208a7736 100644 Binary files a/icons/obj/devices/new_assemblies.dmi and b/icons/obj/devices/new_assemblies.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 97718ba6f06..fce27ec16d1 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3699,6 +3699,7 @@ #include "code\modules\cargo\bounties\slime.dm" #include "code\modules\cargo\bounties\special.dm" #include "code\modules\cargo\bounties\virus.dm" +#include "code\modules\cargo\exports\anomaly.dm" #include "code\modules\cargo\exports\antiques.dm" #include "code\modules\cargo\exports\civilain_bounty.dm" #include "code\modules\cargo\exports\food_and_drink.dm"