Files
Bubberstation/code/datums/components/regenerator.dm
Time-Green 39a2434c06 Voidwalker Rework | Basic Mob Edition + Bonus Antag (#91646)
## About The Pull Request

Reworks the Voidwalker into a basic mob, including a lot of the balance
and mechanics!

Old (left), new (right)

![image](https://github.com/user-attachments/assets/5583db66-6025-4874-95dd-938aa828634c)![image](https://github.com/user-attachments/assets/2785c5cc-ccda-4ffd-bc1c-5bb278873d9b)


https://github.com/user-attachments/assets/22d6138f-11aa-4f7a-8600-2565e6578bcf

(little outdated)
https://youtu.be/cp1E3qPJGX4 (high res mirror)

**🟨Voidwalker mob changes🟨**
No longer a human species and no more void eater. Instead deals damage
by simple unarmed attacks.
Instead of dealing brute, the voidwalker does oxygen damage (4-5 hits to
knock out) with left-click, and slight brute on right click. Non-human
mobs automatically take brute damage instead of oxygen damage.

150 HP
33% burn armor

Yes it has hands, but it can only pick up and drop stuff

**🟨Window phase🟨**

![image](https://github.com/user-attachments/assets/82a330ee-16f8-46e4-a325-c894fc8931d6)
Instead of needing to smash a window with the void eater, moving through
windows simply leaves them passable for 5 seconds. Makes kidnapping a
lot easier, but also makes it easier for people to chase you

People who used the voided skull also leave windows passable for a short
bit.

**🟩Cosmic Charge🟩**
Standard charge ability, but only lets you charge towards space and
works while dragging people

**🟩The Vomitwalker🟩**
People you kidnapped now occasionally do the nebula vomit, which
voidwalkers can use to dive from and into

![image](https://github.com/user-attachments/assets/e483a0d2-a418-479e-89e5-1dcd71165140)
Diving into it is very fast but also removes the nebula vomit. You can
also kidnap people into the vomit (this doesn't remove the vomit).

There is also a little UI for tracking this. Clicking it while in space
dive teleports you to the next nebula vomit, if there are any.


![image](https://github.com/user-attachments/assets/8907f261-6395-44fb-86ea-0ed548aca3ab)

**🟨Voided people changes🟨**
Kidnapped people and people that used the cosmic skull are no longer
muted, but take 10% extra brute and occasionally leave behind glass
shards when taking a lot of damage.

Are no longer obliterated on a second encounter with voidwalkers.
Voidwalkers can't hurt people they've already voided (unless they really
want to), but instead just knock them out for 30s

Also the kidnapped do space vomit as I said earlier.

**🟩Sunwalker🟩**
Voidwalker variant made for pure murderbone. Has no camo and kindap
mechanics, but has a fiery charge, loads of damage and area igniting and
people ignition. It's admin, but I might change this later once I've had
some more time to think about it.

![image](https://github.com/user-attachments/assets/2383dc6e-2173-4449-b71b-367e81c55f88)

Other changes: 
- Voidwindows no longer need to be space adjacent
- Unsettle works faster but can't be used in combat anymore
- Space camo now grants complete space invisibility
- Makes a lot of aspects easily moddable, so we can easily mod it into a
moistwalker in-game
- Taking a cosmic skull when you already used one gives you the old
voidwalker void eater arm. Additional uses just gives you more void
eater arms until you run out of hands
- I definitely forgot a lot more
- I made a cool voidwalker hud! It even has a unique space camo toggle
## Why It's Good For The Game

<details>
  <summary>Lot of text</summary>
  
Voidwalker was basically a snowflaked toghether human species because I
didn't know how to sprite, but I was able to work with species and
visual effects. Then I realized I can just commission sprites!

This also let me just cut out a lot of the snowflake code, because it's
no longer a human so half the things I didn't want them to be able to
do, they just literally cannot do.

Voidwalkers were in a bit of strange spot with kidnapping? There was
essentially no incentive, other than "smash spaceman = funny". They also
had issues doing, anything? There's surprisingly little space on a space
station, especially maps such as tram. Making the voided victims have
nebula vomit gives the voidwalker a reason to WANT to kidnap, by giving
them a way to appear basically anywhere on the station. I don't think
it's too overpowered. Voided people don't vomit that much, it's easily
cleanable and diving into it removes them, so they're limited usability.

Replacing the brute damage with oxygen damage also kinda... just makes
sense? I seriously contemplated letting them do stamina damage for the
first iteration, but opted not to do it because stamina damage has so
many hooks attached. Oxygen damage doesn't! It's also just incredibly
thematic, let's them bypass most armor and makes them more suited to
non-letha kidnappings.

Space camo making them completely invisible was also long overdue. It
was literally just urging people to turn up their gamma and turn down
their parallax settings. I thought it was an interesting mechanic, but
it's just straight up unfair and doesn't belong in a multiplayer game.
They now more frequently leave behind little glass shards, leave
particles from nebula vomit they leave from and have more unique sound
effects, so attentive (and lucky) people can still deduce if an area is
safe-ish.

I removed being able to shatter voided people because the mechanic was
deeply misunderstood. It was intended to give them a means of removing
people if they kept incessently bothering the voidwalker, but people
went out of their way to use this to roundremove people they had already
voided. The 30s sleep conveys my intention a lot better, and fits better
now that the voidwalker benefits from having as many voided people
vomitting all over the place.

The cosmic charge gives them some much needed survivability. My
experiences (in observing voidwalkers, I can never get the roll ;_;) is
that they're constantly one mistake away from complete obliteration. The
cosmic charge let's them get out quick despite their slow movement speed
in gravity. It also makes them stronger when fighting in space.

They got 33% burn armor so it's a tiny bit harder to wipe them away in a
single laser salvo, while still giving people ample opportunity to fight
them off . Also they're like glass or something so it fits thematically.

I gave them hands because I thought it was cool, might be a mistake idk
  
</details>

## Changelog

🆑 Time-Green, INFRARED_BACON
add: Voidwalker has been throughly reworked! Now you are even less safe!
admin: Adds admin-only Sunwalker mob
fix: Unsettle doesnt work on yourself anymore
fix: Space camo doesnt stop bobbing anymore
fix: Voidwalker windows now recharge on kidnap 
runtime: Fixes healthanalyzers runtiming when scanning mobs without
reagent holders
/🆑
2025-07-01 12:55:31 +01:00

154 lines
5.4 KiB
Plaintext

#define REGENERATION_FILTER "healing_glow"
/**
* # Regenerator component
*
* A mob with this component will regenerate its health over time, as long as it has not received damage
* in the last X seconds. Taking any damage will reset this cooldown.
*/
/datum/component/regenerator
/// You will only regain health if you haven't been hurt for this many seconds
var/regeneration_delay
/// Brute reagined every second
var/brute_per_second
/// Burn reagined every second
var/burn_per_second
/// Toxin reagined every second
var/tox_per_second
/// Oxygen reagined every second
var/oxy_per_second
/// If TRUE, we'll try to heal wounds as well. Useless for non-humans.
var/heals_wounds = FALSE
/// List of damage types we don't care about, in case you want to only remove this with fire damage or something
var/list/ignore_damage_types
/// Colour of regeneration animation, or none if you don't want one
var/outline_colour
/// When this timer completes we start restoring health, it is a timer rather than a cooldown so we can do something on its completion
var/regeneration_start_timer
/// Callback for adding special checks for whether or not we can start regenning
var/datum/callback/regen_check = null
/datum/component/regenerator/Initialize(
regeneration_delay = 6 SECONDS,
brute_per_second = 2,
burn_per_second = 0,
tox_per_second = 0,
oxy_per_second = 0,
heals_wounds = FALSE,
ignore_damage_types = list(STAMINA),
outline_colour = COLOR_PALE_GREEN,
regen_check = null,
)
if (!isliving(parent))
return COMPONENT_INCOMPATIBLE
src.regeneration_delay = regeneration_delay
src.brute_per_second = brute_per_second
src.burn_per_second = burn_per_second
src.tox_per_second = tox_per_second
src.oxy_per_second = oxy_per_second
src.heals_wounds = heals_wounds
src.ignore_damage_types = ignore_damage_types
src.outline_colour = outline_colour
src.regen_check = regen_check
/datum/component/regenerator/RegisterWithParent()
. = ..()
RegisterSignal(parent, COMSIG_MOB_APPLY_DAMAGE, PROC_REF(on_take_damage))
/datum/component/regenerator/UnregisterFromParent()
. = ..()
if(regeneration_start_timer)
deltimer(regeneration_start_timer)
UnregisterSignal(parent, COMSIG_MOB_APPLY_DAMAGE)
stop_regenerating()
/datum/component/regenerator/Destroy(force)
stop_regenerating()
. = ..()
if(regeneration_start_timer)
deltimer(regeneration_start_timer)
/// When you take damage, reset the cooldown and start processing
/datum/component/regenerator/proc/on_take_damage(datum/source, damage, damagetype, ...)
SIGNAL_HANDLER
if (damagetype in ignore_damage_types)
return
reset_regeneration_timer()
/datum/component/regenerator/proc/reset_regeneration_timer()
stop_regenerating()
regeneration_start_timer = addtimer(CALLBACK(src, PROC_REF(start_regenerating)), regeneration_delay, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_STOPPABLE)
/// Start processing health regeneration, and show animation if provided
/datum/component/regenerator/proc/start_regenerating()
if (!should_be_regenning(parent))
return
var/mob/living/living_parent = parent
living_parent.visible_message(span_notice("[living_parent]'s wounds begin to knit closed!"))
START_PROCESSING(SSobj, src)
regeneration_start_timer = null
if (!outline_colour)
return
living_parent.add_filter(REGENERATION_FILTER, 2, list("type" = "outline", "color" = outline_colour, "alpha" = 0, "size" = 1))
var/filter = living_parent.get_filter(REGENERATION_FILTER)
animate(filter, alpha = 200, time = 0.5 SECONDS, loop = -1)
animate(alpha = 0, time = 0.5 SECONDS)
/datum/component/regenerator/proc/stop_regenerating()
STOP_PROCESSING(SSobj, src)
var/mob/living/living_parent = parent
var/filter = living_parent.get_filter(REGENERATION_FILTER)
animate(filter)
living_parent.remove_filter(REGENERATION_FILTER)
/datum/component/regenerator/process(seconds_per_tick = SSMOBS_DT)
if (!should_be_regenning(parent))
stop_regenerating()
return
var/mob/living/living_parent = parent
// Heal bonus for being in crit. Only applies to carbons
var/heal_mod = HAS_TRAIT(living_parent, TRAIT_CRITICAL_CONDITION) ? 2 : 1
var/need_mob_update = FALSE
if(brute_per_second)
need_mob_update += living_parent.adjustBruteLoss(-1 * heal_mod * brute_per_second * seconds_per_tick, updating_health = FALSE)
if(burn_per_second)
need_mob_update += living_parent.adjustFireLoss(-1 * heal_mod * burn_per_second * seconds_per_tick, updating_health = FALSE)
if(tox_per_second)
need_mob_update += living_parent.adjustToxLoss(-1 * heal_mod * tox_per_second * seconds_per_tick, updating_health = FALSE)
if(oxy_per_second)
need_mob_update += living_parent.adjustOxyLoss(-1 * heal_mod * oxy_per_second * seconds_per_tick, updating_health = FALSE)
if(heals_wounds && iscarbon(parent))
var/mob/living/carbon/carbon_parent = living_parent
for(var/datum/wound/iter_wound as anything in carbon_parent.all_wounds)
if(SPT_PROB(2 - (iter_wound.severity / 2), seconds_per_tick))
iter_wound.remove_wound()
need_mob_update++
if(need_mob_update)
living_parent.updatehealth()
/// Checks if the passed mob is in a valid state to be regenerating
/datum/component/regenerator/proc/should_be_regenning(mob/living/who)
if(who.stat == DEAD)
return FALSE
if(regen_check && !regen_check.Invoke(who))
reset_regeneration_timer()
return FALSE
if(heals_wounds && iscarbon(who))
var/mob/living/carbon/carbon_who = who
if(length(carbon_who.all_wounds) > 0)
return TRUE
if(who.health != who.maxHealth)
return TRUE
return FALSE
#undef REGENERATION_FILTER