Skip to content

Commit

Permalink
Rust heretic buffs
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy committed Apr 7, 2024
1 parent 87fd9b1 commit a78529a
Show file tree
Hide file tree
Showing 9 changed files with 200 additions and 7 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/~monkestation/actionspeed_modification.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define ACTIONSPEED_ID_RUST_HEALING "rust_healing"
8 changes: 6 additions & 2 deletions code/__DEFINES/~monkestation/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
#define TRAIT_ALL_SURGERIES "all_surgeries"
/// Prevents the user from ever (unintentionally) failing a surgery step, and ensures they always have the maximum surgery speed.
#define TRAIT_PERFECT_SURGEON "perfect_surgeon"
/// Station trait for when the clown has bridge access *shudders*
#define STATION_TRAIT_CLOWN_BRIDGE "clown_bridge"
/// Trait to track where leeching walk/rust healing has given the user a physiology buff.
#define TRAIT_RUST_PHYSIOLOGY_BUFF "rust_physiology_buff"

// /obj/item
/// Whether a storage item can be compressed by the bluespace compression kit, without the usual storage limitation.
#define TRAIT_BYPASS_COMPRESS_CHECK "can_compress_anyways"

// Station traits
/// Station trait for when the clown has bridge access *shudders*
#define STATION_TRAIT_CLOWN_BRIDGE "clown_bridge"
8 changes: 6 additions & 2 deletions code/game/turfs/closed/wall/mineral_walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,10 @@
canSmoothWith = SMOOTH_GROUP_SHUTTLE_PARTS + SMOOTH_GROUP_AIRLOCK + SMOOTH_GROUP_TITANIUM_WALLS
custom_materials = list(/datum/material/titanium = SHEET_MATERIAL_AMOUNT*2)

/*
/turf/closed/wall/mineral/titanium/rust_heretic_act()
return // titanium does not rust
return // titanium does not rust - monkestation edit: fuck you it's magic i ain't gotta explain shit
*/

/turf/closed/wall/mineral/titanium/nodiagonal
icon = 'icons/turf/walls/shuttle_wall.dmi'
Expand Down Expand Up @@ -323,8 +325,10 @@
canSmoothWith = SMOOTH_GROUP_SHUTTLE_PARTS + SMOOTH_GROUP_AIRLOCK + SMOOTH_GROUP_PLASTITANIUM_WALLS + SMOOTH_GROUP_SYNDICATE_WALLS
custom_materials = list(/datum/material/alloy/plastitanium = SHEET_MATERIAL_AMOUNT*2)

/*
/turf/closed/wall/mineral/plastitanium/rust_heretic_act()
return // plastitanium does not rust
return // plastitanium does not rust - monkestation edit: fuck you it's magic i ain't gotta explain shit
*/

/turf/closed/wall/mineral/plastitanium/nodiagonal
icon = 'icons/turf/walls/plastitanium_wall.dmi'
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/open/floor/fancy_floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
icon_state = "wood"
floor_tile = /obj/item/stack/tile/wood
footstep = FOOTSTEP_WOOD
turf_flags = NO_RUST
//turf_flags = NO_RUST - monkestation edit: it's magic, i ain't gotta explain shit
barefootstep = FOOTSTEP_WOOD_BAREFOOT
clawfootstep = FOOTSTEP_WOOD_CLAW
heavyfootstep = FOOTSTEP_GENERIC_HEAVY
Expand Down
8 changes: 6 additions & 2 deletions code/game/turfs/open/floor/mineral_floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@
/turf/open/floor/mineral/titanium/broken_states()
return list("damaged1", "damaged2", "damaged3", "damaged4", "damaged5")

/*
/turf/open/floor/mineral/titanium/rust_heretic_act()
return // titanium does not rust
return // titanium does not rust - monkestation edit: fuck you it's magic i ain't gotta explain shit
*/

/turf/open/floor/mineral/titanium/airless
initial_gas_mix = AIRLESS_ATMOS
Expand Down Expand Up @@ -157,8 +159,10 @@
/turf/open/floor/mineral/plastitanium/broken_states()
return list("damaged1", "damaged2", "damaged3", "damaged4", "damaged5")

