Merge pull request #3101 from VOREStation/aro-xen

[Pls Review] Xenochimera Cleanup
This commit is contained in:
Spades
2018-04-28 10:48:19 -04:00
committed by GitHub
6 changed files with 331 additions and 240 deletions

View File

@@ -20,6 +20,11 @@
#define STARTING_SPECIES_POINTS 1 #define STARTING_SPECIES_POINTS 1
#define MAX_SPECIES_TRAITS 5 #define MAX_SPECIES_TRAITS 5
// Xenochimera thing mostly
#define REVIVING_NOW 1
#define REVIVING_DONE 2
#define REVIVING_COOLDOWN 3
// Resleeving Mind Record Status // Resleeving Mind Record Status
#define MR_NORMAL 0 #define MR_NORMAL 0
#define MR_UNSURE 1 #define MR_UNSURE 1

View File

@@ -1467,11 +1467,21 @@ var/mob/dview/dview_mob = new
if(337.5) if(337.5)
return "North-Northwest" return "North-Northwest"
//This is used to force compiletime errors if you incorrectly supply variable names. Crafty!
#define NAMEOF(datum, X) (#X || ##datum.##X)
//Creates a callback with the specific purpose of setting a variable
#define VARSET_CALLBACK(datum, var, var_value) CALLBACK(GLOBAL_PROC, /proc/___callbackvarset, weakref(##datum), NAMEOF(##datum, ##var), ##var_value)
//Helper for the above
/proc/___callbackvarset(list_or_datum, var_name, var_value)
if(isweakref(list_or_datum))
var/weakref/wr = list_or_datum
list_or_datum = wr.resolve()
if(!list_or_datum)
return
if(length(list_or_datum))
list_or_datum[var_name] = var_value
return
var/datum/D = list_or_datum
D.vars[var_name] = var_value

View File

@@ -58,6 +58,9 @@
/proc/schedule_task_in(var/in_time, var/procedure, var/list/arguments = list()) /proc/schedule_task_in(var/in_time, var/procedure, var/list/arguments = list())
return schedule_task(world.time + in_time, procedure, arguments) return schedule_task(world.time + in_time, procedure, arguments)
/proc/schedule_callback_in(var/in_time, var/datum/callback)
return schedule_callback(world.time + in_time, callback)
/proc/schedule_task_with_source_in(var/in_time, var/source, var/procedure, var/list/arguments = list()) /proc/schedule_task_with_source_in(var/in_time, var/source, var/procedure, var/list/arguments = list())
return schedule_task_with_source(world.time + in_time, source, procedure, arguments) return schedule_task_with_source(world.time + in_time, source, procedure, arguments)
@@ -66,6 +69,11 @@
scheduler.schedule(st) scheduler.schedule(st)
return st return st
/proc/schedule_callback(var/trigger_time, var/datum/callback)
var/datum/scheduled_task/callback/st = new/datum/scheduled_task/callback(trigger_time, callback, /proc/destroy_scheduled_task, list())
scheduler.schedule(st)
return st
/proc/schedule_task_with_source(var/trigger_time, var/source, var/procedure, var/list/arguments) /proc/schedule_task_with_source(var/trigger_time, var/source, var/procedure, var/list/arguments)
var/datum/scheduled_task/st = new/datum/scheduled_task/source(trigger_time, source, procedure, arguments, /proc/destroy_scheduled_task, list()) var/datum/scheduled_task/st = new/datum/scheduled_task/source(trigger_time, source, procedure, arguments, /proc/destroy_scheduled_task, list())
scheduler.schedule(st) scheduler.schedule(st)
@@ -125,6 +133,15 @@
/datum/scheduled_task/proc/trigger_task_in(var/trigger_in) /datum/scheduled_task/proc/trigger_task_in(var/trigger_in)
src.trigger_time = world.time + trigger_in src.trigger_time = world.time + trigger_in
/datum/scheduled_task/callback
var/datum/callback/callback
/datum/scheduled_task/callback/New(var/trigger_time, var/datum/callback, var/proc/task_after_process, var/list/task_after_process_args)
..(trigger_time = trigger_time, task_after_process = task_after_process, task_after_process_args = task_after_process_args)
/datum/scheduled_task/callback/process()
callback.Invoke()
/datum/scheduled_task/source /datum/scheduled_task/source
var/datum/source var/datum/source

View File

