mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +01:00
21b4095dfd
Upstream 04/17/2026 fixes https://github.com/Bubberstation/Bubberstation/issues/5549 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com> Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com> Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com> Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com> Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com> Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com> Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com> Co-authored-by: loganuk <fakeemail123@aol.com> Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com> Co-authored-by: Lucy <lucy@absolucy.moe> Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com> Co-authored-by: Isratosh <Isratosh@hotmail.com> Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com> Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com> Co-authored-by: Alexander V. <volas@ya.ru> Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com> Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Tim <timothymtorres@gmail.com> Co-authored-by: Iamgoofball <iamgoofball@gmail.com> Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com> Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com> Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com> Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com> Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com> Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com> Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com> Co-authored-by: Josh <josh.adam.powell@gmail.com> Co-authored-by: Josh Powell <josh.powell@softwire.com> Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com> Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com> Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com> Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
206 lines
6.6 KiB
Plaintext
206 lines
6.6 KiB
Plaintext
//Crew has to create dna vault
|
|
// Cargo can order DNA samplers + DNA vault boards
|
|
// DNA vault requires x animals, y plants, z human dna
|
|
// DNA vaults require high tier stock parts
|
|
// After completion each crewmember can receive single upgrade chosen out of 2 for the mob.
|
|
#define VAULT_TOXIN "Toxin Adaptation"
|
|
#define VAULT_NOBREATH "Lung Enhancement"
|
|
#define VAULT_FIREPROOF "Thermal Regulation"
|
|
#define VAULT_STUNTIME "Neural Repathing"
|
|
#define VAULT_ARMOUR "Bone Reinforcement"
|
|
#define VAULT_SPEED "Leg Muscle Stimulus"
|
|
#define VAULT_QUICK "Arm Muscle Stimulus"
|
|
|
|
/datum/station_goal/dna_vault
|
|
name = "DNA Vault"
|
|
var/animal_count
|
|
var/human_count
|
|
var/plant_count
|
|
|
|
/datum/station_goal/dna_vault/New()
|
|
..()
|
|
animal_count = rand(16, 20) //might be too few given ~15 roundstart stationside ones
|
|
human_count = rand(round(0.75 * SSticker.totalPlayersReady) , SSticker.totalPlayersReady) // 75%+ roundstart population.
|
|
var/non_standard_plants = non_standard_plants_count()
|
|
plant_count = rand(round(0.15 * non_standard_plants), round(0.3 * non_standard_plants))
|
|
|
|
/datum/station_goal/dna_vault/proc/non_standard_plants_count()
|
|
. = 0
|
|
for(var/T in subtypesof(/obj/item/seeds)) //put a cache if it's used anywhere else
|
|
var/obj/item/seeds/S = T
|
|
if(initial(S.rarity) > 0)
|
|
.++
|
|
|
|
/datum/station_goal/dna_vault/get_report()
|
|
return list(
|
|
"Our long term prediction systems indicate a 99% chance of system-wide cataclysm in the near future.",
|
|
"We need you to construct a DNA Vault aboard your station.",
|
|
"",
|
|
"The DNA Vault needs to contain samples of:",
|
|
"* [animal_count] unique animal data",
|
|
"* [plant_count] unique non-standard plant data",
|
|
"* [human_count] unique sapient humanoid DNA data",
|
|
"",
|
|
"Base vault parts are available for shipping via cargo.",
|
|
).Join("\n")
|
|
|
|
|
|
/datum/station_goal/dna_vault/on_report()
|
|
var/datum/supply_pack/P = SSshuttle.supply_packs[/datum/supply_pack/engineering/dna_vault]
|
|
P.order_flags |= ORDER_SPECIAL_ENABLED
|
|
|
|
P = SSshuttle.supply_packs[/datum/supply_pack/engineering/dna_probes]
|
|
P.order_flags |= ORDER_SPECIAL_ENABLED
|
|
|
|
/datum/station_goal/dna_vault/check_completion()
|
|
if(..())
|
|
return TRUE
|
|
for(var/obj/machinery/dna_vault/V as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/dna_vault))
|
|
if(V.animal_dna.len >= animal_count && V.plant_dna.len >= plant_count && V.human_dna.len >= human_count)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/obj/machinery/dna_vault
|
|
name = "DNA Vault"
|
|
desc = "Break glass in case of apocalypse."
|
|
icon = 'icons/obj/machines/dna_vault.dmi'
|
|
icon_state = "vault"
|
|
density = TRUE
|
|
anchored = TRUE
|
|
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 5
|
|
pixel_x = -32
|
|
pixel_y = -64
|
|
light_range = 3
|
|
light_power = 1.5
|
|
light_color = LIGHT_COLOR_CYAN
|
|
|
|
//High defaults so it's not completed automatically if there's no station goal
|
|
var/animals_max = 100
|
|
var/plants_max = 100
|
|
var/dna_max = 100
|
|
var/list/animal_dna = list()
|
|
var/list/plant_dna = list()
|
|
var/list/human_dna = list()
|
|
|
|
var/completed = FALSE
|
|
var/list/power_lottery = list()
|
|
var/list/possible_powers
|
|
|
|
var/list/obj/structure/fillers = list()
|
|
|
|
/obj/machinery/dna_vault/Initialize(mapload)
|
|
//TODO: Replace this,bsa and gravgen with some big machinery datum
|
|
var/list/occupied = list()
|
|
for(var/direct in list(EAST,WEST,SOUTHEAST,SOUTHWEST))
|
|
occupied += get_step(src,direct)
|
|
occupied += locate(x+1,y-2,z)
|
|
occupied += locate(x-1,y-2,z)
|
|
|
|
for(var/T in occupied)
|
|
var/obj/structure/filler/F = new(T)
|
|
F.parent = src
|
|
fillers += F
|
|
|
|
var/datum/station_goal/dna_vault/dna_vault_goal = SSstation.get_station_goal(/datum/station_goal/dna_vault)
|
|
if(!isnull(dna_vault_goal))
|
|
animals_max = dna_vault_goal.animal_count
|
|
plants_max = dna_vault_goal.plant_count
|
|
dna_max = dna_vault_goal.human_count
|
|
|
|
return ..()
|
|
|
|
/obj/machinery/dna_vault/Destroy()
|
|
for(var/obj/structure/filler/filler as anything in fillers)
|
|
filler.parent = null
|
|
qdel(filler)
|
|
return ..()
|
|
|
|
/obj/machinery/dna_vault/ui_interact(mob/user, datum/tgui/ui)
|
|
ui = SStgui.try_update_ui(user, src, ui)
|
|
if(!ui)
|
|
roll_powers(user)
|
|
ui = new(user, src, "DnaVault", name)
|
|
ui.open()
|
|
|
|
//Generate a unique set of mutation for each person
|
|
/obj/machinery/dna_vault/proc/roll_powers(mob/user)
|
|
var/datum/weakref/user_weakref = WEAKREF(user)
|
|
if((user_weakref in power_lottery) || isdead(user))
|
|
return
|
|
possible_powers = list(
|
|
/datum/mutation/breathless,
|
|
/datum/mutation/dextrous,
|
|
/datum/mutation/quick,
|
|
/datum/mutation/fire_immunity,
|
|
/datum/mutation/plasmocile,
|
|
/datum/mutation/quick_recovery,
|
|
/datum/mutation/tough,
|
|
)
|
|
var/list/gained_mutation = list()
|
|
gained_mutation += pick_n_take(possible_powers)
|
|
gained_mutation += pick_n_take(possible_powers)
|
|
|
|
power_lottery[user_weakref] = gained_mutation
|
|
|
|
/obj/machinery/dna_vault/ui_data(mob/user)
|
|
var/list/data = list()
|
|
data["plants"] = plant_dna.len
|
|
data["plants_max"] = plants_max
|
|
data["animals"] = animal_dna.len
|
|
data["animals_max"] = animals_max
|
|
data["dna"] = human_dna.len
|
|
data["dna_max"] = dna_max
|
|
data["completed"] = completed
|
|
data["used"] = TRUE
|
|
data["choiceA"] = ""
|
|
data["choiceB"] = ""
|
|
if(user && completed)
|
|
var/list/mutation_options = power_lottery[WEAKREF(user)]
|
|
if(length(mutation_options))
|
|
var/datum/mutation/mutation1 = mutation_options[1]
|
|
var/datum/mutation/mutation2 = mutation_options[2]
|
|
data["used"] = FALSE
|
|
data["choiceA"] = initial(mutation1.name)
|
|
data["choiceB"] = initial(mutation2.name)
|
|
return data
|
|
|
|
/obj/machinery/dna_vault/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
|
|
switch(action)
|
|
if("gene")
|
|
upgrade(usr,params["choice"])
|
|
. = TRUE
|
|
|
|
/obj/machinery/dna_vault/proc/check_goal()
|
|
if(plant_dna.len >= plants_max && animal_dna.len >= animals_max && human_dna.len >= dna_max)
|
|
completed = TRUE
|
|
|
|
/obj/machinery/dna_vault/proc/upgrade(mob/living/carbon/human/target, upgrade_type)
|
|
var/datum/weakref/human_weakref = WEAKREF(target)
|
|
var/static/list/associated_mutation = list(
|
|
"Breathless" = /datum/mutation/breathless,
|
|
"Dextrous" = /datum/mutation/dextrous,
|
|
"Quick" = /datum/mutation/quick,
|
|
"Fire Immunity" = /datum/mutation/fire_immunity,
|
|
"Plasmocile" = /datum/mutation/plasmocile,
|
|
"Quick Recovery" = /datum/mutation/quick_recovery,
|
|
"Tough" = /datum/mutation/tough,
|
|
)
|
|
if(!(associated_mutation[upgrade_type] in power_lottery[human_weakref]) || (HAS_TRAIT(target, TRAIT_USED_DNA_VAULT)))
|
|
return
|
|
target.dna.add_mutation(associated_mutation[upgrade_type], MUTATION_SOURCE_DNA_VAULT)
|
|
ADD_TRAIT(target, TRAIT_USED_DNA_VAULT, DNA_VAULT_TRAIT)
|
|
power_lottery[human_weakref] = list()
|
|
use_energy(active_power_usage)
|
|
|
|
#undef VAULT_TOXIN
|
|
#undef VAULT_NOBREATH
|
|
#undef VAULT_FIREPROOF
|
|
#undef VAULT_STUNTIME
|
|
#undef VAULT_ARMOUR
|
|
#undef VAULT_SPEED
|
|
#undef VAULT_QUICK
|