Files
Bubberstation/code/datums/status_effects/debuffs/confusion.dm
SkyratBot 788d288eba [MIRROR] Nerfs Confusion symptom for diseases [MDB IGNORE] (#23478)
* Nerfs Confusion symptom for diseases (#77991)

## About The Pull Request

Removed the threshold for confusion symptom that adds illiteracy to the
disease.

Clamps confusion symptom's confusion to a maximum of 30 seconds.

Confusion as a debuff no longer guarantees random movement if you're
resting.

## Why It's Good For The Game

> Removed the threshold for confusion symptom that adds illiteracy to
the disease.

This virus makes you unable to actually treat yourself when cured, which
is frankly bonkers. Viruses are too virulent and it's rare that a doctor
actually gets to a biosuit in time to inoculate themselves, and if they
forget internals they're screwed anyways. People should be able to fix
their own got damn disease, this is asinine.

> Clamps confusion symptom's confusion to a maximum of 30 seconds.

The lack of clamping literally makes this symptom send your confusion
level to the fucking atmosphere, you can easily get upwards of 5 minutes
of confusion left because it doesn't clamp, adds 16 seconds per
activation, which is made even worse by the fact that confusion gets
stronger the more duration confusion has on you.

> Confusion as a debuff no longer guarantees random movement if you're
resting.

This remedies the last bit by not making it a literal guarantee that you
can't move in any direction after...... *3* triggers of confusion. It
should be obvious to anyone how absurd this is.

Honestly, it's plain as day that the only reason any of this ended up
like it is because of poor coding and oversights. This is just bringing
things down to their designed level.

## Changelog

🆑
del: Removed the threshold for confusion symptom that adds illiteracy to
the disease.
balance: Clamps confusion symptom's confusion to a maximum of 30
seconds.
qol: Confusion as a debuff no longer guarantees random movement if
you're resting.
/🆑

* Nerfs Confusion symptom for diseases

---------

Co-authored-by: carlarctg <53100513+carlarctg@users.noreply.github.com>
2023-09-02 17:51:04 -07:00

50 lines
1.9 KiB
Plaintext

/// The threshold in which all of our movements are fully randomized, in seconds.
#define CONFUSION_FULL_THRESHOLD 40
/// A multiplier applied on how much time is left (in seconds) that determines the chance of moving sideways randomly
#define CONFUSION_SIDEWAYS_MOVE_PROB_PER_SECOND 1.5
/// A multiplier applied on how much time is left (in seconds) that determines the chance of moving diagonally randomly
#define CONFUSION_DIAGONAL_MOVE_PROB_PER_SECOND 3
/// A status effect used for adding confusion to a mob.
/datum/status_effect/confusion
id = "confusion"
alert_type = null
remove_on_fullheal = TRUE
/datum/status_effect/confusion/on_creation(mob/living/new_owner, duration = 10 SECONDS)
src.duration = duration
return ..()
/datum/status_effect/confusion/on_apply()
RegisterSignal(owner, COMSIG_MOB_CLIENT_PRE_MOVE, PROC_REF(on_move))
return TRUE
/datum/status_effect/confusion/on_remove()
UnregisterSignal(owner, COMSIG_MOB_CLIENT_PRE_MOVE)
/// Signal proc for [COMSIG_MOB_CLIENT_PRE_MOVE]. We have a chance to mix up our movement pre-move with confusion.
/datum/status_effect/confusion/proc/on_move(datum/source, list/move_args)
SIGNAL_HANDLER
// How much time is left in the duration, in seconds.
var/time_left = (duration - world.time) / 10
var/direction = move_args[MOVE_ARG_DIRECTION]
var/new_dir
if(time_left > CONFUSION_FULL_THRESHOLD && !owner.resting)
new_dir = pick(GLOB.alldirs)
else if(prob(time_left * CONFUSION_SIDEWAYS_MOVE_PROB_PER_SECOND))
new_dir = angle2dir(dir2angle(direction) + pick(90, -90))
else if(prob(time_left * CONFUSION_DIAGONAL_MOVE_PROB_PER_SECOND))
new_dir = angle2dir(dir2angle(direction) + pick(45, -45))
if(!isnull(new_dir))
move_args[MOVE_ARG_NEW_LOC] = get_step(owner, new_dir)
move_args[MOVE_ARG_DIRECTION] = new_dir
#undef CONFUSION_FULL_THRESHOLD
#undef CONFUSION_SIDEWAYS_MOVE_PROB_PER_SECOND
#undef CONFUSION_DIAGONAL_MOVE_PROB_PER_SECOND