From 0155e2239ab25f7bf0d211aff095bbb80c42788d Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Sat, 11 May 2024 17:47:06 -0400 Subject: [PATCH 1/3] initial --- .../dcs/signals/atom/mob/signals_mob.dm | 3 --- code/modules/clothing/shoes/marine_shoes.dm | 16 --------------- code/modules/cm_aliens/weeds.dm | 20 ------------------- code/modules/mob/living/carbon/human/human.dm | 9 --------- .../mob/living/carbon/human/species/human.dm | 1 - .../living/carbon/human/species/species.dm | 2 -- .../carbon/human/species/yautja/_species.dm | 1 - .../mob/living/carbon/xenomorph/XenoProcs.dm | 5 ----- .../mob/living/carbon/xenomorph/life.dm | 4 ++-- code/modules/vehicles/van/van.dm | 9 --------- 10 files changed, 2 insertions(+), 68 deletions(-) diff --git a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm index 0f2457d4b1..dd136dbdd4 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm @@ -55,9 +55,6 @@ #define COMSIG_MOB_SET_FACE_DIR "mob_set_face_dir" #define COMPONENT_CANCEL_SET_FACE_DIR (1<<0) -/// From /obj/effect/alien/weeds/Crossed(atom/movable/AM) -#define COMSIG_MOB_WEED_SLOWDOWN "mob_weeds_slowdown" - #define COMSIG_MOB_TAKE_DAMAGE "mob_take_damage" // TODO: move COMSIG_XENO_TAKE_DAMAGE & COMSIG_HUMAN_TAKE_DAMAGE to this ///called in /client/change_view() #define COMSIG_MOB_CHANGE_VIEW "mob_change_view" diff --git a/code/modules/clothing/shoes/marine_shoes.dm b/code/modules/clothing/shoes/marine_shoes.dm index 1a11545ea4..949c04438e 100644 --- a/code/modules/clothing/shoes/marine_shoes.dm +++ b/code/modules/clothing/shoes/marine_shoes.dm @@ -209,22 +209,6 @@ flags_inventory = FPRINT|NOSLIPPING siemens_coefficient = 0.6 items_allowed = list(/obj/item/attachable/bayonet, /obj/item/weapon/throwing_knife, /obj/item/weapon/gun/pistol/holdout, /obj/item/weapon/gun/pistol/clfpistol, /obj/item/weapon/straight_razor) - var/weed_slowdown_mult = 0.5 - -/obj/item/clothing/shoes/hiking/equipped(mob/user, slot, silent) - . = ..() - var/mob/living/carbon/human/human_user = user - if(src != human_user.shoes) - return - RegisterSignal(user, COMSIG_MOB_WEED_SLOWDOWN, PROC_REF(handle_weed_slowdown)) - -/obj/item/clothing/shoes/hiking/unequipped(mob/user, slot, silent) - . = ..() - UnregisterSignal(user, COMSIG_MOB_WEED_SLOWDOWN, PROC_REF(handle_weed_slowdown)) - -/obj/item/clothing/shoes/hiking/proc/handle_weed_slowdown(mob/user, list/slowdata) - SIGNAL_HANDLER - slowdata["movement_slowdown"] *= weed_slowdown_mult //=ROYAL MARINES=\\ diff --git a/code/modules/cm_aliens/weeds.dm b/code/modules/cm_aliens/weeds.dm index 736d4f9474..fb40ab2c9c 100644 --- a/code/modules/cm_aliens/weeds.dm +++ b/code/modules/cm_aliens/weeds.dm @@ -168,26 +168,6 @@ if(ceiling_info) . += ceiling_info - -/obj/effect/alien/weeds/Crossed(atom/movable/atom_movable) - if(!isliving(atom_movable)) - return - - var/mob/living/crossing_mob = atom_movable - - var/weed_slow = weed_strength - - if(crossing_mob.ally_of_hivenumber(linked_hive.hivenumber)) - if( (crossing_mob.hivenumber != linked_hive.hivenumber) && prob(7)) // small chance for allied mobs to get a message indicating this - to_chat(crossing_mob, SPAN_NOTICE("The weeds seem to reshape themselves around your feet as you walk on them.")) - return - - var/list/slowdata = list("movement_slowdown" = weed_slow) - SEND_SIGNAL(crossing_mob, COMSIG_MOB_WEED_SLOWDOWN, slowdata, src) - var/final_slowdown = slowdata["movement_slowdown"] - - crossing_mob.next_move_slowdown += POSITIVE(final_slowdown) - // Uh oh, we might be dying! // I know this is bad proc naming but it was too good to pass on and it's only used in this file anyways // If you're still confused, scroll aaaall the way down to the bottom of the file. diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index a04dd5c94b..44c31e40bb 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1104,16 +1104,11 @@ if(oldspecies) //additional things to change when we're no longer that species oldspecies.post_species_loss(src) - if(oldspecies.weed_slowdown_mult != 1) - UnregisterSignal(src, COMSIG_MOB_WEED_SLOWDOWN) mob_flags = species.mob_flags for(var/T in species.mob_inherent_traits) ADD_TRAIT(src, T, TRAIT_SOURCE_SPECIES) - if(species.weed_slowdown_mult != 1) - RegisterSignal(src, COMSIG_MOB_WEED_SLOWDOWN, PROC_REF(handle_weed_slowdown)) - species.create_organs(src) if(species.base_color && default_colour) @@ -1150,10 +1145,6 @@ else return FALSE -/mob/living/carbon/human/proc/handle_weed_slowdown(mob/user, list/slowdata) - SIGNAL_HANDLER - slowdata["movement_slowdown"] *= species.weed_slowdown_mult - /mob/living/carbon/human/print_flavor_text() var/list/equipment = list(src.head,src.wear_mask,src.glasses,src.w_uniform,src.wear_suit,src.gloves,src.shoes) var/head_exposed = 1 diff --git a/code/modules/mob/living/carbon/human/species/human.dm b/code/modules/mob/living/carbon/human/species/human.dm index add78365a3..033b25afb6 100644 --- a/code/modules/mob/living/carbon/human/species/human.dm +++ b/code/modules/mob/living/carbon/human/species/human.dm @@ -111,7 +111,6 @@ heat_level_3 = 1100 knock_down_reduction = 2 stun_reduction = 2 - weed_slowdown_mult = 0.5 /datum/species/human/hero/handle_post_spawn(mob/living/carbon/human/H) H.universal_understand = TRUE diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index d2177cf49a..c3e2a9bdd6 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -96,8 +96,6 @@ var/stun_reduction = 1 //how much the stunned effect is reduced per Life call. var/knock_out_reduction = 1 //same thing - /// If different from 1, a signal is registered on post_spawn(). - var/weed_slowdown_mult = 1 var/acid_blood_dodge_chance = 0 diff --git a/code/modules/mob/living/carbon/human/species/yautja/_species.dm b/code/modules/mob/living/carbon/human/species/yautja/_species.dm index f8ecb3e059..2f3793c37b 100644 --- a/code/modules/mob/living/carbon/human/species/yautja/_species.dm +++ b/code/modules/mob/living/carbon/human/species/yautja/_species.dm @@ -55,7 +55,6 @@ knock_down_reduction = 4 stun_reduction = 4 - weed_slowdown_mult = 0 // no slowdown! icobase = 'icons/mob/humans/species/r_predator.dmi' deform = 'icons/mob/humans/species/r_predator.dmi' diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm index 49bb644b40..064448fcc7 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm @@ -240,11 +240,6 @@ if(agility) . += caste.agility_speed_increase - var/obj/effect/alien/weeds/W = locate(/obj/effect/alien/weeds) in loc - if (W) - if (W.linked_hive.hivenumber == hivenumber) - . *= 0.95 - var/obj/effect/alien/resin/sticky/fast/FR = locate(/obj/effect/alien/resin/sticky/fast) in loc if (FR && FR.hivenumber == hivenumber) . *= 0.8 diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm index 271ac7bbe3..80fc22c843 100644 --- a/code/modules/mob/living/carbon/xenomorph/life.dm +++ b/code/modules/mob/living/carbon/xenomorph/life.dm @@ -170,7 +170,7 @@ if(regular_update && health <= 0 && (!caste || (caste.fire_immunity & FIRE_IMMUNITY_NO_IGNITE) || !on_fire)) //Sleeping Xenos are also unconscious, but all crit Xenos are under 0 HP. Go figure var/turf/T = loc if(istype(T)) - if(!check_weeds_for_healing()) //In crit, damage is maximal if you're caught off weeds + if(!check_weeds_for_healing() || HAS_FLAG(mob_flags, AI_CONTROLLED)) //In crit, damage is maximal if you're caught off weeds or are an AI apply_damage(2.5 - warding_aura*0.5, BRUTE) //Warding can heavily lower the impact of bleedout. Halved at 2.5 phero, stopped at 5 phero else apply_damage(-warding_aura, BRUTE) @@ -337,7 +337,7 @@ Make sure their actual health updates immediately.*/ plasma_stored += plasma_gain * plasma_max / 100 if(recovery_aura) plasma_stored += round(plasma_gain * plasma_max / 100 * recovery_aura/4) //Divided by four because it gets massive fast. 1 is equivalent to weed regen! Only the strongest pheromones should bypass weeds - if(health < maxHealth && !hardcore && is_hive_living(hive) && last_hit_time + caste.heal_delay_time <= world.time) + if(health < maxHealth && !hardcore && is_hive_living(hive) && last_hit_time + caste.heal_delay_time <= world.time && !HAS_FLAG(mob_flags, AI_CONTROLLED)) //no healing for AI if(body_position == LYING_DOWN || resting) if(health < 0) //Unconscious heal_wounds(caste.heal_knocked_out * regeneration_multiplier, recoveryActual) //Healing is much slower. Warding pheromones make up for the rest if you're curious diff --git a/code/modules/vehicles/van/van.dm b/code/modules/vehicles/van/van.dm index 0b99d682c0..d94736c892 100644 --- a/code/modules/vehicles/van/van.dm +++ b/code/modules/vehicles/van/van.dm @@ -62,8 +62,6 @@ var/overdrive_duration = 3 SECONDS var/overdrive_speed_mult = 0.3 // Additive (30% more speed, adds to 80% more speed) - var/momentum_loss_on_weeds_factor = 0.2 - move_on_turn = TRUE var/list/mobs_under = list() @@ -169,13 +167,6 @@ return ..() -/obj/vehicle/multitile/van/pre_movement() - if(locate(/obj/effect/alien/weeds) in loc) - move_momentum *= momentum_loss_on_weeds_factor - - . = ..() - - /obj/vehicle/multitile/van/attackby(obj/item/O, mob/user) if(user.z != z) return ..() From ec0996df15b96614d3b57cbaa1903ba70cf12485 Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Mon, 10 Jun 2024 17:23:45 -0400 Subject: [PATCH 2/3] slowdown, channeled removal reintroduce marine slowdown, switch melee removal from damaging attacks to a lengthy channeled action --- .../dcs/signals/atom/mob/signals_mob.dm | 3 ++ code/modules/clothing/shoes/marine_shoes.dm | 16 +++++++ code/modules/cm_aliens/weeds.dm | 46 +++++++++++++------ code/modules/mob/living/carbon/human/human.dm | 9 ++++ .../mob/living/carbon/human/species/human.dm | 1 + .../living/carbon/human/species/species.dm | 2 + .../carbon/human/species/yautja/_species.dm | 1 + code/modules/vehicles/van/van.dm | 9 ++++ 8 files changed, 74 insertions(+), 13 deletions(-) diff --git a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm index dd136dbdd4..0f2457d4b1 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm @@ -55,6 +55,9 @@ #define COMSIG_MOB_SET_FACE_DIR "mob_set_face_dir" #define COMPONENT_CANCEL_SET_FACE_DIR (1<<0) +/// From /obj/effect/alien/weeds/Crossed(atom/movable/AM) +#define COMSIG_MOB_WEED_SLOWDOWN "mob_weeds_slowdown" + #define COMSIG_MOB_TAKE_DAMAGE "mob_take_damage" // TODO: move COMSIG_XENO_TAKE_DAMAGE & COMSIG_HUMAN_TAKE_DAMAGE to this ///called in /client/change_view() #define COMSIG_MOB_CHANGE_VIEW "mob_change_view" diff --git a/code/modules/clothing/shoes/marine_shoes.dm b/code/modules/clothing/shoes/marine_shoes.dm index 949c04438e..1a11545ea4 100644 --- a/code/modules/clothing/shoes/marine_shoes.dm +++ b/code/modules/clothing/shoes/marine_shoes.dm @@ -209,6 +209,22 @@ flags_inventory = FPRINT|NOSLIPPING siemens_coefficient = 0.6 items_allowed = list(/obj/item/attachable/bayonet, /obj/item/weapon/throwing_knife, /obj/item/weapon/gun/pistol/holdout, /obj/item/weapon/gun/pistol/clfpistol, /obj/item/weapon/straight_razor) + var/weed_slowdown_mult = 0.5 + +/obj/item/clothing/shoes/hiking/equipped(mob/user, slot, silent) + . = ..() + var/mob/living/carbon/human/human_user = user + if(src != human_user.shoes) + return + RegisterSignal(user, COMSIG_MOB_WEED_SLOWDOWN, PROC_REF(handle_weed_slowdown)) + +/obj/item/clothing/shoes/hiking/unequipped(mob/user, slot, silent) + . = ..() + UnregisterSignal(user, COMSIG_MOB_WEED_SLOWDOWN, PROC_REF(handle_weed_slowdown)) + +/obj/item/clothing/shoes/hiking/proc/handle_weed_slowdown(mob/user, list/slowdata) + SIGNAL_HANDLER + slowdata["movement_slowdown"] *= weed_slowdown_mult //=ROYAL MARINES=\\ diff --git a/code/modules/cm_aliens/weeds.dm b/code/modules/cm_aliens/weeds.dm index fb40ab2c9c..d792ee748b 100644 --- a/code/modules/cm_aliens/weeds.dm +++ b/code/modules/cm_aliens/weeds.dm @@ -168,6 +168,26 @@ if(ceiling_info) . += ceiling_info + +/obj/effect/alien/weeds/Crossed(atom/movable/atom_movable) + if(!isliving(atom_movable)) + return + + var/mob/living/crossing_mob = atom_movable + + var/weed_slow = weed_strength + + if(crossing_mob.ally_of_hivenumber(linked_hive.hivenumber)) + if( (crossing_mob.hivenumber != linked_hive.hivenumber) && prob(7)) // small chance for allied mobs to get a message indicating this + to_chat(crossing_mob, SPAN_NOTICE("The weeds seem to reshape themselves around your feet as you walk on them.")) + return + + var/list/slowdata = list("movement_slowdown" = weed_slow) + SEND_SIGNAL(crossing_mob, COMSIG_MOB_WEED_SLOWDOWN, slowdata, src) + var/final_slowdown = slowdata["movement_slowdown"] + + crossing_mob.next_move_slowdown += POSITIVE(final_slowdown) + // Uh oh, we might be dying! // I know this is bad proc naming but it was too good to pass on and it's only used in this file anyways // If you're still confused, scroll aaaall the way down to the bottom of the file. @@ -352,26 +372,26 @@ if(QDELETED(attacking_item) || QDELETED(user) || (attacking_item.flags_item & NOBLUDGEON)) return 0 - if(istype(src, /obj/effect/alien/weeds/node)) //The pain is real - to_chat(user, SPAN_WARNING("You hit \the [src] with \the [attacking_item].")) - else - to_chat(user, SPAN_WARNING("You cut \the [src] away with \the [attacking_item].")) - - var/damage = attacking_item.force / 3 - playsound(loc, "alien_resin_break", 25) - if(iswelder(attacking_item)) var/obj/item/tool/weldingtool/WT = attacking_item if(WT.remove_fuel(2)) - damage = WEED_HEALTH_STANDARD + if(istype(src, /obj/effect/alien/weeds/node)) //The pain is real + to_chat(user, SPAN_WARNING("You hit \the [src] with \the [attacking_item].")) + else + to_chat(user, SPAN_WARNING("You cut \the [src] away with \the [attacking_item].")) + playsound(loc, "alien_resin_break", 25) playsound(loc, 'sound/items/Welder.ogg', 25, 1) + user.animation_attack_on(src) + take_damage(WEED_HEALTH_STANDARD) else + to_chat(user, SPAN_NOTICE("You start clearing \the [src] away with \the [attacking_item]...")) + var/duration = (10 SECONDS) * (health / attacking_item.force) + if(!do_after(user, duration, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD)) + return playsound(loc, "alien_resin_break", 25) + user.animation_attack_on(src) + take_damage(health) - - user.animation_attack_on(src) - - take_damage(damage) return TRUE //don't call afterattack /obj/effect/alien/weeds/proc/take_damage(damage) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 44c31e40bb..a04dd5c94b 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1104,11 +1104,16 @@ if(oldspecies) //additional things to change when we're no longer that species oldspecies.post_species_loss(src) + if(oldspecies.weed_slowdown_mult != 1) + UnregisterSignal(src, COMSIG_MOB_WEED_SLOWDOWN) mob_flags = species.mob_flags for(var/T in species.mob_inherent_traits) ADD_TRAIT(src, T, TRAIT_SOURCE_SPECIES) + if(species.weed_slowdown_mult != 1) + RegisterSignal(src, COMSIG_MOB_WEED_SLOWDOWN, PROC_REF(handle_weed_slowdown)) + species.create_organs(src) if(species.base_color && default_colour) @@ -1145,6 +1150,10 @@ else return FALSE +/mob/living/carbon/human/proc/handle_weed_slowdown(mob/user, list/slowdata) + SIGNAL_HANDLER + slowdata["movement_slowdown"] *= species.weed_slowdown_mult + /mob/living/carbon/human/print_flavor_text() var/list/equipment = list(src.head,src.wear_mask,src.glasses,src.w_uniform,src.wear_suit,src.gloves,src.shoes) var/head_exposed = 1 diff --git a/code/modules/mob/living/carbon/human/species/human.dm b/code/modules/mob/living/carbon/human/species/human.dm index 033b25afb6..add78365a3 100644 --- a/code/modules/mob/living/carbon/human/species/human.dm +++ b/code/modules/mob/living/carbon/human/species/human.dm @@ -111,6 +111,7 @@ heat_level_3 = 1100 knock_down_reduction = 2 stun_reduction = 2 + weed_slowdown_mult = 0.5 /datum/species/human/hero/handle_post_spawn(mob/living/carbon/human/H) H.universal_understand = TRUE diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index c3e2a9bdd6..d2177cf49a 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -96,6 +96,8 @@ var/stun_reduction = 1 //how much the stunned effect is reduced per Life call. var/knock_out_reduction = 1 //same thing + /// If different from 1, a signal is registered on post_spawn(). + var/weed_slowdown_mult = 1 var/acid_blood_dodge_chance = 0 diff --git a/code/modules/mob/living/carbon/human/species/yautja/_species.dm b/code/modules/mob/living/carbon/human/species/yautja/_species.dm index 2f3793c37b..f8ecb3e059 100644 --- a/code/modules/mob/living/carbon/human/species/yautja/_species.dm +++ b/code/modules/mob/living/carbon/human/species/yautja/_species.dm @@ -55,6 +55,7 @@ knock_down_reduction = 4 stun_reduction = 4 + weed_slowdown_mult = 0 // no slowdown! icobase = 'icons/mob/humans/species/r_predator.dmi' deform = 'icons/mob/humans/species/r_predator.dmi' diff --git a/code/modules/vehicles/van/van.dm b/code/modules/vehicles/van/van.dm index d94736c892..0b99d682c0 100644 --- a/code/modules/vehicles/van/van.dm +++ b/code/modules/vehicles/van/van.dm @@ -62,6 +62,8 @@ var/overdrive_duration = 3 SECONDS var/overdrive_speed_mult = 0.3 // Additive (30% more speed, adds to 80% more speed) + var/momentum_loss_on_weeds_factor = 0.2 + move_on_turn = TRUE var/list/mobs_under = list() @@ -167,6 +169,13 @@ return ..() +/obj/vehicle/multitile/van/pre_movement() + if(locate(/obj/effect/alien/weeds) in loc) + move_momentum *= momentum_loss_on_weeds_factor + + . = ..() + + /obj/vehicle/multitile/van/attackby(obj/item/O, mob/user) if(user.z != z) return ..() From 7052ebf2cf96bf00f66c5fa116fd9567ee0d83fa Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Wed, 31 Jul 2024 21:16:20 -0400 Subject: [PATCH 3/3] double duration make clearing weeds take longer, add force sanity check --- code/modules/cm_aliens/weeds.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/cm_aliens/weeds.dm b/code/modules/cm_aliens/weeds.dm index d792ee748b..367e039fc3 100644 --- a/code/modules/cm_aliens/weeds.dm +++ b/code/modules/cm_aliens/weeds.dm @@ -375,7 +375,7 @@ if(iswelder(attacking_item)) var/obj/item/tool/weldingtool/WT = attacking_item if(WT.remove_fuel(2)) - if(istype(src, /obj/effect/alien/weeds/node)) //The pain is real + if(istype(src, /obj/effect/alien/weeds/node)) to_chat(user, SPAN_WARNING("You hit \the [src] with \the [attacking_item].")) else to_chat(user, SPAN_WARNING("You cut \the [src] away with \the [attacking_item].")) @@ -384,8 +384,11 @@ user.animation_attack_on(src) take_damage(WEED_HEALTH_STANDARD) else + if(!attacking_item.force) + to_chat(user, SPAN_WARNING("You scrape ineffectively at \the [src] with \the [attacking_item].")) + return to_chat(user, SPAN_NOTICE("You start clearing \the [src] away with \the [attacking_item]...")) - var/duration = (10 SECONDS) * (health / attacking_item.force) + var/duration = (20 SECONDS) * (health / attacking_item.force) //effectively applying attack damage to weed's health spread over 20 seconds if(!do_after(user, duration, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD)) return playsound(loc, "alien_resin_break", 25)