Commit Graph

11 Commits

Author SHA1 Message Date
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
LemonInTheDark
ed0999e4ea Adds error on qdeling callback, fixes errors this causes (#77850)
## About The Pull Request

You shouldn't ever qdel a callback. If you don't want to own it free
your ref (remove it from a list/set it to null). When all refs are
cleared it'll get cleaned up by byond itself
2023-08-22 21:32:30 -05:00
cnleth
ac6b704191 Mind link speech displays symbols correctly (#76290)
Closes #71991 
Removes a call to sanitize() in mind linker code because tgui_input_text() already sanitizes input by default, symbols now display correctly
2023-06-26 03:31:34 -05: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
MrMelbert
e563148710 Re-pr of #70522 "Space Dragon Update: Up Close and Personal" (#75607)
## About The Pull Request

This PR is a re-pr of ##70522 , with some tweaks: 

Notably:

- Wavespeak is not a say override, but instead uses a mindlink. Meaning
carp and space dragons can still talk verbally, but they can also use
telepathy to talk to all carp and the dragon.
- I would refactor Mind Linker a bit further to be a full datum rather
than a component but that's for another time.
- Removed the gravity aura component in favor of using the existing
forced gravity proximity monitor.
    - Also fixed a bug involving that. Lol.  
- Minor refactoring around the place.
- Reduced the volume on a lot of space dragon sounds. 
- Edited the roundend report for Space Dragons to collate all entries
into one per player.


![image](https://github.com/tgstation/tgstation/assets/51863163/5c3222b2-a80c-4df9-a060-4c5733ab712f)


## Why It's Good For The Game

Space dragon still plays pretty "play lame win game" right now, the
optimal strategy for them is to find the cheesiest spot for a portal and
spam their stun / fire breath to make it unreachable.

I was a fan of the original PR so I updated it and brought it back. 

## Changelog

🆑 IndieanaJones, Melbert
balance: Space Dragon can no longer choose its rift locations freely,
and instead is given 5 pre-determined locations to pick from instead
balance: Space Dragon itself has been buffed in order to support a more
confrontational playstyle, however its wing gust now requires a line of
sight to targets in order to affect them.
balance: Player Space Carp from rifts now have buffed health, but
reduced object damage values. They also gain a temporary speed boost
when hit by Space Dragon's fire breath instead of taking damage.
balance: Carp rift spawn times have been reduced, the healing AOE is now
a 3x3 instead of a 1x1, and apply normal gravity in a large radius
around them
balance: Space Dragon and rift carps now communicate on a private mind
link channel via action button similar to Raw Prophets and Slimepeople.
fix: Fixed Gravity Generator forced gravity not applying. 
fix: Intern Announcer will no longer replace Space Dragon announcements.
qol: The roundend report for space dragons now collates all players who
played a carp into one entry, rather than one per carp spawned.
qol: Space Dragon sounds are much less ear piercingly loud. 
/🆑

---------

Co-authored-by: IndieanaJones <mariosuperstar384@gmail.com>
Co-authored-by: IndieanaJones <47086570+IndieanaJones@users.noreply.github.com>
2023-05-31 10:51:07 -07:00
MrMelbert
329921639a Rewrites how action buttons icons are generated, makes them layer nicer. Allows observers to see a mob's action buttons. (#71339)
## About The Pull Request

- Rewrites how action button icons are generated.
- Prior, generated an action button icon was fairly simplistic and
didn't allow for many changes. Someone recently added the option for
overlays to be generated over action buttons, but the framework was very
weak.
- Now, action button icon generation is split across multiple procs,
like atom icon updates.
      - The background of action buttons are underlays
- The actual icon of the action button is the icon and icon state of the
action button movable
- The rim / border of the button is an overlay, layered overtop the
button.

- Allows observers to see what action buttons a mob has. They even
update in real time! And no, the observers cannot click on them.

## Why It's Good For The Game

- Runechat text of action buttons are no longer hidden behind the actual
icon. This was very ugly with cooldown actions, as the cooldown text was
hidden behind a lot of spell icons.
- Cuts down on a lot of icon duplication. 
- Gives much finer control over action button icons
- Saves a bit of processing from generating full action button icons
when not necessary. Not implemented in many places, but is in some.


![image](https://user-images.githubusercontent.com/51863163/202816617-342e87e6-2cc6-488e-9af2-4b2053dc3dc6.png)


![image](https://user-images.githubusercontent.com/51863163/202816604-da8d4821-0e2b-45af-b289-7442367f98ce.png)

## Changelog

🆑 Melbert
add: Observers can now see what action buttons an observed mob has. No,
you can't click them. And no it doesn't show EVERY action.
refactor: Refactored how action button icons are generated. Some actions
will now use a colored border when active instead of just turning green.
Cooldown text will also appear on the top layer of actions too. If you
see any funky lookin' icons (namely their borders), let me know.
refactor: Bluespace Golem's teleport action is now a cooldown action.
fix: Construct actions go to the middle of the screen like expected. 
/🆑
2022-12-03 19:01:08 -08:00
Mothblocks
fa7688d043 Save 0.6-0.7s of init time by splitting registering lists of signals into its own proc, and optimizing QDELETED (#71056)
- Makes QDELETED use isnull(x) instead of !x, giving about 0.2 to 0.25s
of speed.
- Make disposal constructs only update icon state rather than go through
expensive overlay code. Unfortunately did not have much effect, but is
something they should've been doing nonetheless.
- Makes RegisterSignal only take signals directly as opposed to
allocating a fresh list of signals. Very few consumers actually used
this and it costs about 0.4s. Also I think this is just a bad API anyway
and that separate procs are important

`\bRegisterSignal\((.*)list\(` replaced with `RegisterSignals($1list(`
2022-11-22 07:40:05 +00:00
AnturK
4d6a8bc537 515 Compatibility (#71161)
Makes the code compatible with 515.1594+

Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword

And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.

@tgstation/commit-access Since the .proc/stuff is pretty big change.

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-15 03:50:11 +00:00
Jacquerel
140c12b580 Giant Spider action fixes & Action feedback (#70848)
I went into this just planning on fixing some weird behaviour with
spider buttons and ended up touching a lot of files.

Specifically this is because some of the actions used by Giant Spiders
would print feedback messages in IsAvailable, which was bad because this
is called every time the button updates and so would (for example) print
a bunch of messages about eggs existing when you spawned as a
broodmother because the lay eggs button would be checking for that when
it was granted to you.
The feedback _is_ useful though so I've implemented a pattern used in
Spell where we just pass a flag describing whether we want to print it
or not, which is generally set to true in Trigger() or if the player
physically pressed the button.

A side effect of this is that any action with usability flags (such as
"not when handcuffed") will now tell you why it is failing if you click
it while it is unusable, which is nice.

The spider changes are largely to make sure that their buttons are
tinted at the correct time, they were previously tinted red as if
inactive at almost all times due to the icon not being updated when
relevant conditions changed.
This necessitated adding a new signal (two actually) sent when a
do_after begins and when it ends (for any reason, including premature
interruption).

I also fixed a quirk where the Wrap ability had a permanent 'active'
outline after using it once (the icon states were inverted).

I also fixed a bug where you could just lay infinite enriched eggs after
eating one guy, which is not how the game describes it as working.
I looked up the PR adding it
(https://github.com/tgstation/tgstation/pull/54451) and one egg per kill
seems to be how it is supposed to work.

And finally I changed a few nurse spider to_chats into balloon_messages,
on the principle that they're not information which needs to stick
around for more than a few seconds.
2022-11-05 22:09:17 -05:00
Tim
b1a793f840 Refactor and improve antimagic to be more robust (#64124)
This refactors the antimagic component to use and have bitflags, documentation, defines, code comments, named arguments, and renames variable names for clarity. 

- /obj/effect/proc_holder/spell/aoe_turf/conjure/creature/cult is not used anywhere and has been removed
- /obj/effect/proc_holder/spell/targeted/turf_teleport/blink/cult is not used anywhere and has been removed

- New sound effects are played when magic is blocked. Depending on the type of magic being used it will be either:

- Equipping antimagic now properly updates the magic buttons
- Any magic being blocked or restricting casting now displays a message
- MAGIC_RESISTANCE_MIND now properly blocks telepathy effects
- Removes blood splatter when fireball is blocked
- Magic projectiles for staff of locker no longer spawn lockers when blocked by antimagic
- Fire breath is no longer blocked by antimagic
- Spellcards are now blocked by antimagic

Any antimagic on a mob blocks that magic type from being casted. (certain spells such as mime abilities completely ignore antimagic)

- Foilhats prevent someone from casting mind magic (telepathy, mindswap, etc.)
- Bibles, ritual Totems, nullrods, holymelons, and TRAIT_HOLY prevent someone from casting unholy magic (cult spells, etc.)
- Nullrods, ritual totem, and holymelons prevent someone from casting wizard magic (fireball, magic missile, etc.)
- Immorality talismans, berserker suits, and TRAIT_ANTIMAGIC prevents all types of magic (except stuff like mime abilities)
- Touch of Madness and Mindswap is now blocked with MAGIC_RESISTANCE and MAGIC_RESISTANCE_MIND
- Voice of god is now blocked with MAGIC_RESISTANCE_HOLY and MAGIC_RESISTANCE_MIND
2022-04-08 20:04:09 -05:00
MrMelbert
e510f8d500 Refactors slimelink and mansus link to be a component to cut down on hard-dels / code copy+paste (#64836)
So this started out as a hard delete fix for the mansus link

Then I realized the mansus link was literally copy+pasted exactly the same code
And the reason why mansus link was hard-delling was because slime link used to hard-del and those were fixed but those fixes were never copied over

So in a fit of rage I refactored the slimelink to be a component, datum/component/mind_linker. Raw Prophets and Stargazers use it.

I'm not 100% certain on some of the methods used but it works? It works.
2022-02-13 23:07:28 +00:00