From b661b32258e4f4c1d33f82105ce84be49a0ba782 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Fri, 13 Dec 2024 18:59:06 +0100
Subject: [PATCH 01/27] first step
---
code/datums/vault_genes.dm | 76 ++++++++++
.../objects/items/weapons/dna_upgrader.dm | 139 +++++++++---------
paradise.dme | 1 +
3 files changed, 147 insertions(+), 69 deletions(-)
create mode 100644 code/datums/vault_genes.dm
diff --git a/code/datums/vault_genes.dm b/code/datums/vault_genes.dm
new file mode 100644
index 00000000000..a07acc8ab7f
--- /dev/null
+++ b/code/datums/vault_genes.dm
@@ -0,0 +1,76 @@
+/datum/vault_gene
+ var/name
+
+/datum/vault_gene/proc/apply(mob/living/carbon/human/human, source)
+ return
+
+/datum/vault_gene/toxin
+ name = "Toxin Adaptation"
+
+/datum/vault_gene/toxin/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Ваше тело стало невоспримчиво к токсинам в воздухе."))
+
+ var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
+
+ if(lungs)
+ lungs.tox_breath_dam_min = 0
+ lungs.tox_breath_dam_max = 0
+
+ ADD_TRAIT(human, TRAIT_VIRUSIMMUNE, source)
+
+/datum/vault_gene/nobreath
+ name = "Lung Enhancement"
+
+/datum/vault_gene/nobreath/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Вы чувствуете, как нужда в дыхании пропадает."))
+
+ ADD_TRAIT(human, TRAIT_NO_BREATH, source)
+
+/datum/vault_gene/fireproof
+ name = "Thermal Regulation"
+
+/datum/vault_gene/fireproof/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Вы чувствуете, как ваше тело стало более огнеупорным."))
+ human.physiology.burn_mod *= 0.5
+
+ ADD_TRAIT(human, TRAIT_RESIST_HEAT, source)
+
+/datum/vault_gene/stuntime
+ name = "Neural Repathing"
+
+/datum/vault_gene/stuntime/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Ничто не может долго сдерживать вас."))
+
+ human.physiology.stun_mod *= 0.5
+ human.physiology.stamina_mod *= 0.5
+ human.stam_regen_start_modifier *= 0.5
+
+/datum/vault_gene/armour
+ name = "Hardened Skin"
+
+/datum/vault_gene/armour/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Вы чувствуете себя крепче."))
+
+ human.physiology.brute_mod *= 0.7
+ human.physiology.burn_mod *= 0.7
+ human.physiology.tox_mod *= 0.7
+ human.physiology.oxy_mod *= 0.7
+ human.physiology.clone_mod *= 0.7
+ human.physiology.brain_mod *= 0.7
+ human.physiology.stamina_mod *= 0.7
+
+ ADD_TRAIT(human, TRAIT_PIERCEIMMUNE, source)
+
+/datum/vault_gene/speedlegs
+ name = "Leg Muscle Stimulus"
+
+/datum/vault_gene/speedlegs/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Вы чувствуете себя быстрее и ловче."))
+ human.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
+
+/datum/vault_gene/quickarms
+ name = "Arm Muscle Stimulus"
+
+/datum/vault_gene/quickarms/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Ваши руки двигаются также быстро, как и молния."))
+ human.next_move_modifier *= 0.5
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 544b1f4db3a..1f361fe9edc 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -1,84 +1,85 @@
-#define VAULT_TOXIN "Toxin Adaptation"
-#define VAULT_NOBREATH "Lung Enhancement"
-#define VAULT_FIREPROOF "Thermal Regulation"
-#define VAULT_STUNTIME "Neural Repathing"
-#define VAULT_ARMOUR "Hardened Skin"
-#define VAULT_SPEED "Leg Muscle Stimulus"
-#define VAULT_QUICK "Arm Muscle Stimulus"
-
/obj/item/dna_upgrader
name = "dna upgrader"
- desc = "Somebody could say that such great modification may be reached only by station goal... Fools."
+ desc = "Говорят, что такое великое изменение генома может быть только при выполнении цели станции... Дураки."
+
icon = 'icons/obj/hypo.dmi'
icon_state = "dnaupgrader"
+
var/used = FALSE
+ ru_names = list(
+ NOMINATIVE = "улучшатель ДНК",
+ GENITIVE = "улучшателя ДНК",
+ DATIVE = "улучшателю ДНК",
+ ACCUSATIVE = "улучшатель ДНК",
+ INSTRUMENTAL = "улучшателем ДНК",
+ PREPOSITIONAL = "улучшателе ДНК"
+ )
+
/obj/item/dna_upgrader/update_icon_state()
- icon_state = "dnaupgrader[used ? "0" : ""]"
+ icon_state = "dnaupgrader[used ? false : ""]"
/obj/item/dna_upgrader/update_name(updates = ALL)
. = ..()
name = used ? "used [initial(name)]" : initial(name)
/obj/item/dna_upgrader/attack_self(mob/user)
- if(!used)
- choose_genes(user)
- else
- to_chat(user, span_notice("Looks like it is already used."))
-
-/obj/item/dna_upgrader/proc/choose_genes(mob/user)
- var/choosen_mod = tgui_input_list(user, "Choose a modification", name, list(VAULT_TOXIN, VAULT_NOBREATH, VAULT_FIREPROOF, VAULT_STUNTIME, VAULT_ARMOUR, VAULT_SPEED, VAULT_QUICK), ui_state = GLOB.not_incapacitated_state)
- if(!choosen_mod)
- return
- var/mob/living/carbon/human/H = user
- if(HAS_TRAIT(H, TRAIT_NO_DNA))
- to_chat(H, "Error, no DNA detected.")
- return
- switch(choosen_mod)
- if(VAULT_TOXIN)
- to_chat(H, "You feel resistant to airborne toxins.")
- var/obj/item/organ/internal/lungs/L = H.get_int_organ(/obj/item/organ/internal/lungs)
- if(L)
- L.tox_breath_dam_min = 0
- L.tox_breath_dam_max = 0
- ADD_TRAIT(H, TRAIT_VIRUSIMMUNE, name)
- if(VAULT_NOBREATH)
- to_chat(H, "Your lungs feel great.")
- ADD_TRAIT(H, TRAIT_NO_BREATH, name)
- if(VAULT_FIREPROOF)
- to_chat(H, "You feel fireproof.")
- H.physiology.burn_mod *= 0.5
- ADD_TRAIT(H, TRAIT_RESIST_HEAT, name)
- if(VAULT_STUNTIME)
- to_chat(H, "Nothing can keep you down for long.")
- H.physiology.stun_mod *= 0.5
- H.physiology.stamina_mod *= 0.5
- H.stam_regen_start_modifier *= 0.5
- if(VAULT_ARMOUR)
- to_chat(H, "You feel tough.")
- H.physiology.brute_mod *= 0.7
- H.physiology.burn_mod *= 0.7
- H.physiology.tox_mod *= 0.7
- H.physiology.oxy_mod *= 0.7
- H.physiology.clone_mod *= 0.7
- H.physiology.brain_mod *= 0.7
- H.physiology.stamina_mod *= 0.7
- ADD_TRAIT(H, TRAIT_PIERCEIMMUNE, name)
- if(VAULT_SPEED)
- to_chat(H, "You feel very fast and agile.")
- H.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
- if(VAULT_QUICK)
- to_chat(H, "Your arms move as fast as lightning.")
- H.next_move_modifier *= 0.5
- H.gene_stability += 25
- to_chat(H, span_notice("You feel like your body rebasing."))
+ try_choose_genes(user)
+
+/obj/item/dna_upgrader/proc/try_choose_genes(mob/living/carbon/human/human)
+ if(!istype(human))
+ return FALSE
+
+ if(used)
+ balloon_alert(human, "было использовано!")
+ return FALSE
+
+ if(HAS_TRAIT(human, TRAIT_NO_DNA))
+ ballon_alert(human, "Отсутствует ДНК.")
+ return FALSE
+
+ choose_genes(human)
+
+ return TRUE
+
+/obj/item/dna_upgrader/proc/get_vault_genes_names()
+ var/list/vault_genes_names = list()
+
+ for(var/datum/vault_gene/gene in subtypesof(/datum/vault_gene))
+ if(!gene.name)
+ continue
+
+ LAZYADD(vault_genes, initial(gene.name))
+
+ return vault_genes_names
+
+/obj/item/dna_upgrader/proc/choose_genes(mob/living/carbon/human/user)
+ var/choosen_gene = tgui_input_list(
+ user,
+ "Choose a modification",
+ name,
+ get_vault_genes_names(),
+ ui_state = GLOB.not_incapacitated_state
+ )
+
+ if(!choosen_gene)
+ return FALSE
+
+ for(var/datum/vault_gene/gene in subtypesof(/datum/vault_gene))
+ if(gene.name != choosen_gene)
+ continue
+
+ gene.apply(user, name)
+ break
+
+ finalize_dna_upgrade(user)
+
+ return TRUE
+
+/obj/item/dna_upgrader/proc/finalize_dna_upgrade(mob/living/carbon/human/user)
+ user.gene_stability += 25
+
+ to_chat(user, span_notice("Вы чувствуете, как ваше тело меняется."))
+
used = TRUE
update_appearance(UPDATE_ICON_STATE|UPDATE_NAME)
-
-#undef VAULT_TOXIN
-#undef VAULT_NOBREATH
-#undef VAULT_FIREPROOF
-#undef VAULT_STUNTIME
-#undef VAULT_ARMOUR
-#undef VAULT_SPEED
-#undef VAULT_QUICK
diff --git a/paradise.dme b/paradise.dme
index d07486cf3fa..7ce23198e56 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -416,6 +416,7 @@
#include "code\datums\uplink_item.dm"
#include "code\datums\verb_callback.dm"
#include "code\datums\vision_override.dm"
+#include "code\datums\vault_genes.dm"
#include "code\datums\weakrefs.dm"
#include "code\datums\cache\air_alarm.dm"
#include "code\datums\cache\apc.dm"
From d79dae1f64b3f9aa6dd298b75791f096251c46cd Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Sat, 14 Dec 2024 10:50:10 +0100
Subject: [PATCH 02/27] smol upd
---
code/datums/vault_genes.dm | 48 +++++
.../objects/items/weapons/dna_upgrader.dm | 8 +-
code/modules/station_goals/dna_vault.dm | 174 ++++++++----------
3 files changed, 131 insertions(+), 99 deletions(-)
diff --git a/code/datums/vault_genes.dm b/code/datums/vault_genes.dm
index a07acc8ab7f..3e68b00eb34 100644
--- a/code/datums/vault_genes.dm
+++ b/code/datums/vault_genes.dm
@@ -4,20 +4,38 @@
/datum/vault_gene/proc/apply(mob/living/carbon/human/human, source)
return
+/datum/vault_gene/proc/remove(mob/living/carbon/human/human, source)
+ return
+
/datum/vault_gene/toxin
name = "Toxin Adaptation"
+ var/cached_tox_breath_dam_min
+ var/cached_tox_breath_dam_max
+
/datum/vault_gene/toxin/apply(mob/living/carbon/human/human, source)
to_chat(human, span_notice("Ваше тело стало невоспримчиво к токсинам в воздухе."))
var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
if(lungs)
+ cached_tox_breath_dam_min = lungs.tox_breath_dam_min
+ cached_tox_breath_dam_max = lungs.tox_breath_dam_max
+
lungs.tox_breath_dam_min = 0
lungs.tox_breath_dam_max = 0
ADD_TRAIT(human, TRAIT_VIRUSIMMUNE, source)
+/datum/vault_gene/toxin/remove(mob/living/carbon/human/human, source)
+ var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
+
+ if(lungs)
+ lungs.tox_breath_dam_min = cached_tox_breath_dam_min || initial(lungs.tox_breath_dam_min)
+ lungs.tox_breath_dam_max = cached_tox_breath_dam_max || initial(lungs.tox_breath_dam_max)
+
+ REMOVE_TRAIT(human, TRAIT_VIRUSIMMUNE, source)
+
/datum/vault_gene/nobreath
name = "Lung Enhancement"
@@ -26,6 +44,9 @@
ADD_TRAIT(human, TRAIT_NO_BREATH, source)
+/datum/vault_gene/nobreath/remove(mob/living/carbon/human/human, source)
+ REMOVE_TRAIT(human, TRAIT_NO_BREATH, source)
+
/datum/vault_gene/fireproof
name = "Thermal Regulation"
@@ -35,6 +56,11 @@
ADD_TRAIT(human, TRAIT_RESIST_HEAT, source)
+/datum/vault_gene/fireproof/remove(mob/living/carbon/human/human, source)
+ human.physiology.burn_mod /= 0.5
+
+ REMOVE_TRAIT(human, TRAIT_RESIST_HEAT, source)
+
/datum/vault_gene/stuntime
name = "Neural Repathing"
@@ -45,6 +71,11 @@
human.physiology.stamina_mod *= 0.5
human.stam_regen_start_modifier *= 0.5
+/datum/vault_gene/stuntime/remove(mob/living/carbon/human/human, source)
+ human.physiology.stun_mod /= 0.5
+ human.physiology.stamina_mod /= 0.5
+ human.stam_regen_start_modifier /= 0.5
+
/datum/vault_gene/armour
name = "Hardened Skin"
@@ -61,6 +92,17 @@
ADD_TRAIT(human, TRAIT_PIERCEIMMUNE, source)
+/datum/vault_gene/armour/remove(mob/living/carbon/human/human, source)
+ human.physiology.brute_mod /= 0.7
+ human.physiology.burn_mod /= 0.7
+ human.physiology.tox_mod /= 0.7
+ human.physiology.oxy_mod /= 0.7
+ human.physiology.clone_mod /= 0.7
+ human.physiology.brain_mod /= 0.7
+ human.physiology.stamina_mod /= 0.7
+
+ REMOVE_TRAIT(human, TRAIT_PIERCEIMMUNE, source)
+
/datum/vault_gene/speedlegs
name = "Leg Muscle Stimulus"
@@ -68,9 +110,15 @@
to_chat(human, span_notice("Вы чувствуете себя быстрее и ловче."))
human.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
+/datum/vault_gene/speedlegs/remove(mob/living/carbon/human/human, source)
+ human.remove_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
+
/datum/vault_gene/quickarms
name = "Arm Muscle Stimulus"
/datum/vault_gene/quickarms/apply(mob/living/carbon/human/human, source)
to_chat(human, span_notice("Ваши руки двигаются также быстро, как и молния."))
human.next_move_modifier *= 0.5
+
+/datum/vault_gene/proc/remove(mob/living/carbon/human/human, source)
+ human.next_move_modifier /= 0.5
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 1f361fe9edc..8a0c40df09e 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -35,7 +35,7 @@
return FALSE
if(HAS_TRAIT(human, TRAIT_NO_DNA))
- ballon_alert(human, "Отсутствует ДНК.")
+ ballon_alert(human, "ДНК не обнаружено!")
return FALSE
choose_genes(human)
@@ -46,7 +46,7 @@
var/list/vault_genes_names = list()
for(var/datum/vault_gene/gene in subtypesof(/datum/vault_gene))
- if(!gene.name)
+ if(!initial(gene.name))
continue
LAZYADD(vault_genes, initial(gene.name))
@@ -62,11 +62,11 @@
ui_state = GLOB.not_incapacitated_state
)
- if(!choosen_gene)
+ if(used || !choosen_gene)
return FALSE
for(var/datum/vault_gene/gene in subtypesof(/datum/vault_gene))
- if(gene.name != choosen_gene)
+ if(initial(gene.name) != choosen_gene)
continue
gene.apply(user, name)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 095c1ddb08d..683d5bcdab0 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -1,15 +1,8 @@
-//Crew has to create dna vault
+// 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 and cold
// 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 "Hardened Skin"
-#define VAULT_SPEED "Leg Muscle Stimulus"
-#define VAULT_QUICK "Arm Muscle Stimulus"
/datum/station_goal/dna_vault
name = "DNA Vault"
@@ -18,17 +11,17 @@
var/plant_count
/datum/station_goal/dna_vault/New()
- ..()
- animal_count = rand(15, 20) //might be too few given ~15 roundstart stationside ones
+ . = ..()
+
+ animal_count = rand(15, 20) // might be too few given ~15 roundstart stationside ones
human_count = rand(round(0.75 * SSticker.mode.num_players_started()), SSticker.mode.num_players_started()) // 75%+ roundstart population.
var/non_standard_plants = non_standard_plants_count()
plant_count = rand(round(0.5 * non_standard_plants),round(0.7 * 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)
+ for(var/obj/item/seeds/seeds in subtypesof(/obj/item/seeds)) // put a cache if it's used anywhere else
+ if(initial(seeds.rarity))
.++
/datum/station_goal/dna_vault/get_report()
@@ -125,7 +118,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
/obj/item/circuitboard/machine/dna_vault
board_name = "DNA Vault"
build_path = /obj/machinery/dna_vault
- origin_tech = "engineering=2;combat=2;bluespace=2" //No freebies!
+ origin_tech = "engineering=2; combat=2; bluespace=2" // No freebies!
req_components = list(
/obj/item/stock_parts/capacitor/super = 5,
/obj/item/stock_parts/manipulator/pico = 5,
@@ -172,17 +165,19 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
var/list/obj/structure/fillers = list()
/obj/machinery/dna_vault/New()
- //TODO: Replace this,bsa and gravgen with some big machinery datum
+ // 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
+ for(var/direct in list(EAST, WEST, SOUTHEAST, SOUTHWEST))
+ LAZYADD(occupied, get_step(src,direct))
+
+ LAZYADD(occupied, locate(x + 1, y - 2, z))
+ LAZYADD(occupied, locate(x - 1, y - 2, z))
+
+ for(var/type in occupied)
+ var/obj/structure/filler/filler = new(type)
+ filler.parent = src
+ LAZYADD(fillers, filler)
if(SSticker.mode)
for(var/datum/station_goal/dna_vault/G in SSticker.mode.station_goals)
@@ -191,17 +186,15 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
dna_max = G.human_count
break
- ..()
+ return ..()
/obj/machinery/dna_vault/update_icon_state()
- if(stat & NOPOWER)
- icon_state = "vaultoff"
- return
- icon_state = "vault"
+ icon_state = "vault[stat & NOPOWER ? "off" : ""]"
/obj/machinery/dna_vault/power_change(forced = FALSE)
if(!..())
return
+
update_icon(UPDATE_ICON_STATE)
@@ -210,13 +203,15 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
return ..()
/obj/machinery/dna_vault/attack_ghost(mob/user)
- if(stat & (BROKEN|MAINT))
+ if(stat & (BROKEN | MAINT))
return
+
return ui_interact(user)
/obj/machinery/dna_vault/attack_hand(mob/user)
if(..())
return TRUE
+
ui_interact(user)
/obj/machinery/dna_vault/ui_interact(mob/user, datum/tgui/ui = null)
@@ -227,13 +222,23 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
ui.open()
/obj/machinery/dna_vault/proc/roll_powers(mob/user)
- if(user in power_lottery)
+ if(LAZYIN(power_lottery, user))
return
- var/list/L = list()
- var/list/possible_powers = list(VAULT_TOXIN, VAULT_NOBREATH, VAULT_FIREPROOF, VAULT_STUNTIME, VAULT_ARMOUR, VAULT_SPEED, VAULT_QUICK)
- L += pick_n_take(possible_powers)
- L += pick_n_take(possible_powers)
- power_lottery[user] = L
+
+ var/list/genes = list()
+
+ for(var/datum/vault_gene/gene in subtypesof(/datum/vault_gene))
+ if(!initial(gene.name))
+ continue
+
+ LAZYADD(genes, initial(gene.name))
+
+ var/list/picked_genes = list()
+
+ LAZYADD(picked_genes, pick_n_take(possible_powers))
+ LAZYADD(picked_genes, pick_n_take(possible_powers))
+
+ power_lottery[user] = picked_genes
/obj/machinery/dna_vault/ui_data(mob/user)
var/list/data = list(
@@ -249,13 +254,16 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
"choiceB" = ""
)
if(user && completed)
- var/list/L = power_lottery[user]
- if(length(L))
+ var/list/genes = power_lottery[user]
+
+ if(LAZYLEN(genes))
data["used"] = FALSE
- data["choiceA"] = L[1]
- data["choiceB"] = L[2]
- else if(L)
+ data["choiceA"] = genes[1]
+ data["choiceB"] = genes[2]
+
+ else if(genes)
data["used"] = TRUE
+
return data
/obj/machinery/dna_vault/ui_act(action, params)
@@ -264,11 +272,15 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
switch(action)
if("gene")
+ if(!try_upgrade(usr, params["choice"]))
+ return TRUE
+
upgrade(usr, params["choice"])
+
return TRUE
/obj/machinery/dna_vault/proc/check_goal()
- if(plants.len >= plants_max && animals.len >= animals_max && dna.len >= dna_max)
+ if(LAZYLEN(plants) >= plants_max && LAZYLEN(animals) >= animals_max && LAZYLEN(dna) >= dna_max)
completed = TRUE
@@ -278,23 +290,29 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(istype(I, /obj/item/dna_probe))
add_fingerprint(user)
+
var/obj/item/dna_probe/probe = I
var/uploaded = 0
+
for(var/plant in probe.plants)
if(!plants[plant])
uploaded++
plants[plant] = 1
+
for(var/animal in probe.animals)
if(!animals[animal])
uploaded++
animals[animal] = 1
+
for(var/ui in probe.dna)
if(!dna[ui])
uploaded++
dna[ui] = 1
+
if(!uploaded)
to_chat(user, span_warning("The [probe.name] has no relevant datapoints."))
return ATTACK_CHAIN_PROCEED
+
check_goal()
to_chat(user, span_notice("You have uploaded [uploaded] new datapoints."))
return ATTACK_CHAIN_PROCEED_SUCCESS
@@ -302,62 +320,28 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
return ..()
-/obj/machinery/dna_vault/proc/upgrade(mob/living/carbon/human/H, upgrade_type)
- if(!istype(H))
- return
+/obj/machinery/dna_vault/proc/try_upgrade(mob/living/carbon/human/human, upgrade_name)
+ if(!istype(human))
+ return FALSE
- if(!(upgrade_type in power_lottery[H]))
- return
+ if(!LAZYIN(power_lottery[human], upgrade_name))
+ return FALSE
if(!completed)
- return
+ return FALSE
- if(HAS_TRAIT(H, TRAIT_NO_DNA))
- to_chat(H, "Error, no DNA detected.")
- return
+ if(HAS_TRAIT(human, TRAIT_NO_DNA))
+ ballon_alert(human, "ДНК не обнаружено!")
+ return FALSE
+
+ return TRUE
+
+/obj/machinery/dna_vault/proc/upgrade(mob/living/carbon/human/human, upgrade_name)
+ for(var/datum/vault_gene/gene in subtypesof(/datum/vault_gene))
+ if(!initial(gene.name) != upgrade_name)
+ continue
+
+ gene.apply(human, name)
+ break
- switch(upgrade_type)
- if(VAULT_TOXIN)
- to_chat(H, "You feel resistant to airborne toxins.")
- var/obj/item/organ/internal/lungs/L = H.get_int_organ(/obj/item/organ/internal/lungs)
- if(L)
- L.tox_breath_dam_min = 0
- L.tox_breath_dam_max = 0
- ADD_TRAIT(H, TRAIT_VIRUSIMMUNE, name)
- if(VAULT_NOBREATH)
- to_chat(H, "Your lungs feel great.")
- ADD_TRAIT(H, TRAIT_NO_BREATH, name)
- if(VAULT_FIREPROOF)
- to_chat(H, "You feel fireproof.")
- H.physiology.burn_mod *= 0.5
- ADD_TRAIT(H, TRAIT_RESIST_HEAT, name)
- if(VAULT_STUNTIME)
- to_chat(H, "Nothing can keep you down for long.")
- H.physiology.stun_mod *= 0.5
- H.physiology.stamina_mod *= 0.5
- H.stam_regen_start_modifier *= 0.5
- if(VAULT_ARMOUR)
- to_chat(H, "You feel tough.")
- H.physiology.brute_mod *= 0.7
- H.physiology.burn_mod *= 0.7
- H.physiology.tox_mod *= 0.7
- H.physiology.oxy_mod *= 0.7
- H.physiology.clone_mod *= 0.7
- H.physiology.brain_mod *= 0.7
- H.physiology.stamina_mod *= 0.7
- ADD_TRAIT(H, TRAIT_PIERCEIMMUNE, name)
- if(VAULT_SPEED)
- to_chat(H, "You feel very fast and agile.")
- H.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
- if(VAULT_QUICK)
- to_chat(H, "Your arms move as fast as lightning.")
- H.next_move_modifier *= 0.5
- power_lottery[H] = list()
-
-#undef VAULT_TOXIN
-#undef VAULT_NOBREATH
-#undef VAULT_FIREPROOF
-#undef VAULT_STUNTIME
-#undef VAULT_ARMOUR
-#undef VAULT_SPEED
-#undef VAULT_QUICK
+ power_lottery[human] = list()
From c83401f2911f7199dc1ae973da98a47cd7feb6a6 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Sat, 14 Dec 2024 10:56:39 +0100
Subject: [PATCH 03/27] inconsistent
---
code/datums/vault_genes.dm | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/code/datums/vault_genes.dm b/code/datums/vault_genes.dm
index 3e68b00eb34..496e0f67dc0 100644
--- a/code/datums/vault_genes.dm
+++ b/code/datums/vault_genes.dm
@@ -8,14 +8,14 @@
return
/datum/vault_gene/toxin
- name = "Toxin Adaptation"
-
+ name = "Toxin Adaptation"
+
var/cached_tox_breath_dam_min
var/cached_tox_breath_dam_max
/datum/vault_gene/toxin/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Ваше тело стало невоспримчиво к токсинам в воздухе."))
-
+ to_chat(human, span_notice("Ваше тело стало невоспримчиво к токсинам в воздухе."))
+
var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
if(lungs)
@@ -28,7 +28,7 @@
ADD_TRAIT(human, TRAIT_VIRUSIMMUNE, source)
/datum/vault_gene/toxin/remove(mob/living/carbon/human/human, source)
- var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
+ var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
if(lungs)
lungs.tox_breath_dam_min = cached_tox_breath_dam_min || initial(lungs.tox_breath_dam_min)
@@ -40,8 +40,8 @@
name = "Lung Enhancement"
/datum/vault_gene/nobreath/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете, как нужда в дыхании пропадает."))
-
+ to_chat(human, span_notice("Вы чувствуете, как нужда в дыхании пропадает."))
+
ADD_TRAIT(human, TRAIT_NO_BREATH, source)
/datum/vault_gene/nobreath/remove(mob/living/carbon/human/human, source)
@@ -51,13 +51,13 @@
name = "Thermal Regulation"
/datum/vault_gene/fireproof/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете, как ваше тело стало более огнеупорным."))
+ to_chat(human, span_notice("Вы чувствуете, как ваше тело стало более огнеупорным."))
human.physiology.burn_mod *= 0.5
ADD_TRAIT(human, TRAIT_RESIST_HEAT, source)
/datum/vault_gene/fireproof/remove(mob/living/carbon/human/human, source)
- human.physiology.burn_mod /= 0.5
+ human.physiology.burn_mod /= 0.5
REMOVE_TRAIT(human, TRAIT_RESIST_HEAT, source)
@@ -65,22 +65,22 @@
name = "Neural Repathing"
/datum/vault_gene/stuntime/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Ничто не может долго сдерживать вас."))
+ to_chat(human, span_notice("Ничто не может долго сдерживать вас."))
human.physiology.stun_mod *= 0.5
- human.physiology.stamina_mod *= 0.5
+ human.physiology.stamina_mod *= 0.5
human.stam_regen_start_modifier *= 0.5
/datum/vault_gene/stuntime/remove(mob/living/carbon/human/human, source)
- human.physiology.stun_mod /= 0.5
- human.physiology.stamina_mod /= 0.5
+ human.physiology.stun_mod /= 0.5
+ human.physiology.stamina_mod /= 0.5
human.stam_regen_start_modifier /= 0.5
/datum/vault_gene/armour
name = "Hardened Skin"
/datum/vault_gene/armour/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете себя крепче."))
+ to_chat(human, span_notice("Вы чувствуете себя крепче."))
human.physiology.brute_mod *= 0.7
human.physiology.burn_mod *= 0.7
@@ -93,7 +93,7 @@
ADD_TRAIT(human, TRAIT_PIERCEIMMUNE, source)
/datum/vault_gene/armour/remove(mob/living/carbon/human/human, source)
- human.physiology.brute_mod /= 0.7
+ human.physiology.brute_mod /= 0.7
human.physiology.burn_mod /= 0.7
human.physiology.tox_mod /= 0.7
human.physiology.oxy_mod /= 0.7
@@ -107,7 +107,7 @@
name = "Leg Muscle Stimulus"
/datum/vault_gene/speedlegs/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете себя быстрее и ловче."))
+ to_chat(human, span_notice("Вы чувствуете себя быстрее и ловче."))
human.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
/datum/vault_gene/speedlegs/remove(mob/living/carbon/human/human, source)
From 4ae94df734e229d00f5d3ed62bb58d359c84abb1 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Sat, 14 Dec 2024 10:59:41 +0100
Subject: [PATCH 04/27] fix
---
code/datums/vault_genes.dm | 2 +-
code/game/objects/items/weapons/dna_upgrader.dm | 4 ++--
code/modules/station_goals/dna_vault.dm | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/code/datums/vault_genes.dm b/code/datums/vault_genes.dm
index 496e0f67dc0..50189b9b074 100644
--- a/code/datums/vault_genes.dm
+++ b/code/datums/vault_genes.dm
@@ -120,5 +120,5 @@
to_chat(human, span_notice("Ваши руки двигаются также быстро, как и молния."))
human.next_move_modifier *= 0.5
-/datum/vault_gene/proc/remove(mob/living/carbon/human/human, source)
+/datum/vault_gene/quickarms/remove(mob/living/carbon/human/human, source)
human.next_move_modifier /= 0.5
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 8a0c40df09e..38d403213a8 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -35,7 +35,7 @@
return FALSE
if(HAS_TRAIT(human, TRAIT_NO_DNA))
- ballon_alert(human, "ДНК не обнаружено!")
+ balloon_alert(human, "ДНК не обнаружено!")
return FALSE
choose_genes(human)
@@ -49,7 +49,7 @@
if(!initial(gene.name))
continue
- LAZYADD(vault_genes, initial(gene.name))
+ LAZYADD(vault_genes_names, initial(gene.name))
return vault_genes_names
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 683d5bcdab0..88862a4fcb3 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -235,8 +235,8 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
var/list/picked_genes = list()
- LAZYADD(picked_genes, pick_n_take(possible_powers))
- LAZYADD(picked_genes, pick_n_take(possible_powers))
+ LAZYADD(picked_genes, pick_n_take(genes))
+ LAZYADD(picked_genes, pick_n_take(genes))
power_lottery[user] = picked_genes
@@ -331,7 +331,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
return FALSE
if(HAS_TRAIT(human, TRAIT_NO_DNA))
- ballon_alert(human, "ДНК не обнаружено!")
+ balloon_alert(human, "ДНК не обнаружено!")
return FALSE
return TRUE
From aa6adcc47a46ce9a425d6b822f36a74a0b391da1 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Sat, 14 Dec 2024 11:01:08 +0100
Subject: [PATCH 05/27] fix x2
---
code/game/objects/items/weapons/dna_upgrader.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 38d403213a8..b63dd137677 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -17,7 +17,7 @@
)
/obj/item/dna_upgrader/update_icon_state()
- icon_state = "dnaupgrader[used ? false : ""]"
+ icon_state = "dnaupgrader[used ? FALSE : ""]"
/obj/item/dna_upgrader/update_name(updates = ALL)
. = ..()
From 1076b2d0a75408f27d85c0793612c49244ade56e Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Sat, 14 Dec 2024 11:03:28 +0100
Subject: [PATCH 06/27] more improve
---
code/game/objects/items/weapons/dna_upgrader.dm | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index b63dd137677..83f42d06e28 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -24,7 +24,8 @@
name = used ? "used [initial(name)]" : initial(name)
/obj/item/dna_upgrader/attack_self(mob/user)
- try_choose_genes(user)
+ if(try_choose_genes(user))
+ choose_genes(user)
/obj/item/dna_upgrader/proc/try_choose_genes(mob/living/carbon/human/human)
if(!istype(human))
@@ -37,8 +38,6 @@
if(HAS_TRAIT(human, TRAIT_NO_DNA))
balloon_alert(human, "ДНК не обнаружено!")
return FALSE
-
- choose_genes(human)
return TRUE
From c689121f4b5b19d00929d0d1d009beeb2f614b2a Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Sat, 14 Dec 2024 11:04:33 +0100
Subject: [PATCH 07/27] forgotten CLRF to LF...
---
code/datums/vault_genes.dm | 248 ++++++++++++++++++-------------------
1 file changed, 124 insertions(+), 124 deletions(-)
diff --git a/code/datums/vault_genes.dm b/code/datums/vault_genes.dm
index 50189b9b074..1e5c139ec63 100644
--- a/code/datums/vault_genes.dm
+++ b/code/datums/vault_genes.dm
@@ -1,124 +1,124 @@
-/datum/vault_gene
- var/name
-
-/datum/vault_gene/proc/apply(mob/living/carbon/human/human, source)
- return
-
-/datum/vault_gene/proc/remove(mob/living/carbon/human/human, source)
- return
-
-/datum/vault_gene/toxin
- name = "Toxin Adaptation"
-
- var/cached_tox_breath_dam_min
- var/cached_tox_breath_dam_max
-
-/datum/vault_gene/toxin/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Ваше тело стало невоспримчиво к токсинам в воздухе."))
-
- var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
-
- if(lungs)
- cached_tox_breath_dam_min = lungs.tox_breath_dam_min
- cached_tox_breath_dam_max = lungs.tox_breath_dam_max
-
- lungs.tox_breath_dam_min = 0
- lungs.tox_breath_dam_max = 0
-
- ADD_TRAIT(human, TRAIT_VIRUSIMMUNE, source)
-
-/datum/vault_gene/toxin/remove(mob/living/carbon/human/human, source)
- var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
-
- if(lungs)
- lungs.tox_breath_dam_min = cached_tox_breath_dam_min || initial(lungs.tox_breath_dam_min)
- lungs.tox_breath_dam_max = cached_tox_breath_dam_max || initial(lungs.tox_breath_dam_max)
-
- REMOVE_TRAIT(human, TRAIT_VIRUSIMMUNE, source)
-
-/datum/vault_gene/nobreath
- name = "Lung Enhancement"
-
-/datum/vault_gene/nobreath/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете, как нужда в дыхании пропадает."))
-
- ADD_TRAIT(human, TRAIT_NO_BREATH, source)
-
-/datum/vault_gene/nobreath/remove(mob/living/carbon/human/human, source)
- REMOVE_TRAIT(human, TRAIT_NO_BREATH, source)
-
-/datum/vault_gene/fireproof
- name = "Thermal Regulation"
-
-/datum/vault_gene/fireproof/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете, как ваше тело стало более огнеупорным."))
- human.physiology.burn_mod *= 0.5
-
- ADD_TRAIT(human, TRAIT_RESIST_HEAT, source)
-
-/datum/vault_gene/fireproof/remove(mob/living/carbon/human/human, source)
- human.physiology.burn_mod /= 0.5
-
- REMOVE_TRAIT(human, TRAIT_RESIST_HEAT, source)
-
-/datum/vault_gene/stuntime
- name = "Neural Repathing"
-
-/datum/vault_gene/stuntime/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Ничто не может долго сдерживать вас."))
-
- human.physiology.stun_mod *= 0.5
- human.physiology.stamina_mod *= 0.5
- human.stam_regen_start_modifier *= 0.5
-
-/datum/vault_gene/stuntime/remove(mob/living/carbon/human/human, source)
- human.physiology.stun_mod /= 0.5
- human.physiology.stamina_mod /= 0.5
- human.stam_regen_start_modifier /= 0.5
-
-/datum/vault_gene/armour
- name = "Hardened Skin"
-
-/datum/vault_gene/armour/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете себя крепче."))
-
- human.physiology.brute_mod *= 0.7
- human.physiology.burn_mod *= 0.7
- human.physiology.tox_mod *= 0.7
- human.physiology.oxy_mod *= 0.7
- human.physiology.clone_mod *= 0.7
- human.physiology.brain_mod *= 0.7
- human.physiology.stamina_mod *= 0.7
-
- ADD_TRAIT(human, TRAIT_PIERCEIMMUNE, source)
-
-/datum/vault_gene/armour/remove(mob/living/carbon/human/human, source)
- human.physiology.brute_mod /= 0.7
- human.physiology.burn_mod /= 0.7
- human.physiology.tox_mod /= 0.7
- human.physiology.oxy_mod /= 0.7
- human.physiology.clone_mod /= 0.7
- human.physiology.brain_mod /= 0.7
- human.physiology.stamina_mod /= 0.7
-
- REMOVE_TRAIT(human, TRAIT_PIERCEIMMUNE, source)
-
-/datum/vault_gene/speedlegs
- name = "Leg Muscle Stimulus"
-
-/datum/vault_gene/speedlegs/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете себя быстрее и ловче."))
- human.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
-
-/datum/vault_gene/speedlegs/remove(mob/living/carbon/human/human, source)
- human.remove_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
-
-/datum/vault_gene/quickarms
- name = "Arm Muscle Stimulus"
-
-/datum/vault_gene/quickarms/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Ваши руки двигаются также быстро, как и молния."))
- human.next_move_modifier *= 0.5
-
-/datum/vault_gene/quickarms/remove(mob/living/carbon/human/human, source)
- human.next_move_modifier /= 0.5
+/datum/vault_gene
+ var/name
+
+/datum/vault_gene/proc/apply(mob/living/carbon/human/human, source)
+ return
+
+/datum/vault_gene/proc/remove(mob/living/carbon/human/human, source)
+ return
+
+/datum/vault_gene/toxin
+ name = "Toxin Adaptation"
+
+ var/cached_tox_breath_dam_min
+ var/cached_tox_breath_dam_max
+
+/datum/vault_gene/toxin/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Ваше тело стало невоспримчиво к токсинам в воздухе."))
+
+ var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
+
+ if(lungs)
+ cached_tox_breath_dam_min = lungs.tox_breath_dam_min
+ cached_tox_breath_dam_max = lungs.tox_breath_dam_max
+
+ lungs.tox_breath_dam_min = 0
+ lungs.tox_breath_dam_max = 0
+
+ ADD_TRAIT(human, TRAIT_VIRUSIMMUNE, source)
+
+/datum/vault_gene/toxin/remove(mob/living/carbon/human/human, source)
+ var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
+
+ if(lungs)
+ lungs.tox_breath_dam_min = cached_tox_breath_dam_min || initial(lungs.tox_breath_dam_min)
+ lungs.tox_breath_dam_max = cached_tox_breath_dam_max || initial(lungs.tox_breath_dam_max)
+
+ REMOVE_TRAIT(human, TRAIT_VIRUSIMMUNE, source)
+
+/datum/vault_gene/nobreath
+ name = "Lung Enhancement"
+
+/datum/vault_gene/nobreath/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Вы чувствуете, как нужда в дыхании пропадает."))
+
+ ADD_TRAIT(human, TRAIT_NO_BREATH, source)
+
+/datum/vault_gene/nobreath/remove(mob/living/carbon/human/human, source)
+ REMOVE_TRAIT(human, TRAIT_NO_BREATH, source)
+
+/datum/vault_gene/fireproof
+ name = "Thermal Regulation"
+
+/datum/vault_gene/fireproof/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Вы чувствуете, как ваше тело стало более огнеупорным."))
+ human.physiology.burn_mod *= 0.5
+
+ ADD_TRAIT(human, TRAIT_RESIST_HEAT, source)
+
+/datum/vault_gene/fireproof/remove(mob/living/carbon/human/human, source)
+ human.physiology.burn_mod /= 0.5
+
+ REMOVE_TRAIT(human, TRAIT_RESIST_HEAT, source)
+
+/datum/vault_gene/stuntime
+ name = "Neural Repathing"
+
+/datum/vault_gene/stuntime/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Ничто не может долго сдерживать вас."))
+
+ human.physiology.stun_mod *= 0.5
+ human.physiology.stamina_mod *= 0.5
+ human.stam_regen_start_modifier *= 0.5
+
+/datum/vault_gene/stuntime/remove(mob/living/carbon/human/human, source)
+ human.physiology.stun_mod /= 0.5
+ human.physiology.stamina_mod /= 0.5
+ human.stam_regen_start_modifier /= 0.5
+
+/datum/vault_gene/armour
+ name = "Hardened Skin"
+
+/datum/vault_gene/armour/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Вы чувствуете себя крепче."))
+
+ human.physiology.brute_mod *= 0.7
+ human.physiology.burn_mod *= 0.7
+ human.physiology.tox_mod *= 0.7
+ human.physiology.oxy_mod *= 0.7
+ human.physiology.clone_mod *= 0.7
+ human.physiology.brain_mod *= 0.7
+ human.physiology.stamina_mod *= 0.7
+
+ ADD_TRAIT(human, TRAIT_PIERCEIMMUNE, source)
+
+/datum/vault_gene/armour/remove(mob/living/carbon/human/human, source)
+ human.physiology.brute_mod /= 0.7
+ human.physiology.burn_mod /= 0.7
+ human.physiology.tox_mod /= 0.7
+ human.physiology.oxy_mod /= 0.7
+ human.physiology.clone_mod /= 0.7
+ human.physiology.brain_mod /= 0.7
+ human.physiology.stamina_mod /= 0.7
+
+ REMOVE_TRAIT(human, TRAIT_PIERCEIMMUNE, source)
+
+/datum/vault_gene/speedlegs
+ name = "Leg Muscle Stimulus"
+
+/datum/vault_gene/speedlegs/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Вы чувствуете себя быстрее и ловче."))
+ human.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
+
+/datum/vault_gene/speedlegs/remove(mob/living/carbon/human/human, source)
+ human.remove_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
+
+/datum/vault_gene/quickarms
+ name = "Arm Muscle Stimulus"
+
+/datum/vault_gene/quickarms/apply(mob/living/carbon/human/human, source)
+ to_chat(human, span_notice("Ваши руки двигаются также быстро, как и молния."))
+ human.next_move_modifier *= 0.5
+
+/datum/vault_gene/quickarms/remove(mob/living/carbon/human/human, source)
+ human.next_move_modifier /= 0.5
From 36d2bda7d0ae6ed7b3f861cada1b8f67b41636cd Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Sat, 14 Dec 2024 11:09:42 +0100
Subject: [PATCH 08/27] slightly more improve
---
code/modules/station_goals/dna_vault.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 88862a4fcb3..34755e0198b 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -169,7 +169,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
var/list/occupied = list()
for(var/direct in list(EAST, WEST, SOUTHEAST, SOUTHWEST))
- LAZYADD(occupied, get_step(src,direct))
+ LAZYADD(occupied, get_step(src, direct))
LAZYADD(occupied, locate(x + 1, y - 2, z))
LAZYADD(occupied, locate(x - 1, y - 2, z))
From 5aa85f16f2dadb04a9465a7b139aaccc774a795e Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Sat, 14 Dec 2024 11:22:46 +0100
Subject: [PATCH 09/27] as anything forgotten.
---
code/modules/station_goals/dna_vault.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 34755e0198b..f69fb0c3d22 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -20,7 +20,7 @@
/datum/station_goal/dna_vault/proc/non_standard_plants_count()
. = 0
- for(var/obj/item/seeds/seeds in subtypesof(/obj/item/seeds)) // put a cache if it's used anywhere else
+ for(var/obj/item/seeds/seeds as anything in subtypesof(/obj/item/seeds)) // put a cache if it's used anywhere else
if(initial(seeds.rarity))
.++
From 15a0694a3ca01031472b28c6657a4d73c455babf Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Sun, 15 Dec 2024 09:23:47 +0100
Subject: [PATCH 10/27] forgotten things x2
---
code/game/objects/items/weapons/dna_upgrader.dm | 4 ++--
code/modules/station_goals/dna_vault.dm | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 83f42d06e28..4fa58789fe8 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -44,7 +44,7 @@
/obj/item/dna_upgrader/proc/get_vault_genes_names()
var/list/vault_genes_names = list()
- for(var/datum/vault_gene/gene in subtypesof(/datum/vault_gene))
+ for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
if(!initial(gene.name))
continue
@@ -64,7 +64,7 @@
if(used || !choosen_gene)
return FALSE
- for(var/datum/vault_gene/gene in subtypesof(/datum/vault_gene))
+ for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
if(initial(gene.name) != choosen_gene)
continue
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index f69fb0c3d22..fc211a945ca 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -227,7 +227,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
var/list/genes = list()
- for(var/datum/vault_gene/gene in subtypesof(/datum/vault_gene))
+ for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
if(!initial(gene.name))
continue
@@ -337,7 +337,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
return TRUE
/obj/machinery/dna_vault/proc/upgrade(mob/living/carbon/human/human, upgrade_name)
- for(var/datum/vault_gene/gene in subtypesof(/datum/vault_gene))
+ for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
if(!initial(gene.name) != upgrade_name)
continue
From 1fd433d7b464e27d990923a9e01afcf8350ea8a3 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Sun, 15 Dec 2024 15:25:18 +0100
Subject: [PATCH 11/27] whoops momentfix
---
code/modules/station_goals/dna_vault.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index fc211a945ca..220a4be051b 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -338,7 +338,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
/obj/machinery/dna_vault/proc/upgrade(mob/living/carbon/human/human, upgrade_name)
for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
- if(!initial(gene.name) != upgrade_name)
+ if(initial(gene.name) != upgrade_name)
continue
gene.apply(human, name)
From 502468ce83f9c9c856b819cf1d13743b07cb721a Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Mon, 16 Dec 2024 08:03:43 +0100
Subject: [PATCH 12/27] meow.
---
code/datums/vault_genes.dm | 2 +-
code/game/objects/items/weapons/dna_upgrader.dm | 4 ++--
code/modules/station_goals/dna_vault.dm | 17 ++++++++++-------
3 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/code/datums/vault_genes.dm b/code/datums/vault_genes.dm
index 1e5c139ec63..d9cbb8b630e 100644
--- a/code/datums/vault_genes.dm
+++ b/code/datums/vault_genes.dm
@@ -14,7 +14,7 @@
var/cached_tox_breath_dam_max
/datum/vault_gene/toxin/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Ваше тело стало невоспримчиво к токсинам в воздухе."))
+ to_chat(human, span_notice("Ваше тело стало невоспримчивым к токсинам в воздухе."))
var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 4fa58789fe8..56e6ed2124d 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -17,7 +17,7 @@
)
/obj/item/dna_upgrader/update_icon_state()
- icon_state = "dnaupgrader[used ? FALSE : ""]"
+ icon_state = "initial(icon_state)[used ? "0" : ""]"
/obj/item/dna_upgrader/update_name(updates = ALL)
. = ..()
@@ -32,7 +32,7 @@
return FALSE
if(used)
- balloon_alert(human, "было использовано!")
+ balloon_alert(human, "Инъектор пуст!")
return FALSE
if(HAS_TRAIT(human, TRAIT_NO_DNA))
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 220a4be051b..0799903e172 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -11,7 +11,7 @@
var/plant_count
/datum/station_goal/dna_vault/New()
- . = ..()
+ ..()
animal_count = rand(15, 20) // might be too few given ~15 roundstart stationside ones
human_count = rand(round(0.75 * SSticker.mode.num_players_started()), SSticker.mode.num_players_started()) // 75%+ roundstart population.
@@ -118,7 +118,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
/obj/item/circuitboard/machine/dna_vault
board_name = "DNA Vault"
build_path = /obj/machinery/dna_vault
- origin_tech = "engineering=2; combat=2; bluespace=2" // No freebies!
+ origin_tech = "engineering=2;combat=2;bluespace=2" // No freebies!
req_components = list(
/obj/item/stock_parts/capacitor/super = 5,
/obj/item/stock_parts/manipulator/pico = 5,
@@ -166,7 +166,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
/obj/machinery/dna_vault/New()
// TODO: Replace this, bsa and gravgen with some big machinery datum
- var/list/occupied = list()
+ LAZYINITLIST(occupied)
for(var/direct in list(EAST, WEST, SOUTHEAST, SOUTHWEST))
LAZYADD(occupied, get_step(src, direct))
@@ -186,10 +186,10 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
dna_max = G.human_count
break
- return ..()
+ ..()
/obj/machinery/dna_vault/update_icon_state()
- icon_state = "vault[stat & NOPOWER ? "off" : ""]"
+ icon_state = "initial(icon_state)[stat & NOPOWER ? "off" : ""]"
/obj/machinery/dna_vault/power_change(forced = FALSE)
if(!..())
@@ -225,7 +225,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(LAZYIN(power_lottery, user))
return
- var/list/genes = list()
+ LAZYINITLIST(genes)
for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
if(!initial(gene.name))
@@ -233,7 +233,10 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
LAZYADD(genes, initial(gene.name))
- var/list/picked_genes = list()
+ if(!LAZYLEN(genes))
+ CRASH("[src] rolled 0 genes.")
+
+ LAZYINITLIST(picked_genes)
LAZYADD(picked_genes, pick_n_take(genes))
LAZYADD(picked_genes, pick_n_take(genes))
From c64d9a0f5129740faa61ff824d45edfda3876819 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Mon, 16 Dec 2024 08:07:06 +0100
Subject: [PATCH 13/27] =?UTF-8?q?=D1=83=D0=BF=D1=81.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
code/game/objects/items/weapons/dna_upgrader.dm | 2 +-
code/modules/station_goals/dna_vault.dm | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 56e6ed2124d..018277ba3fe 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -32,7 +32,7 @@
return FALSE
if(used)
- balloon_alert(human, "Инъектор пуст!")
+ balloon_alert(human, "инъектор пуст!")
return FALSE
if(HAS_TRAIT(human, TRAIT_NO_DNA))
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 0799903e172..bd1ca2fb4d7 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -166,7 +166,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
/obj/machinery/dna_vault/New()
// TODO: Replace this, bsa and gravgen with some big machinery datum
- LAZYINITLIST(occupied)
+ var/list/occupied
for(var/direct in list(EAST, WEST, SOUTHEAST, SOUTHWEST))
LAZYADD(occupied, get_step(src, direct))
@@ -225,7 +225,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(LAZYIN(power_lottery, user))
return
- LAZYINITLIST(genes)
+ var/list/genes
for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
if(!initial(gene.name))
@@ -236,7 +236,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(!LAZYLEN(genes))
CRASH("[src] rolled 0 genes.")
- LAZYINITLIST(picked_genes)
+ var/list/picked_genes
LAZYADD(picked_genes, pick_n_take(genes))
LAZYADD(picked_genes, pick_n_take(genes))
From 4fe0f4849f957049feaf0feab7bd6164f4ec893f Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Mon, 16 Dec 2024 09:42:50 +0100
Subject: [PATCH 14/27] full lazylists
---
.../objects/items/weapons/dna_upgrader.dm | 2 +-
code/modules/station_goals/dna_vault.dm | 30 +++++++++----------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 018277ba3fe..43fb262f6e3 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -42,7 +42,7 @@
return TRUE
/obj/item/dna_upgrader/proc/get_vault_genes_names()
- var/list/vault_genes_names = list()
+ var/list/vault_genes_names
for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
if(!initial(gene.name))
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index bd1ca2fb4d7..ac5c13a7a85 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -155,14 +155,14 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
var/animals_max = 100
var/plants_max = 100
var/dna_max = 100
- var/list/animals = list()
- var/list/plants = list()
- var/list/dna = list()
+ var/list/animals
+ var/list/plants
+ var/list/dna
var/completed = FALSE
- var/static/list/power_lottery = list()
+ var/static/list/power_lottery
- var/list/obj/structure/fillers = list()
+ var/list/obj/structure/fillers
/obj/machinery/dna_vault/New()
// TODO: Replace this, bsa and gravgen with some big machinery datum
@@ -245,11 +245,11 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
/obj/machinery/dna_vault/ui_data(mob/user)
var/list/data = list(
- "plants" = length(plants),
+ "plants" = LAZYLEN(plants),
"plants_max" = plants_max,
- "animals" = length(animals),
+ "animals" = LAZYLEN(animals),
"animals_max" = animals_max,
- "dna" = length(dna),
+ "dna" = LAZYLEN(dna),
"dna_max" = dna_max,
"completed" = completed,
"used" = TRUE,
@@ -298,19 +298,19 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
var/uploaded = 0
for(var/plant in probe.plants)
- if(!plants[plant])
+ if(!LAZYACCESS(plants, plant))
uploaded++
- plants[plant] = 1
+ LAZYSET(plants, plant, 1)
for(var/animal in probe.animals)
- if(!animals[animal])
+ if(!LAZYACCESS(animals, animal))
uploaded++
- animals[animal] = 1
+ LAZYSET(animals, animal, 1)
for(var/ui in probe.dna)
- if(!dna[ui])
+ if(!LAZYACCESS(dna, ui))
uploaded++
- dna[ui] = 1
+ LAZYSET(dna, ui, 1)
if(!uploaded)
to_chat(user, span_warning("The [probe.name] has no relevant datapoints."))
@@ -347,4 +347,4 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
gene.apply(human, name)
break
- power_lottery[human] = list()
+ LAZYNULL(power_lottery[human])
From 3134a2b515a5a57d52272e153401cd27fe9c7515 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Mon, 16 Dec 2024 09:57:37 +0100
Subject: [PATCH 15/27] improve
---
code/game/objects/items/weapons/dna_upgrader.dm | 6 +++---
code/modules/station_goals/dna_vault.dm | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 43fb262f6e3..5da0f922257 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -24,10 +24,10 @@
name = used ? "used [initial(name)]" : initial(name)
/obj/item/dna_upgrader/attack_self(mob/user)
- if(try_choose_genes(user))
+ if(can_choose_genes(user))
choose_genes(user)
-/obj/item/dna_upgrader/proc/try_choose_genes(mob/living/carbon/human/human)
+/obj/item/dna_upgrader/proc/can_choose_genes(mob/living/carbon/human/human)
if(!istype(human))
return FALSE
@@ -61,7 +61,7 @@
ui_state = GLOB.not_incapacitated_state
)
- if(used || !choosen_gene)
+ if(!choosen_gene || !can_choose_genes(user))
return FALSE
for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index ac5c13a7a85..9c79e684e60 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -275,7 +275,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
switch(action)
if("gene")
- if(!try_upgrade(usr, params["choice"]))
+ if(!can_upgrade(usr, params["choice"]))
return TRUE
upgrade(usr, params["choice"])
@@ -323,8 +323,8 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
return ..()
-/obj/machinery/dna_vault/proc/try_upgrade(mob/living/carbon/human/human, upgrade_name)
- if(!istype(human))
+/obj/machinery/dna_vault/proc/can_upgrade(mob/living/carbon/human/human, upgrade_name)
+ if(!istype(human) || !upgrade_name)
return FALSE
if(!LAZYIN(power_lottery[human], upgrade_name))
From bfb86a171622403826a5b62d8cb41d956c554528 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Mon, 16 Dec 2024 11:00:56 +0100
Subject: [PATCH 16/27] rework
---
code/_globalvars/genetics.dm | 10 ++
code/datums/vault_genes.dm | 124 --------------
code/game/dna/genes/vault.dm | 153 ++++++++++++++++++
.../objects/items/weapons/dna_upgrader.dm | 6 +-
code/modules/station_goals/dna_vault.dm | 8 +-
paradise.dme | 2 +-
6 files changed, 171 insertions(+), 132 deletions(-)
delete mode 100644 code/datums/vault_genes.dm
create mode 100644 code/game/dna/genes/vault.dm
diff --git a/code/_globalvars/genetics.dm b/code/_globalvars/genetics.dm
index d3d4a4aaad6..bc09ba2e976 100644
--- a/code/_globalvars/genetics.dm
+++ b/code/_globalvars/genetics.dm
@@ -71,8 +71,18 @@ GLOBAL_LIST_EMPTY(reg_dna)
GLOBAL_LIST_EMPTY(global_mutations)
// Currently empty blocks, you can use these for your own powers
+
GLOBAL_VAR_INIT(fakeblock1, 0)
GLOBAL_VAR_INIT(fakeblock2, 0)
GLOBAL_VAR_INIT(fakeblock3, 0)
GLOBAL_VAR_INIT(fakeblock4, 0)
+// Vault genes
+
+GLOBAL_VAR_INIT(vaulttoxinblock, 0)
+GLOBAL_VAR_INIT(vaultnobreathblock, 0)
+GLOBAL_VAR_INIT(vaultfireproofblock, 0)
+GLOBAL_VAR_INIT(vaultstuntimeblock, 0)
+GLOBAL_VAR_INIT(vaultarmourblock, 0)
+GLOBAL_VAR_INIT(vaultspeedlegsblock, 0)
+GLOBAL_VAR_INIT(vaultquickarmsblock, 0)
diff --git a/code/datums/vault_genes.dm b/code/datums/vault_genes.dm
deleted file mode 100644
index d9cbb8b630e..00000000000
--- a/code/datums/vault_genes.dm
+++ /dev/null
@@ -1,124 +0,0 @@
-/datum/vault_gene
- var/name
-
-/datum/vault_gene/proc/apply(mob/living/carbon/human/human, source)
- return
-
-/datum/vault_gene/proc/remove(mob/living/carbon/human/human, source)
- return
-
-/datum/vault_gene/toxin
- name = "Toxin Adaptation"
-
- var/cached_tox_breath_dam_min
- var/cached_tox_breath_dam_max
-
-/datum/vault_gene/toxin/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Ваше тело стало невоспримчивым к токсинам в воздухе."))
-
- var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
-
- if(lungs)
- cached_tox_breath_dam_min = lungs.tox_breath_dam_min
- cached_tox_breath_dam_max = lungs.tox_breath_dam_max
-
- lungs.tox_breath_dam_min = 0
- lungs.tox_breath_dam_max = 0
-
- ADD_TRAIT(human, TRAIT_VIRUSIMMUNE, source)
-
-/datum/vault_gene/toxin/remove(mob/living/carbon/human/human, source)
- var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
-
- if(lungs)
- lungs.tox_breath_dam_min = cached_tox_breath_dam_min || initial(lungs.tox_breath_dam_min)
- lungs.tox_breath_dam_max = cached_tox_breath_dam_max || initial(lungs.tox_breath_dam_max)
-
- REMOVE_TRAIT(human, TRAIT_VIRUSIMMUNE, source)
-
-/datum/vault_gene/nobreath
- name = "Lung Enhancement"
-
-/datum/vault_gene/nobreath/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете, как нужда в дыхании пропадает."))
-
- ADD_TRAIT(human, TRAIT_NO_BREATH, source)
-
-/datum/vault_gene/nobreath/remove(mob/living/carbon/human/human, source)
- REMOVE_TRAIT(human, TRAIT_NO_BREATH, source)
-
-/datum/vault_gene/fireproof
- name = "Thermal Regulation"
-
-/datum/vault_gene/fireproof/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете, как ваше тело стало более огнеупорным."))
- human.physiology.burn_mod *= 0.5
-
- ADD_TRAIT(human, TRAIT_RESIST_HEAT, source)
-
-/datum/vault_gene/fireproof/remove(mob/living/carbon/human/human, source)
- human.physiology.burn_mod /= 0.5
-
- REMOVE_TRAIT(human, TRAIT_RESIST_HEAT, source)
-
-/datum/vault_gene/stuntime
- name = "Neural Repathing"
-
-/datum/vault_gene/stuntime/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Ничто не может долго сдерживать вас."))
-
- human.physiology.stun_mod *= 0.5
- human.physiology.stamina_mod *= 0.5
- human.stam_regen_start_modifier *= 0.5
-
-/datum/vault_gene/stuntime/remove(mob/living/carbon/human/human, source)
- human.physiology.stun_mod /= 0.5
- human.physiology.stamina_mod /= 0.5
- human.stam_regen_start_modifier /= 0.5
-
-/datum/vault_gene/armour
- name = "Hardened Skin"
-
-/datum/vault_gene/armour/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете себя крепче."))
-
- human.physiology.brute_mod *= 0.7
- human.physiology.burn_mod *= 0.7
- human.physiology.tox_mod *= 0.7
- human.physiology.oxy_mod *= 0.7
- human.physiology.clone_mod *= 0.7
- human.physiology.brain_mod *= 0.7
- human.physiology.stamina_mod *= 0.7
-
- ADD_TRAIT(human, TRAIT_PIERCEIMMUNE, source)
-
-/datum/vault_gene/armour/remove(mob/living/carbon/human/human, source)
- human.physiology.brute_mod /= 0.7
- human.physiology.burn_mod /= 0.7
- human.physiology.tox_mod /= 0.7
- human.physiology.oxy_mod /= 0.7
- human.physiology.clone_mod /= 0.7
- human.physiology.brain_mod /= 0.7
- human.physiology.stamina_mod /= 0.7
-
- REMOVE_TRAIT(human, TRAIT_PIERCEIMMUNE, source)
-
-/datum/vault_gene/speedlegs
- name = "Leg Muscle Stimulus"
-
-/datum/vault_gene/speedlegs/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Вы чувствуете себя быстрее и ловче."))
- human.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
-
-/datum/vault_gene/speedlegs/remove(mob/living/carbon/human/human, source)
- human.remove_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
-
-/datum/vault_gene/quickarms
- name = "Arm Muscle Stimulus"
-
-/datum/vault_gene/quickarms/apply(mob/living/carbon/human/human, source)
- to_chat(human, span_notice("Ваши руки двигаются также быстро, как и молния."))
- human.next_move_modifier *= 0.5
-
-/datum/vault_gene/quickarms/remove(mob/living/carbon/human/human, source)
- human.next_move_modifier /= 0.5
diff --git a/code/game/dna/genes/vault.dm b/code/game/dna/genes/vault.dm
new file mode 100644
index 00000000000..d870f58964b
--- /dev/null
+++ b/code/game/dna/genes/vault.dm
@@ -0,0 +1,153 @@
+/datum/dna/gene/basic/vault
+
+/datum/dna/gene/basic/vault/toxin
+ name = "Toxin Adaptation"
+
+ var/cached_tox_breath_dam_min
+ var/cached_tox_breath_dam_max
+
+ traits_to_add = list(TRAIT_VIRUSIMMUNE)
+
+ activation_messages = list(
+ span_notice("Ваше тело стало невоспримчивым к токсинам в воздухе.")
+ )
+
+/datum/dna/gene/basic/vault/toxin/New()
+ ..()
+ block = GLOB.vaulttoxinblock
+
+/datum/dna/gene/basic/vault/toxin/activate(mob/living/carbon/human/human, flags)
+ . = ..()
+
+ var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
+
+ if(lungs)
+ cached_tox_breath_dam_min = lungs.tox_breath_dam_min
+ cached_tox_breath_dam_max = lungs.tox_breath_dam_max
+
+ lungs.tox_breath_dam_min = 0
+ lungs.tox_breath_dam_max = 0
+
+/datum/dna/gene/basic/vault/toxin/deactivate(mob/living/carbon/human/human, flags)
+ . = ..()
+ var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
+
+ if(lungs)
+ lungs.tox_breath_dam_min = cached_tox_breath_dam_min || initial(lungs.tox_breath_dam_min)
+ lungs.tox_breath_dam_max = cached_tox_breath_dam_max || initial(lungs.tox_breath_dam_max)
+
+/datum/dna/gene/basic/vault/nobreath
+ name = "Lung Enhancement"
+
+ traits_to_add = list(TRAIT_NO_BREATH)
+
+/datum/dna/gene/basic/vault/nobreath/New()
+ ..()
+ block = GLOB.vaultnobreathblock
+
+/datum/dna/gene/basic/vault/nobreath/activate(mob/living/carbon/human/human, flags)
+ . = ..()
+ to_chat(human, span_notice("Вы чувствуете, как нужда в дыхании пропадает."))
+
+/datum/dna/gene/basic/vault/fireproof
+ name = "Thermal Regulation"
+
+ traits_to_add = list(TRAIT_RESIST_HEAT)
+
+/datum/dna/gene/basic/vault/fireproof/New()
+ ..()
+ block = GLOB.vaultfireproofblock
+
+/datum/dna/gene/basic/vault/fireproof/activate(mob/living/carbon/human/human, flags)
+ . = ..()
+ to_chat(human, span_notice("Вы чувствуете, как ваше тело стало более огнеупорным."))
+ human.physiology.burn_mod *= 0.5
+
+/datum/dna/gene/basic/vault/fireproof/deactivate(mob/living/carbon/human/human, flags)
+ . = ..()
+ human.physiology.burn_mod /= 0.5
+
+/datum/dna/gene/basic/vault/stuntime
+ name = "Neural Repathing"
+
+/datum/dna/gene/basic/vault/stuntime/New()
+ ..()
+ block = GLOB.vaultstuntimeblock
+
+/datum/dna/gene/basic/vault/stuntime/activate(mob/living/carbon/human/human, flags)
+ . = ..()
+ to_chat(human, span_notice("Ничто не может долго сдерживать вас."))
+
+ human.physiology.stun_mod *= 0.5
+ human.physiology.stamina_mod *= 0.5
+ human.stam_regen_start_modifier *= 0.5
+
+/datum/dna/gene/basic/vault/stuntime/deactivate(mob/living/carbon/human/human, flags)
+ . = ..()
+ human.physiology.stun_mod /= 0.5
+ human.physiology.stamina_mod /= 0.5
+ human.stam_regen_start_modifier /= 0.5
+
+/datum/dna/gene/basic/vault/armour
+ name = "Hardened Skin"
+
+ traits_to_add = list(TRAIT_PIERCEIMMUNE)
+
+/datum/dna/gene/basic/vault/armour/New()
+ ..()
+ block = GLOB.vaultarmourblock
+
+/datum/dna/gene/basic/vault/armour/activate(mob/living/carbon/human/human, flags)
+ . = ..()
+ to_chat(human, span_notice("Вы чувствуете себя крепче."))
+
+ human.physiology.brute_mod *= 0.7
+ human.physiology.burn_mod *= 0.7
+ human.physiology.tox_mod *= 0.7
+ human.physiology.oxy_mod *= 0.7
+ human.physiology.clone_mod *= 0.7
+ human.physiology.brain_mod *= 0.7
+ human.physiology.stamina_mod *= 0.7
+
+/datum/dna/gene/basic/vault/armour/deactivate(mob/living/carbon/human/human, flags)
+ . = ..()
+ human.physiology.brute_mod /= 0.7
+ human.physiology.burn_mod /= 0.7
+ human.physiology.tox_mod /= 0.7
+ human.physiology.oxy_mod /= 0.7
+ human.physiology.clone_mod /= 0.7
+ human.physiology.brain_mod /= 0.7
+ human.physiology.stamina_mod /= 0.7
+
+/datum/dna/gene/basic/vault/speedlegs
+ name = "Leg Muscle Stimulus"
+
+/datum/dna/gene/basic/vault/speedlegs/New()
+ ..()
+ block = GLOB.vaultspeedlegsblock
+
+/datum/dna/gene/basic/vault/speedlegs/activate(mob/living/carbon/human/human, flags)
+ . = ..()
+ to_chat(human, span_notice("Вы чувствуете себя быстрее и ловче."))
+
+ human.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
+
+/datum/dna/gene/basic/vault/speedlegs/deactivate(mob/living/carbon/human/human, flags)
+ . = ..()
+ human.remove_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
+
+/datum/dna/gene/basic/vault/quickarms
+ name = "Arm Muscle Stimulus"
+
+/datum/dna/gene/basic/vault/quickarms/New()
+ ..()
+ block = GLOB.vaultquickarmsblock
+
+/datum/dna/gene/basic/vault/quickarms/activate(mob/living/carbon/human/human, flags)
+ . = ..()
+ to_chat(human, span_notice("Ваши руки двигаются также быстро, как и молния."))
+ human.next_move_modifier *= 0.5
+
+/datum/dna/gene/basic/vault/quickarms/deactivate(mob/living/carbon/human/human, flags)
+ . = ..()
+ human.next_move_modifier /= 0.5
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 5da0f922257..12664b9f72a 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -44,7 +44,7 @@
/obj/item/dna_upgrader/proc/get_vault_genes_names()
var/list/vault_genes_names
- for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
+ for(var/datum/dna/gene/basic/vault/gene in GLOB.dna_genes)
if(!initial(gene.name))
continue
@@ -64,11 +64,11 @@
if(!choosen_gene || !can_choose_genes(user))
return FALSE
- for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
+ for(var/datum/dna/gene/basic/vault/gene in GLOB.dna_genes)
if(initial(gene.name) != choosen_gene)
continue
- gene.apply(user, name)
+ user.force_gene_block(gene, TRUE)
break
finalize_dna_upgrade(user)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 9c79e684e60..6c7480e6f70 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -227,7 +227,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
var/list/genes
- for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
+ for(var/datum/dna/gene/basic/vault/gene in GLOB.dna_genes)
if(!initial(gene.name))
continue
@@ -241,7 +241,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
LAZYADD(picked_genes, pick_n_take(genes))
LAZYADD(picked_genes, pick_n_take(genes))
- power_lottery[user] = picked_genes
+ LAZYSET(power_lottery, user, picked_genes)
/obj/machinery/dna_vault/ui_data(mob/user)
var/list/data = list(
@@ -340,11 +340,11 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
return TRUE
/obj/machinery/dna_vault/proc/upgrade(mob/living/carbon/human/human, upgrade_name)
- for(var/datum/vault_gene/gene as anything in subtypesof(/datum/vault_gene))
+ for(var/datum/dna/gene/basic/vault/gene in GLOB.dna_genes)
if(initial(gene.name) != upgrade_name)
continue
- gene.apply(human, name)
+ human.force_gene_block(gene, TRUE)
break
LAZYNULL(power_lottery[human])
diff --git a/paradise.dme b/paradise.dme
index 7ce23198e56..a439de7b733 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -416,7 +416,6 @@
#include "code\datums\uplink_item.dm"
#include "code\datums\verb_callback.dm"
#include "code\datums\vision_override.dm"
-#include "code\datums\vault_genes.dm"
#include "code\datums\weakrefs.dm"
#include "code\datums\cache\air_alarm.dm"
#include "code\datums\cache\apc.dm"
@@ -742,6 +741,7 @@
#include "code\game\dna\genes\goon_powers.dm"
#include "code\game\dna\genes\monkey.dm"
#include "code\game\dna\genes\powers.dm"
+#include "code\game\dna\genes\vault.dm"
#include "code\game\dna\genes\vg_disabilities.dm"
#include "code\game\dna\genes\vg_powers.dm"
#include "code\game\gamemodes\emergency_shuttle_lockdown.dm"
From 73ca8db35271a284676072f766c7e93108988828 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Mon, 16 Dec 2024 11:42:05 +0100
Subject: [PATCH 17/27] adjust
---
code/_globalvars/genetics.dm | 2 -
code/game/dna/genes/vault.dm | 53 +++++++++++++++----
code/game/gamemodes/setupgame.dm | 9 ++++
.../objects/items/weapons/dna_upgrader.dm | 2 +-
code/modules/station_goals/dna_vault.dm | 2 +-
5 files changed, 55 insertions(+), 13 deletions(-)
diff --git a/code/_globalvars/genetics.dm b/code/_globalvars/genetics.dm
index bc09ba2e976..e72d55ad150 100644
--- a/code/_globalvars/genetics.dm
+++ b/code/_globalvars/genetics.dm
@@ -71,14 +71,12 @@ GLOBAL_LIST_EMPTY(reg_dna)
GLOBAL_LIST_EMPTY(global_mutations)
// Currently empty blocks, you can use these for your own powers
-
GLOBAL_VAR_INIT(fakeblock1, 0)
GLOBAL_VAR_INIT(fakeblock2, 0)
GLOBAL_VAR_INIT(fakeblock3, 0)
GLOBAL_VAR_INIT(fakeblock4, 0)
// Vault genes
-
GLOBAL_VAR_INIT(vaulttoxinblock, 0)
GLOBAL_VAR_INIT(vaultnobreathblock, 0)
GLOBAL_VAR_INIT(vaultfireproofblock, 0)
diff --git a/code/game/dna/genes/vault.dm b/code/game/dna/genes/vault.dm
index d870f58964b..cc5d368ec25 100644
--- a/code/game/dna/genes/vault.dm
+++ b/code/game/dna/genes/vault.dm
@@ -1,5 +1,11 @@
/datum/dna/gene/basic/vault
+/datum/dna/gene/basic/vault/can_activate(mob/living/carbon/human/human, flags)
+ return istype(human)
+
+/datum/dna/gene/basic/vault/can_deactivate(mob/living/carbon/human/human, flags)
+ return flags & MUTCHK_IGNORE_DEFAULT
+
/datum/dna/gene/basic/vault/toxin
name = "Toxin Adaptation"
@@ -14,6 +20,7 @@
/datum/dna/gene/basic/vault/toxin/New()
..()
+
block = GLOB.vaulttoxinblock
/datum/dna/gene/basic/vault/toxin/activate(mob/living/carbon/human/human, flags)
@@ -30,6 +37,7 @@
/datum/dna/gene/basic/vault/toxin/deactivate(mob/living/carbon/human/human, flags)
. = ..()
+
var/obj/item/organ/internal/lungs/lungs = human.get_int_organ(/obj/item/organ/internal/lungs)
if(lungs)
@@ -41,42 +49,52 @@
traits_to_add = list(TRAIT_NO_BREATH)
+ activation_messages = list(
+ span_notice("Вы чувствуете, как нужда в дыхании пропадает.")
+ )
+
/datum/dna/gene/basic/vault/nobreath/New()
..()
- block = GLOB.vaultnobreathblock
-/datum/dna/gene/basic/vault/nobreath/activate(mob/living/carbon/human/human, flags)
- . = ..()
- to_chat(human, span_notice("Вы чувствуете, как нужда в дыхании пропадает."))
+ block = GLOB.vaultnobreathblock
/datum/dna/gene/basic/vault/fireproof
name = "Thermal Regulation"
traits_to_add = list(TRAIT_RESIST_HEAT)
+ activation_messages = list(
+ span_notice("Вы чувствуете, как ваше тело стало более огнеупорным.")
+ )
+
/datum/dna/gene/basic/vault/fireproof/New()
..()
block = GLOB.vaultfireproofblock
/datum/dna/gene/basic/vault/fireproof/activate(mob/living/carbon/human/human, flags)
. = ..()
- to_chat(human, span_notice("Вы чувствуете, как ваше тело стало более огнеупорным."))
+
human.physiology.burn_mod *= 0.5
/datum/dna/gene/basic/vault/fireproof/deactivate(mob/living/carbon/human/human, flags)
. = ..()
+
human.physiology.burn_mod /= 0.5
/datum/dna/gene/basic/vault/stuntime
name = "Neural Repathing"
+ activation_messages = list(
+ span_notice("Ничто не может долго сдерживать вас.")
+ )
+
/datum/dna/gene/basic/vault/stuntime/New()
..()
+
block = GLOB.vaultstuntimeblock
/datum/dna/gene/basic/vault/stuntime/activate(mob/living/carbon/human/human, flags)
. = ..()
- to_chat(human, span_notice("Ничто не может долго сдерживать вас."))
human.physiology.stun_mod *= 0.5
human.physiology.stamina_mod *= 0.5
@@ -84,6 +102,7 @@
/datum/dna/gene/basic/vault/stuntime/deactivate(mob/living/carbon/human/human, flags)
. = ..()
+
human.physiology.stun_mod /= 0.5
human.physiology.stamina_mod /= 0.5
human.stam_regen_start_modifier /= 0.5
@@ -93,13 +112,17 @@
traits_to_add = list(TRAIT_PIERCEIMMUNE)
+ activation_messages = list(
+ span_notice("Вы чувствуете себя крепче.")
+ )
+
/datum/dna/gene/basic/vault/armour/New()
..()
+
block = GLOB.vaultarmourblock
/datum/dna/gene/basic/vault/armour/activate(mob/living/carbon/human/human, flags)
. = ..()
- to_chat(human, span_notice("Вы чувствуете себя крепче."))
human.physiology.brute_mod *= 0.7
human.physiology.burn_mod *= 0.7
@@ -111,6 +134,7 @@
/datum/dna/gene/basic/vault/armour/deactivate(mob/living/carbon/human/human, flags)
. = ..()
+
human.physiology.brute_mod /= 0.7
human.physiology.burn_mod /= 0.7
human.physiology.tox_mod /= 0.7
@@ -122,32 +146,43 @@
/datum/dna/gene/basic/vault/speedlegs
name = "Leg Muscle Stimulus"
+ activation_messages = list(
+ span_notice("Вы чувствуете себя быстрее и ловче.")
+ )
+
/datum/dna/gene/basic/vault/speedlegs/New()
..()
+
block = GLOB.vaultspeedlegsblock
/datum/dna/gene/basic/vault/speedlegs/activate(mob/living/carbon/human/human, flags)
. = ..()
- to_chat(human, span_notice("Вы чувствуете себя быстрее и ловче."))
human.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
/datum/dna/gene/basic/vault/speedlegs/deactivate(mob/living/carbon/human/human, flags)
. = ..()
+
human.remove_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
/datum/dna/gene/basic/vault/quickarms
name = "Arm Muscle Stimulus"
+ activation_messages = list(
+ span_notice("Ваши руки двигаются также быстро, как и молния.")
+ )
+
/datum/dna/gene/basic/vault/quickarms/New()
..()
+
block = GLOB.vaultquickarmsblock
/datum/dna/gene/basic/vault/quickarms/activate(mob/living/carbon/human/human, flags)
. = ..()
- to_chat(human, span_notice("Ваши руки двигаются также быстро, как и молния."))
+
human.next_move_modifier *= 0.5
/datum/dna/gene/basic/vault/quickarms/deactivate(mob/living/carbon/human/human, flags)
. = ..()
+
human.next_move_modifier /= 0.5
diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm
index b5bcb8c187d..9b917b395ab 100644
--- a/code/game/gamemodes/setupgame.dm
+++ b/code/game/gamemodes/setupgame.dm
@@ -61,6 +61,15 @@
GLOB.shockimmunityblock = getAssignedBlock("SHOCKIMMUNITY", numsToAssign, good = TRUE)
GLOB.smallsizeblock = getAssignedBlock("SMALLSIZE", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)
+ // Vault genes
+ GLOB.vaulttoxinblock = getAssignedBlock("VAULT TOXIN", numsToAssign)
+ GLOB.vaultnobreathblock = getAssignedBlock("VAULT NOBREATH", numsToAssign)
+ GLOB.vaultfireproofblock = getAssignedBlock("VAULT FIREPROOF", numsToAssign)
+ GLOB.vaultstuntimeblock = getAssignedBlock("VAULT STUNTIME", numsToAssign)
+ GLOB.vaultarmourblock = getAssignedBlock("VAULT ARMOUR", numsToAssign)
+ GLOB.vaultspeedlegsblock = getAssignedBlock("VAULT SPEEDLEGS", numsToAssign)
+ GLOB.vaultquickarmsblock = getAssignedBlock("VAULT QUICKARMS", numsToAssign)
+
//
// Goon muts
/////////////////////////////////////////////
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 12664b9f72a..801868bacb5 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -68,7 +68,7 @@
if(initial(gene.name) != choosen_gene)
continue
- user.force_gene_block(gene, TRUE)
+ user.force_gene_block(gene.block, TRUE)
break
finalize_dna_upgrade(user)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 6c7480e6f70..3177ff4cb85 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -344,7 +344,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(initial(gene.name) != upgrade_name)
continue
- human.force_gene_block(gene, TRUE)
+ human.force_gene_block(gene.block, TRUE)
break
LAZYNULL(power_lottery[human])
From 485a4e29155d941665fe6e9800805c1063df8fdc Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Mon, 16 Dec 2024 12:37:38 +0100
Subject: [PATCH 18/27] improve
---
code/game/dna/genes/vault.dm | 3 ---
code/game/gamemodes/setupgame.dm | 14 +++-----------
code/game/objects/items/weapons/dna_upgrader.dm | 4 ++--
code/modules/station_goals/dna_vault.dm | 2 +-
4 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/code/game/dna/genes/vault.dm b/code/game/dna/genes/vault.dm
index cc5d368ec25..1ab33faac66 100644
--- a/code/game/dna/genes/vault.dm
+++ b/code/game/dna/genes/vault.dm
@@ -3,9 +3,6 @@
/datum/dna/gene/basic/vault/can_activate(mob/living/carbon/human/human, flags)
return istype(human)
-/datum/dna/gene/basic/vault/can_deactivate(mob/living/carbon/human/human, flags)
- return flags & MUTCHK_IGNORE_DEFAULT
-
/datum/dna/gene/basic/vault/toxin
name = "Toxin Adaptation"
diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm
index 9b917b395ab..646c05ff25c 100644
--- a/code/game/gamemodes/setupgame.dm
+++ b/code/game/gamemodes/setupgame.dm
@@ -16,9 +16,10 @@
/proc/setupgenetics()
if(prob(50))
- GLOB.blockadd = rand(-300,300)
+ GLOB.blockadd = rand(-300, 300)
+
if(prob(75))
- GLOB.diffmut = rand(0,20)
+ GLOB.diffmut = rand(0, 20)
// SE blocks to assign.
var/list/numsToAssign= list()
@@ -61,15 +62,6 @@
GLOB.shockimmunityblock = getAssignedBlock("SHOCKIMMUNITY", numsToAssign, good = TRUE)
GLOB.smallsizeblock = getAssignedBlock("SMALLSIZE", numsToAssign, DNA_HARD_BOUNDS, good = TRUE)
- // Vault genes
- GLOB.vaulttoxinblock = getAssignedBlock("VAULT TOXIN", numsToAssign)
- GLOB.vaultnobreathblock = getAssignedBlock("VAULT NOBREATH", numsToAssign)
- GLOB.vaultfireproofblock = getAssignedBlock("VAULT FIREPROOF", numsToAssign)
- GLOB.vaultstuntimeblock = getAssignedBlock("VAULT STUNTIME", numsToAssign)
- GLOB.vaultarmourblock = getAssignedBlock("VAULT ARMOUR", numsToAssign)
- GLOB.vaultspeedlegsblock = getAssignedBlock("VAULT SPEEDLEGS", numsToAssign)
- GLOB.vaultquickarmsblock = getAssignedBlock("VAULT QUICKARMS", numsToAssign)
-
//
// Goon muts
/////////////////////////////////////////////
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 801868bacb5..9de13bab6ed 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -68,7 +68,7 @@
if(initial(gene.name) != choosen_gene)
continue
- user.force_gene_block(gene.block, TRUE)
+ user.force_gene_block(gene.block, TRUE, TRUE)
break
finalize_dna_upgrade(user)
@@ -81,4 +81,4 @@
to_chat(user, span_notice("Вы чувствуете, как ваше тело меняется."))
used = TRUE
- update_appearance(UPDATE_ICON_STATE|UPDATE_NAME)
+ update_appearance(UPDATE_ICON_STATE | UPDATE_NAME)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 3177ff4cb85..f56a93baabf 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -344,7 +344,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(initial(gene.name) != upgrade_name)
continue
- human.force_gene_block(gene.block, TRUE)
+ human.force_gene_block(gene.block, TRUE, TRUE)
break
LAZYNULL(power_lottery[human])
From bf9153b6f944ebdcee9c7332786fdb9bed6329d2 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Tue, 17 Dec 2024 17:02:06 +0100
Subject: [PATCH 19/27] smol rework
---
code/_globalvars/genetics.dm | 9 -----
code/game/dna/genes/gene.dm | 12 +++++-
code/game/dna/genes/vault.dm | 37 -------------------
code/game/gamemodes/setupgame.dm | 5 +++
.../objects/items/weapons/dna_upgrader.dm | 6 +--
code/modules/station_goals/dna_vault.dm | 4 +-
6 files changed, 20 insertions(+), 53 deletions(-)
diff --git a/code/_globalvars/genetics.dm b/code/_globalvars/genetics.dm
index e72d55ad150..ffeb3f3e1cd 100644
--- a/code/_globalvars/genetics.dm
+++ b/code/_globalvars/genetics.dm
@@ -75,12 +75,3 @@ GLOBAL_VAR_INIT(fakeblock1, 0)
GLOBAL_VAR_INIT(fakeblock2, 0)
GLOBAL_VAR_INIT(fakeblock3, 0)
GLOBAL_VAR_INIT(fakeblock4, 0)
-
-// Vault genes
-GLOBAL_VAR_INIT(vaulttoxinblock, 0)
-GLOBAL_VAR_INIT(vaultnobreathblock, 0)
-GLOBAL_VAR_INIT(vaultfireproofblock, 0)
-GLOBAL_VAR_INIT(vaultstuntimeblock, 0)
-GLOBAL_VAR_INIT(vaultarmourblock, 0)
-GLOBAL_VAR_INIT(vaultspeedlegsblock, 0)
-GLOBAL_VAR_INIT(vaultquickarmsblock, 0)
diff --git a/code/game/dna/genes/gene.dm b/code/game/dna/genes/gene.dm
index a38be8e0513..7d91e99f618 100644
--- a/code/game/dna/genes/gene.dm
+++ b/code/game/dna/genes/gene.dm
@@ -57,10 +57,14 @@
/// Called when the gene activates. Do your magic here.
/datum/dna/gene/proc/activate(mob/living/mutant, flags)
SHOULD_CALL_PARENT(TRUE)
+
LAZYOR(mutant.active_genes, type)
+
mutant.gene_stability -= instability
- if(length(traits_to_add))
+
+ if(LAZYLEN(traits_to_add))
mutant.add_traits(traits_to_add, DNA_TRAIT)
+
mutant.update_mutations()
@@ -70,10 +74,14 @@
*/
/datum/dna/gene/proc/deactivate(mob/living/mutant, flags)
SHOULD_CALL_PARENT(TRUE)
+
LAZYREMOVE(mutant.active_genes, type)
+
mutant.gene_stability += instability
- if(length(traits_to_add))
+
+ if(LAZYLEN(traits_to_add))
mutant.remove_traits(traits_to_add, DNA_TRAIT)
+
mutant.update_mutations()
diff --git a/code/game/dna/genes/vault.dm b/code/game/dna/genes/vault.dm
index 1ab33faac66..30a7d4b2bea 100644
--- a/code/game/dna/genes/vault.dm
+++ b/code/game/dna/genes/vault.dm
@@ -1,8 +1,5 @@
/datum/dna/gene/basic/vault
-/datum/dna/gene/basic/vault/can_activate(mob/living/carbon/human/human, flags)
- return istype(human)
-
/datum/dna/gene/basic/vault/toxin
name = "Toxin Adaptation"
@@ -15,11 +12,6 @@
span_notice("Ваше тело стало невоспримчивым к токсинам в воздухе.")
)
-/datum/dna/gene/basic/vault/toxin/New()
- ..()
-
- block = GLOB.vaulttoxinblock
-
/datum/dna/gene/basic/vault/toxin/activate(mob/living/carbon/human/human, flags)
. = ..()
@@ -50,11 +42,6 @@
span_notice("Вы чувствуете, как нужда в дыхании пропадает.")
)
-/datum/dna/gene/basic/vault/nobreath/New()
- ..()
-
- block = GLOB.vaultnobreathblock
-
/datum/dna/gene/basic/vault/fireproof
name = "Thermal Regulation"
@@ -64,10 +51,6 @@
span_notice("Вы чувствуете, как ваше тело стало более огнеупорным.")
)
-/datum/dna/gene/basic/vault/fireproof/New()
- ..()
- block = GLOB.vaultfireproofblock
-
/datum/dna/gene/basic/vault/fireproof/activate(mob/living/carbon/human/human, flags)
. = ..()
@@ -85,11 +68,6 @@
span_notice("Ничто не может долго сдерживать вас.")
)
-/datum/dna/gene/basic/vault/stuntime/New()
- ..()
-
- block = GLOB.vaultstuntimeblock
-
/datum/dna/gene/basic/vault/stuntime/activate(mob/living/carbon/human/human, flags)
. = ..()
@@ -113,11 +91,6 @@
span_notice("Вы чувствуете себя крепче.")
)
-/datum/dna/gene/basic/vault/armour/New()
- ..()
-
- block = GLOB.vaultarmourblock
-
/datum/dna/gene/basic/vault/armour/activate(mob/living/carbon/human/human, flags)
. = ..()
@@ -147,11 +120,6 @@
span_notice("Вы чувствуете себя быстрее и ловче.")
)
-/datum/dna/gene/basic/vault/speedlegs/New()
- ..()
-
- block = GLOB.vaultspeedlegsblock
-
/datum/dna/gene/basic/vault/speedlegs/activate(mob/living/carbon/human/human, flags)
. = ..()
@@ -169,11 +137,6 @@
span_notice("Ваши руки двигаются также быстро, как и молния.")
)
-/datum/dna/gene/basic/vault/quickarms/New()
- ..()
-
- block = GLOB.vaultquickarmsblock
-
/datum/dna/gene/basic/vault/quickarms/activate(mob/living/carbon/human/human, flags)
. = ..()
diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm
index 646c05ff25c..772180f3b49 100644
--- a/code/game/gamemodes/setupgame.dm
+++ b/code/game/gamemodes/setupgame.dm
@@ -2,14 +2,19 @@
if(!length(blocksLeft))
warning("[name]: No more blocks left to assign!")
return 0
+
var/assigned = pick(blocksLeft)
blocksLeft.Remove(assigned)
+
if(good)
GLOB.good_blocks += assigned
+
else
GLOB.bad_blocks += assigned
+
GLOB.assigned_blocks[assigned] = name
GLOB.dna_activity_bounds[assigned] = activity_bounds
+
return assigned
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 9de13bab6ed..d713caa26c3 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -44,7 +44,7 @@
/obj/item/dna_upgrader/proc/get_vault_genes_names()
var/list/vault_genes_names
- for(var/datum/dna/gene/basic/vault/gene in GLOB.dna_genes)
+ for(var/datum/dna/gene/basic/vault/gene as anything in subtypesof(/datum/dna/gene/basic/vault))
if(!initial(gene.name))
continue
@@ -64,11 +64,11 @@
if(!choosen_gene || !can_choose_genes(user))
return FALSE
- for(var/datum/dna/gene/basic/vault/gene in GLOB.dna_genes)
+ for(var/datum/dna/gene/basic/vault/gene as anything in subtypesof(/datum/dna/gene/basic/vault))
if(initial(gene.name) != choosen_gene)
continue
- user.force_gene_block(gene.block, TRUE, TRUE)
+ gene.activate(user)
break
finalize_dna_upgrade(user)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index f56a93baabf..2c03cea5135 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -340,11 +340,11 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
return TRUE
/obj/machinery/dna_vault/proc/upgrade(mob/living/carbon/human/human, upgrade_name)
- for(var/datum/dna/gene/basic/vault/gene in GLOB.dna_genes)
+ for(var/datum/dna/gene/basic/vault/gene as anything in subtypesof(/datum/dna/gene/basic/vault))
if(initial(gene.name) != upgrade_name)
continue
- human.force_gene_block(gene.block, TRUE, TRUE)
+ gene.activate(user)
break
LAZYNULL(power_lottery[human])
From 7dc8d1158d69a3cc0de6f3d48e5dd14e51a0f12a Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Tue, 17 Dec 2024 17:04:40 +0100
Subject: [PATCH 20/27] =?UTF-8?q?=D1=83=D0=BF=D1=81.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
code/modules/station_goals/dna_vault.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 2c03cea5135..ad17f734c7c 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -344,7 +344,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(initial(gene.name) != upgrade_name)
continue
- gene.activate(user)
+ gene.activate(human)
break
LAZYNULL(power_lottery[human])
From 8f31749ba0cc8fa7cdbc4f0284839bdfd833ed9c Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Fri, 20 Dec 2024 14:42:43 +0100
Subject: [PATCH 21/27] =?UTF-8?q?=D0=BF=D0=B8=D0=BB=D0=B8=D0=BC=20=D0=BF?=
=?UTF-8?q?=D0=B8=D0=BB=D0=B8=D0=BC=20=D0=BF=D0=B8=D0=BB=D0=B8=D0=BC=20?=
=?UTF-8?q?=D0=BF=D0=B8=D0=BB=D0=B8=D0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
code/game/objects/items/weapons/dna_upgrader.dm | 12 +++++++++---
code/modules/station_goals/dna_vault.dm | 8 +++++++-
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index d713caa26c3..538c3024c91 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -1,6 +1,6 @@
/obj/item/dna_upgrader
name = "dna upgrader"
- desc = "Говорят, что такое великое изменение генома может быть только при выполнении цели станции... Дураки."
+ desc = "Говорят, что такое великое изменение генома может быть достигнуто только при выполнении цели станции... Глупцы."
icon = 'icons/obj/hypo.dmi'
icon_state = "dnaupgrader"
@@ -41,13 +41,16 @@
return TRUE
-/obj/item/dna_upgrader/proc/get_vault_genes_names()
+/obj/item/dna_upgrader/proc/get_vault_genes_names(mob/user)
var/list/vault_genes_names
for(var/datum/dna/gene/basic/vault/gene as anything in subtypesof(/datum/dna/gene/basic/vault))
if(!initial(gene.name))
continue
+ if(!gene.can_activate(user))
+ continue
+
LAZYADD(vault_genes_names, initial(gene.name))
return vault_genes_names
@@ -57,7 +60,7 @@
user,
"Choose a modification",
name,
- get_vault_genes_names(),
+ get_vault_genes_names(user),
ui_state = GLOB.not_incapacitated_state
)
@@ -68,6 +71,9 @@
if(initial(gene.name) != choosen_gene)
continue
+ if(!gene.can_activate(user))
+ return FALSE
+
gene.activate(user)
break
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index ad17f734c7c..00feb233e17 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -231,6 +231,9 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(!initial(gene.name))
continue
+ if(!gene.can_activate(user))
+ continue
+
LAZYADD(genes, initial(gene.name))
if(!LAZYLEN(genes))
@@ -277,7 +280,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if("gene")
if(!can_upgrade(usr, params["choice"]))
return TRUE
-
+
upgrade(usr, params["choice"])
return TRUE
@@ -344,6 +347,9 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(initial(gene.name) != upgrade_name)
continue
+ if(!gene.can_activate(human))
+ return FALSE
+
gene.activate(human)
break
From a9e7c026507e90646afd4b63908cd9e9fa15bac4 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Fri, 20 Dec 2024 15:04:25 +0100
Subject: [PATCH 22/27] =?UTF-8?q?=D0=BF=D0=B8=D0=BB=D0=B8=D0=BC=20x2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
code/game/objects/items/weapons/dna_upgrader.dm | 6 ++++++
code/modules/station_goals/dna_vault.dm | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 538c3024c91..0e04113a3d6 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -48,6 +48,9 @@
if(!initial(gene.name))
continue
+ if(LAZYIN(user.active_genes, gene))
+ continue
+
if(!gene.can_activate(user))
continue
@@ -71,6 +74,9 @@
if(initial(gene.name) != choosen_gene)
continue
+ if(LAZYIN(human.active_genes, gene))
+ return FALSE
+
if(!gene.can_activate(user))
return FALSE
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 00feb233e17..e2eeebbb876 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -231,6 +231,9 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(!initial(gene.name))
continue
+ if(LAZYIN(user.active_genes, gene))
+ continue
+
if(!gene.can_activate(user))
continue
@@ -347,6 +350,9 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(initial(gene.name) != upgrade_name)
continue
+ if(LAZYIN(human.active_genes, gene))
+ return FALSE
+
if(!gene.can_activate(human))
return FALSE
From ba4d8c885abd840a16416cf8d54ddb7b2a293c59 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Fri, 20 Dec 2024 15:07:02 +0100
Subject: [PATCH 23/27] =?UTF-8?q?=D1=83=D0=BF=D1=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
code/game/objects/items/weapons/dna_upgrader.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 0e04113a3d6..51528ecffc6 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -74,7 +74,7 @@
if(initial(gene.name) != choosen_gene)
continue
- if(LAZYIN(human.active_genes, gene))
+ if(LAZYIN(user.active_genes, gene))
return FALSE
if(!gene.can_activate(user))
From 6a80f40c4e3115b5ece6e7dde29aa4d549b3e19f Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Fri, 20 Dec 2024 15:13:30 +0100
Subject: [PATCH 24/27] =?UTF-8?q?=D0=BF=D0=B8=D0=BB=D0=B8=D0=BC=20x3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
code/game/dna/genes/vault.dm | 3 +++
code/game/objects/items/weapons/dna_upgrader.dm | 4 ++--
code/modules/station_goals/dna_vault.dm | 4 ++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/code/game/dna/genes/vault.dm b/code/game/dna/genes/vault.dm
index 30a7d4b2bea..e73c2861369 100644
--- a/code/game/dna/genes/vault.dm
+++ b/code/game/dna/genes/vault.dm
@@ -1,5 +1,8 @@
/datum/dna/gene/basic/vault
+/datum/dna/gene/basic/vault/can_activate(mob/living/carbon/human/human, flags)
+ return istype(human)
+
/datum/dna/gene/basic/vault/toxin
name = "Toxin Adaptation"
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 51528ecffc6..8a3d82f339a 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -48,7 +48,7 @@
if(!initial(gene.name))
continue
- if(LAZYIN(user.active_genes, gene))
+ if(gene.is_active(user))
continue
if(!gene.can_activate(user))
@@ -74,7 +74,7 @@
if(initial(gene.name) != choosen_gene)
continue
- if(LAZYIN(user.active_genes, gene))
+ if(gene.is_active(user))
return FALSE
if(!gene.can_activate(user))
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index e2eeebbb876..c41b137d5cd 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -231,7 +231,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(!initial(gene.name))
continue
- if(LAZYIN(user.active_genes, gene))
+ if(gene.is_active(user))
continue
if(!gene.can_activate(user))
@@ -350,7 +350,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(initial(gene.name) != upgrade_name)
continue
- if(LAZYIN(human.active_genes, gene))
+ if(gene.is_active(human))
return FALSE
if(!gene.can_activate(human))
From b8f32a61ac336f6aec754cef42610dbc09f2a7f7 Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Sun, 22 Dec 2024 11:30:16 +0100
Subject: [PATCH 25/27] =?UTF-8?q?=D1=83=D0=BF=D1=81.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
code/modules/station_goals/dna_vault.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index c41b137d5cd..9d8fdb94fc4 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -189,7 +189,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
..()
/obj/machinery/dna_vault/update_icon_state()
- icon_state = "initial(icon_state)[stat & NOPOWER ? "off" : ""]"
+ icon_state = "[initial(icon_state)][stat & NOPOWER ? "off" : ""]"
/obj/machinery/dna_vault/power_change(forced = FALSE)
if(!..())
From 20b3450bcc45b701b23f4adfdbe97ed2f3b88eba Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Tue, 24 Dec 2024 07:38:37 +0100
Subject: [PATCH 26/27] upd
---
code/modules/station_goals/dna_vault.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 9d8fdb94fc4..17724d54d0d 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -227,7 +227,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
var/list/genes
- for(var/datum/dna/gene/basic/vault/gene in GLOB.dna_genes)
+ for(var/datum/dna/gene/basic/vault/gene as anything in subtypesof(/datum/dna/gene/basic/vault))
if(!initial(gene.name))
continue
From eaca95db1c78e36717d5ca56a883c005b682356b Mon Sep 17 00:00:00 2001
From: Antoonij <42318445+Antoonij@users.noreply.github.com>
Date: Tue, 24 Dec 2024 10:02:50 +0100
Subject: [PATCH 27/27] =?UTF-8?q?=D0=BF=D0=B8=D0=BB=D0=B8=D0=BC.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
code/game/dna/dna2.dm | 6 ++++--
code/game/dna/dna2_domutcheck.dm | 18 ++++++++++++++----
code/game/dna/genes/gene.dm | 6 +++---
.../game/objects/items/weapons/dna_upgrader.dm | 8 +-------
code/game/objects/structures.dm | 3 ++-
code/modules/mob/living/carbon/human/monkey.dm | 2 +-
code/modules/station_goals/dna_vault.dm | 8 +-------
7 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm
index 9ff983f8b42..6b4e0be5a88 100644
--- a/code/game/dna/dna2.dm
+++ b/code/game/dna/dna2.dm
@@ -314,12 +314,14 @@ GLOBAL_LIST_EMPTY(bad_blocks)
var/value = GetSEValue(block)
return round(1 + (value / 4096) * maxvalue)
-// Is the block "on" (1) or "off" (0)? (Un-assigned genes are always off.)
+/// Is the block "on" (1) or "off" (0)? (Un-assigned genes are always off.)
/datum/dna/proc/GetSEState(block)
- if(block <= 0)
+ if(!block)
return FALSE
+
var/list/BOUNDS = GetDNABounds(block)
var/value = GetSEValue(block)
+
return (value >= BOUNDS[DNA_ON_LOWERBOUND])
// Set a block "on" or "off".
diff --git a/code/game/dna/dna2_domutcheck.dm b/code/game/dna/dna2_domutcheck.dm
index aa4194d7239..28423e627d0 100644
--- a/code/game/dna/dna2_domutcheck.dm
+++ b/code/game/dna/dna2_domutcheck.dm
@@ -66,7 +66,7 @@
return FALSE
// Gene is in bounds but not active currently
- if(gene_in_bounds && !gene_is_active)
+ if((gene_in_bounds && gene.block) && !gene_is_active)
// If our gene should be activated, we need to check for conditions
if(!gene.can_activate(src, flags))
return FALSE
@@ -75,9 +75,10 @@
return TRUE
// Same with deactivation stuff
- if(!gene_in_bounds && gene_is_active)
+ if((!gene_in_bounds && gene.block) && gene_is_active)
if(!gene.can_deactivate(src, flags))
return FALSE
+
INVOKE_ASYNC(gene, TYPE_PROC_REF(/datum/dna/gene, deactivate), src, flags)
return TRUE
@@ -102,15 +103,24 @@
return
-/mob/living/carbon/human/force_gene_block(block, activate = FALSE, update_default_status = FALSE, ignore_species_default = FALSE)
+/mob/living/carbon/human/force_gene_block(
+ block,
+ activate = FALSE,
+ update_default_status = FALSE,
+ ignore_species_default = FALSE
+ )
var/force_flags = MUTCHK_FORCED
+
if(ignore_species_default)
force_flags |= MUTCHK_IGNORE_DEFAULT
+
dna.SetSEState(block, activate)
+
. = check_gene_block(block, force_flags)
+
if(. && update_default_status)
if(activate)
LAZYOR(dna.default_blocks, block)
+
else
LAZYREMOVE(dna.default_blocks, block)
-
diff --git a/code/game/dna/genes/gene.dm b/code/game/dna/genes/gene.dm
index 7d91e99f618..2b192a94c0e 100644
--- a/code/game/dna/genes/gene.dm
+++ b/code/game/dna/genes/gene.dm
@@ -41,7 +41,7 @@
* Is the gene active in this mob's DNA?
*/
/datum/dna/gene/proc/is_active(mob/living/mutant)
- return LAZYIN(mutant.active_genes, type)
+ return LAZYIN(mutant.active_genes, src)
/// Return `TRUE` if we can activate.
@@ -58,7 +58,7 @@
/datum/dna/gene/proc/activate(mob/living/mutant, flags)
SHOULD_CALL_PARENT(TRUE)
- LAZYOR(mutant.active_genes, type)
+ LAZYOR(mutant.active_genes, src)
mutant.gene_stability -= instability
@@ -75,7 +75,7 @@
/datum/dna/gene/proc/deactivate(mob/living/mutant, flags)
SHOULD_CALL_PARENT(TRUE)
- LAZYREMOVE(mutant.active_genes, type)
+ LAZYREMOVE(mutant.active_genes, src)
mutant.gene_stability += instability
diff --git a/code/game/objects/items/weapons/dna_upgrader.dm b/code/game/objects/items/weapons/dna_upgrader.dm
index 8a3d82f339a..61d418f866a 100644
--- a/code/game/objects/items/weapons/dna_upgrader.dm
+++ b/code/game/objects/items/weapons/dna_upgrader.dm
@@ -74,13 +74,7 @@
if(initial(gene.name) != choosen_gene)
continue
- if(gene.is_active(user))
- return FALSE
-
- if(!gene.can_activate(user))
- return FALSE
-
- gene.activate(user)
+ user.update_gene_status(gene)
break
finalize_dna_upgrade(user)
diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm
index 3d220896144..e6fafe2bd75 100644
--- a/code/game/objects/structures.dm
+++ b/code/game/objects/structures.dm
@@ -145,8 +145,9 @@
if(MOB_SIZE_SMALL) slopchance = 20
if(MOB_SIZE_TINY) slopchance = 10
- if(LAZYIN(user.active_genes, /datum/dna/gene/disability/clumsy))
+ if(locate(/datum/dna/gene/disability/clumsy) in user.active_genes)
slopchance += 20
+
if(user.mind?.miming)
slopchance -= 30
diff --git a/code/modules/mob/living/carbon/human/monkey.dm b/code/modules/mob/living/carbon/human/monkey.dm
index af944459eb9..2fd8039c0c4 100644
--- a/code/modules/mob/living/carbon/human/monkey.dm
+++ b/code/modules/mob/living/carbon/human/monkey.dm
@@ -6,7 +6,7 @@
/mob/living/carbon/human/lesser/setup_dna(datum/species/new_species, monkeybasic = TRUE)
. = ..()
// since we are created as monkas we need to manually set our GLOB.monkeyblock as activated
- LAZYOR(active_genes, /datum/dna/gene/monkey)
+ LAZYOR(active_genes, new /datum/dna/gene/monkey)
/mob/living/carbon/human/lesser/monkey
icon_state = "monkey1"
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 17724d54d0d..606d9e3d79c 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -350,13 +350,7 @@ GLOBAL_LIST_INIT(non_simple_animals, typecacheof(list(/mob/living/carbon/human/l
if(initial(gene.name) != upgrade_name)
continue
- if(gene.is_active(human))
- return FALSE
-
- if(!gene.can_activate(human))
- return FALSE
-
- gene.activate(human)
+ human.update_gene_status(gene)
break
LAZYNULL(power_lottery[human])