Commit Graph

16 Commits

Author SHA1 Message Date
die 0204ab8fdd Canreach refactor (#93165)
## About The Pull Request
ports https://github.com/DaedalusDock/daedalusdock/pull/1144
ports https://github.com/DaedalusDock/daedalusdock/pull/1147

full credit to @Kapu1178 for the juice

instead of `reacher.CanReach(target)` we now do
`target.CanBeReachedBy(reacher)`, this allows us to give special
behavior to atoms which we want to reach, which is exactly what I need
for a feature I'm working on.
## Why It's Good For The Game
allows us to be more flexible with reachability
## Changelog
🆑
refactor: refactored how reaching items works, report any oddities with
being unable to reach something you should be able to!
/🆑
2025-10-07 20:28:59 +02:00
SmArtKar 76bc3afae7 Significantly improves MODtether behavior, fixes multiple bugs and a potential server crash (#92807)
## About The Pull Request

This PR rewrites how MODtethers behave when something appears in their
way, when they run out of slack or get stuck on a corner. Currently,
first case would freeze you in place, while the other two can result in
the tether being blocked by an object which shouldn't interrupt the
beam. Now when it cannot find a direct LOS or get too far from the
owner, the tether will attempt to move to the side a bit to (hopefully)
slide around the corner or whatever object is blocking it, as long as
its distance permits it to do so. They'll also automatically snap if
they cannot find LOS even after trying to move to the side.

Also fixed multiple bugs and a potential crash due to recursion stemming
from MODtethers.
Additionally, while looking around path_info code I found that foam was
calling its passibility check on an incorrect turf, checking if an
object from the target turf could arrive to the turf itself, rather than
sourcing it from its own location. I also fixed that, should prevent
foam from going through directional objects

## Why It's Good For The Game

This should make them less of a pain to use in-game, especially when the
other half is connected to an unanchored object.

## Changelog
🆑
qol: Significantly improved MODtether behavior, they should be easier to
work with now.
fix: Fixed multiple MODtethers bugs and a potential server crash related
to them.
fix: Fixed foam sometimes passing through directional windows.
/🆑
2025-09-09 11:49:01 +02:00
Bloop c9e4360544 Fixes a hard del with mechs (#92496)
## About The Pull Request

<img width="346" height="190" alt="rhJh93UCUl"
src="https://github.com/user-attachments/assets/376199f1-2083-4c9d-b301-461c23c1c03b"
/>

Tin. Caused by someone passing a hard ref in the source arg of
`ADD_TRAIT`. Also does a quick pass for similar bugs.

## Why It's Good For The Game

Less chug

## Changelog

Nothing player facing enough to put in the CL
2025-08-11 21:37:00 +02:00
SmArtKar e6aa18531a Tether improvements and fixes (#89174)
## About The Pull Request

Fixes tether stacking via beacons, you can freely cut your tether while
moving, and cutting/snapping MODsuit tethers now also snaps the beacon
they're connected to if said beacon was generated by a MODsuit
projectile. Retracting the gloves or deactivating your MODsuit also
snaps MODtethers you've created using it.

Closes #88869
Closes #88866
Closes #89170

## Changelog
🆑
qol: Snapping tethers now also removes their beacons
qol: You can now cut tethers that you're attached to while in motion
qol: Tethers now snap when you retract your gloves or disable your
MODsuit
fix: Fixed tether stacking issues
/🆑
2025-01-23 19:14:30 +01:00
SmArtKar e1f41fc807 [NO GBP] Decthulufies tethers to stop players from turning themselves into MODsuit bodyhorror (#88289)
## About The Pull Request
Not adding a limit on how many you can have attached at once was a
mistake. MODsuits can only attach one tether at a time and they're
*slightly* slower to cut. You still can attach yourself to more than one
anchor manually (or mob via embedding), but this prevents you from being
attached to more than one machine/structure at a time. Tether anchors
now also only support one link at most.
Tethers no longer require you to click on a specific tile and have a
couple of transparent pixels to the side to make them easier to cut in a
hurry.
Closes #88057

## Why It's Good For The Game


![image](https://github.com/user-attachments/assets/4702e57c-4366-45db-99e8-099b4d9c500d)


![image](https://github.com/user-attachments/assets/3808633b-43c0-49ee-8ef6-9b06f29d1ff1)

## Changelog
🆑
fix: You cannot have more than one MODtether (excluding manual
connections)
qol: Tethers are easier to cut (require less pixelhunting)
/🆑
2024-12-01 14:28:40 +01:00
SmArtKar c7d7c7625a [NO GBP] Fixes tethers being able to move immovable objects (and delete gravgens) (#87911)
## About The Pull Request

Closes #87203
Forgot that move_force was a thing

## Changelog
🆑
fix: Fixed tethers being able to move immovable objects (and delete
gravgens)
/🆑
2024-11-16 04:24:33 +01:00
SmArtKar d12fca5dfd [NO GBP] Prevents ghosts from cutting tethers (#87194)
## About The Pull Request

Closes #87192

## Changelog
🆑
fix: Ghosts can no longer cut people's tethers
/🆑

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2024-10-13 20:06:51 +03:00
SmArtKar c06f2f9352 [NO GBP] Makes MODtethers quicker to cut, adds a rapid cut action to MODsuits and some examine hints (#86984)
## About The Pull Request
Tethers will now take only 1 second to cut, tether anchors have a line
about how to lengthen/shorten and cut tethers, and MODsuit tether module
now can quickly snap all tethers attached to you in case of an
emergency.

I'm not a fan of MOD tether quick cutting code but its the best we can
do to avoid GetComponent usage.

## Why It's Good For The Game
Tethers aren't very comfortable to use and a lot of people get confused
and stuck with them, this should help a ton.

## Changelog
🆑
qol: Added an explanation of how to change tether length and cut them to
tether anchors
qol: MODsuits can now quickly snap all tethers attached to you
balance: Tethers can now be cut significantly quicker
/🆑
2024-10-04 01:29:24 +02:00
SmArtKar ad111f4950 Spacemove refactor - Newtonian physics (#84869)
## About The Pull Request

This PR significantly enhances how zero-g movement works. Its no longer
locked to one of 8 directions, everything now has inertia and is
affected by weight. This means that throwing a piece of wire will no
longer completely reverse your movement direction, and that being thrown
out of mass driver no longer will slow you down to a halt at some point.

This leads to following gameplay changes:
* Guns now accelerate you. Ballistics have higher acceleration than
lasers, and higher calibers have higher acceleration than smaller ones.
This means that firing full-auto weapons in zero-g will make you drift
and accelerate significantly. While this can be a hilarious way to
travel in space, it makes using them trickier.
* Impacting a wall or an object while moving at high speeds will cause
you to violently crash into it as if you were thrown. Careful when
exploring!
* Jetpacks now have inertia. Changes introduced in #84712 have been
mostly reverted, although speed buff has been reduced to 0.3 instead of
0.5 (although this is compensated by new movement mechanics, so overall
speed should be roughly equal). All MODsuit jetpacks now possess the
speed boost. Advanced MODsuit jets (which has also been added back) and
captain's jetpack instead have higher acceleration and stabilization
power, providing much more precise control over your movement.
* Firing guns while moving on a jetpack will partially negate your
pack's acceleration, slowing you down. Non-advanced jetpacks'
stabilization is not enough to compensate for heavy caliber weaponry as
sniper rifles, shotguns or rocket launchers.
* You no longer instantly decelerate upon sliding along a wall. Instead,
it may take a few tiles if you are moving at extreme speeds. Passing
over lattices still allows you to grab onto them!

As space movement is angle-based instead of dir-based now, its much more
smooth than before due to using new movement logic.

Example of jetpack stabilization in action:

https://github.com/tgstation/tgstation/assets/44720187/6761a4fd-b7de-4523-97ea-38144b8aab41

And, of course, you can do this now.

![jetpack_500](https://github.com/tgstation/tgstation/assets/44720187/37b11cd8-2bd1-4640-ae0c-5e0cc505bf52)

**This pull request requires extensive gameplay testing before
merging**, as a large amount of numbers have been picked arbitrarily in
an attempt to keep consistency with previous behavior (guns and
normal-sized items applying 1 drift force, which is equal to what
everything applied before this PR). Jetpacks and impacts may also
require adjustments as to not be frustrating to use.

Closes #85165

## Why It's Good For The Game

Zero-G refactor - currently our zero-g movement is rather ugly and can
be uncomfortable to work with. A piece of cable being able to accelerate
you the same as a duffelbag full of items when thrown makes no sense,
and so does instantly changing directions. Inertia-based version is
smoother and more intuitive. This also makes being thrown into space
more of a hazard (possibly opening the door for explosive
decompressions?)
Jetpack inertia and gun changes - this is mostly a consequence of
inertia-based movement. However, zero-g combat being preferred during
modes like warops was an issue due to it negatively affecting everyone
without jetpacks which are in limited supply onboard. This reverts the
mobility changes which severely impacted space exploration, while making
zero-g combat more dangerous and having it require more skill to be a
viable option.

## What's left

- [x] Refactor moth wings to use jetpack code
- [x] Refactor functional wings to use jetpack code
- [x] Locate and fix a recursion runtime that sometimes occurs upon
splattering against a wall
- [x] Add craftable tethers and modify engineering MOD tethers to use
the same system

## Changelog
🆑
add: You can now craft tether anchors, which can be secured with a
wrench and attached to with right click. They won't let you drift into
space and you can adjust tether length/cut it via lmb/rmb/ctrl click on
the wire.
add: MOD tethers now remotely place and connect to tether anchors
instead of throwing you at where they landed.
balance: MOD tethers can now be used in gravity
balance: Jetpacks are now inertia-based. 
balance: Guns can accelerate you significantly in zero-g.
balance: All jetpacks now give you equal speed buff, however advanced
MOD ion jets and captain's jetpack have higher acceleration/deceleration
values.
refactor: Refactored zero-g movement to be inertia-based and utilize
angles instead of directions.
/🆑
2024-09-26 02:49:54 -07: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
Ghilker b95c0366a4 _HELPERS/unsorted.dm has been sorted (#61882)
bring code up to latest standards, move many procs to named files inside _HELPERS
no idea where to put some of these procs, help is appreciated
made more files to contain some unique code, deleted unsorted.dm, we can rest now
2021-10-05 20:22:57 +01:00
Watermelon914 375a20e49b Refactors most spans into span procs (#59645)
Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs.
Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines.

Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing.
Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc.

(Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
2021-06-14 13:03:53 -07:00
Jared-Fogle 45c14f6330 Adds SIGNAL_HANDLER and SIGNAL_HANDLER_DOES_SLEEP to prevent signal callbacks from blocking (#52761)
Adds SIGNAL_HANDLER, a macro that sets SHOULD_NOT_SLEEP(TRUE). This should ideally be required on all new signal callbacks.

Adds BLOCKING_SIGNAL_HANDLER, a macro that does nothing except symbolize "this is an older signal that didn't necessitate a code rewrite". It should not be allowed for new work.

This comes from discussion around #52735, which yields by calling input, and (though it sets the return type beforehand) will not properly return the flag to prevent attack from slapping.

To fix 60% of the yielding cases, WrapAdminProcCall no longer waits for another admin's proc call to finish. I'm not an admin, so I don't know how many behinds this has saved, but if this is problematic for admins I can just make it so that it lets you do it anyway. I'm not sure what the point of this babysitting was anyway.

Requested by @optimumtact.
Changelog

cl
admin: Calling a proc while another admin is calling one will no longer wait for the first to finish. You will simply just have to call it again.
/cl
2020-08-20 09:11:28 +12:00
AnturK 4b259d87fb can i have -Wall for dm already (#44008) 2019-05-18 15:27:06 -04:00
vuonojenmustaturska 1009d008de mistakes were made (#43957) 2019-05-16 14:42:19 +02:00