* 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>
* Converts some unique and typelists into stringlists (#54237)
* Converts some unique and typelists into stringlists
Co-authored-by: Rohesie <rohesie@gmail.com>
* 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>
* Doubtful improvement
* Switches out all the magic numbers with defines
* Thanks travis for finally finding a real error
* properly resolves some left over conflict
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
* 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
* 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
* 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
* Christmas code changes
🆑 coiax
add: Santa can now examine presents to see what's inside.
del: Santa no longer has a mass summon presents spell, because of his
new regenerating bag!
add: Santa's bag regenerates presents as long as Santa is holding it.
balance: You can only find one gift under a christmas tree per round, no
matter how many trees you search.
balance: Santa's teleport does not announce where he's going.
fix: Fixed Santa not having a full head and beard of white hair.
fix: Fixed Santa not being genetically white-haired.
fix: Fixed Concentrated Barber's Aid not growing extreme amounts of
hair.
/🆑
The `box` var has been moved down from `/datum/outfit/job` to
`/datum/outfit`.
Added unlimited christmas tree with presents, for testing.
Santa's restriction against opening presents is now done by
TRAIT_CANNOT_OPEN_PRESENTS. Santa's ability to see inside presents is
done by the TRAIT_PRESENT_VISION, which also determines if Santa's Bag
will regenerate presents every 30 to 60 seconds.
Santa no longer starts with a breath mask and O2 tank, but instead has
an internals box. Santa no longer has a no-access gold ID, he can
teleport from room to room!
Gifts determine what type is inside them on initialization, rather than
when unwrapped.
- Reasoning -
Unlike last year, there are various possible methods of accessing
christmas trees spawners, allowing for an unlimited number of anything
presents. Cutting down the presents to one per round regardless of tree
count will avoid this.
Santa should be able to see what he's giving, because then he can reward
the naughty and nice children with different gifts.
* Missed a merge
* Adds present investigate logs, and visible messages
* Use the body+mind checking of mob.has_trait
* Less globals, more static vars on types; also event renaming
Provides an alternative to click-dragging.
The on_alt_click() proc wasn't ever used, but seemed to be ready for replacing
the AltClick() overload from sabre sheath. I kept that part and added
fingerprints to it as well, and it is still good to go (if it really was)
whenever someone bothers.
* nerf boxes
* uuh i think i see what you mean. hows this
* shuffles it over to mob.dm
* asdf
* hows this
* ooga
* i should probably rebase
* t
* cheaper and stronger unlike me
* aaaaa
* does the thing with the words
Aiming to implement the framework oranges has detailed in https://tgstation13.org/phpBB/viewtopic.php?f=10&t=19102
Moves canmove to a bitflag in a new variable called mobility_flags, that will allow finer grain control of what someone can do codewise, for example, letting them move but not stand up, or stand up but not move.
Adds Immobilize()d status effect that freezes movement but does not prevent anything else.
Adds Paralyze()d which is oldstun "You can't do anything at all and knock down).
Stun() will now prevent any item/UI usage and movement (which is similar to before).
Knockdown() will now only knockdown without preventing item usage/movement.
People knocked down will be able to crawl at softcrit-speeds
Refactors some /mob variables and procs to /mob/living.
update_canmove() refactored to update_mobility() and will handle mobility_flags instead of the removed canmove
cl
rscadd: Crawling is now possible if you are down but not stunned. Obviously, you will be slower.
/cl
Refactors are done. I'd rather get this merged faster than try to fine tune stuff like slips. The most obvious gameplay effect this pr has will be crawling, and I believe I made tiny tweaks but I can't find it Anything I missed or weird behavior should be reported.
> Take 1
> Length of cubes is above 1
> Cut(1)
> Wait that just cut the entire list to nothing
Now the signal should work properly instead of not working whenever there's
more of a thing than the requested amount.