Skip to content

Commit

Permalink
Lets twitch work on synthetics, gives a special downside if you're a …
Browse files Browse the repository at this point in the history
…machine or don't need your heart (#660)

* later

* oopsies!

* fixes some other stuff, tweaks the filter some

* that filter stuff did NOT change anything

* actually fixes twitch's overlay animation

* fixes it for real for real this time

* Update modular_nova/modules/deforest_medical_items/code/chemicals/twitch.dm

Co-authored-by: Bloop <[email protected]>

* Update modular_nova/modules/deforest_medical_items/code/chemicals/twitch.dm

Co-authored-by: Bloop <[email protected]>

* Update modular_nova/modules/deforest_medical_items/code/chemicals/twitch.dm

Co-authored-by: Bloop <[email protected]>

* Update modular_nova/modules/deforest_medical_items/code/chemicals/twitch.dm

Co-authored-by: Bloop <[email protected]>

---------

Co-authored-by: Bloop <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Feb 18, 2024
1 parent 30dfd4c commit 0c3b313
Showing 1 changed file with 53 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@
overdose_threshold = 15
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
addiction_types = list(/datum/addiction/stimulants = 20)
process_flags = REAGENT_ORGANIC | REAGENT_SYNTHETIC
/// How much time has the drug been in them?
var/constant_dose_time = 0
/// What type of span class do we change heard speech to?
var/speech_effect_span
/// How much the mob heating is multiplied by, if the target is a robot or has muscled veins
var/mob_heating_muliplier = 5


/datum/reagent/drug/twitch/on_mob_metabolize(mob/living/our_guy)
Expand All @@ -61,11 +64,11 @@

game_plane_master_controller.add_filter(TWITCH_SCREEN_FILTER, 10, color_matrix_filter(col_filter_green, FILTER_COLOR_RGB))

game_plane_master_controller.add_filter(TWITCH_SCREEN_BLUR, 1, list("type" = "radial_blur", "size" = 0.1))
game_plane_master_controller.add_filter(TWITCH_SCREEN_BLUR, 1, list("type" = "radial_blur", "size" = 0.02))

for(var/filter in game_plane_master_controller.get_filters("twitch_blur"))
animate(filter, loop = -1, size = 0.2, time = 2 SECONDS, easing = ELASTIC_EASING|EASE_OUT, flags = ANIMATION_PARALLEL)
animate(size = 0.1, time = 6 SECONDS, easing = CIRCULAR_EASING|EASE_IN)
for(var/filter in game_plane_master_controller.get_filters(TWITCH_SCREEN_BLUR))
animate(filter, loop = -1, size = 0.04, time = 2 SECONDS, easing = ELASTIC_EASING|EASE_OUT, flags = ANIMATION_PARALLEL)
animate(size = 0.02, time = 6 SECONDS, easing = CIRCULAR_EASING|EASE_IN)


/datum/reagent/drug/twitch/on_mob_end_metabolize(mob/living/carbon/our_guy)
Expand All @@ -84,18 +87,31 @@
UnregisterSignal(our_guy, COMSIG_ATOM_PRE_BULLET_ACT)

if(constant_dose_time < CONSTANT_DOSE_SAFE_LIMIT) // Anything less than this and you'll come out fiiiine, aside from a big hit of stamina damage
our_guy.visible_message(
span_danger("[our_guy] suddenly slows from their inhuman speeds, coming back with a wicked nosebleed!"),
span_danger("You suddenly slow back to normal, a stream of blood gushing from your nose!")
)
if(!(our_guy.mob_biotypes & MOB_ROBOTIC))
our_guy.visible_message(
span_danger("[our_guy] suddenly slows from [our_guy.p_their()] inhuman speeds, coming back with a wicked nosebleed!"),
span_danger("You suddenly slow back to normal, a stream of blood gushing from your nose!")
)
else
our_guy.visible_message(
span_danger("[our_guy] suddenly slows from [our_guy.p_their()] inhuman speeds!"),
span_danger("You suddenly slow back to normal speed!")
)
our_guy.adjustStaminaLoss(constant_dose_time)

