Commit Graph

7 Commits

Author SHA1 Message Date
oranges
7f3f522874 Add's support for population limits on keep_me_secure component (Loneop event balance change) (#87657)
This is used to set the nuke disk's safety factor from applying on very
low pop player counts, as it's unlikely the disk can be secured.

I don't believe this precludes the event from being randomly chosen, but
it makes sure it wont be a certainty on very low pop when the disk
hasn't been secured from lack of players

Just to clarify this applies only at 9 population or lower.

## Why It's Good For The Game
On very very low pop, the disk is often unsecured, and.. more
importantly, a lone op is likely to have a very high chance of easily
succeeding as there is not enough crew to upkeep a watch on the relevant
areas.

This event is fun on higher populations, and needing to protect the disk
makes sense, but on very lowpop, I think it doens't quite work as
designed, as instead it just means a lot of low pop rounds will end due
to a loneop spawning if there's any ghosts about at all.
## Changelog
🆑 oranges
balance: Nuclear disk no longer needs to be secured at sub 10 population
/🆑
2024-11-06 14:08:34 -08:00
Mothblocks
c1d68698fb Micro-optimize qdel by only permitting one parameter (#80628)
Productionizes #80615.

The core optimization is this:

```patch
-	var/hint = to_delete.Destroy(arglist(args.Copy(2))) // Let our friend know they're about to get fucked up.
+	var/hint = to_delete.Destroy(force) // Let our friend know they're about to get fucked up.
```

We avoid a heap allocation in the form of copying the args over to a new
list. A/B testing shows this results in 33% better overtime, and in a
real round shaving off a full second of self time and 0.4 seconds of
overtime--both of these would be doubled in the event this is merged as
the new proc was only being run 50% of the time.
2023-12-28 13:52:44 -08:00
Bloop
4c870f71ca Fixes a bunch of callbacks that were being qdeleted, and code cleanup (#77904)
## About The Pull Request


![image](https://github.com/tgstation/tgstation/assets/13398309/559eb50a-461c-4220-b628-55412baaffc3)

Continuing the work of
https://github.com/tgstation/tgstation/pull/77850.

it started with finding one that was being missed and causing a
runtime...then I noticed a whole lot more. While I was doing this I
found callbacks that weren't being nulled in `Destroy()`, so I added
that wherever I found these spots as well as some general code cleanup.

There were a lot more of these than I initially hoped to encounter so
I'm labeling it as a refactor.

## Why It's Good For The Game

Fixes lots of runtimes, improves code resiliency.

## Changelog

🆑
refactor: fixed a bunch of instances of callbacks being qdeleted and
cleaned up related code
/🆑
2023-08-25 16:03:27 -06: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
oranges
4c48966ff8 Renames delta time to be a more obvious name (#74654)
This tracks the seconds per tick of a subsystem, however note that it is
not completely accurate, as subsystems can be delayed, however it's
useful to have this number as a multiplier or ratio, so that if in
future someone changes the subsystem wait time code correctly adjusts
how fast it applies effects

regexes used

git grep --files-with-matches --name-only 'DT_PROB' | xargs -l sed -i
's/DT_PROB/SPT_PROB/g'
git grep --files-with-matches --name-only 'delta_time' | xargs -l sed -i
's/delta_time/seconds_per_tick/g'
2023-04-11 21:31:07 -07:00
Vladin Heir
502bc896aa Fake nuclear authentication disks now have a placebo keep_me_secure component (making them more convincing) (#73890)
## About The Pull Request
In #73453, we were given the `keep_me_secure` component. Something I
think was long overdue, really.

However, it came at a terrible price...
<details>
  <summary>The Lore</summary>

Tell me, John Assistant with absolutely no disk verifier skillchip,
which nuclear authentication disk is real?

![image](https://user-images.githubusercontent.com/44104681/224259065-1176d783-355c-4d83-a7a2-d0a5fa1324fa.png)

The one on the plastitanium glass table?

![image](https://user-images.githubusercontent.com/44104681/224259331-3f7bc729-f451-4c52-9534-b4a86a433d91.png)

The one on the titanium glass table?

![image](https://user-images.githubusercontent.com/44104681/224259436-3aeecb65-57c8-4806-82e9-9e586d44d9e5.png)

Or the one on the reinforced plasma glass table?

![image](https://user-images.githubusercontent.com/44104681/224259583-2e2cb6ad-a6a7-4f7f-b012-9102fe51bc01.png)

The one on the plastitanium glass table you say?

![image](https://user-images.githubusercontent.com/44104681/224259817-1edfbe68-94a9-4f0d-be99-c52adf682774.png)
B-but how did you know?!
</details>

tldr: Anyone can tell the real disk apart from fakes because only the
real one has the `keep_me_secure` component examine message! This PR
fixes that by adding the `keep_me_secure` component to fake disks. It
won't actually do anything - and I added a check to `keep_me_secure` so
it won't process if there are no callbacks passed, avoiding Free Lag.
This just gives the fake disks the same examine message as the disk, so
it won't be so obvious.
## Why It's Good For The Game
Bugfix good. Futureproofing good. Fake disk noob trap bad. Disk verifier
skillchip should actually do something.
## Changelog
🆑
fix: Fake nuclear authentication disks have been updated to include the
holographic security sticker found on the real disk, one again making
them convincingly real to the average person.
code: The keep_me_secured component will now only process if it has at
least one callback argument passed.
/🆑
2023-03-11 00:56:23 -07:00
tralezab
77031e2a93 Refactors the Nuclear Authentication Disk's Lone Op Behavior Into a Component, + Examine Message (#73453)
## About The Pull Request

### Refactor

Turns all the behavior for the nuke disk raising lone op probability
when unsecured into a new component, the "Keep Me Secure" component. As
an example (and really, I made it to test that the component was
actually working), there is a new admin plush called the "whiny plushie"
that will change icon depending on whether it is secure or not. Useful!

### Examine

I also added an examine message. Will explain below

## Why It's Good For The Game

The examine message was really what this entire pr's purpose was really
for.

>
[Capsandi](https://tgstation13.org/phpBB/memberlist.php?mode=viewprofile&u=7767)
wrote:
[↑](https://tgstation13.org/phpBB/viewtopic.php?p=665827#p665827)Wed Feb
15, 2023 2:42 pm
Someone needs to pr some sort of indicator as to whether the disk is
'secure' or not so players who don't know about the niche lone op
mechanic won't make the same intuitive assumption (though swat has been
trolled for putting it in the safe before).

I agree with this for the same reasons I did #73016 so I'll restate the
point with it here: A piece of banning a captain recently was that they
didn't secure the disk, but there is no indication in game that the disk
has special condiitons that trigger lone op, just that it should be kept
safe (which yeah, nuke ops want it). I'd rather remove the ambiguity of
a captain knowing this mechanic or not for the sake of the game, a
single examine for it is harmless

I'm considering this administration, not a feature. If maints want me to
take it out and have this be refactor only, that's fine with me

## Changelog
🆑
refactor: Refactors how nuclear activation disk works. Shouldn't notice
a whole lot but if you do, it might be because of this.
admin: Disk now has an examine message for whether it's secure or not,
to make it less ambiguous for players.
/🆑
2023-02-17 23:09:41 +00:00