/*
/turf/open/floor/mineral/plastitanium/rust_heretic_act()
return // plastitanium does not rust
return // plastitanium does not rust - monkestation edit: fuck you it's magic i ain't gotta explain shit
*/

/turf/open/floor/mineral/plastitanium/airless
initial_gas_mix = AIRLESS_ATMOS
Expand Down
2 changes: 2 additions & 0 deletions code/modules/antagonists/heretic/knowledge/rust_lore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
cost = 1
route = PATH_RUST

/* Replaced in monkestation\code\modules\antagonists\heretic\knowledge\rust_lore.dm
/datum/heretic_knowledge/rust_regen/on_gain(mob/user, datum/antagonist/heretic/our_heretic)
RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(on_move))
RegisterSignal(user, COMSIG_LIVING_LIFE, PROC_REF(on_life))
Expand Down Expand Up @@ -139,6 +140,7 @@
// Heals blood loss
if(source.blood_volume < BLOOD_VOLUME_NORMAL)
source.blood_volume += 2.5 * seconds_per_tick
*/

/datum/heretic_knowledge/mark/rust_mark
name = "Mark of Rust"
Expand Down
156 changes: 156 additions & 0 deletions monkestation/code/datums/status_effects/buffs/rust_heal.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/datum/status_effect/rust_heal
id = "Leeching Walk"
alert_type = /atom/movable/screen/alert/status_effect/rust_heal
/// How much total damage to heal per tick.
var/total_split_healing = 5
/// How much total immobility to heal per tick.
var/immobility_healing = 0.75 SECONDS
/// How much blood to regenerate per tick.
var/blood_regen = 1.5
/// How many fire stacks to remove per tick.
var/fire_extinguish_rate = 1
/// How many units of losebreath to regenerate per tick.
var/losebreath_regen_rate = 0.5
/// Traits to grant to the owner while active, regardless of their path.
var/list/traits_to_give_all = list(
TRAIT_BATON_RESISTANCE,
TRAIT_HARDLY_WOUNDED,
TRAIT_NOFLASH,
TRAIT_NOLIMBDISABLE
)
/// Traits to exclusively give to rust path heretics while active.
var/list/traits_to_give_rust = list(
TRAIT_IGNOREDAMAGESLOWDOWN,
TRAIT_NOCRITDAMAGE,
TRAIT_NO_SLIP_WATER,
TRAIT_PIERCEIMMUNE,
TRAIT_PUSHIMMUNE,
TRAIT_RADSTORM_IMMUNE,
TRAIT_SLEEPIMMUNE,
TRAIT_STABLEHEART,
TRAIT_STABLELIVER
)

/datum/status_effect/rust_heal/on_apply()
. = ..()
if(!rusty_check())
return
apply_rust_path_bonuses()
owner.add_traits(traits_to_give_all, id)

/datum/status_effect/rust_heal/on_remove()
. = ..()
remove_physiology_buff()
owner.remove_actionspeed_modifier(/datum/actionspeed_modifier/rust_heal)
REMOVE_TRAITS_IN(owner, id)

/datum/status_effect/rust_heal/tick(seconds_per_tick, times_fired)
if(!rusty_check())
return
if(isoozeling(owner) && owner.nutrition <= NUTRITION_LEVEL_HUNGRY)
owner.adjust_nutrition(blood_regen * 2 * seconds_per_tick)
heal_damage(seconds_per_tick)
mend_bleeding(seconds_per_tick)

