mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 15:45:25 +01:00
ahahahaha it finally works
This commit is contained in:
@@ -1,15 +1,9 @@
|
||||
/mob/living/carbon/hitby(atom/movable/AM)
|
||||
// if(!skip) //ugly, but easy
|
||||
// message_admins("Skip Check Passed")
|
||||
if(in_throw_mode && !get_active_hand()) //empty active hand and we're in throw mode
|
||||
// message_admins("In Throw Mode and active hand check passed")
|
||||
if(canmove && !restrained())
|
||||
// message_admins("Restrained/moving check passed")
|
||||
if(istype(AM, /obj/item))
|
||||
// message_admins("Item check passed")
|
||||
var/obj/item/I = AM
|
||||
if(isturf(I.loc))
|
||||
// message_admins("Turf check passed")
|
||||
put_in_active_hand(I)
|
||||
visible_message("<span class='warning'>[src] catches [I]!</span>")
|
||||
throw_mode_off()
|
||||
|
||||
@@ -1308,7 +1308,8 @@
|
||||
/mob/living/carbon/human/revive()
|
||||
|
||||
if(species && !(species.flags & NO_BLOOD))
|
||||
vessel.add_reagent("blood",560-vessel.total_volume)
|
||||
var/blood_reagent = species.exotic_blood ? species.exotic_blood : "blood"
|
||||
vessel.add_reagent(blood_reagent, max_blood-vessel.total_volume)
|
||||
fixblood()
|
||||
|
||||
// Fix up all organs.
|
||||
|
||||
@@ -91,12 +91,22 @@ var/const/INGEST = 2
|
||||
|
||||
return the_id
|
||||
|
||||
/datum/reagents/proc/trans_to(var/obj/target, var/amount=1, var/multiplier=1, var/preserve_data=1)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
|
||||
if (!target )
|
||||
/datum/reagents/proc/trans_to(var/target, var/amount=1, var/multiplier=1, var/preserve_data=1)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
|
||||
if (!target)
|
||||
return
|
||||
if (!target.reagents || src.total_volume<=0)
|
||||
if(src.total_volume <= 0)
|
||||
return
|
||||
var/datum/reagents/R = target.reagents
|
||||
var/datum/reagents/R
|
||||
if(istype(target, /obj))
|
||||
var/obj/O = target
|
||||
if (!O.reagents )
|
||||
return
|
||||
R = O.reagents
|
||||
else if(istype(target, /datum/reagents))
|
||||
R = target
|
||||
else
|
||||
return
|
||||
|
||||
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
|
||||
var/part = amount / src.total_volume
|
||||
var/trans_data = null
|
||||
@@ -606,6 +616,14 @@ atom/proc/create_reagents(var/max_vol)
|
||||
reagents = new/datum/reagents(max_vol)
|
||||
reagents.my_atom = src
|
||||
|
||||
/datum/reagents/proc/get_reagent_from_id(var/id)
|
||||
var/datum/reagent/result = null
|
||||
for(var/datum/reagent/R in reagent_list)
|
||||
if(R.id == id)
|
||||
result = R
|
||||
break
|
||||
return result
|
||||
|
||||
/datum/reagents/Destroy()
|
||||
. = ..()
|
||||
processing_objects.Remove(src)
|
||||
|
||||
@@ -184,16 +184,18 @@
|
||||
if(!istype(T)) return
|
||||
var/datum/reagent/blood/self = src
|
||||
src = null
|
||||
if(!(volume >= 3)) return
|
||||
var/big_splash = 1
|
||||
if(volume < 3)
|
||||
big_splash = 0
|
||||
//var/datum/disease/D = self.data["virus"]
|
||||
if(!self.data["donor"] || istype(self.data["donor"], /mob/living/carbon/human))
|
||||
blood_splatter(T, src, big_splash)
|
||||
var/obj/effect/decal/cleanable/blood/blood_prop = locate() in T //find some blood here
|
||||
if(!blood_prop) //first blood!
|
||||
blood_prop = new(T)
|
||||
blood_prop.blood_DNA[self.data["blood_DNA"]] = self.data["blood_type"]
|
||||
|
||||
if(self.data["virus2"])
|
||||
blood_prop.virus2 = virus_copylist(self.data["virus2"])
|
||||
if(blood_prop)
|
||||
blood_prop.blood_DNA[self.data["blood_DNA"]] = self.data["blood_type"]
|
||||
if(self.data["virus2"])
|
||||
blood_prop.virus2 = virus_copylist(self.data["virus2"])
|
||||
|
||||
else if(istype(self.data["donor"], /mob/living/carbon/alien))
|
||||
var/obj/effect/decal/cleanable/blood/xeno/blood_prop = locate() in T
|
||||
|
||||
@@ -16,13 +16,13 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
if(vessel)
|
||||
return
|
||||
|
||||
vessel = new/datum/reagents(600)
|
||||
vessel = new/datum/reagents(max_blood)
|
||||
vessel.my_atom = src
|
||||
|
||||
if(species && species.exotic_blood)
|
||||
vessel.add_reagent(species.exotic_blood,560)
|
||||
vessel.add_reagent(species.exotic_blood, max_blood)
|
||||
else
|
||||
vessel.add_reagent("blood",560)
|
||||
vessel.add_reagent("blood", max_blood)
|
||||
spawn(1)
|
||||
fixblood()
|
||||
|
||||
@@ -43,21 +43,19 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
if(species.exotic_blood)
|
||||
var/blood_reagent = species.exotic_blood // This is a string of the name of the species' blood reagent
|
||||
blood_volume = round(vessel.get_reagent_amount(blood_reagent))
|
||||
if(blood_volume < 560 && blood_volume)
|
||||
var/datum/reagent/R = vessel.reagent_list[blood_reagent] //Grab some blood
|
||||
if(R) // Make sure there's some blood at all
|
||||
R.volume += 0.1 // regenerate blood VERY slowly
|
||||
if (reagents.has_reagent("nutriment")) //Getting food speeds it up
|
||||
R.volume += 0.4
|
||||
reagents.remove_reagent("nutriment", 0.1)
|
||||
else if (reagents.has_reagent(blood_reagent))
|
||||
R.volume += 0.4
|
||||
reagents.remove_reagent(blood_reagent, 0.4)
|
||||
|
||||
if(blood_volume < max_blood && blood_volume)
|
||||
vessel.add_reagent(blood_reagent, 0.1) // regenerate blood VERY slowly
|
||||
if (reagents.has_reagent("nutriment")) //Getting food speeds it up
|
||||
vessel.add_reagent(blood_reagent, 0.4)
|
||||
reagents.remove_reagent("nutriment", 0.1)
|
||||
else if (reagents.has_reagent(blood_reagent))
|
||||
vessel.add_reagent(blood_reagent, 0.4)
|
||||
reagents.remove_reagent(blood_reagent, 0.4)
|
||||
|
||||
else
|
||||
blood_volume = round(vessel.get_reagent_amount("blood"))
|
||||
//Blood regeneration if there is some space
|
||||
if(blood_volume < 560 && blood_volume)
|
||||
if(blood_volume < max_blood && blood_volume)
|
||||
var/datum/reagent/blood/B = locate() in vessel.reagent_list //Grab some blood
|
||||
if(B) // Make sure there's some blood at all
|
||||
|
||||
@@ -79,16 +77,16 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
B = D
|
||||
break
|
||||
|
||||
B.volume += 0.1 // regenerate blood VERY slowly
|
||||
vessel.add_reagent("blood", 0.1) // regenerate blood VERY slowly
|
||||
if (reagents.has_reagent("nutriment")) //Getting food speeds it up
|
||||
B.volume += 0.4
|
||||
vessel.add_reagent("blood", 0.4)
|
||||
reagents.remove_reagent("nutriment", 0.1)
|
||||
if (reagents.has_reagent("iron")) //Hematogen candy anyone?
|
||||
B.volume += 0.8
|
||||
vessel.add_reagent("blood", 0.8)
|
||||
reagents.remove_reagent("iron", 0.1)
|
||||
if (reagents.has_reagent("salglu_solution")) //saline is good for blood regeneration
|
||||
if(prob(33))
|
||||
B.volume += 1.0
|
||||
vessel.add_reagent("blood", 1.0)
|
||||
|
||||
// Damaged heart virtually reduces the blood volume, as the blood isn't
|
||||
// being pumped properly anymore.
|
||||
@@ -294,7 +292,16 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
|
||||
/mob/living/carbon/human/get_blood(datum/reagents/container)
|
||||
if(species.exotic_blood)
|
||||
return container.reagent_list[species.exotic_blood]
|
||||
return container.get_reagent_from_id(species.exotic_blood)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/proc/get_blood_name()
|
||||
return "blood"
|
||||
|
||||
/mob/living/carbon/human/get_blood_name()
|
||||
if(species.exotic_blood)
|
||||
return species.exotic_blood
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -317,16 +324,15 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
return 0
|
||||
|
||||
/*
|
||||
Target: Thing to get bloody
|
||||
Target: Thing/tile to get bloody
|
||||
Source: Human or blood reagent
|
||||
Large: Whether the splat should be big or not
|
||||
*/
|
||||
/proc/blood_splatter(var/target,var/source,var/large)
|
||||
/proc/blood_splatter(var/target,var/source,var/large = 0)
|
||||
|
||||
var/obj/effect/decal/cleanable/blood/B
|
||||
var/decal_type = /obj/effect/decal/cleanable/blood/splatter
|
||||
var/turf/T = get_turf(target)
|
||||
|
||||
var/datum/reagent/blood/bld
|
||||
if(istype(source,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = source
|
||||
@@ -336,8 +342,15 @@ Large: Whether the splat should be big or not
|
||||
return
|
||||
else if(H.species.flags & NO_BLOOD)
|
||||
return
|
||||
else
|
||||
else if(istype(source, /datum/reagent))
|
||||
bld = source
|
||||
if(!istype(bld, /datum/reagent/blood))
|
||||
var/datum/reagent/R = bld
|
||||
if(istype(R))
|
||||
R.reaction_turf(T, R.volume)
|
||||
return
|
||||
else if(source)
|
||||
log_to_dd("Non-human or reagent blood source. Area: [get_area(source)], Name: [source]")
|
||||
|
||||
// Are we dripping or splattering?
|
||||
var/list/drips = list()
|
||||
|
||||
@@ -86,11 +86,11 @@ var/list/organ_cache = list()
|
||||
return
|
||||
|
||||
if(!owner)
|
||||
if(reagents)
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list
|
||||
if(B && prob(40))
|
||||
reagents.remove_reagent("blood",0.1)
|
||||
blood_splatter(src,B,1)
|
||||
if(reagents && prob(40))
|
||||
reagents.remove_any(0.1)
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
R.reaction_turf(get_turf(src), 0.1)
|
||||
|
||||
// Maybe scale it down a bit, have it REALLY kick in once past the basic infection threshold
|
||||
// Another mercy for surgeons preparing transplant organs
|
||||
germ_level++
|
||||
@@ -268,8 +268,8 @@ var/list/organ_cache = list()
|
||||
loc = get_turf(owner)
|
||||
processing_objects |= src
|
||||
var/datum/reagent/blood/organ_blood
|
||||
if(reagents) organ_blood = locate(/datum/reagent/blood) in reagents.reagent_list
|
||||
if(!organ_blood || !organ_blood.data["blood_DNA"])
|
||||
if(reagents) organ_blood = reagents.get_reagent_from_id(owner.get_blood_name())
|
||||
if((!organ_blood || !organ_blood.data["blood_DNA"]) && (owner && !(owner.species.flags & NO_BLOOD)))
|
||||
owner.vessel.trans_to(src, 5, 1, 1)
|
||||
|
||||
if(owner && vital && is_primary_organ()) // I'd do another check for species or whatever so that you couldn't "kill" an IPC by removing a human head from them, but it doesn't matter since they'll come right back from the dead
|
||||
|
||||
Reference in New Issue
Block a user