Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Elzuose Carapace Prototype #3467

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@
//Used as an upper limit for species that continuously gain nutriment
#define NUTRITION_LEVEL_ALMOST_FULL 535

//Charge levels for Ethereals
//WS Begin -- Ethereal Charge Scaling
//Charge levels for Elzu
#define ELZUOSE_CHARGE_SCALING_MULTIPLIER 20
#define ELZUOSE_CHARGE_NONE (0 * ELZUOSE_CHARGE_SCALING_MULTIPLIER)
#define ELZUOSE_CHARGE_LOWPOWER (20 * ELZUOSE_CHARGE_SCALING_MULTIPLIER)
Expand All @@ -260,7 +259,12 @@
#define ELZUOSE_CHARGE_FULL (100 * ELZUOSE_CHARGE_SCALING_MULTIPLIER)
#define ELZUOSE_CHARGE_OVERLOAD (125 * ELZUOSE_CHARGE_SCALING_MULTIPLIER)
#define ELZUOSE_CHARGE_DANGEROUS (150 * ELZUOSE_CHARGE_SCALING_MULTIPLIER)
//WS End

//Carapace conditions for Elzuose
#define CARAPACE_BROKEN "carapace_broken"
#define CARAPACE_BREAKING "carapace_breaking"
#define CARAPACE_DAMAGED "carapace_damaged"
#define CARAPACE_FINE "carapace_fine"

//Slime evolution threshold. Controls how fast slimes can split/grow
#define SLIME_EVOLUTION_THRESHOLD 10
Expand Down
28 changes: 28 additions & 0 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,34 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
desc = "Your blood's electric charge is becoming dangerously high, find an outlet for your energy. Use Grab Intent on an APC to channel your energy into it."
icon_state = "ethereal_overcharge"

/atom/movable/screen/alert/elzucarapace
name = "Carapace"
icon_state = "elzucarapace"
desc = "Your carapace is protecting your delicate internal tissues from damage."

/atom/movable/screen/alert/elzucarapace/Initialize()
. = ..()
START_PROCESSING(SSprocessing, src)

/atom/movable/screen/alert/elzucarapace/Destroy()
STOP_PROCESSING(SSprocessing, src)
return ..()

/atom/movable/screen/alert/elzucarapace/process()
var/mob/living/carbon/human/elzu = owner
var/datum/species/elzuose/elzu_stuff = elzu.dna.species

switch(elzu_stuff.carapace_state)
if(CARAPACE_FINE)
desc = "Your carapace is protecting your delicate internal tissues from damage."
if(CARAPACE_DAMAGED)
desc = "Your carapace is damaged, and won't be as effective at absorbing incoming trauma."
if(CARAPACE_BREAKING)
desc = "Your carapace is in very bad shape... Don't let it break!"
if(CARAPACE_BROKEN)
desc = "Your carapace has broken into pieces! Any damage you take now will cause additional injury, and movement may harm you."
return

//MODsuit unique
/atom/movable/screen/alert/nocore
name = "Missing Core"
Expand Down
11 changes: 11 additions & 0 deletions code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,17 @@
if(151 to INFINITY)
. += "<b>[t_He] [t_is] covered in glistening dust!</b>" //End WS edit

//slop. Someone please add an examine proc to species
if(iselzuose(src))
var/datum/species/elzuose/ourspecies = dna.species
switch(ourspecies.carapace_state)
if(CARAPACE_DAMAGED)
. += span_warning("[t_His] skin is backlit by small, hairline fractures.")
if(CARAPACE_BREAKING)
. += span_warning("[t_His] skin is underlaid with precarious looking cracks, on the verge of splitting apart.")
if(CARAPACE_BROKEN)
. += span_warning("<b>[t_His] carapace has completely splintered apart, exposing flashes of the delicate tissue beneath.<b>")

var/trait_exam = common_trait_examine()
if (!isnull(trait_exam))
. += trait_exam
Expand Down
143 changes: 128 additions & 15 deletions code/modules/mob/living/carbon/human/species_types/ethereal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#define ROOT_TIME (3 SECONDS)
#define ROOT_CHARGE_GAIN (5 * ELZUOSE_CHARGE_SCALING_MULTIPLIER)

