mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 06:00:16 +01:00
[MIRROR] Neutralised anomalies respect the core limit (#28185)
* Neutralised anomalies respect the core limit (#83964) ## About The Pull Request This PR changes it so that if you refine an anomaly by neutralising it, it respects the same limit on number of anomaly cores as refining one you bought from Cargo. If it would produce an illegal core, it will create a mostly useless inert core which you can sell at cargo for 80% of the price of buying a raw core. ## Why It's Good For The Game https://hackmd.io/@ tgstation/r1tzxpwPL This was a requirement in the original design doc which just never made it into the game. We want to be able to control how many cores of each type can possibly exist in a round, as this is what allows them to have the "these items can be really busted" allowance. ## Changelog 🆑 fix: Neutralising an anomaly cannot produce more anomaly cores than are supposed to exist in a single round /🆑 * Neutralised anomalies respect the core limit --------- Co-authored-by: Jacquerel <hnevard@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user