Commit Graph

131 Commits

Author SHA1 Message Date
SmArtKar
cd5b2c2b82 [NO GBP] Fixes some filterrific functions not working (#93232)
## About The Pull Request

Non-smooth modification and renaming didn't work, and mass application
broke a lot of things (always, did actually)

## Changelog
🆑
fix: Fixed some Filterrific functions not working
/🆑
2025-10-02 12:37:17 -07:00
SmArtKar
4a2efa2928 Refactors filters to utilize binary insertion instead of timSort (#93053)
## About The Pull Request

update_filters() is more expensive than it should be due to running
timSort every time a filter is added or removed, plus we wipe
re-initialize the entire atom filter list every time we call it. I
swapped it to use binary insertion into the main list, and we can cut
down on the amount of filter churn by storing filters in a separate list
which we can use Insert on, which allows us to stop constantly deleting
and recreating filters completely.

## Why It's Good For The Game

Server CPU consumption go down

## Changelog
🆑
refactor: Refactored filters to utilize binary insertion instead of
timSort. The server should run somewhat faster now, hopefully.
/🆑
2025-09-21 14:48:38 +02:00
Gaxeer
0c10a3684d remove useless view_variables verb from stat panel (#92040)
## About The Pull Request

Make `VV` verb Context Menu only.
As it's very annoing when clicked on, because it's forming the list of
all atoms in world which causes nasty client freeze.

## Why It's Good For The Game

No more accidentally clicking VV when trying to click View Runtimes 😠 

## Changelog

🆑
admin: VV verb is removed from Debug tab. Who is even using it?
/🆑
2025-07-09 09:39:23 -04:00
necromanceranne
57624ca1e2 Rebalances wound determination values, wounding escalation and wound armor to hopefully be less explosive (#91099)
## About The Pull Request

This is a big one so please bear with me, wounds are complicated

### Max Potential Wound Rolls

We've decreased the max contributed damage to wound rolls from 35 to 25.
This results, after the exponent, a max possible wound roll of 1 to 91
before any modifiers (assuming the attack, after armor, is 25 or above).

The minimum value to wound is still 5.

### Wound Escalation Penalties

Most wounds were contributing significant numbers per wound type to the
potential for a new wound to occur. Getting wounded once meant you were
getting wound a lot, but actually getting past that first wounding may
be the tricky part.

We have significantly reigned in the wound penalty that having a wound
contributes, and instead utilize the series wound penalty to allow same
type wounds to escalate themselves faster as a priority. Having wounds
still makes you more wound vulnerable, just not to such an extreme
degree.

The priority here for what wounds matter most for contributing to
overall wounding vulnerability is ``Infected BURNS > BURNS >
SLASH|PIERCE > BLUNT.``

### Wound Armor

Wound armor, unlike all other kinds of armor, was used as a additive
value to the wound roll modifiers rather than a multiplicative value.

We have reworked how wound armor is determined by changing how wound
modifiers are calculated.

Firstly, we're passing our entire injury roll into the
``check_woundings_mod()`` proc, as we're not treating this as a proc
that just adds values anymore.

Secondly, bare wound bonus only applies if there is no potential wound
protection from any source, as expected. But it comes last in the
calculations.

Thirdly, wound protection is applied to the injury roll last, after
wound bonuses from the attack, wound bonuses from other wounds and wound
bonuses from a disabled limb are applied. This does not include serial
wound bonuses, which are determined outside of this proc.

Wound protection comes from two sources. Clothing and limb wound
resistance. Your chest and head have an amount of wound resistance so
long as they are not mangled in any fashion. Being mangled means having
either a hairline fracture or a weeping avulsion wound.

Wound protection reduces the final injury roll by a percentage. Say our
roll is 50, and we have effectively 50% wound protection. The final roll
would be 25.

### ~~Wound Armor on Clothing~~ Reverted

~~Most clothing have had their wound armor values changed. As a loose
rule, I used the highest of melee or bomb armor, except where that value
was 100, in which case I used the lowest instead. I'm basing this
decision on how embeds are calculated, which is attack type agnostic.~~

~~Some armor have inconsistent values because they are alternative
armors to an existing armor type or are hyperspecialized armor.
Ablative, bulletproof and security vests all share a value of 35,
despite the former two not having decent melee or bomb armor.~~

~~Some clothing missing wound armor that should have had them now have
wound armor.~~

~~This may need a bit of scrutiny in case one or two seem weirdly high.
Some have maybe become too low. Its a bit hard to say.~~

### The ``bare_wound_bonus`` variable

I changed it to ``exposed_wound_bonus`` to better represent when it
applies. You can be naked and still not be affected by this bonus if the
limb has wound resistance.

## Why It's Good For The Game

I'm not promising anything with this PR, but this is an attempt to
sanity check the values on wounds so that we're not seeing what the data
that determined the removal of beheading presented. An extreme
over-representation of tier 3 wounds. ~~And, from that, maybe I can
argue for beheadings coming back. That's my goal. I think beheadings
happened so much because the numbers were in need of work.~~ Well okay I
just wanna make wounds a bit more workable actually more than I want
beheadings.

Why is it that tier 3 wounds were so over-represented? Because wounds
will often force more severe wounds of other types by merit of any
wounds existing at all on a limb. Having **_a_** wound makes you more
wound prone for any kind of wound, and not just making you more likely
to suffer a more severe type of the same wound.

The threshold mechanic was intended to simulate making a wound worse,
but oddly just made a limb broadly more prone to getting worse from any
kind of attack to such a degree that future wound rolls of different
types were often going to start at the threshold necessary to be a tier
3 wound.

Dismemberment, mind you, requires you to suffer a flesh wound while you
have a bone wound of tier 2 or higher (with tier 3 giving a bonus to
this). You can do this readily via just a sharp weapon, because having a
mangled limb causes the wound to turn into a bone wound. Technically,
this is meant to be less likely as the effective damage for this wound
is halved. But the wound bonus from having a flesh wound was almost
always significant enough to kick your new bone wound up to a tier 3.

In other words; its not surprising that you saw so many beheadings,
because the system wanted to behead you as fast as it possibly can
thanks to all these escalating values.

Wound armor was only applied as a flat reduction on the roll. The
average for wound armor was 10. After receiving a single wound, you can
expect wound rolls to reach upwards of 100, even if the actual damage
roll was not particularly high, due to wound stacking bonuses form being
wounded.

This meant that wounds, if they happened, came thick and fast after the
first, regardless of what your protection might be to wounds. It was
just a matter of getting past the initial bump.

This is why effects that forced wounds were so powerful. They basically
made a given limb more prone to taking a wound without having to deal
with the protection problem first.

Finally, this is just a broad flaw with the system that is not its
fault. It is actually a problem that isn't a problem. Most people in the
game are not wearing helmets that protect their head. So most people are
going to suffer from a higher proclivity of being wounded if people are
aiming for the head. There is this...kind of cargo cult belief that
aiming for the head means you do more damage, or can stun someone if
you're lucky or what have you. It's entirely nonsense, but it has a
grain of truth in that people rarely wear, or even have access too,
headwear that provides wound protection or any protection at all. People
have jumpsuits, which are universally wound protected, but that isn't
true of the head. Look, the point is, they're not aiming at the head
because it is usually less armored, its for other reasons but it just so
happens to become true due to wounds and how wounds roll their type.

To soften this issue, I've decided to treat wound resistance as armor
until the limb suffers a tier 3 wound. This way, hits to the head MAY
not necessarily escalate to tier 3 instantly as they would on live even
from relatively low power weapons. Some weapons have very low force, but
have extreme bare wound bonuses. This should be less likely after this
change. I doubt this will necessarily make high damage high wound
weapons like energy swords any less prone to cutting you clean open, but
it might thanks to the reduction to contributed damage to the injury
roll. The system is now _a bit more random_.

## Changelog
🆑
balance: Wounds do not make you as vulnerable to suffering wounds of all
types as before. Instead, wounds make you more vulnerable to suffering
worse versions of themselves as a priority.
balance: Wound armor is now more impactful when protecting you from
wounds when you have already been wounded.
balance: Your head and chest are more difficult to wound until they have
been mangled; either from suffering from a weeping avulsion or a
hairline fracture.
code: Changed the variable for bare_wound_bonus to exposed_wound_bonus
to better explain what that variable is doing.
/🆑

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
2025-06-19 17:49:59 +02:00
MrMelbert
92c9a72b8a List VV properly differentiates null vs 0 2025-05-09 23:51:21 -05:00
TiviPlus
569d25a8de Dissallow non R_VAREDIT admins from using VV topic and modifying traits (#90763)
## About The Pull Request

So
A) Modifying traits pretty self explanatory was a missing check
B) imo given the type of data that can be seen in vv this shouldnt be
exposed to literally anyone with an admin datum especially considering
actually showing it to someone else and editing it is R_admin and
r_varedit

the giant diff is just indentation change
Showing vv to other players is unaffected by this

## Changelog
🆑
fix: fixed some vv issues
/🆑

---------

Co-authored-by: TiviPlus <572233640+TiviPlus@users.noreply.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
2025-04-30 19:16:42 +00:00
Holoo
8f3f0851be Drops support for 515. Bumps compile ands tests to 516 (#90460)
## About The Pull Request
Title. If compiled on 515 the game screen will be black
## Why It's Good For The Game
There is no reason for it to exist if connecting from 515 is not allowed
2025-04-08 00:03:15 +02:00
harry
2691b9a721 makes various uis more compatible with high dpi monitors, adds a preference for smaller windows (#90418)
## About The Pull Request
various uis (tgui-say, vv, player panel, anything using
`/datum/browser`) would not correct for dpi. they now do

we also have a preference to allow you to have smaller windows that are
zoomed out, instead of larger windows that are not zoomed

#### of note, this does require a small change to the usage of css
viewport units, like `vh` and `vw`. they need to be fed through the
`vp(100vw)` function first. there was only one such unit in the codebase

on 4k monitor with 200% scaling:

fixed (pref on default)

![BiygmRan0QqxOMqL@2x](https://github.com/user-attachments/assets/1bdbc93c-1cd4-4a17-bf18-6cca7a5df032)

pref disabled

![DUWSVJNXt3xuQJEy@2x](https://github.com/user-attachments/assets/1b87ed9e-0498-44c4-ab1b-2c0321e70ce0)


## Why It's Good For The Game
516 fucked with uis again and this unfucks them a bit

## Changelog
🆑
qol: there's a new UI preference called UI scale which allows people
that use windows scaling to have their UIs original size with the
contents zoomed out, instead of the default, which is the UIs being
larger with the contents "normal" size
fix: various UIs did not respect windows scaling, they now do
/🆑

---------

Co-authored-by: harryob <55142896+harryob@users.noreply.github.com>
2025-04-06 21:54:57 +02:00
Watermelon914
6c017cf1e1 Refactors subsystems to use dependency-ordering to determine init order. Subsystems can now declare their own dependencies. (#90268)
## About The Pull Request
As the title says.
`init_order` is no more, subsystems ordering now depends on their
declared dependencies.
Subsystems can now declare which other subsystems need to init before
them using a list and the subsystem's typepath
I.e.
```dm
dependencies = list(
    /datum/controller/subsystem/atoms,
    /datum/controller/subsystem/mapping
)
```
The reverse can also be done, if a subsystem must initialize after your
own:
```dm
dependents = list(
    /datum/controller/subsystem/atoms
)
```
Cyclical dependencies are not allowed and will throw an error on
initialization if one is found.
There's also a debug tool to visualize the dependency graph, although
it's a bit basic:

![image](https://github.com/user-attachments/assets/80c854d9-c2a5-4f2f-92db-a031e9a8e257)

Subsystem load ordering can still be controlled using `init_stage`, some
subsystems use this in cases where they must initialize first or last
regardless of dependencies. An error will be thrown if a subsystem has
an `init_stage` before one of their dependencies.

## Why It's Good For The Game
Makes dealing with subsystem dependencies easier, and reduces the chance
of making a dependency error when needing to shift around subsystem
inits.

## Changelog
🆑
refactor: Refactored subsystem initialization
/🆑
2025-04-03 17:04:30 -04:00
Aylong
2df73da53e Fix ByondUI small map preview (#90277)
## About The Pull Request
This PR should fix the problem of small previews in TGUI once and for
all (I hope).

What was causing it? Because TGUI takes a long time to open, that's why
previews were generated broken (small).

On Byond 515 this problem was not so noticeable as the interfaces opened
faster, but with the release of 516 it became much worse.
Previews were generated inside a window that was not yet open, so the
scale was broken, sometimes the window would open before the preview was
done and sent, usually with small interfaces, or when reopening.

I'm not very good at working with signals, and to tell the truth this is
my second experience with them, so I hope I did it right.

## Why It's Good For The Game
No more small map previews

<details> <summary> Video </summary>


https://github.com/user-attachments/assets/834f3820-cc6a-4f65-90e5-d6bb2a118bcf

</details>

## Changelog

🆑
fix: Fixed small character preview, color matrix preview, mech preview,
and other previews with uses ByondUI map
/🆑

---------

Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com>
2025-03-28 05:26:48 +01:00
LemonInTheDark
ded0ee6362 Bitflag Metainfo, Usable (Happy 90000th) (#90000)
## About The Pull Request

Makes wrapper procs to support working with bitflags as defined "things"
rather then EXCLUSIVELY numbers, mostly for getting random flags.

I've ~~also added a unit test to prevent bitfields from being double
defined~~ stolen some code form moth to make double definitions here a
compile error.

This does rely on people actually using the bitfield lists, essentially
upgrading them from breaking just admin debug to POTENTIALLY breaking
game logic (slightly). Would like input on this @tgstation/commit-access

## Why It's Good For The Game

More tools for feature coders to play with, more sane code
2025-03-19 19:54:03 +00:00
TiviPlus
7467212567 Clean up some cruft in mass var edit (#89548)
## About The Pull Request
just cleaning out the cobwebs

Mixed usr/src, using set on a proc /datum/o
casting atom but taking datums

## Changelog
🆑
code: cleaned up some mass var edit code
/🆑

---------

Co-authored-by: TiviPlus <572233640+TiviPlus@users.noreply.com>
2025-02-28 17:43:39 +01:00
Lucy
d656f0f4ec Refactor GLOB.admin/debug/fun_state into cached /datum/ui_state/admin_state instances (#89417)
## About The Pull Request

So, some admin verbs/tools that used tguis, i.e edit/debug planes, were
available to admins with +DEBUG... but the ui_state used
`GLOB.admin_state`, which checks for +ADMIN - meaning that if they
_only_ had +DEBUG, they would have the verb... but it would do nothing
when they used it.

I've refactored `GLOB.admin_state`, `GLOB.debug_state`, and
`GLOB.fun_state` into a merged `/datum/ui_state/admin_state`, with a var
for which specific permissions are being checked for.

You now use the `ADMIN_STATE(perms)` macro to get the UI state for those
specific perms, i.e `admin_state(R_ADMIN)` or `admin_state(R_DEBUG)`,
and the resulting UI state will check for _those specific perms_.

These are initialized and cached in `GLOB.admin_states` (which should
never be directly accessed).

So, I've went thru every single usage of `GLOB.admin_state`,
`GLOB.fun_state`, and `GLOB.debug_state`, and made them all use
`ADMIN_STATE()` with the actual permission flags needed to use said UI
in the first place.

## Why It's Good For The Game

Kinda dumb for specific admin permissions to be granted verbs that don't
let them use it anyways.

## Changelog
🆑
admin: Certain UI-based tools (plane debugger, filter editor, etc) that
were given to admins with only +VAREDIT or +DEBUG, but refused to open
without +ADMIN, now actually work for admins that have the needed
permission.
/🆑
2025-02-17 00:54:00 +01:00
MichiRecRoom
344d3b6266 Optimizes /proc/icon_exists() (#89357)
## About The Pull Request
This PR reimplements https://github.com/tgstation/tgstation/pull/71538
atop `master`. Quoting the original PR:

> Every `icon_exists()` call will cache the entire file. Past me didn't
realise _why_ file opts were so expensive, but I do now. This is
immeasurably slower on a single call, and _significantly_ faster on
subsequent calls to the same file.

I attempted to handle some of the review comments that were posted
there, by splitting screaming functionality into its own proc.

* `if(icon_state in icon_states(file))` and `if(!(icon_state in
icon_states(file)))` were refactored to use `icon_exists(file,
icon_state)`.
* Where screaming was seemingly wanted (and where there wasn't a more
descriptive error inside the `if` block), I refactored them to use
`icon_exists_or_scream(file, icon_state)`
* The exception to the above was under
`/datum/unit_test/turf_icons/Run()` and
`/datum/unit_test/worn_icons/Run()`, where `icon_states()` was being
passed a mode flag. Given that this is only used in unit tests (where
performance isn't a priority), I opted to leave these be.

Additionally, I revised the documentation comment for
`/proc/icon_exists()`, as I felt it was a bit vague currently.

## Why It's Good For The Game
https://youtu.be/Z9G1Mf6TZRs

## Changelog
No player-facing changes (hopefully).

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
2025-02-05 20:00:27 +01:00
John Willard
2e4d70afe5 Updates href uses for 516 (#88699)
## About The Pull Request

Was just scrolling through the Paradise github since they seem to have
more work done for 516 to see if there's anything I can port over, found
this and thought why not.

Ports parts of https://github.com/ParadiseSS13/Paradise/pull/25105
Specifically, updaing all hrefs to use the internal ``byond://``, and
adding it to grep.

## Why It's Good For The Game

More work towards 516.

## Changelog

Nothing player-facing.
2024-12-24 11:42:20 -08:00
Lucy
a3a3fd7a15 Admin deleting a mob now ghostizes it beforehand, preventing a runtime (#87887) 2024-11-14 14:05:39 +01:00
MrMelbert
74f8e7846a Adds item VV header (#87052)
## About The Pull Request

Adds VV header for items, letting quick modification of a few of an
item's combat values..


![image](https://github.com/user-attachments/assets/587d072e-03f0-4c1e-b9b0-f837efb60434)

## Why It's Good For The Game

In testing, I find I tweak these values commonly, to test how effective
an item is vs armor, or how strong a new item should be, etc etc. So
having quick access to these might be cool

I thought about adding a few more like throwforce but I didn't want to
clutter it too much

## Changelog

🆑 Melbert
admin: Items now have a header in VV allowing for quicker editing of
combat properties
/🆑
2024-10-07 14:30:15 +02:00
LemonInTheDark
56d06ad1c1 Actually fixes MA issue w ifdefs (#86579)
## About The Pull Request

I FORGOT TO COMMIT AHHHH

#86538 WAS JUST THE REMOVAL
2024-09-10 23:16:18 +02:00
klorpa
69176298ed Spelling Fixes (#86056)
## About The Pull Request
Fixes several errors to spelling, grammar, and punctuation.
## Why It's Good For The Game
Improves readability and user experience.
## Changelog
🆑
spellcheck: fixed a few typos
/🆑
2024-09-10 17:04:59 +02:00
LemonInTheDark
f54345607a ifdefs out now removed mutable appearance vars (#86538)
Can't do it fully cause the min version isn't bumped up. Also uh, 1643
breaks MA new overrides so like, what can ya do
2024-09-08 15:22:19 -04:00
klorpa
e1bf793264 Spelling and Grammar Fixes (#86022)
## About The Pull Request
Fixes several errors to spelling, grammar, and punctuation.
## Why It's Good For The Game
## Changelog
🆑
spellcheck: fixed a few typos
/🆑
2024-08-23 21:49:46 +02:00
John Willard
1880003270 Reworks silicon/ai access checking & fixes some ui_act's (#84964)
## About The Pull Request

Currently to check for Silicon access, we do:
``if is silicon or is admin ghost or has unlimited silicon privileges or
has machine remote in hand``
What has unlimited silicon privileges? Bots, Drones, and admin ghosts.
To check for AI access, it just checks for AI instead of silicon, and
doesnt check for unlimited silicon privileges.

This was kinda silly, so I thought I should make this a little easier to
understand.
Now all silicon/ai traits come from ``AI_ACCESS_TRAIT`` or
``SILICON_ACCESS_TRAIT``. I made a single exception to keep Admin ghost,
since now instead of being a var on the client, we moved it to using the
same trait but giving it to the client instead, but since we have to
keep parity with previous functionality (admins can spawn in and not
have this on, it only works while as a ghost), I kept previous checks as
well.

No more type checks, removes a silly var on the mob level and another on
the client.

Now while I was doing this, I found a lot of tgui's ``ui_act`` still
uses ``usr`` and the wrong args, so I fixed those wherever I saw them,
and used a mass replace for the args.

Other changes:

- machinery's ``ui_act`` from
https://github.com/tgstation/tgstation/pull/81250 had ``isAI`` replaced
with ``HAS_AI_ACCESS``, this has been reverted. Machine wands and admin
ghosts no longer get kicked off things not on cameras. This was my
fault, I overlooked this when adding Human AI.
- Human AI's wand gives AI control as long as it's in your hand, you can
swap to your offhand. I hope this doesn't end up going horribly,
otherwise I'll revert this part. It should let human AIs not have their
UI closed on them when swapping to eat food or use their door wand or
whatnot.
- Bots previously had special checks to scan reagents and be
unobservant, I replaced this with giving them the trait. I also fixed an
instance of unobservant not being used, so now statues don't affect the
basic creature, whatever that is.

## Why It's Good For The Game

This is an easier to understand way of handling silicon access and makes
these mobs more consistent between eachother.
Other than what I've mentioned above, this should have no impact on
gameplay itself.

## Changelog

🆑
fix: Statues don't count as eyes to creatures.
fix: Human AIs and Admin ghosts no longer get kicked off of machines
that aren't on cameranets.
/🆑
2024-08-19 10:43:45 +00:00
LemonInTheDark
78fc87315c Removes stupid listlike var access code (#84648)
## About The Pull Request

[Removes all other listlike var
accesses](4c5996b5c8)

Also fucking dumpsters an unused proc that allowed for arbitrary
variable modifcation. Bad juju

This is undefined behavior and errors in later 515 versions. also it's
stupid as hell
2024-07-06 01:49:17 +02:00
YesterdaysPromise
8eb3b51ad9 /icons/ folder cleansing crusade part 3 (#83420)
## About The Pull Request

In my effort to make the /icons/ folder cleaner and more intuitive
instead of having to rely on recalling names of stuff and looking them
up in code to find them for poor sods such as myself, plus in spurt of
complusion to organize stuff, here goes. I've tracked all changes in
commit descriptions. A lot still to be done, but I know these waves go
over dozens of files making things slow, so went lighter on it.
Destroyed useless impostor files taking up space and cleaned a stray
pixel on my way.

## Why It's Good For The Game

Cleaner /icons/ file means saner spriters, less time spent. Stray pixels
and impostor files (ones which are copies of actually used ones
elsewhere) are not good.

## Changelog

🆑
image: Cleaned a single stray pixel in a single frame of a bite
telegraphing accidentaly found while re-organizing the files.
/🆑
2024-05-25 21:08:08 -07:00
LemonInTheDark
21b6abfcd6 Redoes how appearance VV works because it scares me (#82851) 2024-04-24 16:23:54 -06:00
EvilDragonfiend
20e67664ed Allows vv investigate /appearance + better checking image (#82670) 2024-04-21 20:46:42 -06:00
Zephyr
7f8752be14 Admin Verb Datums MkIII | Now with functional command bar (#82511) 2024-04-12 12:27:09 -07: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
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
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
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
distributivgesetz
274eb2a52e Removes Clone Damage (#80109)
<!-- 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

Does what it says on the tin. We don't have any "special" sources of
clone damage left in the game, most of them are rather trivial so I
bunched them together into this PR.

Notable things removed:
- Clonexadone, because its entire thing was centered around clone damage
- Decloner gun, it's also centered around cloning damage, I couldn't
think of a replacement mechanic and nobody uses it anyways
- Everything else already dealt clone damage as a side (rainbow knife
deals a random damage type for example), so these sources were removed

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

## Why It's Good For The Game

Consider the four sources of normal damage that you can get: Brute,
Burn, Toxins and Oxygen. These four horsemen of the apocalypse are very
well put together and it's no surprise that they are in the game, as you
can fit any way of damaging a mob into them. Getting beaten to death by
a security officer? Brute damage. Running around on fire? Burn damage.
Poisoned or irradiated? Toxin damage. Suffocating in space? Brute, burn
and oxygen damage. Technically there's also stamina damage but that's
its own ballpark and it also makes sense why we have a damage number for
it.

Picture this now: We have this cool mechanic called "clone pods" where
you can magically revive dead people with absolute ease. We don't want
it to be for free though, it comes at a cost. This cost is clone damage,
and it serves to restrain people from abusing cloning.

Fast forward time a bit and cloning is now removed from the game. What
stays with us is a damage number that is intrinsically tied to the
context of a removed feature. It was a good idea that we had it for that
feature at the time, but now it just sits there. It's the odd one out
from all the other damage types. You can easily explain why your blade
dealt brute damage, but how are you going to fit clone damage into any
context without also becoming extremely specific?

My point is: **clone damage is conceptually a flawed mechanic because it
is too specific**. That is the major issue why no one uses it, and why
that makes it unworthy of being a damage stat.
Don't take my word for it though, because a while ago we only had a
handful of sources for this damage type in the game. And in most of the
rounds where you saw this damage, it came from only one department. It's
not worthwhile to keep it around as a damage number. People also didn't
know what to do with this damage type, so we currently have two ways of
healing clone damage: Cryotubes as a roundstart way of healing clone
damage and Rezadone, which instantly sets your clone damage to 0 on the
first tick. As a medical doctor, when was the last time you saw someone
come in with clone damage and thought to yourself, "Oh, this person has
clone damage, I cannot wait to heal them!" ?

Now we have replacements for these clone damage sources. Slimes? Slime
status effect that deals brute instead of clone. Cosmic heretics? Random
organ damage, because their mechanics are already pretty fleshed out.
Decloning virus? The virus operated as a "ticking timebomb" which used
cloning damage as the timer, so it has been reworked to not use clone
damage. What remains after all this is now a basically unused damage
type. Every specific situation that used clone damage is now relying on
another damage type. Now it's time to put clone damage to rest once and
for all.

Sure, you can technically add some form of cellular degradation in the
future, but it shouldn't be a damage number. The idea of your cells
being degraded is a cool concept, don't get me wrong, but make it a
status effect or maybe even a wound for that matter.

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

## Changelog

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

🆑
del: Removed clone damage.
del: Removed the decloner gun.
del: Removed clonexadone.
/🆑

<!-- 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. -->
2023-12-04 14:42:43 -08:00
MrMelbert
566c7ba9c2 Removes some code soul (IF YOU ARE COPY PASTING THIS...), replaces it with a macro (#79935)
## About The Pull Request

Replaces all instances of `SSblackbox.record_feedback\("tally",
"admin_verb", 1, (.+)\)` with `BLACKBOX_LOG_ADMIN_VERB($1)`

This makes so the funny comment isn't necessary. 

It also reveals one location which someone did not heed the comment, the
`debug_controller` proc copy+pasted the line but did not change the
fourth argument. PEOPLE DON'T READ!
2023-11-26 20:17:04 -07:00
LemonInTheDark
1d6533c525 Bumps compile to 515 (#79134)
## About The Pull Request

LSP supports it, let's GOOOOOO
I've removed the 515 tests since they're stable, alongside the libcall
wrapper. left the rustgcall wrapper cause yaknow memes
Just removed all the 515 and 514 particular define wrappers. gaming

## Changelog
🆑
server: Minimum compile version has been bumped to 515. clients still
support 514 but we're gonna start using 515 restricted features for
serverside now.
/🆑

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2023-11-25 21:03:29 -08:00
Emmett Gaines
fdbddfb12b Fixes vv of things in lists (#79282)
I forgot name could be a number for list indexes, so this switches to
using `in` instead.


Also improves the error message a little bit so reported issues can at
least say *something* about the value throwing an error.

fixes #79280
fixes #79264
2023-10-26 21:45:58 -06:00
Emmett Gaines
007b7d3f43 Precalculates special list var names and avoids incorrect vv targets (#79154)
## About The Pull Request

This adds a global list to precalculate lists that need to be handled
special by vv instead of manually updating such a list. @LemonInTheDark
brought up a potential issue with handling all lists in the way special
lists are handled, that modifying a list in vv can in some cases result
in the wrong list being opened for editing. This makes only special
lists have the issue instead of blindly accessing all lists the same
way.
2023-10-24 17:43:46 +01:00
Emmett Gaines
1539de0167 VV Upgrades (#78948)
## About The Pull Request

* Makes special byond lists display properly
* Makes images get a preview in the header
* Makes filters display properly
* Make variable value display a bit more robust to errors
* Kills single char vars

## Changelog

🆑
admin: VV can now display the contents of special byond lists like
filters, or client.images
admin: VV on images now displays the image in the header
admin: VV can now display filters and includes their type
/🆑
2023-10-13 11:42:11 -06:00
Emmett Gaines
1053f00082 Fixes display of appearance type in VV (#78725)
## About The Pull Request

Appearance vars are awful to detect. They have a type var you can
access, for an appearance the value of this var is `/image`. However
`istype(appearance, /image) == 0`. This is good enough for
identification, you might think this just means detecting appearance
would be something like `if(thing.type == /image && !istype(thing,
/image))`, but there's a problem with this: `istype(appearance, /datum)
== 0`. For that matter it seems like all istypes that check if an
appearance is some type fail, so you can't know that it's safe to access
the `.type` var to do that earlier combined check.

Now we get into magic territory, `istype(new /image, appearance) == 1`.
I have no clue internally why this is the case but it seems to be unique
to appearances, and so can be used to identify them from a previously
unknown var. You have to rule out that the thing you're checking is a
path, it would pass the check if the value were `/image` then, but this
is simple enough.

I hate having to know all this, so now you know this too.

🆑 ninjanomnom
admin: Appearance vars in VV now display instead of being left blank
/🆑
2023-10-03 16:08:49 +02:00
LemonInTheDark
cd125e6b9e Refsearch Info Injection (#78574)
## About The Pull Request

Adds a proc that types can override to inject extra information into the
refsearch
This'll allow us to more easily track and deal with refs held by general
datums, like callbacks.
I've implemented a template example FOR callbacks, to provide an example
and assist in solving future issues

Done to help lumipharon from TGMC, they were having trouble with this
case.

This isn't perfectly optimized, but this proc has a LOT of issues just
in general. Need to rework it to cut down on string churn someday
2023-09-26 11:44:41 -06:00
LemonInTheDark
e8537d489e Adds NONE to empty bitflags in VV (#78355)
This has annoyed me forever. Let's do somethin about it.
2023-09-17 01:14:32 -05:00
LemonInTheDark
0e723b5bb7 Removes Sleep Printing Library (#78324)
## About The Pull Request

#76286, which spawned it, is dead. Don't need to hang onto it anymore
per moth's instructions
2023-09-14 18:04:10 -06:00
LemonInTheDark
6d3e268f6a Implements byond_status() for harddel hunting (#77818)
## About The Pull Request

In addition, improves dump_harddel_deets usage to hopefully hit in unit
testing

byond_status() will dump as a part of find_references(). While I'd like
to expand that if we ever get a proper version, this is good for how we
have things setup rn.
2023-08-21 22:59:18 -07:00
Fikou
b77c1c85ea MODLink System (+ NWTLMM) (#77639)
## About The Pull Request
A pact made with `@Kapu1178`
Small changes you should not care about:
RD MODsuit outfit (admin only) no longer has a beret that blocks the
activation of the suit
The beret used by death squad officers no longer is blocked from being
put on a hat stabilizer module
Admins can now Shear matrices of objects in Modify Transform
Multitool buffers have been a little refactored to use a setter proc
that saves them from causing hard dels
Cooler stuff:
A revival and remake of [Nobody Wants To Learn Matrix
Math](https://github.com/tgstation/tgstation/pull/59103), this time with
additional tooling for quick matrix calculations.

![image](https://github.com/tgstation/tgstation/assets/23585223/eb387738-0839-463a-aed8-4703d139b11a)
The MODLink system, available through every MODsuit and MODLink scryers
(a neck item obtainable from advanced modsuit research or
charliestation)
Let's you make a holographic call with any other MODLink user, where you
can chat in realtime and see what's up with em

![image](https://github.com/tgstation/tgstation/assets/23585223/5a822f9f-e823-497e-b766-40055f2fc0d6)
![image](https://github.com/tgstation/tgstation/assets/23585223/062983ee-6058-4e78-a3aa-bccda1a3e224)


## Why It's Good For The Game
Adds a fun way for the crew to communicate with each other that can be
done in real-time with relative privacy compared to radio.

## Changelog
🆑 Fikou, Armhulen, Sheets (+rep for Mothblocks and Potato)
fix: RD MODsuit outfit (admin only) no longer has a beret that blocks
the activation of the suit
fix: The beret used by death squad officers no longer is blocked from
being put on a hat stabilizer module
admin: Admins can now Shear matrices of objects in Modify Transform
admin: Admins now have access to Test Matrices in the VV dropdown, an
all-in-one tool for editing transforms.
add: MODLink system, available through scryers (from RnD and Charlie
Station) and through MODsuits. Lets you call people with holographs!
/🆑
2023-08-19 06:24:57 +00:00
Ghom
d1880d18fc Polishing the greyscale modify menu's lackluster support for non-atom targets. (#77322)
## About The Pull Request

So, I've been recently told that Skyrat uses the greyscale modify menu
for loadouts, and the new ui state kinda borked it. I honestly haven't
taken the possibility that the target could be anything but a subtype of
`/atom` (and still work) into account because much of the code assumes
the target is an atom. It's kinda crappy. Also I hadn't noticed we've an
`unlocked` variable, which makes `vv_mode` var superflous, so i'm going
to remove the latter.
2023-08-09 12:30:33 -05:00
Ghom
7945598305 [NO GBP] Actually fixing the greyscale_modify_menu. (#77208)
## About The Pull Request
EDIT: So, I've to admit and bow my head: #77165 fucked up because I
hadn't properly tested the code. However, this time around, I can assure
you it's been tested.

## Why It's Good For The Game
Fixing my mistakes. This will fix #77246 

## Changelog
N/A.
2023-08-01 14:39:46 -07:00
Ghom
3ee89a7aa7 Fixing the greyscale modify menu not sanitizing inputs. (#77165)
## About The Pull Request
exactly what it reads on the tin. Also the ui is now anchored to the
target and uses their state unless a specific one is set, so that it'll
correctly close or be unusable if the mob user is incapacitated or too
far.

## Why It's Good For The Game
this will fix #70444.

## Changelog

🆑
fix: Fixing some jank with the a greyscale modify menu, like inputs not
being sanitized.
/🆑
2023-07-28 21:03:57 -06:00
Zephyr
763112fb61 Refactors bardrone area based godmode into an element (#76619)
Let's this be used for more than just bardrones and for more than just
the exit shuttle in the future
2023-07-13 03:35:12 +00:00
LemonInTheDark
5b2cd2f34b Always contracts lists when VVing GLOB (#76091)
## About The Pull Request

This takes render times from like 20 seconds to maybe 2 Most of the time
appears to be clientside rn, so the best we could do further would be
reducing the amount of shit that actually needs to render

So like, removing the E C M buttons (or at least adding a toggle to
render them), that sort of thing

## Why It's Good For The Game

A glob vv you can actually use

![image](https://github.com/tgstation/tgstation/assets/58055496/d7c29c9a-aa45-4cad-9f38-7131140cab5b)

## Changelog
🆑
admin: VV for global vars will now load MUCH faster, in exchange lists
are now perma contracted in that particular pane
/🆑
2023-06-17 17:56:05 +02:00
LemonInTheDark
ae5a4f955d Pulls apart the vestiges of components still hanging onto signals (#75914)
## About The Pull Request

Signals were initially only usable with component listeners, which while
no longer the case has lead to outdated documentation, names, and a
similar location in code.

This pr pulls the two apart. Partially because mso thinks we should, but
also because they really aren't directly linked anymore, and having them
in this midstate just confuses people.

[Renames comp_lookup to listen_lookup, since that's what it
does](102b79694f)

[Moves signal procs over to their own
file](33d07d01fd)

[Renames the PREQDELETING and QDELETING comsigs to drop the parent bit
since they can hook to more then just comps
now](335ea4ad08)

[Does something similar to the attackby comsigs (PARENT ->
ATOM)](210e57051d)

[And finally passes over the examine
signals](65917658fb)

## Why It's Good For The Game

Code makes more sense, things are better teased apart, s just good imo

## Changelog
🆑
refactor: Pulled apart the last vestiges of names/docs directly linking
signals to components
/🆑
2023-06-09 06:14:31 +00:00
LemonInTheDark
daf55e611c Cleans up/renames as private some internal var definitions, removes some fucked uses of internal list vars (#75769)
## About The Pull Request

[Improves the documentation of DCS lists, removes old list of callback
docs that no longer
apply](c3821d9f5f)

[Adds a second signal register to decal rotating, adds a trait to
objects under a tile. STOP DIRECTLY READING HIDDEN LISTS I SWEAR TO
GOD](6b3f97a76a)

[Removes direct reads of the timer list, they were redundant
mostly](14fcd9f8a6)

[Please stop directly reading/modifying the traits list to ensure your
dna rot follows the
brain](ec0e5237ec)

[Marks internal datum lists as well internal with
_](57c6577ff6)

[57c6577](57c6577ff6)

Does the same to _clear_signal_refs() in hopes of keeping people from
touching it

## Why It's Good For The Game

They pissed me off.

Users should not be touching these lists, especially in ways that make
assumptions about their structure and are thus prone to breaking if that
ever changes.
Most of these are close to zero cost changes, using a wrapper to solve
the problem, or just yeeting it

Two aren't, Decals with a direction have gained a second signal register
on init, and things that sit underfloor (cables/pipes) now get a trait
when inserted there.

This should have a minimal impact on memory/init time, bugging
@Mothblocks about it just in case
2023-06-05 22:25:09 -06:00