Commit Graph

34 Commits

Author SHA1 Message Date
SkyratBot
fe47d6ba35 [MIRROR] Refactors sheet crafting to better support directional construction [MDB IGNORE] (#20594)
* Refactors sheet crafting to better support directional construction (#74572)

## About The Pull Request

0426f7ddba/code/game/objects/items/stacks/stack.dm (L449)

Ok, but can we not?

This PR refactors sheet crafting to generalize all the cases that were
previously locked behind grille/window type checks and such. In their
stead there are bitflags that can be set to achieve certain behaviors.

All the behavior from before should be preserved, but now it can be
extended to other items. E.g. if you want a railing that can be crafted
underneath directional windows, or an item that behaves like a grille
does--it's just a matter of setting the right obj_flags for it now.

This makes it very simple and painless to add new recipes that use
directional crafting! It's all modular now.

<details><summary>Details</summary>

---

### What I've done:

-Eliminated all the type checks, instead it will now be handled by
object flags and recipe vars, making for a much more configurable
system.

-Added two new obj_flags: `BLOCKS_CONSTRUCTION_DIR` and
`IGNORE_DENSITY`.
-Additionally, I renamed the existing flag `NO_BUILD` to
`BLOCKS_CONSTRUCTION`.

-Changes the proc `valid_window_location` to `valid_build_direction`,
and makes it work for things other than windows.

-Removed a deprecated `window_checks` var from the stack_recipe datum.
-Added three more vars to the stack_recipe datum: `check_direction` and
`check_density`, `is_fulltile`

-Decoupled `on_solid_ground` from the object density check. Now you can
set those separately, allowing you to make recipes that forbid/allow
building things over other things while in space.

---

### What the new flags do:

`BLOCKS_CONSTRUCTION` works as before---prevents objects from being
built on the object. I felt that the previous name was not descriptive
enough, you should know exactly what it does just from looking at the
name.
_example: dna scanner_

`BLOCKS_CONSTRUCTION_DIR` -- setting this on an object will prevent
objects from being built on it when their directions are the same.
_example: directional windows, windoors, railings_

`IGNORE_DENSITY` -- setting this on an object will cause its density to
be ignored when performing the construction density check. This could
have other potential uses as well in the future.
_example: grilles, directional windows, tables_

These three flags cover all the bases for the types of items that are
currently craftable, so there is no more need for any type checking or
weird snowflake window checks. Simply set the appropriate flag and it'll
work as you would expect.

---

### What the recipe vars do:
`check_direction` tells the recipe to check if there's something in that
direction with the `BLOCKS_CONSTRUCTION_DIR` flag set.

`check_density` tells the recipe to run the density check when set. This
is true by default. There are very few items in the game that currently
have this set to false--namely grilles. Setting this to false will make
it so that the object can be constructed regardless of what is in that
tile (unless `one_per_turf` is also set, which will make it so that you
can't craft the same thing twice in the same turf).

`is_fulltile` is used for fulltile windows, but it doesn't necessarily
have to be--you can give this to any recipe and it will adopt the same
properties as that of the fulltile window. Basically they have a special
case where they shouldn't be able to be built over directional
constructions, where normally things would be able to be. Setting this
makes check_direction true as well.

---

### In summary:

Sheet crafting still works just as it did before. But the backend of it
has gotten a glow up and will be able to more easily support new
behaviors.

</details>

## Why It's Good For The Game

This makes the crafting system much more flexible to add recipes to, and
will prevent bad code practices of stacking more conditionals down the
line whenever someone wants to add an item that behaves like grilles or
directional windows in how they are constructed.

It had to be done. Those window checks were a mess.

## Changelog

🆑
qol: added fifty stack versions of remaining glass sheet stacks for ease
of debugging
refactor: refactored sheet crafting to better support directional
constructions that aren't windows
/🆑

---------

Co-authored-by: san7890 <the@ san7890.com>

* Refactors sheet crafting to better support directional construction

* fex

* https://github.com/Skyrat-SS13/Skyrat-tg/pull/20636

---------

Co-authored-by: Bloop <vinylspiders@gmail.com>
Co-authored-by: san7890 <the@ san7890.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2023-04-21 02:14:10 +01:00
Gandalf
e4b4d4d3c0 MISSED MIRROR [Lints Against Unmanaged Local Defines] (#20204)
* https://github.com/tgstation/tgstation/pull/74333

https: //github.com/tgstation/tgstation/pull/74333
Co-Authored-By: tattle <66640614+dragomagol@users.noreply.github.com>

* var stuff

Co-Authored-By: tattle <66640614+dragomagol@users.noreply.github.com>

* vars

* Update sol_fed.dm

---------

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
2023-04-01 01:15:22 +01:00
SkyratBot
f8f2abb11f [MIRROR] Refactor, improve, and rename canUseTopic to be can_perform_action [MDB IGNORE] (#19391)
* Refactor, improve, and rename canUseTopic to be can_perform_action

* updoot

* https://github.com/tgstation/tgstation/pull/72876

https://github.com/tgstation/tgstation/pull/72876

---------

Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2023-03-10 04:19:25 +00:00
nevimer
a051f4bdc7 Missed Mirror: Fixes seeing rotation failed message ballons at distance (#72463) (#18852)
Fixes seeing rotation failed message ballons at distance (#72463)

(cherry picked from commit 65be90bf0d)

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
2023-01-21 16:38:17 -05:00
SkyratBot
209ea80c4e [MIRROR] Removing verbs from the simple_rotation component [MDB IGNORE] (#18111)
* Removing verbs from the simple_rotation component (#71740)

## About The Pull Request
Likely the most trival issue from the [Dev Cycles
Initiative](https://github.com/orgs/tgstation/projects/11) project:

Closes https://github.com/tgstation/dev-cycles-initiative/issues/20

## Why It's Good For The Game
On the face of how useful they may seem, these verbs are basically
surclassed by the more accessible click shortcuts, while also being an
additional cost, which I cannot readily quantify on my subpar hardware,
but likely to be but a smidge compared to loading the nukie outpost and
wizard shuttle everytime rather than on demand, for example.

## Changelog

🆑
del: Removed object rotation related verbs, overwhelmingly overshadowed
by the click shortcuts anyway.
/🆑

* Removing verbs from the simple_rotation component

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2022-12-14 22:46:13 -08:00
Zonespace
f7c26bbf25 515 Compat (#17465)
* ONLY SKYRAT CHANGES

* ACTUALLY SKYRAT CHANGES

* yolo, revert later

* Update alternate_byond_versions.txt

Co-authored-by: AnturK <AnturK@users.noreply.github.com>
2022-11-15 06:59:06 +00:00
SkyratBot
1ce77983df [MIRROR] canUseTopic now uses TRUE/FALSE instead of defines that just say TRUE [MDB IGNORE] (#16586)
* canUseTopic now uses TRUE/FALSE instead of defines that just say TRUE

* etes

* eyes

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-10-02 15:54:46 +01:00
SkyratBot
caf72b3bbb [MIRROR] Removes canuserrotate from simple rotation's screentip [MDB IGNORE] (#16333)
* Removes canuserrotate from simple rotation's screentip (#70002)

Removes canuserrotate from rotation context

Removes the check on whether the user can rotate a chair or not, in the screentip context message.
We shouldn't check to see if a person can or can't rotate a chair or not, they will instead get the feedback when they try to rotate it if they fail, but it's better if the screentip let them know it's a mechanic that exists.

* Removes canuserrotate from simple rotation's screentip

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2022-09-20 07:49:27 -07:00
SkyratBot
ce6eab8ee2 [MIRROR] Add Alt RMB and Ctrl RMB screentips (used for Simple Rotation) [MDB IGNORE] (#16251)
* Add Alt RMB and Ctrl RMB screentips (used for Simple Rotation) (#69726)

* Add Alt RMB and Ctrl RMB to screentips

* Add Ctrl and Alt RMB screentips to defines

* Add Alt RMB and Ctrl RMB screentips (used for Simple Rotation)

Co-authored-by: Tim <timothymtorres@gmail.com>
2022-09-15 11:04:19 +01:00
SkyratBot
5d849135d5 [MIRROR] Adjust balloon alerts for the rotate component [MDB IGNORE] (#11457)
* Adjust balloon alerts for the rotate component (#64801)

Adjusts the failure balloon alerts to have a !, which is standard.
Remove the balloon alert for rotating/flipping things, as the visual feedback is already there: it's the thing getting rotated/flipped. Plus it's too long.

* Adjust balloon alerts for the rotate component

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-02-11 16:54:16 +00:00
SkyratBot
d682fbfbc8 [MIRROR] Rotation component refactor and improvements [MDB IGNORE] (#11304)
* Rotation component refactor and improvements

* Update code/modules/power/singularity/emitter.dm

* e

Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-02-08 01:38:20 +00:00
SkyratBot
b845d13fd2 [MIRROR] Renames RemoveComponent, fixes a dumb runtime in Destroy (#7347)
* Renames RemoveComponent, fixes a dumb runtime in Destroy (#60653)

* Renames RemoveComponent, as its purpose was unclear. Fixes up some dumb uses, and properly docs its status as a helper proc for transfering components

* Renames RemoveComponent, fixes a dumb runtime in Destroy

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2021-08-03 20:06:15 +01:00
SkyratBot
7d1d0e1fad [MIRROR] Refactors most spans into span procs (#6315)
* Refactors most spans into span procs

* AA

* a

* AAAAAAAAAAAAAAAAAAAAAA

* Update species.dm

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-06-16 00:24:49 +01:00
SkyratBot
b332b46b65 [MIRROR] Remove hideous inline tab indentation, and bans it in contributing guidelines (#3394)
* Remove hideous inline tab indentation, and bans it in contributing guidelines

* a

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
2021-02-15 15:32:02 +00:00
SkyratBot
e6879819ea [MIRROR] CanUseTopic() refactor. (#1829)
* CanUseTopic() refactor. (#54747)

* CanUseTopic() refactor.

* Forgot about default_can_use_topic. Tested and working.

* Update bin.dm

* no-nonsense.

* CanUseTopic() refactor.

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2020-11-25 13:56:56 +01:00
SkyratBot
6da6b33009 [MIRROR] Food refactor part 1: Bread destruction and processable element (#447)
* Food refactor part 1: Bread destruction and processable element (#53047)

* Food refactor part 1: Bread destruction and processable element

Co-authored-by: Qustinnus <Floydje123@hotmail.com>
2020-08-21 14:15:57 +01:00
SkyratBot
e65a48e91f [MIRROR] Adds SIGNAL_HANDLER and SIGNAL_HANDLER_DOES_SLEEP to prevent signal callbacks from blocking (#430)
* 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

* Adds SIGNAL_HANDLER and SIGNAL_HANDLER_DOES_SLEEP to prevent signal callbacks from blocking

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
2020-08-19 20:17:28 -04:00
JJRcop
a1392847bd Remove ismovableatom macro (#9) 2020-02-17 15:03:16 +01:00
spessbandit
e3d1e5c53e ghosts can't use monitors; dextrous animals can climb crates; fixes atrocious spelling (#47262) 2019-10-22 04:37:35 -07:00
nemvar
5d804ad82f Signals for tool acts. (#45263)
About The Pull Request

This PR adds signals for all basic tool acts.
Replaced signals places where it's appropriate.
Why It's Good For The Game

It's kinda dirty how we used to do attackby and then check for tool behaviour. Since we now have stuff like plumbing and possibly that one laser PR, we need signals that directly relate to tool behaviour.
Changelog

cl
code: Added signals for all basic tool acts.
/cl
2019-07-26 09:47:22 +12:00
vuonojenmustaturska
8ddc9677c7 examine-code refactor (#44636)
* 1/4 done? maybe?

* more

* stuff

* incremental stuff

* stuff

* stuff & things

* mostly done but not yet

* stuffing

* stuffing 2: electric boogaloo

* Git Commit and the Kingdom of the Crystal Skull

* make it actually compile

* found more stuff

* fixes

* fix AI laws appearing out of order

* fix windows

* should be the remaining stuff

* this time for real

* i guess it should compile too

* fix sechuds
2019-06-19 22:07:57 +02:00
Emmett Gaines
c3f95024b2 Gets rid of the GetComponent macros (#44220)
* Removes the GetComponent macros

* Regex replacement for GET_COMPONENT

Search: `GET_COMPONENT\( *(.+?) *, *(.+?) *\)`
Replace: `var$2/$1 = GetComponent($2)`

* Regex replacement for GET_COMPONENT_FROM

Search: `GET_COMPONENT_FROM\( *(.+?) *, *(.+?) *, *(.+?) *\)`
Replace: `var$2/$1 = $3.GetComponent($2)`
2019-06-04 17:39:58 +02:00
Tad Hardesty
38977aa740 Fix Alt-Click to rotate soda and booze dispensers (#43522) 2019-04-08 10:37:39 +02:00
oranges
0267bce949 Turns out a bunch of components do not properly transfer because of (#42691)
one of three things.

    1. They don't use RegisterWithParent or UnregisterFromParent to unregister
       and register signals

    2. They use callbacks which refer to a source object, which is usually deleted
       on transfer, or lost in some manner, or simply makes no sense at all to be
       transferred

    3. the component was never designed to be transferred at all

TransferComponents gave no shits about any of this and just blindly transferred
all components, if they were actually capable of it or not.

I only noticed this because it was causing chairs to break as they would not register signals
and verbs correctly for rotation after being picked up and then placed down, and a player
reported that issue via ahelp.

Luckily we caught it before the rot got anywhere, only chairs and the shuttle subystem
tend to use this proc (Shuttle uses it on turfs), can you imagine if everything was using
this LMAO

Which is good because it's more dangerous than a loaded gun

I have added a can_transfer var, that is true when a component is valid to
actually transfer, which means the dev has actually thought about what happens when
you take the parent object away and swap it for another and all the crazy that is entailed
by this

I have done my best to audit what components are actually
transferable, but things are basically a hot mess (Thanks @Cyberboss )

The following components required edits:
Forensics:
did not register/deregister the clean_act signal properly, did not checkblood on new parent

Rotation:
did not use RegisterWithParent or UnregisterFromParent, turned out
to not be transferable anyway due to having callbacks that can be
passed in to the parent with unknown sources that we can't feasibly
reuse (i.e if you're transferred from a chair to a bed, your old rotation
call backs are no longer valid). Turns out the use case it was for (just chairs)
didn't need it anyway, so I just made it non valid for transfer.

Wet Floor:
Honestly this one is just a hot mess, it should be a subtype of the slippery
component with the extra wet turf handling.

As it is it basically manages a slippery component on top of it's own extra
functionality, so that's a major code smell.

I added registration/unregistration of the signals, and made it's pretransfer
remove the slippery component and the posttransfer add it back (via update_flags)

Components that seem transferable without issues
mirage_border
orbiter
decal
spill
storage (I hope to earth)
2019-03-05 20:27:29 +01:00
AnturK
1d403cecfb Fixes rotation verbs. (#40643) 2018-10-03 13:14:02 +03:00
ShizCalev
2fa1ac1349 Replaces istypes with the proper tool_behaviour checks. (#40414) 2018-10-01 03:10:31 +03:00
Emmett Gaines
0943e56e08 Adds the signal origin as the first arg to all signals (#39861)
* Adds the signal origin as the first arg to all signals

* Fixes some storage and nanite procs
2018-08-28 18:28:29 +03:00
Emmett Gaines
34a3d2da4d Refactors component signals registration (#38798)
Datums know what signals are being listened for and components can now be registered to listen for signals on more than one object.
2018-07-05 00:56:39 +03:00
AnturK
74ce12deff Fixes simple rotation component deletion (#38825)
* Fixes simple rotation component deletion

* Also remove verbs on destroy.
2018-07-01 13:58:43 -07:00
pigeons
6135ec864f Refactors bitflag macro values into bitshifts (#37234)
* Refactors bitflag values into bitshifts

* minor formatting edits

* Unbitshifts a macro set that skipped 3 for whatever reason
2018-04-19 18:36:35 -04:00
ShizCalev
3cb6ab32d2 Cleans up some duplicate canusetopic warnings 2018-02-11 09:56:43 -05:00
ShizCalev
bfde5ac057 [s] Fixes altclick exploits (#35456)
* Fixes altclick exploits

* Removed free spam, fixes monkey altclicks

* replaced named args with proper defines

* More cleanup and fixes

* Better yet

* Another exploit fix

* pet carrier fix
2018-02-11 16:06:12 +13:00
Ian Turk
1b35873f36 Fixed not being able to rotate anything except in the default rotation direction 2018-01-24 17:35:17 -06:00
AnturK
53909747c8 Simple rotation component. (#34476)
I'm going to port other rotations to it when i don't feel lazy.
Closes #34064
2018-01-23 21:09:15 +13:00