Refactors DNA Mutations; Refactors Mutations to use Traits (#15483)

* Refactors Mutations

* traits

* more work

* styling fix

* yet even more work

* oh hush

* almost there

* it continues yet further

* and that's genetics done

* and that's it folks

* last bit and golem fixup

* oof

* oops

* tweaks and fixes

* styling
This commit is contained in:
Fox McCloud
2021-02-21 21:25:19 +00:00
committed by GitHub
parent 324af7454c
commit 02b9445b9b
223 changed files with 2908 additions and 3049 deletions
+2 -2
View File
@@ -57,8 +57,8 @@
equip_to_slot_if_possible(new /obj/item/clothing/mask/gas/clown_hat/nodrop, slot_wear_mask, TRUE, TRUE)
dna.SetSEState(GLOB.clumsyblock, TRUE, TRUE)
dna.SetSEState(GLOB.comicblock, TRUE, TRUE)
genemutcheck(src, GLOB.clumsyblock, null, MUTCHK_FORCED)
genemutcheck(src, GLOB.comicblock, null, MUTCHK_FORCED)
singlemutcheck(src, GLOB.clumsyblock, MUTCHK_FORCED)
singlemutcheck(src, GLOB.comicblock, MUTCHK_FORCED)
if(!(iswizard(src) || (mind && mind.special_role == SPECIAL_ROLE_WIZARD_APPRENTICE))) //Mutations are permanent on non-wizards. Can still be removed by genetics fuckery but not mutadone.
dna.default_blocks.Add(GLOB.clumsyblock)
dna.default_blocks.Add(GLOB.comicblock)
+7 -11
View File
@@ -26,9 +26,8 @@
var/obj/item/organ/internal/honktumor/cursed/tumor = new
tumor.insert(src)
mutations.Add(NERVOUS)
dna.SetSEState(GLOB.nervousblock, 1, 1)
genemutcheck(src, GLOB.nervousblock, null, MUTCHK_FORCED)
singlemutcheck(src, GLOB.nervousblock, MUTCHK_FORCED)
rename_character(real_name, "cluwne")
unEquip(w_uniform, 1)
@@ -55,15 +54,12 @@
if(tumor)
tumor.remove(src)
else
mutations.Remove(CLUMSY)
mutations.Remove(GLOB.comicblock)
dna.SetSEState(GLOB.clumsyblock,0)
dna.SetSEState(GLOB.comicblock,0)
genemutcheck(src, GLOB.clumsyblock, null, MUTCHK_FORCED)
genemutcheck(src, GLOB.comicblock, null, MUTCHK_FORCED)
mutations.Remove(NERVOUS)
dna.SetSEState(GLOB.nervousblock, 0)
genemutcheck(src, GLOB.nervousblock, null, MUTCHK_FORCED)
dna.SetSEState(GLOB.clumsyblock, FALSE)
dna.SetSEState(GLOB.comicblock, FALSE)
singlemutcheck(src, GLOB.clumsyblock, MUTCHK_FORCED)
singlemutcheck(src, GLOB.comicblock, MUTCHK_FORCED)
dna.SetSEState(GLOB.nervousblock, FALSE)
singlemutcheck(src, GLOB.nervousblock, MUTCHK_FORCED)
var/obj/item/clothing/under/U = w_uniform
unEquip(w_uniform, 1)
+29 -24
View File
@@ -2,31 +2,36 @@
name = "Genetic"
desc = "This spell inflicts a set of mutations and disabilities upon the target."
var/list/mutations = list() //mutation strings
var/duration = 100 //deciseconds
/*
Disabilities
1st bit - ?
2nd bit - ?
3rd bit - ?
4th bit - ?
5th bit - ?
6th bit - ?
*/
var/list/active_on = list()
var/list/traits = list() // traits
var/list/mutations = list() // mutation defines. Set these in Initialize. Refactor this nonsense one day
var/duration = 100 // deciseconds
/obj/effect/proc_holder/spell/targeted/genetic/cast(list/targets, mob/user = usr)
for(var/mob/living/target in targets)
for(var/x in mutations)
target.mutations.Add(x)
target.update_mutations() //update target's mutation overlays
var/mob/living/carbon/human/H = target
if(ishuman(target))
H.update_body()
spawn(duration)
target.mutations.Remove(mutations)
target.update_mutations()
if(ishuman(target))
H.update_body()
if(!target.dna)
continue
for(var/A in mutations)
target.dna.SetSEState(A, TRUE)
singlemutcheck(target, A, MUTCHK_FORCED)
for(var/A in traits)
ADD_TRAIT(target, A, MAGIC_TRAIT)
active_on += target
target.regenerate_icons()
if(duration < charge_max)
addtimer(CALLBACK(src, .proc/remove, target), duration, TIMER_OVERRIDE|TIMER_UNIQUE)
return
/obj/effect/proc_holder/spell/targeted/genetic/Destroy()
for(var/V in active_on)
remove(V)
return ..()
/obj/effect/proc_holder/spell/targeted/genetic/proc/remove(mob/living/carbon/target)
active_on -= target
if(!QDELETED(target))
for(var/A in mutations)
target.dna.SetSEState(A, FALSE)
singlemutcheck(target, A, MUTCHK_FORCED)
for(var/A in traits)
REMOVE_TRAIT(target, A, MAGIC_TRAIT)
target.regenerate_icons()
+1 -1
View File
@@ -50,5 +50,5 @@
equip_to_slot_if_possible(new /obj/item/clothing/under/mime/nodrop, slot_w_uniform, TRUE, TRUE)
equip_to_slot_if_possible(new /obj/item/clothing/suit/suspenders/nodrop, slot_wear_suit, TRUE, TRUE)
dna.SetSEState(GLOB.muteblock , TRUE, TRUE)
genemutcheck(src, GLOB.muteblock , null, MUTCHK_FORCED)
singlemutcheck(src, GLOB.muteblock, MUTCHK_FORCED)
dna.default_blocks.Add(GLOB.muteblock)
+5 -10
View File
@@ -88,21 +88,16 @@
include_user = 1
centcom_cancast = 0
mutations = list(LASER, HULK)
traits = list(TRAIT_LASEREYES)
duration = 300
cooldown_min = 300 //25 deciseconds reduction per rank
action_icon_state = "mutate"
sound = 'sound/magic/mutate.ogg'
/obj/effect/proc_holder/spell/targeted/genetic/mutate/cast(list/targets, mob/user = usr)
for(var/mob/living/target in targets)
target.dna.SetSEState(GLOB.hulkblock, 1)
genemutcheck(target, GLOB.hulkblock, null, MUTCHK_FORCED)
spawn(duration)
target.dna.SetSEState(GLOB.hulkblock, 0)
genemutcheck(target, GLOB.hulkblock, null, MUTCHK_FORCED)
..()
/obj/effect/proc_holder/spell/targeted/genetic/mutate/Initialize(mapload)
. = ..()
mutations = list(GLOB.hulkblock)
/obj/effect/proc_holder/spell/targeted/smoke
name = "Smoke"
@@ -304,7 +299,7 @@
sound = 'sound/magic/blind.ogg'
/obj/effect/proc_holder/spell/targeted/genetic/blind
mutations = list(BLINDNESS)
traits = list(TRAIT_BLIND)
duration = 300
sound = 'sound/magic/blind.ogg'