diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 38f63b681b2..3401fdf9cf0 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -1297,6 +1297,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// This should not be used on clothing_traits, but should be applied to the clothing itself. #define TRAIT_RADIATION_PROTECTED_CLOTHING "radiation_protected_clothing" +/// Immune to the effects of rust +#define TRAIT_RUSTIMMUNE "rust_immune" + /// Whether or not this item will allow the radiation SS to go through standard /// radiation processing as if this wasn't already irradiated. /// Basically, without this, COMSIG_IN_RANGE_OF_IRRADIATION won't fire once the object is irradiated. diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 3124abd35d7..93dba65dd44 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -30,6 +30,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_MESSAGE_IN_A_BOTTLE_LOCATION" = TRAIT_MESSAGE_IN_A_BOTTLE_LOCATION, "TRAIT_QUALITY_FOOD_INGREDIENT" = TRAIT_QUALITY_FOOD_INGREDIENT, "TRAIT_RECENTLY_COINED" = TRAIT_RECENTLY_COINED, + "TRAIT_RUSTIMMUNE" = TRAIT_RUSTIMMUNE, "TRAIT_RUSTY" = TRAIT_RUSTY, "TRAIT_SPINNING" = TRAIT_SPINNING, "TRAIT_STICKERED" = TRAIT_STICKERED, diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index d44821c7857..b369f8cc814 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -6,6 +6,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( /atom = list( "TRAIT_CATCH_AND_RELEASE" = TRAIT_CATCH_AND_RELEASE, "TRAIT_KEEP_TOGETHER" = TRAIT_KEEP_TOGETHER, + "TRAIT_RUSTIMMUNE" = TRAIT_RUSTIMMUNE, "TRAIT_UNHITTABLE_BY_PROJECTILES" = TRAIT_UNHITTABLE_BY_PROJECTILES, "TRAIT_UNHITTABLE_BY_LASERS" = TRAIT_UNHITTABLE_BY_LASERS, ), diff --git a/code/datums/elements/leeching_walk.dm b/code/datums/elements/leeching_walk.dm deleted file mode 100644 index 25ecb3fe1f9..00000000000 --- a/code/datums/elements/leeching_walk.dm +++ /dev/null @@ -1,67 +0,0 @@ -/// Buffs and heals the target while standing on rust. -/datum/element/leeching_walk - var/healing_multiplier = 1.0 // How much healing to do - -/datum/element/leeching_walk/Attach(datum/target) - . = ..() - if (!isliving(target)) - return ELEMENT_INCOMPATIBLE - - RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(on_move)) - RegisterSignal(target, COMSIG_LIVING_LIFE, PROC_REF(on_life)) - -/datum/element/leeching_walk/Detach(datum/source) - . = ..() - UnregisterSignal(source, list(COMSIG_MOVABLE_MOVED, COMSIG_LIVING_LIFE)) - -/* - * Signal proc for [COMSIG_MOVABLE_MOVED]. - * - * Checks if we should have baton resistance on the new turf. - */ -/datum/element/leeching_walk/proc/on_move(mob/source, atom/old_loc, dir, forced, list/old_locs) - SIGNAL_HANDLER - - var/turf/mover_turf = get_turf(source) - if(HAS_TRAIT(mover_turf, TRAIT_RUSTY)) - ADD_TRAIT(source, TRAIT_BATON_RESISTANCE, type) - else - REMOVE_TRAIT(source, TRAIT_BATON_RESISTANCE, type) - -/** - * Signal proc for [COMSIG_LIVING_LIFE]. - * - * Gradually heals the heretic ([source]) on rust, - * including baton knockdown and stamina damage. - */ -/datum/element/leeching_walk/proc/on_life(mob/living/source, seconds_per_tick) - SIGNAL_HANDLER - - var/turf/our_turf = get_turf(source) - if(!HAS_TRAIT(our_turf, TRAIT_RUSTY)) - return - - // Heals all damage + Stamina - var/need_mob_update = FALSE - var/delta_time = DELTA_WORLD_TIME(SSmobs) * 0.5 // SSmobs.wait is 2 secs, so this should be halved. - need_mob_update += source.adjust_brute_loss(-3 * delta_time * healing_multiplier, updating_health = FALSE) - need_mob_update += source.adjust_fire_loss(-3 * delta_time * healing_multiplier, updating_health = FALSE) - need_mob_update += source.adjust_tox_loss(-3 * delta_time * healing_multiplier, updating_health = FALSE, forced = TRUE) // Slimes are people too - need_mob_update += source.adjust_oxy_loss(-1.5 * delta_time * healing_multiplier, updating_health = FALSE) - need_mob_update += source.adjust_stamina_loss(-10 * delta_time * healing_multiplier, updating_stamina = FALSE) - if(need_mob_update) - source.updatehealth() - new /obj/effect/temp_visual/heal(get_turf(source), COLOR_BROWN) - // Reduces duration of stuns/etc - source.AdjustAllImmobility((-0.5 SECONDS) * delta_time) - // Heals blood loss - source.adjust_blood_volume(2.5 * delta_time, maximum = BLOOD_VOLUME_NORMAL) - // Slowly regulates your body temp - source.adjust_bodytemperature((source.get_body_temp_normal() - source.bodytemperature) / 5) - -/datum/element/leeching_walk/minor - healing_multiplier = 0.5 - -// Minor variant which heals slightly less and no baton resistance -/datum/element/leeching_walk/minor/on_move(mob/source, atom/old_loc, dir, forced, list/old_locs) - return diff --git a/code/datums/elements/rust.dm b/code/datums/elements/rust.dm index 91bcd038d57..2f3ce383832 100644 --- a/code/datums/elements/rust.dm +++ b/code/datums/elements/rust.dm @@ -115,6 +115,9 @@ /datum/element/rust/heretic/proc/on_entered(turf/source, atom/movable/entered, ...) SIGNAL_HANDLER + if (HAS_TRAIT(entered, TRAIT_RUSTIMMUNE) || HAS_TRAIT(entered, TRAIT_MAGICALLY_PHASED) || entered.movement_type & (MOVETYPES_NOT_TOUCHING_GROUND | VENTCRAWLING)) + return + if(ismecha(entered)) var/obj/vehicle/sealed/mecha/victim = entered victim.take_damage(20, armour_penetration = 100) diff --git a/code/datums/elements/rust_healing.dm b/code/datums/elements/rust_healing.dm new file mode 100644 index 00000000000..bb899b98937 --- /dev/null +++ b/code/datums/elements/rust_healing.dm @@ -0,0 +1,68 @@ +/// Buffs and heals the target while standing on rust. +/datum/element/rust_healing + element_flags = ELEMENT_BESPOKE + argument_hash_start_idx = 2 + /// How much HP to heal per second + var/heal_amount + /// How much stamina to heal per second + var/stamina_heal_amount + +/datum/element/rust_healing/Attach(atom/target, baton_resistance = TRUE, heal_amount = 3, stamina_heal_amount = 10) + . = ..() + if (!isliving(target)) + return ELEMENT_INCOMPATIBLE + + if (baton_resistance) + RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(on_move)) + RegisterSignal(target, COMSIG_LIVING_LIFE, PROC_REF(on_life)) + + src.heal_amount = heal_amount + src.stamina_heal_amount = stamina_heal_amount + ADD_TRAIT(target, TRAIT_RUSTIMMUNE, ELEMENT_TRAIT(type)) + +/datum/element/rust_healing/Detach(atom/source) + . = ..() + UnregisterSignal(source, list(COMSIG_MOVABLE_MOVED, COMSIG_LIVING_LIFE)) + REMOVE_TRAIT(source, TRAIT_RUSTIMMUNE, ELEMENT_TRAIT(type)) + +/* + * Signal proc for [COMSIG_MOVABLE_MOVED]. + * + * Checks if we should have baton resistance on the new turf. + */ +/datum/element/rust_healing/proc/on_move(mob/source, atom/old_loc, dir, forced, list/old_locs) + SIGNAL_HANDLER + + if(source.is_touching_rust()) + ADD_TRAIT(source, TRAIT_BATON_RESISTANCE, type) + else + REMOVE_TRAIT(source, TRAIT_BATON_RESISTANCE, type) + +/** + * Signal proc for [COMSIG_LIVING_LIFE]. + * + * Gradually heals the heretic ([source]) on rust, + * including baton knockdown and stamina damage. + */ +/datum/element/rust_healing/proc/on_life(mob/living/source, seconds_per_tick) + SIGNAL_HANDLER + if(!source.is_touching_rust()) + return + + // Heals all damage + Stamina + var/need_mob_update = FALSE + var/delta_time = DELTA_WORLD_TIME(SSmobs) * 0.5 // SSmobs.wait is 2 secs, so this should be halved. + need_mob_update += source.adjust_brute_loss(-heal_amount * delta_time, updating_health = FALSE) + need_mob_update += source.adjust_fire_loss(-heal_amount * delta_time, updating_health = FALSE) + need_mob_update += source.adjust_tox_loss(-heal_amount * delta_time, updating_health = FALSE, forced = TRUE) // Slimes are people too + need_mob_update += source.adjust_oxy_loss(-heal_amount / 2 * delta_time, updating_health = FALSE) + need_mob_update += source.adjust_stamina_loss(-stamina_heal_amount * delta_time, updating_stamina = FALSE) + if(need_mob_update) + source.updatehealth() + new /obj/effect/temp_visual/heal(get_turf(source), COLOR_BROWN) + // Reduces duration of stuns/etc + source.AdjustAllImmobility((-0.5 SECONDS) * delta_time) + // Heals blood loss + source.adjust_blood_volume(2.5 * delta_time, maximum = BLOOD_VOLUME_NORMAL) + // Slowly regulates your body temp + source.adjust_bodytemperature((source.get_body_temp_normal() - source.bodytemperature) / 5) diff --git a/code/game/atom/atom_act.dm b/code/game/atom/atom_act.dm index 2a0475302b4..233060015dc 100644 --- a/code/game/atom/atom_act.dm +++ b/code/game/atom/atom_act.dm @@ -240,9 +240,6 @@ var/datum/antagonist/heretic/heretic_data = GET_HERETIC(src) target.rust_heretic_act(heretic_data?.rust_strength) -/mob/living/basic/heretic_summon/rust_walker/do_rust_heretic_act(atom/target) - target.rust_heretic_act(4) - ///Called when something resists while this atom is its loc /atom/proc/container_resist_act(mob/living/user) return diff --git a/code/game/turfs/closed/indestructible.dm b/code/game/turfs/closed/indestructible.dm index fc123d9f41d..fb41ca70b90 100644 --- a/code/game/turfs/closed/indestructible.dm +++ b/code/game/turfs/closed/indestructible.dm @@ -4,6 +4,7 @@ icon = 'icons/turf/walls.dmi' explosive_resistance = 50 rust_resistance = RUST_RESISTANCE_ABSOLUTE + turf_flags = IS_SOLID | NO_RUST /turf/closed/indestructible/TerraformTurf(path, new_baseturf, flags, defer_change = FALSE, ignore_air = FALSE) return diff --git a/code/game/turfs/closed/wall/mineral_walls.dm b/code/game/turfs/closed/wall/mineral_walls.dm index 4b84200708e..d06f83e6853 100644 --- a/code/game/turfs/closed/wall/mineral_walls.dm +++ b/code/game/turfs/closed/wall/mineral_walls.dm @@ -275,10 +275,10 @@ custom_materials = list(/datum/material/titanium = SHEET_MATERIAL_AMOUNT*2) rust_resistance = RUST_RESISTANCE_TITANIUM -/turf/closed/wall/mineral/titanium/rust_turf() +/turf/closed/wall/mineral/titanium/rust_turf(magic = FALSE) if(HAS_TRAIT(src, TRAIT_RUSTY)) ChangeTurf(/turf/closed/wall/rust) - return + return TRUE return ..() /turf/closed/wall/mineral/titanium/nodiagonal @@ -321,10 +321,10 @@ canSmoothWith = SMOOTH_GROUP_SURVIVAL_TITANIUM_POD rust_resistance = RUST_RESISTANCE_TITANIUM -/turf/closed/wall/mineral/titanium/rust_turf() +/turf/closed/wall/mineral/titanium/rust_turf(magic = FALSE) if(HAS_TRAIT(src, TRAIT_RUSTY)) ChangeTurf(/turf/closed/wall/rust) - return + return TRUE return ..() /////////////////////Plastitanium walls///////////////////// @@ -344,10 +344,10 @@ custom_materials = list(/datum/material/alloy/plastitanium = SHEET_MATERIAL_AMOUNT*2) rust_resistance = RUST_RESISTANCE_TITANIUM -/turf/closed/wall/mineral/plastitanium/rust_turf() +/turf/closed/wall/mineral/plastitanium/rust_turf(magic = FALSE) if(HAS_TRAIT(src, TRAIT_RUSTY)) ChangeTurf(/turf/closed/wall/rust) - return + return TRUE return ..() @@ -361,10 +361,10 @@ icon_state = MAP_SWITCH("plastitanium_wall-0", "plastitanium_overspace") fixed_underlay = list("space" = TRUE) -/turf/closed/wall/mineral/plastitanium/rust_turf() +/turf/closed/wall/mineral/plastitanium/rust_turf(magic = FALSE) if(HAS_TRAIT(src, TRAIT_RUSTY)) ChangeTurf(/turf/closed/wall/rust) - return + return TRUE return ..() diff --git a/code/game/turfs/closed/wall/reinf_walls.dm b/code/game/turfs/closed/wall/reinf_walls.dm index 5b4e791f8e2..525b9540b65 100644 --- a/code/game/turfs/closed/wall/reinf_walls.dm +++ b/code/game/turfs/closed/wall/reinf_walls.dm @@ -227,10 +227,10 @@ if(the_rcd.canRturf || rcd_data[RCD_DESIGN_MODE] == RCD_WALLFRAME) return ..() -/turf/closed/wall/r_wall/rust_turf() +/turf/closed/wall/r_wall/rust_turf(magic = FALSE) if(HAS_TRAIT(src, TRAIT_RUSTY)) ChangeTurf(/turf/closed/wall/rust) - return + return TRUE return ..() /turf/closed/wall/r_wall/plastitanium diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm index 1df2ea0251b..ed29d3cebe4 100644 --- a/code/game/turfs/closed/walls.dm +++ b/code/game/turfs/closed/walls.dm @@ -298,10 +298,10 @@ add_overlay(dent_decals) -/turf/closed/wall/rust_turf() +/turf/closed/wall/rust_turf(magic = FALSE) if(HAS_TRAIT(src, TRAIT_RUSTY)) ScrapeAway() - return + return TRUE return ..() diff --git a/code/game/turfs/open/chasm.dm b/code/game/turfs/open/chasm.dm index df1278b29d4..47c425da544 100644 --- a/code/game/turfs/open/chasm.dm +++ b/code/game/turfs/open/chasm.dm @@ -9,6 +9,7 @@ smoothing_flags = SMOOTH_BITMASK | SMOOTH_BORDER smoothing_groups = SMOOTH_GROUP_TURF_OPEN + SMOOTH_GROUP_TURF_CHASM canSmoothWith = SMOOTH_GROUP_TURF_CHASM + turf_flags = NO_RUST density = TRUE //This will prevent hostile mobs from pathing into chasms, while the canpass override will still let it function like an open turf bullet_bounce_sound = null //abandon all hope ye who enter rust_resistance = RUST_RESISTANCE_ABSOLUTE diff --git a/code/game/turfs/open/floor.dm b/code/game/turfs/open/floor.dm index 268af20d19e..01be12d84af 100644 --- a/code/game/turfs/open/floor.dm +++ b/code/game/turfs/open/floor.dm @@ -362,9 +362,9 @@ return TRUE return FALSE -/turf/open/floor/rust_turf() +/turf/open/floor/rust_turf(magic = FALSE) if(HAS_TRAIT(src, TRAIT_RUSTY)) - return + return FALSE ChangeTurf(/turf/open/floor/plating) return ..() diff --git a/code/game/turfs/open/lava.dm b/code/game/turfs/open/lava.dm index d12fe69c31a..fb8c30c79c2 100644 --- a/code/game/turfs/open/lava.dm +++ b/code/game/turfs/open/lava.dm @@ -23,6 +23,7 @@ clawfootstep = FOOTSTEP_LAVA heavyfootstep = FOOTSTEP_LAVA rust_resistance = RUST_RESISTANCE_ABSOLUTE + turf_flags = NO_RUST /// How much fire damage we deal to living mobs stepping on us var/lava_damage = 20 /// How many firestacks we add to living mobs stepping on us diff --git a/code/game/turfs/open/openspace.dm b/code/game/turfs/open/openspace.dm index 6724cb74d23..f72423d1432 100644 --- a/code/game/turfs/open/openspace.dm +++ b/code/game/turfs/open/openspace.dm @@ -12,6 +12,7 @@ plane = TRANSPARENT_FLOOR_PLANE layer = SPACE_LAYER rust_resistance = RUST_RESISTANCE_ABSOLUTE + turf_flags = NO_RUST var/can_cover_up = TRUE var/can_build_on = TRUE diff --git a/code/game/turfs/open/space/space.dm b/code/game/turfs/open/space/space.dm index 74ee7b6a879..dcc735819f3 100644 --- a/code/game/turfs/open/space/space.dm +++ b/code/game/turfs/open/space/space.dm @@ -48,6 +48,7 @@ GLOBAL_LIST_EMPTY(starlight) name = "\proper space" overfloor_placed = FALSE underfloor_accessibility = UNDERFLOOR_INTERACTABLE + turf_flags = NO_RUST rust_resistance = RUST_RESISTANCE_ABSOLUTE temperature = TCMB diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 3a17329e878..bc95c6ed9fc 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -630,18 +630,19 @@ GLOBAL_LIST_EMPTY(station_turfs) return /// Check if the heretic is strong enough to rust this turf, and if so, rusts the turf with an added visual effect. -/turf/rust_heretic_act(rust_strength = 1) - if((turf_flags & NO_RUST) || (rust_strength < rust_resistance)) - return - rust_turf() - -/// Override this to change behaviour when being rusted by a heretic -/turf/proc/rust_turf() - if(HAS_TRAIT(src, TRAIT_RUSTY)) +/turf/rust_heretic_act(rust_strength = RUST_RESISTANCE_BASIC) + if((rust_strength < rust_resistance)) return - AddElement(/datum/element/rust/heretic) - new /obj/effect/glowing_rune(src) + if (rust_turf(magic = TRUE)) + new /obj/effect/glowing_rune(src) + +/// Override this to change behaviour when being rusted +/turf/proc/rust_turf(magic = FALSE) + if ((turf_flags & NO_RUST) || HAS_TRAIT(src, TRAIT_RUSTIMMUNE) || HAS_TRAIT(src, TRAIT_RUSTY)) + return FALSE + AddElement(magic ? /datum/element/rust/heretic : /datum/element/rust) + return TRUE /turf/handle_fall(mob/faller) if(has_gravity(src)) diff --git a/code/modules/antagonists/heretic/heretic_antag.dm b/code/modules/antagonists/heretic/heretic_antag.dm index c6858a7ec15..eed1f6d2e9e 100644 --- a/code/modules/antagonists/heretic/heretic_antag.dm +++ b/code/modules/antagonists/heretic/heretic_antag.dm @@ -354,7 +354,7 @@ for(var/starting_knowledge in GLOB.heretic_start_knowledge) gain_knowledge(starting_knowledge, HERETIC_KNOWLEDGE_START, update = FALSE) - owner.current.AddElement(/datum/element/leeching_walk/minor) + owner.current.AddElement(/datum/element/rust_healing, FALSE, 1.5, 5) ADD_TRAIT(owner, TRAIT_SEE_BLESSED_TILES, REF(src)) addtimer(CALLBACK(src, PROC_REF(passive_influence_gain)), passive_gain_timer) // Gain +1 knowledge every 20 minutes. @@ -368,7 +368,7 @@ QDEL_NULL(researched_knowledge[knowledge_path][HKT_INSTANCE]) REMOVE_TRAIT(owner, TRAIT_SEE_BLESSED_TILES, REF(src)) - owner.current.RemoveElement(/datum/element/leeching_walk/minor) + owner.current.RemoveElement(/datum/element/rust_healing, FALSE, 1.5, 5) QDEL_NULL(heretic_path) owner.current.cut_overlay(eldritch_overlay) return ..() diff --git a/code/modules/antagonists/heretic/heretic_knowledge.dm b/code/modules/antagonists/heretic/heretic_knowledge.dm index 4b2b82adc56..af0381db3cc 100644 --- a/code/modules/antagonists/heretic/heretic_knowledge.dm +++ b/code/modules/antagonists/heretic/heretic_knowledge.dm @@ -653,7 +653,7 @@ if(!isnull(ascension_achievement)) user.client?.give_award(ascension_achievement, user) - heretic_datum.rust_strength = 4 // Ascended heretics can rust whatever they want (below RUST_RESISTANCE_ABSOLUTE) + heretic_datum.rust_strength = RUST_RESISTANCE_ORGANIC // Ascended heretics can rust whatever they want (below RUST_RESISTANCE_ABSOLUTE) ADD_TRAIT(user, TRAIT_DESENSITIZED, type) return TRUE diff --git a/code/modules/antagonists/heretic/items/heretic_armor.dm b/code/modules/antagonists/heretic/items/heretic_armor.dm index da3aaec7453..411865817e9 100644 --- a/code/modules/antagonists/heretic/items/heretic_armor.dm +++ b/code/modules/antagonists/heretic/items/heretic_armor.dm @@ -918,8 +918,7 @@ /obj/item/clothing/suit/hooded/cultrobes/eldritch/rust/proc/on_move(mob/source, atom/old_loc, dir, forced, list/old_locs) SIGNAL_HANDLER - var/turf/mover_turf = get_turf(source) - if(HAS_TRAIT(mover_turf, TRAIT_RUSTY)) + if(source.is_touching_rust()) set_armor(/datum/armor/eldritch_armor/rust/on_rust) ADD_TRAIT(source, TRAIT_PIERCEIMMUNE, REF(src)) diff --git a/code/modules/antagonists/heretic/items/heretic_grenade.dm b/code/modules/antagonists/heretic/items/heretic_grenade.dm index 9902c109414..14ceaf1183e 100644 --- a/code/modules/antagonists/heretic/items/heretic_grenade.dm +++ b/code/modules/antagonists/heretic/items/heretic_grenade.dm @@ -111,7 +111,7 @@ /datum/reagent/heretic_rust/expose_turf(turf/exposed_turf, reac_volume) . = ..() - exposed_turf.rust_turf() + exposed_turf.rust_heretic_act(RUST_RESISTANCE_TITANIUM) /datum/reagent/heretic_rust/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, metabolization_ratio) . = ..() diff --git a/code/modules/antagonists/heretic/knowledge/rust_lore.dm b/code/modules/antagonists/heretic/knowledge/rust_lore.dm index b8331ce909f..207669735e0 100644 --- a/code/modules/antagonists/heretic/knowledge/rust_lore.dm +++ b/code/modules/antagonists/heretic/knowledge/rust_lore.dm @@ -69,12 +69,12 @@ /datum/heretic_knowledge/limited_amount/starting/base_rust/on_gain(mob/user, datum/antagonist/heretic/our_heretic) . = ..() RegisterSignal(user, COMSIG_HERETIC_MANSUS_GRASP_ATTACK_SECONDARY, PROC_REF(on_secondary_mansus_grasp)) - user.RemoveElement(/datum/element/leeching_walk/minor) + user.RemoveElement(/datum/element/rust_healing, FALSE, 1.5, 5) /datum/heretic_knowledge/limited_amount/starting/base_rust/on_lose(mob/user, datum/antagonist/heretic/our_heretic) . = ..() UnregisterSignal(user, COMSIG_HERETIC_MANSUS_GRASP_ATTACK_SECONDARY) - user.AddElement(/datum/element/leeching_walk/minor) + user.AddElement(/datum/element/rust_healing, FALSE, 1.5, 5) /datum/heretic_knowledge/limited_amount/starting/base_rust/on_mansus_grasp(mob/living/source, mob/living/target) . = ..() @@ -262,7 +262,7 @@ /datum/heretic_knowledge/ultimate/rust_final/proc/delay_transform_turfs(list/turfs) for(var/turf/turf as anything in turfs) - turf.rust_heretic_act(5) + turf.rust_heretic_act(RUST_RESISTANCE_ORGANIC) CHECK_TICK /** @@ -273,16 +273,12 @@ /datum/heretic_knowledge/ultimate/rust_final/proc/on_move(mob/living/source, atom/old_loc, dir, forced, list/old_locs) SIGNAL_HANDLER - // If we're on a rusty turf, and haven't given out our traits, buff our guy - var/turf/our_turf = get_turf(source) - if(HAS_TRAIT(our_turf, TRAIT_RUSTY)) + if(source.is_touching_rust()) if(!immunities_active) source.add_traits(conditional_immunities, type) source.add_movespeed_mod_immunities(type, /datum/movespeed_modifier/damage_slowdown) immunities_active = TRUE - - // If we're not on a rust turf, and we have given out our traits, nerf our guy - else + else // If we're not on a rust turf, and we have given out our traits, nerf our guy if(immunities_active) source.remove_traits(conditional_immunities, type) source.remove_movespeed_mod_immunities(type, /datum/movespeed_modifier/damage_slowdown) @@ -296,8 +292,7 @@ /datum/heretic_knowledge/ultimate/rust_final/proc/on_life(mob/living/source, seconds_per_tick) SIGNAL_HANDLER - var/turf/our_turf = get_turf(source) - if(!HAS_TRAIT(our_turf, TRAIT_RUSTY)) + if(!source.is_touching_rust()) return var/need_mob_update = FALSE diff --git a/code/modules/antagonists/heretic/status_effects/heretic_passive.dm b/code/modules/antagonists/heretic/status_effects/heretic_passive.dm index 53eae533386..6f5786b809b 100644 --- a/code/modules/antagonists/heretic/status_effects/heretic_passive.dm +++ b/code/modules/antagonists/heretic/status_effects/heretic_passive.dm @@ -500,8 +500,7 @@ /datum/status_effect/heretic_passive/rust/proc/on_move(mob/source, atom/old_loc, dir, forced, list/old_locs) SIGNAL_HANDLER - var/turf/mover_turf = get_turf(source) - if(HAS_TRAIT(mover_turf, TRAIT_RUSTY)) + if(source.is_touching_rust()) ADD_TRAIT(source, TRAIT_BATON_RESISTANCE, REF(src)) else REMOVE_TRAIT(source, TRAIT_BATON_RESISTANCE, REF(src)) @@ -515,8 +514,7 @@ /datum/status_effect/heretic_passive/rust/proc/on_life(mob/living/source, seconds_per_tick) SIGNAL_HANDLER - var/turf/our_turf = get_turf(source) - if(!HAS_TRAIT(our_turf, TRAIT_RUSTY)) + if(!source.is_touching_rust()) return // Heals all damage + Stamina diff --git a/code/modules/bitrunning/virtual_domain/domains/heretic_hunt.dm b/code/modules/bitrunning/virtual_domain/domains/heretic_hunt.dm index 43225d18e38..921e9033a18 100644 --- a/code/modules/bitrunning/virtual_domain/domains/heretic_hunt.dm +++ b/code/modules/bitrunning/virtual_domain/domains/heretic_hunt.dm @@ -75,7 +75,7 @@ /datum/outfit/virtual_domain_heretic/pre_equip(mob/living/carbon/human/user, visuals_only) ADD_TRAIT(user, TRAIT_ACT_AS_HERETIC, INNATE_TRAIT) ADD_TRAIT(user, TRAIT_NO_TELEPORT, INNATE_TRAIT) - user.AddElement(/datum/element/leeching_walk) + user.AddElement(/datum/element/rust_healing) user.faction |= FACTION_HERETIC // All it does is stand there, only attacks if attacked (Manuel player) diff --git a/code/modules/deathmatch/deathmatch_loadouts.dm b/code/modules/deathmatch/deathmatch_loadouts.dm index f2b169c92f3..5601623e94e 100644 --- a/code/modules/deathmatch/deathmatch_loadouts.dm +++ b/code/modules/deathmatch/deathmatch_loadouts.dm @@ -1004,7 +1004,7 @@ /datum/outfit/deathmatch_loadout/heresy/pre_equip(mob/living/carbon/human/user, visuals_only) . = ..() ADD_TRAIT(user, TRAIT_ACT_AS_HERETIC, REF(src)) - user.AddElement(/datum/element/leeching_walk) + user.AddElement(/datum/element/rust_healing) // Creates the knowledge as an isolated datum inside the target, allowing passive knowledges to work still. for(var/datum/heretic_knowledge/knowhow as anything in knowledge_to_grant) diff --git a/code/modules/mob/living/basic/cult/constructs/harvester.dm b/code/modules/mob/living/basic/cult/constructs/harvester.dm index 91037848540..8fc1226ab09 100644 --- a/code/modules/mob/living/basic/cult/constructs/harvester.dm +++ b/code/modules/mob/living/basic/cult/constructs/harvester.dm @@ -180,7 +180,7 @@ /mob/living/basic/construct/harvester/heretic/grant_abilities() AddElement(/datum/element/wall_walker, or_trait = TRAIT_RUSTY) - AddElement(/datum/element/leeching_walk) + AddElement(/datum/element/rust_healing) AddComponent(\ /datum/component/amputating_limbs,\ surgery_time = 1.5 SECONDS,\ diff --git a/code/modules/mob/living/basic/heretic/rust_walker.dm b/code/modules/mob/living/basic/heretic/rust_walker.dm index 3b7544edf5f..a2cdfc43250 100644 --- a/code/modules/mob/living/basic/heretic/rust_walker.dm +++ b/code/modules/mob/living/basic/heretic/rust_walker.dm @@ -29,6 +29,9 @@ . = ..() update_appearance(UPDATE_ICON_STATE) +/mob/living/basic/heretic_summon/rust_walker/do_rust_heretic_act(atom/target) + target.rust_heretic_act(RUST_RESISTANCE_TITANIUM) + /mob/living/basic/heretic_summon/rust_walker/update_icon_state() . = ..() if(stat == DEAD) // We usually delete on death but just in case diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index d340bc5268c..d48bbd9ac23 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -591,3 +591,12 @@ continue ai_controller?.set_blackboard_key(blackboard_key, ability) + +/// Returns true if the mob is on a rusty tile, really low level just because we call it in a bunch of unrelated places +/mob/proc/is_touching_rust(check_flying = FALSE) + if (check_flying && (movement_type & MOVETYPES_NOT_TOUCHING_GROUND)) + return FALSE + if (HAS_TRAIT(src, TRAIT_MAGICALLY_PHASED) || (movement_type & VENTCRAWLING)) + return FALSE + var/turf/our_turf = get_turf(src) + return HAS_TRAIT(our_turf, TRAIT_RUSTY) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index b8cac992c48..0fec8f117c9 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -2936,8 +2936,8 @@ /datum/reagent/eldritch/expose_turf(turf/exposed_turf, reac_volume) . = ..() - if ((reac_volume >= 1.5 || isplatingturf(exposed_turf)) && !HAS_TRAIT(exposed_turf, TRAIT_RUSTY)) - exposed_turf.rust_turf() + if ((reac_volume >= 1.5 || isplatingturf(exposed_turf))) + exposed_turf.rust_heretic_act(RUST_RESISTANCE_TITANIUM) /datum/reagent/universal_indicator name = "Universal Indicator" diff --git a/tgstation.dme b/tgstation.dme index 11b6f032ec8..c671a8e299f 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1601,7 +1601,6 @@ #include "code\datums\elements\kneecapping.dm" #include "code\datums\elements\kneejerk.dm" #include "code\datums\elements\knockback.dm" -#include "code\datums\elements\leeching_walk.dm" #include "code\datums\elements\lifesteal.dm" #include "code\datums\elements\light_blocking.dm" #include "code\datums\elements\light_eaten.dm" @@ -1655,6 +1654,7 @@ #include "code\datums\elements\ridable.dm" #include "code\datums\elements\rotation.dm" #include "code\datums\elements\rust.dm" +#include "code\datums\elements\rust_healing.dm" #include "code\datums\elements\selfknockback.dm" #include "code\datums\elements\series.dm" #include "code\datums\elements\shiny_bait.dm"