Commit Graph

29 Commits

Author SHA1 Message Date
SkyratBot
169c42a262 [MIRROR] Refactors connect_loc_behalf into a component (#7613)
* Refactors connect_loc_behalf into a component (#60678)

See title. Also refactors caltrops into a component because they use connect_loc_behalf which requires them to hold the state.

This also fixes COMPONENT_DUPE_SELECTIVE from just outright not working.

connect_loc_behalf doesn't make sense as an element because it tries to hold states. There is also no way to maintain current behaviour and not have the states that it needs.
Due to the fact that it tries to hold states, it means the code itself is a lot more buggy because it's a lot harder to successfully manage these states without runtimes or bugs. 

On metastation, there is only 2519 connect_loc_behalf components at roundstart. MrStonedOne has told me that datums take up this much space:
image

If we do the (oversimplified) math, there are only ever 5 variables that'll likely be changed on most connect_loc_behalf components at runtime:
connections,
tracked,
signal_atom,
parent,
signal_procs

This means that on metastation at roundstart, we take up this amount: (24 + 16 * 5) * 2519 = 261.97600 kilobytes
This is not really significant and the benefits of moving this to a component greatly outweighs the memory cost.

(Basically the memory cost is outweighed by the maint cost of tracking down issues with the thing. It's too buggy to be viable longterm basically)

* Update glass.dm

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-08-17 20:29:11 +01:00
SkyratBot
56d4291ef6 [MIRROR] Reverts Entered() passing dir instead of old loc (#6646)
* Reverts Entered() passing dir instead of old loc (#59910)

* Reverts Entered() passing dir instead of old loc

Co-authored-by: Rohesie <rohesie@gmail.com>
2021-07-02 16:42:34 +01:00
SkyratBot
5326760cb3 [MIRROR] Makes turfs persist their signals, uses this to optimize connect_loc (#6465)
* Makes turfs persist their signals, uses this to optimize connect_loc  (#59608)

* Makes turfs persist signals

* Splits connect_loc up into two elements, one for stuff that wishes to connect on behalf of something, and one for stuff that just wants to connect normally. Connecting on behalf of someone has a significant amount of overhead, so let's do this to keep things clear

* Converts all uses of connect_loc over to the new patterns

* Adds some comments, actually makes turfs persist signals

* There's no need to detach connect loc anymore, since all it does is unregister signals. Unregisters a signal from formorly decal'd turfs, and makes the changeturf signal persistance stuff actually work

* bro fuck documentation

* Changes from a var to a proc, prevents admemems and idiots

* Extra detail on why we do the copy post qdel

* Makes turfs persist their signals, uses this to optimize connect_loc

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2021-06-23 04:23:48 +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
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
5880be0168 [MIRROR] (code bounty) refactors all uses of Crossed() and Uncrossed() into signals sent to loc, tracked by connect_loc (#5524)
* (code bounty) refactors all uses of Crossed() and Uncrossed() into signals sent to loc, tracked by connect_loc

* WHEW THAT WAS EASY

* Update ammo.dm

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-05-07 22:39:27 +01:00
SkyratBot
66eaf09920 [MIRROR] Patch runtime from unequip before equip (#4085)
* Patch runtime from unequip before equip (#57272)

https://gist.github.com/Gurkenglas/1a8c40afb1106a4233ef65a36af3148c

This "harmless" runtime resulted from trying to unregister a squeak from its bananium's holder before it was ever finished equipping - perhaps #56820 did not expect https://github.com/tgstation/tgstation/blob/master/code/datums/components/storage/concrete/_concrete.dm#L160.

* Patch runtime from unequip before equip

Co-authored-by: Gurkenglas <gurkenglas@hotmail.de>
2021-03-12 00:42:14 +00:00
SkyratBot
134377fc2c [MIRROR] No More Calling get_equipped_items() in mob/living/Crossed(), Makes Slippery Component Work Without it (#3292)
* No More Calling get_equipped_items() in mob/living/Crossed(), Makes Slippery Component Work Without it (#56820)

* gets rid of mob/living/crossed and makes clown pdas work without it

* makes squeaky work without COMSIG_ITEM_WEARERECROSSED

* No More Calling get_equipped_items() in mob/living/Crossed(), Makes Slippery Component Work Without it

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
2021-02-11 23:44:29 +00:00
SkyratBot
e05cca4ab4 [MIRROR] Rework job food/alchohol benefits into livers (#2648)
* Rework job food/alchohol benefits into livers  (#55721)

By moving the "special behaviour" of something like security officers
eating donuts, or engineers losing radiation by drinking Screwdrivers,
into traits on the liver, this makes the "origin" of that behaviour more
clearly defined, rather than something that's attached to the mind of
the person. (For example, now if a wizard mindswaps into a Security
Officer, they too can now digest donuts good.)

Having this behaviour be partially visible to the more medically
inclined members of the station (like doctors, and the chaplain for
"entrails reading mystic" themes), means that a dismembered liver tells
a story to those who know how to read it.

Some jobs have more "benefits" than others, for example the only thing
that the liver of a Quartermaster gives them is a sense of inadequacy
when consuming royal carpet.

Clowns having livers that honk make them easier to identify, and plays
into the retconned "bike horns are clown livers lore"? Also, why not cut
out a clown's liver then honk them with it? You monster.

* Rework job food/alchohol benefits into livers

Co-authored-by: coiax <jack@billbuddy.co.uk>
2021-01-12 01:50:22 +01:00
SkyratBot
3f22ac0cee [MIRROR] Removed effect/dummy/phased_mob copypasta. Fixed squeak component triggering from abstract effects & co. (#1784)
* Removed effect/dummy/phased_mob copypasta. Fixed squeak component triggering from abstract effects & co. (#54783)

* Removed effect/dummy/phased_mob copypasta. Fixed squeak component triggering from abstract effects & co.

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2020-11-23 18:29:54 +00:00
SkyratBot
d1315d9474 [MIRROR] Audio falloff re-work, and increased audio range. (#1406)
* Audio falloff re-work, and increased audio range.

* a

* a

Co-authored-by: Qustinnus <Floydje123@hotmail.com>
Co-authored-by: Azarak <azarak10@gmail.com>
2020-10-21 07:36:31 +02:00
SkyratBot
243e224167 [MIRROR] Custom statues and sculpting changes. (#927)
* Custom statues and sculpting changes. (#53154)

### Gameplay changes:
- Spacemen lose their ability to sculpt all minerals into statues barehanded, you need a chisel now.
- You can now create carving blocks out of 5 sheets of most materials.
- Using a chisel on the blocks you can designate what to carve in it (including the preset statues from before).
- Chisels can be printed at autolathe, there's also one in art storage.
### Code changes:
- Squeak component now squeaks on attack_hand for structures.
- Radials now accept atom paths automatically extracting the name with initial.
- Base and rigid stack recipes renamed appropriately.
- Statues now use custom materials.

* Custom statues and sculpting changes.

Co-authored-by: AnturK <AnturK@users.noreply.github.com>
2020-09-23 14:42:47 +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
JJRcop
a1392847bd Remove ismovableatom macro (#9) 2020-02-17 15:03:16 +01:00
nemvar
a148cae769 Kills obj/item/projectile in favour of obj/projectile (#46692)
* Kills obj/item/projectile in favour of obj/projectile

* Resolves conflicts properly

* fixes that one map

* it lives
2019-10-06 13:37:24 -04:00
Firecage
69a0c5b15c Bike horns, golden horns, rubber ducks, and air horns no longe… (#46690)
* Bike horns no longer squeaks when crossed in Zero-G.

* Flying over bikehorns no longer squeaks them.

* Replaces the has_gravity() check.
2019-09-25 17:08:29 -07:00
Qustinnus
9812834054 Adds knight armour to the game that can be made from any material (#46301)
* Adds knight armour

* fixes armor

* nerfs & fixes

* adds ruin

* done

* bug

* oh im a buddy

* rad

* ok nem

* fix sprite

* fixes

* tgm

* epic

* re-adds icons

* fixes list

* ok ninja

* fixes

* fixed

* woops
2019-09-14 15:32:29 -04: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
ninjanomnom
56196df9c6 Reverts datum outputs
reverts #43038
reverts #41535
2019-06-13 20:09:10 -04:00
nemvar
c44120b5d1 Adds bee plushies (#44342)
* Adds beeplushies

* makes the behind less pure black

* Newline
2019-06-07 13:55:02 -04:00
ninjanomnom
539a17dc21 Adds a source var to a signal receiver that should have it 2019-05-18 14:56:00 -04:00
Militaires
3ff0287d90 [READY] Outputs Datum Cooldown: For Real Guys This Time (#43038)
cl Basilman
fix: Added a cooldown for datum outputs
/cl

also added an arg called do_owner in playsound that lets the owner of a datum output be different from the atom that plays it, chiefly used for component/squeak so that you can apply the component directly to any single atom without having to fuck with said atom's datum_outputs list so that it can properly play the sound, since the datum output is already stored within the datum component itself.

also send_info now returns true or false based on whether it's cooling down or not, i dont like this and i initially just had a var for whether it's cooling down or not but raz said it saves a var so i guess whatever ill just have it like that
2019-04-03 10:48:37 +13:00
ShizCalev
c4c5ece3ba Fixes jaunting mobs squeaking things. 2019-02-25 09:31:28 -05:00
Militaires
cecf676684 [Ready] Outputs datum (#41535)
Idea and instructions by @Razharas, many thanks.

This PR only implements the framework required to catalog as well as play the sounds. Their to_chat text, and icons (if any) are not included, are to be pushed in a separate PR.

This PR does not remove the old playsound_local system, it is kept for the sake of not necessitating a direct changeover of every single playsound in the code, which will surely cause a lot of merge conflicts. It does however, replace bike horns' and toy nukes' means of playback to this datum, purely as proof of concept.

Playsound_local may remain in the code to support playback of admin-uploaded sounds that do not have an inherent datum. Playsound will likely be renamed to something else in the next PR to reflect its new, more universal function. We will see.

New process for adding sounds:

    Create a new datum/outputs subtype.
    If you wish, write down some supporting text; this gives further meaning to the sound.
    Add multiple sounds to the sounds list, and weight them as you wish. (New)
    Add a sound icon if you wish, it defaults to a generic sound circle anyways though.
    playsound(/datum/outputs/new_subtype, receiver), and it will deliver, icon, sound, and text to the receiver.

Maintaining implication is that from now on playsound should only be processing datum/outputs

This pr intends to gut to_chats that are added alongside playsounds in the code.
This pr eliminates the need to initialize sounds in a list so that you can weight them or have the game play them randomly from the list.

Sound Rings
Currently, only mobs with the audiolocation var may view them. Sound icons have an alpha that depends on the volume of the sound, louder sounds create a more opaque image

Sound rings are completely modular and may be changed to any image.

In addition to renaming playsound to reflect its new function. I intend to give blind people sound icons at the cost of their small view, but that is for another PR.

cl Basilman
refactor: refactored how sounds are stored and played
add: Added sound rings and supporting text
/cl
2019-02-04 10:25:48 +13:00
kevinz000
c48de148fb bike horns and most things that have the squeak component no longer triggers from projectiles flying past them (#40077)
* Update squeak.dm

* woops

* Update squeak.dm
2018-09-07 12:57:33 +02: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
McBawbaggings
d2f7b3376a isnum() checks for squeak component initialisation (#39847)
if you supply step_delay_override or use_delay_override as 0 then component
just ignores these new values despite them being valid options

by using isnum() checks, these values can actually be used for this
2018-08-22 18:18:53 -07:00
ninjanomnom
20f015a2ea Makes the squeak component slightly more horrifying
The clown outfit got its hardcoded squeak on hit replaced with the component.
Objects which can squeak which are thrown in disposals will squeak when they hit bends in the piping.
2018-07-11 01:12:45 -04:00
Emmett Gaines
3c7bffc278 Renames the squeak component file and cleans up a little registry (#38954) 2018-07-10 15:05:28 -04:00