Files
S.P.L.U.R.T-Station-13/code/game/gamemodes/dynamic
Putnam3145 93feb0277a Further dynamic tweaks: "you can instamerge this time" edition (#11715)
* Starting a replacement of how threat works.

* no, we do it this way

* Added threat levels to jobs

* Added threat to... a lot.

* Updated for traitor classes.

* Fixed errors, except for one.

It's consistently giving me "maximum number of internal arrays exceeded (65535)". I have no idea what could be causing this.

* Added type annotation to GetJob.

* This one I should change though

* wow how'd that happen

* spammable means low threat

* Made story threat have initial threat level on average

* Made somet rulesets force if they won the vote

* )

* Gave EVERY job threat, added a config for it.

* Rebalanced some numbers

* Update code/game/gamemodes/dynamic/dynamic_storytellers.dm

Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com>

* Removes mush threat

* Makes devil threat scale with form

* reviewing reviewer's review of reviewer

* Gutlunches can be friendly spawned, so no

* Also made forced-friendly mobs not count

* null checks better

* Made antag threats in config, too

* various fixes

* Another couple dynamic fixes

* Made an admin message chunk all one line.

* Make roundstarts ignore current threat

It's not even calculated yet, so this is probably better.

* Minimum pop for chaotic/teamwork.

* More conveyance issues, removed superfluous threat costs

* More conveyance and tweaks

* Makes storyteller min players use all players instead of ready

* Lowered chaos weight with chaotic

* Blob now has correct cost

* Makes phylactery count for threat

* Makes random storyteller  have random threat level

* Made starting rulesets scale up with threat LEVEL

* Made "minor rulesets" never have lower weight

* Makes chaotic not forced.

* Made story about 25% less chaotic

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2020-04-03 14:23:08 +02:00
..

DYNAMIC

ROUNDSTART

Dynamic rolls threat based on a special sauce formula: "dynamic_curve_width * tan((3.1416 * (rand() - 0.5) * 57.2957795)) + dynamic_curve_centre"

Latejoin and midround injection cooldowns are set using exponential distribution between 5 minutes and 25 for latejoin 15 minutes and 35 for midround this value is then added to world.time and assigned to the injection cooldown variables.

rigged_roundstart() is called instead if there are forced rules (an admin set the mode)

can_start() -> pre_setup() -> roundstart() OR rigged_roundstart() -> picking_roundstart_rule(drafted_rules) -> post_setup()

PROCESS

Calls rule_process on every rule which is in the current_rules list. Every sixty seconds, update_playercounts() Midround injection time is checked against world.time to see if an injection should happen. If midround injection time is lower than world.time, it updates playercounts again, then tries to inject and generates a new cooldown regardless of whether a rule is picked.

LATEJOIN

make_antag_chance(newPlayer) -> [For each latespawn rule...] -> acceptable(living players, threat_level) -> trim_candidates() -> ready(forced=FALSE) **If true, add to drafted rules **NOTE that acceptable uses threat_level not threat! **NOTE Latejoin timer is ONLY reset if at least one rule was drafted. **NOTE the new_player.dm AttemptLateSpawn() calls OnPostSetup for all roles (unless assigned role is MODE) [After collecting all draftble rules...] -> picking_latejoin_ruleset(drafted_rules) -> spend threat -> ruleset.execute()

MIDROUND

process() -> [For each midround rule...] -> acceptable(living players, threat_level) -> trim_candidates() -> ready(forced=FALSE) [After collecting all draftble rules...] -> picking_midround_ruleset(drafted_rules) -> spend threat -> ruleset.execute()

FORCED

For latejoin, it simply sets forced_latejoin_rule make_antag_chance(newPlayer) -> trim_candidates() -> ready(forced=TRUE) **NOTE no acceptable() call For midround, calls the below proc with forced = TRUE picking_specific_rule(ruletype,forced) -> forced OR acceptable(living_players, threat_level) -> trim_candidates() -> ready(forced) -> spend threat -> execute() **NOTE specific rule can be called by RS traitor->MR autotraitor w/ forced=FALSE **NOTE that due to short circuiting acceptable() need not be called if forced.

RULESET

acceptable(population,threat) just checks if enough threat_level for population indice. **NOTE that we currently only send threat_level as the second arg, not threat. ready(forced) checks if enough candidates and calls the map's map_ruleset(dynamic_ruleset) at the parent level trim_candidates() varies significantly according to the ruleset type Roundstart: All candidates are new_player mobs. Check them for standard stuff: connected, desire role, not banned, etc. **NOTE Roundstart deals with both candidates (trimmed list of valid players) and mode.candidates (everyone readied up). Don't confuse them! Latejoin: Only one candidate, the latejoiner. Standard checks. Midround: Instead of building a single list candidates, candidates contains four lists: living, dead, observing, and living antags. Standard checks in trim_list(list). Midround - Rulesets have additional types /from_ghosts: execute() -> send_applications() -> review_applications() -> finish_setup(mob/newcharacter, index) -> setup_role(role) **NOTE: execute() here adds dead players and observers to candidates list