else // Much longer than that however, and you're not gonna have a good day
our_guy.visible_message(
span_danger("[our_guy] suddenly snaps back from their inhumans speeds, coughing up a spray of blood!"),
span_danger("As you snap back to normal speed you cough up a worrying amount of blood. You feel like you've just been run over by a power loader.")
)
our_guy.spray_blood(our_guy.dir, 2) // The before mentioned coughing up blood
our_guy.emote("cough")
if(!(our_guy.mob_biotypes & MOB_ROBOTIC))
our_guy.spray_blood(our_guy.dir, 2) // The before mentioned coughing up blood
our_guy.emote("cough")
our_guy.visible_message(
span_danger("[our_guy] suddenly snaps back from [our_guy.p_their()] inhuman speeds, coughing up a spray of blood!"),
span_danger("As you snap back to normal speed you cough up a worrying amount of blood. You feel like you've just been run over by a power loader.")
)
else
our_guy.visible_message(
span_danger("[our_guy] suddenly snaps back from [our_guy.p_their()] inhuman speeds!"),
span_danger("You suddenly snap back to normal speeds. You feel like you've just been run over by a power loader.")
)
our_guy.adjustStaminaLoss(constant_dose_time)
if(!HAS_TRAIT(our_guy, TRAIT_TWITCH_ADAPTED))
our_guy.adjustOrganLoss(ORGAN_SLOT_HEART, 0.3 * constant_dose_time) // Basically you might die
Expand Down Expand Up @@ -136,7 +152,17 @@

constant_dose_time += seconds_per_tick

our_guy.adjustOrganLoss(ORGAN_SLOT_HEART, 0.1 * REM * seconds_per_tick)
// If the target is a robot, or has muscle veins, then they get an effect similar to herignis, heating them up quite a bit
if((our_guy.mob_biotypes & MOB_ROBOTIC) || HAS_TRAIT(our_guy, TRAIT_STABLEHEART))
var/heating = mob_heating_muliplier * creation_purity * REM * seconds_per_tick
our_guy.reagents?.chem_temp += heating
our_guy.adjust_bodytemperature(heating * TEMPERATURE_DAMAGE_COEFFICIENT)
if(!ishuman(our_guy))
return
var/mob/living/carbon/human/human = our_guy
human.adjust_coretemperature(heating * TEMPERATURE_DAMAGE_COEFFICIENT)
else
our_guy.adjustOrganLoss(ORGAN_SLOT_HEART, 0.1 * REM * seconds_per_tick)

if(locate(/datum/reagent/drug/kronkaine) in our_guy.reagents.reagent_list) // Kronkaine, another heart-straining drug, could cause problems if mixed with this
our_guy.ForceContractDisease(new /datum/disease/adrenal_crisis(), FALSE, TRUE)
Expand Down Expand Up @@ -164,10 +190,20 @@
. = ..()
our_guy.set_jitter_if_lower(10 SECONDS * REM * seconds_per_tick)

our_guy.adjustOrganLoss(ORGAN_SLOT_HEART, 1 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags)
// If the target is a robot, or has muscle veins, then they get an effect similar to herignis, heating them up quite a bit
if((our_guy.mob_biotypes & MOB_ROBOTIC) || HAS_TRAIT(our_guy, TRAIT_STABLEHEART))
var/heating = (mob_heating_muliplier * 2) * creation_purity * REM * seconds_per_tick
our_guy.reagents?.chem_temp += heating
our_guy.adjust_bodytemperature(heating * TEMPERATURE_DAMAGE_COEFFICIENT)
if(!ishuman(our_guy))
return
var/mob/living/carbon/human/human = our_guy
human.adjust_coretemperature(heating * TEMPERATURE_DAMAGE_COEFFICIENT)
else
our_guy.adjustOrganLoss(ORGAN_SLOT_HEART, 1 * REM * seconds_per_tick, required_organ_flag = affected_organ_flags)
our_guy.adjustToxLoss(1 * REM * seconds_per_tick, updating_health = FALSE, forced = TRUE, required_biotype = affected_biotype)

if(SPT_PROB(5, seconds_per_tick))
if(SPT_PROB(5, seconds_per_tick) && !(our_guy.mob_biotypes & MOB_ROBOTIC))
to_chat(our_guy, span_danger("You cough up a splatter of blood!"))
our_guy.spray_blood(our_guy.dir, 1)
our_guy.emote("cough")
Expand Down

0 comments on commit 0c3b313

Please sign in to comment.