#define CARAPACE_REGEN_LOWCHARGE 0.002
#define CARAPACE_REGEN_MEDCHARGE 0.004
#define CARAPACE_REGEN_HIGHCHARGE 0.008
#define CARAPACE_REGEN_FASTCHARGE 0.032//finally a reason to risk intentional overload

/datum/species/elzuose
name = "\improper Elzuose"
id = SPECIES_ELZUOSE
Expand All @@ -13,8 +18,6 @@
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/ethereal
mutantstomach = /obj/item/organ/stomach/ethereal
mutanttongue = /obj/item/organ/tongue/ethereal
siemens_coeff = 0.5 //They thrive on energy
brutemod = 1.25 //They're weak to punches
attack_type = BURN //burn bish
exotic_bloodtype = "E"
species_age_max = 300
Expand Down Expand Up @@ -54,6 +57,16 @@
var/obj/effect/dummy/lighting_obj/ethereal_light
var/datum/action/innate/root/rooting

siemens_coeff = 0.5 //They thrive on energy
brutemod = 1.25 //They're weak to punches

//Elzu carapace. Greatly reduces damage taken until shattered. Takes a long time to recover.
var/carapace_hp = 100
var/carapace_state = CARAPACE_FINE
var/carapace_regen_factor = CARAPACE_REGEN_MEDCHARGE
var/shattered = FALSE


/datum/species/elzuose/Destroy(force)
if(ethereal_light)
QDEL_NULL(ethereal_light)
Expand All @@ -71,7 +84,7 @@
rooting = new
rooting.Grant(_carbon)
RegisterSignal(ethereal, COMSIG_DIGOUT, PROC_REF(digout))
RegisterSignal(ethereal, COMSIG_MOVABLE_MOVED, PROC_REF(uproot))
RegisterSignal(ethereal, COMSIG_MOVABLE_MOVED, PROC_REF(elzu_move_handling))

//The following code is literally only to make admin-spawned ethereals not be black.
_carbon.dna.features["mcolor"] = _carbon.dna.features["ethcolor"] //Ethcolor and Mut color are both dogshit and will be replaced
Expand Down Expand Up @@ -125,6 +138,7 @@
stomach.adjust_charge(ROOT_CHARGE_GAIN)
_human.adjustBruteLoss(-3)
_human.adjustFireLoss(-3)
_elzu.adjust_cara_hp(CARAPACE_REGEN_FASTCHARGE)//should be okay because this is limited by charge

if(stomach.crystal_charge > ELZUOSE_CHARGE_FULL)
stomach.crystal_charge = ELZUOSE_CHARGE_FULL
Expand All @@ -141,8 +155,14 @@
_human.remove_status_effect(/datum/status_effect/rooted)
return

/datum/species/elzuose/proc/uproot(mob/living/carbon/human/_human)
//You got moved and uprooted, time to suffer the consequences.
//Handles damage from a broken carapace and the effects of being uprooted
/datum/species/elzuose/proc/elzu_move_handling(mob/living/carbon/human/_human)
//if your carapace is broken, occasionally suffer damage when moving..
if(shattered == TRUE && prob(5))
var/obj/item/bodypart/limb = pick(_human.bodyparts)
to_chat(_human, span_danger("You feel a broken shard of your carapace slice into your [limb]!"))
_human.apply_damage(5,BRUTE,limb.body_zone)//actually 10 dmg, because shatter
//If rooted, you got moved and uprooted, time to suffer the consequences.
if(_human.has_status_effect(/datum/status_effect/rooted))
_human.visible_message(span_warning("[_human] is forcefully uprooted. That looked like it hurt."),span_warning("You're forcefully unrooted! Ouch!"),span_warning("You hear someone scream in pain."))
_human.apply_damage(8,BRUTE,BODY_ZONE_CHEST)
Expand Down Expand Up @@ -236,32 +256,36 @@
/datum/species/elzuose/spec_life(mob/living/carbon/human/_human)
.=..()
handle_charge(_human)
handle_carapace(_human)

