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
+1 -1
View File
@@ -35,7 +35,7 @@
return ..()
add_fingerprint(user)
if((CLUMSY in user.mutations) && prob(50))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
user.visible_message("<span class='danger'>[user] accidentally clubs [user.p_them()]self with [src]!</span>", \
"<span class='userdanger'>You accidentally club yourself with [src]!</span>")
user.Weaken(force * 3)
+2 -2
View File
@@ -419,7 +419,7 @@
for(var/obj/item/organ/external/O in H.bodyparts)
total_brute += O.brute_dam
total_burn += O.burn_dam
if(total_burn <= 180 && total_brute <= 180 && !H.suiciding && !ghost && tplus < tlimit && !(NOCLONE in H.mutations) && (H.mind && H.mind.is_revivable()) && (H.get_int_organ(/obj/item/organ/internal/heart) || H.get_int_organ(/obj/item/organ/internal/brain/slime)))
if(total_burn <= 180 && total_brute <= 180 && !H.suiciding && !ghost && tplus < tlimit && !HAS_TRAIT(H, TRAIT_HUSK) && !HAS_TRAIT(H, TRAIT_BADDNA) && (H.mind && H.mind.is_revivable()) && (H.get_int_organ(/obj/item/organ/internal/heart) || H.get_int_organ(/obj/item/organ/internal/brain/slime)))
tobehealed = min(health + threshold, 0) // It's HILARIOUS without this min statement, let me tell you
tobehealed -= 5 //They get 5 of each type of damage healed so excessive combined damage will not immediately kill them after they get revived
H.adjustOxyLoss(tobehealed)
@@ -538,7 +538,7 @@
for(var/obj/item/organ/external/O in H.bodyparts)
total_brute += O.brute_dam
total_burn += O.burn_dam
if(total_burn <= 180 && total_brute <= 180 && !H.suiciding && !ghost && tplus < tlimit && !(NOCLONE in H.mutations) && (H.mind && H.mind.is_revivable()))
if(total_burn <= 180 && total_brute <= 180 && !H.suiciding && !ghost && tplus < tlimit && !HAS_TRAIT(H, TRAIT_HUSK) && (H.mind && H.mind.is_revivable()))
tobehealed = min(health + threshold, 0) // It's HILARIOUS without this min statement, let me tell you
tobehealed -= 5 //They get 5 of each type of damage healed so excessive combined damage will not immediately kill them after they get revived
H.adjustOxyLoss(tobehealed)
@@ -80,7 +80,7 @@
return
spawn(0) //Some mutations have sleeps in them, like monkey
if(!(NOCLONE in M.mutations) && !(H && (NO_DNA in H.dna.species.species_traits))) // prevents drained people from having their DNA changed
if(!HAS_TRAIT(M, TRAIT_BADDNA) && !HAS_TRAIT(M, TRAIT_GENELESS)) // prevents drained people from having their DNA changed
var/prev_ue = M.dna.unique_enzymes
// UI in syringe.
if(buf.types & DNA2_BUF_UI)
@@ -103,7 +103,7 @@
M.dna.UpdateSE()
else
M.dna.SetSEValue(block,src.GetValue())
domutcheck(M, null, forcedmutation ? MUTCHK_FORCED : 0)
domutcheck(M, forcedmutation ? MUTCHK_FORCED : FALSE)
M.update_mutations()
if(H)
H.sync_organ_dna(assimilate = 0, old_ue = prev_ue)
@@ -112,14 +112,9 @@
if(used)
to_chat(user, "<span class='warning'>This injector is used up!</span>")
return
if(!M.dna) //You know what would be nice? If the mob you're injecting has DNA, and so doesn't cause runtimes.
if(!M.dna || HAS_TRAIT(M, TRAIT_GENELESS) || HAS_TRAIT(M, TRAIT_BADDNA)) //You know what would be nice? If the mob you're injecting has DNA, and so doesn't cause runtimes.
return FALSE
if(ishuman(M)) // Would've done this via species instead of type, but the basic mob doesn't have a species, go figure.
var/mob/living/carbon/human/H = M
if(NO_DNA in H.dna.species.species_traits)
return FALSE
if(!user.IsAdvancedToolUser())
return FALSE
@@ -22,11 +22,9 @@
if(used)
return
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(NO_DNA in H.dna.species.species_traits)
to_chat(user, "<span class='warning'>You failed to inject [M], as [M.p_they()] [M.p_have()] no DNA to scramble, nor flesh to inject.</span>")
return
if(HAS_TRAIT(M, TRAIT_GENELESS))
to_chat(user, "<span class='warning'>You failed to inject [M], as [M.p_they()] [M.p_have()] no DNA to scramble, nor flesh to inject.</span>")
return
if(M == user)
user.visible_message("<span class='danger'>[user] injects [user.p_them()]self with [src]!</span>")
@@ -74,7 +74,7 @@
if(!ear_safety)
M.Stun(stun_amount)
M.Weaken(stun_amount)
M.AdjustEarDamage(rand(0, 5), 15)
M.AdjustEarDamage(5, 15)
if(iscarbon(M))
var/mob/living/carbon/C = M
var/obj/item/organ/internal/ears/ears = C.get_int_organ(/obj/item/organ/internal/ears)
@@ -83,6 +83,5 @@
to_chat(M, "<span class='warning'>Your ears start to ring badly!</span>")
if(prob(ears.ear_damage - 5))
to_chat(M, "<span class='warning'>You can't hear anything!</span>")
M.BecomeDeaf()
else if(ears.ear_damage >= 5)
to_chat(M, "<span class='warning'>Your ears start to ring!</span>")
@@ -22,7 +22,7 @@
qdel(src)
/obj/item/grenade/proc/clown_check(var/mob/living/user)
if((CLUMSY in user.mutations) && prob(50))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
to_chat(user, "<span class='warning'>Huh? How does this thing work?</span>")
active = 1
icon_state = initial(icon_state) + "_active"
+1 -1
View File
@@ -29,7 +29,7 @@
to_chat(user, "<span class='warning'>[src] is stuck to your hand!</span>")
return
if((CLUMSY in user.mutations) && prob(50) && (!ignoresClumsy))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50) && (!ignoresClumsy))
to_chat(user, "<span class='warning'>Uh... how do those things work?!</span>")
apply_cuffs(user, user)
return
+1 -1
View File
@@ -48,7 +48,7 @@
if(user.a_intent != INTENT_HELP)
if(user.zone_selected == "head" || user.zone_selected == "eyes")
if((CLUMSY in user.mutations) && prob(50))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
C = user
return eyestab(C, user)
else
@@ -37,7 +37,7 @@
return BRUTELOSS|FIRELOSS
/obj/item/melee/energy/attack_self(mob/living/carbon/user)
if((CLUMSY in user.mutations) && prob(50))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
to_chat(user, "<span class='warning'>You accidentally cut yourself with [src], like a doofus!</span>")
user.take_organ_damage(5,5)
active = !active
@@ -291,7 +291,7 @@
if(ishuman(user))
var/mob/living/carbon/human/H = user
if((CLUMSY in H.mutations) && prob(50))
if(HAS_TRAIT(H, TRAIT_CLUMSY) && prob(50))
to_chat(H, "<span class='warning'>You accidentally cut yourself with [src], like a doofus!</span>")
H.take_organ_damage(10,10)
active = !active
@@ -101,7 +101,7 @@
if(tank && !tank.air_contents.remove(gasPerThrow * pressureSetting))
to_chat(user, "<span class='warning'>\The [src] lets out a weak hiss and doesn't react!</span>")
return
if(user && (CLUMSY in user.mutations) && prob(75))
if(user && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(75))
user.visible_message("<span class='warning'>[user] loses [user.p_their()] grip on [src], causing it to go off!</span>", "<span class='userdanger'>[src] slips out of your hands and goes off!</span>")
user.drop_item()
if(prob(10))
+1 -1
View File
@@ -51,7 +51,7 @@
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(!H.gloves && !(PIERCEIMMUNE in H.dna.species.species_traits))
if(!H.gloves && !HAS_TRAIT(H, TRAIT_PIERCEIMMUNE))
var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand")
if(affecting.is_robotic())
return
+1 -1
View File
@@ -76,7 +76,7 @@
return (active)
/obj/item/shield/energy/attack_self(mob/living/carbon/human/user)
if((CLUMSY in user.mutations) && prob(50))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
to_chat(user, "<span class='warning'>You beat yourself in the head with [src].</span>")
user.take_organ_damage(5)
active = !active
@@ -82,7 +82,7 @@
user.take_organ_damage(0, 10)
return
if((CLUMSY in user.mutations) && prob(50))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
to_chat(user, "<span class='warning'>The [src] slips out of your hand and hits your head.</span>")
user.take_organ_damage(10)
user.Paralyse(20)
@@ -56,7 +56,7 @@
to_chat(user, "<span class='warning'>The [I] is too big to fit in the false bottom!</span>")
return
if(!user.drop_item(I))
user << "<span class='warning'>The [I] is stuck to your hands!</span>"
to_chat(user, "<span class='warning'>The [I] is stuck to your hands!</span>")
return
stored_item = I
+1 -1
View File
@@ -135,7 +135,7 @@
add_fingerprint(user)
/obj/item/melee/baton/attack(mob/M, mob/living/user)
if(status && (CLUMSY in user.mutations) && prob(50))
if(status && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
user.visible_message("<span class='danger'>[user] accidentally hits [user.p_them()]self with [src]!</span>", \
"<span class='userdanger'>You accidentally hit yourself with [src]!</span>")
user.Weaken(stunforce*3)
+1 -1
View File
@@ -9,7 +9,7 @@
/obj/item/melee/baton/cattleprod/teleprod/attack(mob/living/carbon/M, mob/living/carbon/user)//handles making things teleport when hit
..()
if(status)
if((CLUMSY in user.mutations) && prob(50))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
user.visible_message("<span class='danger'>[user] accidentally hits [user.p_them()]self with [src]!</span>", \
"<span class='userdanger'>You accidentally hit yourself with [src]!</span>")
user.Weaken(stunforce*3)
+3 -3
View File
@@ -300,12 +300,12 @@
..()
/obj/item/twohanded/dualsaber/attack(mob/target, mob/living/user)
if(HULK in user.mutations)
if(HAS_TRAIT(user, TRAIT_HULK))
to_chat(user, "<span class='warning'>You grip the blade too hard and accidentally close it!</span>")
unwield()
return
..()
if((CLUMSY in user.mutations) && (wielded) && prob(40))
if(HAS_TRAIT(user, TRAIT_CLUMSY) && (wielded) && prob(40))
to_chat(user, "<span class='warning'>You twirl around a bit before losing your balance and impaling yourself on the [src].</span>")
user.take_organ_damage(20, 25)
return
@@ -353,7 +353,7 @@
return TRUE
/obj/item/twohanded/dualsaber/wield(mob/living/carbon/M) //Specific wield () hulk checks due to reflection chance for balance issues and switches hitsounds.
if(HULK in M.mutations)
if(HAS_TRAIT(M, TRAIT_HULK))
to_chat(M, "<span class='warning'>You lack the grace to wield this!</span>")
return
. = ..()