mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 19:17:50 +01:00
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:
@@ -24,7 +24,7 @@
|
||||
|
||||
if(ishuman(AM))
|
||||
var/mob/living/carbon/human/H = AM
|
||||
if(PIERCEIMMUNE in H.dna.species.species_traits)
|
||||
if(HAS_TRAIT(H, TRAIT_PIERCEIMMUNE))
|
||||
return
|
||||
|
||||
if((flags & CALTROP_IGNORE_WALKERS) && H.m_intent == MOVE_INTENT_WALK)
|
||||
|
||||
@@ -142,11 +142,12 @@
|
||||
|
||||
|
||||
/mob/living/carbon/human/CanContractDisease(datum/disease/D)
|
||||
if((VIRUSIMMUNE in dna.species.species_traits) && !D.bypasses_immunity)
|
||||
return 0
|
||||
if(HAS_TRAIT(src, TRAIT_VIRUSIMMUNE) && !D.bypasses_immunity)
|
||||
return FALSE
|
||||
|
||||
for(var/thing in D.required_organs)
|
||||
if(!((locate(thing) in bodyparts) || (locate(thing) in internal_organs)))
|
||||
return 0
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/monkey/CanContractDisease(datum/disease/D)
|
||||
|
||||
@@ -16,7 +16,6 @@ Bonus
|
||||
*/
|
||||
|
||||
/datum/symptom/deafness
|
||||
|
||||
name = "Deafness"
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
@@ -29,15 +28,12 @@ Bonus
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB))
|
||||
var/mob/living/M = A.affected_mob
|
||||
var/obj/item/organ/internal/ears/ears = M.get_organ_slot("ears")
|
||||
if(!ears)
|
||||
return //cutting off your ears to cure the deafness: the ultimate own
|
||||
switch(A.stage)
|
||||
if(3, 4)
|
||||
to_chat(M, "<span class='warning'>[pick("You hear a ringing in your ear.", "Your ears pop.")]</span>")
|
||||
if(5)
|
||||
if(!(DEAF in M.mutations))
|
||||
to_chat(M, "<span class='userdanger'>Your ears pop and begin ringing loudly!</span>")
|
||||
M.BecomeDeaf()
|
||||
spawn(200)
|
||||
if(M)
|
||||
to_chat(M, "<span class='warning'>The ringing in your ears fades...</span>")
|
||||
M.CureDeaf()
|
||||
return
|
||||
to_chat(M, "<span class='userdanger'>Your ears pop and begin ringing loudly!</span>")
|
||||
ears.deaf = min(20, ears.deaf + 15)
|
||||
|
||||
@@ -44,7 +44,8 @@ Bonus
|
||||
M.EyeBlurry(30)
|
||||
eyes.receive_damage(5)
|
||||
if(eyes.damage >= 10)
|
||||
M.BecomeNearsighted()
|
||||
M.become_nearsighted(EYE_DAMAGE)
|
||||
if(prob(eyes.damage - 10 + 1))
|
||||
if(M.BecomeBlind())
|
||||
if(!M.eye_blind)
|
||||
to_chat(M, "<span class='userdanger'>You go blind!</span>")
|
||||
eyes.receive_damage(eyes.max_damage)
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
/datum/disease/critical/hypoglycemia/has_cure()
|
||||
if(ishuman(affected_mob))
|
||||
var/mob/living/carbon/human/H = affected_mob
|
||||
if(NO_HUNGER in H.dna.species.species_traits)
|
||||
if(HAS_TRAIT(H, TRAIT_NOHUNGER))
|
||||
return TRUE
|
||||
if(ismachineperson(H))
|
||||
return TRUE
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
|
||||
/datum/dog_fashion/back/hardsuit/apply(mob/living/simple_animal/pet/dog/D)
|
||||
..()
|
||||
D.mutations.Add(BREATHLESS)
|
||||
ADD_TRAIT(D, TRAIT_NOBREATH, DOGGO_SPACESUIT)
|
||||
D.atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
|
||||
D.minbodytemp = 0
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/datum/element/earhealing
|
||||
element_flags = ELEMENT_DETACH
|
||||
var/list/user_by_item = list()
|
||||
|
||||
/datum/element/earhealing/New()
|
||||
START_PROCESSING(SSdcs, src)
|
||||
|
||||
/datum/element/earhealing/Attach(datum/target)
|
||||
. = ..()
|
||||
if(!isitem(target))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
|
||||
RegisterSignal(target, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED), .proc/equippedChanged)
|
||||
|
||||
/datum/element/earhealing/Detach(datum/target)
|
||||
. = ..()
|
||||
UnregisterSignal(target, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED))
|
||||
user_by_item -= target
|
||||
|
||||
/datum/element/earhealing/proc/equippedChanged(datum/source, mob/living/carbon/user, slot)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(((slot == slot_l_ear) || (slot == slot_r_ear)) && istype(user))
|
||||
user_by_item[source] = user
|
||||
else
|
||||
user_by_item -= source
|
||||
|
||||
/datum/element/earhealing/process()
|
||||
for(var/i in user_by_item)
|
||||
var/mob/living/carbon/user = user_by_item[i]
|
||||
var/obj/item/organ/internal/ears/ears = user.get_int_organ(/obj/item/organ/internal/ears)
|
||||
if(!ears || HAS_TRAIT_NOT_FROM(user, TRAIT_DEAF, EAR_DAMAGE))
|
||||
continue
|
||||
ears.deaf = max(ears.deaf - 0.25, (ears.ear_damage < 100 ? 0 : 1)) // Do not clear deafness if our ears are too damaged
|
||||
ears.ear_damage = max(ears.ear_damage - 0.025, 0)
|
||||
CHECK_TICK
|
||||
+1
-1
@@ -976,7 +976,7 @@
|
||||
current.dna = changeling.absorbed_dna[1]
|
||||
current.real_name = current.dna.real_name
|
||||
current.UpdateAppearance()
|
||||
domutcheck(current, null)
|
||||
domutcheck(current)
|
||||
log_admin("[key_name(usr)] has reset [key_name(current)]'s DNA")
|
||||
message_admins("[key_name_admin(usr)] has reset [key_name_admin(current)]'s DNA")
|
||||
|
||||
|
||||
@@ -1052,7 +1052,7 @@
|
||||
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/raise_vampires)
|
||||
to_chat(H, "You have gained the ability to Raise Vampires. This extremely powerful AOE ability affects all humans near you. Vampires/thralls are healed. Corpses are raised as vampires. Others are stunned, then brain damaged, then killed.")
|
||||
H.dna.SetSEState(GLOB.jumpblock, 1)
|
||||
genemutcheck(H, GLOB.jumpblock, null, MUTCHK_FORCED)
|
||||
singlemutcheck(H, GLOB.jumpblock, MUTCHK_FORCED)
|
||||
H.update_mutations()
|
||||
H.gene_stability = 100
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@
|
||||
/datum/status_effect/blooddrunk/on_apply()
|
||||
. = ..()
|
||||
if(.)
|
||||
ADD_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, "blooddrunk")
|
||||
if(ishuman(owner))
|
||||
owner.status_flags |= IGNORESLOWDOWN
|
||||
var/mob/living/carbon/human/H = owner
|
||||
for(var/X in H.bodyparts)
|
||||
var/obj/item/organ/external/BP = X
|
||||
@@ -81,7 +81,7 @@
|
||||
H.dna.species.clone_mod *= 10
|
||||
H.dna.species.stamina_mod *= 10
|
||||
add_attack_logs(owner, owner, "lost blood-drunk stun immunity", ATKLOG_ALL)
|
||||
owner.status_flags &= ~IGNORESLOWDOWN
|
||||
REMOVE_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, "blooddrunk")
|
||||
if(islist(owner.stun_absorption) && owner.stun_absorption["blooddrunk"])
|
||||
owner.stun_absorption -= "blooddrunk"
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
alert_type = /obj/screen/alert/status_effect/regenerative_core
|
||||
|
||||
/datum/status_effect/regenerative_core/on_apply()
|
||||
owner.status_flags |= IGNORE_SPEED_CHANGES
|
||||
ADD_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, id)
|
||||
owner.adjustBruteLoss(-25)
|
||||
owner.adjustFireLoss(-25)
|
||||
owner.remove_CC()
|
||||
@@ -231,4 +231,4 @@
|
||||
return TRUE
|
||||
|
||||
/datum/status_effect/regenerative_core/on_remove()
|
||||
owner.status_flags &= ~IGNORE_SPEED_CHANGES
|
||||
REMOVE_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, id)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
if(prob(40))
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
if(!(RADIMMUNE in H.dna.species.species_traits))
|
||||
if(!HAS_TRAIT(H, TRAIT_RADIMMUNE))
|
||||
if(prob(max(0, 100 - resist)))
|
||||
randmuti(H) // Applies bad mutation
|
||||
if(prob(50))
|
||||
@@ -44,7 +44,7 @@
|
||||
randmutb(H)
|
||||
else
|
||||
randmutg(H)
|
||||
domutcheck(H, null, 1)
|
||||
domutcheck(H, MUTCHK_FORCED)
|
||||
|
||||
L.rad_act(20)
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/obj/item/organ/internal/eyes/eyes = H.get_int_organ(/obj/item/organ/internal/eyes)
|
||||
if(eyes && (COLOURBLIND in H.mutations)) // Check if the human has colorblindness.
|
||||
if(eyes && HAS_TRAIT(H, TRAIT_COLORBLIND)) // Check if the human has colorblindness.
|
||||
replace_colors = eyes.replace_colours // Get the colorblind replacement colors list.
|
||||
|
||||
var/list/wires_list = list()
|
||||
|
||||
Reference in New Issue
Block a user