/datum/species/elzuose/proc/stop_emp(mob/living/carbon/human/_human)
EMPeffect = FALSE
spec_updatehealth(_human)
to_chat(_human, span_notice("You feel more energized as your shine comes back."))

/datum/species/elzuose/proc/handle_charge(mob/living/carbon/human/_human)
brutemod = 1.25
switch(get_charge(_human))
if(ELZUOSE_CHARGE_NONE to ELZUOSE_CHARGE_LOWPOWER)
if(get_charge(_human) == ELZUOSE_CHARGE_NONE)
_human.throw_alert("ELZUOSE_CHARGE", /atom/movable/screen/alert/etherealcharge, 3)
carapace_regen_factor = null
else
_human.throw_alert("ELZUOSE_CHARGE", /atom/movable/screen/alert/etherealcharge, 2)
carapace_regen_factor = CARAPACE_REGEN_LOWCHARGE
if(_human.health > 10.5)
apply_damage(0.2, TOX, null, null, _human)
brutemod = 1.75

if(ELZUOSE_CHARGE_LOWPOWER to ELZUOSE_CHARGE_NORMAL)
_human.throw_alert("ELZUOSE_CHARGE", /atom/movable/screen/alert/etherealcharge, 1)
brutemod = 1.5
carapace_regen_factor = CARAPACE_REGEN_MEDCHARGE

if(ELZUOSE_CHARGE_FULL to ELZUOSE_CHARGE_OVERLOAD)
_human.throw_alert("ethereal_overcharge", /atom/movable/screen/alert/ethereal_overcharge, 1)
brutemod = 1.5
carapace_regen_factor = CARAPACE_REGEN_HIGHCHARGE

if(ELZUOSE_CHARGE_OVERLOAD to ELZUOSE_CHARGE_DANGEROUS)
_human.throw_alert("ethereal_overcharge", /atom/movable/screen/alert/ethereal_overcharge, 2)
brutemod = 1.75
carapace_regen_factor = CARAPACE_REGEN_FASTCHARGE
if(prob(10)) //10% each tick for ethereals to explosively release excess energy if it reaches dangerous levels
discharge_process(_human)
else
Expand All @@ -283,11 +307,15 @@
stomach.adjust_charge(ELZUOSE_CHARGE_FULL - stomach.crystal_charge)
to_chat(_human,span_warning("You violently discharge energy!"))
_human.visible_message(span_danger("[_human] violently discharges energy!"))
if(prob(10)) //chance of developing heart disease to dissuade overcharging oneself
var/datum/disease/D = new /datum/disease/heart_failure
_human.ForceContractDisease(D)
to_chat(_human, span_userdanger("You're pretty sure you just felt your heart stop for a second there."))
_human.playsound_local(_human, 'sound/effects/singlebeat.ogg', 100, 0)
if(prob(15)) //May damage the heart. If the heart is damaged enough, triggers heart failure.
var/obj/item/organ/heart/heart = _human.getorganslot(ORGAN_SLOT_HEART)
to_chat(_human, span_danger("Your chest aches."))
heart.damage += 5
if(heart.damage >= 50)
var/datum/disease/D = new /datum/disease/heart_failure
_human.ForceContractDisease(D)
to_chat(_human, span_userdanger("You're pretty sure you just felt your heart stop for a second there."))
_human.playsound_local(_human, 'sound/effects/singlebeat.ogg', 100, 0)
_human.Paralyze(100)
return

Expand All @@ -296,3 +324,88 @@
if(istype(stomach))
return stomach.crystal_charge
return ELZUOSE_CHARGE_NONE

//CARAPACE CODE STUFF//

