Commit Graph
5 Commits
Author SHA1 Message Date
b72368fd03 #87754: Batons have their stamina damage reduced by armor, get stun armor penetration, but not a test and actually intended to be merged (#88830)
## About The Pull Request

This PR is literally just
https://github.com/tgstation/tgstation/pull/87754 so you should probably
go read the contents of that PR to learn more.

### Sorry, No Stunsword in this PR.

Stunbaton inhand tips change color as the cell it has inside increases
in capacity. They also have different animations based on the cell, to
make it clearer which one you are looking at.


![image](https://github.com/user-attachments/assets/95be1499-47b7-4991-a3c1-03833f329d7f)

## Why It's Good For The Game

So, two things;

A) The test showed that there is more work to be done, but that this was
actually improving survivability to some degree against batons when
properly geared, while not necessarily impacting the average tider
arrest attempts. It didn't solve the issue of alleviating the need for
anti-baton knockdown tools, but it did help a bit. Enough that I think
this could be worked on further as a foundation for solving that
problem.

B) People have been asking me to, or have made it obvious that they
would like to see this actually merged into the game. So uh...here is
that PR if any maints care for it.

I think there is still more to do for testing and possible changes to
address the issues I was trying to investigate in the test. However, I
actually think this change could be an important step towards
accomplishing some of those changes. It isn't quite enough to start
pulling out baton resistance from various sources just yet, but it is a
start.

## Changelog
🆑 
balance: Batons now respect the armor worn by targets. Analog batons
respect MELEE armor. Cell-type batons respect ENERGY armor.
balance: Various batons have differing amounts of armour penetration
based on what type of baton it is.
balance: Heads of staff have color graded batons to denote penetration
power. Bronze (Quartermaster), Silver (Chief Engineer, Chief Medical
Officer, Head of Personnel, Research Director), Gold (Captain).
Contractor batons are equivalent to Gold.
balance: Cell-type batons gain armor penetration based on their cell's
quality. The better it is, the more it penetrates.
/🆑

---------

Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
2025-01-21 18:17:23 -05:00
SmArtKarandGitHub 2cef60c063 Changing clipboard skins now changes the inhands sprite as well (#88123)
## About The Pull Request

Closes #88122

## Changelog
🆑
image: Changing clipboard skins now changes the inhands sprite as well
/🆑
2024-11-24 04:36:12 -08:00
91baa94ac5 event based incapicated and able_to_run (#86031)
## About The Pull Request
this is a revival of #82635 . i got permission from potato to reopen
this, he did almost all the work. i only just solved the conflicts and
fixed all the bugs that were preventing the original from being merged
(but it should be TMed first)

## Why It's Good For The Game
slightly improves the performance of basic mob AI

## Changelog
🆑
LemonInTheDark
refactor: able_to_run and incapacitated have been refactored to be event
based
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: ZephyrTFA <matthew@tfaluc.com>
2024-09-04 10:02:49 -04:00
_0StevenandGitHub aa5eddb99b Fix pride pin reskinning (#82920)
## About The Pull Request

**Edit: Since writing, this pr has been updated to address failing CI
based on code-general suggestions, invalidating the previous
descriptions. The previous descriptions has been included as spoilers
for posterity**

Right, so, this has gone from just a simple pride pin fix to realizing
CI fails with it to doing a more complex lasting fix based on
suggestions.

Recap time. Objects get reskinning set up if they have `unique_reskin`
set when `Initialize(...)` runs.

https://github.com/tgstation/tgstation/blob/9145ecb7e1e44635a1056fc704adfa3d764325e6/code/game/objects/items.dm#L267-L269
Because pride pins use a global list, we set it in `Initialize(...)`...
After we call the parent.

https://github.com/tgstation/tgstation/blob/9145ecb7e1e44635a1056fc704adfa3d764325e6/code/modules/clothing/under/accessories/badges.dm#L196-L198
Obviously this fails.

However, moving this *before* `Initialize(...)`, while fixing the issue,
causes CI to fail due to calling `register_context()` twice.
Why? Well, it's simple. We automatically call `register_context()` if we
have `unique_reskin` set, as seen above, but we *also* call it on
accessory `Initialize(...)` due to it having its own context.

https://github.com/tgstation/tgstation/blob/0c562fd74299f8ce92a81c0a932b8ec4862189af/code/modules/clothing/under/accessories/_accessories.dm#L29-L31
This causes it to try register the same thing twice, which doesn't
_break_ things, but it sure as hell isn't clean.

So talking about this with San in code general, we decided to try go
with the following:
We add two new procs, `setup_reskinning()` and
`check_setup_reskinning()`, and handle all this fuckery within those.
This lets subtypes override them with their own new checks or
differences in setup.
Then we override `setup_reskinning()` for `/obj/item/clothing/under` and
`/obj/item/clothing/accessory` to not register context again, and do the
same for `/obj/item/clothing/accessory/pride` but while also setting
`unique_reskin`.

This fixes it.

<details>
  <summary>Previous implementation for posterity</summary>
  
Back from my short code break, time to fix some of the things I've been
annoyed by.

Firstly, I noticed pride pins could no longer be reskinned since the
alt-click refactor.
Looking into it, this seems to be because we now only register this on
`Initialize(...)` if `unique_reskin` has been set:

https://github.com/tgstation/tgstation/blob/9145ecb7e1e44635a1056fc704adfa3d764325e6/code/game/objects/items.dm#L267-L269
While due to using a global list we don't set this in the item
definition, but in `Initialize(...)` :

https://github.com/tgstation/tgstation/blob/9145ecb7e1e44635a1056fc704adfa3d764325e6/code/modules/clothing/under/accessories/badges.dm#L196-L198
Where we call the parent proc _before_ setting `unique_reskin`, and thus
not registering our ability to reskin.

So all we do is set this to our global list _before_ we call the parent
proc.
```dm
/obj/item/clothing/accessory/pride/Initialize(mapload)
	unique_reskin = GLOB.pride_pin_reskins // Set before parent proc checks for it.
	. = ..()
```
This fixes it.
  
</details>


## Why It's Good For The Game

Fixes pride pin reskinning.
Theoretically makes it easier to avoid this happening in the future, and
allows `setup_reskinning()` to be manually called in the case of values
being edited post-initialize.

<details>
  <summary>Previous pitch for posterity</summary>
  
Fixes pride pin reskinning.
  
</details>

## Changelog
🆑
fix: Pride pins can be reskinned again with alt-click.
/🆑
2024-05-08 22:18:54 +01:00
JeremiahandGitHub 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