Files
Yogstation/code/game/objects/items/chromosome.dm
yogstation13-bot 05e86b90c3 [MIRROR] [GOONETICS] Chromosomes (#4453)
* [GOONETICS] Chromosomes (#42151)

* adds chromosomes

* Makes the framework nice and functional

* Adds chromosome interaction

* Makes chromosomes work

* removes the double instability update

* Apply suggestions from code review

Co-Authored-By: Time-Green <timkoster1@hotmail.com>

* more review stuff

also fixed some inconsistencies in chromosomes

* unfucks defines

* Fixes saved mutations runtiming with empty pods

* Adds stability to the dna console and advanced health scanner

* removes a random bug i stumbled upon

* Update code/game/machinery/computer/dna_console.dm

Co-Authored-By: Time-Green <timkoster1@hotmail.com>

* makes chromosomes harder to get

fixes double mutations, adds reinforcer and nerfs stabilizer

* fixes edge case where fireballs would be harmless

* cleans up find/replace all mess and 1 in 10 trillion chance of fireball breaking

* [GOONETICS] Chromosomes

* fuck you mirror bot
2019-02-18 12:01:23 -05:00

92 lines
2.8 KiB
Plaintext

/obj/item/chromosome
name = "blank chromosome"
icon = 'icons/obj/chromosomes.dmi'
icon_state = ""
desc = "A tube holding chromosomic data."
force = 0
w_class = WEIGHT_CLASS_SMALL
var/stabilizer_coeff = 1 //lower is better, affects genetic stability
var/synchronizer_coeff = 1 //lower is better, affects chance to backfire
var/power_coeff = 1 //higher is better, affects "strength"
var/energy_coeff = 1 //lower is better. affects recharge time
var/weight = 5
/obj/item/chromosome/proc/can_apply(datum/mutation/human/HM)
if(!HM || !(HM.can_chromosome == CHROMOSOME_NONE))
return FALSE
if((stabilizer_coeff != 1) && (HM.stabilizer_coeff != -1)) //if the chromosome is 1, we dont change anything. If the mutation is -1, we cant change it. sorry
return TRUE
if((synchronizer_coeff != 1) && (HM.synchronizer_coeff != -1))
return TRUE
if((power_coeff != 1) && (HM.power_coeff != -1))
return TRUE
if((energy_coeff != 1) && (HM.energy_coeff != -1))
return TRUE
/obj/item/chromosome/proc/apply(datum/mutation/human/HM)
if(HM.stabilizer_coeff != -1)
HM.stabilizer_coeff = stabilizer_coeff
if(HM.synchronizer_coeff != -1)
HM.synchronizer_coeff = synchronizer_coeff
if(HM.power_coeff != -1)
HM.power_coeff = power_coeff
if(HM.energy_coeff != -1)
HM.energy_coeff = energy_coeff
HM.can_chromosome = 2
HM.chromosome_name = name
HM.modify()
qdel(src)
/proc/generate_chromosome()
var/static/list/chromosomes
if(!chromosomes)
chromosomes = list()
for(var/A in subtypesof(/obj/item/chromosome))
var/obj/item/chromosome/CM = A
if(!initial(CM.weight))
break
chromosomes[A] = initial(CM.weight)
return pickweight(chromosomes)
/obj/item/chromosome/stabilizer
name = "stabilizer chromosome"
desc = "A chromosome that adjusts to the body to reduce genetic damage by 20%."
icon_state = "stabilizer"
stabilizer_coeff = 0.8
weight = 1
/obj/item/chromosome/synchronizer
name = "synchronizer chromosome"
desc = "A chromosome that gives the mind more controle over the mutation, reducing knockback and downsides by 50%."
icon_state = "synchronizer"
synchronizer_coeff = 0.5
/obj/item/chromosome/power
name = "power chromosome"
desc = "A power chromosome for boosting certain mutation's power by 50%."
icon_state = "power"
power_coeff = 1.5
/obj/item/chromosome/energy
name = "energetic chromosome"
desc = "A chromosome that reduces cooldown on action based mutations by 50%."
icon_state = "energy"
energy_coeff = 0.5
/obj/item/chromosome/reinforcer
name = "reinforcement chromosome"
desc = "Renders the mutation immune to mutadone."
icon_state = "reinforcer"
weight = 3
/obj/item/chromosome/reinforcer/can_apply(datum/mutation/human/HM)
if(!HM || !(HM.can_chromosome == CHROMOSOME_NONE))
return FALSE
return !HM.mutadone_proof
/obj/item/chromosome/reinforcer/apply(datum/mutation/human/HM)
HM.mutadone_proof = TRUE
..()