mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-02-07 06:48:44 +00:00
* New docking port sprites (#82729)
* Adds text to lootpanel items [no gbp] (#82722)
## About The Pull Request
Just some qol, this captures a small portion of the item name and fixes
some icon clipping issues
I clipped it at 5 because monke


## Why It's Good For The Game
Handy if youre in a rush and won't upgrade byond to fix the issue
## Changelog
🆑
fix: Lootpanel additions: Condensed item names for the quick of draw
/🆑
* Fixes tgui alert buttons (#82714)
<!-- 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
Been on my mind for a long time
I did this while relatively inexperienced (how do I center a div etc)
Fixes an issue inherent to our stack implementation where reversing the
direction caused strange spacing issues. This effectively reverses the
extra margins in css so it looks identically spaced whether reversed/not
<details>
<summary>before/after</summary>
Before (normal buttons)

Before (large buttons)

After (normal buttons)

After (large buttons)

Long buttons (normal)

Long buttons (large buttons (I am 35 and yet still fight the forces of
chaos))

</details>
<!-- 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
Looks better, runs smoother, no clipping
<!-- 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. -->
🆑
fix: TGUI Alerts shouldn't have such wonky buttons any more
/🆑
<!-- 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. -->
---------
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
* MetaStation: Replaces the tools in the Primary Surgery Theatre with filled surgery trays (#82730)
## About The Pull Request
Replaces the tools on the tables with 2 surgery trays.

## Why It's Good For The Game
Makes surgery a bit less painful in the surgery theatre, Using tools
from a tray is much nicer than having to open the context menu on the
piles of tools on the tables.
## Changelog
🆑
qol: Replaced the surgical tools in the Primary Surgery Theatre with 2
Surgery Trays.
/🆑
* Fixes smart pipe & cryo gas reallocation (#82701)
## About The Pull Request
**1. Smart Pipe Problem**
- Fill a pipe with any gas, plasma for e.g.
- Unwrench the pipe to deconstruct
- The pressure sends you flying but notice plasma is nowhere to be seen
from the now destroyed pipe
**2. Cryo pipe connector problem**
The gas gets reallocated when the object is deleted. We only want this
when its deconstructed not deleted to prevent any side effects
This PR fixes them
## Changelog
🆑
fix: smart pipes release their gases into the air when unwrenched
fix: cryo pipe connector component has no side effects of gas
reallocation when deleted
/🆑
* Fix Primal Instincts (#82741)
## About The Pull Request
#82539 randomly made these two lines switch their AI controllers to idle
rather than on, when the intent was for them to wake up immediately to
do make the mob attack or fight or do something
## Changelog
🆑 Melbert
fix: Primal Instincts and Living Flesh should be a tad more reactive
/🆑
* Fix handcuffing (#82760)
## About The Pull Request
Changed this to an early return but then didn't invert the condition
## Changelog
🆑 Melbert
fix: You can handcuff people with 2 arms and you can no longer handcuff
people with 0 arms
/🆑
* Gets rid of UNIT_TESTS compiler warning (#82695)
## About The Pull Request
Basically every single CI Run is throwing the following warning:
```txt
code/modules/unit_tests/lootpanel.dm:24:warning (unused_var): new_box: variable defined but not used
```
You may find an example here:
https://github.com/tgstation/tgstation/actions/runs/8698627681/job/23855921813#step:9:24
This is pretty silly but I don't really know why we even have this
variable (I assume there's something far more complicated underneath the
surface based on what the unit test is asserting), but assuming it is
important let's just insert a do-nothing procedure to get rid of the
compiler warning while ensuring the unit test is actually operating as
it should.
I also don't really like the fact that this is a warning instead of an
error but let's tackle this problem one step at a time by at least
getting rid of the compiler warning in a quick advance PR while I dwell
on this issue (is there a way to get the Dreamchecker linter to look at
the unit test files? it's caught perfectly fine in the langserver)
---------
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
* Makes dropdowns better (#82697)
## About The Pull Request
Kind of a pain to work with, confusing people with its prop names (many
such cases!)
After recently discovering deathmatch it's very obvious to me how broken
it is, so I made it less so
(now comes with a complete ui upgrade!)
It now scrolls with the selection and to the selection on open, which
felt like major QoL
<details>
<summary>pics/vids</summary>
In motion

Deathmatch got some UI facelifts


Fixes #75741

</details>
## Why It's Good For The Game
Better UX
Bug fixes
Potential exploit patched (ui validation for ai voice changer)
Fixes #81506
## Changelog
🆑
fix: Dropdowns received some much-needed QoL, like having the scrollbar
follow your selection.
fix: AI voice changer now shows its current voice selection.
fix: Deathmatch screen has been touched up.
fix: Prefs menu has their dropdowns simplified, hopefully fixing issues
/🆑
---------
Co-authored-by: san7890 <the@san7890.com>
* Fixes the NT SWAT helmet sprite (#82743)
* Mass Item Creation (#82455)
## About The Pull Request
Have you ever had to click the "Make" button a dozen times for a chef
making soup? I've also had it, so with this PR you can press the button
and everything will repeat itself as long as possible.
## Why It's Good For The Game
Makes life easier for chefs, now they can play chess on their cool
smartphone and craft food. (actually you can transfer it to other items
as well, see for yourself).
* Adds Retain volume flag on the ants reaction (#82718)
Fixes #82575
We'd expect feeding ants to always result in more ants I imagine.
* Borg movement now has sounds (#82704)
## About The Pull Request
adds sound effects to cyborgs when they move
Demo:
https://imgur.com/a/7Mu98pQ
Open to feedback on this sound so please tell me what you think.
## Why It's Good For The Game
a hunk of metal moving at you without any sound is frightening
## Changelog
🆑 grungussuss
sound: cyborgs now have sounds to indicate they are moving
/🆑
* Use cell defined constants for various stuff (#82594)
## About The Pull Request
This re writes most cell power usage cases with 2 defines
`STANDARD_CELL_CHARGE`(Joules) & `STANDARD_CELL_RATE`(Watts) so changing
cell capacity values in the future won't cause discrepancies.
## Changelog
🆑
code: most cell power usages are scaled with defined constants to help
adapt to future changes
/🆑
* Plumbing machinery power & processing tweaks (#82702)
## About The Pull Request
- Plumbing machinery begins processing only when wrenched & ends
processing when unwrenched. The machines plumbing component
`/datum/component/plumbing/process()` already does this but the
underlying machines processing proc for e.g.
`/obj/machinery/plumbing/synthesizer/process()` is always processing
regardless of its wrenched state or not. We can optimize this & save
power when unwrenched
- Fixes #82621. This adds plumbing machines `idle_power_usage` on top of
its `active_power_usage` ensuring it only uses power when actively doing
work, So if your factory is say full of reagents & cannot do any more
work it will use less energy i.e almost enter an stand by mode,
efficiency
- Plumbing grinder chemical will grinds & juice stuff correctly i.e.
prefer grinding over juicing most of the time
## Changelog
🆑
fix: plumbing machinery begins processing only when wrenched & ends when
unwrenched
fix: plumbing machinery uses energy only when wrenched & doing work,
will stop/use less energy when idle
fix: plumbing grinder chemical will grinds & juice stuff correctly i.e.
prefer grinding over juicing for most stuff
/🆑
* Carps migrating through the station no longer idle so they don't get stuck after spawning until someone walks by. (#82744)
## About The Pull Request
Carps migrating through the station no longer idle so they don't get
stuck after spawning until someone walks by.
## Why It's Good For The Game
Bugfix for Carp Migrations.
## Changelog
🆑
fix: Carps migrating through the station no longer idle so they don't
get stuck after spawning until someone walks by.
/🆑
* Alt click no longer conflicts with mech suit [no gbp] (#82758)
## About The Pull Request
Get in the gundam shinji!!!
Context: Mech users hold ALT to disable strafe, which would trigger the
lootpanel to come up while committing war crimes (annoying!)
This prevents the panel from appearing and fixes the previous behavior,
meaning you can alt click your own mech to disable strafing.

It also makes toggling strafe a balloon alert with sound. Parties for
all occupants!!
## Why It's Good For The Game
Fixes #82753
## Changelog
🆑
fix: Mecha pilots are no longer bothered by incessant loot panels while
holding ALT for strafe disable.
/🆑
---------
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
* Adds a Wizard-themed map to the deathmatch (#81640)
## About The Pull Request
Deathmatch is severely lacking in HIGH IMPACT MAGIC LARPING. So I added
a big ass wizard arena. The arena itself is based off the wizard den.
Loadouts:
**Wizard:** Standard all-rounder. Got magic missile, jaunt, and
forcewall. Regular gear.
**Pyromancer:** Fire guy. Red robes, fireball, smoke.
**Electromancer:** Zappy guy. Lightning and tesla shock.
**Necromancer:** Is a skeleton. Has Scream for Me and blink.
**LARPer:** Straight from Station & Spessmen. Fake robes and can only
throw lightning and repulse.
**Chuunibyou:** Classic animage. Got chuuni buff and magic cards.
**Battlemage:** Melee fighter. Got some armor and a big hammer with
instant summons.
**Apprentice:** Underpowered until they find a mystery box. Got charge.
**Gunmancer:** Who needs magic when you have guns? Starts with an m1911,
lesser gun summons, and knock.
**Monkeymancer:** Is a monkey. Can summon monkeys and gorillas. Has a
banana.
**Chaosmancer:** Jumbled robes. Starts with a chaos rod. Can rod form
and summon traps for high chaos.
**Funnymancer:** It's just a clown with a banana staff.
The map itself is a pretty standard arena with a long sightline in the
middle. Each participant spawns in their own room complete with a magic
item box. The very southern portion of the ship has a standard mystery
gun box. Soon after the round starts, a hostile gelatinous cube in the
center of the map will break out and attack whoever it sees. Inside its
enclosure is a free death wand. Map has been tested to make sure
deathmatch participants can't escape the deathmatch.
## Why It's Good For The Game
Deathmatch provides a unique opportunity for people to play with
mechanics they will not often get to use. Allowing people to play wizard
for a few minutes shouldn't cause too much harm aside from admin logging
from explosions, which hopefully a fix is in the pipeline for.
## Changelog
:cl:Motho
add: Added wizard-themed deathmatch map.
add: Added mystery wand box.
/🆑
* Makes viewers() defines (#82767)
* Fixes Pseudo circuit delay & some missed cell define usages (#82771)
## About The Pull Request
- Fixes #82688
If the circuit cost is<= 1% of `STANDARD_CELL_CHARGE` then the delay is
5 seconds, if the circuit cost is >= 50% of `STANDARD_CELL_CHARGE` then
delay is 1 minute. All other delay values are interpolated in between
these 2.
- Pseudo circuits don't use power when used on cooldown
- Makes `INSPECTOR_ENERGY_USAGE_*` defines values use standard cell
values
## Changelog
🆑
fix: pseudo circuit adapter computes recharge delay durations correctly
& won't use power when on cooldown
code: uses standard cell defines for N-spect scanner
/🆑
* Lava/Plasma River tiles now immerse you in them (#82736)
## About The Pull Request
This adds the "immerse" element to lava tiles.

It's a tad hard to see because you're super on-fire, but it still looks
nice.
## Why It's Good For The Game
Eye candy, pretty...
## Changelog
🆑 Rhials
qol: Lava and plasma rivers now immerse you in them.
/🆑
* Adds `ALLOW_RESTING` to a bunch of items (#82761)
## About The Pull Request
Allows you to alt-click a bunch of items while resting.
Fixes #82788
## Why It's Good For The Game
Some of these, such as storage, are bugfixes. You shouldn't need to be
standing up to configure a spray can, or change the direction of your
bedsheet
Others are just sensible changes.
## Changelog
🆑 Melbert
fix: You can open bags with alt click while resting again
qol: Many items which previously required you to stand to alt-click now
don't, such as bedsheets and spray cans
/🆑
* Fixes sight range on lootpanel [no gbp] (#82765)
## About The Pull Request
When asked to make lootpanel visible at range they did not just mean
_any range_
AI alt click was a little weird (still is) but now it works
(TM BUG)
Fixes #82768
* Adds Omnitools for engineer and medical cyborgs, reducing on inventory clutter. (#82425)
[This PR is a bounty requested by Ophaq and worked on by
Singul0.](https://tgstation13.org/phpBB/viewtopic.php?f=5&t=36013)
All of the following description in this PR is written by Ophaq as to
what this PR entails:
In this PR, the medical and engineering cyborg's tools are completely
reworked and condensed into an arm similar to the implant a carbon would
get. The tools are shown in a radial wheel around the character to quick
select what is needed instead of looking for it in a cluttered bag of
items. There are a few tools such as the blood filter for the medical
cyborg, as well as the welder, gas analyzer, and t-ray scanner for the
engineering cyborg excluded from the radial wheel. mostly due to their
inherent inmodularity


Each cyborg gets two arms in case the player wishes to have one on the
side to quick swap to, like having a scalpel in one arm and a hemostat
in the other on the hotbar for convenience or just preference. An
upgraded version of the tools has been added to each respective cyborg
upgrade node with somewhat faster action speed. The upgrade replaces the
arms and transforms them into the "advanced" version which is currently
the same sprite as the regular but just a faster and more efficient
version. The sprites for the surgical arm currently look good but may
need replacing later if someone who wishes to resprite them down the
line decides to do so.
As it currently stands, the medical cyborg's magical bag of gadgets
takes up a lot of your screen space and as a player who plays medical A
LOT, this was a MUCH NEEDED quality of life feature.
The amount of clutter in a medical cyborg's bag makes it in my opinion,
hard to see at the bottom of the screen and a nuisance to constantly
close compared to other models. My standard set up for playing medical
cyborg on the hotbar is 1=med analyzer, 2=usually a secondary surgery
tool or injector, and 3=another surgery tool. The flow of gameplay
during surgery ends up being surgery tool, hit 3 and drop it, surgery
tool, repeat or for efficiency using X to swap between the two surgery
tools I need on 2 and 3. This gets tedious especially after so many
hours of playing medical cyborg. I know some people may disagree, but I
think it would help a lot of help to speed up this flow of gameplay
during surgery and declutter.
By turning the medical cyborg's toolset into an omni-surgery tool which
functions like the surgery arm implant's radial wheel, this would
greatly declutter by like an entire row and make things easier on
medical cyborg players. Having a secondary in the bag helps with
efficiency for those players who like having an extra tool on their
hotbar and swapping back and forth would also improve efficiency and
make less swapping by hitting Z needed. Additionally with the upgraded
version as an optional upgrade in the mediborg tech, this also lets them
be on par with players who use advanced tools late game but not at the
level of alien tools where players would obviously out compete a
mediborg in terms of action speed.
Engineering models also benefit from this rework but at a slightly
different and lesser way whereas certain tools are excluded such as the
welder, due to the way they work on refill and the gas scanner and t-ray
scanner not counting as tool components are not included in the arms.
Syndicate versions of the engineering and medical cyborg also get these
arms, unupgraded.
🆑
add: Adds an omnitoolset for both engineering and medical cyborgs,
containing various basic tools
qol: Engineer and Medical module inventory space is now significantly
decluttered
/🆑
---------
Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
* Fixes dropdown displaytext not working for numeric values (#82778)
## About The Pull Request
https://github.com/tgstation/tgstation/pull/82697 broke the prefs menu
downstream; we have a couple of dropdown choices that are numeric but
that make use of `display_names` to map those choices to appropriate
strings.
The code was assuming that `value` would always be a string when calling
`capitalizeFirst(value)`. Basically it should be doing
`display_names[value]` when `display_names` are present.
## Why It's Good For The Game
Fixes an oversight/bug.
## Changelog
🆑
fix: dropdowns that use display_names as an alias for numeric values
will no longer cause tgui bluescreens
/🆑
* [NO GBP] HPLC can purify inverted chems (#82727)
## About The Pull Request
- Fixes #82725
Inverted chems are now coloured green and classified as clean (like
before my general maintenance PR) which means they can be purified
again.
Only chems that are too impure to use & have an inverted chem value are
coloured red in the UI and not when they are just of the inverted type
## Changelog
🆑
fix: HPLC can purify inverted chems and are now coloured green(clean) in
the UI
/🆑
* Lathes compute their local storage size correctly (#82770)
## About The Pull Request
Basically we have to add the material container before we call parent
Initialize(which calls `RefreshParts()`), else the container doesn't get
initialized early and we skip over computing storage sizes
## Changelog
🆑
fix: off station & round start lathes with local storage don't have
infinite storage size.
/🆑
* Arcmining QoL: GPS component to scanned vents and vent(pin)pointer (#82724)
## About The Pull Request
Scanning ore vents will now tag them on GPS so you can find them easily
when you are prepared (and remove them when they are tapped). Also adds
special pinpointer to help with finding unscanned vents in a first
place. And adds missing uranium overlays for scanned vents. Because why
not.
<details>


</details>
## Why It's Good For The Game
While looking at mineral density to find vents is somewhat fun and
entertaining, having some sort of upgrade to make finding them easier
adds a bit of a progression. Also re-finding already scanned vents can
be a bit annoying. You need to fill your backpacks with GPSs and tag
them manually. It is also inconsistent with geysers that are added to
positioning after you scan them. And with tendrils, which are always
visible.
## Changelog
🆑
add: added ventpointer that points toward nearby ore vents and can be
bought with mining points
balance: scanned ore vents can now be found with GPS
fix: fixed ore vents missing overlay icon for uranium
/🆑
* Fix oven tray runtime (#82782)
## About The Pull Request
Fixes a lil typo from the interaction refactors that broke the ability
to load oven trays from containers
## Why It's Good For The Game
squamsh bug
## Changelog
🆑
fix: loading oven trays from serving trays and other containers works
again
/🆑
* Fix flaky test detection (#82790)
- Add missing job pagination.
- Fix multiple jobs being able to fail if they aren't in
`CONSIDERED_JOBS`
* Add utf8 support for state laws button (#82789)
## About The Pull Request
Adds UTF-8 support for state laws HTML page. Now it supports more than
just English
## Why It's Good For The Game
Support for other symbols, such as cyrillic

* Update highest available sound channel (#82780)
Current channels are:
```
```
So, the highest available now is 1013
Updating the thing which everyone forgot for 7 years. Not that many
special channels were added either way
* Revert "Borg movement now has sounds" (#82795)
Reverts tgstation/tgstation#82704
The sound ingame appears much louder than the original author intended.
Not to mention that the sound loops stack for every borg moving near
you.
* Use defines for "General Research" where it's not used (#82785)
## About The Pull Request
There is a define for it, so why not use it?
## Why It's Good For The Game
Defines good
* [READY] the unfuckening of clothing rendering (#79784)
refactors clothing visors to use the same system, including masks being
toggled and stuff like riot helmets toggling using the same system and
welding helmets and such
adds a handler that updates all visuals in slots that an item has
obscured, each visual proc calls that so you no longer have weird shit
happening like having to hardcode a proc for heads where you need to
also update hair, mask, glasses everytime you put on an item
one thing here i could also do is make check_obscured_slots return the
HIDEX flags instead of item slots, because in 99% of cases its hardcoded
to be ran against specific slots (like eye code running it against the
glasses slot), but maintainers didnt seem to like that :/
fuck this 2003 bullshit
theres like several bugs here i fixed but i forgot them all and they are
small
* Allows vv investigate /appearance + better checking image (#82670)
* Fixes Alien Numerical Identifier Transfer System (#82762)
## About The Pull Request
Fixes #82756
I'm not sure what the root cause of the issue is or why it broke so
recently (this has been a thing since #49150) but I went and cleaned up
the code and ensured that we always reset the `name` to the `initial()`
value we have for it if we determine that we need to transfer over the
`numba` from the old xenomorph. This is done by a new proc which is a
lot less convoluted from the old system (always respecting var-edited
names and stuff like that) that should make it flow a lot better and
make it more hardy against double-addition of the `numba` to the name.
## Why It's Good For The Game
Having two numbers in your name is weird, should only have one.
[x] I tested this PR
## Changelog
🆑
fix: Evolved aliens should no longer have two numbers in their name.
/🆑
* [NO GBP] Fixes runtime in advanced camera console (#82699)
## About The Pull Request
We only unset machine if we have a user who has logged in
## Changelog
🆑
fix: Fixes runtime in advanced camera console when power is turned off
/🆑
* Refactors how basic ais do their success/failures (#82643)
* Rocky DLXIII: Fitness to Athletics, Athletics skill influences Boxing against Boxers, Boxing overhaul, Evil Boxing (#82611)
as the only meaningful reward
Basically just a rebranding so that it is more broad in its concept. It
isn't just about peak physique. It's about how you can apply it too.
Reaching Legendary rewards you with the Golden Gloves.
I started it in this pr here
https://github.com/tgstation/tgstation/pull/80635
But this is a more significant overhaul of boxing from the ground up.
Namely, it now is majorly influenced by the Athletics skill, and also
more thoroughly aligns with conventional punching in its current state.
However, a major component of this is that boxing's breadth of mechanics
is only relevant when used against another boxer. Non-boxer targets are
only ever going to get smacked by a stamina punch, as it is currently
(and more or less the same values too). Additionally, boxers cannot
punch someone who is either unconscious or in stamina crit, so it can't
be used to maintain stamcrit.
- Boxing now has a One-Two Punch mechanic. Swapping between the left and
right mouse buttons to punch and maintaining this causes every second
punch to do more damage (to boxers). Breaking this chain by punching
with the same button twice will cause you to lose damage (against
boxers).
- Boxing now can have crits occur below 50 stamina damage (against
boxers). However, to knock someone out clean, the target must be
staggered from a previous crit first. (Or I guess be staggered at all,
maybe their shoelaces were tied or something). Crit probabilities are
determined by adding your Athletics probability skill bonuses to your
unarmed effectiveness, and then reduced by the targets own Athletics
skill bonuses. It is hard for two athletes to knock each other out in
one blow. It is trivial for a legendary boxer to knock out a novice in a
single punch. Cybernetically enhanced boxers are dangerously effective
at boxing.
- Boxers can block other boxers by using throw mode, but the chances of
doing so is based on Athletics skill bonuses. A successful block causes
the attacker to take stamina damage (as does the blocker, but less so).
- Participating in boxing increases the Athletics skill. Your gains are
probably slower than normal training, but you at least get some reward
for doing so. Only relevant if your opponent is a boxer. Get a sparring
partner!
So this is all well and good, but what if you're a scoundrel with no
care for the other person in this equation? Well, that's where Evil
Boxing comes in. Evil Boxing has absolutely no restrictions at all, and
can freely use its boxing abilities against anyone. Even non-boxers. You
can even grab people! Wow, what a scumbag. I bet you even king hit
people. Thankfully, only an admin can make you into an Evil Boxer.
(against boxers)
Both mutations have a flimsy increase to instability of 5 because of how
incredibly particular the bonus is.
Strength now reduces the amount of stamina damage inflicted via
exercising by half. Strength also adds a +2 damage bonus on boxing
punches while boxing against boxers (this doesn't influence normal
unarmed attacks whatsoever, or boxing against nonboxers). Obviously,
evil boxers just get this benefit against everyone because they're
knaves.
Stimmed increases the duration of the exercised status effect by one
factor. (That is, if you have no other modifiers, it will double the
duration on its own)
@Jacquerel was racking their brain trying to come up with an alternative
to the skill rewards of Fitness. At the moment, sprite growth is not
only a really bad bonus (it does literally nothing but make you big, and
thus is actually a detriment due to how intrusive sprite size is with
interaction, and plays weird with other sprite changing effects), but
isn't really all that interesting for all the effort put in.
Problem is, how do you make Fitness meaningful without making it a
powergame mechanic? Simple! You make it applicable to a really niche,
self-contained but still utilized game mechanic that is engaging to
participate in and makes you meaningfully very good in it. AND scratches
that power scaling itch that many players have.
Boxing is reasonably self-contained as is, but pretty bland due to how
old it is. While maintaining that self-contained nature, I hoped to
expand the interactivity of boxing a little bit by giving it a small
mini-game in of itself. And also introduce ways to simulate the idea of
boxing a bit better.
The idea of being an Evil Boxer is funny. For every Rocky, there is a
[Insert Rocky Villain Here that isn't Creed]. But in this case, it's
probably some Syndicate douchebag looking to punch clowns into a coma
and inspire the mime to take up shadowboxing in revenge.
🆑
add: Replaces Fitness with Athletics; same skill, but now more
specifically applicable to boxing.
add: Athletics does not increase sprite size.
balance: Overhauls Boxing to add a lot more depth to the interactions.
Only applicable to other boxers, however. You can still punch the snot
out of non-boxers though. But only up to stamcrit or unconsciousness. No
hitting someone who can't fight back!
balance: Adds Evil Boxing, which is the evil and fucked up version of
boxing that you kill people with and are allowed to flout the sacred
rules of boxing as you please. Everyone is a victim!
/🆑
* Cargo ui refactor -> TS (#82745)
Refactors cargo ui, fixing some visual bugs, just making it look better
in general
Should be no gameplay effect other than it looking better
<details>
<summary>pics</summary>




Fixes #81442

Made a type grabber for backend data in case you want to make your own
typescript uis
`logger.log(getShallowTypes(data))`

Otherwise cargo's data is unreadable
</details>
Any UI over 500 lines should get broken up to reduce cognitive load
~~Any ui in javascript shouldn't exist~~
Cargo UI is better
Typescript
🆑
fix: Cargo's supply console has been upgraded visually.
/🆑
---------
Co-authored-by: EricZilla <81941674+EricZilla@users.noreply.github.com>
Co-authored-by: Helg2 <93882977+Helg2@users.noreply.github.com>
* Makes lavaland stone tiles prevent immersion (#82807)
## About The Pull Request
Adds the same trait that lavaproof rods have to the stone tiles, so
things can continue being visually outside of the lava
## Why It's Good For The Game
this shit looks goofy

## Changelog
🆑 FlufflesTheDog
fix: Stone tiles (and things on them) no longer get immersed in lava
/🆑
* Getting up from prone, z movement, and mod de/activation don't do cogwheels (#82794)
Adds `hidden` to getting up (from prone), moving up (z-movement), moving
down (z-movement), and de/activating MODsuits
- Getting up from prone happens very often, makes it a bit hard to
differentiate when people are doing actions or just crawling around.
- If we want feedback for getting up, should just be a chat message.
- Moving up and down is just movement. Only affects using the verbs.
- Same as before: If we want feedback, it should just be a chat message.
- Other methods of moving up/down (IE, ladders) are untouched / retain
their cogwheel.
- De/activating modsuits have their own visual feedback and sound
effects associated. Both feels unnecessary.
🆑 Melbert
qol: Getting up from prone, moving up or down a z-level (not via
ladders, naturally. Like flight), and de/activating your modsuit no
longer shows cogwheel effect
/🆑
* [NO GBP]Inversely scale mechanical favor with STANDARD_CELL_CHARGE. (#82801)
## About The Pull Request
Makes the mechanical sect cell sacrifice favor adjustment inversely
scale with STANDARD_CELL_CHARGE. This reduces it by a factor of 1,000.
## Why It's Good For The Game
So they don't get 1,000 times the favor as intended from a cell.
## Changelog
🆑
fix: Fixes mechanical sect gaining 1,000 times the favor from a cell
sacrifice.
/🆑
* Fix all types of damage to the head causing brain damage (#82763)
## About The Pull Request
5 months ago when I separated this stuff out to its own proc I forgot a
damagetype check.
## Changelog
🆑 Melbert
fix: Only brute damage causes brain damage when applied to the forehead,
rather than all damage types
/🆑
* Converts ListInputModal to actually be a Modal | Adds ListInputWindow which uses it (#82792)
## About The Pull Request
If we say something is a Modal it should actually be a Modal
## Why It's Good For The Game
You can now use this system in other windows if you want.
Fixed the misnomer.
---------
Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
* Higher capacity SMES variant for low maintenance areas; miners can access their maintenance area on mining base, gulag no longer saps all power from the main base (#82713)
## About The Pull Request
Creates a higher capacity version of the SMES unit that spawns in with
super capacity cells, as well as a full version. Places the full version
into all the AI sats (which all have independent grids for the most
part), some remote space ruins and the mining base. These SMES units are
intended for areas where players aren't expected or cannot reasonably be
expected to constantly monitor power usage within the length of a
standard round.
Miners can access their power stations, telecommunications box and
atmospheric station on the mining base. They're really the only people
who care, after all.
The gulag's SMES (also now upgraded) no longer saps power from the main
base due to having its input terminal rigged to the main base power
grid, and thus demanding all power from the grid greedily. To revert
this in-game is a single power cable placed back east of the SMES unit.
## Why It's Good For The Game
The power changes made some of the once largely low-maintenance areas
much more likely to run out of power more quickly than you would expect.
These aren't areas expected to be maintained or monitored by engineering
(probably because they're not easily accessed), and they're just kind of
troublesome to deal with on a round-to-round basis.
Mining had this problem triple-fold. It had significant drain with no
convenient method of installing power generation at all, miners couldn't
access what power generation there was without using their 'skeleton
key' to open the way (only engineers could, and they aren't expected to
come down to mining at all), and even then, there was the gulag SMES
just eating all the power anyway. I'm pretty sure that SMES unit was the
biggest culprit of them all, but I think this conveniently future proofs
these issues for the time being.
## Changelog
🆑
add: Adds a higher capacity SMES unit to lower maintenance areas and
maps.
fix: Miners can actually access and fix their engineering issues on the
lavaland base via the engineering section of the base.
fix: The gulag SMES unit is no longer needlessly draining the entire
power grid of the main mining base.
/🆑
* Revert "Higher capacity SMES variant for low maintenance areas; miners can access their maintenance area on mining base, gulag no longer saps all power from the main base (#82713)"
This reverts commit af8d69f889.
* New views for mc controller ui (#82769)
## About The Pull Request
Lots of qol improvements for controller tgui
- Auto sort order based on type
- Bar view for items in deciseconds
<details>
<summary>vids</summary>
in a live round

modals

bar view with defaults for decisecond sorts

</details>
## Why It's Good For The Game
Better admin tools
## Changelog
🆑
add: Admin tools buffed, check the Controller Overview
add: Controller Overview moved to debug tab
/🆑
* Revert "Converts ListInputModal to actually be a Modal | Adds ListInputWindow which uses it" (#82841)
Reverts tgstation/tgstation#82792
* [no gbp] Fixes cargo express console (#82843)
## About The Pull Request
Cargo express console does not send amounts by name
Fixed and touched up the express console a bit

## Why It's Good For The Game
Bug fix (no issue yet)
## Changelog
🆑
fix: Cargo express console fixed: No more bluescreen
/🆑
* Plumbing & chem reaction chamber patches (#82781)
## About The Pull Request
1. Both Plumbing & Chem reaction chamber will use the beakers
`heat_capacity()` proc instead of the formulae `SPECIFIC_HEAT_DEFAULT *
reagents.total_volume`. This yields the exact same results as before but
will mean in the future if individual reagents heat capacities are
changed then the heating effects will be accurately reflected here. It
also uses that amount of power for heating
2. Plumbing rection chamber will not use energy when its either
'emptying' or when no reagents are present in its internal buffer
3. You can hit the chem reaction chamber with items like beakers,
screwdrivers, crowbars and what not
## Changelog
🆑
fix: plumbing & chem reaction chamber heating effects accurately reflect
the beakers heat capacity & power usage
fix: plumbing reaction will not use power when emptying or when there
are no reagents to heat
fix: you can hit the chem reaction chamber with items like beakers,
screwdrivers, crowbars and what not
/🆑
* fixes brimdemon AI (and some other mobs) (#82831)
## About The Pull Request
i noticed brimdemons werent attacking when i tried investigating the
problem i saw it extends to other mobs
## Why It's Good For The Game
brimdemons, as well as other mobs, will behave normally
## Changelog
🆑
fix: brimdemons (and other mobs) will act normally
/🆑
* Implements data systems (#82816)
## About The Pull Request
Subsystems currently come in two different flavors:
1. Systems that process at intervals with the master controller
2. Global data containers that do not fire
And I think they should be split up...
This moves 4 non firing, non init subsytems -> datasystem
## Why It's Good For The Game
Clarity in code
* fixes ammo_bench data system
* [no gbp] express console: Bluescreen on cart (#82844)
## About The Pull Request
Truly,
## Why It's Good For The Game
Bug fix before you even issue report it
* Adds Medieval Pirates (and small assault_pod change) (#82392)
## About The Pull Request
(short, slightly outdated video compilation of the pirates)
https://youtu.be/j9BNFzcUSjc
Adds the **MEDIEVAL WARMONGERS** pirate gang, these pirates are focused
on causing chaos directly on the station with the use of melee weaponry
and swarming tactics.
they are not very smart when it comes to using technology, so they crash
in the station in an attempt to dock.
the pirates spawn with the NOGUN trait as they have never used guns
before but have access to dashing and the unbreakable component(small
heal burst upon reaching crit).
Warlord spawns with a better version of hulk(isnt removed upon crit and
can still do stuff while critted) and gigantism mutation by default
because ~~Chad Maximus~~ the other pirates require someone to run to
when stuff like flashbangs, batons or lasers are present. The warlord
spawns with a boarding axe which is a better axe that is good at
destroying things and a meat hook. **there's a total of 5 pirates.**
the pirate shuttle has:
- thermite barrel and 3 large beakers
- single weak claymore
- 3 extra military spears
- 3 kite shields
- 3 heavy bolas
- 4 regular bolas
- a stack of wood
- 2 stacks of mourning poultice (15 uses each)
- one burn medkit
**shuttle was made by striders18, big thanks to him**

things added:
- the new pirate gang
- a gamberson jumpsuit
- crude armor (good melee and wound protection but lacks on the rest)
- warlord armor (extreme protection at the cost of slowdown)
- a shortsword(bootleg claymore with 30 block chance and goes on belt
instead of back)
- military spear (better at throwing, better wounding, deals blunt
wounds instead of sharp)
- axe with better damage and demolition mod for the warlord
- a var to specify the name of the landing zone destination for the
assaultpod
- an assault pod targeting device item for the medieval shuttle
- a thermite barrel
- kite shields
- new hulk variant that doesnt go away when crit and has tenacity
## Why It's Good For The Game
I always liked the chaotic nature of the russian bounty hunters that
would come from their extra numbers and lack of tools. i thought
something of a similar idea on pirates would be good, a very direct and
scary militia rushing in with sword and faith would create some awesome
scenarios
## Changelog
🆑
add: New heavy weight pirates, medieval warmongers
add: Adds military spear, shortsword, boarding axe, kite shields
add: Adds warlord and crude armor
add: Adds medieval shuttle (made by striders18)
/🆑
---------
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
* fix for pirate suit
* Adds sorting options and a search bar to the crew monitor (#82732)
## About The Pull Request
This PR adds buttons in the crew monitor UI to sort by name, position,
or vitals, as well as a search bar for searching for specific people.
For vitals, people are sorted first by life status (living, crit, dead,
etc), then by damage. Also TS-ifies the UI.
https://github.com/tgstation/tgstation/assets/42454181/a7c0c262-8ea7-4e9f-8de6-6b9cf7481b23
## Why It's Good For The Game
Currently, finding a specific person, or a person in a specific place,
is a pain in the butt with the crew monitor. You have to go through an
unsorted list of people grouped only by department. Don't know the
person's job? Tough luck, you're going down the list one by one. It is
not at all a friendly user experience. With this PR, it becomes a
breeze, and makes the crew monitor much easier to use.
## Changelog
🆑
add: The crew monitor now has sorting options and a search bar.
/🆑
* Accessing Datasystem Manager from MC controller panel (#82848)
* [NO GBP] fixes issues with human rendering fixes (#82852)
## About The Pull Request
fixes #82838, forgot to add the attack_self there
fixes #82869
fixes the atmos hardhat not using flags_inv and transparent_protection
correctly (you could pull off someones glasses through it for example
makes modsuits use the new rendering stuff
fixes rendering stuff not working correctly with adjustable clothing
fixes quick equip dropping the item if you cant equip it
## Why It's Good For The Game
waow its awesome
## Changelog
🆑
fix: you can no longer take off someones glasses or mask through atmos
hardhat
fix: once you adjust a welding helmet or something it no longer makes
your cigarette or sunglasses invisible
fix: welding gas mask works once again
fix: quick equips dont drop the item if you cant equip it
/🆑
* fixes erp slots
* Redoes how appearance VV works because it scares me (#82851)
* [NO GBP] Critical fixes for cyborg omnitools (#82825)
## About The Pull Request
Fixes several critical fixes for cyborg omnitools, surgical omnitools in
peculiar. Which is:
1. bonesetter omnitool can do compound fracture surgery now
2. omnitool butchering not properly disabled works (why didn't that
runtime. fucking dreammaker)
3. omnitool surgery_initiator not properly disabled
4. cautery in offhand not working
Fixes #82805
Fixes #82868
Honestly I have now regretted for doing this kind of implementation at
the start. with how shoddily coded it is.
Planning to refactor cyborg omnitools, admin omnitool and ayys omnitool
(all have the same base of implementation) to be less snowflakey. but
that's for the future. and will take some time. This is a bandaid fix
for now
## Why It's Good For The Game
this is cbt
## Changelog
🆑
fix: fixed cyborg bonesetter not working for compound fractures
fix: butchering not disabling in cyborg omnitool
fix: fixes a bug where if you select the omnitool it would be stuck in
surgery initiator mode
fix: cautery in off hand for cyborg omnitools not working
/🆑
* fixes ai controllers hard deletes (#82861)
## About The Pull Request

i noticed almost all ai controllers were being hard deleted, its because
the controller itself was being addedto the behavior_cooldowns list
rather than the behavior itself
## Why It's Good For The Game
fixes hard deletes
## Changelog
🆑
/🆑
* [no gbp] actually fixes bot access (#82809)
## About The Pull Request
real fix to bots having AA. also i forgot to address simple bots in my
previous attempt so this fixes them too
## Why It's Good For The Game
fixes bots having AA
## Changelog
🆑
fix: all bots have their normal accesses restored
/🆑
* [no gbp] Adds silicon interaction flags (#82822)
## About The Pull Request
A few items with special silicon interactions did not have the proper
flags to permit their use at distance (airlocks for instance)
## Why It's Good For The Game
Fixes #82800
## Changelog
🆑
fix: Restored silicon alt-clicking capability
/🆑
* Monkey eyes fix and noticable organ display refactor; AI monkeys no longer catatonic (#82669)
## About The Pull Request
It turns out monkeys being catatonic got broken 2 years ago in a PR that
was meant to fix something else; also, it turns out monkeys are supposed
to have primal eyes when turned into humans, and that got broken too. I
fixed both of those things, and while I was at it I did a refactor to
make it easier to give noticable organs (or anything else that you'd
want correct pronoun and verb tenses) easier to implement.
1) AI controlled mobs now properly display their noticable organs when
appropriate
2) Added some macros and a helper proc for replacing appropriate
pronouns and verb tenses in text
3) The noticable organ HTML is no longer broken, so you can pass text
with spans into it, if you want the text to be pretty or big or whatever
4) Monkeys are no longer catatonic if they have an active AI controller;
this goes for any carbon actually but I think monkeys are the only one
with AI controllers at the moment
## Why It's Good For The Game
Fixes the logic for displaying organs on AI controller mobs (currently
monkeys)
Makes it easier to add these kind of organs for carbons, AI controlled
or not, in the future
Look! An actual use-case for split editor:

## Changelog
Humanized monkeys now have their primal eyes again; monkeys with active
AI are no longer catatonic.
🆑 Bisar
fix: AI controlled monkeys are no longer catatonic, and they have primal
eyes again when turned into humans.
spellcheck: Noticable organs now have more modular grammar, and their
current grammar is fixed.
refactor: Refactored the code for displaying the messages for noticable
organs.
config: Added a documented define of all our pronouns
/🆑
---------
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
* DNA Infusion Refactor: Separates DNA Infusion Behavior from DNA Infuser (#82829)
## About The Pull Request
- infuser entries global is now an assoc list type -> singleton. makes
it easier to pick specific entries as needed
- separated infusion behavior onto both movable level (for machine
occupants and things that can potentially be infused) and human level
(for the actual infusion into a human)
- [x] tested
## Why It's Good For The Game
Upcoming plans is to fix up maintenance sect's organ replacement system
that just so happens to work a lot like how infusions do with actual
infusion mechanics, and that requires this prerequisite. In general
outside of that vision I see a lot of potential in alternate infusion
sources, from wherever they may be.
## Changelog
no player side changes, this is a refactor
---------
Co-authored-by: Thunder12345 <Thunder12345@users.noreply.github.com>
Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
Co-authored-by: starrm4nn <139372157+starrm4nn@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Bm0n <92271472+Bm0n@users.noreply.github.com>
Co-authored-by: Yaroslav Nurkov <78199449+AnywayFarus@users.noreply.github.com>
Co-authored-by: Pink <sightld2@gmail.com>
Co-authored-by: Sadboysuss <96586172+Sadboysuss@users.noreply.github.com>
Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: Name <w4rd3nn@gmail.com>
Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
Co-authored-by: Singul0 <127663818+Singul0@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: Iajret <8430839+Iajret@users.noreply.github.com>
Co-authored-by: FlufflesTheDog <piecopresident@gmail.com>
Co-authored-by: Jordan Dominion <Cyberboss@users.noreply.github.com>
Co-authored-by: larentoun <31931237+larentoun@users.noreply.github.com>
Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: EvilDragonfiend <87972842+EvilDragonfiend@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: necromanceranne <40847847+necromanceranne@users.noreply.github.com>
Co-authored-by: EricZilla <81941674+EricZilla@users.noreply.github.com>
Co-authored-by: Helg2 <93882977+Helg2@users.noreply.github.com>
Co-authored-by: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com>
Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: uaioy <114047053+uaioy@users.noreply.github.com>
Co-authored-by: Nick <42454181+Momo8289@users.noreply.github.com>
Co-authored-by: Joshua Kidder <49173900+Metekillot@users.noreply.github.com>
Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
1071 lines
51 KiB
Plaintext
1071 lines
51 KiB
Plaintext
#define FAKE_GREENSHIFT_FORM_CHANCE 15
|
|
#define FAKE_REPORT_CHANCE 8
|
|
#define PULSAR_REPORT_CHANCE 8
|
|
#define REPORT_NEG_DIVERGENCE -15
|
|
#define REPORT_POS_DIVERGENCE 15
|
|
|
|
// Are HIGH_IMPACT_RULESETs allowed to stack?
|
|
GLOBAL_VAR_INIT(dynamic_no_stacking, TRUE)
|
|
// If enabled does not accept or execute any rulesets.
|
|
GLOBAL_VAR_INIT(dynamic_forced_extended, FALSE)
|
|
// How high threat is required for HIGH_IMPACT_RULESETs stacking.
|
|
// This is independent of dynamic_no_stacking.
|
|
GLOBAL_VAR_INIT(dynamic_stacking_limit, 90)
|
|
// List of forced roundstart rulesets.
|
|
GLOBAL_LIST_EMPTY(dynamic_forced_roundstart_ruleset)
|
|
// Forced threat level, setting this to zero or higher forces the roundstart threat to the value.
|
|
GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1)
|
|
/// Modify the threat level for station traits before dynamic can be Initialized. List(instance = threat_reduction)
|
|
GLOBAL_LIST_EMPTY(dynamic_station_traits)
|
|
/// Rulesets which have been forcibly enabled or disabled
|
|
GLOBAL_LIST_EMPTY(dynamic_forced_rulesets)
|
|
|
|
SUBSYSTEM_DEF(dynamic)
|
|
name = "Dynamic"
|
|
flags = SS_NO_INIT
|
|
wait = 1 SECONDS
|
|
|
|
// Threat logging vars
|
|
/// The "threat cap", threat shouldn't normally go above this and is used in ruleset calculations
|
|
var/threat_level = 0
|
|
|
|
/// Set at the beginning of the round. Spent by the mode to "purchase" rules. Everything else goes in the postround budget.
|
|
var/round_start_budget = 0
|
|
|
|
/// Set at the beginning of the round. Spent by midrounds and latejoins.
|
|
var/mid_round_budget = 0
|
|
|
|
/// The initial round start budget for logging purposes, set once at the beginning of the round.
|
|
var/initial_round_start_budget = 0
|
|
|
|
/// Running information about the threat. Can store text or datum entries.
|
|
var/list/threat_log = list()
|
|
/// Threat log shown on the roundend report. Should only list player-made edits.
|
|
var/list/roundend_threat_log = list()
|
|
/// List of latejoin rules used for selecting the rules.
|
|
var/list/latejoin_rules
|
|
/// List of midround rules used for selecting the rules.
|
|
var/list/midround_rules
|
|
/** # Pop range per requirement.
|
|
* If the value is five the range is:
|
|
* 0-4, 5-9, 10-14, 15-19, 20-24, 25-29, 30-34, 35-39, 40-54, 45+
|
|
* If it is six the range is:
|
|
* 0-5, 6-11, 12-17, 18-23, 24-29, 30-35, 36-41, 42-47, 48-53, 54+
|
|
* If it is seven the range is:
|
|
* 0-6, 7-13, 14-20, 21-27, 28-34, 35-41, 42-48, 49-55, 56-62, 63+
|
|
*/
|
|
var/pop_per_requirement = 6
|
|
/// Number of players who were ready on roundstart.
|
|
var/roundstart_pop_ready = 0
|
|
/// List of candidates used on roundstart rulesets.
|
|
var/list/candidates = list()
|
|
/// Rules that are processed, rule_process is called on the rules in this list.
|
|
var/list/current_rules = list()
|
|
/// List of executed rulesets.
|
|
var/list/executed_rules = list()
|
|
/// If TRUE, the next player to latejoin will guarantee roll for a random latejoin antag
|
|
/// (this does not guarantee they get said antag roll, depending on preferences and circumstances)
|
|
var/forced_injection = FALSE
|
|
/// Forced ruleset to be executed for the next latejoin.
|
|
var/datum/dynamic_ruleset/latejoin/forced_latejoin_rule = null
|
|
/// How many percent of the rounds are more peaceful.
|
|
var/peaceful_percentage = 50
|
|
/// If a high impact ruleset was executed. Only one will run at a time in most circumstances.
|
|
var/high_impact_ruleset_executed = FALSE
|
|
/// If a only ruleset has been executed.
|
|
var/only_ruleset_executed = FALSE
|
|
/// Dynamic configuration, loaded on pre_setup
|
|
var/list/configuration = null
|
|
|
|
/// When world.time is over this number the mode tries to inject a latejoin ruleset.
|
|
var/latejoin_injection_cooldown = 0
|
|
|
|
/// The minimum time the recurring latejoin ruleset timer is allowed to be.
|
|
var/latejoin_delay_min = (5 MINUTES)
|
|
|
|
/// The maximum time the recurring latejoin ruleset timer is allowed to be.
|
|
var/latejoin_delay_max = (25 MINUTES)
|
|
|
|
/// The low bound for the midround roll time splits.
|
|
/// This number influences where to place midround rolls, making this smaller
|
|
/// will make midround rolls more frequent, and vice versa.
|
|
/// A midround will never be able to roll before this.
|
|
var/midround_lower_bound = 10 MINUTES
|
|
|
|
/// The upper bound for the midround roll time splits.
|
|
/// This number influences where to place midround rolls, making this larger
|
|
/// will make midround rolls less frequent, and vice versa.
|
|
/// A midround will never be able to roll farther than this.
|
|
var/midround_upper_bound = 100 MINUTES
|
|
|
|
/// The distance between the chosen midround roll point (which is deterministic),
|
|
/// and when it can actually roll.
|
|
/// Basically, if this is set to 5 minutes, and a midround roll point is decided to be at 20 minutes,
|
|
/// then it can roll anywhere between 15 and 25 minutes.
|
|
var/midround_roll_distance = 3 MINUTES
|
|
|
|
/// The amount of threat per midround roll.
|
|
/// Basically, if this is set to 5, then for every 5 threat, one midround roll will be added.
|
|
/// The equation this is used in rounds up, meaning that if this is set to 5, and you have 6
|
|
/// threat, then you will get 2 midround rolls.
|
|
var/threat_per_midround_roll = 7
|
|
|
|
/// A number between -5 and +5.
|
|
/// A negative value will give a more peaceful round and
|
|
/// a positive value will give a round with higher threat.
|
|
var/threat_curve_centre = 0
|
|
|
|
/// A number between 0.5 and 4.
|
|
/// Higher value will favour extreme rounds and
|
|
/// lower value rounds closer to the average.
|
|
var/threat_curve_width = 1.8
|
|
|
|
/// A number between -5 and +5.
|
|
/// Equivalent to threat_curve_centre, but for the budget split.
|
|
/// A negative value will weigh towards midround rulesets, and a positive
|
|
/// value will weight towards roundstart ones.
|
|
var/roundstart_split_curve_centre = 1
|
|
|
|
/// A number between 0.5 and 4.
|
|
/// Equivalent to threat_curve_width, but for the budget split.
|
|
/// Higher value will favour more variance in splits and
|
|
/// lower value rounds closer to the average.
|
|
var/roundstart_split_curve_width = 1.8
|
|
|
|
/// The minimum amount of time for antag random events to be hijacked.
|
|
var/random_event_hijack_minimum = 10 MINUTES
|
|
|
|
/// The maximum amount of time for antag random events to be hijacked.
|
|
var/random_event_hijack_maximum = 18 MINUTES
|
|
|
|
/// What is the lower bound of when the roundstart annoucement is sent out?
|
|
var/waittime_l = 600
|
|
|
|
/// What is the higher bound of when the roundstart annoucement is sent out?
|
|
var/waittime_h = 1800
|
|
|
|
/// A number between 0 and 100. The maximum amount of threat allowed to generate.
|
|
var/max_threat_level = 100
|
|
|
|
/// The extra chance multiplier that a heavy impact midround ruleset will run next time.
|
|
/// For example, if this is set to 50, then the next heavy roll will be about 50% more likely to happen.
|
|
var/hijacked_random_event_injection_chance_modifier = 50
|
|
|
|
/// Any midround before this point is guaranteed to be light
|
|
var/midround_light_upper_bound = 25 MINUTES
|
|
|
|
/// Any midround after this point is guaranteed to be heavy
|
|
var/midround_heavy_lower_bound = 55 MINUTES
|
|
|
|
/// If there are less than this many players readied, threat level will be lowered.
|
|
/// This number should be kept fairly low, as there are other measures that population
|
|
/// impacts Dynamic, such as the requirements variable on rulesets.
|
|
var/low_pop_player_threshold = 20
|
|
|
|
/// The maximum threat that can roll with *zero* players.
|
|
/// As the number of players approaches `low_pop_player_threshold`, the maximum
|
|
/// threat level will increase.
|
|
/// For example, if `low_pop_maximum_threat` is 50, `low_pop_player_threshold` is 20,
|
|
/// and the number of readied players is 10, then the highest threat that can roll is
|
|
/// lerp(50, 100, 10 / 20), AKA 75.
|
|
var/low_pop_maximum_threat = 40
|
|
|
|
/// The chance for latejoins to roll when ready
|
|
var/latejoin_roll_chance = 50
|
|
|
|
// == EVERYTHING BELOW THIS POINT SHOULD NOT BE CONFIGURED ==
|
|
|
|
/// A list of recorded "snapshots" of the round, stored in the dynamic.json log
|
|
var/list/datum/dynamic_snapshot/snapshots
|
|
|
|
/// The time when the last midround injection was attempted, whether or not it was successful
|
|
var/last_midround_injection_attempt = 0
|
|
|
|
/// Whether or not a random event has been hijacked this midround cycle
|
|
var/random_event_hijacked = HIJACKED_NOTHING
|
|
|
|
/// The timer ID for the cancellable midround rule injection
|
|
var/midround_injection_timer_id
|
|
|
|
/// The last drafted midround rulesets (without the current one included).
|
|
/// Used for choosing different midround injections.
|
|
var/list/current_midround_rulesets
|
|
|
|
/// The amount of threat shown on the piece of paper.
|
|
/// Can differ from the actual threat amount.
|
|
var/shown_threat
|
|
|
|
VAR_PRIVATE/next_midround_injection
|
|
|
|
/datum/controller/subsystem/dynamic/proc/admin_panel()
|
|
var/list/dat = list("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><title>Game Mode Panel</title></head><body><h1><B>Game Mode Panel</B></h1>")
|
|
dat += "Dynamic Mode <a href='?_src_=vars;[HrefToken()];Vars=[REF(src)]'>\[VV\]</a> <a href='?src=[text_ref(src)];[HrefToken()]'>\[Refresh\]</a><BR>"
|
|
dat += "Threat Level: <b>[threat_level]</b><br/>"
|
|
dat += "Budgets (Roundstart/Midrounds): <b>[initial_round_start_budget]/[threat_level - initial_round_start_budget]</b><br/>"
|
|
|
|
dat += "Midround budget to spend: <b>[mid_round_budget]</b> <a href='?src=[text_ref(src)];[HrefToken()];adjustthreat=1'>\[Adjust\]</A> <a href='?src=[text_ref(src)];[HrefToken()];threatlog=1'>\[View Log\]</a><br/>"
|
|
dat += "<br/>"
|
|
dat += "Parameters: centre = [threat_curve_centre] ; width = [threat_curve_width].<br/>"
|
|
dat += "Split parameters: centre = [roundstart_split_curve_centre] ; width = [roundstart_split_curve_width].<br/>"
|
|
dat += "<i>On average, <b>[clamp(peaceful_percentage, 1, 99)]</b>% of the rounds are more peaceful.</i><br/>"
|
|
dat += "Forced extended: <a href='?src=[text_ref(src)];[HrefToken()];forced_extended=1'><b>[GLOB.dynamic_forced_extended ? "On" : "Off"]</b></a><br/>"
|
|
dat += "No stacking (only one round-ender): <a href='?src=[text_ref(src)];[HrefToken()];no_stacking=1'><b>[GLOB.dynamic_no_stacking ? "On" : "Off"]</b></a><br/>"
|
|
dat += "Stacking limit: [GLOB.dynamic_stacking_limit] <a href='?src=[text_ref(src)];[HrefToken()];stacking_limit=1'>\[Adjust\]</A>"
|
|
dat += "<br/>"
|
|
dat += "<A href='?src=[text_ref(src)];[HrefToken()];force_latejoin_rule=1'>\[Force Next Latejoin Ruleset\]</A><br>"
|
|
if (forced_latejoin_rule)
|
|
dat += {"<A href='?src=[text_ref(src)];[HrefToken()];clear_forced_latejoin=1'>-> [forced_latejoin_rule.name] <-</A><br>"}
|
|
dat += "<A href='?src=[text_ref(src)];[HrefToken()];force_midround_rule=1'>\[Execute Midround Ruleset\]</A><br>"
|
|
dat += "<br />"
|
|
dat += "Executed rulesets: "
|
|
if (executed_rules.len > 0)
|
|
dat += "<br/>"
|
|
for (var/datum/dynamic_ruleset/DR in executed_rules)
|
|
dat += "[DR.ruletype] - <b>[DR.name]</b><br>"
|
|
else
|
|
dat += "none.<br>"
|
|
dat += "<br>Injection Timers: (<b>[get_heavy_midround_injection_chance(dry_run = TRUE)]%</b> heavy midround chance)<BR>"
|
|
dat += "Latejoin: [DisplayTimeText(latejoin_injection_cooldown-world.time)] <a href='?src=[text_ref(src)];[HrefToken()];injectlate=1'>\[Now!\]</a><BR>"
|
|
|
|
var/next_injection = next_midround_injection()
|
|
if (next_injection == INFINITY)
|
|
dat += "All midrounds have been exhausted."
|
|
else
|
|
dat += "Midround: [DisplayTimeText(next_injection - world.time)] <a href='?src=[text_ref(src)];[HrefToken()];injectmid=1'>\[Now!\]</a><BR>"
|
|
|
|
usr << browse(dat.Join(), "window=gamemode_panel;size=500x500")
|
|
|
|
/datum/controller/subsystem/dynamic/Topic(href, href_list)
|
|
if (..()) // Sanity, maybe ?
|
|
return
|
|
if(!check_rights(R_ADMIN))
|
|
message_admins("[usr.key] has attempted to override the game mode panel!")
|
|
log_admin("[key_name(usr)] tried to use the game mode panel without authorization.")
|
|
return
|
|
if (href_list["forced_extended"])
|
|
GLOB.dynamic_forced_extended = !GLOB.dynamic_forced_extended
|
|
else if (href_list["no_stacking"])
|
|
GLOB.dynamic_no_stacking = !GLOB.dynamic_no_stacking
|
|
else if (href_list["adjustthreat"])
|
|
var/threatadd = input("Specify how much threat to add (negative to subtract). This can inflate the threat level.", "Adjust Threat", 0) as null|num
|
|
if(!threatadd)
|
|
return
|
|
if(threatadd > 0)
|
|
create_threat(threatadd, threat_log, "[worldtime2text()]: increased by [key_name(usr)]")
|
|
else
|
|
spend_midround_budget(-threatadd, threat_log, "[worldtime2text()]: decreased by [key_name(usr)]")
|
|
else if (href_list["injectlate"])
|
|
latejoin_injection_cooldown = 0
|
|
forced_injection = TRUE
|
|
message_admins("[key_name(usr)] forced a latejoin injection.")
|
|
else if (href_list["injectmid"])
|
|
forced_injection = TRUE
|
|
message_admins("[key_name(usr)] forced a midround injection.")
|
|
try_midround_roll()
|
|
else if (href_list["threatlog"])
|
|
show_threatlog(usr)
|
|
else if (href_list["stacking_limit"])
|
|
GLOB.dynamic_stacking_limit = input(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null) as num
|
|
else if(href_list["force_latejoin_rule"])
|
|
var/added_rule = input(usr,"What ruleset do you want to force upon the next latejoiner? This will bypass threat level and population restrictions.", "Rigging Latejoin", null) as null|anything in sort_names(init_rulesets(/datum/dynamic_ruleset/latejoin))
|
|
if (!added_rule)
|
|
return
|
|
forced_latejoin_rule = added_rule
|
|
log_admin("[key_name(usr)] set [added_rule] to proc on the next latejoin.")
|
|
message_admins("[key_name(usr)] set [added_rule] to proc on the next valid latejoin.")
|
|
else if(href_list["clear_forced_latejoin"])
|
|
forced_latejoin_rule = null
|
|
log_admin("[key_name(usr)] cleared the forced latejoin ruleset.")
|
|
message_admins("[key_name(usr)] cleared the forced latejoin ruleset.")
|
|
else if(href_list["force_midround_rule"])
|
|
var/added_rule = input(usr,"What ruleset do you want to force right now? This will bypass threat level and population restrictions.", "Execute Ruleset", null) as null|anything in sort_names(init_rulesets(/datum/dynamic_ruleset/midround))
|
|
if (!added_rule)
|
|
return
|
|
log_admin("[key_name(usr)] executed the [added_rule] ruleset.")
|
|
message_admins("[key_name(usr)] executed the [added_rule] ruleset.")
|
|
picking_specific_rule(added_rule, TRUE)
|
|
else if(href_list["cancelmidround"])
|
|
admin_cancel_midround(usr, href_list["cancelmidround"])
|
|
return
|
|
else if (href_list["differentmidround"])
|
|
admin_different_midround(usr, href_list["differentmidround"])
|
|
return
|
|
|
|
admin_panel() // Refreshes the window
|
|
|
|
// Set result and news report here
|
|
/datum/controller/subsystem/dynamic/proc/set_round_result()
|
|
// If it got to this part, just pick one high impact ruleset if it exists
|
|
for(var/datum/dynamic_ruleset/rule in executed_rules)
|
|
if(rule.flags & HIGH_IMPACT_RULESET)
|
|
rule.round_result()
|
|
// One was set, so we're done here
|
|
if(SSticker.news_report)
|
|
return
|
|
|
|
SSticker.mode_result = "undefined"
|
|
|
|
// Something nuked the station - it wasn't nuke ops (they set their own via their rulset)
|
|
if(GLOB.station_was_nuked)
|
|
SSticker.news_report = STATION_NUKED
|
|
|
|
if(SSsupermatter_cascade.cascade_initiated)
|
|
SSticker.news_report = SUPERMATTER_CASCADE
|
|
|
|
// Only show this one if we have nothing better to show
|
|
if(EMERGENCY_ESCAPED_OR_ENDGAMED && !SSticker.news_report)
|
|
SSticker.news_report = SSshuttle.emergency?.is_hijacked() ? SHUTTLE_HIJACK : STATION_EVACUATED
|
|
|
|
/datum/controller/subsystem/dynamic/proc/send_intercept()
|
|
if(DScommunications.block_command_report) //If we don't want the report to be printed just yet, we put it off until it's ready
|
|
addtimer(CALLBACK(src, PROC_REF(send_intercept)), 10 SECONDS)
|
|
return
|
|
|
|
. = "<b><i>Nanotrasen Department of Intelligence Threat Advisory, Spinward Sector, TCD [time2text(world.realtime, "DDD, MMM DD")], [CURRENT_STATION_YEAR]:</i></b><hr>"
|
|
. += generate_advisory_level()
|
|
|
|
var/min_threat = 100
|
|
for(var/datum/dynamic_ruleset/ruleset as anything in init_rulesets(/datum/dynamic_ruleset))
|
|
if(ruleset.weight <= 0 || ruleset.cost <= 0)
|
|
continue
|
|
min_threat = min(ruleset.cost, min_threat)
|
|
|
|
var/greenshift = GLOB.dynamic_forced_extended || (threat_level < min_threat && shown_threat < min_threat) //if both shown and real threat are below any ruleset, its extended time
|
|
SSstation.generate_station_goals(greenshift ? INFINITY : CONFIG_GET(number/station_goal_budget))
|
|
|
|
var/list/datum/station_goal/goals = SSstation.get_station_goals()
|
|
if(length(goals))
|
|
var/list/texts = list("<hr><b>Special Orders for [station_name()]:</b><br>")
|
|
for(var/datum/station_goal/station_goal as anything in goals)
|
|
station_goal.on_report()
|
|
texts += station_goal.get_report()
|
|
. += texts.Join("<hr>")
|
|
|
|
var/list/trait_list_strings = list()
|
|
for(var/datum/station_trait/station_trait as anything in SSstation.station_traits)
|
|
if(!station_trait.show_in_report)
|
|
continue
|
|
trait_list_strings += "[station_trait.get_report()]<BR>"
|
|
if(trait_list_strings.len > 0)
|
|
. += "<hr><b>Identified shift divergencies:</b><BR>" + trait_list_strings.Join()
|
|
|
|
if(length(DScommunications.command_report_footnotes))
|
|
var/footnote_pile = ""
|
|
|
|
for(var/datum/command_footnote/footnote in DScommunications.command_report_footnotes)
|
|
footnote_pile += "[footnote.message]<BR>"
|
|
footnote_pile += "<i>[footnote.signature]</i><BR>"
|
|
footnote_pile += "<BR>"
|
|
|
|
. += "<hr><b>Additional Notes: </b><BR><BR>" + footnote_pile
|
|
|
|
#ifndef MAP_TEST
|
|
print_command_report(., "[command_name()] Status Summary", announce=FALSE)
|
|
if(greenshift)
|
|
priority_announce("Thanks to the tireless efforts of our security and intelligence divisions, there are currently no credible threats to [station_name()]. All station construction projects have been authorized. Have a secure shift!", "Security Report", SSstation.announcer.get_rand_report_sound(), color_override = "green")
|
|
else
|
|
if(SSsecurity_level.get_current_level_as_number() < SEC_LEVEL_BLUE)
|
|
SSsecurity_level.set_level(SEC_LEVEL_BLUE, announce = FALSE)
|
|
priority_announce("[SSsecurity_level.current_security_level.elevating_to_announcement]\n\nA summary has been copied and printed to all communications consoles.", "Security level elevated.", ANNOUNCER_INTERCEPT, color_override = SSsecurity_level.current_security_level.announcement_color)
|
|
#endif
|
|
|
|
return .
|
|
|
|
/// Generate the advisory level depending on the shown threat level.
|
|
/datum/controller/subsystem/dynamic/proc/generate_advisory_level()
|
|
var/advisory_string = ""
|
|
if (prob(PULSAR_REPORT_CHANCE))
|
|
if(HAS_TRAIT(SSstation, STATION_TRAIT_BANANIUM_SHIPMENTS))
|
|
advisory_string += "Advisory Level: <b>Clown Planet</b></center><BR>"
|
|
advisory_string += "Your sector's advisory level is Clown Planet! Our bike horns have picked up on a large bananium stash. Clowns show a large influx of clowns on your station. We highly advise you to slip any threats to keep Honkotrasen assets within the Banana Sector. The Department of Intelligence advises defending chemistry from any clowns that are trying to make baldium or space lube."
|
|
return advisory_string
|
|
|
|
advisory_string += "Advisory Level: <b>Pulsar Star</b></center><BR>"
|
|
advisory_string += "Your sector's advisory level is Pulsar Star. A large, unknown electromagnetic field has stormed through nearby surveillance equipment, causing major data loss. Partial data was recovered and showed no credible threats to Nanotrasen assets within the Spinward Sector; however, the Department of Intelligence advises maintaining high alert against potential threats due to the lack of complete data."
|
|
return advisory_string
|
|
|
|
switch(round(shown_threat))
|
|
if(0)
|
|
advisory_string += "Advisory Level: <b>White Dwarf</b></center><BR>"
|
|
advisory_string += "Your sector's advisory level is White Dwarf. Our surveillance has ruled out any and all potential threats known in our database, eliminating most risks to our assets in the Spinward Sector. We advise a lower level of security, alongside distributing resources on potential profit."
|
|
if(1 to 19)
|
|
var/show_core_territory = (GLOB.current_living_antags.len > 0)
|
|
if (prob(FAKE_GREENSHIFT_FORM_CHANCE))
|
|
show_core_territory = !show_core_territory
|
|
|
|
if (show_core_territory)
|
|
advisory_string += "Advisory Level: <b>Blue Star</b></center><BR>"
|
|
advisory_string += "Your sector's advisory level is Blue Star. At this threat advisory, the risk of attacks on Nanotrasen assets within the sector is minor but cannot be ruled out entirely. Remain vigilant."
|
|
else
|
|
advisory_string += "Advisory Level: <b>Green Star</b></center><BR>"
|
|
advisory_string += "Your sector's advisory level is Green Star. Surveillance information shows no credible threats to Nanotrasen assets within the Spinward Sector at this time. As always, the Department of Intelligence advises maintaining vigilance against potential threats, regardless of a lack of known threats."
|
|
if(20 to 39)
|
|
advisory_string += "Advisory Level: <b>Yellow Star</b></center><BR>"
|
|
advisory_string += "Your sector's advisory level is Yellow Star. Surveillance shows a credible risk of enemy attack against our assets in the Spinward Sector. We advise a heightened level of security alongside maintaining vigilance against potential threats."
|
|
if(40 to 65)
|
|
advisory_string += "Advisory Level: <b>Orange Star</b></center><BR>"
|
|
advisory_string += "Your sector's advisory level is Orange Star. Upon reviewing your sector's intelligence, the Department has determined that the risk of enemy activity is moderate to severe. At this advisory, we recommend maintaining a higher degree of security and reviewing red alert protocols with command and the crew."
|
|
if(66 to 79)
|
|
advisory_string += "Advisory Level: <b>Red Star</b></center><BR>"
|
|
advisory_string += "Your sector's advisory level is Red Star. The Department of Intelligence has decrypted Cybersun communications suggesting a high likelihood of attacks on Nanotrasen assets within the Spinward Sector. Stations in the region are advised to remain highly vigilant for signs of enemy activity and to be on high alert."
|
|
if(80 to 99)
|
|
advisory_string += "Advisory Level: <b>Black Orbit</b></center><BR>"
|
|
advisory_string += "Your sector's advisory level is Black Orbit. Your sector's local communications network is currently undergoing a blackout, and we are therefore unable to accurately judge enemy movements within the region. However, information passed to us by GDI suggests a high amount of enemy activity in the sector, indicative of an impending attack. Remain on high alert and vigilant against any other potential threats."
|
|
if(100)
|
|
advisory_string += "Advisory Level: <b>Midnight Sun</b></center><BR>"
|
|
advisory_string += "Your sector's advisory level is Midnight Sun. Credible information passed to us by GDI suggests that the Syndicate is preparing to mount a major concerted offensive on Nanotrasen assets in the Spinward Sector to cripple our foothold there. All stations should remain on high alert and prepared to defend themselves."
|
|
|
|
return advisory_string
|
|
|
|
/datum/controller/subsystem/dynamic/proc/show_threatlog(mob/admin)
|
|
if(!SSticker.HasRoundStarted())
|
|
tgui_alert(usr, "The round hasn't started yet!")
|
|
return
|
|
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
var/list/out = list("<TITLE>Threat Log</TITLE><B><font size='3'>Threat Log</font></B><br><B>Starting Threat:</B> [threat_level]<BR>")
|
|
|
|
for(var/entry in threat_log)
|
|
if(istext(entry))
|
|
out += "[entry]<BR>"
|
|
|
|
out += "<B>Remaining threat/threat_level:</B> [mid_round_budget]/[threat_level]"
|
|
|
|
usr << browse(out.Join(), "window=threatlog;size=700x500")
|
|
|
|
/// Generates the threat level using lorentz distribution and assigns peaceful_percentage.
|
|
/datum/controller/subsystem/dynamic/proc/generate_threat()
|
|
// At lower pop levels we run a Liner Interpolation against the max threat based proportionally on the number
|
|
// of players ready. This creates a balanced lorentz curve within a smaller range than 0 to max_threat_level.
|
|
var/calculated_max_threat = (SSticker.totalPlayersReady < low_pop_player_threshold) ? LERP(low_pop_maximum_threat, max_threat_level, SSticker.totalPlayersReady / low_pop_player_threshold) : max_threat_level
|
|
log_dynamic("Calculated maximum threat level based on player count of [SSticker.totalPlayersReady]: [calculated_max_threat]")
|
|
|
|
threat_level = lorentz_to_amount(threat_curve_centre, threat_curve_width, calculated_max_threat)
|
|
|
|
for(var/datum/station_trait/station_trait in GLOB.dynamic_station_traits)
|
|
threat_level = max(threat_level - GLOB.dynamic_station_traits[station_trait], 0)
|
|
log_dynamic("Threat reduced by [GLOB.dynamic_station_traits[station_trait]]. Source: [type].")
|
|
|
|
peaceful_percentage = (threat_level/max_threat_level)*100
|
|
|
|
/// Generates the midround and roundstart budgets
|
|
/datum/controller/subsystem/dynamic/proc/generate_budgets()
|
|
round_start_budget = lorentz_to_amount(roundstart_split_curve_centre, roundstart_split_curve_width, threat_level, 0.1)
|
|
initial_round_start_budget = round_start_budget
|
|
mid_round_budget = threat_level - round_start_budget
|
|
|
|
/datum/controller/subsystem/dynamic/proc/setup_parameters()
|
|
log_dynamic("Dynamic mode parameters for the round:")
|
|
log_dynamic("Centre is [threat_curve_centre], Width is [threat_curve_width], Forced extended is [GLOB.dynamic_forced_extended ? "Enabled" : "Disabled"], No stacking is [GLOB.dynamic_no_stacking ? "Enabled" : "Disabled"].")
|
|
log_dynamic("Stacking limit is [GLOB.dynamic_stacking_limit].")
|
|
if(GLOB.dynamic_forced_threat_level >= 0)
|
|
threat_level = round(GLOB.dynamic_forced_threat_level, 0.1)
|
|
else
|
|
generate_threat()
|
|
generate_budgets()
|
|
set_cooldowns()
|
|
log_dynamic("Dynamic Mode initialized with a Threat Level of... [threat_level]! ([round_start_budget] round start budget)")
|
|
SSblackbox.record_feedback(
|
|
"associative",
|
|
"dynamic_threat",
|
|
1,
|
|
list(
|
|
"server_name" = CONFIG_GET(string/serversqlname),
|
|
"forced_threat_level" = GLOB.dynamic_forced_threat_level,
|
|
"threat_level" = threat_level,
|
|
"max_threat" = (SSticker.totalPlayersReady < low_pop_player_threshold) ? LERP(low_pop_maximum_threat, max_threat_level, SSticker.totalPlayersReady / low_pop_player_threshold) : max_threat_level,
|
|
"player_count" = SSticker.totalPlayersReady,
|
|
"round_start_budget" = round_start_budget,
|
|
"parameters" = list(
|
|
"threat_curve_centre" = threat_curve_centre,
|
|
"threat_curve_width" = threat_curve_width,
|
|
"forced_extended" = GLOB.dynamic_forced_extended,
|
|
"no_stacking" = GLOB.dynamic_no_stacking,
|
|
"stacking_limit" = GLOB.dynamic_stacking_limit,
|
|
),
|
|
),
|
|
)
|
|
return TRUE
|
|
|
|
/datum/controller/subsystem/dynamic/proc/setup_shown_threat()
|
|
if (prob(FAKE_REPORT_CHANCE))
|
|
shown_threat = rand(1, 100)
|
|
else
|
|
shown_threat = clamp(threat_level + rand(REPORT_NEG_DIVERGENCE, REPORT_POS_DIVERGENCE), 0, 100)
|
|
|
|
/datum/controller/subsystem/dynamic/proc/set_cooldowns()
|
|
var/latejoin_injection_cooldown_middle = 0.5*(latejoin_delay_max + latejoin_delay_min)
|
|
latejoin_injection_cooldown = round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), latejoin_delay_min, latejoin_delay_max)) + world.time
|
|
|
|
// Called BEFORE everyone is equipped with their job
|
|
/datum/controller/subsystem/dynamic/proc/pre_setup()
|
|
if(CONFIG_GET(flag/dynamic_config_enabled))
|
|
var/json_file = file("[global.config.directory]/dynamic.json")
|
|
if(fexists(json_file))
|
|
configuration = json_decode(file2text(json_file))
|
|
if(configuration["Dynamic"])
|
|
for(var/variable in configuration["Dynamic"])
|
|
if(!(variable in vars))
|
|
stack_trace("Invalid dynamic configuration variable [variable] in game mode variable changes.")
|
|
continue
|
|
vars[variable] = configuration["Dynamic"][variable]
|
|
|
|
configure_station_trait_costs()
|
|
setup_parameters()
|
|
setup_hijacking()
|
|
setup_shown_threat()
|
|
setup_rulesets()
|
|
|
|
//We do this here instead of with the midround rulesets and such because these rules can hang refs
|
|
//To new_player and such, and we want the datums to just free when the roundstart work is done
|
|
var/list/roundstart_rules = init_rulesets(/datum/dynamic_ruleset/roundstart)
|
|
|
|
SSjob.DivideOccupations(pure = TRUE, allow_all = TRUE)
|
|
for(var/i in GLOB.new_player_list)
|
|
var/mob/dead/new_player/player = i
|
|
if(player.ready == PLAYER_READY_TO_PLAY && player.mind && player.check_preferences())
|
|
if(is_unassigned_job(player.mind.assigned_role))
|
|
var/list/job_data = list()
|
|
var/job_prefs = player.client.prefs.job_preferences
|
|
for(var/job in job_prefs)
|
|
var/priority = job_prefs[job]
|
|
job_data += "[job]: [SSjob.job_priority_level_to_string(priority)]"
|
|
to_chat(player, span_danger("You were unable to qualify for any roundstart antagonist role this round because your job preferences presented a high chance of all of your selected jobs being unavailable, along with 'return to lobby if job is unavailable' enabled. Increase the number of roles set to medium or low priority to reduce the chances of this happening."))
|
|
log_admin("[player.ckey] failed to qualify for any roundstart antagonist role because their job preferences presented a high chance of all of their selected jobs being unavailable, along with 'return to lobby if job is unavailable' enabled and has [player.client.prefs.be_special.len] antag preferences enabled. They will be unable to qualify for any roundstart antagonist role. These are their job preferences - [job_data.Join(" | ")]")
|
|
else
|
|
roundstart_pop_ready++
|
|
candidates.Add(player)
|
|
SSjob.ResetOccupations()
|
|
log_dynamic("Listing [roundstart_rules.len] round start rulesets, and [candidates.len] players ready.")
|
|
if (candidates.len <= 0)
|
|
log_dynamic("[candidates.len] candidates.")
|
|
return TRUE
|
|
|
|
if(GLOB.dynamic_forced_roundstart_ruleset.len > 0)
|
|
rigged_roundstart()
|
|
else
|
|
roundstart(roundstart_rules)
|
|
|
|
log_dynamic("[round_start_budget] round start budget was left, donating it to midrounds.")
|
|
threat_log += "[worldtime2text()]: [round_start_budget] round start budget was left, donating it to midrounds."
|
|
mid_round_budget += round_start_budget
|
|
|
|
var/starting_rulesets = ""
|
|
for (var/datum/dynamic_ruleset/roundstart/DR in executed_rules)
|
|
starting_rulesets += "[DR.name], "
|
|
log_dynamic("Picked the following roundstart rules: [starting_rulesets]")
|
|
candidates.Cut()
|
|
return TRUE
|
|
|
|
// Called AFTER everyone is equipped with their job
|
|
/datum/controller/subsystem/dynamic/proc/post_setup(report)
|
|
for(var/datum/dynamic_ruleset/roundstart/rule in executed_rules)
|
|
rule.candidates.Cut() // The rule should not use candidates at this point as they all are null.
|
|
addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/controller/subsystem/dynamic/, execute_roundstart_rule), rule), rule.delay)
|
|
|
|
if (!CONFIG_GET(flag/no_intercept_report))
|
|
addtimer(CALLBACK(src, PROC_REF(send_intercept)), rand(waittime_l, waittime_h))
|
|
//SKYRAT EDIT START - DIVERGENCY/GOALS REPORT
|
|
else
|
|
addtimer(CALLBACK(src, PROC_REF(send_trait_report)), rand(waittime_l, waittime_h))
|
|
//SKYRAT EDIT END
|
|
addtimer(CALLBACK(src, PROC_REF(display_roundstart_logout_report)), ROUNDSTART_LOGOUT_REPORT_TIME)
|
|
|
|
if(CONFIG_GET(flag/reopen_roundstart_suicide_roles))
|
|
var/delay = CONFIG_GET(number/reopen_roundstart_suicide_roles_delay)
|
|
if(delay)
|
|
delay *= (1 SECONDS)
|
|
else
|
|
delay = (4 MINUTES) //default to 4 minutes if the delay isn't defined.
|
|
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(reopen_roundstart_suicide_roles)), delay)
|
|
|
|
if(SSdbcore.Connect())
|
|
var/list/to_set = list()
|
|
var/arguments = list()
|
|
if(GLOB.revdata.originmastercommit)
|
|
to_set += "commit_hash = :commit_hash"
|
|
arguments["commit_hash"] = GLOB.revdata.originmastercommit
|
|
if(to_set.len)
|
|
arguments["round_id"] = GLOB.round_id
|
|
var/datum/db_query/query_round_game_mode = SSdbcore.NewQuery(
|
|
"UPDATE [format_table_name("round")] SET [to_set.Join(", ")] WHERE id = :round_id",
|
|
arguments
|
|
)
|
|
query_round_game_mode.Execute()
|
|
qdel(query_round_game_mode)
|
|
return TRUE
|
|
|
|
/datum/controller/subsystem/dynamic/proc/display_roundstart_logout_report()
|
|
var/list/msg = list("[span_boldnotice("Roundstart logout report")]\n\n")
|
|
for(var/i in GLOB.mob_living_list)
|
|
var/mob/living/L = i
|
|
var/mob/living/carbon/C = L
|
|
if (istype(C) && !C.last_mind)
|
|
continue // never had a client
|
|
|
|
if(L.ckey && !GLOB.directory[L.ckey])
|
|
msg += "<b>[L.name]</b> ([L.key]), the [L.job] (<font color='#ffcc00'><b>Disconnected</b></font>)\n"
|
|
|
|
|
|
if(L.ckey && L.client)
|
|
var/failed = FALSE
|
|
if(L.client.inactivity >= ROUNDSTART_LOGOUT_AFK_THRESHOLD) //Connected, but inactive (alt+tabbed or something)
|
|
msg += "<b>[L.name]</b> ([L.key]), the [L.job] (<font color='#ffcc00'><b>Connected, Inactive</b></font>)\n"
|
|
failed = TRUE //AFK client
|
|
if(!failed && L.stat)
|
|
if(HAS_TRAIT(L, TRAIT_SUICIDED)) //Suicider
|
|
msg += "<b>[L.name]</b> ([L.key]), the [L.job] ([span_boldannounce("Suicide")])\n"
|
|
failed = TRUE //Disconnected client
|
|
if(!failed && (L.stat == UNCONSCIOUS || L.stat == HARD_CRIT))
|
|
msg += "<b>[L.name]</b> ([L.key]), the [L.job] (Dying)\n"
|
|
failed = TRUE //Unconscious
|
|
if(!failed && L.stat == DEAD)
|
|
msg += "<b>[L.name]</b> ([L.key]), the [L.job] (Dead)\n"
|
|
failed = TRUE //Dead
|
|
|
|
continue //Happy connected client
|
|
for(var/mob/dead/observer/D in GLOB.dead_mob_list)
|
|
if(D.mind && D.mind.current == L)
|
|
if(L.stat == DEAD)
|
|
if(HAS_TRAIT(L, TRAIT_SUICIDED)) //Suicider
|
|
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] ([span_boldannounce("Suicide")])\n"
|
|
continue //Disconnected client
|
|
else
|
|
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] (Dead)\n"
|
|
continue //Dead mob, ghost abandoned
|
|
else
|
|
if(D.can_reenter_corpse)
|
|
continue //Adminghost, or cult/wizard ghost
|
|
else
|
|
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] ([span_boldannounce("Ghosted")])\n"
|
|
continue //Ghosted while alive
|
|
|
|
var/concatenated_message = msg.Join()
|
|
log_admin(concatenated_message)
|
|
to_chat(GLOB.admins, concatenated_message)
|
|
|
|
|
|
/// Initializes the internal ruleset variables
|
|
/datum/controller/subsystem/dynamic/proc/setup_rulesets()
|
|
midround_rules = init_rulesets(/datum/dynamic_ruleset/midround)
|
|
latejoin_rules = init_rulesets(/datum/dynamic_ruleset/latejoin)
|
|
|
|
/// Returns a list of the provided rulesets.
|
|
/// Configures their variables to match config.
|
|
/datum/controller/subsystem/dynamic/proc/init_rulesets(ruleset_subtype)
|
|
var/list/rulesets = list()
|
|
|
|
for (var/datum/dynamic_ruleset/ruleset_type as anything in subtypesof(ruleset_subtype))
|
|
if (initial(ruleset_type.name) == "")
|
|
continue
|
|
|
|
if (initial(ruleset_type.weight) == 0)
|
|
continue
|
|
|
|
var/ruleset = new ruleset_type
|
|
configure_ruleset(ruleset)
|
|
rulesets += ruleset
|
|
|
|
return rulesets
|
|
|
|
/// A simple roundstart proc used when dynamic_forced_roundstart_ruleset has rules in it.
|
|
/datum/controller/subsystem/dynamic/proc/rigged_roundstart()
|
|
message_admins("[GLOB.dynamic_forced_roundstart_ruleset.len] rulesets being forced. Will now attempt to draft players for them.")
|
|
log_dynamic("[GLOB.dynamic_forced_roundstart_ruleset.len] rulesets being forced. Will now attempt to draft players for them.")
|
|
for (var/datum/dynamic_ruleset/roundstart/rule in GLOB.dynamic_forced_roundstart_ruleset)
|
|
configure_ruleset(rule)
|
|
message_admins("Drafting players for forced ruleset [rule.name].")
|
|
log_dynamic("Drafting players for forced ruleset [rule.name].")
|
|
rule.acceptable(roundstart_pop_ready, threat_level) // Assigns some vars in the modes, running it here for consistency
|
|
rule.candidates = candidates.Copy()
|
|
rule.trim_candidates()
|
|
rule.load_templates()
|
|
if (rule.ready(roundstart_pop_ready, TRUE))
|
|
var/cost = rule.cost
|
|
var/scaled_times = 0
|
|
if (rule.scaling_cost)
|
|
scaled_times = round(max(round_start_budget - cost, 0) / rule.scaling_cost)
|
|
cost += rule.scaling_cost * scaled_times
|
|
|
|
spend_roundstart_budget(picking_roundstart_rule(rule, scaled_times, forced = TRUE))
|
|
|
|
/datum/controller/subsystem/dynamic/proc/roundstart(list/roundstart_rules)
|
|
if (GLOB.dynamic_forced_extended)
|
|
log_dynamic("Starting a round of forced extended.")
|
|
return TRUE
|
|
var/list/drafted_rules = list()
|
|
for (var/datum/dynamic_ruleset/roundstart/rule in roundstart_rules)
|
|
if (!rule.weight)
|
|
continue
|
|
if (rule.acceptable(roundstart_pop_ready, threat_level) && round_start_budget >= rule.cost) // If we got the population and threat required
|
|
rule.candidates = candidates.Copy()
|
|
rule.trim_candidates()
|
|
rule.load_templates()
|
|
if (rule.ready(roundstart_pop_ready) && rule.candidates.len > 0)
|
|
drafted_rules[rule] = rule.weight
|
|
|
|
var/list/rulesets_picked = list()
|
|
|
|
// Kept in case a ruleset can't be initialized for whatever reason, we want to be able to only spend what we can use.
|
|
var/round_start_budget_left = round_start_budget
|
|
|
|
while (round_start_budget_left > 0)
|
|
var/datum/dynamic_ruleset/roundstart/ruleset = pick_weight(drafted_rules)
|
|
if (isnull(ruleset))
|
|
log_dynamic("No more rules can be applied, stopping with [round_start_budget] left.")
|
|
break
|
|
|
|
var/cost = (ruleset in rulesets_picked) ? ruleset.scaling_cost : ruleset.cost
|
|
if (cost == 0)
|
|
stack_trace("[ruleset] cost 0, this is going to result in an infinite loop.")
|
|
drafted_rules[ruleset] = null
|
|
continue
|
|
|
|
if (cost > round_start_budget_left)
|
|
drafted_rules[ruleset] = null
|
|
continue
|
|
|
|
if (check_blocking(ruleset.blocking_rules, rulesets_picked))
|
|
drafted_rules[ruleset] = null
|
|
continue
|
|
|
|
round_start_budget_left -= cost
|
|
|
|
rulesets_picked[ruleset] += 1
|
|
|
|
if (ruleset.flags & HIGH_IMPACT_RULESET)
|
|
for (var/_other_ruleset in drafted_rules)
|
|
var/datum/dynamic_ruleset/other_ruleset = _other_ruleset
|
|
if (other_ruleset.flags & HIGH_IMPACT_RULESET)
|
|
drafted_rules[other_ruleset] = null
|
|
|
|
if (ruleset.flags & LONE_RULESET)
|
|
drafted_rules[ruleset] = null
|
|
|
|
for (var/ruleset in rulesets_picked)
|
|
spend_roundstart_budget(picking_roundstart_rule(ruleset, rulesets_picked[ruleset] - 1))
|
|
|
|
update_log()
|
|
|
|
/// Initializes the round start ruleset provided to it. Returns how much threat to spend.
|
|
/datum/controller/subsystem/dynamic/proc/picking_roundstart_rule(datum/dynamic_ruleset/roundstart/ruleset, scaled_times = 0, forced = FALSE)
|
|
log_dynamic("Picked a ruleset: [ruleset.name], scaled [scaled_times] times")
|
|
|
|
ruleset.trim_candidates()
|
|
var/added_threat = ruleset.scale_up(roundstart_pop_ready, scaled_times)
|
|
|
|
if(ruleset.pre_execute(roundstart_pop_ready))
|
|
threat_log += "[worldtime2text()]: Roundstart [ruleset.name] spent [ruleset.cost + added_threat]. [ruleset.scaling_cost ? "Scaled up [ruleset.scaled_times]/[scaled_times] times." : ""]"
|
|
if(ruleset.flags & ONLY_RULESET)
|
|
only_ruleset_executed = TRUE
|
|
if(ruleset.flags & HIGH_IMPACT_RULESET)
|
|
high_impact_ruleset_executed = TRUE
|
|
executed_rules += ruleset
|
|
return ruleset.cost + added_threat
|
|
else
|
|
stack_trace("The starting rule \"[ruleset.name]\" failed to pre_execute.")
|
|
return 0
|
|
|
|
/// Mainly here to facilitate delayed rulesets. All roundstart rulesets are executed with a timered callback to this proc.
|
|
/datum/controller/subsystem/dynamic/proc/execute_roundstart_rule(sent_rule)
|
|
var/datum/dynamic_ruleset/rule = sent_rule
|
|
if(rule.execute())
|
|
if(rule.persistent)
|
|
current_rules += rule
|
|
new_snapshot(rule)
|
|
rule.forget_startup()
|
|
return TRUE
|
|
rule.clean_up() // Refund threat, delete teams and so on.
|
|
rule.forget_startup()
|
|
executed_rules -= rule
|
|
stack_trace("The starting rule \"[rule.name]\" failed to execute.")
|
|
return FALSE
|
|
|
|
/// An experimental proc to allow admins to call rules on the fly or have rules call other rules.
|
|
/datum/controller/subsystem/dynamic/proc/picking_specific_rule(ruletype, forced = FALSE, ignore_cost = FALSE)
|
|
var/datum/dynamic_ruleset/midround/new_rule
|
|
if(ispath(ruletype))
|
|
new_rule = new ruletype() // You should only use it to call midround rules though.
|
|
configure_ruleset(new_rule) // This makes sure the rule is set up properly.
|
|
else if(istype(ruletype, /datum/dynamic_ruleset))
|
|
new_rule = ruletype
|
|
else
|
|
return FALSE
|
|
|
|
if(!new_rule)
|
|
return FALSE
|
|
|
|
if(!forced)
|
|
if(only_ruleset_executed)
|
|
return FALSE
|
|
// Check if a blocking ruleset has been executed.
|
|
else if(check_blocking(new_rule.blocking_rules, executed_rules))
|
|
return FALSE
|
|
// Check if the ruleset is high impact and if a high impact ruleset has been executed
|
|
else if(new_rule.flags & HIGH_IMPACT_RULESET)
|
|
if(threat_level < GLOB.dynamic_stacking_limit && GLOB.dynamic_no_stacking)
|
|
if(high_impact_ruleset_executed)
|
|
return FALSE
|
|
|
|
var/population = GLOB.alive_player_list.len
|
|
if((new_rule.acceptable(population, threat_level) && (ignore_cost || new_rule.cost <= mid_round_budget)) || forced)
|
|
new_rule.trim_candidates()
|
|
new_rule.load_templates()
|
|
if (new_rule.ready(forced))
|
|
if (!ignore_cost)
|
|
spend_midround_budget(new_rule.cost, threat_log, "[worldtime2text()]: Forced rule [new_rule.name]")
|
|
new_rule.pre_execute(population)
|
|
if (new_rule.execute()) // This should never fail since ready() returned 1
|
|
if(new_rule.flags & HIGH_IMPACT_RULESET)
|
|
high_impact_ruleset_executed = TRUE
|
|
else if(new_rule.flags & ONLY_RULESET)
|
|
only_ruleset_executed = TRUE
|
|
log_dynamic("Making a call to a specific ruleset...[new_rule.name]!")
|
|
executed_rules += new_rule
|
|
if (new_rule.persistent)
|
|
current_rules += new_rule
|
|
new_rule.forget_startup()
|
|
return TRUE
|
|
else if (forced)
|
|
log_dynamic("The ruleset [new_rule.name] couldn't be executed due to lack of elligible players.")
|
|
new_rule.forget_startup()
|
|
return FALSE
|
|
|
|
/datum/controller/subsystem/dynamic/fire()
|
|
for (var/datum/dynamic_ruleset/rule in current_rules)
|
|
if(rule.rule_process() == RULESET_STOP_PROCESSING) // If rule_process() returns 1 (RULESET_STOP_PROCESSING), stop processing.
|
|
current_rules -= rule
|
|
|
|
try_midround_roll()
|
|
|
|
/// Removes type from the list
|
|
/datum/controller/subsystem/dynamic/proc/remove_from_list(list/type_list, type)
|
|
for(var/I in type_list)
|
|
if(istype(I, type))
|
|
type_list -= I
|
|
return type_list
|
|
|
|
/// Checks if a type in blocking_list is in rule_list.
|
|
/datum/controller/subsystem/dynamic/proc/check_blocking(list/blocking_list, list/rule_list)
|
|
if(blocking_list.len > 0)
|
|
for(var/blocking in blocking_list)
|
|
for(var/_executed in rule_list)
|
|
var/datum/executed = _executed
|
|
if(blocking == executed.type)
|
|
log_dynamic("FAIL: check_blocking - [blocking] conflicts with [executed.type]")
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/// Handles late-join antag assignments
|
|
/datum/controller/subsystem/dynamic/proc/make_antag_chance(mob/living/carbon/human/newPlayer)
|
|
if (GLOB.dynamic_forced_extended)
|
|
return
|
|
if(EMERGENCY_ESCAPED_OR_ENDGAMED) // No more rules after the shuttle has left
|
|
return
|
|
|
|
if (forced_latejoin_rule)
|
|
log_dynamic("Forcing specific [forced_latejoin_rule.ruletype] ruleset [forced_latejoin_rule].")
|
|
if(!handle_executing_latejoin(forced_latejoin_rule, newPlayer, forced = TRUE))
|
|
message_admins("The forced latejoin ruleset [forced_latejoin_rule.name] couldn't be executed \
|
|
as the most recent latejoin did not fulfill the ruleset's requirements.")
|
|
forced_latejoin_rule = null
|
|
return
|
|
|
|
if(!forced_injection)
|
|
if(latejoin_injection_cooldown >= world.time)
|
|
return
|
|
if(!prob(latejoin_roll_chance))
|
|
return
|
|
|
|
var/was_forced = forced_injection
|
|
forced_injection = FALSE
|
|
var/list/possible_latejoin_rules = list()
|
|
for (var/datum/dynamic_ruleset/latejoin/rule in latejoin_rules)
|
|
if(!rule.weight)
|
|
continue
|
|
if(mid_round_budget < rule.cost)
|
|
continue
|
|
if(!rule.acceptable(GLOB.alive_player_list.len, threat_level))
|
|
continue
|
|
possible_latejoin_rules[rule] = rule.get_weight()
|
|
|
|
if(!length(possible_latejoin_rules))
|
|
log_dynamic("FAIL: [newPlayer] was selected to roll for a latejoin ruleset, but there were no valid rulesets.")
|
|
return
|
|
|
|
log_dynamic("[newPlayer] was selected to roll for a latejoin ruleset from the following list: [english_list(possible_latejoin_rules)].")
|
|
// You get one shot at becoming a latejoin antag, if it fails the next guy will try.
|
|
var/datum/dynamic_ruleset/latejoin/picked_rule = pick_ruleset(possible_latejoin_rules, max_allowed_attempts = 1)
|
|
if(isnull(picked_rule))
|
|
log_dynamic("FAIL: No valid rulset was selected for [newPlayer]'s latejoin[was_forced ? "" : ", the next player will be checked instead"].")
|
|
return
|
|
if(was_forced)
|
|
log_dynamic("Forcing random [picked_rule.ruletype] ruleset [picked_rule].")
|
|
handle_executing_latejoin(picked_rule, newPlayer, forced = was_forced)
|
|
|
|
/**
|
|
* This proc handles the execution of a latejoin ruleset, including removing it from latejoin rulesets if not repeatable,
|
|
* upping the injection cooldown, and starting a timer to execute the ruleset on delay.
|
|
*/
|
|
/datum/controller/subsystem/dynamic/proc/handle_executing_latejoin(datum/dynamic_ruleset/ruleset, mob/living/carbon/human/only_candidate, forced = FALSE)
|
|
ruleset.candidates = list(only_candidate)
|
|
ruleset.trim_candidates()
|
|
ruleset.load_templates()
|
|
if (!ruleset.ready(forced))
|
|
log_dynamic("FAIL: [only_candidate] was selected to latejoin with the [ruleset] ruleset, \
|
|
but the ruleset failed to execute[length(ruleset.candidates) ? "":" as they were not a valid candiate"].")
|
|
return FALSE
|
|
if (!ruleset.repeatable)
|
|
latejoin_rules = remove_from_list(latejoin_rules, ruleset.type)
|
|
addtimer(CALLBACK(src, PROC_REF(execute_midround_latejoin_rule), ruleset), ruleset.delay)
|
|
|
|
if(!forced)
|
|
var/latejoin_injection_cooldown_middle = 0.5 * (latejoin_delay_max + latejoin_delay_min)
|
|
latejoin_injection_cooldown = round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), latejoin_delay_min, latejoin_delay_max)) + world.time
|
|
log_dynamic("A latejoin rulset triggered successfully, the next latejoin injection will happen at [latejoin_injection_cooldown] round time.")
|
|
|
|
return TRUE
|
|
|
|
/// Apply configurations to rule.
|
|
/datum/controller/subsystem/dynamic/proc/configure_ruleset(datum/dynamic_ruleset/ruleset)
|
|
var/rule_conf = LAZYACCESSASSOC(configuration, ruleset.ruletype, ruleset.name)
|
|
for(var/variable in rule_conf)
|
|
if(!(variable in ruleset.vars))
|
|
stack_trace("Invalid dynamic configuration variable [variable] in [ruleset.ruletype] [ruleset.name].")
|
|
continue
|
|
ruleset.vars[variable] = rule_conf[variable]
|
|
ruleset.restricted_roles |= SSstation.antag_restricted_roles
|
|
if(length(ruleset.protected_roles)) //if we care to protect any role, we should protect station trait roles too
|
|
ruleset.protected_roles |= SSstation.antag_protected_roles
|
|
if(CONFIG_GET(flag/protect_roles_from_antagonist))
|
|
ruleset.restricted_roles |= ruleset.protected_roles
|
|
if(CONFIG_GET(flag/protect_assistant_from_antagonist))
|
|
ruleset.restricted_roles |= JOB_ASSISTANT
|
|
// SKYRAT EDIT ADDITION
|
|
for(var/datum/job/iterating_job as anything in subtypesof(/datum/job))
|
|
if(!initial(iterating_job.antagonist_restricted))
|
|
continue
|
|
if(initial(iterating_job.restricted_antagonists))
|
|
var/list/restricted_antagonists = initial(iterating_job.restricted_antagonists)
|
|
if(!(ruleset.antag_flag in restricted_antagonists))
|
|
continue
|
|
ruleset.restricted_roles |= initial(iterating_job.title)
|
|
else
|
|
ruleset.restricted_roles |= initial(iterating_job.title)
|
|
// SKYRAT EDIT END
|
|
|
|
/// Get station traits and call for their config
|
|
/datum/controller/subsystem/dynamic/proc/configure_station_trait_costs()
|
|
if(!CONFIG_GET(flag/dynamic_config_enabled))
|
|
return
|
|
for(var/datum/station_trait/station_trait as anything in GLOB.dynamic_station_traits)
|
|
configure_station_trait(station_trait)
|
|
|
|
/// Apply configuration for station trait costs
|
|
/datum/controller/subsystem/dynamic/proc/configure_station_trait(datum/station_trait/station_trait)
|
|
var/list/station_trait_config = LAZYACCESSASSOC(configuration, "Station", station_trait.dynamic_threat_id)
|
|
var/cost = station_trait_config["cost"]
|
|
|
|
if(isnull(cost)) //0 is valid so check for null specifically
|
|
return
|
|
|
|
if(cost != GLOB.dynamic_station_traits[station_trait])
|
|
log_dynamic("Config set [station_trait.dynamic_threat_id] cost from [station_trait.threat_reduction] to [cost]")
|
|
|
|
GLOB.dynamic_station_traits[station_trait] = cost
|
|
|
|
/// Refund threat, but no more than threat_level.
|
|
/datum/controller/subsystem/dynamic/proc/refund_threat(regain)
|
|
mid_round_budget = min(threat_level, mid_round_budget + regain)
|
|
|
|
/// Generate threat and increase the threat_level if it goes beyond, capped at 100
|
|
/datum/controller/subsystem/dynamic/proc/create_threat(gain, list/threat_log, reason)
|
|
mid_round_budget = min(100, mid_round_budget + gain)
|
|
if(mid_round_budget > threat_level)
|
|
threat_level = mid_round_budget
|
|
for(var/list/logs in threat_log)
|
|
log_threat(gain, logs, reason)
|
|
|
|
/datum/controller/subsystem/dynamic/proc/log_threat(threat_change, list/threat_log, reason)
|
|
var/gain_or_loss = "+"
|
|
if(threat_change < 0)
|
|
gain_or_loss = "-"
|
|
threat_log += "Threat [gain_or_loss][abs(threat_change)] - [reason]."
|
|
|
|
/// Expend round start threat, can't fall under 0.
|
|
/datum/controller/subsystem/dynamic/proc/spend_roundstart_budget(cost, list/threat_log, reason)
|
|
round_start_budget = max(round_start_budget - cost,0)
|
|
if (!isnull(threat_log))
|
|
log_threat(-cost, threat_log, reason)
|
|
|
|
/// Expend midround threat, can't fall under 0.
|
|
/datum/controller/subsystem/dynamic/proc/spend_midround_budget(cost, list/threat_log, reason)
|
|
mid_round_budget = max(mid_round_budget - cost,0)
|
|
if (!isnull(threat_log))
|
|
log_threat(-cost, threat_log, reason)
|
|
|
|
#define MAXIMUM_DYN_DISTANCE 5
|
|
|
|
/**
|
|
* Returns the comulative distribution of threat centre and width, and a random location of -0.5 to 0.5
|
|
* plus or minus the otherwise unattainable lower and upper percentiles. All multiplied by the maximum
|
|
* threat and then rounded to the nearest interval.
|
|
* rand() calls without arguments returns a value between 0 and 1, allowing for smaller intervals.
|
|
*/
|
|
/datum/controller/subsystem/dynamic/proc/lorentz_to_amount(centre = 0, scale = 1.8, max_threat = 100, interval = 1)
|
|
var/location = RANDOM_DECIMAL(-MAXIMUM_DYN_DISTANCE, MAXIMUM_DYN_DISTANCE) * rand()
|
|
var/lorentz_result = LORENTZ_CUMULATIVE_DISTRIBUTION(centre, location, scale)
|
|
var/std_threat = lorentz_result * max_threat
|
|
///Without these, the amount won't come close to hitting 0% or 100% of the max threat.
|
|
var/lower_deviation = max(std_threat * (location-centre)/MAXIMUM_DYN_DISTANCE, 0)
|
|
var/upper_deviation = max((max_threat - std_threat) * (centre-location)/MAXIMUM_DYN_DISTANCE, 0)
|
|
return clamp(round(std_threat + upper_deviation - lower_deviation, interval), 0, 100)
|
|
|
|
/proc/reopen_roundstart_suicide_roles()
|
|
var/include_command = CONFIG_GET(flag/reopen_roundstart_suicide_roles_command_positions)
|
|
var/list/reopened_jobs = list()
|
|
|
|
for(var/mob/living/quitter in GLOB.suicided_mob_list)
|
|
var/datum/job/job = SSjob.GetJob(quitter.job)
|
|
if(!job || !(job.job_flags & JOB_REOPEN_ON_ROUNDSTART_LOSS))
|
|
continue
|
|
if(!include_command && job.departments_bitflags & DEPARTMENT_BITFLAG_COMMAND)
|
|
continue
|
|
job.current_positions = max(job.current_positions - 1, 0)
|
|
reopened_jobs += quitter.job
|
|
|
|
if(CONFIG_GET(flag/reopen_roundstart_suicide_roles_command_report))
|
|
if(reopened_jobs.len)
|
|
var/reopened_job_report_positions
|
|
for(var/dead_dudes_job in reopened_jobs)
|
|
reopened_job_report_positions = "[reopened_job_report_positions ? "[reopened_job_report_positions]\n":""][dead_dudes_job]"
|
|
|
|
var/suicide_command_report = {"
|
|
<font size = 3><b>[command_name()] Human Resources Board</b><br>
|
|
Notice of Personnel Change</font><hr>
|
|
To personnel management staff aboard [station_name()]:<br><br>
|
|
Our medical staff have detected a series of anomalies in the vital sensors
|
|
of some of the staff aboard your station.<br><br>
|
|
Further investigation into the situation on our end resulted in us discovering
|
|
a series of rather... unforturnate decisions that were made on the part of said staff.<br><br>
|
|
As such, we have taken the liberty to automatically reopen employment opportunities for the positions of the crew members
|
|
who have decided not to partake in our research. We will be forwarding their cases to our employment review board
|
|
to determine their eligibility for continued service with the company (and of course the
|
|
continued storage of cloning records within the central medical backup server.)<br><br>
|
|
<i>The following positions have been reopened on our behalf:<br><br>
|
|
[reopened_job_report_positions]</i>
|
|
"}
|
|
|
|
print_command_report(suicide_command_report, "Central Command Personnel Update")
|
|
|
|
|
|
#undef MAXIMUM_DYN_DISTANCE
|
|
|
|
#undef FAKE_REPORT_CHANCE
|
|
#undef FAKE_GREENSHIFT_FORM_CHANCE
|
|
#undef PULSAR_REPORT_CHANCE
|
|
#undef REPORT_NEG_DIVERGENCE
|
|
#undef REPORT_POS_DIVERGENCE
|