mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 03:57:48 +01:00
Shadekin and Xenochimera variable refactor (#17651)
* gets rid of xenochimera brain var * whoops * shadekin too ye https://i.imgur.com/lNI2AiG.png * organize * simplekin too * yuh * Refactors xenochimera progress: https://i.imgur.com/ssQbRKS.png https://i.imgur.com/ySBxm0M.png https://i.imgur.com/3FWPVuP.png * Update xenochimera.dm * Update examine_vr.dm * Update xenochimera.dm * Update xenochimera.dm
This commit is contained in:
@@ -129,10 +129,12 @@
|
||||
t_He = "Shi"
|
||||
t_His = "Hir"
|
||||
t_his = "hir"
|
||||
if(revive_ready == REVIVING_NOW || revive_ready == REVIVING_DONE)
|
||||
if(stat == DEAD)
|
||||
return span_warning("[t_His] body is twitching subtly.")
|
||||
else
|
||||
return span_notice("[t_He] [t_appear] to be in some sort of torpor.")
|
||||
if(feral)
|
||||
return span_warning("[t_He] [t_has] a crazed, wild look in [t_his] eyes!")
|
||||
var/datum/component/xenochimera/xc = get_xenochimera_component()
|
||||
if(xc)
|
||||
if((xc.revive_ready == REVIVING_NOW || xc.revive_ready == REVIVING_DONE))
|
||||
if(stat == DEAD)
|
||||
return span_warning("[t_His] body is twitching subtly.")
|
||||
else
|
||||
return span_notice("[t_He] [t_appear] to be in some sort of torpor.")
|
||||
else if(xc.feral)
|
||||
return span_warning("[t_He] [t_has] a crazed, wild look in [t_his] eyes!")
|
||||
|
||||
@@ -832,7 +832,7 @@
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/IsAdvancedToolUser(var/silent)
|
||||
if(feral)
|
||||
if(get_feralness())
|
||||
to_chat(src, span_warning("Your primitive mind can't grasp the concept of that thing."))
|
||||
return 0
|
||||
if(species.has_fine_manipulation)
|
||||
@@ -1311,6 +1311,7 @@
|
||||
|
||||
species.create_organs(src)
|
||||
|
||||
species.apply_components(src)
|
||||
|
||||
maxHealth = species.total_health
|
||||
hunger_rate = species.hunger_factor
|
||||
|
||||
@@ -577,7 +577,7 @@
|
||||
|
||||
// standard CPR ahead, adjust oxy and refresh health
|
||||
if(health > CONFIG_GET(number/health_threshold_crit) && prob(10))
|
||||
if(istype(species, /datum/species/xenochimera))
|
||||
if(get_xenochimera_component())
|
||||
visible_message(span_danger("\The [src]'s body twitches and gurgles a bit."))
|
||||
to_chat(reviver, span_danger("You get the feeling [src] can't be revived by CPR alone."))
|
||||
return // Handle xenochim, can't cpr them back to life
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
var/hungry = (500 - nutrition) / 5 //Fixed 500 here instead of our huge MAX_NUTRITION
|
||||
if (hungry >= 70) . += hungry/50
|
||||
|
||||
if (feral >= 10) //crazy feral animals give less and less of a shit about pain and hunger as they get crazier
|
||||
. = max(species.slowdown, species.slowdown+((.-species.slowdown)/(feral/10))) // As feral scales to damage, this amounts to an effective +1 slowdown cap
|
||||
if (get_feralness() >= 10) //crazy feral animals give less and less of a shit about pain and hunger as they get crazier
|
||||
. = max(species.slowdown, species.slowdown+((.-species.slowdown)/(get_feralness()/10))) // As feral scales to damage, this amounts to an effective +1 slowdown cap
|
||||
if(shock_stage >= 10) . -= 1.5 //this gets a +3 later, feral critters take reduced penalty
|
||||
if(riding_datum) //Bit of slowdown for taur rides if rider is bigger or fatter than mount.
|
||||
var/datum/riding/R = riding_datum
|
||||
|
||||
@@ -80,6 +80,9 @@
|
||||
else if(stat == DEAD && !stasis)
|
||||
handle_defib_timer()
|
||||
|
||||
//Handle any species related components we may have. Ex: Shadekin, Xenochimera, etc. Not STAT checked because those do statchecks in their own code.
|
||||
handle_species_components()
|
||||
|
||||
if(skip_some_updates())
|
||||
return //We go ahead and process them 5 times for HUD images and other stuff though.
|
||||
|
||||
@@ -902,6 +905,9 @@
|
||||
if(species.allergen_reaction & AG_CONFUSE)
|
||||
Confuse(disable_severity/4)
|
||||
|
||||
/mob/living/carbon/human/proc/handle_species_components()
|
||||
species.handle_species_components(src)
|
||||
|
||||
/mob/living/carbon/human/handle_environment(datum/gas_mixture/environment)
|
||||
if(!environment)
|
||||
return
|
||||
|
||||
@@ -108,6 +108,7 @@
|
||||
var/kin_type
|
||||
var/energy_light = 0.25
|
||||
var/energy_dark = 0.75
|
||||
species_component = /datum/component/shadekin
|
||||
|
||||
/datum/species/shadekin/New()
|
||||
..()
|
||||
@@ -183,38 +184,35 @@
|
||||
update_shadekin_hud(H)
|
||||
|
||||
/datum/species/shadekin/proc/get_energy(var/mob/living/carbon/human/H)
|
||||
var/obj/item/organ/internal/brain/shadekin/shade_organ = H.internal_organs_by_name[O_BRAIN]
|
||||
var/datum/component/shadekin/comp = H.GetComponent(/datum/component/shadekin)
|
||||
if(!comp)
|
||||
return FALSE //No component, no energy to be had.
|
||||
|
||||
if(!istype(shade_organ))
|
||||
return 0
|
||||
if(shade_organ.dark_energy_infinite)
|
||||
return shade_organ.max_dark_energy
|
||||
if(comp.dark_energy_infinite)
|
||||
return comp.max_dark_energy
|
||||
|
||||
return shade_organ.dark_energy
|
||||
return comp.dark_energy
|
||||
|
||||
/datum/species/shadekin/proc/get_max_energy(var/mob/living/carbon/human/H)
|
||||
var/obj/item/organ/internal/brain/shadekin/shade_organ = H.internal_organs_by_name[O_BRAIN]
|
||||
var/datum/component/shadekin/comp = H.GetComponent(/datum/component/shadekin)
|
||||
if(!comp)
|
||||
return FALSE //No component, no energy to be had.
|
||||
|
||||
if(!istype(shade_organ))
|
||||
return 0
|
||||
|
||||
return shade_organ.max_dark_energy
|
||||
return comp.max_dark_energy
|
||||
|
||||
/datum/species/shadekin/proc/set_energy(var/mob/living/carbon/human/H, var/new_energy)
|
||||
var/obj/item/organ/internal/brain/shadekin/shade_organ = H.internal_organs_by_name[O_BRAIN]
|
||||
var/datum/component/shadekin/comp = H.GetComponent(/datum/component/shadekin)
|
||||
if(!comp)
|
||||
return FALSE //No component, no energy to be had.
|
||||
|
||||
if(!istype(shade_organ))
|
||||
return
|
||||
|
||||
shade_organ.dark_energy = CLAMP(new_energy, 0, get_max_energy(H))
|
||||
comp.dark_energy = CLAMP(new_energy, 0, get_max_energy(H))
|
||||
|
||||
/datum/species/shadekin/proc/set_max_energy(var/mob/living/carbon/human/H, var/new_max_energy)
|
||||
var/obj/item/organ/internal/brain/shadekin/shade_organ = H.internal_organs_by_name[O_BRAIN]
|
||||
var/datum/component/shadekin/comp = H.GetComponent(/datum/component/shadekin)
|
||||
if(!comp)
|
||||
return FALSE //No component, no energy to be had.
|
||||
|
||||
if(!istype(shade_organ))
|
||||
return 0
|
||||
|
||||
shade_organ.max_dark_energy = new_max_energy
|
||||
comp.max_dark_energy = new_max_energy
|
||||
|
||||
/datum/species/shadekin/proc/update_shadekin_hud(var/mob/living/carbon/human/H)
|
||||
var/turf/T = get_turf(H)
|
||||
|
||||
@@ -371,6 +371,7 @@
|
||||
var/list/food_preference = list() //RS edit
|
||||
var/food_preference_bonus = 0
|
||||
|
||||
var/datum/component/species_component = null // The component that this species uses. Example: Xenochimera use /datum/component/xenochimera
|
||||
|
||||
// For Lleill and Hanner
|
||||
var/lleill_energy = 200
|
||||
@@ -605,6 +606,23 @@
|
||||
env_trait.handle_environment_special(H)
|
||||
return
|
||||
|
||||
/datum/species/proc/handle_species_components(var/mob/living/carbon/human/H)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
|
||||
//Xenochimera Species Component
|
||||
var/datum/component/xenochimera/xc = H.get_xenochimera_component()
|
||||
if(xc)
|
||||
if(!H.stat || !(xc.revive_ready == REVIVING_NOW || xc.revive_ready == REVIVING_DONE))
|
||||
SEND_SIGNAL(H, COMSIG_XENOCHIMERA_COMPONENT)
|
||||
|
||||
//Shadekin Species Component.
|
||||
/* //For when shadekin actually have their component control everything.
|
||||
var/datum/component/shadekin/sk = H.get_xenochimera_component()
|
||||
if(sk)
|
||||
if(!H.stat || !(xc.revive_ready == REVIVING_NOW || xc.revive_ready == REVIVING_DONE))
|
||||
SEND_SIGNAL(H, COMSIG_SHADEKIN_COMPONENT)
|
||||
*/
|
||||
|
||||
// Used to update alien icons for aliens.
|
||||
/datum/species/proc/handle_login_special(var/mob/living/carbon/human/H)
|
||||
return
|
||||
@@ -756,6 +774,10 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/datum/species/proc/apply_components(var/mob/living/carbon/human/H)
|
||||
if(species_component)
|
||||
H.LoadComponent(species_component)
|
||||
|
||||
/datum/species/proc/produceCopy(var/list/traits, var/mob/living/carbon/human/H, var/custom_base, var/reset_dna = TRUE) // Traitgenes reset_dna flag required, or genes get reset on resleeve
|
||||
ASSERT(src)
|
||||
ASSERT(istype(H))
|
||||
|
||||
@@ -165,12 +165,12 @@
|
||||
/datum/unarmed_attack/claws/chimera //special feral attack that gets stronger as they get angrier
|
||||
|
||||
/datum/unarmed_attack/claws/chimera/get_unarmed_damage(var/mob/living/carbon/human/user)
|
||||
return user.feral/5
|
||||
return user.get_feralness()/5
|
||||
|
||||
/datum/unarmed_attack/claws/chimera/apply_effects(var/mob/living/carbon/human/user,var/mob/living/carbon/human/target,var/armour,var/attack_damage,var/zone)
|
||||
..()
|
||||
if(user.feral && !(target == user))
|
||||
var/selfdamage = ((user.feral/10)-7.5)
|
||||
if(user.get_feralness() && !(target == user))
|
||||
var/selfdamage = ((user.get_feralness()/10)-7.5)
|
||||
if(selfdamage > 0)
|
||||
var/selfdamagezone = null
|
||||
if (user.hand)
|
||||
|
||||
@@ -1698,8 +1698,7 @@
|
||||
tail = "tail"
|
||||
icobase_tail = 1
|
||||
inherent_verbs = list(
|
||||
/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/tie_hair,
|
||||
/mob/living/carbon/human/proc/lick_wounds) //Xenochimera get all the special verbs since they can't select traits.
|
||||
|
||||
@@ -1748,260 +1747,32 @@
|
||||
|
||||
reagent_tag = IS_CHIMERA
|
||||
|
||||
species_component = /datum/component/xenochimera
|
||||
|
||||
/datum/species/xenochimera/handle_environment_special(var/mob/living/carbon/human/H)
|
||||
//If they're KO'd/dead, or reviving, they're probably not thinking a lot about much of anything.
|
||||
if(!H.stat || !(H.revive_ready == REVIVING_NOW || H.revive_ready == REVIVING_DONE))
|
||||
handle_feralness(H)
|
||||
|
||||
//While regenerating
|
||||
if(H.revive_ready == REVIVING_NOW || H.revive_ready == REVIVING_DONE)
|
||||
H.stunned = 5
|
||||
H.canmove = 0
|
||||
H.does_not_breathe = TRUE
|
||||
var/regen_sounds = H.regen_sounds
|
||||
if(prob(2)) // 2% chance of playing squelchy noise while reviving, which is run roughly every 2 seconds/tick while regenerating.
|
||||
playsound(H, pick(regen_sounds), 30)
|
||||
H.visible_message(span_danger("<p>" + span_huge("[H.name]'s motionless form shudders grotesquely, rippling unnaturally.") + "</p>"))
|
||||
if(!H.lying)
|
||||
H.lay_down()
|
||||
//Cold/pressure effects when not regenerating
|
||||
else
|
||||
var/datum/gas_mixture/environment = H.loc.return_air()
|
||||
var/pressure2 = environment.return_pressure()
|
||||
var/adjusted_pressure2 = H.calculate_affecting_pressure(pressure2)
|
||||
var/datum/gas_mixture/environment = H.loc.return_air()
|
||||
var/pressure2 = environment.return_pressure()
|
||||
var/adjusted_pressure2 = H.calculate_affecting_pressure(pressure2)
|
||||
|
||||
//Very low pressure damage
|
||||
if(adjusted_pressure2 <= 20)
|
||||
H.take_overall_damage(brute=LOW_PRESSURE_DAMAGE, used_weapon = "Low Pressure")
|
||||
//they handle areas where they can't breathe better than most, but it still lowers their effective health as well as all the other bad stuff that comes with unbreathable environments
|
||||
if(H.getOxyLoss() >= 50)
|
||||
H.does_not_breathe = TRUE
|
||||
//Very low pressure damage
|
||||
if(adjusted_pressure2 <= 20)
|
||||
H.take_overall_damage(brute=LOW_PRESSURE_DAMAGE, used_weapon = "Low Pressure")
|
||||
//they handle areas where they can't breathe better than most, but it still lowers their effective health as well as all the other bad stuff that comes with unbreathable environments
|
||||
if(H.getOxyLoss() >= 50)
|
||||
H.does_not_breathe = TRUE
|
||||
|
||||
//Cold hurts and gives them pain messages, eventually weakening and paralysing, but doesn't damage or trigger feral.
|
||||
//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)
|
||||
|
||||
/datum/species/xenochimera/proc/handle_feralness(var/mob/living/carbon/human/H)
|
||||
//first, calculate how stressed the chimera is
|
||||
var/laststress = 0
|
||||
var/obj/item/organ/internal/brain/B = H.internal_organs_by_name[O_BRAIN]
|
||||
if(B) //if you don't have a chimera brain in a chimera body somehow, you don't get the feraless protection
|
||||
laststress = B.laststress
|
||||
|
||||
//Low-ish nutrition has messages and can eventually cause feralness
|
||||
var/hunger = max(0, 150 - H.nutrition)
|
||||
|
||||
//pain makes feralness a thing
|
||||
var/shock = 0.75*H.traumatic_shock
|
||||
|
||||
//Caffeinated or otherwise overexcited xenochimera can become feral and have special messages
|
||||
var/jittery = max(0, H.jitteriness - 100)
|
||||
|
||||
//To reduce distant object references
|
||||
var/feral = H.feral
|
||||
|
||||
//Are we in danger of ferality?
|
||||
var/danger = FALSE
|
||||
var/feral_state = FALSE
|
||||
|
||||
//finally, calculate the current stress total the chimera is operating under, and the cause
|
||||
var/currentstress = (hunger + shock + jittery)
|
||||
var/cause = "stress"
|
||||
if(hunger > shock && hunger > jittery)
|
||||
cause = "hunger"
|
||||
else if (shock > hunger && shock > jittery)
|
||||
cause = "shock"
|
||||
else if (jittery > shock && jittery > hunger)
|
||||
cause = "jittery"
|
||||
|
||||
//check to see if they go feral if they weren't before
|
||||
if(!feral && !isbelly(H.loc))
|
||||
// if stress is below 15, no chance of snapping. Also if they weren't feral before, they won't suddenly become feral unless they get MORE stressed
|
||||
if((currentstress > laststress) && prob(clamp(currentstress-15, 0, 100)) )
|
||||
go_feral(H, currentstress, cause)
|
||||
feral = currentstress //update the local var
|
||||
|
||||
//they didn't go feral, give 'em a chance of hunger messages
|
||||
else if(H.nutrition <= 200 && prob(0.5))
|
||||
switch(H.nutrition)
|
||||
if(150 to 200)
|
||||
to_chat(H,span_info("You feel rather hungry. It might be a good idea to find some some food..."))
|
||||
if(100 to 150)
|
||||
to_chat(H,span_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..."))
|
||||
danger = TRUE
|
||||
|
||||
//now the check's done, update their brain so it remembers how stressed they were
|
||||
if(B && !isbelly(H.loc)) //another sanity check for brain implant shenanigans, also no you don't get to hide in a belly and get your laststress set to a huge amount to skip rolls
|
||||
B.laststress = currentstress
|
||||
|
||||
// Handle being feral
|
||||
if(feral)
|
||||
//We're feral
|
||||
feral_state = TRUE
|
||||
|
||||
//If they're still stressed, they stay feral
|
||||
if(currentstress >= 15)
|
||||
danger = TRUE
|
||||
feral = max(feral, currentstress)
|
||||
|
||||
else
|
||||
feral = max(0,--feral)
|
||||
|
||||
// Being in a belly or in the darkness decreases stress further. Helps mechanically reward players for staying in darkness + RP'ing appropriately. :9
|
||||
var/turf/T = get_turf(H)
|
||||
if(feral && (isbelly(H.loc) || T.get_lumcount() <= 0.1))
|
||||
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)
|
||||
feral_state = FALSE
|
||||
to_chat(H,span_info("Your thoughts start clearing, your feral urges having passed - for the time being, at least."))
|
||||
log_and_message_admins("is no longer feral.", H)
|
||||
update_xenochimera_hud(H, danger, feral_state)
|
||||
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)
|
||||
update_xenochimera_hud(H, danger, feral_state)
|
||||
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, or a belly, and out in the open.
|
||||
if(!darkish && isturf(H.loc) && !isbelly(H.loc)) // Added specific check for if in belly
|
||||
|
||||
//Always handle feral if nobody's around and not in the dark.
|
||||
if(!nearby.len)
|
||||
H.handle_feral()
|
||||
|
||||
//Rarely handle feral if someone is around
|
||||
else if(prob(1))
|
||||
H.handle_feral()
|
||||
|
||||
//And bail
|
||||
update_xenochimera_hud(H, danger, feral_state)
|
||||
return
|
||||
|
||||
// In the darkness, or "hidden", or in a belly. No need for custom scene-protection checks as it's just an occational infomessage.
|
||||
if(darkish || !isturf(H.loc) || isbelly(H.loc)) // Specific check for if in belly. !isturf should do this, but JUST in case.
|
||||
// If hurt, tell 'em to heal up
|
||||
if (cause == "shock")
|
||||
to_chat(H,span_info("This place seems safe, secure, hidden, a place to lick your wounds and recover..."))
|
||||
|
||||
//If hungry, nag them to go and find someone or something to eat.
|
||||
else if(cause == "hunger")
|
||||
to_chat(H,span_info("Secure in your hiding place, your hunger still gnaws at you. You need to catch some food..."))
|
||||
|
||||
//If jittery, etc
|
||||
else if(cause == "jittery")
|
||||
to_chat(H,span_info("sneakysneakyyesyesyescleverhidingfindthingsyessssss"))
|
||||
|
||||
//Otherwise, just tell them to keep hiding.
|
||||
else
|
||||
to_chat(H,span_info("...safe..."))
|
||||
|
||||
// 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(cause == "shock")
|
||||
to_chat(H,span_danger("You're hurt, in danger, exposed, and [M] looks to be a little too close for comfort..."))
|
||||
else
|
||||
to_chat(H,span_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..."))
|
||||
|
||||
// Nobody around
|
||||
else
|
||||
if(cause == "hunger")
|
||||
to_chat(H,span_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."))
|
||||
else if(cause == "jittery")
|
||||
to_chat(H,span_danger("yesyesyesyesyesyesgetthethingGETTHETHINGfindfoodsfindpreypounceyesyesyes"))
|
||||
else
|
||||
to_chat(H,span_danger("Confusing sights and sounds and smells surround you, this place is wrong, confusing, frightening. You need to hide, go to ground..."))
|
||||
|
||||
// HUD update time
|
||||
update_xenochimera_hud(H, danger, feral_state)
|
||||
|
||||
/datum/species/xenochimera/proc/go_feral(var/mob/living/carbon/human/H, var/stress, var/cause)
|
||||
// Going feral due to hunger
|
||||
if(cause == "hunger")
|
||||
to_chat(H,span_danger(span_large("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.")))
|
||||
log_and_message_admins("has gone feral due to hunger.", H)
|
||||
|
||||
// If they're hurt, chance of snapping.
|
||||
else if(cause == "shock")
|
||||
//If the majority of their shock is due to halloss, give them a different message (3x multiplier on check as halloss is 2x - meaning t_s must be at least 3x for other damage sources to be the greater part)
|
||||
if(3*H.halloss >= H.traumatic_shock)
|
||||
to_chat(H,span_danger(span_large("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...")))
|
||||
log_and_message_admins("has gone feral due to halloss.", H)
|
||||
|
||||
//Majority due to other damage sources
|
||||
else
|
||||
to_chat(H,span_danger(span_large("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.")))
|
||||
log_and_message_admins("has gone feral due to injury.", H)
|
||||
|
||||
//No hungry or shock, but jittery
|
||||
else if(cause == "jittery")
|
||||
to_chat(H,span_warning(span_large("Suddenly, something flips - everything that moves is... potential prey. A plaything. This is great! Time to hunt!")))
|
||||
log_and_message_admins("has gone feral due to jitteriness.", H)
|
||||
|
||||
else // catch-all just in case something weird happens
|
||||
to_chat(H,span_warning(span_large("The stress of your situation is too much for you, and your survival instincts kick in!")))
|
||||
log_and_message_admins("has gone feral for unknown reasons.", H)
|
||||
//finally, set their feral var
|
||||
H.feral = stress
|
||||
if(!H.stat)
|
||||
H.emote("twitch")
|
||||
//Cold hurts and gives them pain messages, eventually weakening and paralysing, but doesn't damage or trigger feral.
|
||||
//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)
|
||||
|
||||
/datum/species/xenochimera/get_race_key()
|
||||
var/datum/species/real = GLOB.all_species[base_species]
|
||||
return real.race_key
|
||||
|
||||
/datum/species/xenochimera/proc/update_xenochimera_hud(var/mob/living/carbon/human/H, var/danger, var/feral)
|
||||
if(H.xenochimera_danger_display)
|
||||
H.xenochimera_danger_display.invisibility = INVISIBILITY_NONE
|
||||
if(danger && feral)
|
||||
H.xenochimera_danger_display.icon_state = "danger11"
|
||||
else if(danger && !feral)
|
||||
H.xenochimera_danger_display.icon_state = "danger10"
|
||||
else if(!danger && feral)
|
||||
H.xenochimera_danger_display.icon_state = "danger01"
|
||||
else
|
||||
H.xenochimera_danger_display.icon_state = "danger00"
|
||||
|
||||
return
|
||||
|
||||
/obj/screen/xenochimera
|
||||
icon = 'icons/mob/chimerahud.dmi'
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/obj/screen/xenochimera/danger_level
|
||||
name = "danger level"
|
||||
icon_state = "danger00" //first number is bool of whether or not we're in danger, second is whether or not we're feral
|
||||
alpha = 200
|
||||
|
||||
/datum/species/sparkledog //Exists primarily as an april fools joke, along with everything tied to it!
|
||||
name = SPECIES_SPARKLE
|
||||
name_plural = "Sparklies"
|
||||
|
||||
@@ -1,89 +1,4 @@
|
||||
/mob/living/carbon/human/proc/reconstitute_form() //Scree's race ability.in exchange for: No cloning.
|
||||
set name = "Reconstitute Form"
|
||||
set category = "Abilities.General"
|
||||
|
||||
// Sanity is mostly handled in chimera_regenerate()
|
||||
if(stat == DEAD)
|
||||
var/confirm = tgui_alert(src, "Are you sure you want to regenerate your corpse? This process can take up to thirty minutes.", "Confirm Regeneration", list("Yes", "No"))
|
||||
if(confirm == "Yes")
|
||||
chimera_regenerate()
|
||||
else if (quickcheckuninjured())
|
||||
var/confirm = tgui_alert(src, "Are you sure you want to regenerate? As you are uninjured this will only take 30 seconds and match your appearance to your character slot.", "Confirm Regeneration", list("Yes", "No"))
|
||||
if(confirm == "Yes")
|
||||
chimera_regenerate()
|
||||
else
|
||||
var/confirm = tgui_alert(src, "Are you sure you want to completely reconstruct your form? This process can take up to fifteen minutes, depending on how hungry you are, and you will be unable to move.", "Confirm Regeneration", list("Yes", "No"))
|
||||
if(confirm == "Yes")
|
||||
chimera_regenerate()
|
||||
|
||||
/mob/living/carbon/human/proc/chimera_regenerate()
|
||||
//If they're already regenerating
|
||||
switch(revive_ready)
|
||||
if(REVIVING_NOW)
|
||||
to_chat(src, "You are already reconstructing, just wait for the reconstruction to finish!")
|
||||
return
|
||||
if(REVIVING_DONE)
|
||||
to_chat(src, "Your reconstruction is done, but you need to hatch now.")
|
||||
return
|
||||
if(revive_ready > world.time)
|
||||
to_chat(src, "You can't use that ability again so soon!")
|
||||
return
|
||||
|
||||
var/time = min(900, (120+780/(1 + nutrition/100))) //capped at 15 mins, roughly 6 minutes at 250 (yellow) nutrition, 4.1 minutes at 500 (grey), cannot be below 2 mins
|
||||
if (quickcheckuninjured()) //if you're completely uninjured, then you get a speedymode - check health first for quickness
|
||||
time = 30
|
||||
|
||||
//Clicked regen while dead.
|
||||
if(stat == DEAD)
|
||||
|
||||
//reviving from dead takes extra nutriment to be provided from outside OR takes twice as long and consumes extra at the end
|
||||
if(!hasnutriment())
|
||||
time = time*2
|
||||
|
||||
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.")
|
||||
|
||||
//Scary spawnerization.
|
||||
revive_ready = REVIVING_NOW
|
||||
revive_finished = (world.time + time SECONDS) // When do we finish reviving? Allows us to find out when we're done, called by the alert currently.
|
||||
throw_alert("regen", /obj/screen/alert/xenochimera/reconstitution)
|
||||
spawn(time SECONDS)
|
||||
// check to see if they've been fixed by outside forces in the meantime such as defibbing
|
||||
if(stat != DEAD)
|
||||
to_chat(src, span_notice("Your body has recovered from its ordeal, ready to regenerate itself again."))
|
||||
revive_ready = REVIVING_READY //reset their cooldown
|
||||
clear_alert("regen")
|
||||
throw_alert("hatch", /obj/screen/alert/xenochimera/readytohatch)
|
||||
|
||||
// Was dead, still dead.
|
||||
else
|
||||
to_chat(src, span_notice("Consciousness begins to stir as your new body awakens, ready to hatch."))
|
||||
add_verb(src, /mob/living/carbon/human/proc/hatch)
|
||||
revive_ready = REVIVING_DONE
|
||||
src << sound('sound/effects/mob_effects/xenochimera/hatch_notification.ogg',0,0,0,30)
|
||||
clear_alert("regen")
|
||||
throw_alert("hatch", /obj/screen/alert/xenochimera/readytohatch)
|
||||
|
||||
|
||||
//Clicked regen while NOT dead
|
||||
else
|
||||
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
|
||||
revive_ready = REVIVING_NOW
|
||||
revive_finished = (world.time + time SECONDS) // When do we finish reviving? Allows us to find out when we're done, called by the alert currently.
|
||||
throw_alert("regen", /obj/screen/alert/xenochimera/reconstitution)
|
||||
spawn(time SECONDS)
|
||||
|
||||
//Slightly different flavour messages
|
||||
if(stat != DEAD || hasnutriment())
|
||||
to_chat(src, span_notice("Consciousness begins to stir as your new body awakens, ready to hatch.."))
|
||||
else
|
||||
to_chat(src, span_warning("Consciousness begins to stir as your battered body struggles to recover from its ordeal.."))
|
||||
add_verb(src, /mob/living/carbon/human/proc/hatch)
|
||||
revive_ready = REVIVING_DONE
|
||||
src << sound('sound/effects/mob_effects/xenochimera/hatch_notification.ogg',0,0,0,30)
|
||||
clear_alert("regen")
|
||||
throw_alert("hatch", /obj/screen/alert/xenochimera/readytohatch)
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/hasnutriment()
|
||||
@@ -104,287 +19,12 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/human/proc/hatch()
|
||||
set name = "Hatch"
|
||||
set category = "Abilities.General"
|
||||
|
||||
if(revive_ready != REVIVING_DONE)
|
||||
//Hwhat?
|
||||
remove_verb(src, /mob/living/carbon/human/proc/hatch)
|
||||
return
|
||||
|
||||
var/confirm = tgui_alert(src, "Are you sure you want to hatch right now? This will be very obvious to anyone in view.", "Confirm Regeneration", list("Yes", "No"))
|
||||
if(confirm == "Yes")
|
||||
|
||||
//Dead when hatching
|
||||
if(stat == DEAD)
|
||||
var/sickness_duration = 10 MINUTES
|
||||
//Reviving from ded takes extra nutrition - if it isn't provided from outside sources, it comes from you
|
||||
if(!hasnutriment())
|
||||
nutrition=nutrition * 0.75
|
||||
sickness_duration = 20 MINUTES
|
||||
chimera_hatch()
|
||||
add_modifier(/datum/modifier/resleeving_sickness/chimera, sickness_duration)
|
||||
adjustBrainLoss(5) // if they're reviving from dead, they come back with 5 brainloss on top of whatever's unhealed.
|
||||
visible_message(span_warning("<p>" + span_huge("The former corpse staggers to its feet, all its former wounds having vanished...") + "</p>")) //Bloody hell...
|
||||
clear_alert("hatch")
|
||||
return
|
||||
|
||||
//Alive when hatching
|
||||
else
|
||||
chimera_hatch()
|
||||
|
||||
visible_message(span_warning("<p>" + span_huge("[src] rises to \his feet.") + "</p>")) //Bloody hell...
|
||||
clear_alert("hatch")
|
||||
|
||||
/mob/living/carbon/human/proc/chimera_hatch()
|
||||
remove_verb(src, /mob/living/carbon/human/proc/hatch)
|
||||
to_chat(src, span_notice("Your new body awakens, bursting free from your old skin."))
|
||||
//Modify and record values (half nutrition and braindamage)
|
||||
var/old_nutrition = nutrition
|
||||
var/braindamage = min(5, max(0, (brainloss-1) * 0.5)) //brainloss is tricky to heal and might take a couple of goes to get rid of completely.
|
||||
var/uninjured=quickcheckuninjured()
|
||||
//I did have special snowflake code, but this is easier.
|
||||
revive()
|
||||
mutations.Remove(HUSK)
|
||||
setBrainLoss(braindamage)
|
||||
species.update_vore_belly_def_variant()
|
||||
|
||||
if(!uninjured)
|
||||
nutrition = old_nutrition * 0.5
|
||||
//Drop everything
|
||||
for(var/obj/item/W in src)
|
||||
drop_from_inventory(W)
|
||||
//Visual effects
|
||||
var/T = get_turf(src)
|
||||
var/blood_color = species.blood_color
|
||||
var/flesh_color = species.flesh_color
|
||||
new /obj/effect/gibspawner/human/xenochimera(T, null, flesh_color, blood_color)
|
||||
visible_message(span_danger("<p>" + span_huge("The lifeless husk of [src] bursts open, revealing a new, intact copy in the pool of viscera.") + "</p>")) //Bloody hell...
|
||||
playsound(T, 'sound/effects/mob_effects/xenochimera/hatch.ogg', 50)
|
||||
else //lower cost for doing a quick cosmetic revive
|
||||
nutrition = old_nutrition * 0.9
|
||||
|
||||
//Unfreeze some things
|
||||
does_not_breathe = FALSE
|
||||
update_canmove()
|
||||
weakened = 2
|
||||
|
||||
revive_ready = world.time + 10 MINUTES //set the cooldown, Reduced this to 10 minutes, you're playing with fire if you're reviving that often.
|
||||
|
||||
/datum/modifier/resleeving_sickness/chimera //near identical to the regular version, just with different flavortexts
|
||||
name = "imperfect regeneration"
|
||||
desc = "You feel rather weak and unfocused, having just regrown your body not so long ago."
|
||||
|
||||
on_created_text = span_warning(span_large("You feel weak and unsteady, that regeneration having been rougher than most."))
|
||||
on_expired_text = span_notice(span_large("You feel your strength and focus return to you."))
|
||||
|
||||
/mob/living/carbon/human/proc/revivingreset() // keep this as a debug proc or potential future use
|
||||
revive_ready = REVIVING_READY
|
||||
|
||||
/obj/effect/gibspawner/human/xenochimera
|
||||
fleshcolor = "#14AD8B"
|
||||
bloodcolor = "#14AD8B"
|
||||
|
||||
/mob/living/carbon/human/proc/getlightlevel() //easier than having the same code in like three places
|
||||
if(isturf(src.loc)) //else, there's considered to be no light
|
||||
var/turf/T = src.loc
|
||||
return T.get_lumcount() * 5
|
||||
else return 0
|
||||
|
||||
/mob/living/carbon/human/proc/handle_feral()
|
||||
if(handling_hal) return
|
||||
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.
|
||||
spawn(rand(200,500)/(feral/10))
|
||||
if(!feral) return //just to avoid fuckery in the event that they un-feral in the time it takes for the spawn to proc
|
||||
var/halpick = rand(1,100)
|
||||
switch(halpick)
|
||||
if(0 to 15) //15% chance
|
||||
//Screwy HUD
|
||||
//to_chat(src, "Screwy HUD")
|
||||
hal_screwyhud = pick(1,2,3,3,4,4)
|
||||
spawn(rand(100,250))
|
||||
hal_screwyhud = 0
|
||||
if(16 to 25) //10% chance
|
||||
//Strange items
|
||||
//to_chat(src, "Traitor Items")
|
||||
if(!halitem)
|
||||
halitem = new
|
||||
var/list/slots_free = list(ui_lhand,ui_rhand)
|
||||
if(l_hand) slots_free -= ui_lhand
|
||||
if(r_hand) slots_free -= ui_rhand
|
||||
if(ishuman(src))
|
||||
var/mob/living/carbon/human/H = src
|
||||
if(!H.belt) slots_free += ui_belt
|
||||
if(!H.l_store) slots_free += ui_storage1
|
||||
if(!H.r_store) slots_free += ui_storage2
|
||||
if(slots_free.len)
|
||||
halitem.screen_loc = pick(slots_free)
|
||||
halitem.layer = 50
|
||||
switch(rand(1,6))
|
||||
if(1) //revolver
|
||||
halitem.icon = 'icons/obj/gun.dmi'
|
||||
halitem.icon_state = "revolver"
|
||||
halitem.name = "Revolver"
|
||||
if(2) //c4
|
||||
halitem.icon = 'icons/obj/assemblies.dmi'
|
||||
halitem.icon_state = "plastic-explosive0"
|
||||
halitem.name = "Mysterious Package"
|
||||
if(prob(25))
|
||||
halitem.icon_state = "c4small_1"
|
||||
if(3) //sword
|
||||
halitem.icon = 'icons/obj/weapons.dmi'
|
||||
halitem.icon_state = "sword1"
|
||||
halitem.name = "Sword"
|
||||
if(4) //stun baton
|
||||
halitem.icon = 'icons/obj/weapons.dmi'
|
||||
halitem.icon_state = "stunbaton"
|
||||
halitem.name = "Stun Baton"
|
||||
if(5) //emag
|
||||
halitem.icon = 'icons/obj/card.dmi'
|
||||
halitem.icon_state = "emag"
|
||||
halitem.name = "Cryptographic Sequencer"
|
||||
if(6) //flashbang
|
||||
halitem.icon = 'icons/obj/grenade.dmi'
|
||||
halitem.icon_state = "flashbang1"
|
||||
halitem.name = "Flashbang"
|
||||
if(client) client.screen += halitem
|
||||
spawn(rand(100,250))
|
||||
if(client)
|
||||
client.screen -= halitem
|
||||
halitem = null
|
||||
if(26 to 35) //10% chance
|
||||
//Flashes of danger
|
||||
//to_chat(src, "Danger Flash")
|
||||
if(!halimage)
|
||||
var/list/possible_points = list()
|
||||
for(var/turf/simulated/floor/F in view(src,world.view))
|
||||
possible_points += F
|
||||
if(possible_points.len)
|
||||
var/turf/simulated/floor/target = pick(possible_points)
|
||||
|
||||
switch(rand(1,3))
|
||||
if(1)
|
||||
//to_chat(src, "Space")
|
||||
halimage = image('icons/turf/space.dmi',target,"[rand(1,25)]",TURF_LAYER)
|
||||
if(2)
|
||||
//to_chat(src, "Fire")
|
||||
halimage = image('icons/effects/fire.dmi',target,"1",TURF_LAYER)
|
||||
if(3)
|
||||
//to_chat(src, "C4")
|
||||
halimage = image('icons/obj/assemblies.dmi',target,"plastic-explosive2",OBJ_LAYER+0.01)
|
||||
|
||||
|
||||
if(client) client.images += halimage
|
||||
spawn(rand(10,50)) //Only seen for a brief moment.
|
||||
if(client) client.images -= halimage
|
||||
halimage = null
|
||||
|
||||
if(36 to 55) //20% chance
|
||||
//Strange audio
|
||||
//to_chat(src, "Strange Audio")
|
||||
switch(rand(1,12))
|
||||
if(1) src << 'sound/machines/door/old_airlock.ogg'
|
||||
if(2)
|
||||
if(prob(50))src << 'sound/effects/Explosion1.ogg'
|
||||
else src << 'sound/effects/Explosion2.ogg'
|
||||
if(3) src << 'sound/effects/explosionfar.ogg'
|
||||
if(4) src << 'sound/effects/Glassbr1.ogg'
|
||||
if(5) src << 'sound/effects/Glassbr2.ogg'
|
||||
if(6) src << 'sound/effects/Glassbr3.ogg'
|
||||
if(7) src << 'sound/machines/twobeep.ogg'
|
||||
if(8) src << 'sound/machines/door/windowdoor.ogg'
|
||||
if(9)
|
||||
//To make it more realistic, I added two gunshots (enough to kill)
|
||||
src << 'sound/weapons/Gunshot1.ogg'
|
||||
spawn(rand(10,30))
|
||||
src << 'sound/weapons/Gunshot2.ogg'
|
||||
if(10) src << 'sound/weapons/smash.ogg'
|
||||
if(11)
|
||||
//Same as above, but with tasers.
|
||||
src << 'sound/weapons/Taser.ogg'
|
||||
spawn(rand(10,30))
|
||||
src << 'sound/weapons/Taser.ogg'
|
||||
//Rare audio
|
||||
if(12)
|
||||
//These sounds are (mostly) taken from Hidden: Source
|
||||
var/list/creepyasssounds = list('sound/effects/ghost.ogg', 'sound/effects/ghost2.ogg', 'sound/effects/Heart Beat.ogg', 'sound/effects/screech.ogg',\
|
||||
'sound/hallucinations/behind_you1.ogg', 'sound/hallucinations/behind_you2.ogg', 'sound/hallucinations/far_noise.ogg', 'sound/hallucinations/growl1.ogg', 'sound/hallucinations/growl2.ogg',\
|
||||
'sound/hallucinations/growl3.ogg', 'sound/hallucinations/im_here1.ogg', 'sound/hallucinations/im_here2.ogg', 'sound/hallucinations/i_see_you1.ogg', 'sound/hallucinations/i_see_you2.ogg',\
|
||||
'sound/hallucinations/look_up1.ogg', 'sound/hallucinations/look_up2.ogg', 'sound/hallucinations/over_here1.ogg', 'sound/hallucinations/over_here2.ogg', 'sound/hallucinations/over_here3.ogg',\
|
||||
'sound/hallucinations/turn_around1.ogg', 'sound/hallucinations/turn_around2.ogg', 'sound/hallucinations/veryfar_noise.ogg', 'sound/hallucinations/wail.ogg')
|
||||
src << pick(creepyasssounds)
|
||||
if(56 to 60) //5% chance
|
||||
//Flashes of danger
|
||||
//to_chat(src, "Danger Flash")
|
||||
if(!halbody)
|
||||
var/list/possible_points = list()
|
||||
for(var/turf/simulated/floor/F in view(src,world.view))
|
||||
possible_points += F
|
||||
if(possible_points.len)
|
||||
var/turf/simulated/floor/target = pick(possible_points)
|
||||
switch(rand(1,4))
|
||||
if(1)
|
||||
halbody = image('icons/mob/human.dmi',target,"husk_l",TURF_LAYER)
|
||||
if(2,3)
|
||||
halbody = image('icons/mob/human.dmi',target,"husk_s",TURF_LAYER)
|
||||
if(4)
|
||||
halbody = image('icons/mob/alien.dmi',target,"alienother",TURF_LAYER)
|
||||
// if(5)
|
||||
// halbody = image('xcomalien.dmi',target,"chryssalid",TURF_LAYER)
|
||||
|
||||
if(client) client.images += halbody
|
||||
spawn(rand(50,80)) //Only seen for a brief moment.
|
||||
if(client) client.images -= halbody
|
||||
halbody = null
|
||||
if(61 to 85) //25% chance
|
||||
//food
|
||||
if(!halbody)
|
||||
var/list/possible_points = list()
|
||||
for(var/turf/simulated/floor/F in view(src,world.view))
|
||||
possible_points += F
|
||||
if(possible_points.len)
|
||||
var/turf/simulated/floor/target = pick(possible_points)
|
||||
switch(rand(1,10))
|
||||
if(1)
|
||||
halbody = image('icons/mob/animal.dmi',target,"cow",TURF_LAYER)
|
||||
if(2)
|
||||
halbody = image('icons/mob/animal.dmi',target,"chicken",TURF_LAYER)
|
||||
if(3)
|
||||
halbody = image('icons/obj/food.dmi',target,"bigbiteburger",TURF_LAYER)
|
||||
if(4)
|
||||
halbody = image('icons/obj/food.dmi',target,"meatbreadslice",TURF_LAYER)
|
||||
if(5)
|
||||
halbody = image('icons/obj/food.dmi',target,"sausage",TURF_LAYER)
|
||||
if(6)
|
||||
halbody = image('icons/obj/food.dmi',target,"bearmeat",TURF_LAYER)
|
||||
if(7)
|
||||
halbody = image('icons/obj/food.dmi',target,"fishfillet",TURF_LAYER)
|
||||
if(8)
|
||||
halbody = image('icons/obj/food.dmi',target,"meat",TURF_LAYER)
|
||||
if(9)
|
||||
halbody = image('icons/obj/food.dmi',target,"meatstake",TURF_LAYER)
|
||||
if(10)
|
||||
halbody = image('icons/obj/food.dmi',target,"monkeysdelight",TURF_LAYER)
|
||||
|
||||
if(client) client.images += halbody
|
||||
spawn(rand(50,80)) //Only seen for a brief moment.
|
||||
if(client) client.images -= halbody
|
||||
halbody = null
|
||||
if(86 to 100) //15% chance
|
||||
//hear voices. Could make the voice pick from nearby creatures, but nearby creatures make feral hallucinations rare so don't bother.
|
||||
var/list/hiddenspeakers = list("Someone distant", "A voice nearby","A familiar voice", "An echoing voice", "A cautious voice", "A scared voice", "Someone around the corner", "Someone", "Something", "Something scary", "An urgent voice", "An angry voice")
|
||||
var/list/speakerverbs = list("calls out", "yells", "screams", "exclaims", "shrieks", "shouts", "hisses", "snarls")
|
||||
var/list/spookyphrases = list("It's over here!","Stop it!", "Hunt it down!", "Get it!", "Quick, over here!", "Anyone there?", "Who's there?", "Catch that thing!", "Stop it! Kill it!", "Anyone there?", "Where is it?", "Find it!", "There it is!")
|
||||
to_chat(src, span_game(span_say(span_name(pick(hiddenspeakers)) + " [pick(speakerverbs)], \"[pick(spookyphrases)]\"")))
|
||||
|
||||
|
||||
handling_hal = 0
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/bloodsuck()
|
||||
set name = "Partially Drain prey of blood"
|
||||
set desc = "Bites prey and drains them of a significant portion of blood, feeding you in the process. You may only do this once per minute."
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
if(shift_denial)
|
||||
name = shift_denial
|
||||
else
|
||||
name = my_kin.energy >= cost ? "Activate" : "No Energy"
|
||||
name = my_kin.comp.dark_energy >= cost ? "Activate" : "No Energy"
|
||||
return src
|
||||
|
||||
/obj/effect/shadekin_ability/Click(var/location, var/control, var/params)
|
||||
@@ -53,11 +53,11 @@
|
||||
else if(shift_mode == ONLY_WHILE_SHIFTED && !(my_kin.ability_flags & AB_PHASE_SHIFTED))
|
||||
to_chat(my_kin,span_warning("Can only use that ability while phase shifted!"))
|
||||
return FALSE
|
||||
else if(my_kin.energy < cost)
|
||||
else if(my_kin.comp.dark_energy < cost)
|
||||
to_chat(my_kin,span_warning("Not enough energy for that ability!"))
|
||||
return FALSE
|
||||
|
||||
my_kin.energy -= cost
|
||||
my_kin.comp.dark_energy -= cost
|
||||
if(ab_sound)
|
||||
playsound(src,ab_sound,75,1)
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
if(!..())
|
||||
return
|
||||
if(!my_kin.mend_other())
|
||||
my_kin.energy += cost //Refund due to abort
|
||||
my_kin.comp.dark_energy += cost //Refund due to abort
|
||||
/*
|
||||
/datum/modifier/shadekin/heal_boop
|
||||
name = "Shadekin Regen"
|
||||
|
||||
@@ -68,8 +68,7 @@
|
||||
var/image/tailimage //Cached tail image
|
||||
|
||||
//Darknesssss
|
||||
var/energy = 100 //For abilities
|
||||
var/energy_adminbuse = FALSE //For adminbuse infinite energy
|
||||
var/datum/component/shadekin/comp = /datum/component/shadekin //Component that holds all the shadekin vars.
|
||||
var/dark_gains = 0 //Last tick's change in energy
|
||||
var/ability_flags = 0 //Flags for active abilities
|
||||
var/obj/screen/darkhud //Holder to update this icon
|
||||
@@ -97,6 +96,7 @@
|
||||
new new_type(loc)
|
||||
flags |= ATOM_INITIALIZED
|
||||
return INITIALIZE_HINT_QDEL
|
||||
comp = LoadComponent(comp)
|
||||
|
||||
if(icon_state == "map_example")
|
||||
icon_state = pick("white","dark","brown")
|
||||
@@ -205,9 +205,9 @@
|
||||
density = FALSE
|
||||
|
||||
//Convert spare nutrition into energy at a certain ratio
|
||||
if(. && nutrition > initial(nutrition) && energy < 100)
|
||||
if(. && nutrition > initial(nutrition) && comp.dark_energy < 100)
|
||||
nutrition = max(0, nutrition-5)
|
||||
energy = min(100,energy+1)
|
||||
comp.dark_energy = min(100,comp.dark_energy+1)
|
||||
if(!client && check_for_observer && check_timer++ > 5)
|
||||
check_timer = 0
|
||||
var/non_kin_count = 0
|
||||
@@ -328,10 +328,10 @@
|
||||
if(darkness >= 0.65)
|
||||
dark_gains = 0.30
|
||||
|
||||
energy = max(0,min(initial(energy),energy + dark_gains))
|
||||
comp.dark_energy = max(0,min(initial(comp.dark_energy),comp.dark_energy + dark_gains))
|
||||
|
||||
if(energy_adminbuse)
|
||||
energy = 100
|
||||
if(comp.dark_energy_infinite)
|
||||
comp.dark_energy = 100
|
||||
|
||||
//Update turf darkness hud
|
||||
if(darkhud)
|
||||
@@ -349,7 +349,7 @@
|
||||
|
||||
//Update energy storage hud
|
||||
if(energyhud)
|
||||
switch(energy)
|
||||
switch(comp.dark_energy)
|
||||
if(80 to INFINITY)
|
||||
energyhud.icon_state = "energy0"
|
||||
if(60 to 80)
|
||||
@@ -441,7 +441,7 @@
|
||||
if(ORANGE_EYES)
|
||||
gains = 5
|
||||
|
||||
energy += gains
|
||||
comp.dark_energy += gains
|
||||
|
||||
//Special hud elements for darkness and energy gains
|
||||
/mob/living/simple_mob/shadekin/extra_huds(var/datum/hud/hud,var/icon/ui_style,var/list/hud_elements)
|
||||
|
||||
Reference in New Issue
Block a user