Merge pull request #4188 from Fox-McCloud/diona-refactor

Diona Species Behavior Handling Refactor
This commit is contained in:
TheDZD
2016-04-14 19:17:17 -04:00
4 changed files with 38 additions and 70 deletions
+4 -38
View File
@@ -192,26 +192,15 @@
if (radiation > 100)
radiation = 100
if(!(species.flags & RAD_ABSORB))
Weaken(10)
if(!lying)
to_chat(src, "<span class='alert'>You feel weak.</span>")
emote("collapse")
Weaken(10)
if(!lying)
to_chat(src, "<span class='alert'>You feel weak.</span>")
emote("collapse")
if (radiation < 0)
radiation = 0
else
if(species.flags & RAD_ABSORB)
var/rads = radiation/25
radiation -= rads
nutrition += rads
adjustBruteLoss(-(rads))
adjustOxyLoss(-(rads))
adjustToxLoss(-(rads))
updatehealth()
return
var/damage = 0
switch(radiation)
if(0 to 49)
@@ -676,24 +665,6 @@
if(status_flags & GODMODE)
return 0 //godmode
if(species.flags & REQUIRE_LIGHT)
var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing
if(isturf(loc)) //else, there's considered to be no light
var/turf/T = loc
light_amount = min(T.get_lumcount()*10, 5) //hardcapped so it's not abused by having a ton of flashlights
nutrition += light_amount
traumatic_shock -= light_amount
if(species.flags & IS_PLANT)
if(nutrition > 450)
nutrition = 450
if((light_amount >= 5) && !suiciding) //if there's enough light, heal
adjustBruteLoss(-(light_amount/2))
adjustFireLoss(-(light_amount/4))
//adjustToxLoss(-(light_amount))
adjustOxyLoss(-(light_amount))
//TODO: heal wounds, heal broken limbs.
//The fucking FAT mutation is the greatest shit ever. It makes everyone so hot and bothered.
if(species.flags & CAN_BE_FAT)
if(FAT in mutations)
@@ -728,11 +699,6 @@
else
overeatduration -= 2
if(species.flags & REQUIRE_LIGHT)
if(nutrition < 200)
take_overall_damage(10,0)
traumatic_shock++
if (drowsyness)
drowsyness--
eye_blurry = max(2, eye_blurry)
@@ -622,7 +622,7 @@
even the simplest concepts of other minds. Their alien physiology allows them survive happily off a diet of nothing but light, \
water and other radiation."
flags = NO_BREATHE | REQUIRE_LIGHT | IS_PLANT | RAD_ABSORB | NO_BLOOD | NO_PAIN
flags = NO_BREATHE | RADIMMUNE | IS_PLANT | NO_BLOOD | NO_PAIN
clothing_flags = HAS_SOCKS
dietflags = 0 //Diona regenerate nutrition in light, no diet necessary
@@ -672,23 +672,32 @@
return ..()
/* //overpowered and dumb as hell; they get cloning back, though.
/datum/species/diona/handle_death(var/mob/living/carbon/human/H)
/datum/species/diona/handle_life(var/mob/living/carbon/human/H)
var/rads = H.radiation/25
H.radiation = Clamp(H.radiation - rads, 0, 100)
H.nutrition += rads
H.adjustBruteLoss(-(rads))
H.adjustOxyLoss(-(rads))
H.adjustToxLoss(-(rads))
var/mob/living/simple_animal/diona/S = new(get_turf(H))
var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing
if(isturf(H.loc)) //else, there's considered to be no light
var/turf/T = H.loc
light_amount = min(T.get_lumcount()*10, 5) //hardcapped so it's not abused by having a ton of flashlights
H.nutrition += light_amount
H.traumatic_shock -= light_amount
if(H.mind)
H.mind.transfer_to(S)
else
S.key = H.key
if(H.nutrition > 450)
H.nutrition = 450
for(var/mob/living/simple_animal/diona/D in H.contents)
if(D.client)
D.loc = H.loc
else
qdel(D)
if((light_amount >= 5) && !H.suiciding) //if there's enough light, heal
H.adjustBruteLoss(-(light_amount/2))
H.adjustFireLoss(-(light_amount/4))
H.adjustOxyLoss(-(light_amount))
H.visible_message("<span class='danger">[H] splits apart with a wet slithering noise!"</span>) */
if(H.nutrition < 200)
H.take_overall_damage(10,0)
H.traumatic_shock++
/datum/species/machine
name = "Machine"
-5
View File
@@ -72,11 +72,6 @@
updatehealth()
return 1
/mob/living/carbon/human/apply_effect(var/effect = 0, var/effecttype = STUN, var/blocked = 0, var/negate_armor = 0)
if((effecttype == IRRADIATE) && (species.flags & RADIMMUNE))
return 0
return ..()
/mob/living/proc/apply_effects(var/stun = 0, var/weaken = 0, var/paralyze = 0, var/irradiate = 0, var/slur = 0, var/stutter = 0, var/eyeblur = 0, var/drowsy = 0, var/blocked = 0, var/stamina = 0, var/jitter = 0)
if(blocked >= 100) return 0
if(stun) apply_effect(stun, STUN, blocked)