@@ -1,137 +1,147 @@
/mob/living/carbon/human/proc/begin_reconstitute_form() //Scree's race ability.in exchange for: No cloning. /mob/living/carbon/human/proc/reconstitute_form() //Scree's race ability.in exchange for: No cloning.
set name = "Reconstitute Form" set name = "Reconstitute Form"
set category = "Abilities" set category = "Abilities"
if(world.time < last_special) // Sanity is mostly handled in chimera_regenerate()
return
last_special = world.time + 50 //To prevent button spam.
var/confirm = alert(usr, "Are you sure you want to completely reconstruct your form? This process can take up to twenty minutes, depending on how hungry you are, and you will be unable to move.", "Confirm Regeneration", "Yes", "No") var/confirm = alert(usr, "Are you sure you want to completely reconstruct your form? This process can take up to twenty minutes, depending on how hungry you are, and you will be unable to move.", "Confirm Regeneration", "Yes", "No")
if(confirm == "Yes") if(confirm == "Yes")
chimera_regenerate() chimera_regenerate()
/mob/living/carbon/human/proc/chimera_regenerate() /mob/living/carbon/human/proc/chimera_regenerate()
var/nutrition_used = nutrition/2 //If they're already regenerating
switch(reviving)
if(reviving == TRUE) //If they're already unable to if(REVIVING_NOW)
to_chat(src, "You are already reconstructing, or your body is currently recovering from the intense process of your previous reconstitution.") to_chat(src, "You are already reconstructing, just wait for the reconstruction to finish!")
return return
if(REVIVING_DONE)
if(stat == DEAD) //Uh oh, you died! to_chat(src, "Your reconstruction is done, but you need to hatch now.")
if(hasnutriment()) //Let's hope you have nutriment in you.... If not return
var/time = (240+960/(1 + nutrition_used/75)) if(REVIVING_COOLDOWN)
reviving = TRUE to_chat(src, "You can't use that ability again so soon!")
to_chat(src, "You begin to reconstruct your form. You will not be able to move during this time. It should take aproximately [round(time)] seconds.")
//don't need all the weakened, does_not_breathe, canmove, heal IB crap here like you do for live ones'cause they're DEAD.
spawn(time SECONDS)
if(src) //Runtime prevention.
if (stat == DEAD) // let's make sure they've not been defibbed or whatever
to_chat(src, "<span class='notice'>Consciousness begins to stir as your new body awakens, ready to hatch.</span>")
verbs += /mob/living/carbon/human/proc/hatch
return
else // their revive got aborted by being made not-dead. Remove their cooldown.
to_chat(src, "<span class='notice'>Your body has recovered from its ordeal, ready to regenerate itself again.</span>")
reviving = FALSE
return
else
return //Something went wrong.
else //Dead until nutrition injected.
to_chat(src, "Your body is too damaged to regenerate without additional nutrients to feed what few living cells remain.")
return return
else if(stat != DEAD) //If they're alive at the time of regenerating. var/nutrition_used = nutrition * 0.5
var/time = (240+960/(1 + nutrition_used/75)) var/time = (240+960/(1 + nutrition_used/75))
weakened = 10000 //Since it takes 1 tick to lose one weaken. Due to prior rounding errors, you'd sometimes unweaken before regenning. This fixes that.
reviving = TRUE
canmove = 0 //Make them unable to move. In case they somehow get up before the delay.
to_chat(src, "You begin to reconstruct your form. You will not be able to move during this time. It should take aproximately [round(time)] seconds.")
does_not_breathe = 1 //effectively makes them spaceworthy while regenning
spawn(time SECONDS) //Clicked regen while dead.
if(stat != DEAD) //If they're still alive after regenning. if(stat == DEAD)
to_chat(src, "<span class='notice'>Consciousness begins to stir as your new body awakens, ready to hatch..</span>")
verbs += /mob/living/carbon/human/proc/hatch //Has nutrition and dead, allow regen.
return if(hasnutriment())
else if(stat == DEAD) to_chat(src, "You begin to reconstruct your form. You will not be able to move during this time. It should take aproximately [round(time)] seconds.")
if(hasnutriment()) //Let's hope you have nutriment in you.... If not
to_chat(src, "<span class='notice'>Consciousness begins to stir as your new body awakens, ready to hatch..</span>") //Scary spawnerization.
verbs += /mob/living/carbon/human/proc/hatch reviving = REVIVING_NOW
return spawn(time SECONDS)
else //Dead until nutrition injected. // Was dead, now not dead.
to_chat(src, "Your body was unable to regenerate, what few living cells remain require additional nutrients to complete the process.") if(stat != DEAD)
reviving = FALSE // so they can try again when they're given a kickstart to_chat(src, "<span class='notice'>Your body has recovered from its ordeal, ready to regenerate itself again.</span>")
return reviving = 0 //Not bool
else
return //Something went wrong // Was dead, still dead.
else
to_chat(src, "<span class='notice'>Consciousness begins to stir as your new body awakens, ready to hatch.</span>")
verbs |= /mob/living/carbon/human/proc/hatch
//Dead until nutrition injected.
else
to_chat(src, "<span class='warning'>Your body is too damaged to regenerate without additional nutrients to feed what few living cells remain.</span>")
//Clicked regen while NOT dead
else else
return //Something went wrong to_chat(src, "You begin to reconstruct your form. You will not be able to move during this time. It should take aproximately [round(time)] seconds.")
//Waiting for regen after being alive
reviving = REVIVING_NOW
spawn(time SECONDS)
//If they're still alive after regenning.
if(stat != DEAD)
to_chat(src, "<span class='notice'>Consciousness begins to stir as your new body awakens, ready to hatch..</span>")
verbs |= /mob/living/carbon/human/proc/hatch
//Was alive, now dead
else if(hasnutriment())
to_chat(src, "<span class='notice'>Consciousness begins to stir as your new body awakens, ready to hatch..</span>")
verbs |= /mob/living/carbon/human/proc/hatch
//Dead until nutrition injected.
else
to_chat(src, "<span class='warning'>Your body was unable to regenerate, what few living cells remain require additional nutrients to complete the process.</span>")
reviving = 0 //Not boolean
/mob/living/carbon/human/proc/hasnutriment() /mob/living/carbon/human/proc/hasnutriment()
if (bloodstr.has_reagent("nutriment", 30) || src.bloodstr.has_reagent("protein", 15)) //protein needs half as much. For reference, a steak contains 9u protein. if (bloodstr.has_reagent("nutriment", 30) || src.bloodstr.has_reagent("protein", 15)) //protein needs half as much. For reference, a steak contains 9u protein.
return 1 return TRUE
else if (ingested.has_reagent("nutriment", 60) || src.ingested.has_reagent("protein", 30)) //try forcefeeding them, why not. Less effective. else if (ingested.has_reagent("nutriment", 60) || src.ingested.has_reagent("protein", 30)) //try forcefeeding them, why not. Less effective.
return 1 return TRUE
else return 0 else return FALSE
/mob/living/carbon/human/proc/hatch() /mob/living/carbon/human/proc/hatch()
set name = "Hatch" set name = "Hatch"
set category = "Abilities" set category = "Abilities"
if(world.time < last_special) if(reviving != REVIVING_DONE)
//Hwhat?
verbs -= /mob/living/carbon/human/proc/hatch
return return
last_special = world.time + 50 //To prevent button spam.
var/confirm = alert(usr, "Are you sure you want to hatch right now? This will be very obvious to anyone in view.", "Confirm Regeneration", "Yes", "No") var/confirm = alert(usr, "Are you sure you want to hatch right now? This will be very obvious to anyone in view.", "Confirm Regeneration", "Yes", "No")
if(confirm == "Yes") if(confirm == "Yes")
if(stat == DEAD) //Uh oh, you died!
if(hasnutriment()) //Let's hope you have nutriment in you.... If not //Dead when hatching
if(src) //Runtime prevention. if(stat == DEAD)
chimera_hatch() //Check again for nutriment (necessary?)
visible_message("<span class='danger'><p><font size=4>The lifeless husk of [src] bursts open, revealing a new, intact copy in the pool of viscera.</font></p></span>") //Bloody hell... if(hasnutriment())
brainloss += 10 //Reviving from dead means you take a lil' brainloss on top of whatever was healed in the revive. chimera_hatch()
return visible_message("<span class='danger'><p><font size=4>The lifeless husk of [src] bursts open, revealing a new, intact copy in the pool of viscera.</font></p></span>") //Bloody hell...
else
return //Runtime prevention
else //don't have nutriment to hatch! Or you somehow died in between completing your revive and hitting hatch.
to_chat(src, "Your body was unable to regenerate, what few living cells remain require additional nutrients to complete the process.")
reviving = FALSE // so they can try again when they're given a kickstart
return return
else if(stat != DEAD) //If they're alive at the time of regenerating. //Don't have nutriment to hatch! Or you somehow died in between completing your revive and hitting hatch.
else
to_chat(src, "Your body was unable to regenerate, what few living cells remain require additional nutrients to complete the process.")
verbs -= /mob/living/carbon/human/proc/hatch
reviving = 0 //So they can try again when they're given a kickstart
//Alive when hatching
else
chimera_hatch() chimera_hatch()
visible_message("<span class='danger'><p><font size=4>The dormant husk of [src] bursts open, revealing a new, intact copy in the pool of viscera.</font></p></span>") //Bloody hell... visible_message("<span class='danger'><p><font size=4>The dormant husk of [src] bursts open, revealing a new, intact copy in the pool of viscera.</font></p></span>") //Bloody hell...
return
else
return //Runtime prevention.
/mob/living/carbon/human/proc/chimera_hatch() /mob/living/carbon/human/proc/chimera_hatch()
nutrition -= nutrition/2 //Cut their nutrition in half. verbs -= /mob/living/carbon/human/proc/hatch
var/old_nutrition = nutrition //Since the game is being annoying.
to_chat(src, "<span class='notice'>Your new body awakens, bursting free from your old skin.</span>") to_chat(src, "<span class='notice'>Your new body awakens, bursting free from your old skin.</span>")
var/T = get_turf(src)
new /obj/effect/gibspawner/human/scree(T) //Modify and record values (half nutrition and braindamage)
var/braindamage = brainloss/2 //If you have 100 brainloss, it gives you 50. var/old_nutrition = nutrition * 0.5
does_not_breathe = 0 //start breathing again var/braindamage = (brainloss * 0.5) + 10 //A little damage from the process.
revive() // I did have special snowflake code, but this is easier.
weakened = 2 //Not going to let you get up immediately. 2 ticks before you get up. Overrides the above 10000 weaken. //I did have special snowflake code, but this is easier.
revive()
mutations.Remove(HUSK) mutations.Remove(HUSK)
nutrition = old_nutrition nutrition = old_nutrition
brainloss = braindamage //Gives them half their prior brain damage. setBrainLoss(braindamage)
update_canmove()
//Drop everything
for(var/obj/item/W in src) for(var/obj/item/W in src)
drop_from_inventory(W) drop_from_inventory(W)
spawn(3600 SECONDS) //1 hour wait until you can revive.
reviving = FALSE
to_chat(src, "Your body has recovered from the strenuous effort of rebuilding itself.")
verbs -= /mob/living/carbon/human/proc/hatch
return
/obj/effect/gibspawner/human/scree //Unfreeze some things
fleshcolor = "#14AD8B" //Scree blood. does_not_breathe = FALSE
update_canmove()
weakened = 2
//Visual effects
var/T = get_turf(src)
new /obj/effect/gibspawner/human/xenochimera(T)
reviving = REVIVING_COOLDOWN
schedule_callback_in(1 HOUR, VARSET_CALLBACK(src, reviving, 0))
/obj/effect/gibspawner/human/xenochimera
fleshcolor = "#14AD8B"
bloodcolor = "#14AD8B" bloodcolor = "#14AD8B"
/mob/living/carbon/human/proc/getlightlevel() //easier than having the same code in like three places /mob/living/carbon/human/proc/getlightlevel() //easier than having the same code in like three places
@@ -141,7 +151,7 @@
else return 0 else return 0
/mob/living/carbon/human/proc/handle_feral() /mob/living/carbon/human/proc/handle_feral()
if(handling_hal) return //avoid conflict with actual hallucinations if(handling_hal) return
handling_hal = 1 handling_hal = 1
if(client && feral >= 10) // largely a copy of handle_hallucinations() without the fake attackers. Unlike hallucinations, only fires once - if they're still feral they'll get hit again anyway. if(client && feral >= 10) // largely a copy of handle_hallucinations() without the fake attackers. Unlike hallucinations, only fires once - if they're still feral they'll get hit again anyway.