/datum/status_effect/rust_heal/proc/grant_physiology_buff()
var/mob/living/carbon/human/human_owner = owner
if(!istype(human_owner) || QDELETED(human_owner.physiology) || HAS_TRAIT(owner, TRAIT_RUST_PHYSIOLOGY_BUFF))
return
human_owner.physiology.brute_mod *= 0.8
human_owner.physiology.burn_mod *= 0.8
human_owner.physiology.oxy_mod *= 0.8
human_owner.physiology.stamina_mod *= 0.8
human_owner.physiology.pressure_mod *= 0.3
human_owner.physiology.heat_mod *= 0.3
human_owner.physiology.cold_mod *= 0.3
human_owner.physiology.siemens_coeff *= 0.3
human_owner.physiology.stun_mod *= 0.5
human_owner.physiology.bleed_mod *= 0.25
human_owner.physiology.hunger_mod *= 0.25
ADD_TRAIT(human_owner, TRAIT_RUST_PHYSIOLOGY_BUFF, id)

/datum/status_effect/rust_heal/proc/remove_physiology_buff()
var/mob/living/carbon/human/human_owner = owner
if(!istype(human_owner) || QDELETED(human_owner.physiology) || !HAS_TRAIT_FROM(owner, TRAIT_RUST_PHYSIOLOGY_BUFF, id))
return
human_owner.physiology.brute_mod /= 0.8
human_owner.physiology.burn_mod /= 0.8
human_owner.physiology.oxy_mod /= 0.8
human_owner.physiology.stamina_mod /= 0.8
human_owner.physiology.pressure_mod /= 0.3
human_owner.physiology.heat_mod /= 0.3
human_owner.physiology.cold_mod /= 0.3
human_owner.physiology.siemens_coeff /= 0.3
human_owner.physiology.stun_mod /= 0.5
human_owner.physiology.bleed_mod /= 0.25
human_owner.physiology.hunger_mod /= 0.25
REMOVE_TRAIT(human_owner, TRAIT_RUST_PHYSIOLOGY_BUFF, id)

/datum/status_effect/rust_heal/proc/apply_rust_path_bonuses()
var/datum/antagonist/heretic/heretic = IS_HERETIC(owner)
if(heretic?.heretic_path != PATH_RUST)
return
total_split_healing = 8
immobility_healing = 1.2 SECONDS
blood_regen = 2.5
fire_extinguish_rate = 2
losebreath_regen_rate = 1
owner.add_actionspeed_modifier(/datum/actionspeed_modifier/rust_heal)
owner.add_traits(traits_to_give_rust, id)
grant_physiology_buff()

/*
* Heals the owner's damage + stamina.
* The less different types of damage you have, the more you heal per type.
*/
/datum/status_effect/rust_heal/proc/heal_damage(seconds_per_tick)
owner.adjust_fire_stacks(-round(fire_extinguish_rate * seconds_per_tick))
owner.losebreath = max(owner.losebreath - losebreath_regen_rate * seconds_per_tick, 0)
var/types_to_heal = (owner.getBruteLoss() > 0) + (owner.getFireLoss() > 0) + (owner.getToxLoss() > 0) + (owner.getOxyLoss() > 0) + (owner.getCloneLoss() > 0) + (owner.stamina.loss > 0)
if(types_to_heal > 0)
var/amt_to_heal = (total_split_healing / types_to_heal) * seconds_per_tick
if(owner.has_status_effect(/datum/status_effect/determined))
amt_to_heal *= 1.25
amt_to_heal = CEILING(amt_to_heal, 0.5)
owner.heal_overall_damage(brute = amt_to_heal, burn = amt_to_heal, updating_health = FALSE)
owner.stamina.adjust(amt_to_heal, forced = TRUE)
owner.adjustToxLoss(-amt_to_heal, updating_health = FALSE, forced = TRUE)
owner.adjustOxyLoss(-amt_to_heal, updating_health = FALSE)
owner.adjustCloneLoss(-amt_to_heal, updating_health = FALSE)
owner.AdjustAllImmobility(-immobility_healing * seconds_per_tick)
owner.updatehealth()

