Commit Graph

2842 Commits

Author SHA1 Message Date
MrMelbert
d1cadb24f9 Vote clean up and admin additions (#82981)
## About The Pull Request

- Fixes `vote_delay` not being a thing. I broke this two years ago but
there's no bug report associated.

- Admins can now reset the vote delay (to let people vote again
instantly)

- Admins can now end the current vote immediately (rather than
cancelling)

- Custom multi and custom single combined into one vote

## Why It's Good For The Game

Makes voting a bit easier to use, both for admins and for coders adding
new votes.


![image](https://github.com/tgstation/tgstation/assets/51863163/40b8857c-76b7-4a58-82bc-1b82640d550a)

## Changelog

🆑 Melbert
admin: Custom Single and Custom Multi votes are now combined into one
vote
admin: Admins can now end votes instantly, rather than cancelling them
admin: Admins can now reset the vote cooldown
fix: Vote cooldown actually applies now
/🆑
2024-05-01 16:55:01 -06:00
Watermelon914
24bc322fa6 Fixed the ipintel subsystem not initializing (#82936)
## About The Pull Request
Subsystem had the SS_INIT_NO_NEED inside of its subsystem flags. This is
not a flag and has a value of 3, which includes the SS_NO_INIT and
SS_NO_FIRE flags, which stopped it from initializing.
The subsystem has things it needs to do in init, so I've replaced this
flag with SS_OK_TO_FAIL_INIT so that it can pass unit tests, but still
be okay to fail.

## Why It's Good For The Game
Fixes the ipintel subsystem not working.

## Changelog
🆑
fix: Fixed the ipintel subsystem not working.
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2024-05-01 19:53:38 +02:00
Mothblocks
bc4e7d3b4e Remove data systems in favor of global datums (#82943) 2024-04-29 22:47:36 -07:00
13spacemen
74b4715d6e fix roleless poll ignores not working (#82911)
Fixes https://github.com/tgstation/tgstation/issues/82890

In some cases an alert poll had no role, like the monkey helmet, and
because of that it skipped the eligibility check
## Changelog
🆑
fix: All alert polls ignore option works
/🆑
2024-04-28 20:21:15 +02:00
John Willard
b59ae8fb9d Fixes pAIs permanently blocking requests (#82900)
## About The Pull Request

Removes pAI subsystem/card's reliance on clients and makes them
unstoppable, which didn't really make much sense for it to be this way
in the first place since it's something that has to always happen and is
something that isn't client-controlled.

Also removed case of ``usr`` use in ui act.

## Why It's Good For The Game

Closes https://github.com/tgstation/tgstation/issues/70401

## Changelog

🆑
fix: pAI requests should no longer randomly permanently break in a
round.
/🆑
2024-04-27 18:44:28 -06:00
MrMelbert
03a93f09a8 Fix malf AI being unable to trigger because AIs are considered ghost roles (#82893)
## About The Pull Request

Fix #82891 

PR #82030 added this job flag check to dynamic candidate trimming


cd29b123ef/code/controllers/subsystem/dynamic/dynamic_rulesets_midround.dm (L77-L79)

Problem: AIs do not have `JOB_CREW_MEMBER`!

This meant that all AI mobs were trimmed out of the candidate list for
midround malf, so no it always failed

This PR fixes this by flipping `restrict_ghost_roles` to `FALSE` for
midround malf and then tightening up some of the checks to ensure off
station AIs don't roll malf.

## Changelog

🆑 Melbert
fix: Midround malf can roll again
/🆑
2024-04-26 21:50:26 -06:00
Zephyr
cbcf5a7108 ip intel mk2 (#82683)
Do not merge this without coordinating with your server's host.

## About The Pull Request

Slightly refactors the way we handle IP intel.
You can still use the old data stored in the database.
Adds the ability to automatically reject connections determined by
config flags.

## Why It's Good For The Game

We used to have IP intel to check for VPNs, although it was disabled due
to being bad and unhelpful.
This refactor should make it much more manageable for hosts and admins.

## HOSTS BEWARE
This adds a new SQL table `ipintel_whitelist`
Look at the schema!

## Changelog

🆑
admin: The return of IPIntel
/🆑

---------

Co-authored-by: MrStonedOne <kyleshome@gmail.com>
Co-authored-by: oranges <email@oranges.net.nz>
2024-04-26 14:52:54 +12:00
EvilDragonfiend
0cb9aa842a Accessing Datasystem Manager from MC controller panel (#82848) 2024-04-24 12:03:59 -06:00
Jeremiah
c1a775efe1 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
2024-04-22 21:27:15 -06:00
Ben10Omintrix
f01035fb27 ai controllers use cell trackers to know when to idle (#82691)
## About The Pull Request
this makes ai controllers use cell trackers and signals to determine
when to idle

## Why It's Good For The Game
might be better than looping over all clients for every controller

## Changelog
🆑
code: The way mobs idle has been refactored, please report any issues
with non-reactive mobs
/🆑
2024-04-16 23:31:28 -06:00
MrMelbert
af2144f2dd Small optimization for Aura Healing (#82674)
## About The Pull Request

- Makes use of the byond internal optimization for `view` to speed up
aura healing a tiny bit.
- In case you didn't know, byond has an optimization for `view` which
speeds up iterating over objects in view if you provide it a type. This
use of a ternary (likely) prevented this optimization from kicking in,
and since worst-case we're doing view(7) it can add up.
- Test case: 2 staff of Ascelpius users surrounded by 15 humans and 15
random objects constant being damaged. ~8 minutes of testing.

   - Profile:
```
/datum/component/aura_healing/proc/heal_old   0.789        6.590        6.596        0.000         4076
/datum/component/aura_healing/proc/heal_new   0.682        6.443        6.442        0.000         4081
```

- Generalizes `SSaura_healing` to `SSaura`, makes "damage aura"
component (which is totally 99% copied from "healing aura" but that's
for another pr) use it as well

## Changelog

🆑 Melbert
refactor: Staff of Healing should perform slightly better. 
/🆑
2024-04-16 17:27:45 -06:00
LemonInTheDark
c514facd5f Removes redundant update_parallax_contents calls (#82644)
## About The Pull Request

Off shuttle move doesn't need to happen because shuttles use abstract
move which calls it anyway
Similar story for the ghost stuff, this was actually causing pretty
common double calls so we may actually get somethin out of this Oh and
something in air which is past me knifing me in the back
2024-04-14 17:33:36 -06:00
Jeremiah
d554ab7766 RPG Loot: Revisited & READY (#82533)
## About The Pull Request
Revival of #72881

A new alt click window with a tarkov-y loading spinner. Replaces the
object item window in stat panel.

## Videos
<details>
<summary>vids</summary>

toggleable grouping:

![syAA5zf6RK](https://github.com/tgstation/tgstation/assets/42397676/c89b372d-29f6-4ebe-895d-f73bbdc41c19)

now lists the floor as first obj:

![abc](https://github.com/tgstation/tgstation/assets/42397676/cd8dc962-2ac7-41bf-a5d3-b9e926116b06)

in action:

![dreamseeker_IkrPKt2QZt](https://github.com/tgstation/tgstation/assets/42397676/1f990aa0-60f0-47e7-9d93-b63e35d05273)

</details>

## features:
- search by name
- 515 image generator is much faster than alt click menu
- opening a gargantuan amount of items shouldnt freeze your screen
- groups similar items together in stacks by default, toggleable
- shows tile as first item
- <kbd>Shift</kbd> and <kbd>Ctrl</kbd> compatible with LMB
🖱️
- RMB points points at items (sry i could not get MMB working)
- key <kbd>Esc</kbd> to exit the window.


For devs:
- A new image generation tech.
- An error refetch mechanic to the Image component
- It does not "smart track" the items being added to the pile, just
reopen or refresh. This was a design decision.

## Why It's Good For The Game
Honestly I just dislike the stat panel

Fixes #53824

Fixes 

![image](https://github.com/tgstation/tgstation/assets/42397676/0e50faab-7d4d-4bf7-8c5b-4ac28547bfbd)

## Changelog
🆑
add: Added a loot window for alt-clicking tiles.
del: Removed the item browser from the stat panel.
/🆑

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2024-04-14 17:35:03 -04:00
Zephyr
7f8752be14 Admin Verb Datums MkIII | Now with functional command bar (#82511) 2024-04-12 12:27:09 -07:00
Iamgoofball
e0d335b442 Fixes AI lag by re-adding idle mode to all AI that was lost with the simple mob to basic mob conversion. (#82539) 2024-04-12 12:24:50 -07:00
John Willard
1530f361c0 Removes unused code for HTML UIs (#82589)
## About The Pull Request

This is the final PR for https://hackmd.io/XLt5MoRvRxuhFbwtk4VAUA that
I've been slowly inching towards the past few months.

This removes ``updateDialog``, ``updateUsrDialog``, ``IN_USE``,
``INTERACT_MACHINE_SET_MACHINE``, and everything surrounding it. Also
fixes advanced camera consoles not booting you off when you're moved out
of reach.

We called ``check_eye`` on mob life whenever they had their machine var
set, but their machine var would never be set to anything that actually
used it, which I found to be a little funny but was also probably my
fault.

## Why It's Good For The Game

This is poor and unmaintained code used for HTML UIs that we no longer
need thanks to TGUI, we should get rid of it to encourage the use of
TGUI in the future instead.

## Changelog


🆑
fix: Advanced camera consoles now boots you off when you're moved out of
reach.
/🆑
2024-04-11 20:52:51 -06:00
Horatio22
29f645ca63 Rephrases advisory level descriptions (#82585)
## About The Pull Request

Some of the station alert descriptions contained grammatical errors.
This PR corrects some word choice, punctuation, and grammar mistakes as
well as editing some sections for clarity. For example, Pulsar Star's
current warning

> "Your sector's advisory level is Pulsar Star. A large unknown
electromagnetic field has stormed through nearby surveillance equipment.
No surveillance data has been able to be obtained showing no credible
threats to Nanotrasen assets within the Spinward Sector. The Department
advises maintaining high alert against potential threats, regardless of
a lack of information."

has been changed to 
     

> "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."

## Why It's Good For The Game

Readability is important

## Changelog
🆑
spellcheck: grammar fixes in the roundstart advisory warnings
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2024-04-11 20:52:34 -06:00
san7890
c403a6eccc Wraps lowertext() to ensure proper stringification. (#82442)
## About The Pull Request

Fixes #82440

This PR just creates a new macro, `LOWER_TEXT()` (yes the irony is not
lost on me) to wrap around all calls of `lowertext()` and ensure that
whatever we input into that proc will be stringified using the `"[]"`
(or `tostring()` for the nerds) operator. very simple.

I also added a linter to enforce this (and prevent all forms of
regression) because I think that machines should do the menial work and
we shouldn't expect maintainers to remember this, let me know if you
disagree. if there is a time when it should be opted out for some
reason, the linter does respect it if you wrap your input with the
`UNLINT()` function.
2024-04-10 12:19:43 -07:00
Thunder12345
920f2c6442 Explosions Part I - Directional Explosions (#82429)
## About The Pull Request

Adds the ability for explosions to be directional. This is achieved by
adding an angle check to `prepare_explosion_turfs()` to drop any turfs
outside the cone of the explosion. If the arc covers a full 360 degrees,
as is the default, it will accept all the turfs without performing the
angle check.

Uses this functionality to rework both rocket launcher backblast and X4
explosions. Rocket launcher backblast has been changed from a shotgun of
indendiary bullets to a directional explosion of similar length. X4 now
uses a directional explosion to "ensure user safety".

Apparently the old method of moving the explosion one tile away didn't
even work, as it blew up `target` before trying to check its density for
the directional behaviour.

https://youtu.be/Mzdt7d7Le2Y

## Why It's Good For The Game

Directional explosions - Useful functionality for a range of potential
use cases, which can be implemented with minimal extra processing cost
(Worst case scenario being very large directional explosions)

Backblast - Looks way cooler than a bunch of projectiles, and should be
significantly more functional in high-lag situations where projectile
code tends to get fucky

X4 - More predictable for players wanting to use it as a breaching
charge, you can actually stand near the charge and not have to worry
about being hoist upon your own petard.

## Changelog
🆑
add: Added support for directional explosions.
add: Rocket launcher backblast is now 271% more explosive, check your
six for friendlies!
add: X4 charges now explode in a cone away from the user when placed on
a sufficiently solid object.
fix: X4 charges will now behave correctly when placed on dense atoms
(note: don't try to read a variable from an atom you just blew up)
/🆑
2024-04-09 20:26:08 +02:00
John Willard
5e9ce5ab99 New Battle Arcade (#81810)
## About The Pull Request

Remakes Battle Arcade from just about the ground up, with exceptions
taken for emagged stuff since I didn't really want to touch its
behavior.

The Battle Arcade now has stages that players can go through, unlocking
a stage by beating 2 enemies and the boss of the previous one, but this
must all be done in a row. You can choose to take a break between each
battle and there's a good chance you'll sleep just fine but there's also
a chance it can go wrong either through an ambush or robbery.

The Inn lets you restore everything for 15 gold and you can buy a sword
and armor, each level you unlock is a new sword and armor pair you can
buy that's better than the last, it's 30 gold each but scales up as you
progress through levels. They are really worth getting so it's best to
try to not lose your money early in.

The battle system is nearly the same as how it was before but I removed
the poor combo system that plagued the old arcade as one big knowledge
lock, now it's more just turn based. The game is built on permadeath so
dying means you restart from the beginning, but if you are going to lose
you can try to escape instead which costs you half of your gold.

Getting to higher levels increases the difficulty of enemies but also
increases the gaming exp rewards which could make this a better way to
get exp if you can get good at it.

Gaming EXP is used to increase chances of counterattacking but doesn't
give any extra health to the player.

I also removed the exploit of being able to screwdriver arcade cabinets
because people would do that if they thought they were on the verge of
losing to bypass the effects of loss. I instead replaced it with a new
interaction that the Curator's display case key can be used to reset
arcade cabinets (there's several keys on the chain so it made sense to
me), which I added solely because I thought Curators would be the type
of person to have run an actual arcade.

This is some gameplay

https://github.com/tgstation/tgstation/assets/53777086/499083f5-75cc-43b5-b457-017a012beede

As a misc sidenote, I also split up the arcade file just like how Orion
Trail was before, just for neat code organization.
The Inn keeper is straight up just a photo of my localhost dude, he's
not a player reference or anything it's not my actual character.
I also have no idea how well balanced this is cause I suck at it lol.

## Why It's Good For The Game

Battle Arcade is one of 3 last machines in my hackmd here to turn into
TGUI https://hackmd.io/XLt5MoRvRxuhFbwtk4VAUA?view
I've always thought the current version of battle arcade is quite lame
and lacks any progression, like Orion Trail I thought that since I was
moving this to TGUI, it would also be a perfect opportunity to revamp it
and try to improve on where it failed before, especially since the
alternative (NTOS Arcade) is also lame as hell and is even lamer than
HTML battle arcade (spam mana, then spam health, then just spam attack,
rinse and repeat).
This will hopefully be more entertaining and give players sense that
they are getting through a series of tasks rather than doing one same
one again and again.

## Changelog

🆑 JohnFulpWillard, Zeek the Rat
add: Battle Arcade has been completely overhauled in a new progression
system, this time using TGUI.
add: The Curator's keys can now reset arcade cabinets.
balance: You now need to be literate to play arcade games, except for
Mediborg's Amputation Adventure.
fix: You can no longer screwdriver emagged arcade consoles. Accept your
fate.
fix: Silicons can no longer play Mediborg's Amputation Adventure.
/🆑

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
2024-04-08 23:24:27 +00:00
Jacquerel
f47733d0e3 Final Objective: Battle Royale (#82258)
## About The Pull Request

Adds a new final objective option with a classic premise; the forced
battle to the death.
The concept is that the Syndicate will provide you with an implanter
tool you can use on an arbitrary number of crew members. Once you have
at least 6 (though there is no ceiling) you can activate the implants to
start the Battle Royale and broadcast the perspectives of everyone you
implanted live to the entertainment monitor.

After activation these implants cause you to explode upon death. If at
the end of 10 minutes, more than one person remains unexploded then all
of the remaining implants will detonate simultaneously.
Additionally, one of the station's departments (Medbay, Cargo, Science,
or Engineering) will be chosen as the arena. If after 5 minutes pass
you're not within that department (or if you leave it after that time
has passed) then you will be killed.

The Syndicate plan on both using the recorded footage to study
Nanotrasen technology, and also to sell it as an underground blood
sport, and so have employed a pirate broadcasting station to provide
colour commentary.

The implantation is silent, however it requires you and your target to
be adjacent and stood still for one and a half seconds.
Once implanted, it will occasionally itch and eventually signal to the
implantee that something is up, so once you start implanting someone
you're on a soft timer until you are given away. You can also implant
yourself if you want to do that for some reason.

Removing an implant from someone has a 70% chance of setting it off
instantly, but it _is_ possible. If the implant is exposed to EMP, this
value is randomised between 0 and 100%. You could also try doing surgery
while the patient is wearing a bomb suit or something, that puzzle is
for you to solve and I'm not going to tell you the answers. I'm sure
you'll think of ones I haven't.

## Why It's Good For The Game

Adds a somewhat more down-to-earth but still hopefully exciting and
threatening option which should let people mess around with the sandbox.
The mutual death element provides some roleplaying prompts; nothing
actually _forces_ you to fight apart from fear of death and it may be
possible to find other ways to survive, or perform some kind of
solidarity behaviour with your fellow contestants. Maybe you'll try that
but one of your fellow contestants just wants to be the last survivor
anyway. Maybe you'll pretend you're setting up some kind of mutual
survivorship thing in order to make sure you're the sole survivor.
Gives some people to watch on the bar TV channel.
The crew apparently love playing Deathmatch while dead so we might as
well enable doing it while alive.

Also I'm going to follow this up with a separate PR to remove the Space
Dragon objective and it felt like it'd be a good idea to do one out one
in

## Changelog

🆑
add: Adds a new Final Objective where you force your fellow crew to
fight to the death on pain of... death.
/🆑
2024-04-07 16:37:40 -07:00
Jeremiah
9723b4b317 Replaces even more deciseconds with SECONDS (#82438)
## About The Pull Request
Using these search regexes:

Ending in 0:
`addtimer\((.*),\s?(\d{1,3})0\b\)`
replacement:
`addtimer($1, $2 SECONDS)`

Two digit ending in odd:
`addtimer\((.*), (\d)([1-9])\)$`
replacement:
`addtimer($1, $2.$3 SECONDS)`

Single digit ending odd:
`addtimer\((.*), ([1-9])\)$`
replacement:
`addtimer($1, 0.$2 SECONDS)`

## Why It's Good For The Game
Code readability

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2024-04-06 15:18:49 -06:00
John Willard
a15a1b88ed Basic mobs now use z-level turnoff instead of simple (#82469)
## About The Pull Request

On one compile of MetaStation, I saw that there's 45 basic mobs on the
station, 256 on lavaland (the number growing from tendrils), and 59 in
all other z levels combined.

While we do expect Lavaland to be visited every round, at least it won't
be running during the times when no one is there, but even more
importantly, space exploration is something not done every round, so we
don't have any reason to waste our resources on AIs that will never be
interacted with.

Simple animals had an easy solution to this:
If no one is on the Z level, their AI turns off
If someone is on the Z level, they are idle unless needed.

The last simple animals that exists right now are bots, megafauna,
geese, gondolas, and some minor ones like mimic, zombie, dark wizard,
soulscythe, etc.
Point is, we're very much nearly done going through all simple animals,
so this code is being wasted just to ensure things like cleanbots won't
work if no one is on the z level, something I doubt happens often, so I
took their code and made it work for basic mobs instead. I could've done
both but I thought it would look very bad, and maybe this is a good
incentivize to get more basic mob conversions.

There's one major change here and it's that we're missing the "Idle"
mode, some basic mobs like the Lavaland village seems to be made with
intent that they'll be running even if players aren't around, so this
sets up a future PR that makes idle AI easier to add, and I want to make
sure those cases are taken into account.

## Why It's Good For The Game

We don't need to always be processing these basic mobs, and sets us in
the future to hopefully also implement idle AIs.

## Changelog

🆑
balance: Basic mob AIs with no mobs on the Z level now stop.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2024-04-06 15:17:53 -06:00
SyncIt21
c4adbf877e Clamps material market quantities & prices during cargo operations (#82338)
## About The Pull Request
- Fixes #82329

Cargo operations means buying & selling materials on the market. Now
both their prices & quantities are clamped during these operations

Also increased the width of materials market UI so large numbers don't
overflow to the next line.

## Changelog
🆑
fix: buying & selling huge quantities of materials on the market won't
cause their prices & quantities to go beyond bounds.
/🆑
2024-04-02 19:38:59 +02:00
san7890
0bb6a27955 Give Error Messages On Subsystem Initialization Failure CI (#82139)
## About The Pull Request

Noticed during #82138

Basically, the unit test that makes sure that all of the subsystems that
had to initialize properly initialized is good with the Notice
annotation, but it had a flaw - it didn't tell you _why_ the subsystem
failed to initialize:


![image](https://github.com/tgstation/tgstation/assets/34697715/3cd719d2-2f1f-42a9-8c36-d5c37b8a330c)

Basically this PR just adds a variable, `initialization_failure_message`
(i have it on good authority that variables that don't get changed from
their compile time variable don't take up extra memory), and we just
append the failure message to this notice should it occur so all of the
information is available in one spot, rather than have the coder dig
through the CI Run Log to figure out what the specific error was should
it occur on something that isn't SSlua.

also small cute code cleanup :3
2024-04-02 05:32:46 -04:00
Kyle Spier-Swenson
8628cbc54e Refactored admin backup saving. No longer at round end, more data backed up (#81891)
Admin verified connections now cache all verified connections for all
admins. (Rather then just the last connection data of the currently
connected admins)

Sync with the db now happens at admin load time, not at round end. (this
was causing annoyances because servers with long rounds could override
the admin db with old/stale data overwritting the fresher data that was
written by a server with a shorter round)

Fix backup verification not working if the db thinks it still connected
but its not actually still connected.

@Mothblocks @Jordie0608

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
2024-04-02 05:50:12 +00:00
Ghom
95b7fa1fb7 Add a unit test to check that maploaded simple/basic mobs are in an environment they can survive in. (#82180)
## About The Pull Request
I've recently noticed that the maploaded penguins from the snowdin away
mission were dying from unsafe atmos/temperature. This sparked the idea
of making a (focus only) unit test that would prevent this sort of
issues from happening.

This PR also implements the usage of the `atmos_requirements` and
`body_temp_sensitive` elements for simple animals too, cutting down the
copypaste.

## Why It's Good For The Game
More unit tests to make sure things are done correctly.

## Changelog

🆑
fix: Made sure that mapped critters (i.e. penguins on the snow cabin
away mission) can survive in the environment they're spawned in.
/🆑
2024-03-27 16:01:56 -06:00
John Willard
762779f3f2 Adds a photobooth (#82105)
## About The Pull Request

Adds a photobooth machine to the HoP line which can be used to update
your security records photo.
It updates the records of the person's name, which means hiding your
identity and wearing an ID will let you change other people's photos. If
you aren't hiding your identity and are wearing someone else's ID, it
won't update at all because it will be unable to find your record.
There's 2 variants of this machine, one at the HoP line that's tied
behind Law Office access (so Lawyers have an extra thing they can help
out with if no one's available, but maybe it would be better behind
Library access since Curators are our "photographer" role?), and the
Security one that requires Security access.
The Security one has a special feature that it adds a height chart
behind the player.

![image](https://github.com/tgstation/tgstation/assets/53777086/c4eb0661-d752-4052-8006-2898af78c528)

This machine is used by either right-clicking on it or by pressing a
button, so the HoP can do it remotely from their line (except on Tram
where it's in the library), and after a few delays it'll update your
records automatically to how you look like.

Emagging the machine will remove its access restrictions but every time
it updates your photos it will spam camera flashing and blind you.

Sprites

Open

![image](https://github.com/tgstation/tgstation/assets/53777086/d5e97d84-46d8-40b5-995f-c0ef5c7f18ac)
Closed

![image](https://github.com/tgstation/tgstation/assets/53777086/520e88ed-4630-40d8-9039-4c6dd85a9872)
Security version on the left, has a red tint on it

![image](https://github.com/tgstation/tgstation/assets/53777086/ef71a092-8d1b-4776-bdb4-6718308967c7)

Video demonstration (old sprites):


https://github.com/tgstation/tgstation/assets/53777086/a2e59f08-2d58-4f5b-b081-e137c7606d35

## Why It's Good For The Game

Current security records has no way to change your photo ID, something
that was a feature before it was moved to TGUI. The only alternative is
to fully delete your record and make a new one with a photo and the same
name, but this shares a major issue with the HTML UI: You're immediately
sold out by the fact you have a background. No matter how well you try
to cover your tracks, any security officer looking at records will see
you are the only photo on the manifest that has a background and even a
camera in your hand, which makes it impossible to get away with it
unless security essentially takes pity on you.
This opens up the ability to fully mask yourself in records, finally.

This is also better even for non antagonists because you can now
properly update your photos to match what you look like in the event of
an appearance change or even just a job change, which makes it a benefit
for HoPs who likes to keep records as up-to-date as possible.

## Changelog

🆑 JohnFulpWillard, Twox
add: Added a new photobooth machine to the HoP's line.
fix: Things checking for access now checks your off hand, too.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-03-27 17:58:01 +13:00
Rhials
a066fd3be4 Adds dynamic blob/obsession to ghost popups, removes third rail popup, tweaks supply pod popup (#82234)
## About The Pull Request

Three changes to ghost orbit popups. Let's check them one-by-one.

First off -- The obsession awakening and blob host midrounds now have a
ghost popup when summoned via Dynamic. They already have them when
summoned by a random event roll, so this is mostly just bringing the two
different spawn methods in line with each other. None of the other
midround dynamic picks (autotraitor, revs, etc) have had this added,
because they're less focused on spectacle and require more mystery to
function properly.

Second -- The electrified railings on the tram no longer notify ghosts
every time someone gets shocked. Electrocute_act is called on anything
that passes by it, and the popup would be thrown regardless of whether
or not they've "fallen in the path of an oncoming tram" or not. Making
it check if the electrocute_act actually successfully stunned a player,
and that they're about to be hit, would probably require an unwieldy
rewrite to the behavior that I'd rather not resort to. I brought this
helper call into this world, and now I'm taking it out.

Lastly -- The supply pod random event can now be properly jumped to.
Originally, it would track the landing indicator, which would delete
almost immediately and leave an un-orbitable popup on your screen. Now
you jump to the landing zone, regardless of when you click the toast
popup.

This is really long PR body for such tiny changes please don't think
this is anything more than it actually is.
## Why It's Good For The Game

Minor improvements to some ghost orbit popups, because Observers are
players too!
## Changelog
🆑
qol: Dynamic midrounds "Obsession Awakening" and "Blob Host" now have
ghost orbit popups, so you can see them happening in real time.
qol: There is no longer a ghost orbit popup for players being shocked by
an electrified tram rail.
qol: The Stray Cargo orbit popup no longer has a half-second window to
orbit before it becomes useless.
/🆑
2024-03-26 20:03:06 -06:00
Pickle-Coding
c1f11f26ce Converts arbitrary energy units to the joule. Fixes conservation of energy issues relating to charging cells. (#81579)
## About The Pull Request
Removes all arbitrary energy and power units in the codebase. Everything
is replaced with the joule and watt, with 1 = 1 joule, or 1 watt if you
are going to multiply by time. This is a visible change, where all
arbitrary energy units you see in the game will get proper prefixed
units of energy.

With power cells being converted to the joule, charging one joule of a
power cell will require one joule of energy.

The grid will now store energy, instead of power. When an energy usage
is described as using the watt, a power to energy conversion based on
the relevant subsystem's timing (usually multiplying by seconds_per_tick
or applying power_to_energy()) is needed before adding or removing from
the grid. Power usages that are described as the watt is really anything
you would scale by time before applying the load. If it's described as a
joule, no time conversion is needed. Players will still read the grid as
power, having no visible change.

Machines that dynamically use power with the use_power() proc will
directly drain from the grid (and apc cell if there isn't enough)
instead of just tallying it up on the dynamic power usages for the area.
This should be more robust at conserving energy as the surplus is
updated on the go, preventing charging cells from nothing.

APCs no longer consume power for the dynamic power usage channels. APCs
will consume power for static power usages. Because static power usages
are added up without checking surplus, static power consumption will be
applied before any machine processes. This will give a more truthful
surplus for dynamic power consumers.

APCs will display how much power it is using for charging the cell. APC
cell charging applies power in its own channel, which gets added up to
the total. This will prevent invisible power usage you see when looking
at the power monitoring console.

After testing in MetaStation, I found roundstart power consumption to be
around 406kW after all APCs get fully charged. During the roundstart APC
charge rush, the power consumption can get as high as over 2MW (up to
25kW per roundstart APC charging) as long as there's that much
available.

Because of the absurd potential power consumption of charging APCs near
roundstart, I have changed how APCs decide to charge. APCs will now
charge only after all other machines have processed in the machines
processing subsystem. This will make sure APC charging won't disrupt
machines taking from the grid, and should stop APCs getting their power
drained due to others demanding too much power while charging. I have
removed the delays for APC charging too, so they start charging
immediately whenever there's excess power. It also stops them turning
red when a small amount of cell gets drained (airlocks opening and shit
during APC charge rush), as they immediately become fully charged
(unless too much energy got drained somehow) before changing icon.

Engineering SMES now start at 100% charge instead of 75%. I noticed
cells were draining earlier than usual after these changes, so I am
making them start maxed to try and combat that.

These changes will fix all conservation of energy issues relating to
charging powercells.
## Why It's Good For The Game
Closes #73438
Closes #75789
Closes #80634
Closes #82031

Makes it much easier to interface with the power system in the codebase.
It's more intuitive. Removes a bunch of conservation of energy issues,
making energy and power much more meaningful. It will help the
simulation remain immersive as players won't encounter energy
duplication so easily. Arbitrary energy units getting replaced with the
joule will also tell people more meaningful information when reading it.
APC charging will feel more snappy.
## Changelog
🆑
fix: Fixes conservation of energy issues relating to charging
powercells.
qol: APCs will display how much power they are using to charge their
cell. This is accounted for in the power monitoring console.
qol: All arbitrary power cell energy units you see are replaced with
prefixed joules.
balance: As a consequence of the conservation of energy issues getting
fixed, the power consumption for charging cells is now very significant.
balance: APCs only use surplus power from the grid after every machine
processes when charging, preventing APCs from causing others to
discharge while charging.
balance: Engineering SMES start at max charge to combat the increased
energy loss due to conservation of energy fixes.
/🆑

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-03-23 16:58:56 +01:00
Ghom
4a3942677a [NO GBP] Fix curators not getting a cut from patronized paintings in a better way (#82159)
## About The Pull Request
I'm giving all the credits of this PR to the creator of #82153. The
reason I'm making this PR is because, while the other fix work too, I
believe this one is perhaps better so that we won't have to call
`SSjob.GetJobType(jobtype)` everytime we want to access or make use of
the `bank_accounts_by_job` variable.

## Why It's Good For The Game
See title, also the other PR if you want a more indepth explaination of
relatively simple stuff.

## Changelog
🆑 00-Steven
fix: Fixed patronizing paintings not giving a cut to the curators.
/🆑
2024-03-22 21:12:59 -06:00
Ghom
5fb0088983 Fixes the LTSRBT
I borked it in the blackmarket refactor. It was constantly on cooldown
when idle. Also, some logic mistakes.
2024-03-22 22:03:54 +00:00
Watermelon914
fe3c2edddd Moves lua off of the timer subsystem and onto its own internal scheduler. (#82131)
## About The Pull Request
Lua uses the timer subsystem, which can end up holding the entire timer
subsystem if lua is creating a lot of timers.
The solution to this is to use an internal scheduler instead so that the
load gets placed onto the lua subsystem.

## Why It's Good For The Game
Performance improvement when using lua scripts.

## Changelog
🆑
refactor: Auxlua no longer uses the timer subsystem to get stuff done,
lua scripts shouldn't slow down timers anymore.
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2024-03-22 10:59:16 +13:00
Bilbo367
9fa40f4f1d DeathMatch Rolling Antag Fix (#82030)
## About The Pull Request

Gives Deathmatch players the TRAIT_TEMPORARY_BODY which is checked
during antag rolls while trimming candidates.

## Why It's Good For The Game

Closes https://github.com/tgstation/tgstation/issues/81725

## Changelog

🆑
fix: Deathmatch players should no longer be able to roll any midround
antagonist.
/🆑

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2024-03-17 21:49:11 +01:00
MrMelbert
c7b2e2be50 Fix polling mutating its target's plane and layer (#82009)
## About The Pull Request
This PR fixes polling for an atom causing its plane and layer to mutate

```dm
		var/mutable_appearance/picture_source = alert_pic
		poll_image = picture_source
```
```dm
		poll_image.layer = FLOAT_LAYER
		poll_image.plane = poll_alert_button.plane
```
See the issue?

Passing an atom as an `alert_pic` would set `poll_image = alert_pic`
which would in turn change `poll_image`'s plane and layer

This is supposed to be `new(alert_pic)`, to make a mutable appearance
*based on* the atom's appearance.

I also did a minor bit of cleanup

## Changelog

🆑 Melbert
fix: Fixes polling for things causing said things to have their planes
and layers screwed up (causing random objects or mobs to appear above
runechat and blindness, for example)
/🆑
2024-03-15 14:01:21 -06:00
ArcaneMusic
9802508ab9 Adds logging to SSore_generation on subsystem initialize (#81488)
This PR adds a new logging category and a logging message specific to
SSore_generation's initialize, logging the number of vents of each size,
as well as the number of random and proximity based ore spawns due to
cave generation and map generation.

Currently drafted as I could use some feedback as to why I'm not seeing
the logger.log() messages not appearing on any of the current in-game
log files 👍

Useful for data logging to determine how many of each type of ore is
spawned on the map, for the purposes of determining how much ore is
being spawned manually over the automatic amounts based on the vents,
with the quantity of ores spawning being a product of the ore vent sizes
being logged as well.
2024-03-14 21:25:50 +00:00
John Willard
bd8c1aebff Instrument editor now uses TGUI (#81923)
## About The Pull Request

Instruments now use TGUI as their editor which is pretty cool.
It's mostly a 1:1 remake of the HTML UI except I did make a change to
make the playback options a little more compact, leaving some more space
for the editor before you have to scroll, and some other minor things
that were made to make the UI hopefully nicer to look at and mess with.

When there's a song to play - While playing, Repeat section can't be
edited

![image](https://github.com/tgstation/tgstation/assets/53777086/33f21ca3-98d8-4147-83e7-74e7611463e6)

Help section and UI when there's no song put in

![image](https://github.com/tgstation/tgstation/assets/53777086/babd30ab-9551-448b-9fe6-24e0b0535caf)

## Why It's Good For The Game

It is yet another step in finishing up
https://hackmd.io/XLt5MoRvRxuhFbwtk4VAUA?view
Instruments especially were in a poor spot because they didn't respect
things like ``IN_USE`` to not refresh if it's not the "UI" you are on,
and such.

## Changelog

🆑
refactor: Instruments now use TGUI.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-03-14 18:43:05 +01:00
Ghom
18d734ef7e Closet Anomaly station trait. (#81393)
## About The Pull Request
Well, it's a station trait that makes a small number of (non-secure)
closets function as if splashed with eigenstatium (which turns them into
teleportation cabins of some sort). However, they're subtler, they lack
the transparency and blueish tint, and don't make sparks.

This PR also demotes the Eigenstate subsystem to a singleton global
datum. It doesn't fire, it doesn't init, it plain doesn't belong amongst
the big boys.

## Why It's Good For The Game
This should be a mildly interesting station trait.

## Changelog

🆑
add: Added a 'Closet Anomaly' station trait, which links and turns a
portion of the roundstart closets into impromptu teleporters.
/🆑
2024-03-14 00:45:42 +00:00
Ghom
737822398a Blackmarket refactor and balance, fixing spy bounties, plus a new category for people captured by pirates/tots/contractors. (#81818)
## About The Pull Request
This PR aims to take care of a few potential hard dels and fix the
fenced goods category first and foremost.

The PR also adds a new one that enables you to buy mobs captured by
antags in advance, before they're sent back to the station. Unlike other
categories, it doesn't have "Launch" and "Teleport" as delivery methods,
instead it uses a special "Supply Pod" delivery method that ships the
chattel directly to your location. This method costs 400 credits,
however, if you've built the LTSRBT, shipment will be free.

Another thing, I always felt LTSRBT to be pretty fucking dumb as is. Way
too overpriced for the benefits it offers: a slighty cheaper delivery
method that, while definitely better than the other two, doesn't really
pay off or honestly even remotely compensate the 4000 credits you just
spent to get it, especially if you're only buying a couple items at
most. So I decided to remove it from cargo and add it to the blackmarket
as a 500 to 750 creds item, available every round.

Human mobs sold by the pirate bounty pad are no longer deleted, instead
they're properly ransomed and sent to the holding facility, much like
for contractors and tots. This means they're also added to the black
market.

## Why It's Good For The Game
The blackmarket system has some issues to it that need to be fixed
(otherwise the "Fenced Goods" and "Hostages" categories wouldn't work).
The Pirate Pad deleting "ransomed" mobs instead of actually ransoming
them is lame. The LTSRBT shouldn't suck as much. Also more market stuff.

This will fix #81809.

## Changelog

🆑
fix: Fixed the "Fenced Goods" black market category.
balance: Removed the LTSRBT from cargo and added it to the blackmarket,
reduced the price from 4000 to 625 on average.
balance: The time it takes for captured mobs to be automatically sent
back to the station from the holding facility has been increased from
3-4 minutes to 6.
add: You can buy mobs captured by contractors, traitors and pirates from
the black market and have them sent back to the station in advance. For
safety, they'll also be handcuffed (not always) upon delivery.
add: Human mobs sold by pirates are not deleted anymore. Instead,
they're now captured and sent to the holding facility.
/🆑
2024-03-13 15:22:01 -04:00
moocowswag
b44f7e16fe Explosion Block (A hidden stat on things like reinforced walls) is more effective against heavy and light tiers of explosions (#81603)
## About The Pull Request

As of right now if a 5/10/20 bomb goes through a reinforced wall it has
its ranges subtracted by a flat value of 2 (explosion block is a flat
subtraction to each tier) and essentially gets turned into a 3/8/18.

This pr just buffs the effect of explosion block against heavy and
light. The modifier is 1.5x against heavy and 2.5x against light (I
might nerf 2.5x down to 2x) I dont want to nullify shockwaves because
they should always be impactful at weakening the station.

In the same situation a 5/10/20 bomb goes through a reinforced wall, it
has its ranged subtracted and ends up 3/7/15


Here is an image of a max cap (5/10/20, do note that currently tg server
config is like 8/16/32 or something crazy) in tram sci, notice there is
roughly 2 layers of reinforced walls on the right and it makes it
through the first layer and hits the second, it would likely destroy the
entire first layer of reinforced walls and remove several tiles from the
second making a second explosion able to go into genetics entirely
unmitigated.

![image](https://github.com/tgstation/tgstation/assets/62126254/dbbcb834-e734-43c8-a50a-6b13d850d941)


In practice the 2nd layer of walls remains miraculously unscathed due to
light explosions having an rng diceroll on destroying reinforced walls


![image](https://github.com/tgstation/tgstation/assets/62126254/42c5ab23-9d72-4b49-be83-04d9e160a9a3)

A second blast still gets through since the 1st layer is no longer there
to protect it.


![image](https://github.com/tgstation/tgstation/assets/62126254/e86e36b6-f9ea-42b8-8918-23d2e72a7416)


Do note on live servers it would be much bigger due to max cap being
8/16/32 , going through 1 reinforced walls would result in 6/13/27 which
is still far larger than the 5/10/20 shown.

## Why It's Good For The Game

Its probably not the best approach to fixing the problem and I probably
made it too good at mitigating light but..

As of right now reinforced walls are so weak at stopping or mitigating
explosions that they are spammed alittle bit more than they should be on
a lot of maps and the nukie ship has a laughably silly explosion block
of 20!!! Just to be able to make it somewhat safe.

Every once in awhile atmos becomes a hot topic for debate because of
some new form of spammable explosive that is getting nerfed because of
the way they can easily wipe the station but we never took a look at how
explosions are done, if this pr is merged it won't kill those types of
gimmicks but it will necessitate actually thinking about how you plan to
bomb the station since now you will need to repeatedly bomb to get
through hardpoints (remember even if a reinforced wall mitigates an
explosion it can be dismantled by it and let subsequent explosions
through) or simply position those bombs directly inside of areas of
interest

Another important note is that rooms that map makers intend to be
explosive resistant should be able to better contain 1 explosion so less
situations of everyone in sci getting cucked by toxins messing up
(unless its so bad that they bomb themselves twice)


If this pr is merged I would suggest keeping an eye on heavy firelocks,
they are more expensive than reinforced walls but allow movement through
them which means they are a lot more practical for spamming explosive
block.

I personally wanted to make foam and other materials good at uniquely
blocking different tiers of explosions but I recall being told that was
a little bit too complicated, if this pr doesn't go well I might try
that.
## Changelog
🆑

balance: Reinforced sections of station hull have gotten better at
mitigating explosive shockwaves.
/🆑
2024-03-10 12:45:33 +01:00
John Willard
9ac81e1a64 New station trait job: Human AI (#81681)
## About The Pull Request

This PR does many things, I'll try to explain the basic/background stuff
to the main thing first:

1. Adds a new remote that allows a human to function like an AI. It
controls a fly that will fly around the station slowly, and when it
reaches a machine then the person can interact with it as if they were
an AI. This required changing a lot of silicon/AI checks with one that
also checks for this remote, and some messing with shared ui state.
2. Moves req_access from the obj and bot to ``/atom/movable`` which lets
it be shared between the two, no more copy-paste and one side lacking
features/checks/signals the other has.
3. Adds a check for AI config for AI-related station traits, which was
lacking prior

Now for the good part...
Adds a new station trait that replaces the AI with a Human.
This person is equipped with an AI headset (including Binary), an
advanced camera console, an omni door wand, the machine controller, and
their laws.
They are immune to the SAT's turrets (even if set to target borgs) and
are slow outside of the SAT, mimicing the actions of the AI.

They interact with the world through their advanced camera console,
which allows them to do most AI stuff needed, and the holopad they can
connect to without having to ring first (like Command can).

They are given a paper with the laws they must follow, but since they
are human they are able to bend it. Cyborgs that run the default lawset
are "slaved" to them via an unremovable law 0, so the Human AI can bend
the laws if they really need to (for their own survival n such), and
make the cyborgs obey their commands above laws, but in general this
shouldn't be a frequent occurrence. This does take into account the
unique AI trait, so it's not guaranteed Asimov.

When this station trait rolls, all Intellicards, AI uploads, and AI core
boards are destroyed and are unresearchable. They can be spawned by
admins in-game if necessary. Maybe in the future we can also exclude
Oldstation from this but I haven't really decided.

Extra perks:

Human AI spawns with a Robotic voicebox (unless they are a body purist)
and teleport blocking implant, so they can't use teleporters to bypass
their on-station slowdown.
They also have an infinite laser pointer that can be used to blind
through their camera console. This is unfortunately nerfed from the
recent borg balance PR that removed its stun. This was meant to be the
alternative to no longer being able to permanently lock borgs down like
AIs can (or more than one, for that matter).
They aren't affected by Roburgers, Acid, and Fuel's toxicity.
Bots salute them like they do Beepsky (which is now a trait)
They spawn with SyndEye to replace the AI's tracking ability
They do not have a bank account

### The machine remote

The machine remote has a little fly in it that flies to the machines it
is pointed to, working as the arms and legs of the Human AI. It scans
the machine and punches in the action the AI does, and is how the AI
accesses basically anything. This fly slowly moves from one machine to
the next, and can be recalled with Alt Click.
It works on machines and bots.

### Video (Low quality to fit Github)


https://github.com/tgstation/tgstation/assets/53777086/e16509f8-8bed-42b5-9fbf-7e37165a11e8

## Why It's Good For The Game

I've seen a funny screenshot one day of a person replacing the AI by
using a bunch of door remotes, camera console, crew monitoring console,
and a few other things. I've been thinking about that for a few years
and really wanted to make it official if not easier to make possible,
because it is an incredibly funny interaction.
This makes it a reality, and while they aren't as powerful as regular
AIs, I think it makes for better and funnier in-game moments. With the
same weight as Cargorilla (1), I hope this wouldn't be rolling too often
and ruin rounds, but instead show off the different capabilities that
Humans and AIs can do, to do the job of an AI. You win some you lose
some.

## Changelog

🆑 JohnFulpWillard, Tattax
add: Adds a new station trait job: The Human AI.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2024-03-09 23:48:39 +01:00
Thunder12345
058cb039eb Bitrunning 1.5: Secondary Objectives (#81828)
## About The Pull Request

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

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

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

## Why It's Good For The Game

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

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

## Changelog
🆑
add: Added secondary objectives to bitrunning!
add: Pick up encrypted curiosities and return them to the safehouse to
claim their contents.
add: Glacier Grind has been given a secondary objective, look out for
the limited edition hat.
add: Bitrunning domains can now be modified during the round by admins.
/🆑
2024-03-09 22:42:23 +01:00
MrMelbert
5f2f9e67ad Add compile option for compiling in MAP_TEST mode, which disables common annoyances when testing new maps (#81697)
## About The Pull Request

Adds `MAP_TEST` compile flag. 

This compile flag blocks common things which make it difficult to test a
map.

Things this applies to: 

- Rats no longer spawn. 
- Rat spawning will (obviously) break up the powernet, which is
INCREDIBLY annoying when trying to test if all the rooms of the station
are wired correctly (or testing which rooms lose power first, etc)

- Light tubes no longer break on initialize. 
- Random light breakages can easily cause mappers to accidentally over
light a room.

- Roundstart command report is not printed. 
- Might be a personal preference, but it's kinda annoying to hear the
alert over and over again.

- Random events do not trigger. 
- Some events such as gravity generator outage can trigger with 0
population.
   - Random camera breakage event can cause over-placement of cameras. 
   - Other stuff tends to just get in the way. 

- Station traits do not trigger. 
- Probably the biggest annoyance. Many traits modify the map in some way
which disrupts testing.

- Roundstart landmarks don't self deletes. 
   - Allows mappers to use sdql to find them. 

- Mapping verbs start enabled. 

Obviously more things can be added if they come up.
2024-03-07 16:57:47 -05:00
ArcaneMusic
3a76cb27fe Arcargo: Balance Pass v2 on the Stock Market (#81580)
## About The Pull Request

Picking up where I left off on #81216. 

* Stock market stocks have had their market quantity drastically
reduced, as on both the more common and more rare material sides of
things these materials traditionally have been traded in quantities that
it would prevent bicycle like quantities of materials entering the game
while still allowing for access to rare materials at rare material rates
of credits.

* The stock market subsystem now fires once every 60 seconds, as opposed
to once every 20 seconds. To compensate for this, the subsystem now
makes much wider price changes every update, to disincentivize players
from just camping out at the stock market console all game, as this is
behavior we typically discourage (genetics/virology/etc). Material
tending times are similarly decreased to make up for that, while noting
that stock market events will still enable for a material to change
directions at any point as well.

* Material prices can drop below their minimum trading threshold,
resulting in them gaining protected purchasing status, and resulting in
them being unavailable for purchase. This means if you're watching a
price drop, and it's still trending lower, there's a distinct chance you
might want to buy before it drops below the threshold, or risk it, buy
later, and avoid the material getting locked out for another minute or
more.

* Adds 2 new stock market events to help add additional variety to the
stock market's variability, while adjusting the probability of a market
event occurring per stock market event. This should average to ~4 events
every minute, keeping things somewhat interesting if you're watching the
prices of items, but without requiring second to second updates to keep
things engaging.
* These two events include one that blocks off all material quantity
from a material for the duration of the event and resets prices when
complete, and another one that maximizes the profitability of a
material, but leaves it's market quantity up in the air.

* Stock blocks have had their freeze timer decreased from 5 minutes,
down to 3, with the warning now at 1.5 minutes. This is to encourage
players not to sit on their resources for longer periods of time if
their goal is just to sell at a specific price point and to keep items
going through the shuttle, which _also_ encourages players to receive
mail/receive regular orders from the rest of the crew.

* The UI has a number of improvements, those being:
* The time until the next stock market update is listed on the UI as an
active timer.
* The materials listed in the UI are now sorted by the value of that
resource per unit.
* The instructions are now kept within a collapsible component to cut
down on wasted space within the UI.
* A few elements are moved over to % width as opposed to a hardset x
pixels width for screen size compatibility purposes.


![image](https://github.com/tgstation/tgstation/assets/41715314/b8c7b00a-947e-421b-aa18-2b77f0b9bb50)

## Why It's Good For The Game

Stock market has been known to create bike levels of wealth with near
negligible amounts of effort and was going to need a balance pass
eventually. This is being accomplished by slowing down the system, but
also making it more unpredictable by expanding on the stock market event
system a bit further. Naturally, it could use a few more wacky events to
keep the system fresh and active, but for now this helps to keep the
system from being a screen simulator while also making game-health
changes like lowering material quantities that were capable of allowing
the player to double, quadruple, octuple, etc. their wealth every few
minutes by just buying low and selling high.

Makes a few QOL changes to the UI to compensate for a few of these
changes, like the new update timer on the UI in the case we change the
time per update any further, as well as to give incentive to players to
not just camp the console for new updates, just to glance at how their
investments are doing.

These tweaks also keep cargo moving as opposed to just trying to power
game iron and glass for maximum returns, while giving them extra
opportunities to send the shuttle to keep packages flowing for other
purchases/getting mail.

This has a chance to stop #79978, but I'll edit this appropriately after
a TM has confirmed if it was effective or not.

## Changelog

🆑
balance: The stock market now fires slower, has stock market events
occur more often, and the stock market has fewer minerals that are
available to buy in a single purchase before restocking.
balance: Materials sold on the stock market may be protected from being
bought if their prices drop too low, so make sure you watch your prices
before they run the risk of getting shut out!
balance: Stock blocks now freeze the price of materials for 3 minutes,
down from 5.
qol: Tweaks to the Galactic Material Market UI, with materials sorted
based on their rarity and a timer to show how long until it updates.
add: New Stock market events, one locks a material from being purchased,
the other maximizes the value and quantity of a material for sale.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-03-06 23:54:37 +00:00
Kyle Spier-Swenson
3086ed4f8c refactor db connection timeouts (#81816)
Give it exponential back off and smerter logic.
2024-03-07 12:25:01 +13:00
13spacemen
357799c8a5 Removes Orbit Polling Component, SSpolling improvement (#81748)
When I made SSpolling, jlsnow gave me his blessing to delete the orbit
polling component [where you orbit something for 20 seconds before it
chooses a ghost from the orbiters]
It's only used in a few places like soulstones replacing
jobbanned/inactive players, etc.

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

Also prints to chat who the chosen one was

Also made slime intelligence potions ask the user for a reason, which
will be displayed in the alert poll
2024-03-06 08:24:36 +00:00
_0Steven
16f6200b65 Alternate job titles such as chef and department security get injected to the manifest normally, and show up as the right department. (#81634)
## About The Pull Request

Previously injecting to the manifest would use solely the mind's
assigned role, thus injecting player with alternate job titles such as
chef and department security as the job they're based off rather than
their actual ID trim.
Then if the manifest were to be updated later on, they would show up as
being departmentless because getting the manifest checks for an assigned
job, which these don't have as they're just alternate titles for an
existing job.

This resolves the first part by checking if it's possible to get a trim
from a held ID and using that before attempting to default to the mind's
assigned role. As building/updating the manifest is done after
equipping, this lets alternate job titles be assigned as their actual
job.
Then the second part is resolved by adding a list of alternate titles
for the job subsystem to register as being that job, so that a job can
have multiple titles which refer to it.
## Why It's Good For The Game

It's annoying to not be able to find these in the right spot on the
manifest, if at all in the first place.
2024-03-05 22:37:00 -06:00
Ghom
88bdabe53b Adds a small cafeteria behind the right wing shutters of the museum. (#81465)
## About The Pull Request
I was thinking to contribute something to the new away mission map to
make it better. Mapping and all takes too much time for me, so I could
do little. Though it comes with its own unique gimmicks.

To reach the cafeteria, one has to complete a couple puzzles.
The first set is opened by inputing the correct PIN on the password
panel beside it. There're several clues to help you guess this fairly
easy puzzle, in the form of several number graffitis, a scrapped piece
of paper full of numbers, and a board filled with colored dots also
found just beside the panel.
The second one is opened by a keycard, and is generally lazier. To find
it, you'll need to do a bit of (toilet) searching.

As for the unique things this PR adds:
- A fire extinguisher... that actually contains welding fuel
- A (dirt-cheap) hotdog vending machine*
- A completely ornamental maneki-neko (that's the name of the
luck-bringing, paw-waving cat figurine)
- A piggy bank that carries money between rounds. It has a cap of 10k
credits worth of holochips, cash and coins, which is pretty high, but
I'm confident people will just destroy it for its contents the moment
they find it. His name is Pigston Swinelord VI.
- More, totally legit and not actually fake bombable walls :^)

*By the by, you can also find it during the national hotdog day.

Screenshots of the new location:
![museum
cafe](https://github.com/tgstation/tgstation/assets/42542238/1c0d93b7-90d5-4459-a48d-81430f0d3613)
![museum
restrooms](https://github.com/tgstation/tgstation/assets/42542238/5a9e049d-6acc-464b-998d-901e43154bae)


## Why It's Good For The Game
You know how most away missions are not that special at all? Yeah,
@mc-oofert set an example of a pretty decent one actually, if not a tad
small. I thought it could use a touch of another mind actually
contributing to it too, because it deserves it.

Also, this sets the basis for other persistent piggy banks. I don't
think they should all have that 10k cap like this one, perhaps 1k is
enough. Beside, the code that mothblocks did for json database datum is
pretty good, so there is not a whole lot of shitcode here.

## Changelog

🆑
add: Added a cafeteria to the museum away mission, with a few special
things to it. To reach it, you'll have to complete a couple puzzles
however.
map: The museum away mission now has a couple restrooms.
add: Hotdog vending machines may spawn during the National Hot Dog Day.
/🆑
2024-03-05 18:19:39 -07:00
Kyle Spier-Swenson
a88013783a Fix shutdown hanging if the db went away. gives shutdowns a time out. improves db shutdown logging (#81813)
terry right now:
```
[20:11:31] Runtime in code/controllers/subsystem/dbcore.dm,353: Attempting to create a new db query during the world shutdown
...
[21:25:29] Runtime in code/controllers/subsystem/dbcore.dm,353: Attempting to create a new db query during the world shutdown
```
2024-03-04 19:00:42 -07:00
MrMelbert
977799a2e7 A red spy has entered the base: Adds Spies, a roundstart antagonist inspired by Goonstation's Spy-Thief (#81231)
# Disclaimer: No Goon code was referenced or used in the making of this
PR

## About The Pull Request

[Design Document (Read this for more
information)](https://hackmd.io/@L9JPMsZhRO2wI25rNI6GYg/rkYKM9Yc6)

This PR adds Spies as a new roundstart antagonist type, inspired by
Spy-Thiefs from Goonstation.

Spies are tasked with stealing various objects around the station, from
insulated gloves to the black box, from the clown's left leg to the
bridge's communications console.

For every item stolen, the Spy is rewarded with a random item from the
Syndicate Uplink, plus some items uniquely available to the Spy. Stolen
items are then shipped off and sold on the Black Market Uplink, allowing
the crew - or maybe some other evil-doers - to get their hands on them.


![image](https://github.com/tgstation/tgstation/assets/51863163/f057d480-4545-44da-b8fe-a8d09a5d2dcf)

More ideas for theft items and bounties are welcome. 

## Why It's Good For The Game

See the design document for more information. 

In short: Adds a solo antagonist which has less impact than your
Traitors and Heretics, but more impact than Paradox Clones and Thieves.
In other words: On the same tier as old traitors.

Seeks to embrace the sandbox aspect of antagonists more by having no
precise greentext objective, and instead some suggestions for chaos you
can embark in. Have fun with it!

## Changelog

🆑 Melbert
add: Spies may now roam the halls of Space Station 13. Watch your
belongings closely.
/🆑
2024-03-01 04:41:57 +00:00