Reaction_Mob Checks and Golem Reagent Processing Change

Reaction_mob(), which handles things like TOUCH based reactions, now
will properly obey process_flags.
- This means things like Synthflesh won't work on Synthetics.

Changed Golems from PROCESS_DUO to PROCESS_ORG
- This will give them back the ability to be healed via chemistry, since
they don't naturally regenerate.
- PROCESS_DUO remains defined in case someone finds a use for it
(adminbuse maybe?)
This commit is contained in:
FalseIncarnate
2015-06-23 18:06:54 -04:00
parent fc6ebc4854
commit f3c9098ecd
2 changed files with 32 additions and 3 deletions
@@ -7,7 +7,7 @@
default_language = "Galactic Common"
flags = NO_BREATHE | NO_PAIN | NO_BLOOD | NO_SCAN
dietflags = DIET_OMNI //golems can eat anything because they are magic or something
reagent_tag = PROCESS_DUO //golems only process a select few chems like acid and hellwater because magic?
reagent_tag = PROCESS_ORG
blood_color = "#515573"
flesh_color = "#137E8F"
+31 -2
View File
@@ -404,6 +404,27 @@ datum
del_reagent(R.id)
return 0
reaction_check(var/mob/M, var/datum/reagent/R)
var/can_process = 0
if(!istype(M, /mob/living)) //Non-living mobs can't metabolize reagents, so don't bother trying (runtime safety check)
return can_process
if(ishuman(M))
var/mob/living/carbon/human/H = M
//Check if this mob's species is set and can process this type of reagent
if(H.species && H.species.reagent_tag)
if((R.process_flags & SYNTHETIC) && (H.species.reagent_tag & PROCESS_SYN)) //SYNTHETIC-oriented reagents require PROCESS_SYN
can_process = 1
if((R.process_flags & ORGANIC) && (H.species.reagent_tag & PROCESS_ORG)) //ORGANIC-oriented reagents require PROCESS_ORG
can_process = 1
//Species with PROCESS_DUO are only affected by reagents that affect both organics and synthetics, like acid and hellwater
if((R.process_flags & ORGANIC) && (R.process_flags & SYNTHETIC) && (H.species.reagent_tag & PROCESS_DUO))
can_process = 1
//We'll assume that non-human mobs lack the ability to process synthetic-oriented reagents (adjust this if we need to change that assumption)
else
if(R.process_flags != SYNTHETIC)
can_process = 1
return can_process
reaction(var/atom/A, var/method=TOUCH, var/volume_modifier=0)
switch(method)
@@ -412,7 +433,11 @@ datum
if(ismob(A))
spawn(0)
if(!R) return
else R.reaction_mob(A, TOUCH, R.volume+volume_modifier)
var/check = reaction_check(A, R)
if(!check)
continue
else
R.reaction_mob(A, TOUCH, R.volume+volume_modifier)
if(isturf(A))
spawn(0)
if(!R) return
@@ -426,7 +451,11 @@ datum
if(ismob(A) && R)
spawn(0)
if(!R) return
else R.reaction_mob(A, INGEST, R.volume+volume_modifier)
var/check = reaction_check(A, R)
if(!check)
continue
else
R.reaction_mob(A, INGEST, R.volume+volume_modifier)
if(isturf(A) && R)
spawn(0)
if(!R) return