/*
* Slow and stop any blood loss the owner's experiencing.
*/
/datum/status_effect/rust_heal/proc/mend_bleeding(seconds_per_tick)
if(!iscarbon(owner) || !owner.blood_volume || HAS_TRAIT(owner, TRAIT_NOBLOOD))
return
var/mob/living/carbon/carbon_owner = owner
var/datum/wound/bloodiest_wound
for(var/datum/wound/iter_wound as anything in carbon_owner.all_wounds)
if(iter_wound.blood_flow && (iter_wound.blood_flow > bloodiest_wound?.blood_flow))
bloodiest_wound = iter_wound
bloodiest_wound?.adjust_blood_flow(-blood_regen * seconds_per_tick)
if(owner.blood_volume < BLOOD_VOLUME_NORMAL)
owner.blood_volume += blood_regen * seconds_per_tick

/*
* Check if the owner is standing on a rusty turf,
* removing the status effect if they're not.
*/
/datum/status_effect/rust_heal/proc/rusty_check()
var/turf/our_turf = get_turf(owner)
if(QDELETED(our_turf) || !HAS_TRAIT(our_turf, TRAIT_RUSTY))
qdel(src)
return FALSE
return TRUE

/atom/movable/screen/alert/status_effect/rust_heal
name = "Leeching Walk"
desc = "The rusted ground you walk on empowers you, making you far more resilient."
icon_state = "regenerative_core"

/datum/actionspeed_modifier/rust_heal
multiplicative_slowdown = -0.3
id = ACTIONSPEED_ID_RUST_HEALING
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/datum/heretic_knowledge/rust_regen/on_gain(mob/living/user, datum/antagonist/heretic/our_heretic)
RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(on_move))

/datum/heretic_knowledge/rust_regen/on_lose(mob/living/user, datum/antagonist/heretic/our_heretic)
UnregisterSignal(user, COMSIG_MOVABLE_MOVED)

/*
* Signal proc for [COMSIG_MOVABLE_MOVED].
*
* Applies the rusty healing status effect on rust terfs, and removes it on non-rust turfs.
*/
/datum/heretic_knowledge/rust_regen/proc/on_move(mob/living/source, atom/old_loc, dir, forced, list/old_locs)
SIGNAL_HANDLER

var/turf/mover_turf = get_turf(source)
if(!QDELETED(mover_turf) && HAS_TRAIT(mover_turf, TRAIT_RUSTY))
source.apply_status_effect(/datum/status_effect/rust_heal)
else
source.remove_status_effect(/datum/status_effect/rust_heal)
3 changes: 3 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@
#include "code\__DEFINES\research\research_categories.dm"
#include "code\__DEFINES\~monkestation\_patreon.dm"
#include "code\__DEFINES\~monkestation\access.dm"
#include "code\__DEFINES\~monkestation\actionspeed_modification.dm"
#include "code\__DEFINES\~monkestation\admin.dm"
#include "code\__DEFINES\~monkestation\ai.dm"
#include "code\__DEFINES\~monkestation\alerts.dm"
Expand Down Expand Up @@ -5713,6 +5714,7 @@
#include "monkestation\code\datums\status_effects\buffs.dm"
#include "monkestation\code\datums\status_effects\disorient.dm"
#include "monkestation\code\datums\status_effects\food_buffs.dm"
#include "monkestation\code\datums\status_effects\buffs\rust_heal.dm"
#include "monkestation\code\datums\storage\storage.dm"
#include "monkestation\code\datums\wires\particle_accelerator.dm"
#include "monkestation\code\game\atom.dm"
Expand Down Expand Up @@ -5923,6 +5925,7 @@
#include "monkestation\code\modules\antagonists\heretic\items\forbidden_book.dm"
#include "monkestation\code\modules\antagonists\heretic\items\heretic_armor.dm"
#include "monkestation\code\modules\antagonists\heretic\knowledge\ash_lore.dm"
#include "monkestation\code\modules\antagonists\heretic\knowledge\rust_lore.dm"
#include "monkestation\code\modules\antagonists\heretic\knowledge\sacrifice_knowledge\sacrifice_buff.dm"
#include "monkestation\code\modules\antagonists\nukeop\equipment\nuclear_bomb\bee_nuke.dm"
#include "monkestation\code\modules\antagonists\slasher\__base_slasher_additions.dm"
Expand Down

0 comments on commit a78529a

Please sign in to comment.