Files
Bubberstation/code/controllers/subsystem/traitor.dm
Jacquerel 8c6062e948 Traitor Reputation does not scale with population & reintroduces population locked items (#89617)
## About The Pull Request

Closes #89617

Prior to progression traitor some items were only available with a
minimum number of (normally 25) players in the round.
These items were:
- The dual esword
- Noslip shoes
- The ebow
- Holoparasite
- Sleeping Carp
- Contractor Kit
- Maybe a couple of others that I forgot to write down

When we moved to a progression system this concept was merged with
reputation; under 20 players your reputation would advance more slowly
thus making these "dangerous" items less obtainable and also serving as
a sort of scaling factor on rewards (with fewer players the secondary
objectives are easier to complete, so the reward is commesurately
lower).

Now that we have removed secondary objectives this doesn't really make
sense any more, so now reputation simply advances at a rate of one
second per second all the time, but that leaves the old population locks
in question.

So... I just recoded items that are only available when there are enough
players

![image](https://github.com/user-attachments/assets/206577f0-dfdb-4b53-a00f-36e39b2a7f44)

![image](https://github.com/user-attachments/assets/8f840168-9550-4c77-aad0-cb87beb20499)
(This iconography simply vanishes once the pop level is reached).

Note that this is based on "players who have joined" (roundstart +
latejoin), not "players who are online" or "players who are alive".
Once an item becomes available it will never stop being available, but
it only becomes available based on people who are playing and not
watching.

Currently the only items I applied this to (with a value of 20 players)
are:
- Dual esword
- Sleeping Carp
- Spider Extract (the spider antagonist usually requires like 27
players)
- Romerol

It isn't applied to anything else.

## Why It's Good For The Game

Reputation isn't really a tool used to designate how dangerous an item
is any more (if it ever was) and resultingly it doesn't make any sense
to slow its gain based on population.
Some items though we maybe still don't want to show up in a "low pop"
round because they'll create an overall unsatisfying experience, so we
should be able to remove those items from play.

## Changelog

🆑
balance: Traitor reputation now advances at a fixed rate, not dependent
on current server population.
balance: The dual esword, sleeping carp scroll, spider extract, and
romerol vial cannot be purchased if fewer than 20 players have joined
the game.
/🆑
2025-02-22 22:38:40 +00:00

54 lines
2.5 KiB
Plaintext

SUBSYSTEM_DEF(traitor)
name = "Traitor"
flags = SS_KEEP_TIMING
wait = 10 SECONDS
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
/// A list of all uplink items mapped by type
var/list/uplink_items_by_type = list()
/// A list of all uplink items
var/list/uplink_items = list()
/// The coefficient multiplied by the current_global_progression for new joining traitors to calculate their progression
var/newjoin_progression_coeff = 1
/// The current progression that all traitors should be at in the round, you can't have less than this
var/current_global_progression = 0
/// The current uplink handlers being managed
var/list/datum/uplink_handler/uplink_handlers = list()
/// The current scaling per minute of progression.
var/current_progression_scaling = 1 MINUTES
/datum/controller/subsystem/traitor/Initialize()
current_progression_scaling = 1 MINUTES * CONFIG_GET(number/traitor_scaling_multiplier)
for(var/theft_item in subtypesof(/datum/objective_item/steal))
new theft_item
return SS_INIT_SUCCESS
/datum/controller/subsystem/traitor/fire(resumed)
var/previous_progression = current_global_progression
current_global_progression = (STATION_TIME_PASSED()) * CONFIG_GET(number/traitor_scaling_multiplier)
var/progression_increment = current_global_progression - previous_progression
for(var/datum/uplink_handler/handler in uplink_handlers)
if(!handler.has_progression || QDELETED(handler))
uplink_handlers -= handler
if(handler.progression_points < current_global_progression)
// If we got unsynced somehow, just set them to the current global progression
// Prevents problems with precision errors.
handler.progression_points = current_global_progression
else
handler.progression_points += progression_increment // Should only really happen if an admin is messing with an individual's progression value
handler.on_update()
/datum/controller/subsystem/traitor/proc/register_uplink_handler(datum/uplink_handler/uplink_handler)
if(!uplink_handler.has_progression)
return
uplink_handlers |= uplink_handler
// An uplink handler can be registered multiple times if they get assigned to new uplinks, so
// override is set to TRUE here because it is intentional that they could get added multiple times.
RegisterSignal(uplink_handler, COMSIG_QDELETING, PROC_REF(uplink_handler_deleted), override = TRUE)
/datum/controller/subsystem/traitor/proc/uplink_handler_deleted(datum/uplink_handler/uplink_handler)
SIGNAL_HANDLER
uplink_handlers -= uplink_handler