View File

@@ -22,7 +22,7 @@
tail = "tail" //Scree's tail. Can be disabled in the vore tab by choosing "hide species specific tail sprite" tail = "tail" //Scree's tail. Can be disabled in the vore tab by choosing "hide species specific tail sprite"
icobase_tail = 1 icobase_tail = 1
inherent_verbs = list( inherent_verbs = list(
/mob/living/carbon/human/proc/begin_reconstitute_form, /mob/living/carbon/human/proc/reconstitute_form,
/mob/living/carbon/human/proc/sonar_ping, /mob/living/carbon/human/proc/sonar_ping,
/mob/living/carbon/human/proc/succubus_drain, /mob/living/carbon/human/proc/succubus_drain,
/mob/living/carbon/human/proc/succubus_drain_finalize, /mob/living/carbon/human/proc/succubus_drain_finalize,
@@ -40,9 +40,9 @@
Most, if not all chimeras possess the ability to undergo some type of regeneration process, at the cost of energy." Most, if not all chimeras possess the ability to undergo some type of regeneration process, at the cost of energy."
hazard_low_pressure = -1 //Prevents them from dying normally in space. Special code handled below. hazard_low_pressure = -1 //Prevents them from dying normally in space. Special code handled below.
cold_level_1 = -5000 // All cold debuffs are handled below in handle_environment_special cold_level_1 = -1 // All cold debuffs are handled below in handle_environment_special
cold_level_2 = -5000 cold_level_2 = -1
cold_level_3 = -5000 cold_level_3 = -1
//primitive_form = "Farwa" //primitive_form = "Farwa"
@@ -56,142 +56,198 @@
/datum/species/xenochimera/handle_environment_special(var/mob/living/carbon/human/H) /datum/species/xenochimera/handle_environment_special(var/mob/living/carbon/human/H)
if(H.stat == 2) // If they're dead they won't think about being all feral and won't need all the code below. //If they're KO'd/dead, they're probably not thinking a lot about much of anything.
return if(!H.stat)
handle_feralness(H)
//handle feral triggers //While regenerating
if(H.reviving && H.reviving != REVIVING_COOLDOWN)
if(H.nutrition <= 200||H.traumatic_shock > min(60, H.nutrition/10)) // Stress factors are in play H.weakened = 5
// If they're hungry, give nag messages. H.canmove = 0
if (!istype(H.loc, /mob)) // if they're in a mob, skip the hunger stuff so it doesn't mess with drain/absorption modes. H.does_not_breathe = TRUE
if(H.nutrition < 200 && H.nutrition > 150)
if(prob(0.5)) //A bit of an issue, not too bad.
H << "<span class='info'>You feel rather hungry. It might be a good idea to find some some food...</span>"
else if(H.nutrition <= 150 && H.nutrition > 100)
if(prob(0.5)) //Getting closer, should probably eat some food about now...
H << "<span class='warning'>You feel like you're going to snap and give in to your hunger soon... It would be for the best to find some [pick("food","prey")] to eat...</span>"
else if(H.nutrition <= 100) //Should've eaten sooner!
if(H.feral == 0)
H << "<span class='danger'><big>Something in your mind flips, your instincts taking over, no longer able to fully comprehend your surroundings as survival becomes your primary concern - you must feed, survive, there is nothing else. Hunt. Eat. Hide. Repeat.</big></span>"
log_and_message_admins("has gone feral due to hunger.", H)
H.feral += 5 //just put them over the threshold by a decent amount for the first chunk.
if(H.stat == CONSCIOUS)
H.emote("twitch")
if(H.feral + H.nutrition < 150) //Feralness increases while this hungry, capped at 50-150 depending on hunger.
H.feral += 1
// If they're hurt, chance of snapping. Not if they're straight-up KO'd though.
if (H.stat == CONSCIOUS && H.traumatic_shock >=min(60, H.nutrition/10)) //at 360 nutrition, this is 30 brute/burn, or 18 halloss. Capped at 50 brute/30 halloss - if they take THAT much, no amount of satiation will help them. Also they're fat.
if (2.5*H.halloss >= H.traumatic_shock) //If the majority of their shock is due to halloss, greater chance of snapping.
if(prob(min(10,(0.2 * H.traumatic_shock))))
if(H.feral == 0)
H << "<span class='danger'><big>The pain! It stings! Got to get away! Your instincts take over, urging you to flee, to hide, to go to ground, get away from here...</big></span>"
log_and_message_admins("has gone feral due to halloss.", H)
H.feral = max(H.feral, H.halloss) //if already more feral than their halloss justifies, don't increase it.
H.emote("twitch")
else if(prob(min(10,(0.1 * H.traumatic_shock))))
H.emote("twitch")
if(H.feral == 0)
H << "<span class='danger'><big>Your fight-or-flight response kicks in, your injuries too much to simply ignore - you need to flee, to hide, survive at all costs - or destroy whatever is threatening you.</big></span>"
H.feral = 2*H.traumatic_shock //Make 'em snap.
log_and_message_admins("has gone feral due to injury.", H)
else
H.feral = max(H.feral, H.traumatic_shock * 2) //keep feralness up to match the current injury state.
else if (H.jitteriness >= 100) //No stress factors, but there's coffee. Keeps them mildly feral while they're all jittery.
if(H.feral == 0)
H << "<span class='warning'><big>Suddenly, something flips - everything that moves is... potential prey. A plaything. This is great! Time to hunt!</big></span>"
log_and_message_admins("has gone feral due to jitteriness.", H)
if(H.stat == CONSCIOUS)
H.emote("twitch")
H.feral = max(H.feral, H.jitteriness-100) //they'll be twitchy and pouncy while they're under the influence, and feralness won't wear off until they're calm.
//Cold/pressure effects when not regenerating
else else
if (H.feral > 0) //still feral, but all stress factors are gone. Calm them down. var/datum/gas_mixture/environment = H.loc.return_air()
H.feral -= 1 var/pressure2 = environment.return_pressure()
if (H.feral <=0) //check if they're unferalled var/adjusted_pressure2 = H.calculate_affecting_pressure(pressure2)
H.feral = 0
H << "<span class='info'>Your thoughts start clearing, your feral urges having passed - for the time being, at least.</span>"
log_and_message_admins("is no longer feral.", H)
// handle what happens while feral //Very low pressure damage
if(adjusted_pressure2 <= 20)
H.take_overall_damage(brute=LOW_PRESSURE_DAMAGE, used_weapon = "Low Pressure")
if(H.feral > 0) //do the following if feral, otherwise no effects. //Cold hurts and gives them pain messages, eventually weakening and paralysing, but doesn't damage or trigger feral.
var/light_amount = H.getlightlevel() //how much light there is in the place //NB: 'body_temperature' used here is the 'setpoint' species var
var/temp_diff = body_temperature - H.bodytemperature
if(temp_diff >= 50)
H.shock_stage = min(H.shock_stage + (temp_diff/20), 160) // Divided by 20 is the same as previous numbers, but a full scale
H.eye_blurry = max(5,H.eye_blurry)
H.shock_stage = max(H.shock_stage-(H.feral/20), 0) //if they lose enough health to hit softcrit, handle_shock() will keep resetting this. Otherwise, pissed off critters will lose shock faster than they gain it.
if(light_amount <= 0.5) // in the darkness. No need for custom scene-protection checks as it's just an occational infomessage. /datum/species/xenochimera/proc/handle_feralness(var/mob/living/carbon/human/H)
if(prob(2)) //periodic nagmessages just to remind 'em they're still feral
if (H.traumatic_shock >=min(60, H.nutrition/10)) // if hurt, tell 'em to heal up //Low-ish nutrition has messages and eventually feral
H << "<span class='info'> This place seems safe, secure, hidden, a place to lick your wounds and recover...</span>" var/hungry = H.nutrition <= 200
else if(H.nutrition <= 100) //If hungry, nag them to go and find someone or something to eat.
H << "<span class='info'> Secure in your hiding place, your hunger still gnaws at you. You need to catch some food...</span>" //At 360 nutrition, this is 30 brute/burn, or 18 halloss. Capped at 50 brute/30 halloss - if they take THAT much, no amount of satiation will help them. Also they're fat.
else if(H.jitteriness >= 100) var/shock = H.traumatic_shock > min(60, H.nutrition/10)
H << "<span class='info'> sneakysneakyyesyesyescleverhidingfindthingsyessssss</span>"
else //otherwise, just tell them to keep hiding. //Caffeinated xenochimera can become feral and have special messages
H << "<span class='info'> ...safe...</span>" var/jittery = H.jitteriness >= 100
else // must be in a lit area
var/list/nearby = oviewers(H) //To reduce distant object references
if (nearby.len) // someone's nearby var/feral = H.feral
if(prob(1)) // 1 in 100 chance of doing something so as not to interrupt scenes
var/mob/M = pick(nearby) //Handle feral triggers and pre-feral messages
if (H.traumatic_shock >=min(60, H.nutrition/10)) //tell 'em to be wary of a random person if(!feral && (hungry || shock || jittery))
H << "<span class='danger'> You're hurt, in danger, exposed, and [M] looks to be a little too close for comfort...</span>"
else if(H.nutrition <= 250 || H.jitteriness > 0) //tell them a random person in view looks like food. It CAN happen when you're not hungry enough to be feral, especially if coffee is involved. // If they're hungry, give nag messages (when not bellied)
H << "<span class='danger'> Every movement, every flick, every sight and sound has your full attention, your hunting instincts on high alert... In fact, [M] looks extremely appetizing...</span>" if(H.nutrition >= 100 && prob(0.5) && !ismob(H.loc))
if(H.stat == CONSCIOUS) switch(H.nutrition)
if(150 to 200)
to_chat(H,"<span class='info'>You feel rather hungry. It might be a good idea to find some some food...</span>")
if(100 to 150)
to_chat(H,"<span class='warning'>You feel like you're going to snap and give in to your hunger soon... It would be for the best to find some [pick("food","prey")] to eat...</span>")
// Going feral due to hunger
else if(H.nutrition < 100)
to_chat(H,"<span class='danger'><big>Something in your mind flips, your instincts taking over, no longer able to fully comprehend your surroundings as survival becomes your primary concern - you must feed, survive, there is nothing else. Hunt. Eat. Hide. Repeat.</big></span>")
log_and_message_admins("has gone feral due to hunger.", H)
feral = 5
if(!H.stat)
H.emote("twitch")
// If they're hurt, chance of snapping.
else if(shock)
//If the majority of their shock is due to halloss, greater chance of snapping.
if(2.5*H.halloss >= H.traumatic_shock)
if(prob(min(10,(0.2 * H.traumatic_shock))))
to_chat(H,"<span class='danger'><big>The pain! It stings! Got to get away! Your instincts take over, urging you to flee, to hide, to go to ground, get away from here...</big></span>")
log_and_message_admins("has gone feral due to halloss.", H)
feral = 5
if(!H.stat)
H.emote("twitch") H.emote("twitch")
//Majority due to other damage sources
else if(prob(min(10,(0.1 * H.traumatic_shock))))
to_chat(H,"<span class='danger'><big>Your fight-or-flight response kicks in, your injuries too much to simply ignore - you need to flee, to hide, survive at all costs - or destroy whatever is threatening you.</big></span>")
feral = 5
log_and_message_admins("has gone feral due to injury.", H)
if(!H.stat)
H.emote("twitch")
//No hungry or shock, but jittery
else if(jittery)
to_chat(H,"<span class='warning'><big>Suddenly, something flips - everything that moves is... potential prey. A plaything. This is great! Time to hunt!</big></span>")
feral = 5
log_and_message_admins("has gone feral due to jitteriness.", H)
if(!H.stat)
H.emote("twitch")
// Handle being feral
if(feral)
//Shock due to mostly halloss. More feral.
if(shock && 2.5*H.halloss >= H.traumatic_shock)
feral = max(feral, H.halloss)
//Shock due to mostly injury. More feral.
else if(shock)
feral = max(feral, H.traumatic_shock * 2)
//Still jittery? More feral.
if(jittery)
feral = max(feral, H.jitteriness-100)
//Still hungry? More feral.
if(H.feral + H.nutrition < 150)
feral++
else
feral = max(0,--feral)
//Set our real mob's var to our temp var
H.feral = feral
//Did we just finish being feral?
if(!feral)
to_chat(H,"<span class='info'>Your thoughts start clearing, your feral urges having passed - for the time being, at least.</span>")
log_and_message_admins("is no longer feral.", H)
return
//If they lose enough health to hit softcrit, handle_shock() will keep resetting this. Otherwise, pissed off critters will lose shock faster than they gain it.
H.shock_stage = max(H.shock_stage-(feral/20), 0)
//Handle light/dark areas
var/turf/T = get_turf(H)
if(!T)
return //Nullspace
var/darkish = T.get_lumcount() <= 0.1
//Don't bother doing heavy lifting if we weren't going to give emotes anyway.
if(!prob(1))
//This is basically the 'lite' version of the below block.
var/list/nearby = H.living_mobs(world.view)
//Not in the dark.
if(!darkish)
//Always handle feral if nobody's around and not in the dark.
if(!nearby.len)
H.handle_feral() H.handle_feral()
else // nobody around
H.handle_feral()
if(prob(2)) //periodic nagmessages
if(H.nutrition <= 100) //If hungry, nag them to go and find someone or something to eat.
H << "<span class='danger'> Confusing sights and sounds and smells surround you - scary and disorienting it may be, but the drive to hunt, to feed, to survive, compels you.</span>"
if(H.stat == CONSCIOUS)
H.emote("twitch")
else if(H.jitteriness >= 100)
H << "<span class='danger'> yesyesyesyesyesyesgetthethingGETTHETHINGfindfoodsfindpreypounceyesyesyes</span>"
if(H.stat == CONSCIOUS)
H.emote("twitch")
else //otherwise, just tell them to hide.
H << "<span class='danger'> Confusing sights and sounds and smells surround you, this place is wrong, confusing, frightening. You need to hide, go to ground...</span>"
if(H.stat == CONSCIOUS)
H.emote("twitch")
//Rarely handle feral if someone is around
else if(prob(1))
H.handle_feral()
////////////////////////////////////////////////////////////////////////////////////////// //And bail
///////////WIP CODE TO MAKE XENOCHIMERAS NOT DIE IN SPACE WHILE REGENNING BELOW/////////// //I put WIP, but what I really meant to put was "Finished" return
//////////////////////////////////////////////////////////////////////////////////////////
var/datum/gas_mixture/environment = H.loc.return_air() // In the darkness. No need for custom scene-protection checks as it's just an occational infomessage.
var/pressure2 = environment.return_pressure() if(darkish)
var/adjusted_pressure2 = H.calculate_affecting_pressure(pressure2) // If hurt, tell 'em to heal up
if (shock)
to_chat(H,"<span class='info'>This place seems safe, secure, hidden, a place to lick your wounds and recover...</span>")
if(adjusted_pressure2 <= 20 && H.does_not_breathe) //If they're in a enviroment with no pressure and are not breathing (See: regenerating), don't kill them. //If hungry, nag them to go and find someone or something to eat.
//This is just to prevent them from taking damage if they're in stasis. else if(hungry)
to_chat(H,"<span class='info'>Secure in your hiding place, your hunger still gnaws at you. You need to catch some food...</span>")
else if(adjusted_pressure2 <= 20) //If they're in an enviroment with no pressure and are NOT in stasis, damage them. //If jittery, etc
H.take_overall_damage(brute=LOW_PRESSURE_DAMAGE, used_weapon = "Low Pressure") else if(jittery)
to_chat(H,"<span class='info'>sneakysneakyyesyesyescleverhidingfindthingsyessssss</span>")
if(H.bodytemperature <= 260 && H.does_not_breathe) //If they're regenerating, don't give them them the negative cold effects //Otherwise, just tell them to keep hiding.
//This is just here to prevent them from getting cold effects else
to_chat(H,"<span class='info'>...safe...</span>")
// NOT in the darkness
else
//Twitch twitch
if(!H.stat)
H.emote("twitch")
var/list/nearby = H.living_mobs(world.view)
// Someone/something nearby
if(nearby.len)
var/M = pick(nearby)
if(shock)
to_chat(H,"<span class='danger'>You're hurt, in danger, exposed, and [M] looks to be a little too close for comfort...</span>")
else if(hungry || jittery)
to_chat(H,"<span class='danger'>Every movement, every flick, every sight and sound has your full attention, your hunting instincts on high alert... In fact, [M] looks extremely appetizing...</span>")
// Nobody around
else
if(hungry)
to_chat(H,"<span class='danger'>Confusing sights and sounds and smells surround you - scary and disorienting it may be, but the drive to hunt, to feed, to survive, compels you.</span>")
else if(jittery)
to_chat(H,"<span class='danger'>yesyesyesyesyesyesgetthethingGETTHETHINGfindfoodsfindpreypounceyesyesyes</span>")
else
to_chat(H,"<span class='danger'>Confusing sights and sounds and smells surround you, this place is wrong, confusing, frightening. You need to hide, go to ground...</span>")
else if(H.bodytemperature <= 260) //If they're not in stasis and are cold. Don't really have to add in an exception to cryo cells, as the effects aren't anything /too/ horrible.
var/coldshock = 0
if(H.bodytemperature <= 260 && H.bodytemperature >= 200) //Chilly.
coldshock = 4 //This will begin to knock them out until they run out of oxygen and suffocate or until someone finds them.
H.eye_blurry = 5 //Blurry vision in the cold.
if(H.bodytemperature <= 199 && H.bodytemperature >= 100) //Extremely cold. Even in somewhere like the server room it takes a while for bodytemp to drop this low.
coldshock = 8
H.eye_blurry = 5
if(H.bodytemperature <= 99) //Insanely cold.
coldshock = 16
H.eye_blurry = 5
H.shock_stage = min(H.shock_stage + coldshock, 160) //cold hurts and gives them pain messages, eventually weakening and paralysing, but doesn't damage or trigger feral.
return
/datum/species/xenochimera/proc/produceCopy(var/datum/species/to_copy,var/list/traits,var/mob/living/carbon/human/H) /datum/species/xenochimera/proc/produceCopy(var/datum/species/to_copy,var/list/traits,var/mob/living/carbon/human/H)
ASSERT(to_copy) ASSERT(to_copy)
@@ -272,10 +328,10 @@
Before they were found they built great cities out of their silk, being united and subjugated in warring factions under great “Star Queens” \ Before they were found they built great cities out of their silk, being united and subjugated in warring factions under great “Star Queens” \
Who forced the working class to build huge, towering cities to attempt to reach the stars, which they worship as gems of great spiritual and magical significance." Who forced the working class to build huge, towering cities to attempt to reach the stars, which they worship as gems of great spiritual and magical significance."
hazard_low_pressure = -1 //Prevents them from dying normally in space. Special code handled below. hazard_low_pressure = 20 //Prevents them from dying normally in space. Special code handled below.
cold_level_1 = -5000 // All cold debuffs are handled below in handle_environment_special cold_level_1 = -1 // All cold debuffs are handled below in handle_environment_special
cold_level_2 = -5000 cold_level_2 = -1
cold_level_3 = -5000 cold_level_3 = -1
//primitive_form = "Monkey" //I dunno. Replace this in the future. //primitive_form = "Monkey" //I dunno. Replace this in the future.
@@ -288,16 +344,9 @@
blood_color = "#0952EF" //Spiders have blue blood. blood_color = "#0952EF" //Spiders have blue blood.
/datum/species/spider/handle_environment_special(var/mob/living/carbon/human/H) /datum/species/spider/handle_environment_special(var/mob/living/carbon/human/H)
if(H.stat == 2) // If they're dead they won't need anything. if(H.stat == DEAD) // If they're dead they won't need anything.
return return
var/datum/gas_mixture/environment = H.loc.return_air()
var/pressure2 = environment.return_pressure()
var/adjusted_pressure2 = H.calculate_affecting_pressure(pressure2)
if(adjusted_pressure2 <= 20) //If they're in an enviroment with no pressure and are NOT in stasis, like a stasis bodybag, damage them.
H.take_overall_damage(brute=LOW_PRESSURE_DAMAGE, used_weapon = "Low Pressure")
if(H.bodytemperature <= 260) //If they're really cold, they go into stasis. if(H.bodytemperature <= 260) //If they're really cold, they go into stasis.
var/coldshock = 0 var/coldshock = 0
if(H.bodytemperature <= 260 && H.bodytemperature >= 200) //Chilly. if(H.bodytemperature <= 260 && H.bodytemperature >= 200) //Chilly.

View File

@@ -56,7 +56,7 @@
/datum/chemical_reaction/xenolazarus/on_reaction(var/datum/reagents/holder, var/created_volume) //literally all this does is mash the regenerate button /datum/chemical_reaction/xenolazarus/on_reaction(var/datum/reagents/holder, var/created_volume) //literally all this does is mash the regenerate button
if(ishuman(holder.my_atom)) if(ishuman(holder.my_atom))
var/mob/living/carbon/human/H = holder.my_atom var/mob/living/carbon/human/H = holder.my_atom
if(H.stat == DEAD && (/mob/living/carbon/human/proc/begin_reconstitute_form in H.verbs)) //no magical regen for non-regenners, and can't force the reaction on live ones if(H.stat == DEAD && (/mob/living/carbon/human/proc/reconstitute_form in H.verbs)) //no magical regen for non-regenners, and can't force the reaction on live ones
if(H.hasnutriment()) // make sure it actually has the conditions to revive if(H.hasnutriment()) // make sure it actually has the conditions to revive
if(!H.reviving) // if it's not reviving, start doing so if(!H.reviving) // if it's not reviving, start doing so
H.visible_message("<span class='info'>[H] shudders briefly, then relaxes, faint movements stirring within.</span>") H.visible_message("<span class='info'>[H] shudders briefly, then relaxes, faint movements stirring within.</span>")