Commit Graph

3974 Commits

Author SHA1 Message Date
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
EvilDragonfiend
20e67664ed Allows vv investigate /appearance + better checking image (#82670) 2024-04-21 20:46:42 -06:00
Zephyr
907f9497d7 Player Panel-age (#82757) 2024-04-19 22:31:21 -07:00
chel
fa28207f6b Fixes a minor spelling mistake on the admin panel/verb list (#82747)
## About The Pull Request

Corrects `inisimin` to `invisimin`. This addresses #82728, but only
fixes one of the two issues mentioned

## Why It's Good For The Game

-1 spelling mistake

## Changelog
🆑
spellcheck: 'inisimin' verb corrected to 'invisimin'
/🆑
2024-04-19 15:34:54 -06:00
Jeremiah
8e3f635b98 Alt click refactor (#82656)
## About The Pull Request
Rewrites how alt click works. 
Based heavily on #82625. What a cool concept, it flows nicely with
#82533.

Fixes #81242 
(tm bugs fixed)
Fixes #82668

<details><summary>More info for devs</summary>

Handy regex used for alt click s&r:
`AltClick\((.*).*\)(\n\t.*\.\.\(\))?`
`click_alt($1)` (yes I am aware this only copies the first arg. there
are no other args!)

### Obj reskins
No reason for obj reskin to check on every single alt click for every
object. It applies to only a few items.
- Moved to obj/item
- Made into signal
- Added screentips

### Ventcrawling
Every single atmospherics machine checked for ventcrawling capability on
alt click despite only 3 objects needing that functionality. This has
been moved down to those individual items.
</details>

## Why It's Good For The Game
For players: 
- Alt clicking should work more logically, not causing double actions
like eject disk and open item window
- Added context menus for reskinnable items
- Removed adjacency restriction on loot panel

For devs:
- Makes alt click interactions easier to work with, no more click chain
nonsense and redundant guard clauses.
- OOP hell reduced
- Pascal Case reduced
- Glorious snake case

## Changelog
🆑
add: The lootpanel now works at range.
add: Screentips for reskinnable items.
fix: Alt click interactions have been refactored, which may lead to
unintentional changes to gameplay. Report any issues, please.
/🆑
2024-04-16 17:48:03 -06:00
Zephyr
abbee36f1d Hey what if admins were allowed to use the player panel (#82682)
Re-adds the player panel verb to the verb panel.
2024-04-15 18:45:32 +00:00
Zephyr
9124a73b60 Put some admin jump verbs back into the context menu | sorts area jump list again (#82647)
## About The Pull Request

See title.

## Why It's Good For The Game

Some admins wanted all the jump verbs back, aswell as making them not
AGhost you.
Also make the Jump To Area verb use a sorted list again
2024-04-14 17:27:07 +00:00
Zephyr
7f8752be14 Admin Verb Datums MkIII | Now with functional command bar (#82511) 2024-04-12 12:27:09 -07: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
Watermelon914
ce23a59c36 Cleans up the SS13_base lua file and adds a new lua file for easily handling multiple signals on different objects. (#82458)
## About The Pull Request
Cleaned up the SS13.register_signal and SS13.unregister_signal, removing
the weird list shifting.
Also adds a new lua file that can be included for the use of registering
different signals on various datums and being able to clear them all in
1 function.
Removed the make_easy_clear_function option when registering a signal
via lua because I don't think it's used by anyone and it lacks any sort
of versatility. Users can just create their own function for clearing
signals from a datum.

Also updates the documentation for HARDDELETES.md as
COMSIG_PARENT_QDELETING was renamed to COMSIG_QDELETING

## Why It's Good For The Game
New handler file makes registering signals in batches a lot easier if
you want to clear them in one go without clearing unrelated callbacks on
the same datum. The list shifting in SS13.register_signal had pretty
significant performance problems, so removing that will make registering
and unregistering signals faster.

## Changelog
🆑
admin: LUA - Adds a new library called handler_group. Include it in your
files by doing require('handler_group')
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2024-04-10 12:10:30 -07:00
John Willard
611c48be40 Monkeys now use height offset (and monkey tail works) (#81598)
This PR adds the ability for monkeys to wear any jumpsuit in the game,
and adds support for them to wear things like coats, gloves, and shoes
(though this cannot be obtained in-game and is solely achieved through
admins, which I also improved a bit upon by adding a defined bitfield
for no equip flags).

This reverts a lot of changes from
https://github.com/tgstation/tgstation/pull/73325 - We no longer check
height from limbs and such to bring sprites down, instead monkeys now
work more similarly to humans, so the entire PR was made irrelevant, and
I didn't really want to leave around dead code for the sake of having a
human with longer legs.

I've now also added support for Dwarfism, which makes monkeys look even
smaller. Very minor change but at least now the mutation doesn't feel
like it does literally nothing to monkeys (since they can already walk
over tables).

Here's a few examples of how it can appear in game (purely for
demonstration, as it is currently intentionally made impossible to
obtain in-game, though if someone wants to change that post-this PR now
that support is added, feel free):

Tails have been broken for a while now, the only reason you see them
in-game is because they are baked into the monkey sprites. This fixes
that, which means humans can now get monkey tails implanted into them
(hell yeah) and monkeys can have their tails removed (also hell yeah)
2024-04-09 02:36:31 -05: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
17deef69d9 re-adds list of components for admins to remove (#82461)
## About The Pull Request

The list of components on a mob when admins try to remove one didn't
actually show them, now it does.

![image](https://github.com/tgstation/tgstation/assets/53777086/a6102c3a-df30-4e9c-b7fd-29a4d8ddaa89)

## Why It's Good For The Game

Messing with components/elements on mobs are such a pain, in this case
was broken entirely.

![admin-toolings](https://github.com/tgstation/tgstation/assets/53777086/3d190c66-34e4-4424-824b-37f95e88b003)

## Changelog

🆑
admin: Removing components button now lists components to remove
/🆑
2024-04-05 17:45:09 -06:00
Bilbo367
1ace94c7bb Aheal no longer turns monkies in to humans (#82393)
## About The Pull Request

Also changes the Make Monkey Admin button to turn you into a monkey with
mutations instead of just creating a new being.
Closes: https://github.com/tgstation/tgstation/issues/80744
Mabye Closes: https://github.com/tgstation/tgstation/issues/81722

## Changelog

🆑
fix: aheal no longer turns monkies into humans
qol: Player panel "make monkey" turns humans into monkeys through
mutation instead of making a new mob
/🆑
2024-04-02 21:45:33 -06: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
Watermelon914
ece026703d Makes lua file upload work with bigger files and standardizes a few file|null (#82202)
## About The Pull Request
My lua scripts were hitting the topic byte limit, so this makes file
upload of lua scripts able to bypass the topic limit.

## Why It's Good For The Game
Removes arbitrary restriction on how big a lua file can be in bytes.

## Changelog
🆑
admin: Admins can now run lua files bigger than 36 KB by importing them
directly.
/🆑

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2024-03-26 20:03:44 -04:00
Watermelon914
9fecca8556 Fixes lua error logging and a few timer.lua functions (#82160)
<!-- 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

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->
Lua errors don't get logged when `call_function` is called

Timer.start_loop was just straight up broken due to me not properly
testing it, so this fixes that.

## Why It's Good For The Game

<!-- 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. -->
Makes debugging lua scripts easier. Also fixes bugs.

## 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: Fixed lua error logging.
fix: Fixed the SS13.start_loop function not working properly.
/🆑

<!-- 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: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2024-03-23 13:40:33 +01:00
Bilbo367
466b3df048 Refactor removing unused defines. (#82115)
## About The Pull Request

Refactors a lot of the unused defines.

## Why It's Good For The Game

Refactors a lot of the unused defines.

## Changelog
Nothing player facing

---------

Co-authored-by: san7890 <the@san7890.com>
2024-03-22 21:29:35 -06: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
Ghom
bd8a641a5a map exporting now supports puzzle pieces and similar (#81759)
## About The Pull Request
What it reads on the tin. `puzzle_id` vars and the such are now
supported by the map exporting verb.

## Why It's Good For The Game
If anyone ever so wishes to export maps with puzzle doors and stuff.

## Changelog
N/A
2024-03-21 20:32:24 +00: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
Jacquerel
94482850a2 Adding a blood brother via the team panel sets it up correctly (#81799)
## About The Pull Request

In a recent round, it was noticed that it's kind of annoying and fiddly
for an admin to add someone to a blood brother team (for instance, if
they had to recreate someone's mob to fix a different issue).
Now if you add someone to a blood brother team via the teams panel, it
will set them up as a blood brother properly.

It's probably in the future worth examining this behaviour for other
team antags as well.

I also added a link to the Team Panel to the Antag Panel because I had a
skill issue and kept forgetting how to access it.

Finally, the conversion logging looked all kinds of fucked, so I fixed
it. I will be honest: I don't know what that list does but the arguments
it was recording were both wrong and didn't make any sense.

## Why It's Good For The Game

Makes admin lives easier.
Using this panel you can now add sapient Ian to a blood brother team.

## Changelog

🆑
admin: Made it easier for admins to adjust blood brother teams using
admin tools.
fix: Correct blood brother conversion logging.
/🆑
2024-03-06 16:09:56 -07: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
Kyle Spier-Swenson
0269c4be44 Protected admins can skip 2fa if the db is down. (#81823)
This is basically only admins inside of the .txt and for /tg/station,
only includes heads like the headmins and headcoders

---------

Co-authored-by: san7890 <the@san7890.com>
2024-03-04 19:00:14 -07:00
Zergspower
d68ef829ad Universalizing ruin names (#81737)
## About The Pull Request

This is not player-facing, however it's a good QOL that i made for
downstream modular ruins. The pick-list of maps makes it a bit..
annoying to really grab a ruin quickly - so all this does is add an ID
to the front of them for Space, Lava and Ice respectively.

## Why It's Good For The Game
## Changelog
:cl:Zergspower
admin: renames ruin names to have an identifier in front of it
refactor: converts map plate and jump to ruin to tguilist
/🆑
2024-03-04 16:17:15 -06:00
John Willard
aace5f46f4 You can do more things while floored (#81641)
## About The Pull Request

While on the floor, you can:
- Use the UIs of Atmos machinery (except thermomachine and bluespace gas
vendor), Holopads, Crayons (spray cans too), radios, and Disposal bins
- Close extinguisher cabinets with Right-Click
- Click and drag yourself onto a photocopier to climb onto it.

I also changed all instances of ``ui_status`` to have all the args it's
being passed, I was messing with it a bit but it's gonna be for a later
PR.

## Why It's Good For The Game

It's an extra layer of harmless realism, also nice QoL for people who do
not have functional legs and do not have a wheelchair.

## Changelog

🆑
qol: You can use atmos machines, holopads, crayons, spray cans, and
disposal bins while floored.
fix: You can close extinguisher cabinets while floored.
fix: You can climb onto a photocopier from the floor.
/🆑
2024-02-26 18:34:20 +01:00
Holoo
c6f137fdb4 Minor update to admin secrets panel (free antags for everyone) (#81292)
## About The Pull Request
Remakes a button in admin secrets panel from everyone is traitor to
everyone is admin chosen antag.


## Why It's Good For The Game
Slightly better buttons for admin to push


## Changelog
🆑
admin: remade everyone is traitor into everyone is antag in secrets
panel
/🆑
2024-02-08 20:52:12 -08:00
LemonInTheDark
0a496f180c Refactors fancy type generation (#81259)
## About The Pull Request

[Refactors fancy type
generation](3f218ac7b7)

Ok so we have this proc that generates concatenated names for types so
admins have a nice list to sort through.

The trouble is this is done by, for each type, iterating all possible
replacements, and seeing which ones apply (with expensive string
operations)

A clean run of this applied to all datums takes about 3.5 seconds on my
pc.
This sucks.

Ok so can we do better. Well, yes, pretty easily.

Rather then, for each potential type, iterating all the options, let's
build a zebra typecache (a lookup list of type -> string to use), and
use that.
Then we can use a list of replacement -> the bit to tear out to figure
out what to remove.

This works quite well. It does mean that we're doing it based off the
type tree and not type paths, so if we didn't have a replacement for
like, mob, it'd look weird, but we don't have cases like that so it's
fine.

Or well we sorta did, didn't have anything for atom movables or areas,
but I fixed that so sall good.

Anyway, we only need to do this work once. It takes about 0.3 seconds on
my machine, so we can cache it.

Just this on its own would technically slow init, since we have a some
code that's running this proc off static, but we can just not, that's
fine (technically saves init time too since we don't have to burn 0.1
seconds on it anymore).

This brings the cost of generating this list for all datums from 3
seconds to 0.16, assuming we have the static pre generated.

We could in theory pre-generate just like, all the strings? 
But I don't think the cached cost is high enough for that to be a real
problem. IDK open to other thoughts

Oh also I had to reorder the strings in that list, cause
zebra_typecacheof has reverse priority. s life

[Updates stat tracking macro to work at world
start](1fbfb701a1)

It for some reason doesn't actually get anything this early, but now at
least the logging would in theory function

## Why It's Good For The Game

Better response times for admins, faster code, more better
2024-02-08 14:28:18 +01:00
Zephyr
c76df7f37a Station Goals are now handled by SSstation instead of a global list (#81177)
## About The Pull Request

You can now get station goals in a slightly better way over using a
`locate() in` call on a global list.
The Meteor Satellite goal no longer stores a giant list of ALL OBJECTS
in view. And now correctly only counts turfs.
## Changelog
🆑
fix: Meteor Satellites no longer erroneously count every piece of paper
as a protected turf.
fix: As a result the station goal is slightly more difficult
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2024-01-31 20:47:09 +01:00
John Willard
eb957bf46f Newspapers now use TGUI (#80991)
## About The Pull Request

Newspapers work as a static newscaster that is not affected by things
like D-notices and changing wanted issues after its been printed. It
doesn't store comments or get any updates after its been printed.
You can also scribble on the paper to leave notes on a specific page,
which is a feature I have never seen in my life but it is still here I
guess.

Minor things I've added:
- Sound effect when printing the newspaper in the first place
- 2 second do-after when scribbling just for some player feedback and
consistency
- Balloon alerts
- Context tips for scribbling and burning

I also fixed an issue with wanted issues on newscasters when there isn't
an image.
As a minor note, I replaced the instances of ``content`` in Buttons I
saw in newscaster's UI because it's marked as deprecated.

Too lazy to take a video sorry


![image](https://github.com/tgstation/tgstation/assets/53777086/6944965e-e949-4c22-a6a2-1dbe2f2d09c4)

![image](https://github.com/tgstation/tgstation/assets/53777086/5af44877-6170-424d-9766-46d1ad9f77be)

![image](https://github.com/tgstation/tgstation/assets/53777086/5c5cdfc5-541a-417e-a60d-9522227d0687)

## Why It's Good For The Game

Fixes an issue with newscasters and makes newspapers use a nice TGUI
that feels more responsive than before.
Helps further https://hackmd.io/XLt5MoRvRxuhFbwtk4VAUA even more.

## Changelog

🆑
refactor: Newspapers now use TGUI.
fix: Fixed the newscaster's wanted section showing a non-existent photo.
/🆑
2024-01-25 09:07:53 -05:00
LemonInTheDark
5d9488cd2a Macro Optimizes Map Saving (100x) DO NOT CHURN STRINGS Edition (#80845)
## About The Pull Request

Yello!
This one is reasonably quick, tho I did some fixes too

This is the big one, fixes the buildmode tool sometimes locking disabled
for the whole round.
We do this by replacing the static var on buildmode with global var and
a global proc
This keeps a harddel on the buildmode datum from permalocking is_running
to TRUE

Also makes flipping the var BACK if something breaks significantly
easier for admins, so that's nice

Alright, smaller things now

Fixes lists of numbers failing to encoded improperly This was fixed on
shiptest, we failed to actually port their most recent revision
Fixes the shuttle flag not actually working because it used istype
instead of ispath
Changes obj_blacklist to a typecache for optimization's sake
Renames/moves some vars around to prevent weird double typing things
Removes a checktick in key gen, it's just costing more time then it
would save in overtime
Properly handles lists. We were only doing var encoding one layer deep,
need to do it alll the way down

Alright, now the optimizations

This proc is fucking HOT, and it's for really dumb reasons

This is a text gen proc, and it makes the mistake of generating text and
concatinating it with MORE text.
This is HORRIFICALLY EXPENSIVE because byond caches strings (can only be
one of each) and string churn fucks up that caching system something
fierce
Moving from strings to lists of strings we join at the end takes us from
like idk 100 seconds to save bare metastation to like 1.5
This is applied basically everywhere for obvious reasons

While I'm here, storing keys in a flat list and then using find to find
them, then using that index to lookup into another flat list is a bit
silly. Let's just make it an assoc list. Faster lookup, cleaner.

Oh also rather then iterating over all the vars on an object, let's
iterate over just the ones we care about yeah?

Let's see... no sense genning a key we'll never use, and having suffixes
be often non existent is silly just embrace the slight mess.

That's it I think, this takes us from 100 seconds to save metastation to
2.5 seconds to save ALL of metastation (I removed the vars limiter so I
could make sure var saving didn't fuck me up)

## Why It's Good For The Game

Cleans up some issues that we failed to port the fixes for, MASSIVELY
optimizes this (so it can finish in like 5/10 seconds and not 300!) and
ensures admins can always use the thing and don't risk dropping their
pet buildastation to the void.

Worth noting, this tool really should not be used for station mapping
outside an event context. It produces sorta buggy var edits, and WILL
fail to pull over context for shit. Please don't use it as such

Profiles (csv files I promise)

[Before](https://github.com/tgstation/tgstation/files/13853313/profiler.json)

[After](https://github.com/tgstation/tgstation/files/13853271/profiler.json)

I'd include my line by lines but I don't know how much you'd get out of
them. Here's an image tho


![image](https://github.com/tgstation/tgstation/assets/58055496/3f3148c5-8b1e-4bda-aa65-3983f9944a91)

## Changelog
🆑
fix: The map saving tool will no longer lock up and prevent all further
action at random
fix: Map saving now takes on the order of seconds, not minutes
fix: Fixes an issue with lists that caused strongdmm to report saved
maps as broken
/🆑
2024-01-20 10:14:45 +00:00
Kyle Spier-Swenson
8703eac50d split area.contained_turfs up by zlevel, make init 10 seconds faster (#80941)
## About The Pull Request

Situation: areas have a list of all turfs in their area.

Problem: `/area/space` is an area and has a 6 to 7 digit count of turfs
that has to be traversed for every turf we need to remove from it. This
can take multiple byond ticks just to preform this action for a single
space rune

Solution: split the list by zlevel, and only search the right zlevel
list when removing turfs from areas.

replaces `area.get_contained_turfs()` with a few new procs:

* `get_highest_zlevel()` - returns the highest zlevel the area contains
turfs in. useful for use with `get_turfs_by_zlevel`
* `get_turfs_by_zlevel(zlevel)` - returns a list of turfs in the area in
a given zlevel. Useful for code that only cares about a specific zlevel
or changes behavior based on zlevel like lighting init.
* `get_turfs_from_all_zlevels()` - the replacement for
`get_contained_turfs()`, renamed as such so anybody copying/cargo
culting code gets a hint that a zlevel specific version might exist.
Still used in for loops that type checked so byond would do that all at
once
* `get_zlevel_turf_lists()` - returns the area's zlevel lists of lists
but only for non-empty zlevels. very useful for for loops.

The area contents unit test has been rewritten to ensure any improper
data triggers failures or runtimes by not having it use the helpers
above (some of which ensure a list is always returned) and access the
lists directly.
2024-01-18 12:16:12 -05:00
LemonInTheDark
a3bb400816 Optimizes Reftracking (Bigly) (Plus harddel fixes) (#80443)
## About The Pull Request

### Reftracking BS

Alllright so reftracking is slow, really really slow.
That's a problem for me, both because I want it to be fast so I can more
efficiently torture players by running it on live, but also because it
impedes both local and CI runs.

So I've set out to micro optimize the DoSearchVar proc, one of the
hottest in the game.
I've done this in a few different ways.

#### The simple shit

Removing redundant proc args
Yeeting assoc arg setting (extra cost)
Moving if statements around to prioritize the more common case
Ignoring empty lists.

#### The not simple shit

Throwing our snowflake list checking into the sun
(Background, byond has some special lists that cannot be accessed like
an assoc list, trying to will lead to runtimes)
The way we handle this involves inspecting their ref string, and it eats
a LOT of time.

Faster then to mark all the lists we know are special by var name, and
then use try/catch to detect and silence anything that sneaks through
(this is on the order of like 1/3 per run, kinda curious what they are
tbh)
Thanks to MSO for the idea for this btw.

Removes the vars and logic that tied ref searching to clients. 
It's not how this code is used, and it slows everything else down for
really no reason

Added support for handing in a known "hanging reference" count, and then
searching for that.
This lets us early exit the ref search if we find everything we were
looking for, which is REALLY powerful, and why I asked for refcount() in
the first place.

### Harddel Fixes

[Fixes some harddels w gulag stuff born of the 515 one way ref
issues](046d7daa03)

[Ensures proximity cameras clean their ref to their proximity datum if
it's
deleted](ff607e9ccb)

[Deleting a pipe connected via the gas_machine_connector datum to a
machine should also delete that machine (harddel
fix)](9eecca22e7)
## Why It's Good For The Game

All this combined speeds up refsearching massively, on the order of
hundreds of seconds, and makes it far less time consuming for both CI
and running on live.
I'll be bullying some servers semi soon, want to see what I can cut out.
2024-01-16 02:17:03 +01:00
SyncIt21
8a1b4e8d01 Remove unused output var from sql_message_system.dm (#80951)
## About The Pull Request
Fixes this
![Screenshot
(382)](https://github.com/tgstation/tgstation/assets/110812394/39f8ae38-0632-4429-9d46-3355d16b9e86)

## Changelog
N/A
2024-01-15 22:05:46 +01:00
Ghom
43fe8dd349 fixes null plane debuggers for admins (#80939)
## About The Pull Request
Yeah, why would we delete the plane debugger while the admin is active?

## Why It's Good For The Game
Broken debugging tool.

## Changelog
N/A
2024-01-14 11:07:29 +01:00
LemonInTheDark
2ed5a9fca0 Fixes the "Saw this admin message" button not working (#80908)
## About The Pull Request

Wrong fuckin name brother (also topic doesn't automake textnums into
nums)

## Why It's Good For The Game

Closes #80020

## Changelog
🆑
admin: Confirming that you have read an admin message now uh, works.
it's been 2 years bros
/🆑
2024-01-13 16:13:45 -07:00
ArcaneMusic
006b61f08b Adds a Debug command to stop all weather. (#80848)
Atomizing out of #78524 as a result of that PR being too big and this
was quite easy to do.

## About The Pull Request

This adds a debug (admin) command that allows you to stop all weather
effects that are going on across the map in a given instance. This is
useful for when you are testing something on lavaland and need the storm
to stop, or if you otherwise had some other kind of weather effect
interfering with testing something. It's worth noting this directly
calls end() on the active weather effect, meaning that for more
complicated weather that may have different side effects, it may need
some extra finess, but as of current writing no weather does anything
interesting in their wind_down() procs.

## Why It's Good For The Game

God weather is so annoying while testing lavaland, plus this is just
straight admin and testing tooling so there's no harm.

## Changelog

🆑
admin: Added a new admin verb that ends all active weather within the
weather subsystem.
/🆑
2024-01-11 00:23:19 -05:00
MrMelbert
279904e079 Saves some free lag by removing some in area (in world) loops (#80644)
## About The Pull Request

Goes through and changes some `in area` / `in a` loops to use
`get_contained_turfs` to cut down on `in_world` loops. Saves some free
lag.

## Changelog

🆑 Melbert
fix: Some things which affect everything in an area are less laggy, the
"all lights are broken" station trait especially
/🆑
2024-01-04 02:13:48 +01:00
lessthanthree
aada68392a Make server announcement OOC [NO GBP] (#80741)
## About The Pull Request

Makes the server admin announcement use tgchat's OOC colors and stops
using announcement.ogg, so players don't mistake it for a Centcom
announcement.


![image](https://github.com/tgstation/tgstation/assets/83487515/32b965a3-58df-45d5-9238-fdb954c8448e)


![image](https://github.com/tgstation/tgstation/assets/83487515/3174d8c9-4194-4a96-844b-d92a6723dce2)

## Why It's Good For The Game

Melbert was right.

## Changelog

🆑 LT3
fix: OOC announcements will now be in shown in OOC colors
/🆑
2024-01-04 02:01:20 +01:00
Bloop
73d8721951 Fixes some runtimes in pathfinding (and bonus) (#80735)
## About The Pull Request

Found these while running a test server all night. I am not sure if the
second one really causes issues because `.` is being set to something
but it is is certainly polluting the runtime logs.

Also fixes an unrelated runtime with one of the admin verbs, where it
would runtime if you canceled out of the input prompt.

## Why It's Good For The Game

Less runtime spam.


![IklvTShHJB](https://github.com/tgstation/tgstation/assets/13398309/2441ad6b-67b7-4d65-83a3-eabba4516fe9)


![veGkt0Eyul](https://github.com/tgstation/tgstation/assets/13398309/e99eced9-89e6-4065-93d9-578795ddbd8d)

## Changelog

🆑
fix: fixes some runtimes in pathfinding code, as well as one in the give
direct control admin verb
/🆑
2024-01-03 15:13:37 -05:00
Yaroslav Nurkov
98f489a33d Map export admin verb/buildmode (#80326)
## About The Pull Request

The base for the PR was taken from
https://github.com/shiptest-ss13/Shiptest/pull/206 and thank them for
that.

The point of this verb is to save pieces of the map to your computer for
further use. It's not that necessary, but rarely, it can be useful.

[Video](https://i.imgur.com/M6mdDTC.mp4)

## Why It's Good For The Game

Transferring buildings from one round to another, preserving the decor
made in the game.

## Changelog
🆑 Vishenka0704
admin: The ability to export a part(or z-level) of the map has been
added.
/🆑
2024-01-02 14:40:42 -07:00
Bloop
f34174414d Cleans up some extra args in Destroy() (#80642)
## About The Pull Request

After https://github.com/tgstation/tgstation/pull/80628, these shouldn't
be needed anymore right?

## Why It's Good For The Game

Cleans up some vestigial code

## Changelog
EDIT: Not player-facing.
2023-12-30 03:54:07 +01:00
Timberpoes
8a6f660141 Fixes runtime which prevents Sentience Fun Balloons working. (#80536)
## About The Pull Request

Fixes #80534

```
[2023-12-23 19:23:03.446] RUNTIME: runtime error: Cannot read "sentience fun balloon".layer
 - proc name: poll candidates (/datum/controller/subsystem/polling/proc/poll_candidates)
 -   source file: code/controllers/subsystem/polling.dm,90
 -   usr: Bob Stange (/mob/dead/observer)
 -   src: Polling (/datum/controller/subsystem/polling)
 -   usr.loc: the floor (166,47,1) (/turf/open/floor/iron)
 -   call stack:
 - Polling (/datum/controller/subsystem/polling): poll candidates("Would you like to be test?", "Sentience Potion Spawn", "Sentience Potion Spawn", 100, "shuttle_denizens", the sentience fun balloon (/obj/effect/fun_balloon/sentience), /list (/list), "sentience fun balloon", "Sentience Potion Spawn")
...
```

Classic off-by-one error, except instead of a mathematical error it was
a logical error.


`/datum/controller/subsystem/polling/proc/poll_ghost_candidates_for_mobs(...)`
called `poll_ghost_candidates` with an incorrect number of args,
omitting the `flashwindow` arg and causing `pic_source` to be passed as
`flashwindow` and `role_name_text` to be passed as `pic_source`.

Since `role_name_text` is a string, this causes the above runtime as the
code tries to access the `.layer` member of the string. Which strings
don't have. Because they're strings.

I added the missing `flashwindow` arg and tidied up the base proc call a
touch back at the sentience balloon layer, since I noticed it was using
named args out of order which - while valid - could cause issues in any
future refactor or copypasted code.
## Why It's Good For The Game

Sentience Fun Balloons work again!
## Changelog
🆑
fix: Fixed an issue with polling ghost roles to control multiple mobs
that prevented Sentience Fun Balloons from working as intended.
/🆑
2023-12-24 23:49:47 +01:00
Ghom
f3983e3901 Color matrix defines for filters and identity (#80320)
This PR converts the procs `color_matrix_identity`,
`color_matrix_lightness` and `color_matrix_contrast` into
defines/macros. Also adds in defines for common color matrix filters.

I don't like how `color_matrix_identity` is a one-line proc with no arg.
Also these help people identify the sort of color matrix filter is being
used.
2023-12-24 20:14:01 +00:00
13spacemen
908d6f1a2b Better Ghost Selection (#80283)
## About The Pull Request
Revived my old PR https://github.com/tgstation/tgstation/pull/68901

Replaces the annoying tgui alert popup "Do you want to be X? | Yes | No
| Never for this round" that is hard to read and steals window focus,
with a nice clean alert in the top right that counts down. If it's the
same event/mob they stack with 2x, 3x, etc. It also shows how many
candidates/ghosts are signed up.

The poll alerts have screentips too, they countdown and show if you're
signed up, how many people are signed up, if you chose "never for this
round" (which is cancelable)
## Why It's Good For The Game
![Screenshot 2023-12-13
030302](https://github.com/tgstation/tgstation/assets/46101244/04061a6b-cd9a-4546-9d71-bba6a6b70d87)

Way easier to see what role is available, you get a nice pic of the role
and get it's name in big text, you can cancel "never for this round",
and you can cancel signing up for a role before the timer is up
## Changelog
🆑
refactor: Ghost roles now offer ghosts a clickable poll button. Ghosts
can select a role, deselect it, alt-click it for "Never For This Round",
can cancel "Never", can see the countdown, and can see how many other
people are signed up for the role poll.
/🆑
2023-12-22 11:44:55 -08:00
lessthanthree
f2ba7a8e94 Admin server announcement uses new announcement span (#80403)
## About The Pull Request

The current admin announce is just notice span text, which is easily
missed mixed in with all the other white noise of the chat box.
Currently admins have to fill it with linebreaks or manually add their
own spans to increase visibility.

This updates the admin announcement proc to use the new alert box divs,
similar to other announcements, making it more visible.

## Why It's Good For The Game

Admin server-wide announcements are generally things you want the
players to notice


![image](https://github.com/tgstation/tgstation/assets/83487515/460bacbb-3a7f-4855-9e16-24b1533f61bd)

## Changelog

🆑 LT3
admin: Server wide admin announcements now use an alert box like other
announcements
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2023-12-19 20:06:53 +00:00
Fikou
2125aae0c4 adds head of staff job flag (#80415)
## About The Pull Request
as we added a command role that isn't a head of staff, itd be good to
untie some checks from the command department
so i added a job flag for that, and moved what made sense to different
traits that are added to head of staff minds

## Why It's Good For The Game
revs (the gamemode not the players) shouldnt care about the bridge
assistant existing

## Changelog
🆑
fix: bridge assistant no longer passes some head of staff checks
qol: if you steal a command member's liver, you can now sabre better!
/🆑
2023-12-18 16:07:25 +01:00
Fikou
a3fa541e2e Bridge Assistant Station Trait (#80279)
## About The Pull Request
adds a station trait which adds a new role, the bridge assistant
he is designed to help commandeer the bridge and help out other heads
when needed. he is armed with the mini energy gun (the one heads used to
have on kilostation), a flash, a toolbelt (with an inducer), some cool
shades and a swanky scarf.
as he is a nerd he is weak and unable to twohand weapons, preventing him
from wielding the fire axe.
currently he does not have a mindshield but he cannot roll antag
he currently has access to the bridge, announcement console, eva,
teleporter, gateway, maint, and a weapon permit (somewhat (not really
other than for nerds) interestingly this is the first job that isnt
assistant that doesnt have access to any lathes, so he doesnt have orm
access unlike all the other jobs (except assistant))
the trait also makes a coffee machine spawn on the bridge
here is some useful art of your role

![image](https://github.com/tgstation/tgstation/assets/23585223/905e5527-9069-4226-b160-8dedd1ea7b74)
and ingame screenshots

![image](https://github.com/tgstation/tgstation/assets/23585223/0aa537ac-a791-4249-a702-490584919fd9)

![image](https://github.com/tgstation/tgstation/assets/23585223/eb93e2d1-0291-4ade-9208-b1c0b68648c7)

![image](https://github.com/tgstation/tgstation/assets/23585223/1d3c2f11-8ac0-4ee9-91a5-176f81a08dcb)


## Why It's Good For The Game
Adds upon the station trait job system with a straight forward role that
IS just a human (unlike the cargorilla), and is pretty basic with no
custom assets or whatever other than hud icons
Having the bridge assistant in some rounds seems like a neat way to
protect it since it gets fucked up in like half the time, while also not
having enough mechanical depth or gameplay as to warrant it as a
permanent role

## Changelog
🆑
add: Bridge Assistant job accessible from a station trait.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-12-16 20:02:45 -05:00