Commit Graph

75 Commits

Author SHA1 Message Date
SkyratBot
79c3c379b9 [MIRROR] Fix missing SIGNAL_HANDLER (#6552)
* Fix missing SIGNAL_HANDLER (#59826)

Adds SIGNAL_HANDLER to everywhere that didn't have it that was picked up by dm-lua, which is now ready enough to catch these.

* Fix missing SIGNAL_HANDLER

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-06-27 16:16:04 +01:00
SkyratBot
665fe76566 [MIRROR] Modifies right click logic so that it is not the same priority as modifier keys. (#6498)
* Modifies right click logic so that it is not the same priority as modifier keys. (#59656)

Strips out the existing right click code - Due to the myriad of ways right clicking has been implemented, dedicated signals and procs for right clicking without modifiers are fundamentally incompatible with our system of primary and secondary attacks.

Adds additional signals to attacking code. These signals allow atoms to cancel the attack chain early on secondary attacks, or override the standard procs and not send signals to prevent any undesired behaviour from signal handlers.

Items that used RightClick procs have been converted to attack_hand_secondary.

The slaughter demon, having its own set of snowflake code as poor OOP principles have been applied in UnarmedAttack() procs with lacking calls to parent procs and arbitrary redefinition of behaviour, checks for a right click in its own UnarmedAttack() and performs a bodyslam off that.

Storage components now hijack the secondary attackby stage via signals to handle their opening and closing shortcuts on right click. When you right click a storage component equipped item with an object in your active hand, the object has an opportunity to perform its logic in pre secondary attack code and cancel the attack chain. If it does not cancel the attack chain in pre-attack, then the storage component takes over for attackby and, if possible, opens the relevant inventory and ends the attack chain.

The forensic scanner is a proof-of-concept of this working in action. With its scan logic moved from afterattack code to pre attack code for right clicking, right clicking with the scanner will now perform a scan where previously one was impossible. Left clicking still does what it always does - Scans at the very end of the attack chain.

The logic still isn't perfect - For example, you still can't attack containers in melee even in combat mode (you'll either open them or put your weapon into them regardless of which option you choose) - But this is a better setup overall which allows for items to at least override this behaviour in pre-attack if needed.

* Modifies right click logic so that it is not the same priority as modifier keys.

* a

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-06-27 16:10:15 +01:00
SkyratBot
d85a02babd [MIRROR] Refactors move procs to support multitle objects (#6423)
* Refactors move procs to support multitle objects

* Update _blob.dm

Co-authored-by: Rohesie <rohesie@gmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-06-22 22:40:04 +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
6f3b151bb8 [MIRROR] Fixes a bunch of harddels that are sourced from player action (#6252)
* Fixes a bunch of harddels that are sourced from player action

* Mirror!

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Funce <funce.973@gmail.com>
2021-06-11 03:13:33 +01:00
SkyratBot
196fe2f198 [MIRROR] Moves opening storage items from alt-click to right-click (#6234)
* Moves opening storage items from alt-click to right-click (#59565)

* Moves opening storage items from alt-click to right-click

Co-authored-by: TJatPBnJ <69724863+TJatPBnJ@users.noreply.github.com>
2021-06-10 23:48:15 +01:00
SkyratBot
22a553a0c4 [MIRROR] Removes SIGNAL_HANDLER_DOES_SLEEP and makes signals synchronous (#5845)
* Removes SIGNAL_HANDLER_DOES_SLEEP and makes signals synchronous (#59176)

* Removes SIGNAL_HANDLER_DOES_SLEEP and makes signals synchronous

* a

* Update peacekeeper_clothing.dm

* Update peacekeeper_clothing.dm

* Update peacekeeper_clothing.dm

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-05-21 14:51:00 +01:00
SkyratBot
daec7111cd [MIRROR] You can now put food on plates, and plate no longer materialize out of nowhere as you cook (#4418)
* You can now put food on plates, and plate no longer materialize out of nowhere as you cook

* Update dish_drive.dm

* aaaaaaaaaaaaaaa

Co-authored-by: Qustinnus <Floydje123@hotmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-03-26 15:40:39 +00:00
SkyratBot
391f1d2552 [MIRROR] Item hover outline FX (#4090)
* Revert "[MODULAR] Adds item outline glow (#3861)"

This reverts commit 9ea4373618.

* ..

Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
2021-03-12 22:44:54 +00:00
Gandalf
9ea4373618 [MODULAR] Adds item outline glow (#3861)
* start

* Update outline_procs.dm

* Update outline_procs.dm

* Update outline_procs.dm

* Update outline_procs.dm
2021-03-04 21:52:11 +00:00
SkyratBot
18eca27569 [MIRROR] update_appearance (#3508)
* update_appearance

* a

* a

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
2021-02-19 16:08:09 +00: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
3000d75ad5 Adds aquariums and aquarium fish. (#56343) (#2920)
Co-authored-by: tralezab <spamqetuo2@gmail.com>
Co-authored-by: Mothblocks <35135081+Jared-Fogle@users.noreply.github.com>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Co-authored-by: Qustinnus <Floydje123@hotmail.com>
Co-authored-by: coiax <yellowbounder@gmail.com>

Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: tralezab <spamqetuo2@gmail.com>
Co-authored-by: Mothblocks <35135081+Jared-Fogle@users.noreply.github.com>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Co-authored-by: Qustinnus <Floydje123@hotmail.com>
Co-authored-by: coiax <yellowbounder@gmail.com>
2021-01-28 03:27:25 +01:00
SkyratBot
9dfb7a1189 [MIRROR] Everything that uses maptext now uses the class that makes it actually readable (#2116)
* Everything that uses maptext now uses the class that makes it actually readable

* Update chatmessage.dm

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2020-12-11 00:40:04 +00:00
SkyratBot
40015ba64d [MIRROR] Minor refactor to signal handlers to remove potential sleeps (#1777)
* Minor refactor to signal handlers to remove potential sleeps (#54649)

About The Pull Request

These are legacy sleepers, the remaining 12 are non-trivial to fix.

* Minor refactor to signal handlers to remove potential sleeps

Co-authored-by: spookydonut <github@spooksoftware.com>
2020-11-22 22:35:37 +00:00
SkyratBot
4dc077b884 [MIRROR] Food processors and microwaves now respect food trays (#1716)
* Food processors and microwaves now respect food trays (#54927)

Really it's a bandaid as it would be better to wait until the refactor is done, but it turned out to be a rather easy fix.
Food trays may now once again mass insert both new and old food into the microwaves and food processors.

Prevents any manual handing when cooking large quantities of food at once.
Also, you get the switch gathering mode button when being given the serving tray again.

* Food processors and microwaves now respect food trays

Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
2020-11-19 06:45:07 +01:00
SkyratBot
e768cef297 [MIRROR] /obj/screen --> /atom/movable/screen (#1646)
* /obj/screen --> /atom/movable/screen

* Update storage.dm

* Update radial.dm

* a

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
Co-authored-by: Azarak <azarak10@gmail.com>
2020-11-11 04:12:50 +01:00
SkyratBot
6ecaa9a994 [MIRROR] Standardizes attack chain signal returns and fixes a tk bug (#1409)
* Standardizes attack chain signal returns and fixes a tk bug (#54475)

The attack chain is a bit of a mess, and the introduction of signals hasn't helped in simplifying it.

In order to take a step into untangling this, I re-ordered the attack signals to no longer be by source type and instead to be grouped more modularly, as they are all members of the attack chain and function similarly. They all share the trait of potentially ending the attack chain via a return, but had several different names for it. I joined it into one.

Additionally, fixed a tk bug reported by @ Timberpoes by adding a signal return check at the base of /mob/proc/RangedAttack

Lastly, removed the async call of /datum/mutation/human/telekinesis/proc/on_ranged_attack, which was added as a lazy patch to appease the linter complaining about a sleep on a signal handler (namely in /obj/singularity/attack_tk). Fixed the problem using timers.

Also cleaned some code here and there.

* Standardizes attack chain signal returns and fixes a tk bug

Co-authored-by: Rohesie <rohesie@gmail.com>
2020-10-21 07:39:32 +02:00
SkyratBot
f02e30a50e [MIRROR] Implements timed_action_flags for do_after-like procs (#1385)
* Implements timed_action_flags for do_after-like procs (#54409)

Originally I wanted to fix an issue where the `get_up()` `do_after()` would ignore the callback checks, because it was `uninterruptible`, so that made me refactor these procs to allow for higher granularity on checks and standardize behavior a bit more.
There's more work to be done for them, but one thing at a time.

* Removes the `uninterruptible` check in favor of the more granular `timed_action_flags`
* Cleans code on the `do_atom`, `do_after_mob`, `do_mob` and `do_after` procs to standardize them a little better.

* Implements timed_action_flags for do_after-like procs

* Update horror_form.dm

Co-authored-by: Rohesie <rohesie@gmail.com>
Co-authored-by: Azarak <azarak10@gmail.com>
2020-10-21 07:06:03 +02:00
Azarak
a17abc1830 weh (#1371) 2020-10-19 18:50:02 +01:00
SkyratBot
b8d9874c27 [MIRROR] Converts all A && A.B into A?.B (#1292)
* Converts A && A.B into A?.B (#54342)

Implements the ?. operator, replacing code like A && A.B with A?.B

BYOND Ref:
When reading A?.B, it's equivalent to A && A.B except that A is only evaluated once, even if it's a complex expression like a proc call.

* Converts all A && A.B into A?.B

Co-authored-by: ZeWaka <zewakagamer@gmail.com>
2020-10-13 23:19:25 +02:00
SkyratBot
756b97a0fb [MIRROR] Converts some unique and typelists into stringlists (#1284)
* Converts some unique and typelists into stringlists (#54237)

* Converts some unique and typelists into stringlists

Co-authored-by: Rohesie <rohesie@gmail.com>
2020-10-13 08:03:58 +02:00
SkyratBot
1dfe6e9e85 [MIRROR] Unit tests for serving trays (#1199)
* Unit tests for serving trays (#54224)

* Unit tests for serving trays

Co-authored-by: NightRed <nightred@gmail.com>
2020-10-08 02:42:27 +02: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
jdawg1290
62676e72a8 Force LF line endings with gitattributes and convert repo (#52266)
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2020-07-16 03:02:40 +03:00
AnturK
f4af5ed28c Makes CanReach default to blocking. (#52115) 2020-07-12 04:25:27 +10:00
Tad Hardesty
4e666f1325 Remove unnecessary incapacitated check 2020-06-27 14:39:20 -07:00
ivanmixo
6351f3837d replaces the thing with user.incapacitated() 2020-06-19 22:54:51 +02:00
Rohesie
b940ce3ff9 progressbar refactor (#50316) 2020-04-01 14:38:55 +08:00
ShizCalev
7209ac3c93 Removes unnessacary math defines 2020-02-17 23:09:09 -05:00
Ghom
1e15900f2d Fixes shock paddles being insertable in BoH (#48643)
* Fixes shock paddles being insert able in BoH

* Redundant.
2020-01-12 19:34:20 -08:00
Dennok
a2fc1614a6 You do not lose the storage window on storage pickup. (#48685)
* do not lose the storage window on pickup

do not lose the storage window on pickup

* Keep update_actions()
2020-01-10 21:35:02 +11:00
81Denton
f5bd6a381d Merge pull request #47052 from kingofkosmos/misc_span_fixes1
Misc span fixes
2019-10-20 18:46:54 +02:00
kingofkosmos
52325eda25 Merge branch 'master' of https://github.com/tgstation/tgstation into misc_span_fixes1
# Conflicts:
#	code/game/machinery/Sleeper.dm
#	code/game/machinery/doors/airlock.dm
#	code/game/objects/structures/beds_chairs/chair.dm
#	code/game/objects/structures/lavaland/geyser.dm
#	code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm
#	code/modules/antagonists/clockcult/clock_mobs/_eminence.dm
#	code/modules/paperwork/contract.dm
2019-10-17 06:02:06 +03:00
nemvar
9467c73899 Checks if the tick has stopped. 2019-10-16 19:25:16 +02:00
nemvar
ced45cfddd Fixes forceMove to null 2019-10-16 19:21:41 +02:00
PKPenguin321
deeac2355a Big storage containers (like bags) in smaller ones (like boxes) can't have items placed in them (#46983)
* Bags in boxes can't have items placed in them

Untested webedit
Fixes https://github.com/tgstation/tgstation/issues/46345

* smooths a redundant check

* more squishing
2019-10-14 07:05:06 +02:00
kingofkosmos
280d416d4f Adds missing spans, missing periods and missing span endings. Also changes spans to suit the situation better. 2019-10-12 19:34:11 +03:00
nemvar
8cfe0f6467 Slightly improves visible and audible messages. (#46499)
* Doubtful improvement

* Switches out all the magic numbers with defines

* Thanks travis for finally finding a real error

* properly resolves some left over conflict
2019-09-18 12:52:18 +02:00
Rob Bailey
2029163d33 playsound vary boolean define conversion (#46254)
About The Pull Request

Converts every single usage of playsound's vary parameter to use the boolean define instead of 1 or 0. I'm tired of people copypasting the incorrect usage.
Also changes a couple of places where a list was picked from instead of using get_sfx internal calls

This was done via regex:
(playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\)) to match 1
(playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\)) to match 0
full sed commands:
/(playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\))/\1TRUE\2/ 1 to TRUE
/(playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\))/\1FALSE\2/ 0 to FALSE

I'm not very good with regex and these could probably be optimized, but they worked.
Why It's Good For The Game

Code usability
2019-08-30 18:45:20 +12:00
nemvar
1ec07b1508 Fixes that pesky dumping issue (#46025) 2019-08-21 01:08:36 -07:00
Mickyan
e26abb7047 Random pixel shift for dropped/thrown objects (#45155)
* pixels

* offset for any throw, critical bedsheet bugfix

* nyeh

* might as well (autodoc)

* renamed proc

* removed redundant src

* moved call from dropped() to dropItemToGround()

* handles storage dumping, customizable max offset

* adjusted values

* inline
2019-07-16 00:51:17 -07:00
kingofkosmos
ec5c82029a * "Is already...", "Can not...", "Not when..." etc. 2019-06-27 06:15:43 +03: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
Akrilla
2d32be1904 Small storage refactor and examine change (#44109)
* Removes repeated line

* Description change for clothing items that can only store specific items

* Get all children of can_hold listed items.

* can_hold only needs the top most item, child items are dealt automatically

* cant_hold related change

* Text change

* Moves the item check to the line above, and removes the current.

* Same changes, but to belt/wallet code.

* Change to using signals instead

* Generic signal on datum/topic

* Cache typecache, and small signal change

* Small argument tweaks and remove unneeded lists

* Change to proc

* Change call can_holds/cant_holds to use new proc

* initial, and cleaned up display code

* Null check
2019-05-30 14:20:29 -04:00
Akrilla
55ed0ebf35 Fedoras hold small and gimmick items (#44139)
* This was probably originally intended...

* Fedoras hold small items, and exceptions for gimmicks

* Only create cache once

* Cache exception_hold, and adds other katana type
2019-05-28 09:57:59 -04:00
vuonojenmustaturska
fb45b7a017 Turns trait accessors into defines, fixes some bugs (#43820)
It's free performance.
2019-05-06 19:44:05 -04:00
coiax
881e8c1ab9 Refactors NODROP flag into TRAIT_NODROP (#42109)
* Refactors NODROP flag into TRAIT_NODROP

🆑 coiax
fix: Anti-drop implants can no longer be used to drop objects that they
were not responsible for sticking to a person's hand.
fix: Backfiring with a Barnyard spellbook will now play a spooky horse sound.
refactor: Refactors the way that "NODROP" items work to a new system,
there should be no change in functionality.
/🆑

Various items in the codebase were doing weird hoop jumps in order to
preserve the nodrop flag's state when it also wanted to change it, so I
moved it to a trait system.

I may have gone overboard with the type of unique trait sources, but
those can be changed later. My long term plan is make a general "CURSED"
nodrop origin, which means you can unlock cursed items by being hit with
a bolt of door opening or something. But that's for another PR, this has
no functionality changes, apart from some slightly modified descriptions
on cursed masks.

- Removed a bunch of redundant voice changing code for all the voice
changing animal masks, used two new clothing flags for this purpose.
- Also refactored a bit the animal masks, making new cursed subtypes that play
the sound when created.

* Drop location
2019-01-17 15:24:30 -05:00
skoglol
4a5fc9e14e Makes satchels stack by name instead of type (#41827)
* Makes satchels stack by name

* Type and name and hopefully fixed branch?
2018-12-23 16:30:34 +11:00
oranges
0e982cad32 Merge pull request #41921 from kevinz000/patch-584
Fixes some instances of storage not closing when it should (on move)
2018-12-16 13:02:44 +13:00