Vampires now don't get toxin damage from drinking a wrong blood type (#21776)

* normal blood works

* slime jelly

* this is now cleaner

* also this is a bit cleaner

* Hal review

* Hal review

* now slime vamps won't get double the blood
This commit is contained in:
DGamerL
2023-08-12 18:57:21 +01:00
committed by GitHub
parent a4010a9525
commit 0b5a3e692f
3 changed files with 12 additions and 4 deletions
@@ -49,7 +49,14 @@
/datum/reagent/slimejelly/on_mob_life(mob/living/M)
var/update_flags = STATUS_UPDATE_NONE
if(M.get_blood_id() != id) // no effect on slime people
var/mob/living/carbon/C = M
if(iscarbon(C) && C.mind?.has_antag_datum(/datum/antagonist/vampire))
M.set_nutrition(min(NUTRITION_LEVEL_WELL_FED, M.nutrition + 10))
if(M.get_blood_id() != id)
M.blood_volume = min(M.blood_volume + REAGENTS_METABOLISM, BLOOD_VOLUME_NORMAL)
return ..() | update_flags
if(M.get_blood_id() != id)
if(prob(10))
to_chat(M, "<span class='danger'>Your insides are burning!</span>")
update_flags |= M.adjustToxLoss(rand(2, 6) * REAGENTS_EFFECT_MULTIPLIER, FALSE) // avg 0.4 toxin per cycle, not unreasonable
@@ -68,7 +75,6 @@
B.basecolor = color
B.update_icon()
/datum/reagent/slimetoxin
name = "Mutation Toxin"
id = "mutationtoxin"
@@ -103,7 +103,7 @@
taste_description = "<span class='warning'>blood</span>"
taste_mult = 1.3
/datum/reagent/blood/reaction_mob(mob/living/M, method=REAGENT_TOUCH, volume)
/datum/reagent/blood/reaction_mob(mob/living/M, method = REAGENT_TOUCH, volume)
if(data && data["viruses"])
for(var/thing in data["viruses"])
var/datum/disease/D = thing
@@ -120,6 +120,7 @@
var/mob/living/carbon/C = M
if(C.mind?.has_antag_datum(/datum/antagonist/vampire))
C.set_nutrition(min(NUTRITION_LEVEL_WELL_FED, C.nutrition + 10))
C.blood_volume = min(C.blood_volume + round(volume, 0.1), BLOOD_VOLUME_NORMAL)
..()
/datum/reagent/blood/on_new(list/data)
@@ -72,8 +72,9 @@
if(can_become_addicted)
if(is_type_in_list(src, M.reagents.addiction_list))
to_chat(M, "<span class='notice'>You feel slightly better, but for how long?</span>") //sate_addiction handles this now, but kept this for the feed back.
var/mob/living/carbon/C = M
if(C.mind?.has_antag_datum(/datum/antagonist/vampire))
return
if(method == REAGENT_INGEST && istype(C) && C.get_blood_id() == id)
if(id == "blood" && !(data?["blood_type"] in get_safe_blood(C.dna?.blood_type)) || C.dna?.species.name != data?["species"] && (data?["species_only"] || C.dna?.species.own_species_blood))
C.reagents.add_reagent("toxin", volume * 0.5)