//handles the life tick involved with carapace behavior
/datum/species/elzuose/proc/handle_carapace(mob/living/carbon/human/_human)
//var/examine_string = _human.get_examine_string(_human, thats = TRUE)
//passive carapace regeneration
adjust_cara_hp(carapace_regen_factor)
switch(carapace_hp)
if(85.01 to 100)
carapace_state = CARAPACE_FINE
_human.throw_alert("ELZUOSE_CARAPACE", /atom/movable/screen/alert/elzucarapace, 1)
//examine_string += span_warning("test fine") //this doesn't work :(
if(40.01 to 85)
carapace_state = CARAPACE_DAMAGED
_human.throw_alert("ELZUOSE_CARAPACE", /atom/movable/screen/alert/elzucarapace, 2)
//examine_string += span_warning("test damaged")
if(7.01 to 40)
carapace_state = CARAPACE_BREAKING
_human.throw_alert("ELZUOSE_CARAPACE", /atom/movable/screen/alert/elzucarapace, 3)
if(shattered == TRUE)
toggle_carapace_break(_human)
if(1 to 7)
carapace_state = CARAPACE_BROKEN
_human.throw_alert("ELZUOSE_CARAPACE", /atom/movable/screen/alert/elzucarapace, 4)
if(shattered == FALSE)
toggle_carapace_break(_human)
else
_human.clear_alert("ELZUOSE_CARAPACE")

/datum/species/elzuose/proc/adjust_cara_hp(amount)
carapace_hp = clamp(carapace_hp + amount, 1, 100)
return

/datum/species/elzuose/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H, forced = FALSE, spread_damage = FALSE, break_modifier = 1, sharpness = FALSE)
if((damagetype == BRUTE || damagetype == BURN) && damage)
var/newdam = damage_to_carapace(damage, damagetype)
damage = newdam

. = ..()

//handles the absorption of damage by elzu carapace.
//Basically, use brute force to smash an elzu- okay maybe don't say it like tha
/datum/species/elzuose/proc/damage_to_carapace(damage, damagetype)
//reduce damage proportunate to current carapace hp. 75% reduction at full carapace.
//one of the math operations of all time
var/new_damage = max(damage * ((100 - carapace_hp * 0.75) / 100), 1)
//transfers a portion of damage taken to carapace.
switch(damagetype)
if(BRUTE)
adjust_cara_hp((damage * -0.3))//30%
if(BURN)
adjust_cara_hp((damage * -0.1))//10%
return new_damage

/datum/species/elzuose/proc/toggle_carapace_break(mob/living/carbon/human/_human)
if(shattered == FALSE)
shattered = TRUE
_human.do_jitter_animation(4)
_human.visible_message(span_warning("[_human] jolts with a terrible cracking noise!"), span_userdanger("You feel a stabbing pain spread under your skin as your carapace shatters!"))
//when carapace fully breaks, damage taken greatly increased
brutemod = 2
burnmod = 1.50
playsound(_human.loc, 'sound/effects/woodbreak.ogg', 25, FALSE, 2)
else
shattered = FALSE
brutemod = 1.25
burnmod = 1

//CHEM EFFECTS

/datum/species/elzuose/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
//var/obj/item/organ/stomach/ethereal/stomach = H.getorganslot(ORGAN_SLOT_STOMACH)
//consuming minerals simulates repair of an elzu's carapace.
//we don't have actual silicate so silicon is filling in for a "mineral deposit" chemical, as it does in sand
if(chem.type == /datum/reagent/silicon || /datum/reagent/iron || /datum/reagent/consumable/sodiumchloride)
adjust_cara_hp(CARAPACE_REGEN_HIGHCHARGE)
H.reagents.remove_reagent(chem.type, chem.metabolization_rate * 3)//om nom nom (this technically 'nerfs' Iron I guess?)
return TRUE
//incredibly shitty mineral
if(chem.type == /datum/reagent/consumable/sodiumchloride)
adjust_cara_hp(CARAPACE_REGEN_LOWCHARGE)
H.reagents.remove_reagent(chem.type, chem.metabolization_rate * 3)
return TRUE
return ..()
1 change: 1 addition & 0 deletions code/modules/reagents/chemistry/reagents/other_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@
H.reagents.add_reagent(/datum/reagent/hydrogen, (hydrogen-base))
return TRUE
return

/datum/reagent/fuel
name = "Welding fuel"
description = "Required for welders. Flammable."
Expand Down
Binary file modified icons/hud/screen_alert.dmi
Binary file not shown.
Binary file added sound/effects/woodbreak.ogg
Binary file not shown.
Loading