Commit Graph

54 Commits

Author SHA1 Message Date
Bloop
9e5ff3cc67 Fixes manifest hard dels (#92283)
## About The Pull Request

<img width="378" height="199" alt="1eSxYbsh0e"
src="https://github.com/user-attachments/assets/e8a658ca-c1c4-48fe-bb51-c77c85a7f824"
/>

Noticed some hard dels here, does some light refactoring/code
improvement to ensure that doesn't happen.

Crates shouldn't really be owning a hard ref to the manifest in the
first place since they are detachable. Removes some code duplication in
favor of calling `tear_manifest()` which has the safety check to prevent
`forceMove()`ing a qdeleted manifest out of nullspace.

## Why It's Good For The Game

Less server hiccups.

## Changelog

Nothing players will notice besides less server hiccups.
2025-07-25 20:15:29 -06:00
MrMelbert
4c277dc572 Dynamic Rework (#91290)
## About The Pull Request

Implements https://hackmd.io/@tgstation/SkeUS7lSp , rewriting Dynamic
from the ground-up

- Dynamic configuration is now vastly streamlined, making it far far far
easier to understand and edit

- Threat is gone entirely; round chaos is now determined by dynamic
tiers
   - There's 5 dynamic tiers, 0 to 4.
      - 0 is a pure greenshift.
- Tiers are just picked via weight - "16% chance of getting a high chaos
round".
- Tiers have min pop ranges. "Tier 4 (high chaos) requires 25 pop to be
selected".
- Tier determines how much of every ruleset is picked. "Tier 4 (High
Chaos) will pick 3-4 roundstart[1], 1-2 light, 1-2 heavy, and 2-3
latejoins".
- The number of rulesets picked depends on how many people are in the
server - this is also configurable[2]. As an example, a tier that
demands "1-3" rulesets will not spawn 3 rulesets if population <= 40 and
will not spawn 2 rulesets if population <= 25.
- Tiers also determine time before light, heavy, and latejoin rulesets
are picked, as well as the cooldown range between spawns. More chaotic
tiers may send midrounds sooner or wait less time between sending them.

- On the ruleset side of things, "requirements", "scaling", and
"enemies" is gone.
- You can configure a ruleset's min pop and weight flat, or per tier.
- For example a ruleset like Obsession is weighted higher for tiers 1-2
and lower for tiers 3-4.
- Rather than scaling up, roundstart rulesets can just be selected
multiple times.
- Rulesets also have `min_antag_cap` and `max_antag_cap`.
`min_antag_cap` determines how many candidates are needed for it to run,
and `max_antag_cap` determines how many candidates are selected.

- Rulesets attempt to run every 2.5 minutes. [3]

- Light rulesets will ALWAYS be picked before heavy rulesets. [4]

- Light injection chance is no longer 100%, heavy injection chance
formula has been simplified.
- Chance simply scales based on number of dead players / total number
off players, with a flag 50% chance if no antags exist. [5]

[1] This does not guarantee you will actually GET 3-4 roundstart
rulesets. If a roundstart ruleset is picked, and it ends up being unable
to execute (such as "not enough candidates", that slot is effectively a
wash.) This might be revisited.

[2] Currently, this is a hard limit - below X pop, you WILL get a
quarter or a half of the rulesets. This might be revisited to just be
weighted - you are just MORE LIKELY to get a quarter or a half.

[3] Little worried about accidentally frontloading everything so we'll
see about this

[4] This may be revisited but in most contexts it seems sensible. 

[5] This may also be revisited, I'm not 100% sure what the best / most
simple way to tackle midround chances is.

Other implementation details

- The process of making rulesets has been streamlined as well. Many
rulesets only amount to a definition and `assign_role`.

- Dynamic.json -> Dynamic.toml

- Dynamic event hijacked was ripped out entirely.
- Most midround antag random events are now dynamic rulesets. Fugitives,
Morphs, Slaughter Demons, etc.
      - The 1 weight slaughter demon event is gone. RIP in peace. 
- There is now a hidden midround event that simply adds +1 latejoin, +1
light, or +1 heavy ruleset.

- `mind.special_role` is dead. Minds have a lazylist of special roles
now but it's essentially only used for traitor panel.

- Revs refactored almost entirely. Revs can now exist without a dynamic
ruleset.

- Cult refactored a tiny bit. 

- Antag datums cleaned up.

- Pre round setup is less centralized on Dynamic.

- Admins have a whole panel for interfacing with dynamic. It's pretty
slapdash I'm sure someone could make a nicer looking one.


![image](https://github.com/user-attachments/assets/e99ca607-20b0-4d30-ab4a-f602babe7ac7)


![image](https://github.com/user-attachments/assets/470c3c20-c354-4ee6-b63b-a8f36dda4b5c)

- Maybe some other things.

## Why It's Good For The Game

See readme for more info.

Will you see a massive change in how rounds play out? My hunch says
rounds will spawn less rulesets on average, but it's ultimately to how
it's configured

## Changelog

🆑 Melbert
refactor: Dynamic rewritten entirely, report any strange rounds
config: Dynamic config reworked, it's now a TOML file
refactor: Refactored antag roles somewhat, report any oddities
refactor: Refactored Revolution entirely, report any oddities
del: Deleted most midround events that spawn antags - they use dynamic
rulesets now
add: Dynamic rulesets can now be false alarms
add: Adds a random event that gives dynamic the ability to run another
ruleset later
admin: Adds a panel for messing around with dynamic
admin: Adds a panel for chance for every dynamic ruleset to be selected
admin: You can spawn revs without using dynamic now
fix: Nuke team leaders get their fun title back
/🆑
2025-06-25 17:36:10 -07:00
carlarctg
4ac2974e95 Adds support for PVP Bitrunning Domains (#89798)
## About The Pull Request

Adds support for PVP bitrunning domains. If min/max candidates are set
above 0, the virtual domain will search for any ghost spawners inside
and cause a randomly-selected ghost that signed up via poll to spawn
there. If no ghosts are signed up the process is cancelled.

Also adds content for them:
An outfit wardrobe that lets you select one of several possible outfits,
once.

![image](https://github.com/user-attachments/assets/485d854d-d0c4-43b8-9dc4-75fa9dd2f17f)

Not confident in my code, it's been in the works (as part of a
now-canned library heretic domain thing) for over a year
## Why It's Good For The Game

PvP domains are an underexplored concept. The beach domain is cloying
and overly simple. This adds support for newer and cooler domains as
long as there are ghosts for them.
## Changelog
🆑
code: Adds support for PVP Bitrunning Domains
/🆑
2025-05-31 13:33:47 +00:00
MrMelbert
5261efb67f Re-refactors batons / Refactors attack chain force modifiers (#90809)
## About The Pull Request

Melee attack chain now has a list passed along with it,
`attack_modifiers`, which you can stick force modifiers to change the
resulting attack

This is basically a soft implementation of damage packets until a more
definitive pr, but one that only applies to item attack chain, and not
unarmed attacks.

This change was done to facilitate a baton refactor - batons no longer
hack together their own attack chain, and are now integrated straight
into the real attack chain. This refactor itself was done because batons
don't send any attack signals, which has been annoying in the past (for
swing combat).

## Changelog

🆑 Melbert
refactor: Batons have been refactored again. Baton stuns now properly
count as an attack, when before it was a nothing. Report any oddities,
particularly in regards to harmbatonning vs normal batonning.
refactor: The method of adjusting item damage mid-attack has been
refactored - some affected items include the Nullblade and knives.
Report any strange happenings with damage numbers.
refactor: A few objects have been moved to the new interaction chain -
records consoles, mawed crucible, alien weeds and space vines, hedges,
restaurant portals, and some mobs - to name a few.
fix: Spears only deal bonus damage against secure lockers, not all
closet types (including crates)
/🆑
2025-05-19 13:32:12 +10:00
Rhials
8cb6e45abd Grassland Hunt domain doesn't give you a crate for quitting early (#90917)
## About The Pull Request

This prevents the Grassland Hunt VDOM from auto-completing when the
domain is shut down.

This is because the target mobs are "killed" as the map unloads, and
those kills would count towards the domain's win condition. Now, mobs
just qdel wholesale when the domain unloads. No death, no funeral.

This ALSO happened because, on the Grassland Hunt domain, the crate
point beacon was located directly over the delivery zone. This means
that, as the map unloaded, it would dust (kill) the target mobs until
the crate spawned in the safehouse (basically the last area to unload),
"winning" the domain as it unloads. Now, the beacon has been moved to
directly outside the safehouse.

I wasn't sure how to handle this so I went with both solutions at the
same time.
## Why It's Good For The Game

Bitrunning isn't a lot of work, but starting and stopping the domain is
a bit too easy to warrant a reward.
## Changelog
🆑 Rhials
fix: The grassland hunt domain no longer auto-completes just by closing
the domain.
/🆑
2025-05-01 17:16:45 -07:00
Ghom
339616ae78 You can now interact with held mobs beside wearing them (feat: "minor" melee attack chain cleanup) (#90080)
## About The Pull Request
People can now pet held mothroaches and pugs if they want to, or use
items on them, hopefully without causing many issues. After all, it only
took about a couple dozen lines of code to make...

...Oh, did the 527 files changed or the 850~ lines added/removed perhaps
catch your eye? Made you wonder if I accidentally pushed the wrong
branch? or skewed something up big time? Well, nuh uh. I just happen to
be fed up with the melee attack chain still using stringized params
instead of an array/list. It was frankly revolting to see how I'd have
had to otherwise call `list2params` for what I'm trying to accomplish
here, and make this PR another tessera to the immense stupidity of our
attack chain procs calling `params2list` over and over and over instead
of just using that one call instance from `ClickOn` as an argument. It's
2025, honey, wake up!

I also tried to replace some of those single letter vars/args but there
are just way too many of them.

## Why It's Good For The Game
Improving old code. And I want to be able to pet mobroaches while
holding them too.

## Changelog

🆑
qol: You can now interact with held mobs in more ways beside wearing
them.
/🆑
2025-04-23 20:18:26 +00:00
Lucy
79a26d26e5 Fix some instances of trying to directly qdel lists (#90227)
## About The Pull Request

this fixes a bunch of code incorrectly calling qdel directly on a list,
and adds a stack trace to qdel if someone does pass a list to it

## Why It's Good For The Game

because I'm pretty sure qdel ends up calling fucking `del()` as `/list`
is not a `/datum`

## Changelog

No user-facing changes.
2025-03-28 18:37:16 +01:00
SmArtKar
b7383bc503 Refactors MODsuit slowdown calculations (#90116)
## About The Pull Request

MODsuits now calculate their slowdown by querying modules by sending a
signal on themselves instead of having modules try and keep up with
control unit's speed updates (which broke in a fabulous fashion after
MODsuits were allowed to deploy by piece)
Also added a separate trait to prevent objects from being speed
potion-ed to combat stabilized red crossbreed issues, and removed a
duplicate list helper (40 lines down in the same file lol)

Closes #89979
Closes #90036

## Changelog
🆑
fix: MODsuits should now be affected by stabilized red crossbreeds
fix: MODsuit slowdowns should no longer behave weirdly with ash
accretion/magboots/armor booster modules.
refactor: Refactored MODsuit slowdown calculations to be query-based
instead of modules directly modifying part speed values.
/🆑
2025-03-26 17:55:32 +01:00
Jeremiah
70d356506f Fixes a bitrunning runtime & adds a component initialize result (#90099)
## About The Pull Request
Noticed that bitrunning virtual spawners were runtiming if the server
was already emagged. Basically, the guardrail component is added
(virtual_entity), then immediately deleted because it's emagged, leading
to a race condition in `JoinParent()` where parent is null. I still want
to keep this "valid, but delete me" state for components, so I made
`COMPONENT_REDUNDANT` (thx @LemonInTheDark).

I can't say for certain because I couldn't repro, but this /probably/
fixes #89992
## Why It's Good For The Game
Fixes a runtime
Allows devs to add components that execute an arbitrary amount of logic
while still qdeling themselves due to some in-game incompatibility issue
## Changelog
N/A
2025-03-20 13:51:47 +01:00
Kapu1178
a0e862d575 Base implementation of /datum/persistent_client (#89449)
## About The Pull Request
Converts `/datum/player_details` into `/datum/persistent_client`.
Persistent Clients persist across connections. The only time a mob's
persistent client will change is if the ckey it's bound to logs into a
different mob, or the mob is deleted (duh).

Also adds PossessByPlayer() so that transfering mob control is cleaner
and makes more immediate sense if you don't know byond-fu.

## Why It's Good For The Game
Clients are an abstract representation of a connection that can be
dropped at almost any moment so putting things that should be stable to
access at any time onto an undying object is ideal. This allows for
future expansions like abstracting away client.screen and managing
everything cleanly.
2025-02-25 13:52:24 -06:00
Archemagus
8a5898212b Automated Announcement System refactor (#89276)
## About The Pull Request

I standardized stuff in AASs code, and all current reference to it. Also
added interactions for bounty cubes, weather reports and request
consoles, all of it can be changed from AASs UI.
Also it's easier now to add new config entries for AAS to proceed, and
it's now downstream friendly.
## Why It's Good For The Game
Well, because kind of order in code and because it's funny to make
custom messages for... Almost everything?
BTW any entry can be blocked from ingame changes, by default you can't
change Broken Arrival shuttle and Security Officer arrival
announcements, how it was before. But may be we should allow it - it's
an open question.
## Changelog
🆑
add: Many things now handles via AAS: Bounty Cubes, Request Consoles,
Brig Cells, Vending Machines and Orion Trails alerts, Weather Reports,
Cargo Order Console
code: Now anyone can make their own entry for AAS
refactor: AAS internals, also cleanup
/🆑
2025-02-17 11:06:50 +01:00
Y0SH1M4S73R
25eb08420a Temporary bodies return players to minds without bodies (#89323)
## About The Pull Request

There are a couple of cases where ghost roles that give the temporary
body component prevent you from returning to the round when they really
shouldn't. The particular cases are:
- You entered a temporary body while you had no body, but could be
recovered via means such as podcloning
- You enter a temporary body, and while in that body, your original body
is permanently removed while your mind could be recovered via means such
as podcloning
- Basketball

This PR addresses those cases by allowing the temporary body component
to operate with a null `old_body`, and allowing the temporary body
component to be given to ghosts whose minds don't have bodies.


## Why It's Good For The Game

Erroneous DNRs caused by code oversights are probably very undesirable
to the playerbase.

## Changelog

🆑
fix: Joining a minigame or taking certain ghost roles, while you have a
mind without a body, will no longer DNR you, just in case you can be
resurrected by some means.
fix: If your old body is permanently destroyed while you are playing a
minigame or as certain ghost roles, you will still return to your
character's original mind, just in case you can be resurrected by some
means.
fix: The basketball minigame now gives its players and referee temporary
bodies.
/🆑
2025-02-05 20:01:42 +01:00
_0Steven
fe1e071499 Bitrunning Gimmick Loadout Disks (feat. minor disk load refactor) (#88716)
## About The Pull Request

Where I forget about a pr for 5 months.

This started because there was a pr that made it so skills transfer
between the real and the digital, and so I thought it'd be really funny
if I could train boxing in virtual reality... but there's no easy way to
get boxing gloves or anything like it in the virtual world...
So! I decided to make a disk for it, but then thought about fishing and
gaming and-
Anyhow it all went downhill from there and here we are now: Gimmick
Disks. (And a refactor of disk loading)

This implements a new type of bitrunning disk that instead of a single
item or ability, grants a full set of thematic items/abilities!
Unhelpfully cosplay as a wizard! Game inside your game! Down a digital
protein shake and box some simplemobs!
As the name "Gimmick" implies, these are primarily intended to help
shake up the sometimes stale bitrunner gameplay.
By letting you invoke, if you so desire, what to me is the most
enjoyable gaming experience: doing stupid shit with your buddies.

To facilitate the new type of disk I had to refactor disk loading, as it
was hardcoded to the item types.
Instead, we make disk loading send a signal to the bitrunner, and
register for this when held in their inventory.
This allows us to do things like making the lead acid battery give you
shock touch when held, without needing to make an explicit typecheck or
iterate over every item in the bitrunner's nested contents to see if
they have a loadable item.
## Why It's Good For The Game

I think it'd be really funny if you could train your boxing in the
digital realm.
As said above, I feel the bitrunner gameplay can get stale sometimes,
and this is how I hope to help people shake it up for themselves
sometimes. By giving them more stupid shit to do.
Doing stupid extended bits with other people is one of the things I
enjoy most out of ss13, and this is there to let the bitrunners do
exactly that with each other.

And sometimes you just have to roleplay as Gamers™️ entering virtual
reality to fight the virtual syndicate in bad cosplay while roleplaying
as a wizard smoking his magic weed, an overly edgy rogue, and the healer
desperately trying to keep them from exploding into a million pieces.
## Changelog
🆑
refactor: Bitrunning item/ability loading has been refactored. Please
report any issues.
add: Added Bitrunning gimmick loadout disks. These disks contain full
sets of equipment for all your digital cosplay needs, each including
questionably helpful equipment. Currently includes Sports (Boxer,
Skater, Archer, Fisher, Gamer) and Dungeon Crawling (Alchemist, Rogue,
Healer, Wizard).
add: Taking a lead acid battery into the netpod with you now gives your
bit avatar shock touch.
/🆑
2025-01-30 13:17:08 +01:00
Penelope Haze
b67a0901f2 Fix issues discovered via TypeMaker (#87596)
## About The Pull Request
Fixes issues with var typing and proc arguments, discovered using
OpenDream's WIP TypeMaker feature (using improvements I haven't PR'd
upstream yet).

## Why It's Good For The Game
Codebase maintenance.
2024-11-19 15:24:52 -05:00
Ghom
778ed9f1ab The death or internal/external organ pathing (ft. fixed fox ears and recoloring bodypart overlays with dye sprays) (#87434)
## About The Pull Request
This PR kills the abstract internal and external typepaths for organs,
now replaced by an EXTERNAL_ORGAN flag to distinguish the two kinds.

This PR also fixes fox ears (from #87162, no tail is added) and
mushpeople's caps (they should be red, the screenshot is a tad
outdated).

And yes, you can now use a hair dye spray to recolor body parts like
most tails, podpeople hair, mushpeople caps and cat ears. The process
can be reversed by using the spray again.

## Why It's Good For The Game
Time-Green put some effort during the last few months to untie functions
and mechanics from external/internal organ pathing. Now, all that this
pathing is good for are a few typechecks, easily replaceable with
bitflags.

Also podpeople and mushpeople need a way to recolor their "hair". This
kind of applies to fish tails from the fish infusion, which colors can't
be selected right now. The rest is just there if you ever want to
recolor your lizard tail for some reason.

Proof of testing btw (screenshot taken before mushpeople cap fix, right
side has dyed body parts, moth can't be dyed, they're already fabolous):

![immagine](https://github.com/user-attachments/assets/2bb625c9-9233-42eb-b9b8-e0bd6909ce89)

## Changelog

🆑
code: Removed internal/external pathing from organs in favor of a bit
flag. Hopefully this shouldn't break anything about organs.
fix: Fixed invisible fox ears.
fix: Fixed mushpeople caps not being colored red by default.
add: You can now dye most tails, podpeople hair, mushpeople caps etc.
with a hair dye spray.
/🆑
2024-10-30 08:03:02 +01:00
Profakos
9f7d6dea62 Outfits that put items in your hand now respect if the outfit is visual only (#87355)
## About The Pull Request

On a downstream, we have an antagonist, that is a less competent
wizards. This antagonist's preview outfit has a beer bottle in their
hand, which has caused runtimes, as the bottle did not have any reagents
instantiated, and it tried check its length for sloshing. After putting
in a check for the `initial` argument of `on_equip`, I have noticed that
the problem goes deeper: the various procs that handle putting something
in your hand do not pass along if the items is put in your hand as a
preview or not. This PR adds a new optional var to these procs, ensuring
that unwanted behaviour during previews won't trigger.

I also swapped `visualsOnly` to snake case, as it looked inconsistent
with the rest of the code style.
 
## Why It's Good For The Game

Making the argument that ensures avoiding side effects during previews
work with all kinds of items is good.

## Changelog

🆑
fix: if an outfit puts a reagent container in the preview dummy's hand,
it will not try to slosh
code: outfits putting items in your hand will respect the visual_only
argument
/🆑
2024-10-24 15:09:50 +02:00
grungussuss
58501dce77 Reorganizes the sound folder (#86726)
## About The Pull Request

<details>

- renamed ai folder to announcer

-- announcer --
- moved vox_fem to announcer
- moved approachingTG to announcer

- separated the ambience folder into ambience and instrumental
-- ambience --

- created holy folder moved all related sounds there
- created engineering folder and moved all related sounds there
- created security folder and moved ambidet there
- created general folder and moved ambigen there
- created icemoon folder and moved all icebox-related ambience there
- created medical folder and moved all medbay-related ambi there
- created ruin folder and moves all ruins ambi there
- created beach folder and moved seag and shore there
- created lavaland folder and moved related ambi there
- created aurora_caelus folder and placed its ambi there
- created misc folder and moved the rest of the files that don't have a
specific category into it

-- instrumental --

- moved traitor folder here
- created lobby_music folder and placed our songs there (title0 not used
anywhere? - server-side modification?)

-- items --

- moved secdeath to hailer
- moved surgery to handling

-- effects --

- moved chemistry into effects
- moved hallucinations into effects
- moved health into effects
- moved magic into effects

-- vehicles --

- moved mecha into vehicles


created mobs folder

-- mobs --

- moved creatures folder into mobs
- moved voice into mobs

renamed creatures to non-humanoids
renamed voice to humanoids

-- non-humanoids--

created cyborg folder
created hiss folder
moved harmalarm.ogg to cyborg

-- humanoids --




-- misc --

moved ghostwhisper to misc
moved insane_low_laugh to misc

I give up trying to document this.

</details>

- [X] ambience
- [x] announcer
- [x] effects
- [X] instrumental
- [x] items
- [x] machines
- [x] misc 
- [X] mobs
- [X] runtime
- [X] vehicles

- [ ] attributions

## Why It's Good For The Game

This folder is so disorganized that it's vomit inducing, will make it
easier to find and add new sounds, providng a minor structure to the
sound folder.

## Changelog
🆑 grungussuss
refactor: the sound folder in the source code has been reorganized,
please report any oddities with sounds playing or not playing
server: lobby music has been repathed to sound/music/lobby_music
/🆑
2024-09-23 22:24:50 -07:00
Timberpoes
6808a082eb Assorted changes to job assignment code and logging. Runtime free, guaranteed or your money back. Price: $£0. (#85947)
## About The Previous Pull Request

#85308 reverted by #85929


![image](https://github.com/user-attachments/assets/e7518dcb-a60a-4bf1-a3d4-a5a8966d8633)

~~Causes the round to not start when a player isn't eligible for any
jobs at a specific priority level due to runtimes trying to `pick()`
from an empty list aborting the entire job assignment stack.~~
(Fixed???? by
e0e9f2f430)

Maybe we should test merge this for a mo just to make sure no more
cheeky runtimes pop up before merging.

## About The Pull Request

This PR does a couple of minor things:
Makes the job debug logging a bit easier to follow.
Minorly brings some SSjob code up to code standards, converting proc
names to snake_case and doing some otherm is cleanup.
Refactored some stuff into different procs, updated some comments.

And some major things:
Changes the job assignment logic.
Old behaviour
> Assign dynamic priority roles
> Force one Head of Staff (if possible)
> Assign all AIs
> Assign overflow roles (bugged in 2 ways)
> Shuffle the available jobs list once, at the start of the random job
assignment loop
> Pick and assign random jobs for random players from High prefs down,
with a priority on Head of Staff roles
> Handle everyone that couldn't be assigned a random job

New behaviour
> Assign dynamic priority roles
> Assign all Head of Staff roles to players with High prefs
> If no Head of Staff was made in the above way, force one Head of Staff
(if possible)
> Assign all AIs
> Assign overflow roles (fixed)
> Prioritise and fill unfilled head roles at each job priority pref
level, from High prefs down.
> Build a list of all jobs that each unassigned player could be eligible
for at the above pref level.
> Pick a job from that list at random and assign it to the player.
> Handle everyone that couldn't be assigned a random job.

In reality there should be little impact on overall job assignment, the
code changes read more as semantics. For example, the priority check for
filling Head slots will have the same candidate pool in both old and new
versions, but in the new version we're more clearly saying that Heads
are important and we want to prioritise filling them for the sake of
round progression even though the outcome in new and old is the same.

A key change will lead to an increase in assistants - Overflow fixes.

Currently the code block to do early assignments to the Overflow role
doesn't work - or works but not as you'd expect. The idea was is that
because enabling the Overflow role in the prefs menu is an On/Off toggle
that sets the job to High priority when enabled and prevents any other
High priority pref, players that have the Overflow role enabled will
**always** get it. It's their highest priority job with infinite slots.
So we do a pass right at the start to give everyone with the Overflow
role enabled that role and save us wasting time later on in random job
code giving them that same role but with more work.

The problem is the code for this only assigns the Overflow role to
people with it set to Low priority in their prefs, resulting in log
readouts like:
```
[2024-07-27 09:49:43.469] DEBUG-JOB: DO, Running Overflow Check 1
[2024-07-27 09:49:43.469] DEBUG-JOB: Running FOC, Job: /datum/job/assistant, Level: Low Priority
[2024-07-27 09:49:43.472] DEBUG-JOB: FOC player job enabled at wrong level, Player: Radioprague, TheirLevel: Medium Priority, ReqLevel: Low Priority
[2024-07-27 09:49:43.472] DEBUG-JOB: FOC player job enabled at wrong level, Player: Caluan, TheirLevel: High Priority, ReqLevel: Low Priority
[2024-07-27 09:49:43.473] DEBUG-JOB: FOC player job enabled at wrong level, Player: Caractaser, TheirLevel: High Priority, ReqLevel: Low Priority
[2024-07-27 09:49:43.473] DEBUG-JOB: FOC player job enabled at wrong level, Player: Apsua, TheirLevel: High Priority, ReqLevel: Low Priority
[2024-07-27 09:49:43.475] DEBUG-JOB: FOC player job enabled at wrong level, Player: Bebrus2, TheirLevel: Medium Priority, ReqLevel: Low Priority
[2024-07-27 09:49:43.475] DEBUG-JOB: AC1, Candidates: 0
```
Where nobody gets pre-assigned the overflow role because their prefs are
all set to the High priority from being toggled... Except wait a second,
some people have it at Medium priority when it should just be a No
Role/High Priority Role toggle?

And herein we meet a problem. My hypothesis is that traits and stuff
that change the overflow have allowed players to set the "ordinary"
overflow role of Assistant to Medium and/or Low priority.

This still shows as enabled in the prefs menu, but leads to an outcome
where a player with assistant enabled is assigned Cook instead.
```
[2024-07-27 09:49:47.775] DEBUG-JOB: DO, Running Overflow Check 1
[2024-07-27 09:49:47.775] DEBUG-JOB: Running FOC, Job: /datum/job/assistant, Level: Low Priority
...
[2024-07-27 09:49:43.475] DEBUG-JOB: FOC player job enabled at wrong level, Player: Bebrus2, TheirLevel: Medium Priority, ReqLevel: Low Priority
...
[2024-07-27 09:49:47.987] DEBUG-JOB: Running AR, Player: Bebrus2, Job: /datum/job/cook, LateJoin: 0
```

So players with the Overflow job pref set to Low (an unexpected state,
should be disabled or High) would be guaranteed to get that role if none
of the higher priority Head of Staff/AI/Dynamic roles took over via the
bugged "force overflow for people with the pref enabled" proc.

Players with the Overflow job pref set to High would be guaranteed to
get that role if none of the higher priority Head of Staff/AI/Dynamic
roles took over via the random job assignment code giving them their
Highest priority role thanks to the infinite job slots of the Overflow.

And players with the Overflow job pref set to Medium (an unexpected
state, should be disabled or High) would get Assistant if the shuffle
step of the available jobs list put Assisstant before any of the other
jobs they had prefs enabled for at Medium that weren't already filled,
otherwise they'd get another random job.

This code is now changed to ignore the priority the player has set when
looking for people to fill the overflow role. As long as it **is**
enabled, the player will get it unless they're forced into a dynamic
ruleset role (AI when malf rolls) or a Head of Staff role due to their
other prefs (they have RD set to med or low, and no other player has a
Head of Staff at high so they get randomly picked and miss the overflow
role).

This will increase the number of assistants in shifts where their pref
state has Assisstant in the bugged Medium priority, but doesn't change
it for bugged Low and not-bugged High/On priority.

On the other side of the coin, we have how the random jobs are picked.
They're kinda not random, and I noticed this reading the logs then
reading the code.

The list of available jobs to pick from is randomly shuffled - but only
**once**. All players pull from a list of jobs in the same order. So you
end up with a log block like this:
```
[2024-07-27 09:49:47.985] DEBUG-JOB: DO pass, Player: Pierow, Level:3, Job:Botanist
[2024-07-27 09:49:47.985] DEBUG-JOB: Running AR, Player: Pierow, Job: /datum/job/botanist, LateJoin: 0
[2024-07-27 09:49:47.985] DEBUG-JOB: Player: Pierow is now Rank: Botanist, JCP:0, JPL:2
[2024-07-27 09:49:47.986] DEBUG-JOB: DO pass, Player: Daddos, Level:3, Job:Botanist
[2024-07-27 09:49:47.986] DEBUG-JOB: Running AR, Player: Daddos, Job: /datum/job/botanist, LateJoin: 0
[2024-07-27 09:49:47.986] DEBUG-JOB: Player: Daddos is now Rank: Botanist, JCP:1, JPL:2
[2024-07-27 09:49:47.986] DEBUG-JOB: FOC job filled and not overflow, Player: Bebrus2, Job: /datum/job/botanist, Current: 2, Limit: 2
[2024-07-27 09:49:47.987] DEBUG-JOB: FOC player job not enabled, Player: Bebrus2
[2024-07-27 09:49:47.987] DEBUG-JOB: DO pass, Player: Bebrus2, Level:3, Job:Cook
[2024-07-27 09:49:47.987] DEBUG-JOB: Running AR, Player: Bebrus2, Job: /datum/job/cook, LateJoin: 0
[2024-07-27 09:49:47.988] DEBUG-JOB: Player: Bebrus2 is now Rank: Cook, JCP:0, JPL:1
[2024-07-27 09:49:47.988] DEBUG-JOB: FOC player job not enabled, Player: Redwizz
[2024-07-27 09:49:47.988] DEBUG-JOB: FOC job filled and not overflow, Player: Redwizz, Job: /datum/job/cook, Current: 1, Limit: 1
```

The list is shuffled into an order of something like `list("Scientist",
"Botanist", "Cook", "Sec Officer", ...)` then iterated over for each
player. So every random job selection goes:
> "Does Player1 have Scientist enabled and at the right priority? No?
Okay, Botanist? Yes? You get botanist."
> "Does Player2 have Scientist enabled and at the right priority? No?
Okay, Botanist? Yes? You get botanist."
> "Does Player3 have Scientist enabled and at the right priority? No?
Okay, Botanist has no slots left so we'll remove it from the list. Okay,
Cook? Yes? You get cook."
> "Does Player4 have Scientist enabled and at the right priority? No?
Okay, Cook has no slots left so we'll remove it from the list. Okay, Sec
Officer? ..."

This can lead to stacked individual departments if it gets randomly
rolled to the start of the list in the shuffle, and completely empty
departments if they end up at the end.

On high pop shifts this is probably less of an issue. Player prefs add
noise to this and as departments at the front fill up, those at the back
pick up some of the lower pref players.

But have you ever had a shift where there's just like... No fucking sec
even though there's tons of players? The logging (before I made changes
in this PR) was a bit ass, but my hypothesis there is that sec officer
was shuffled right at the end of the random job list, so every other
department was filled up before sec officers were picked.

To mitigate this, I made the list shuffle every single time the game
picks a random available job for the player. This should lead to a more
balanced selection of available jobs by avoiding situations where the
code is biased towards packing some departments by accident.
## Why It's Good For The Game

Overflow fixes mean people who go to their prefs and see the Overflow
Role is On will all have the same experience - They will be the Overflow
role.

More random random job selection should prevent individual departments
having a jobs be stacked when it would have otherwise been possible for
a more balanced selection but the code unintentially biased random
departments to be overstaffed and understaffed each shift.
## Changelog
🆑
fix: Having the Overflow Role set to On will properly ensure you get
that role at a High priority as intended by the game code.
fix: Job selection is now a little bit more random. Fixes an
unintentional bias in random job assignment that could lead to
feast-or-famine for roles where everyone is assigned one job and nobody
is assigned another job.
/🆑
2024-09-13 13:58:35 +02:00
Jeremiah
008876823c Adds two new BR maps, basic mobs, BR tweaks & fixes (#85292)
## About The Pull Request
Title. Adds two new maps: 
- Grasslands Hunt (peaceful)
- Meta Central (easy)

These maps add a new basic revolutionary mob and significantly upgrades
the ai of basic deer.
This fixes an issue where modular maps were not correctly spawning mobs
or adding them to the "mutable candidates" for antagonists.
There's also some balance changes to bitrunning vendor prices, which are
generally now lower. This change is unrelated to the PR as a whole so
I'm okay with removing it if there's concern

### photos
<details>
<summary>expand</summary>

![Screenshot 2024-07-26
151822](https://github.com/user-attachments/assets/61fd84f3-3768-4b7a-b421-a953fb8b8174)

![Screenshot 2024-07-26
151834](https://github.com/user-attachments/assets/27193237-858e-41ac-953c-6c30846c98c0)

</details>

### todo

- [x] Fix the revolutionary death anim
- [x] Make deer run when injured
## Why It's Good For The Game
New maps as a general positive for bitrunning
Bug fixes
Makes vendor choices for bitrunning-exclusive items generally less of a
chore to get
## Changelog
jlsnow301, MMMiracles, KikoWen0, Ben10Omintrix
🆑
add: Added two new bitrunning maps: Grasslands Hunt and Meta Central.
add: Deer are now more complex animals, granting them enhanced ability
to run amok and chew your favorite plants.
balance: Reduced the cost of most BR vendor items.
fix: Fixes an issue where modular virtual domains spawned less mobs than
intended.
fix: These modular spawns are now valid mutation targets to become an
antagonist.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-09-06 01:53:50 +02:00
tgstation-ci[bot]
9a9b428b61 Wallening Revert [MDB Ignore][IDB Ignore] (#86161)
This PR is reverting the wallening by reverting everything up to
8868a5d1fe and replaying the PRs skipping
#85491.

The following 239 (39 + Wallening Main PR excluded) PRs need to be
replayed (DO NOT EDIT THIS LIST MANUALLY, IT IS USED BY THE BOT TO TRACK
PROGRESS):

  - [x] #85777 - Reverted in 3
  - [x] #85767 - Reverted in 2
  - [x] #85763 - Reverted in c
  - [x] #85762 - Reverted in 2
  - [x] #85760 - Reverted in dbc19df13b033ac8bb5a83fa38c5cf140cf31836
  - [x] #85733 - Reverted in 22f17d057eac71661b86c3f2186489568c130043
  - [x] #85721 - Reverted in 6d90643dbbc90f3d21f2d25dc85dc4d4f706d6a3
  - [x] #85719 - Reverted in c52954648309ad4786238f409cd33142d486190f
  - [x] #85705 - Reverted in 3b5ddabfd5ab2cfec226a643be6e8a8fd656c831
  - [x] #85684 - Reverted in cbc1839625f44ba67bcd5489c3629ef98e31b2d4
  - [x] #85662 - Reverted in 69cac24e236604c262093abea7b9566ecbd092c4
  - [x] #85663 - Reverted in f394c3b1430d346b0598abf19fe511b30c3f4676
  - [x] #85673 - Reverted in 8a9ae0411488c9c779a54c5c41076238c230a304
  - [x] #85718 - Reverted in f8f18d8b626e963b06555f76850702740d5de0c3
  - [x] #85667 - Reverted in a1365766d178b727b6c6b503ad410e9d88d57ddd
  - [x] #85683 - Reverted in 3bdb0207d883de8db6f726d976025517cc6d3cba
  - [x] #85676 - Reverted in 0a5d667b2c8a9a2519af2a4fda8cd39f568e5049
  - [x] #85661 - Reverted in 49fc6bc1815133644d7173aa7914ede6c900218a
  - [x] #85682 - Reverted in b41efe96fd72228b079319ac07c660f4cd974af6
  - [x] #85695 - Reverted in 89a173b136cb0297070cef39c5bc9783b6323f02
  - [x] #85654 - Reverted in 1e4836b5173a40fbeb8755e0fb76ebc8d39fe1e0
  - [x] #85655 - Reverted in b4dde41eebd0422e1ec440b4d8d54229fc9617f4
  - [x] #85634 - Reverted in 0c352fc785762da025a68873438593b508f757d9
  - [x] #85700 - Reverted in 1327cf7fe48d7f4fd227120508f77c831aefa4ca
  - [x] #85633 - Reverted in c71c8c9d43112a1f4c6331bbba546881dcffd59d
  - [x] #85649 - Reverted in 73484337077f616878e63208d9bf2309f0d2e579
  - [x] #85475 - Reverted in 839f700001a57646109e75332d5311fe27bbc957
  - [x] #85467 - Reverted in 6f08421f64d01b13775d146cf7a451f9f38e195a
  - [x] #85472 - Reverted in 63c6a9b04e72e8130df5eeb2861c75f80a97e3de
  - [x] #85300 - Reverted in 7c776034f34ee6a76810c1a3779f169f2430c418
  - [x] #85249 - Reverted in 257d02273751fc1f939f76756f70b614a6e06789
  - [x] #85236 - Reverted in f9f4c444c8fc027dea87d4dbe0ebb8dd6bc67154
  - [x] #85299 - Reverted in f24ddff51dc3fec7145a2e97f057f1b286921db3
  - [x] #85228 - Reverted in cb8c318f7e2183d9f941c582f79e4c8b2503d95c
  - [x] #84910 - Reverted in 2a562ca26d9d13f335c276487f66edaa0d21b3bd
  - [x] #84889 - Reverted in 679da6885b034bcd8843f7f4c855388bce263733
  - [x] #84766 - Reverted in 4035dd7adee74af0fed82c14a8749585b2ab1c96
  - [x] #85607 - Reverted in dc9a0462b4c287cee2d541925f8a9988d18d9d85
  - [x] #85618 - Reverted in 2a06f57c89939dc31e9273ef250bd050cff17ff1
  - [x] #85619 - Reverted in b98661affc90e44c68a58c05e57cdf1dfd094c93
  - [x] #85608 - Reverted in 57a935126233f90255aef0a55dab16524be1faac
  - [x] #85648 - Reverted in ab82c66a95d4fbff86040b421a86cc82dca73009
  - [x] #85692 - Reverted in f04fac92bd3594f12f244bae9ea0c5c300c737fb
  - [x] #85544 - Reverted in 7b1198eb5c700e85ec163e60828c01fac55a9909
  - [x] #85631 - Reverted in 81c04ceb553f9887d59f8edf8b2526ff3807264b
  - [x] #85529 - Reverted in 2a7e2c8e3856d67cdefda0d25803393070a6e996
  - [x] #85525 - Reverted in 6ed2d9f28a9333c705eafd21acf54771b8e4db36
  - [x] #85514 - Reverted in a4fa2aa79d93b69d15e0fb9cb1fb7a5bc288bb34
  - [x] #85520 - Reverted in 6e1bd4b11cd55e36cab332c5a0c90c76a2e43703
  - [x] #85521 - Reverted in 79afdac194da5f42b38fb0fdfc394f2b8d485266
  - [x] #85519 - Reverted in a967cae1fb3feea23fdf196595e496431740f52d
  - [x] #85513 - Reverted in e3934edf8794f93a37dc7f63c60aa64ed7b60736
  - [x] #85498 - Reverted in cf1fadbc54a1365362aaeb142cbbd4e2c3be6f15
  - [x] #85485 - Reverted in 2a650ef9c0454bd650d6a13d10c0cb71bb134b2b
  - [x] #85494 - Reverted in bbb97958010dc0f74cee279fd304a7fcaccb625e
  - [x] #85552 - Reverted in f1780715bd054300e50e9102ad150c76690d4ca1
  - [x] #85724 - Reverted in 6933699cef8b01f9aef989f36ca079680a2777ff
  - [x] #85735 - Reverted in a6564f19226ef3969bec0573b49fa772d6e6df31
  - [x] #85729 - Reverted in f728d121a2f27a3cc7973fc2041df9b7193b796d
  - [x] #85704 - Reverted in 38f5b034a3370eda4657a2a5a6adcf3df6ec280c
  - [x] #85660 - Reverted in 7db39869d37ff5b39574d88ffc872449ab5b457c
  - [x] #85752 - Reverted in 1f2988028b7cccad121fc658d6547d89453703b7
  - [x] #85592 - Reverted in 263cbcfcb54746a9361369d86b44cc3e2d375199
  - [x] #85580 - Reverted in a92d53624198dce844c108b5dbea09cf2a16cd10
  - [x] #85573 - Reverted in a7d51042355798038ced44f64e987261b85e93bc
  - [x] #85534 - Reverted in 31787e7d1ce4fec2ce20776672099bf35486a296
  - [x] #85511 - Reverted in 2567a2eb56cdb7058f89ea298e53197147198d82
  - [x] #85508 - Reverted in 69de2ac16c20d968adcd19f0732fd2f84a4ae90e
  - [x] #85680 - Reverted in 44437ac406c708b9a3ab3b47f4e3c10e77a0b91b
  - [x] #85551 - Reverted in 7f17d428fd2787a6982534bfc9ac9188fd4b8675
  - [x] #85478 - Reverted in bd9e575dafc62dc7e1259e8c19199ba15d82be4f
  - [x] #85476 - Reverted in 4ce8052076de0bb52f1ed87663920e98482ade62
  - [x] #85593 - Reverted in 9ff5924d3d56fcba3f180fc4b539568fb2013323
  - [x] #85441 - Reverted in db96015adaec01f3fbcb978796a0d7abd5668932
  - [x] #85567 - Reverted in 62696ad04fb34fd946708309bd3e439db9b3f488
  - [x] #85337 - Reverted in 1267e9f002d03c33187afd2e734e95a78a5ca6ac
  - [x] #85348 - Reverted in 4fcc3c659ee2a38d978e137252309644d5adde8f
  - [x] #85350 - Reverted in e691c833dd5aca2e7808591516e8443e8ccf1b27
  - [x] #85744 - Reverted in 251578d2868a691981b824a268c540b9c15a424e
  - [x] #85772 - Reverted in bc6804a04aa9368074bcc853e689c8fe6de2cb3a
  - [x] #85797 - Reverted in a05e36ec4a0129ff6901ea07488120b54a8ee124
  - [x] #85787 - Reverted in a5393f94b9e71d9ea0625e5fcfb5baaf16af38d3
  - [x] #85742 - Reverted in cd99a2aeaa1347b790c9bfdae35e41900e2ada9a
  - [x] #85440 - Reverted in 8b5ead7c7f0d8087b41256a296e730443752f17d
  - [x] #85739 - Reverted in 3511aae5a4798104220b79ad0e5b2b357dc1e83b
  - [x] #85293 - Reverted in fc687ca36ef476ab9080f0c62b427ab0af533d68
  - [x] #85716 - Reverted in 130b32a222a7585cfdde71aa561fb8b2c7d8083b
- ~~[ ] #85848 - Reverted in f6c46ca2f5cb2d039e4b26731570ca801741cc5d~~
(SKIPPED)
  - [x] #85795 - Reverted in 4684c3325a9135b6bf10eb43026f373993bf605d
  - [x] #85859 - Reverted in 0e0838fe11b7d9af4f62af4f7388ed8fb57bf49c
  - [x] #84873 - Reverted in 34407b79a45718a305f3bfe3fac7f129b4f1c51f
  - [x] #85864 - Reverted in 4b25a209c5019bb65922cd793aff339f20c3d026
- ~~[ ] #85845 - Reverted in a326246e81b7b9242bbf45e7ab3b31caf9ce8147~~
(SKIPPED)
  - [x] #85844 - Reverted in bdf1e6c1e3469884550d3211e51ec9303a022482
- ~~[ ] #85843 - Reverted in 41a8acb196af0988372b06ade7131d07d03daab3~~
(NOT BEING INCLUDED)
- ~~[ ] #85840 - Reverted in 4807bacea8418000f84d62ca0fb122846cab4929~~
(NOT BEING INCLUDED)
- ~~[ ] #85837 - Reverted in bc9edfa8666de14ca4e57e466146d753182a3a71~~
(NOT BEING INCLUDED)
  - [x] #85865 - Reverted in 14c958b465af40f0ff28b100047c4c572919ae19
- ~~[ ] #85818 - Reverted in a77256f74e2d330f5f76141eb9c994a8e5e45810~~
(NOT BEING INCLUDED)
  - [x] #85822 - Reverted in caba685be95fd336f0b09e88bccfb8856d5ad9b4
  - [x] #85794 - Reverted in 0d4de984eb8513d065e8ac724e8cde11f01d4ef7
  - [x] #85756 - Reverted in 9c5a7e1a5f895851493e149ccb5cd50e35cd6101
  - [x] #85852 - Reverted in 74303e5bbae8426a073d068ef4342d8acc420a09
- ~~[ ] #85841 - Reverted in e5831ce3cc87765cb13e6d342417bc1730780392~~
(NOT BEING INCLUDED)
- ~~[ ] #85834 - Reverted in 1be665204da791ec7520d0799c015157fc625953~~
(NOT BEING INCLUDED)
  - [x] #85792 - Reverted in 33b4e48175040f9f76ef83d3154f10c69589b6ad
  - [x] #85646 - Reverted in fd23a0d6c4c96470b688dc0a35370c61c7e32f61
- ~~[ ] #85799 - Reverted in 4a7a6d812f2f301c1e749c92f324223f9bde8a39~~
(NOT BEING INCLUDED)
  - [x] #85819 - Reverted in 8bf001b7889d3a4282947cd332833c473b98eac1
  - [x] #85479 - Reverted in 6aeb5ef4582c03febe0c914185d29f75df4d5d94
- ~~[ ] #85824 - Reverted in 9ca3edfaa17d97306ac73207ef32fd1272061f6b~~
(SKIPPED)
  - [x] #85406 - Reverted in 702280ff48c8aef44f4da9a85eb33a7bc5faa013
  - [x] #85778 - Reverted in ce0ec5c685aadb02ae049d6714f1d2fd6dae1f26
- ~~[ ] #85851 - Reverted in 610c68b275cf3c54181d36ce48bd97b0cce0665c~~
(NOT BEING INCLUDED)
  - [x] #85754 - Reverted in 5cbdda00c5335db79ea50aedba097de1d06bf91b
  - [x] #85266 - Reverted in abdfec798e5223dfa9d67e1967d7618454dbec28
- ~~[ ] #85823 - Reverted in 86b766abd3d77af8ad835a3464fc5ff95cc11079~~
(NOT BEING INCLUDED)
- ~~[ ] #85842 - Reverted in 7ddd47e26ef1bc336e92a6675a33ec3191039c16~~
(NOT BEING INCLUDED)
  - [x] #85857 - Reverted in e32312ee20e9fdccb6dd7c4dc2d185540bd2276b
  - [x] #85856 - Reverted in 7d5d74c2b55a08ef5553568e996053157359dbe2
  - [x] #85276 - Reverted in 1d6fa881e4aef1e6b368d5b6809bccb021fbbd2a
  - [x] #85886 - Reverted in f27d6cabdf8f06f29926616345fa82c4e1e48708
- ~~[ ] #85771 - Reverted in 019d898b601c9ef4d45b7ee0f2144518ee127ca9~~
(SKIPPED)
  - [x] #85464 - Reverted in adc00417795deb85f8aa6170b0f0a07c40c8798c
- ~~[ ] #85870 - Reverted in d69b998420bfb39693bb59b9b9a20611880fdafa~~
(NOT BEING INCLUDED)
- ~~[ ] #85869 - Reverted in 0063c69f111bb67144f9b379476250ce86c99eee~~
(NOT BEING INCLUDED)
  - [x] #85530 - Reverted in b40c93399411d277b3899e149196f3eb974f841f
- ~~[ ] #85871 - Reverted in 63908bbd0a71d0a2bd0a4691816c17cc9eb5310c~~
(NOT BEING INCLUDED)
- ~~[ ] #85832 - Reverted in b29dab083f091198d65a9b0754536f13a935dc2c~~
(SKIPPED)
- ~~[ ] #85825 - Reverted in d072b294ca3bc526df5128df45653db97ba38fe1~~
(NOT BEING INCLUDED)
  - [x] #85632 - Reverted in 290092c7d826aa5b100a38cd4bacc5330b39a934
  - [x] #85902 - Reverted in 76118d620e71f1819a9385863b689d9a8d4ea810
  - [x] #85906 - Reverted in 82623c2cc0fd9aee3e79c95fe5558146c59bc941
  - [x] #85907 - Reverted in 68b7305f21240ca28c33afc904ee532966b7c4bd
  - [x] #85449 - Reverted in ab86a79339ef7b01ceb08dc7279c698927ebcbfa
- ~~[ ] #85875 - Reverted in 0a1fcda90e638e66d574c247e93f0669d0c27b0e~~
(NOT BEING INCLUDED)
- ~~[ ] #85861 - Reverted in 6dad5111aa144860371c93a2d78094fe3d39a7e1~~
(NOT BEING INCLUDED)
  - [x] #85264 - Reverted in dc1d2dcc995f33fc5773e037f5171e9516897281
  - [x] #85726 - Reverted in dbd9ec81586c87c1ab2afc43d43c4f020907dc1b
  - [x] #85730 - Reverted in 7de2c2a1d012ccb03f82c6beabd71a66aa0f910a
  - [x] #85880 - Reverted in 02169d2f28611765997fa332dda69c8031436fd1
  - [x] #85176 - Reverted in e3c85aae1cf665c9892bf7280b7b48ea42323198
- ~~[ ] #85887 - Reverted in 56b35f294b303fd30fbd7685011d37b456d584c7~~
(NOT BEING INCLUDED)
  - [x] #85883 - Reverted in 53be06a505ebd8581114bba8590e378d387b6c1a
- ~~[ ] #85882 - Reverted in a8877ff0083ca5753e3d3b1b9c9edc3613fa6570~~
(NOT BEING INCLUDED)
  - [x] #85895 - Reverted in 741235d41b3a19a40434653f1c14fc0999fac9c3
- ~~[ ] #85746 - Reverted in b7aebb6e5788f6c484173f0a5e29f042ea0c8560~~
(NOT BEING INCLUDED)
- ~~[ ] #85889 - Reverted in d677231d8c55efcd2cf427d510d961cd00f186c7~~
(NOT BEING INCLUDED)
- ~~[ ] #85888 - Reverted in 693f79abae54980ee098d602ed79926d51d5094b~~
(NOT BEING INCLUDED)
  - [x] #85898 - Reverted in 4f41fda23e6b9711aef5d00836591c1ac230612e
- ~~[ ] #85821 - Reverted in 738c9a75f65c4a376da36ad208e1fd8fdeac1ff0~~
(NOT BEING INCLUDED)
  - [x] #85694 - Reverted in f7ea4d19cdaa2067c87c43362b514c684b56b1f3
  - [x] #85308 - Reverted in 4a89b62774da5e9ec9ea241c60ec2a99f51f9bed
  - [x] #85904 - Reverted in 999dbe1773cc7488c629bb8d0d21be5454dbef60
- ~~[ ] #85901 - Reverted in bbf832da9e0c61ad25221530df3b1e93cace25dd~~
(NOT BEING INCLUDED)
- ~~[ ] #85896 - Reverted in 542fe408728faaef8a16869e13c4661018a8a07c~~
(NOT BEING INCLUDED)
  - [x] #85927 - Reverted in 7dc87df28e79ef3e9f3fad83cc0907d2dc867c47
  - [x] #85908 - Reverted in bcca80f073a486ca7908e9636d0e8b275c2085bf
  - [x] #85929 - Reverted in 094bf3610a73961f6433a52ada1a52f25d853738
  - [x] #85877 - Reverted in 5874cafd0dab8d3bd61cf1f662793c2708f42dcc
  - [x] #85903 - Reverted in b3ba8fffc5548e0f2ae6bada3baf10bad3c75e54
- ~~[ ] #85913 - Reverted in 67f7ec48d20f9a64ce4664fa2c452a25b60db59e~~
(SKIPPED)
  - [x] #85914 - Reverted in 7efcd3a5f7fef33c2a1625386bfead80a6ed5309
  - [x] #85917 - Reverted in fc50a5ff998d0e7269131a029e533e90e9dc3c54
- ~~[ ] #85949 - Reverted in 10a8e0f5c69e3ca1eb6e26f00945bfe226598bc2~~
(NOT BEING INCLUDED)
- ~~[ ] #85338 - Reverted in 847549ab938f77464829b1392a1b6f2b2f4b9e8f~~
(SKIPPED)
- ~~[ ] #85922 - Reverted in 3d9388249b8c322aac5dd4980d4ab4673ca01006~~
(SKIPPED)
  - [x] #85923 - Reverted in 2c6ffa4decf40eb52a92353aeb98aee8cbc7b4a2
- ~~[ ] #85920 - Reverted in 1de5b03981d9fcf9c2e6823bffa515fb939aa541~~
(NOT BEING INCLUDED)
  - [x] #85919 - Reverted in 1773e9baccdc941285f56ccb416f5c7125b031ef
  - [x] #85271 - Reverted in aecf8002cf2807a76b6b295867e50392b4bc4534
  - [x] #85918 - Reverted in 023ec3a4d1b1b2fc8f596fea65a77ddc9a06689f
  - [x] #85924 - Reverted in e4886079ad90f33628ac59e0793dfbbc8b8b9420
  - [x] #85928 - Reverted in 7470b7d5ac40be21c345e8825f4c4efc4738e29f
  - [x] #85926 - Reverted in 7761c9e3a1f442f37d4db4b27e5d78fae95edf00
  - [x] #85900 - Reverted in 633736cb0655dc464e9794666c63ae6ec7689826
  - [x] #85909 - Reverted in a47c7ec8a77bd02f8b7bb1ce3c621efbe57077c3
- ~~[ ] #85931 - Reverted in 9bc7a412982da6fbdb9cd24570d98877b76a45c3~~
(NOT BEING INCLUDED)
- ~~[ ] #85894 - Reverted in c15e1711656929aeb59f482145ecf029b40d58b8~~
(SKIPPED)
- ~~[ ] #85759 - Reverted in f45d70be0ffb9bf007bfa18a1bd1b5ce23d6dcfc~~
(SKIPPED)
- ~~[ ] #85892 - Reverted in fc08dc1a7160f584c94e368962eb56c18dccc86a~~
(SKIPPED)
- ~~[ ] #85915 - Reverted in 428f475c26f383998a689560a16de86da3f17557~~
(NOT BEING INCLUDED)
  - [x] #85222 - Reverted in 66e7ac2f00735c90acdb69a50c9e485a0f4e1552
  - [x] #85150 - Reverted in 3079387f926e41febb576105ec0b3acec2f7beba
  - [x] #85935 - Reverted in ce6114f644593ead295763362a61d19077f22acf
- ~~[ ] #85936 - Reverted in f601fa796bce7e70645a84fff91391cbb6ed8e37~~
(NOT BEING INCLUDED)
  - [x] #85937 - Reverted in 64242f589df3d9118fd5c09d19574758260c76a1
- ~~[ ] #85940 - Reverted in a979c6c24705a8729efab5eca40840f1c8070f1d~~
(NOT BEING INCLUDED)
- ~~[ ] #85942 - Reverted in 9562c14083212fc962b8687663ba5fac2ebfdd1a~~
(NOT BEING INCLUDED)
  - [x] #85944 - Reverted in adf8e1927e4b9886c9042d6a0eaaef74e4e0e102
  - [x] #85605 - Reverted in 88dbfb4f859f12549e8cf8ed5204ee8d7183d40f
  - [x] #85945 - Reverted in dea9e79a9c298eae05b8d173d8df4a37218e2d9c
  - [x] #84964 - Reverted in 234481fb1d92a266768fcbca49245151236803ed
  - [x] #85952 - Reverted in c62d87ab54d687db64b1551b319195527ca92924
  - [x] #85953 - Reverted in bd0e46245ccb597081b8baa4f81ff85949f672be
- ~~[ ] #85943 - Reverted in 697b6841391354885ef2d314d9185b8eee7a5cb0~~
(NOT BEING INCLUDED)
  - [x] #85946 - Reverted in f4afd4d330b6fc28397f7707bca8773d44cb15ed
  - [x] #85950 - Reverted in 394fffcb836f32f4e1b1fd91a621249e0e5d7d67
  - [x] #85955 - Reverted in 2230a5bc141cd11fc79ccf6b4b653257508a7e65
  - [x] #85319 - Reverted in fdaddd9cd6ed0bdd1cd78ba3c9729035936abcbd
- ~~[ ] #85934 - Reverted in 41bb6122b6d6e3c38c500d5ddf63808836ab090e~~
(NOT BEING INCLUDED)
- ~~[ ] #85255 - Reverted in 3e213b8554b40e53f6429969d6e9dbaa357fb09e~~
(SKIPPED)
- ~~[ ] #85961 - Reverted in 6f3d000b3601dc7f75f7edd221fab3edc3bbbd8c~~
(NOT BEING INCLUDED)
  - [x] #85956 - Reverted in a5bf22a93ca1a149ca839e6c874d088b32c7c25f
  - [x] #85958 - Reverted in c964a46741bd26a600bb75bc6463c629c11c914f
- ~~[ ] #85969 - Reverted in b599cd4bd3ae223210eb0d3b47c3bd814e1cb08c~~
(NOT BEING INCLUDED)
  - [x] #85252 - Reverted in 5a0e2f31a6e1093ab47970056f5bb3af54172e12
  - [x] #85984 - Reverted in b000da82f62bb48b059a881d596f3a2e7d985d21
  - [x] #85137 - Reverted in 1f31b558e41fc66d5da9db30a83d89cbb9949eae
  - [x] #85881 - Reverted in f3913f94c4557c4fc9d5605cd8e875accabebda6
  - [x] #85972 - Reverted in d3afed87a3a8eed7e0016512d2186b6aded0fca9
  - [x] #85998 - Reverted in 3d286b763cf2f7fe11b6f0ccb2456130570726c2
  - [x] #85358 - Reverted in 75f84bda1b3c80d54ae94a567bf96016aaae45b2
- ~~[ ] #85964 - Reverted in be1aeb010afa20c1b6949218d8911ee9e900b3d7~~
(SKIPPED)
  - [x] #85960 - Reverted in 69cbfce1529377ce7cd998ab474add0d61650d7f
  - [x] #85992 - Reverted in 89e4a7bb0b793461338ba1b0a3d332bf78ef140c
  - [x] #85967 - Reverted in d398e418eb340f309be523514ae0befdf1869560
  - [x] #84888 - Reverted in bb98eb09f06a1fdc0bbb733d6a42d711e6d477bc
- ~~[ ] #85983 - Reverted in 81152a9cd347eb7b4073758e2e96490e6e729ca9~~
(NOT BEING INCLUDED)
  - [x] #85976 - Reverted in 93c091347ca8f04763b91fd4c39ccdff848a0d50
- ~~[ ] #85962 - Reverted in de32ea25b534c725e3d55418ef0363145f0ed2b0~~
(NOT BEING INCLUDED)
  - [x] #85977 - Reverted in 393652a1ef065014748ae6977a9f36b32c99dc7c
  - [x] #85959 - Reverted in 52e6e07eb98bcb74a423934b14d5850dbf2c6647
- ~~[ ] #85988 - Reverted in a5853ccde46b5fee2d9eb31755384de15e7a5a87~~
(SKIPPED)
- ~~[ ] #85974 - Reverted in eab20ba04e6b06f862a0fb35cedb6374af7b93c0~~
(SKIPPED)
  - [x] #85939 - Reverted in ca85b05692f55f6b3e4bd0b3f30c63f89531c33f
  - [x] #85878 - Reverted in 3b3d3dbff9148e46b01f3af28f17f66bef4dfd16
  - [x] #85858 - Reverted in 08d6082e62d07117170ff5ffd065daad1278e853
  - [x] #85651 - Reverted in b76ab4a2114dd0eb78336878b2825d9919c210cc
  - [x] #85505 - Reverted in 0958eaa7b6f4d48400bea4e215e11edaa933ba8a
- ~~[ ] #85352 - Reverted in 620cec18618e514bbe4d3eb0a0d0db1528b9d312~~
(SKIPPED)
  - [x] #85279 - Reverted in ba0fd529ef94ba793fe2eee40975533fe8f475e3
  - [x] #85954 - Reverted in d7fe0336f2a968b93fd02361814930236e3b8ddf
- ~~[ ] #85996 - Reverted in 5fbd62139e0c1b668aaaf35d249d527cdc276b93~~
(SKIPPED)
  - [x] #85994 - Reverted in c99a03c6833ac58e0288111953573f697488234f
  - [x] #85470 - Reverted in fbd5ac46d84d27455cbcf5f998741124ed6de625
- ~~[ ] #85981 - Reverted in dc74c75011ddfb1b16d644fd2ca5607599532d6f~~
(NOT BEING INCLUDED)
  - [x] #86011 - Reverted in b14b42e70e2bd21f19d443065b2342e4591c5e05
  - [x] #85820 - Reverted in 26248546b9f7d0fedec52e7b2f7def40d457e29f
  - [x] #86013 - Reverted in e17ac14f53d08be988f0516e7c39d31496a35184
  - [x] #85986 - Reverted in 4021ffea0b1bbb1f6c5b26a296abd5a8bda1d5b3
  - [x] #86019 - Reverted in c0801b3aa5dbdd33ca7c6c81e80c9fa573ada9e1
  - [x] #86010 - Reverted in 10dff005729305b75deaf1c5755a94125fa5141d
  - [x] #86029 - Reverted in 664619213db52930fa22007561dad01fe8bb3de4
  - [x] #86024 - Reverted in e74ea4368cbd2cd085aa6e8bbe83db07800b0bd4
  - [x] #86022 - Reverted in 0b2fc6a1f478c48546b161fd3ddd571f7ed6000f
  - [x] #86015 - Reverted in b99d93592dbf8840a035f22f26b64bcf27c817cb
  - [x] #85415 - Reverted in d6102c7339838675c03eb771d7a3b5a9bea4035d
- ~~[ ] #85703 - Reverted in 339b7edf3c0318f9f02922018d6918211660234f~~
(SKIPPED)
  - [x] #85890 - Reverted in 4e54f376e07071f84ed283e7468e334aaf6e4e02
  - [x] #86046 - Reverted in 0bbe2c9a048c229d151682e08aca1fa176c3ad91
  - [x] #86008 - Reverted in a0a0635cd6618618c49fda7cf150231d62a14236
  - [x] #86042 - Reverted in fa376315a064b945ed9846225c7f48e38e9b55ed
  - [x] #85891 - Reverted in 603dcd691e9eaad0a610c60c94fee522391bd2b3
  - [x] #86040 - Reverted in e42fc7618194b4b01cb68ca0c61385e465d0cb05
  - [x] #86025 - Reverted in 536bb25fe91845fe05bb7d512d8e73cc193b67ff
  - [x] #86012 - Reverted in 5cb4ec5bdf87653a5bb651c536f21423db30887e
  - [x] #86004 - Reverted in e9536143e78e3b0614d3ce6ee2c9a40005ba9b91
  - [x] #85989 - Reverted in 88a92322c2f028d2e3a2be18951d35d1135a6268
  - [x] #86044 - Reverted in d0a5fb5956be23144e325d3d51f53cb103dd5bbe
  - [x] #86001 - Reverted in 195c3597044315c9b10d002e6196911ac0622c45
  - [x] #86030 - Reverted in 5265796286b481d34fc91a1f8c58b6373d23415e
  - [x] #86055 - Reverted in e82138798cda028b673fe7ac83890e5a6b9e16d2
  - [x] #86057 - Reverted in c921900e6151552aa0768b4c9d7cc58c58dfbcc0
  - [x] #86014 - Reverted in c004d4e989a2faa672793f58fd98bd6fded8194e
  - [x] #85304 - Reverted in 611510bd7f65ee06738b7344326d72f57a131f8a
  - [x] #86061 - Reverted in f14b0a245dcf164bb99f7696e180847bb5be9b11
  - [x] #86075 - Reverted in 5339fe6c098d48769eda3f9935aa3488faa73097
  - [x] #86089 - Reverted in 10b5398e6b55f4799ca7d6740ac50c031e157c43
  - [x] #86081 - Reverted in ba86f43383cd2e8417c0a465c23fe3227fcd5520
  - [x] #85609 - Reverted in 9e5208feaca3163b7f4237c316d880161933777f
  - [x] #86114 - Reverted in cf410a97b8348381f96cc784a6489d7c1dea49ba
  - [x] #86023 - Reverted in a7a2e95c0c1b0598f15019934c80ccc80a9f89af
  - [x] #86027 - Reverted in 9cf71611befac64d26d326c060ef082262aeca70
  - [x] #86016 - Reverted in b67fa06e1559c8de87899bd06d09891b4c7ae947
  - [x] #86095 - Reverted in dc5abd827bb56e1609afe5a9d2bdd957d40cc75c
  - [x] #86105 - Reverted in f5b8e7ecbe99cb38e829a98a4f6eb2c200af8b91
  - [x] #86070 - Reverted in 6c460bbc22827bdbc566b524b8e6a959cbb61c37

After that some startup commits on this branch need to be reverted then
it can be merged.

---------

Co-authored-by: tgstation-ci <179393467+tgstation-ci[bot]@users.noreply.github.com>
Co-authored-by: Jordan Dominion <Cyberboss@users.noreply.github.com>
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: MrMelbert <kmelbert4@gmail.com>
2024-09-03 10:41:51 +02:00
Kyle Spier-Swenson
4d1639b04c Revert "Assorted changes to job assignment code and logging." (#85929)
Reverts tgstation/tgstation#85308

![image](https://github.com/user-attachments/assets/eb74d378-29da-44f0-bd14-89c95654cb4e)
2024-08-17 15:26:08 -07:00
Timberpoes
1eef540054 Assorted changes to job assignment code and logging. (#85308)
## About The Pull Request

This PR does a couple of minor things:
Makes the job debug logging a bit easier to follow.
Minorly brings some SSjob code up to code standards, converting proc
names to snake_case and doing some otherm is cleanup.
Refactored some stuff into different procs, updated some comments.

And some major things:
Changes the job assignment logic.
Old behaviour
> Assign dynamic priority roles
> Force one Head of Staff (if possible)
> Assign all AIs
> Assign overflow roles (bugged in 2 ways)
> Shuffle the available jobs list once, at the start of the random job
assignment loop
> Pick and assign random jobs for random players from High prefs down,
with a priority on Head of Staff roles
> Handle everyone that couldn't be assigned a random job

New behaviour
> Assign dynamic priority roles
> Assign all Head of Staff roles to players with High prefs
> If no Head of Staff was made in the above way, force one Head of Staff
(if possible)
> Assign all AIs
> Assign overflow roles (fixed)
> Prioritise and fill unfilled head roles at each job priority pref
level, from High prefs down.
> Build a list of all jobs that each unassigned player could be eligible
for at the above pref level.
> Pick a job from that list at random and assign it to the player.
> Handle everyone that couldn't be assigned a random job.

In reality there should be little impact on overall job assignment, the
code changes read more as semantics. For example, the priority check for
filling Head slots will have the same candidate pool in both old and new
versions, but in the new version we're more clearly saying that Heads
are important and we want to prioritise filling them for the sake of
round progression even though the outcome in new and old is the same.

A key change will lead to an increase in assistants - Overflow fixes.

Currently the code block to do early assignments to the Overflow role
doesn't work - or works but not as you'd expect. The idea was is that
because enabling the Overflow role in the prefs menu is an On/Off toggle
that sets the job to High priority when enabled and prevents any other
High priority pref, players that have the Overflow role enabled will
**always** get it. It's their highest priority job with infinite slots.
So we do a pass right at the start to give everyone with the Overflow
role enabled that role and save us wasting time later on in random job
code giving them that same role but with more work.

The problem is the code for this only assigns the Overflow role to
people with it set to Low priority in their prefs, resulting in log
readouts like:
```
[2024-07-27 09:49:43.469] DEBUG-JOB: DO, Running Overflow Check 1
[2024-07-27 09:49:43.469] DEBUG-JOB: Running FOC, Job: /datum/job/assistant, Level: Low Priority
[2024-07-27 09:49:43.472] DEBUG-JOB: FOC player job enabled at wrong level, Player: Radioprague, TheirLevel: Medium Priority, ReqLevel: Low Priority
[2024-07-27 09:49:43.472] DEBUG-JOB: FOC player job enabled at wrong level, Player: Caluan, TheirLevel: High Priority, ReqLevel: Low Priority
[2024-07-27 09:49:43.473] DEBUG-JOB: FOC player job enabled at wrong level, Player: Caractaser, TheirLevel: High Priority, ReqLevel: Low Priority
[2024-07-27 09:49:43.473] DEBUG-JOB: FOC player job enabled at wrong level, Player: Apsua, TheirLevel: High Priority, ReqLevel: Low Priority
[2024-07-27 09:49:43.475] DEBUG-JOB: FOC player job enabled at wrong level, Player: Bebrus2, TheirLevel: Medium Priority, ReqLevel: Low Priority
[2024-07-27 09:49:43.475] DEBUG-JOB: AC1, Candidates: 0
```
Where nobody gets pre-assigned the overflow role because their prefs are
all set to the High priority from being toggled... Except wait a second,
some people have it at Medium priority when it should just be a No
Role/High Priority Role toggle?

And herein we meet a problem. My hypothesis is that traits and stuff
that change the overflow have allowed players to set the "ordinary"
overflow role of Assistant to Medium and/or Low priority.

This still shows as enabled in the prefs menu, but leads to an outcome
where a player with assistant enabled is assigned Cook instead.
```
[2024-07-27 09:49:47.775] DEBUG-JOB: DO, Running Overflow Check 1
[2024-07-27 09:49:47.775] DEBUG-JOB: Running FOC, Job: /datum/job/assistant, Level: Low Priority
...
[2024-07-27 09:49:43.475] DEBUG-JOB: FOC player job enabled at wrong level, Player: Bebrus2, TheirLevel: Medium Priority, ReqLevel: Low Priority
...
[2024-07-27 09:49:47.987] DEBUG-JOB: Running AR, Player: Bebrus2, Job: /datum/job/cook, LateJoin: 0
```

So players with the Overflow job pref set to Low (an unexpected state,
should be disabled or High) would be guaranteed to get that role if none
of the higher priority Head of Staff/AI/Dynamic roles took over via the
bugged "force overflow for people with the pref enabled" proc.

Players with the Overflow job pref set to High would be guaranteed to
get that role if none of the higher priority Head of Staff/AI/Dynamic
roles took over via the random job assignment code giving them their
Highest priority role thanks to the infinite job slots of the Overflow.

And players with the Overflow job pref set to Medium (an unexpected
state, should be disabled or High) would get Assistant if the shuffle
step of the available jobs list put Assisstant before any of the other
jobs they had prefs enabled for at Medium that weren't already filled,
otherwise they'd get another random job.

This code is now changed to ignore the priority the player has set when
looking for people to fill the overflow role. As long as it **is**
enabled, the player will get it unless they're forced into a dynamic
ruleset role (AI when malf rolls) or a Head of Staff role due to their
other prefs (they have RD set to med or low, and no other player has a
Head of Staff at high so they get randomly picked and miss the overflow
role).

This will increase the number of assistants in shifts where their pref
state has Assisstant in the bugged Medium priority, but doesn't change
it for bugged Low and not-bugged High/On priority.

On the other side of the coin, we have how the random jobs are picked.
They're kinda not random, and I noticed this reading the logs then
reading the code.

The list of available jobs to pick from is randomly shuffled - but only
**once**. All players pull from a list of jobs in the same order. So you
end up with a log block like this:
```
[2024-07-27 09:49:47.985] DEBUG-JOB: DO pass, Player: Pierow, Level:3, Job:Botanist
[2024-07-27 09:49:47.985] DEBUG-JOB: Running AR, Player: Pierow, Job: /datum/job/botanist, LateJoin: 0
[2024-07-27 09:49:47.985] DEBUG-JOB: Player: Pierow is now Rank: Botanist, JCP:0, JPL:2
[2024-07-27 09:49:47.986] DEBUG-JOB: DO pass, Player: Daddos, Level:3, Job:Botanist
[2024-07-27 09:49:47.986] DEBUG-JOB: Running AR, Player: Daddos, Job: /datum/job/botanist, LateJoin: 0
[2024-07-27 09:49:47.986] DEBUG-JOB: Player: Daddos is now Rank: Botanist, JCP:1, JPL:2
[2024-07-27 09:49:47.986] DEBUG-JOB: FOC job filled and not overflow, Player: Bebrus2, Job: /datum/job/botanist, Current: 2, Limit: 2
[2024-07-27 09:49:47.987] DEBUG-JOB: FOC player job not enabled, Player: Bebrus2
[2024-07-27 09:49:47.987] DEBUG-JOB: DO pass, Player: Bebrus2, Level:3, Job:Cook
[2024-07-27 09:49:47.987] DEBUG-JOB: Running AR, Player: Bebrus2, Job: /datum/job/cook, LateJoin: 0
[2024-07-27 09:49:47.988] DEBUG-JOB: Player: Bebrus2 is now Rank: Cook, JCP:0, JPL:1
[2024-07-27 09:49:47.988] DEBUG-JOB: FOC player job not enabled, Player: Redwizz
[2024-07-27 09:49:47.988] DEBUG-JOB: FOC job filled and not overflow, Player: Redwizz, Job: /datum/job/cook, Current: 1, Limit: 1
```

The list is shuffled into an order of something like `list("Scientist",
"Botanist", "Cook", "Sec Officer", ...)` then iterated over for each
player. So every random job selection goes:
> "Does Player1 have Scientist enabled and at the right priority? No?
Okay, Botanist? Yes? You get botanist."
> "Does Player2 have Scientist enabled and at the right priority? No?
Okay, Botanist? Yes? You get botanist."
> "Does Player3 have Scientist enabled and at the right priority? No?
Okay, Botanist has no slots left so we'll remove it from the list. Okay,
Cook? Yes? You get cook."
> "Does Player4 have Scientist enabled and at the right priority? No?
Okay, Cook has no slots left so we'll remove it from the list. Okay, Sec
Officer? ..."

This can lead to stacked individual departments if it gets randomly
rolled to the start of the list in the shuffle, and completely empty
departments if they end up at the end.

On high pop shifts this is probably less of an issue. Player prefs add
noise to this and as departments at the front fill up, those at the back
pick up some of the lower pref players.

But have you ever had a shift where there's just like... No fucking sec
even though there's tons of players? The logging (before I made changes
in this PR) was a bit ass, but my hypothesis there is that sec officer
was shuffled right at the end of the random job list, so every other
department was filled up before sec officers were picked.

To mitigate this, I made the list shuffle every single time the game
picks a random available job for the player. This should lead to a more
balanced selection of available jobs by avoiding situations where the
code is biased towards packing some departments by accident.
## Why It's Good For The Game

Overflow fixes mean people who go to their prefs and see the Overflow
Role is On will all have the same experience - They will be the Overflow
role.

More random random job selection should prevent individual departments
having a jobs be stacked when it would have otherwise been possible for
a more balanced selection but the code unintentially biased random
departments to be overstaffed and understaffed each shift.
## Changelog
🆑
fix: Having the Overflow Role set to On will properly ensure you get
that role at a High priority as intended by the game code.
fix: Job selection is now a little bit more random. Fixes an
unintentional bias in random job assignment that could lead to
feast-or-famine for roles where everyone is assigned one job and nobody
is assigned another job.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2024-08-17 14:27:45 -06:00
LemonInTheDark
4b4e9dff1d Wallening [IDB IGNORE] [MDB IGNORE] (#85491)
## What's going on here

Kept you waitin huh!

This pr resprites most all walls, windows and other "wall adjacent"
things to a 3/4th perspective, technical term is "tall" walls (we are
very smart).

If you're trying to understand the technical details here, much of the
"rendering tech" is built off the idea of split-vis. Basically, split a
sprite up and render it on adjacent turfs, to prevent seeing "through"
walls/doors, and to support seeing "edges" without actually seeing the
atom itself.

Most of the rest of it is pipelining done to accommodate how icons are
cut.

## Path To Merge

Almost* all sprites and code is done at this point. 
There are some things missing both on and off the bounty list, but that
will be the case forever unless we force upstream (you guys) to stop
adding new shit that doesn't fit the style.
I plan on accepting and integrating prs to the current working repo
<https://github.com/wall-nerds/wallening> up until a merge, to make
contribution simpler and allow things like bounties to close out more
easily

This pr is quite bulky, even stripping away map changes it's maybe 7000
LOC (We have a few maps that were modified with UpdatePaths, I am also
tentatively pring our test map, for future use.)
This may inhibit proper review, although that is part of why I am
willing to make it despite my perfectionism. Apologies in advance.

Due to the perspective shift, a lot of mapping work is going to need to
be done at some point. This comes in varying levels of priority. Many
wallmounts are offset by hand, some are stuck in the wall/basically
cannot be placed on the east/west/north edges of walls (posters), some
just don't look great good in their current position.

Tests are currently a minor bit yorked, I thought it was more important
to get this up then to clean them fully.

## What does it look like?


![dreamseeker_hBsU6wCu91](https://github.com/user-attachments/assets/5392fa3b-60f6-40ea-876f-e686f25f996a)

![dreamseeker_CTiK0Je5iR](https://github.com/user-attachments/assets/1aee23bd-a5ec-4679-b094-d044401b7222)

![dreamseeker_HYkS1Q9GRq](https://github.com/user-attachments/assets/bad8844b-3179-4856-8684-f912e14e844a)

![dreamseeker_Pa18tgyKYp](https://github.com/user-attachments/assets/c2e1d222-9e5c-4500-8829-dd065428644a)

![dreamseeker_BfOBwS2mjH](https://github.com/user-attachments/assets/7dc51153-111d-4b17-93c3-8389daa6b60b)

![dreamseeker_iJazOumiMQ](https://github.com/user-attachments/assets/5837e203-3865-4f60-854e-62b4875c6b99)

## Credits

<details>
<summary>Historical Mumbojumbo</summary>

I am gonna do my best to document how this project came to be. I am
operating off third party info and half remembered details, so if I'm
wrong please yell at me.

This project started sometime in late 2020, as a product of Rohesie
trying to integrate and make easier work from Mojave Sun (A recently
defunct fallout server) with /tg/.

Mojave Sun (Apparently this was LITERALLY JUST infrared baron, that man
is insane) was working with tall walls, IE walls that are 48px tall
instead of the normal 32. This was I THINK done based off a technical
prototype from aao7 proving A it was possible and B it didn't look like
dogwater.

This alongside oranges begging the art team for 3/4th walls (he meant
TGMC style) lead to Rohesie bringing on contributors from general /tg/,
including actionninja who would eventually take over as technical lead
and Kryson, who would define /tg/'s version of the artstyle. Much of the
formative aspects of this project are their work.

The project was coming along pretty well for a few months, but ran into
serious technical issues with `SIDE_MAP`, a byond map_format that allows
for simpler 3/4th rendering.
Due to BULLSHIT I will not detail here, the map format caused issues
both at random with flickering and heavily with multiz.

Concurrent with this, action stepped down after hacking out the
rendering tech and starting work on an icon cutter that would allow for
simpler icon generation, leaving ninjanomnom to manage the project.

Some time passed, and the project stalled out due to the technical
issues. Eventually I built a test case for the issues we had with
`SIDE_MAP` and convinced lummox jr (byond's developer) to explain how
the fuckin thing actually worked. This understanding made the project
theoretically possible, but did not resolve the problems with multi-z.
Resolving those required a full rework of how rendering like, worked. I
(alongside tattle) took over project development from ninjanomnom at
this time, and started work on Plane Cube (#69115), which when finished
would finally make the project technically feasible.

The time between then and now has been slow, progressive work. Many many
artists and technical folks have dumped their time into this (as you can
see from the credits). I will get into this more below but I would like
to explicitly thank (in no particular order) tattle, draco, arcanemusic,
actionninja, imaginos, viro and kylerace for keeping the project alive
in this time period. I would have curled up into a ball and died if I
had to do this all myself, your help has been indispensable.

</details>

<details>
<summary>Detailed Credits</summary>

Deep apologies if I have forgotten someone (I am sure I have, if someone
is you please contact me). I've done my best to collate from the git
log/my memory.

Thanks to (In no particular order):
Raccoff: Being funny to bully, creating threshold decals for airlocks
aa07: (I think) inspiring the project
ActionNinja: Laying the technical rock we build off, supporting me
despite byond trying to kill him, building the icon cutter that makes
this possible
ArcaneMusic: Artistic and technical work spanning from the project's
start to literally today, being a constant of motivation and positivity.
I can't list all the stuff he's done
Armhulen: Key rendering work (he's the reason thindows render right), an
upbeat personality and a kick in the ass. Love you arm
Azlan: Damn cool sprites, consistently
Ben10Omintrix: You know ben showed up just to make basic mobs work, he's
just fuckin like that man
BigBimmer: A large amount of bounty work, alongside just like, throwing
shit around. An absolute joy to work with
Capsandi: Plaques, blastdoors, artistic work early on
CapybaraExtravagante: Rendering work on wall frames
Draco: SO MUCH STUFF. Much of the spritework done over the past two
years is his, constantly engaged and will take on anything. I would have
given up if not for you
Floyd: Early rendering work, so early I don't even know the details.
Enjoy freedom brother
Imaginos16: A guiding hand through the middle years, handled much of the
sprite review and contribution for a good bit there
Iamgoofball: A dedication to detail and aesthetic goals, spends a lot of
effort dissecting feedback with a focus on making things as good as they
can be at the jump
Infrared: Part of the impetus for the project, made all the xenomorph
stuff in the MS style
Jacquerel: A bunch of little upkeep/technical things, has done so much
sprite gruntwork (WHY ARE THERE SO MANY PAINTING TYPES)
Justice12354: Solved a bunch of error sprites (and worked out how to
actually make prs to the project) Thanks bro!
Kryson: Built the artstyle of the project, carrying on for years even
when it was technically dying, only stopping to casually beat cancer. So
much of our style and art is Kryson
KylerAce: Handled annoying technical stuff for me, built window frame
logic and fully got rid of grilles.
LemonInTheDark: Rendering dirtywork, project management and just so much
fucking time in dreammaker editing sprites
Meyhazah: Table buttons, brass windows and alll the old style doors
Mothblocks: Has provided constant support, gave me a deadline and
motivation, erased worries about "it not being done", gave just SO much
money to fill in the critical holes in sprites. Thanks moth
MTandi: Contributed art despite his own blackjack and hookers club
opening right down the road, I'm sorry I rolled over some of your
sprites man I wish we had finished earlier
Ninjanomnomnom: Consulted on gags issues, kept things alive through some
truly shit times
oranges: This is his fault
Rohesie: Organized the effort, did much of the initial like, proof of
concept stuff. I hope you're doin well whatever you're up to.
san7890: Consulting on mapper UX/design problems, being my pet mapper
Senefi: Offsetting items with a focus on detail/the more unused
canidates
SimplyLogan: Detailed map work and mapper feedback, personally very kind
even if we end up talking past each other sometimes. Thank you!
SpaceSmithers: Just like, random mapping support out of nowhere, and
bein a straight up cool dude
Tattle: A bunch of misc project management stuff, organizing the
discord, managing the test server, dealing with all the mapping bullshit
for me, being my backup in case of bus. I know you think you didn't do
much but your presence and work have been a great help
Thunder12345: Came out of nowhere and just so much of the random
bounties, I'm kind of upset about how much we paid him
Time-Green: I hooked him in by fucking with stuff he made and now he's
just doin shit, thanks for helping out man!
Twaticus: Provided artistic feedback and authority for my poor feeble
coder brain, believed in the project for YEARS, was a constant source of
❤️ and affirmation
unit0016: I have no god damn idea who she is, popped out of nowhere on
the github one day and dealt with a bunch of annoying
rendering/refactoring. Godspeed random furry thank you for all your
effort and issue reports
Viro: A bunch of detailed spriting moving towards 3/4ths, both on and
off the wallening fork. If anyone believed this project would be done,
it was viro
Wallem: Artistic review and consultation, was my go-to guy for a long
time when the other two spritetainers were inactive
Waltermeldon: Cracked out a bunch of rendering work, he's the reason
windows look like not dogwater. Alongside floyd and action spent a TON
of time speaking to lummox/unearthing how byond rendering worked trying
to make this thing happen
ZephyrTFA: Added directional airlock helpers, dealt with a big fuckin
bugaboo that was living in my brain like it was nothing. Love you
brother

And finally:
The Mojave Sun development team. They provided a testbed for the idea,
committed hundreds and hundreds of hours to the artstyle, and were a
large reason we caught issues early enough to meaningfully deal with
them. Your work is a testament to what longterm effort and deep detailed
care produce. I hope you're doing well whatever you're up to. Go out
with a bang!
</details>

## Changelog
🆑 Raccoff, aa07, ActionNinja, ArcaneMusic, Armhulen, Azlan,
Ben10Omintrix, BigBimmer, Capsandi, CapybaraExtravagante, Draco, Floyd,
Iamgoofball, Imaginos16, Infrared, Jacquerel, Justice12354, Kryson,
KylerAce, LemonInTheDark, Meyhazah, Mothblocks, MTandi, Ninjanomnom,
oranges, Rohesie, Runi-c, san7890, Senefi, SimplyLogan, SomeAngryMiner,
SpaceSmithers, Tattle, Thunder12345, Time-Green, Twaticus, unit0016,
Viro, Waltermeldon, ZephyrTFA with thanks to the Mojave Sun team!
add: Resprites or offsets almost all "tall" objects in the game to match
a 3/4ths perspective
add: Bunch of rendering mumbo jumbo to make said 3/4ths perspective work
/🆑

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: = <stewartareid@outlook.com>
Co-authored-by: Capsandi <dansullycc@gmail.com>
Co-authored-by: ArcaneMusic <hero12290@aol.com>
Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
Co-authored-by: SomeAngryMiner <53237389+SomeAngryMiner@users.noreply.github.com>
Co-authored-by: KylerAce <kylerlumpkin1@gmail.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: Runi-c <5150427+Runi-c@users.noreply.github.com>
Co-authored-by: Roryl-c <5150427+Roryl-c@users.noreply.github.com>
Co-authored-by: tattle <article.disaster@gmail.com>
Co-authored-by: Senefi <20830349+Peliex@users.noreply.github.com>
Co-authored-by: Justice <42555530+Justice12354@users.noreply.github.com>
Co-authored-by: BluBerry016 <50649185+unit0016@users.noreply.github.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
Co-authored-by: Rob Bailey <github@criticalaction.net>
Co-authored-by: MMMiracles <lolaccount1@hotmail.com>
2024-08-14 09:07:45 +00:00
Jeremiah
5dc1d36ee4 Bitrunning: Combat domain [READY] (#84196)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
Finally dusts off this project to make a deathmatch style bitrunning
map.
Don't be too intimidated by the file diff, lots of code organization +
resized a large map.

Changes:

1. Reuses the gateway beach map as a combat zone (99% of the file diff)
(maptainers: i just added spawners and areas)
2. Alters how bitrunning handles spawning: Custom spawns are now
available, which can be anything

Misc organization:

- Splits netpod.dm into separate files.
- Fixes some wording in vdom map documentation.
- Organizes vdom variables a bit.
- Adds a permanent hololadder spawn.

How bitrunning deathmatch works: 

- Temporary spawners are offered to both ghosts and bitrunners. 
- Runners spawn in like usual. Ghost can use the spawner menu.
- Ghosts work to prevent avatars from collecting side objectives or try
to cause mass brain damage.
- The domain completes after a number of deaths accrue. Any faction.
Blood for the blood god, etc.
- This map can be played solo. ANY deaths.

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
I've been toying with the idea of a deathmatch style map for some time.
I liked syndicate assault, the spawners were intentionally left there,
and the possibility of player-controlled players made the experience
more tense and challenging.

This PR leans into this idea: The virtual world is dangerous. Players
get a chance to compete on both sides here. It offers a lot of variety
to bitrunning other than "run for box". It's also very lucrative if
ghosts join in.

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
add: Added a bitrunning deathmatch map: Island Brawl. Both ghosts and
runners get many more spawns than normal.
fix: Lowered the static vision time in domain load in.
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
2024-07-02 23:03:12 -04:00
Jeremiah
9ab7d8f2e8 Bitrunning: Avatars get silly hacker names (#84279)
## About The Pull Request
Bit avatars now get corny names while spawning in to the virtual domain.
You can change your alias in prefs or have it randomized for s0meth1ng
1337.

Added sechud icons (and thereby orbit ui icons) for bit avatars since
"Cyb3rHaxx0r" might be confusing to find in the living players section.
## Why It's Good For The Game
This was done as a request and after discussion in the code channel. 
A little bit of character persistence across simulations.
## Changelog
🆑
add: Bitrunning: You can now choose your hacker alias in prefs.
add: Bit avatars get orbit icons.
/🆑
2024-06-25 00:25:33 -04:00
Jeremiah
1116f150eb Bitrunning: Tweaks, QoL and removals (#84125)
## About The Pull Request

See changelog for shortlist

1. **Threat changes.** I was a bit unsatisfied with the rate of antag
spawns. These have been increased considerably. The clamped probability
has been increased from 1-10 to 5-15. The probability increases from 5
to 15 as domains are completed. Generally, in a standard round, the
chance of spawning at least one antag should be around ~50% at 7 domains
completed. Emagging a server doubles this rate.
2. **Map changes.** Starfront saloon was a cool idea on paper: A totally
modular map. However, it looked very uninspired and was so much of a
chore on the map loading system that it prompted players to admin help
how long it took, thinking it was broken. I've removed the map. I have
others I want to implement that don't look so bad.
3. **QoL changes**. Ghost observer experience is improved. Previously,
you could click netpods to view their avatar, and now you can click the
hololadder to return. I've included examine text to show this. The
server's examine text will now also give you clues that it's emagged
(ghost only). The examine text on hololadders has also been improved.
4. **Bitrunning antags.** These were designed as temporary, but they
were everything but. Spawning as one would prevent your revival, which
just isn't a good tradeoff for something that's going to get deleted in
a minute. Now, this system uses temp bodies just like CTF, so you can
return once you're dead. (exception: coming station side)
5. **Maps**: Syndicate assault is still one of my favorites, but there's
cheesy exploits like instantly breaking the display case to lock down
the ship, turning on turrets which are EXTRA lethal, etc. I've added
some pistols to the closets and removed some of these exploits.
6. **Cooldown**: Yes, no one seems to upgrade these ever, and it proved
a poor technique to encourage bitrunners to leave their rooms. I had
other plans to encourage this, not included here, so I think lowering
the cooldown time is beneficial. 3min -> 2min

> [!NOTE]
> File diff: removed a map

## Why It's Good For The Game
Closes #83787
General updates and QoL for bitrunning to keep it fresh. I was quite
disappointed with the scaling of threat, and most players haven't even
seen bitrunning antags except when I admin spawn them. These numbers
aren't hard set in my mind, and could be adjusted.

I generally want bitrunning easier to access and more "temporary" which
is in keeping with its design doc.
## Changelog
🆑
fix: Bitrunning made more illegal: Increased the rate at which antags
spawn.
fix: "Temporary" bitrunning antagonists and spawners are made actually
temporary. You will return to your original body after death, just like
CTF.
add: Added more examine text for ghosts to bitrunning equipment.
balance: Server cooldown reduced by 1 minute at base level.
add: As an observer, you can now switch views between station and
virtual domain by clicking the hololadder and netpod respectively.
del: Removed the starfront saloon BR map.
fix: Syndicate assault map: Added pistols, reduced exploits.
/🆑
2024-06-21 22:39:44 -04:00
Jacquerel
e8157f4dfc Items in your hands can catch fire (#83867)
## About The Pull Request

Recently we allowed items held in your hands to catch fire if you catch
fire.
This makes sense but the code had a few oversights, then we reverted it.

This PR reintroduces the feature, but with a few refinements.
The basic feature is simple: If you are on fire then items you are
holding will also catch fire, in the same vein as items you are wearing
on your head or hands.

There are also a few caveats we forgot about the first time we added
this:

- If your gloves cannot catch fire, your held items will not catch fire
(because your hands aren't on fire).
- If you are extinguished, your held items will also be extinguished.
- Stopping, Dropping, and Rolling on top of any items will also
extinguish those items.

As part of this change, after an argument about whether or not this is
an oversight in coding-general, I've made the proc `get_equipped_items`
take a bitflag instead of a series of booleans as an argument and added
a new one for "include held items", so that we need no longer argue
about whether holding something counts as "equipping" it (in all other
parts of the game than this proc, it does). This is what gives the PR
most of its code footprint, don't be scared.

## Why It's Good For The Game

Items you are holding in your hands _should_ catch fire if everything
else on your person is on fire, and taking an item off of your body to
put it in your hands shouldn't protect it from fire, because those
things don't make intuitive sense.
If we want an item to be able to catch fire when worn, then it should do
so.

This might expose some issues where we were improperly setting the
flammability flags on items, but any weapon which will burn in your
hands now would also have burned if you were wearing it on your belt or
back, so making those issues more visible should be a bonus (we'll also
stop them from burning on your back or belt).

If you see someone holding a piece of paper that you really don't want
them to read you can now set them on fire to stop them from reading it,
whereas previously they would deftly hold the very flammable object out
of reach of their flaming body.

## Changelog

🆑
balance: Items held in your hands can catch fire.
balance: Items you are holding won't catch fire if your hands cannot
catch fire.
balance: When you stop being on fire so will items you are holding.
balance: If you roll around on your burning items they will stop being
on fire.
/🆑
2024-06-19 12:15:27 +12:00
Profakos
af23a63c37 Logs bitrunning domain loading and completion (#83955)
## About The Pull Request

This PR tallies the following:

- Each time a domain is loaded, by key
- Each time a domain's primary reward is loaded (completed the domain)
- Each time a domain's secondary reward is found
- Each time a BEPIS disk is rewarded

## Why It's Good For The Game

Its nice to know which are the meta domains, which ones are easy to
compete, and how often do people earn a BEPIS disk per round.

## Changelog

Nothing player facing
2024-06-14 12:27:02 -06:00
Jeremiah
fce52097ee Fixes some bitrunning related issues [no gbp] (#83184)
## About The Pull Request
Properly allows bitrunning antagonists to come station side

A few issues were resolved:
- Event title was too lengthy, it's been renamed
- IDs were not being named properly for cyber police. Cybertac would
appear as "unknown"
- Runtime at examining cyber police ID because it had an erroneous
account
- Teleporting station side would delete your organs and leave you a
broken husk of a mob
## Why It's Good For The Game
Fixes #83181
## Changelog
🆑
fix: Bitrunning antagonists no longer gib on teleport
fix: Cyber tac now have a visible name / ID
fix: Renamed the bitrunning malfunction event to just "Malfunction: x"
/🆑

---------

Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
2024-05-15 03:01:04 +02:00
Rhials
6aa0dee37f Virtual Domains now have certain areas protected from ghost role interference (#82960)
## About The Pull Request

This touches up on the bitrunning ghost roles that come with some maps,
namely Corsair Cove and Syndicate Assault.

The gist of it is: Ghost role spawners and Digital Anomalies (the random
event boss mobs) are now restricted from entering the VDOM safehouse,
and other areas where critical equipment is stored.

Here's an example from Syndicate Assault -- The X-ed out area is
considered "out of bounds" for digital anomalies/ghost roles:

![image](https://github.com/tgstation/tgstation/assets/28870487/b0752dd4-102b-4b64-8c21-c100a58c1a96)

Additionally, this also fixes the matter of pirate ghost role spawns
creating their own antag datum/pirate team, which would carry into the
roundend report. Since these are no longer legitimate pirate spawners
and are now specifically designed spawners for virtual domains.

Naturally, emagging the server jailbreaks all of these restrictions and
notifies any virtual entities.

The new subtype of spawners should also be scalable enough that new
VDOMs should be able to implement new ghost role spawners with ease.
## Why It's Good For The Game

It's one thing to have sentient mobs to fight, which can shake up the
otherwise somewhat static nature of bitrunning maps, but when players
are tossing equipment, spawncamping, or otherwise making it impossible
for the runners to fight them it ends up being unfun for everyone
involved. You can't get into a good fight with a bitrunner avatar if
their only recourse is to wipe the map and everything (YOU) in it.

This ensures a level of fairness between the (typically vindictive)
ghost roles of a VDOM and the players.

Also, pirate spawns don't make a new pirate team/datum. That's one of
the fixes I was aiming for with this.
## Changelog
🆑 Rhials
balance: Virtual domain ghost roles can no longer enter the
safehouse/"equipment" areas of a domain.
fix: Pirate virtual domain ghost roles will no longer make a pirate team
antag datum.
/🆑

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
2024-05-06 22:35:05 -07:00
Profakos
28540f275b Bepis techs can be found in bitrunning crates, removed from vendors (#82872)
## About The Pull Request

This PR adds Bepis disks to the main rewards of the Bitrunning crate in
addition to the minerals and domain specific rewards. It also removes it
from the Bepis vending machine.

Once per domain, if its difficult was Medium or higher, and the
completion score was A or S, and if there are still any leftover locked
Bepis tech nodes, a Bepis disk will spawn.

<details>
  <summary>Original PR text</summary>
If domain has a reward value greater than one, it has 10% chance per
reward value to drop. No disk is gained if they ran out of techs to
unlock. Most of the domains have a reward value of three, so by the law
of great numbers they probably get one disk per every three domains run,
which should be one disk every 20-30 minutes. At least, if I am correct
that domain runs take about five to ten minutes, and the server cooldown
is three minutes. If I am incorrect, I can edit the drop chance as
needed, of course.

Edit: As I have underestimated how fast Bitrunners can be, I have
decreased the chance to be 5% per reward tier.
</details> 

## Why It's Good For The Game

- Bepis disks are expensive, and bitrunners need to spend almost all
their NP on gear and abilities
- Downloading secret research data, is flavourful, fitting for invading
the forgotten nooks of cyberspace.
- This will allow Bepis tech to be actually used in rounds

## Changelog

🆑
balance: Bitrunners can now earn Bepis disks, once per medium domain or
above, if they scored at least an A.
del: Bitrunners can not buy Bepis disks from their vendors.
/🆑
2024-05-04 08:10:10 +12:00
Jeremiah
dc1900ac8d Removes avatar earpiece [no gbp] (#82609)
## About The Pull Request
There's no comms in the digital plane anyway so this is only stopping
them from exploiting binary comms
## Why It's Good For The Game
Exploit fix
Fixes #82604
## Changelog
🆑
fix: Bit avatars no longer have access to free binary comms with the AI
outfit
/🆑
2024-04-17 18:52:54 +01:00
John Willard
fa31403353 LateInitialize is not allowed to call parent anymore (#82540)
## About The Pull Request

I've seen a few cases in the past where LateInitialize is done cause of
the init return value being set to do so for no real reason, I thought I
should try to avoid that by ensuring LateInitialize isn't ever called
without overriding.

This fixes a ton of machine's LateInitialize not calling parent
(mechpad, door buttons, message monitor, a lot of tram machines,
abductor console, holodeck computer & disposal bin), avoiding having to
set itself up to be connected to power. If they were intended to not
connect to power, they should be using ``NO_POWER_USE`` instead.

Also removes a ton of returns to LateInit when it's already getting it
from parent regardless (many cases of that in machine code).

## Why It's Good For The Game

I think this is better for coding standard reasons as well as just
making sure we're not calling this proc on things that does absolutely
nothing with them. A machine not using power can be seen evidently not
using power with ``NO_POWER_USE``, not so much if it's LateInitialize
not calling parent.

## Changelog

🆑
fix: Mech pads, door buttons, message monitors, tram machines, abductor
consoles & holodeck computers now use power.
/🆑
2024-04-08 22:15:07 -06:00
MrMelbert
c1047432c0 Bitrunners can broadcast their bitruns to the crew via Entertainment Monitors (#82218)
## About The Pull Request


![image](https://github.com/tgstation/tgstation/assets/51863163/72b90aba-863c-4776-b596-89f0dc0ee45f)

Bitrunners are now equipped with body cameras. 
The Quantum Console now holds a switch which you can toggle on to
broadcast your body camera footage to the station's Entertainment
Monitors.

I also cleaned up some balloon alerts

## Why It's Good For The Game

I did a gimmick with a bunch of bitrunners and thought it was lame I
couldn't watch them as they did the bitrunning part.
So here we are. I think it is pretty neat and fun, and also kinda
thematic, since it is VR after all.

## Changelog

🆑 Melbert
add: Bitrunners can now broadcast their Bitruns to the station's
Entertainment Monitors.
/🆑
2024-03-26 12:28:45 -06:00
Ghom
76fa5bcdad Skillchips are now copied to bitrunning avatars, plus a new chip to dodge bullets while flipping. (#81980)
## About The Pull Request
Active skillchips are now copied on bitrunning avatars. To celebrate
this, I've made a skillchip, which can be ordered through the bitrunning
vendor, that lets you dodge projectiles for the duration of your flips
plus 1/10 of a second (so 8/10 of a sec), at the cost of stamina (if you
think 20 is a bit too low, tell me).

I've also renamed the files containing the orderable bepis disks and
bitrunning tech because they inconsistent with the names of their
sections shown in the UI.

## Why It's Good For The Game
I think (active) skillchips being copied to bitrunning avatars makes
sense as after all they're both tech-y, brainy stuff. It's a bit of a
shame that no one thought of doing that.

## Changelog

🆑
add: Active skillchips are now copied on bitrunning avatars.
add: To celebrate it, a skillchip is now available from the bitrunning
order console, which lets you dodge projectiles for the duration of your
flips, at the cost of stamina.
/🆑
2024-03-21 20:44:10 +00:00
Thunder12345
058cb039eb Bitrunning 1.5: Secondary Objectives (#81828)
## About The Pull Request

Added secondary objective lockboxes to bitrunning. These pull from a
list of secondary objective loot on the domain, with a limited quantity
of items. Once there are no items left to pull, the secondary objective
disappears. If multiple secondary objective markers are placed, they
will be placed until all markers have been used, or all the items in the
loot pool are already spoken for.

To support this functionality, adds SSbitrunning, which stores all
domains as instances, instead of checking the hardcoded types as
previously. SSbitrunning manages listing domains for the quantum
console, and rolling secondary loot.

As an example of this functionality, added a side path to Glacier Grind
with a polar bear and some loot.

## Why It's Good For The Game

Secondary objectives give mappers ways to encourage players to venture
into a wider range of domains by offering non-trivial loot beyond the
fluff items given in the main caches. The absolute limit on the number
of items available ensures these items can't be farmed.

As well as supporting secondary objectives, SSbitrunning allows for
future support of features relying on mid-round modification of domains,
for instance adding custom domains.

## Changelog
🆑
add: Added secondary objectives to bitrunning!
add: Pick up encrypted curiosities and return them to the safehouse to
claim their contents.
add: Glacier Grind has been given a secondary objective, look out for
the limited edition hat.
add: Bitrunning domains can now be modified during the round by admins.
/🆑
2024-03-09 22:42:23 +01:00
13spacemen
357799c8a5 Removes Orbit Polling Component, SSpolling improvement (#81748)
When I made SSpolling, jlsnow gave me his blessing to delete the orbit
polling component [where you orbit something for 20 seconds before it
chooses a ghost from the orbiters]
It's only used in a few places like soulstones replacing
jobbanned/inactive players, etc.

Also upgraded SSpolling; you can now place a little icon on the sides in
the chat message, chat message looks a lot nicer, the alert pic and the
jump target don't have to be the same anymore, and I made it be able to
pre-pick candidates since 90% of the use cases would just want 1
candidate

Also prints to chat who the chosen one was

Also made slime intelligence potions ask the user for a reason, which
will be displayed in the alert poll
2024-03-06 08:24:36 +00:00
Jeremiah
9090795000 Disables mod links from virtual modsuits [NO GBP] (#80038)
## About The Pull Request
Via discussion in discord:

![image](https://github.com/tgstation/tgstation/assets/42397676/b1990bce-35c3-4266-9ee1-3f6abde846bb)
## Why It's Good For The Game
Virtual entities, however suited up they are, shouldn't be able to
communicate station side with crew or with syndicate entities.
## Changelog
🆑
fix: Mod links are now disabled in the virtual realm.
/🆑
2023-12-01 21:33:03 +01:00
Jeremiah
7cb5738fcb Adds a modular bitrunning map, changes safehouse spawns (#79937)
## About The Pull Request
Primarily, this adds one new map to bitrunning that uses modular rooms.

<details>
<summary>pictures</summary>


![image](https://github.com/tgstation/tgstation/assets/42397676/48d78e05-1134-477c-a269-a4b71064058b)

![Screenshot 2023-11-25
133937](https://github.com/tgstation/tgstation/assets/42397676/851d6235-e939-465c-92e5-830886d50d9c)


![image](https://github.com/tgstation/tgstation/assets/42397676/6094dae6-fc3b-4cc4-9fd5-d7dd6d944cee)

</details>

I also added in some changes:
- Safehouses are now loaded using the modular map system rather than the
bespoke solution qservers had.
- Lowers the difficulty of psyker shuffle (which I felt was a little too
nightmarish) and boosts its rewards.
## Why It's Good For The Game
New maps
More integration with prior systems
## Changelog
🆑
add: Added a new modular bitrunning domain - Starfront Saloon.
balance: Psyker shuffle domain was made slightly easier and has been
given more rewards.
/🆑
2023-12-01 01:06:21 +01:00
Y0SH1M4S73R
640bb71ec8 Bitrunning glitches that don't escape their domain don't show up in the roundend report (#79910)
## About The Pull Request

Exactly what the title says. I was planning to fully refactor glitches
to function more like lavaland elites, which they operate more similarly
to, but I was lazy and also discovered the `show_in_roundend` var on
`/datum/antagonist` - setting that to `FALSE` does the thing I cared
most about.

Making them still appear in the roundend report if they escape was
Fikou's idea.

## Why It's Good For The Game

Does the roundend report really need to list a hostile that will cease
to exist soon after killing the only characters it can interact with?

## Changelog

🆑
qol: Bitrunning glitches will not show up in the roundend report unless
they escape the virtual domain.
/🆑
2023-11-24 23:52:31 -07:00
Jeremiah
8977992323 Reimplements bitrunning hands [NO GBP] (#79810)
## About The Pull Request
As it turns out, you cannot do that
## Why It's Good For The Game
Bitrunners need hands
Fixes #79786
## Changelog
🆑
fix: After correcting a slight miscalculation, Bit Avatars now have
hands again.
/🆑
2023-11-17 22:08:01 +00:00
Jeremiah
ba5ae73dac Adds more bitrunning antagonists + fixes (READY) (#79522)
## About The Pull Request
Reopened #78997
Larger patch for bitrunning that addresses a few issues.

- Two new antagonists: cyber tac and netguardian
- Quantum server emag opportunity
- Modular mob packs: Like random spawners, but for groups
- Antag spawning fixed: vdom antags now have up to a 10% chance to spawn
based on domains loaded
- Virtual domains are no longer all fullbright by default, only the
outdoorsy ones
- Actually deletes legion map file, since it was removed in #79424

<details>
<summary>images</summary>

The netguardian prime

![dreamseeker_eKi7Mhv45s](https://github.com/tgstation/tgstation/assets/42397676/099a0982-d6f8-4c93-a64c-8c7d45d9204e)


![robot_48_animation](https://github.com/tgstation/tgstation/assets/42397676/a2147195-61e6-4584-8645-56333ecd3e07)

The glitch effect - this mob is being mutated

![dreamseeker_NE4j4rCoez](https://github.com/tgstation/tgstation/assets/42397676/273892c7-e396-417b-8a9d-3709a210e3ff)

Cyber tac (t2 antagonist)
![Screenshot 2023-10-27
211732](https://github.com/tgstation/tgstation/assets/42397676/6ff79337-cb0d-4a1f-80cf-dce99a4991d5)

</details>

## Why It's Good For The Game
- Bitrunning antagonists are so incredibly rare that it's underwhelming
to play as one for the solid second they offer if you even get the role
- Bitrunners had basically no traitor route to follow, they became
assistants with black outfits

Fixes #79465

<details>
<summary>More info</summary>

Bitrunners don't have any type of traitor options. If they're made into
traitors, there's nothing bitrunner related they can do, and their
access is particularly bad so it's like they're a worse assistant. I've
coupled this with the bitrunning antagonist system, which is now
fixed.\. Bitrunners can now attempt to coax these entities to come onto
the station, however they are not given any form of allegiance for doing
so (and are quite counterable).

Previously, vdom antagonists relied on so many factors to spawn that it
basically wouldn't happen. Now, it runs on the server each time there is
a map loaded, with increasing probability as the round progresses. This
builds up the list of spawnable antagonists, of which two are new,
including an entirely new giant mech megafauna. This is the first
"megafauna-esque" basic mob in the game. Its AI is bad, it's really only
meant to be player controlled, but this does mean an admin can spawn
them. Being mech, they are very counterable with ion rifles and the
like.

Several refactors, rewrites, and overall bug fixes are included in this
PR.

Lastly, I added a framework for making bitrunner maps more random, the
modular mob spawning system, which works in conjunction with random
crate locations.
</details>

## Changelog
jlsnow301, infraredbaron
🆑
add: Bitrunning Patch 1 features a host of changes!
add: Added randomized mobs to virtual domains, which will be indicated
with a unique icon.
add: New emag interaction with the quantum server. Antags will spawn
more frequently, and they can hack themselves onto the station. You have
been warned.
add: Both living and dead players can now see which mob is going to
spawn an antagonist in the vdom.
add: Two new vdom antagonists: Cyber Tac and the NetGuardian. These
unlock at specific thresholds.
balance: You can no longer stack copies of the same ability with
bitrunning disks.
balance: Some of the disk items have been replaced with stronger
versions.
fix: You can no longer spy on crew using the advanced camera console on
syndicate assault.
fix: Fixed the spawning mechanism of virtual domain antagonists. You
should now have a chance of playing as one. This chance increases as
more domains are completed.
fix: Vdom antagonists shouldn't spawn at the end of the run any longer.
fix: The preference for vdom antagonists has been changed to factor in
the new types. Check your preferences!
fix: The quantum server will now show its balloon alerts to all
observers.
fix: Random domains should be fully random again.
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-11-17 11:56:17 +13:00
Jeremiah
a6b194c51c Removes virtual-specific subtypes of drinking glass + adds a new fishing map (#79423)
## About The Pull Request
Changed how loot signals work with bitrunning entirely, which allows map
creators to attach functionality to objects without creating subtypes of
the item

As a bonus I added a fishing minigame map which uses it
## Why It's Good For The Game
It's a messy solution to need to create subtypes just for the one-off
map that needs them
## Changelog
🆑
add: Added a new fishing map to bitrunning.
add: You are no longer limited to pina coladas on the beach bar domain.
Cheers!
/🆑
2023-11-03 02:19:26 +00:00
Jeremiah
550ec9b1d9 Cleans up signal use in bitrunning [NO GBP] (#79426)
## About The Pull Request
Atomized #78997
Broke up duplicate signal usage - though they do the same thing, this is
convention & it makes it easier to debug
Removed custom alert subtypes in favor of just setting values directly
Removed some unnecessary vars like the console ref from the server
Since I'm just copying this over, it has added exam text for net pods,
which fixes an issue reported to me in Discord
## Why It's Good For The Game
Code improvement
## Changelog
🆑
add: Added some clarity to the range of netpods (4 tiles) in their exam
text.
/🆑
2023-11-02 13:23:48 +00:00
Jeremiah
af00850356 Removes virtual-specific megafauna, fixes boss map issues [NO GBP] (#79424)
## About The Pull Request
Another atomization of the content patch-
Let's not subtype everything into virtual variants

This also fixes some bugs that were present with vdom boss maps
- Made the bubblegum map larger so he wouldn't teleport out
- Legion is just far too annoying to have to fix code wise, given that
few if anyone tries it with the base virtual equipment

<details>
<summary>what do you mean too annoying?</summary>

Legion doesn't handle dying like the standard megafauna - each time it
"dies" it looks to see if there's another legion in the entire game
world. Given the real one very likely exists, this basically means it
won't drop anything. I'd have to modify legion's death proc specifically
for the virtual domain. No other megafauna has this level of weirdness
(nor splitting behavior) and coupled with the fact I think no one tries
the domain, I'm just removing it.

</details>

## Why It's Good For The Game
Cleans up megafauna subtypes that were specific for the virtual domain.
Now, we won't need to keep adding to the list if there's ever a new one
Fixes #79203
Fixes #79200

## Changelog
🆑
fix: Bubblegum should no longer teleport out of the simulation when
threatened
del: Chamber of Echoes map removed as it conflicts with the actual
Legion
/🆑
2023-11-02 13:21:04 +00:00
Jeremiah
918e4faeb1 Fixes some bitrunning bugs [NO GBP] (#79332)
## About The Pull Request
Atomized bug fix PR from the content patch. They seemed to be priority
## Why It's Good For The Game
Fixes #79329
Fixes #79164
Fixes #79289

## Changelog
🆑
fix: Paraplegics can now enter netpods.
fix: Fixes an exploit caused by teleporting out of a netpod.
fix: Outfit selection at netpods shouldn't give armor bonuses any
longer.
/🆑
2023-10-31 13:47:25 +00:00
MrMelbert
5bf6d09903 Cuts the number of apply_damage copypaste procs from 3(.5) to 1, fixing a few bugs along the way (#79207)
## About The Pull Request

- `apply_damage` is now uniform, handled, in a single place. At the
living level.
- Fixes people being held at gunpoint from being unable to flinch from
taking damage.
- Fixes a few signals (explodable, glass jaw) of apply damage maybe
potentially not having effects if the passed hit zone was a bodypart and
not a def zone.
- Fixes regenerator component always halting regeneration no matter what
damage taken.
- Fixes pressure damage being unaffected by `brute_mod` despite what
documentation claims.
- Signalizes the `check_species_weakness` proc on species. 

## Why It's Good For The Game

The copy+paste of this proc made it awful, awful to maintain or add
features to. And also made it very bug prone.

This just takes a step forward in making sustaining damage a lot more
consistent, not only across all mobs, but across all methods of...
taking damage. Unarmed attacks, hulk, item attacks, etc.

## Changelog

🆑 Melbert
fix: People held at gunpoint can now flinch when being hit. 
fix: Regenerating mobs no longer stop regenerating no matter hit with
what.
fix: Pressure damage is now properly modified by a mob's brute damage
modifier.
fix: Fixes some occasions which some effects (glass jaw, explodable worn
items) won't respond to hits.
refactor: Refactored core code related to mobs sustaining damage. 
/🆑
2023-10-27 18:55:30 +00:00
Jeremiah
83e6cc517b Fixes infinite loop in bitrunning (#79194)
## About The Pull Request
Clears up some functionality in netpod disconnect cases that lead to an
infinite loop

Also fixes an errant message from #78959
## Why It's Good For The Game
Fixes #79190

## Changelog
🆑
fix: Entering a virtual domain should no longer give you a message that
it doesn't forbid items
/🆑

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-10-23 23:22:25 +01:00
Paxilmaniac
324dfb65c1 Allows domains to forgo giving bitrunners their disk items and spells if that is desired (#78959)
## About The Pull Request

Adds two variables to bitrunner domains, one for making them not spawn
disk items, and one for making them not grant disk abilities to
bitrunner characters on loading into the domain.

Not presently used in any domains, but will be a mystery tool that will
help us later.
## Why It's Good For The Game

I've thought of a few pretty good domains but the ideas behind them fall
apart a bit of joey bitrunner can bring a desword and fireball into
them.
## Changelog
🆑
code: Bitrunner domains can now have spells or items from disks disabled
if the domain maker wants such a thing
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2023-10-20 06:23:24 +00:00
Jeremiah
235ebba7e0 Bitrunning hotfix 3 (#78818)
## About The Pull Request
The next round of small changes to how bitrunning works - mostly from
feedback, bug reports etc.

- The loot crate delivery spot is now a buildable machine (the
byteforge), making it replaceable in the event of a disaster
- Same for netpods and quantum consoles. These boards are now
researchable and buildable.
- New icons for the byteforge and the health monitor
- Some bug fixes around despawning avatars
- Reimplements one of the bitrunning unit tests

<details>
<summary>Pictures ⬇️</summary>

Host monitor

![hostmon](https://github.com/tgstation/tgstation/assets/42397676/dc6811bc-7ce9-4eae-a91b-96975bd13c65)

Byteforge

![dreamseeker_LewhZG8bEl](https://github.com/tgstation/tgstation/assets/42397676/3071bc5f-b2c1-47d5-8a56-b0e6c216be20)

Spawning a crate

![dreamseeker_mHGSfoeMu5](https://github.com/tgstation/tgstation/assets/42397676/d5f84e91-b9bc-4bb8-8f1c-f8931154ff6d)
</details>

## Why It's Good For The Game
Bitrunning bug fixes and personal requests
Fixes #78571 
Fixes an issue reported in discord - players stuck as gondola spawn

## Changelog
🆑
fix: Added extra checks to bitrunning domain cleanup so avatars are
deleted properly.
add: Quantum servers now look for a new machine called a byteforge to
spawn loot on- no longer on an invisible landmark. This should make the
rooms rebuildable after disasters.
add: *Most* bitrunning machinery is now researchable and buildable via
circuits in the engineering protolathe.
/🆑
2023-10-09 00:26:16 -04:00