Commit Graph

7 Commits

Author SHA1 Message Date
SmArtKar
ab7f1c12d6 Implements icon size caching to avoid unnecessary load in updatehealth (#88266)
## About The Pull Request

Technically an improved port of
https://github.com/DaedalusDock/daedalusdock/pull/651, instead of only
storing height over 32 pixels for HUDs we store both pure height and
width for the sake of cutting down on icon operation spam (which is
pretty costly). Should save us a significant amount of time, cuts down
update_health_hud times by 45% and total update_health by 30% which is
pretty good for a somewhat hot proc.

## Why It's Good For The Game

Our health HUDs constantly fetch icons ***twice*** every update_health,
jesus.

## Changelog
🆑 SmArtKar, Kapu
code: Implemented caching for icon sizes which should significantly
improve mob health performance due to HUDs constantly fetching icons
/🆑
2024-12-06 23:59:30 +01:00
MrMelbert
3c40876f15 Fix itchy skillchip status effect "Curse of Mundanity", adds unit test for effects set to "Curse of Mundanity" (and missing IDs) (#88240)
## About The Pull Request

Fixes a lot of status effects having the default alert, adds a unit test
to check that status effects don't forget to change it

I chose a test rather than just making the default "no alert" because I
think people making status effects should think about whether it should
have an alert

Also I added a test for effects which did not set an ID because that's
kind of important, I applied the same mindset here to account for
abstract types but admittedly less sold on this one.

## Changelog

🆑 Melbert
fix: You should be afflicted by the "Curse of Mundanity" far, far less
/🆑
2024-11-29 15:41:37 +01:00
MrMelbert
239797a4ee Deletes misleading infinite define, adds defines for clearer status effect durations (#87842)
## About The Pull Request

1. Deletes `INFINTIE`, it is misleading and not at all a big number and
causes bugs
2. Adds `STATUS_EFFECT_PERMANENT` and `STATUS_EFFECT_NO_TICK` to make it
clearer what infinite status effects are
2024-11-12 17:24:27 +01:00
tonty
3f0b4abb8d Replaces world.icon_size (and some magic numbers) with defines (#86819)
## About The Pull Request

All usages of world.icon_size in code have been replaced with new
`ICONSIZE_X`, `ICONSIZE_Y` and `ICONSIZE_ALL` defines depending on
context

Replaces some "32" magic numbers with the defines

A few bits of code have been modified to split up x/y math as well

## Why It's Good For The Game

Magic number bad, code more readable, code more flexible and I'm told
there's an access cost to doing world.icon_size so minor performance
gains

## Changelog

🆑 tonty
code: made some code relating to the world's icon size more readable
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-09-29 13:28:32 +00: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
MrMelbert
eea20b83e3 Kills seconds_per_tick from status effect tick, replaces it with seconds_between_ticks to clarify some things (#77219)
## About The Pull Request

https://github.com/tgstation/tgstation/pull/66573#discussion_r861157216

`status_effect/proc/tick(seconds_per_tick)` is wildly misleading and I
feel like I should address it

For a majority of status effects, they process on fast processing but do
not tick every fastprocessing tick

This means that using `seconds_per_tick` here is not giving you the
seconds between status effect ticks, it's giving you seconds between
processing ticks (`0.2`)

This is how it's misleading - If you have a tick interval of `1
SECONDS`, you'd think `seconds_per_tick` is, well, one. But it's
actually one-fifth. So all of your effects are now 80% weaker.

I have replaced the use of `seconds_per_tick` in tick with
`seconds_between_ticks`.

This number is, quite simply, the initial tick interval of the status
effect divided by ten.

An effect with the tick interval of `1 SECONDS` has a
`seconds_between_ticks` of 1.

As a consequence, some things which were inadvertently made weaker, such
as fire and some heretic things (at a glance), are now a little
stronger.

## Why It's Good For The Game

See above. Makes it more clear what you're doing when working with
effects.

## Changelog

🆑 Melbert
code: Updated some status effect tick code to be more clear of how long
is elapsing between ticks. Some effects that were inadvertently weakened
are now stronger as a result (fire and some heretic effects).
/🆑
2023-08-08 11:54:12 +12:00
MrMelbert
61e45109cc Auto-docs + code improvements + splits up status_effect.dm (#66362)
* Code improvements for status effects in general

* Does this for now

* Throws in a qdeleted check

* A return

* comment tweak

* Missed some ref()s

* Wrong var

* Comment clarifications

* Some more comment clarifications
2022-04-21 15:59:46 -07:00