* Improves duplication (#72572)
## About The Pull Request
- Improves duplication code significantly
- Removes 'perfectcopy', 'newloc', 'nerf' and 'holoitem' args. These
were made for holodeck items, but holodeck items do not use this proc so
it's since been unused.
- Adds many things to duplicate forbidden vars, such as external organs
(and fixes internal organs), overlays, and signals. The signal part is
what broke basic things for duplicated mobs, such as dying, huds, and
lying down.
- Duplicated mobs now properly carry over the identity of the old mob
without losing anything in the process, and now actually work as a mob,
with visible HUDs and everything. They also carry implants over now.
- Duplicated mobs also now no longer cut all their contents and rebuild
the entire mob, they don't carry overlays at all (so we don't have the
problems that come along with it, like clothing sprites from clothes
that don't exist).
- As a minor detail, makes DuplicateObject use snake_case instead, and
makes duplicate_forbidden_vars protected.
- Removes copy_contents_to because it's unused. It was originally meant
for Holodeck, but holodecks now use map templates so it's no longer used
in-game.


## Why It's Good For The Game
Closes https://github.com/tgstation/tgstation/issues/42212
Duplicating mobs no longer gives a broken mob, which was a common
problem with cloning pods (the admin pods, that you drop down onto
people).
Updates very old code to modern code standards.
This PR was made to help out
https://github.com/tgstation/tgstation/pull/71141 too, the author of
that PR is aware of this one.
## Changelog
🆑
refactor: Duplicating mobs now should now give properly functioning
mobs, as duplications in general have been reworked. Admins can feel
free to use the pod feature on people.
/🆑
* Improves duplication
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Abstract away stuff that acts on baseturfs directly into their own procs, and kills some dead code related to baseturfs + tests (#72117)
Adds some new procs relating to baseturfs that replaces some code that
reads and sets them directly. Moves them to their own file. **To
reviewers: Any proc in baseturfs.dm that is snake_case is mine, anything
else is just moved**.
Adds tests for the existing procs of baseturfs.
I'm going to be doing some optimizations to baseturfs that change the
actual representation of baseturfs, and so I'm prepping these to be
implementation agnostic.
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
* Hologram Projectors for TGC! (#72226)
## About The Pull Request
Adds a new holodeck layout that features a TGC card fighting arena,
complete with holographic representations of your cards. Cards act the
same as physical cards when displayed except you can see the stats of
the cards without needing to inspect and the cards stats can be modified
on the fly for keeping track of equipment.
Example:

## Why It's Good For The Game
TGC is a significantly more complicated game then the other ones we have
like UNO and CAS and is extremely messy to play on a table ingame, this
provides a much clearer way of visualizing the game by having all active
creature stats on full display at all times without having to rely on
inspecting cards to check.
## Changelog
🆑
add: Introducing a new holodeck map, the TGC Arena, featuring hologram
projectors for your trading cards.
fix: Janitor and Intern TGC cards are now considered creatures rather
than just humans.
balance: The price of card packs has been reduced from double a paycheck
to 3 quarters of one.
balance: The number of cards available in the good clean fun vendor has
been doubled.
/🆑
* Hologram Projectors for TGC!
Co-authored-by: NamelessFairy <40036527+NamelessFairy@users.noreply.github.com>
* Smoothing groups optimization, save 265ms with configs, more on production & w/ space ruins (#71989)
This one is fun.
On every /turf/Initialize and /atom/Initialize, we try to set
`smoothing_groups` and `canSmoothWith` to a cached list of bitfields. At
the type level, these are specified as lists of IDs, which are then
`Join`ed in Initialize, and retrieved from the cache (or built from
there).
The problem is that the cache only misses about 60 times, but the cache
hits more than a hundred thousand times. This means we eat the cost of
`Join` (which is very very slow, because strings + BYOND), as well as
the preliminary `length` checks, for every single atom.
Furthermore, as you might remember, if you have any list variable set on
a type, it'll create a hidden `(init)` proc to create the list. On
turfs, that costs us about 60ms.
This PR does a cool trick where we can completely eliminate the `Join`
*and* the lists at the cost of a little more work when building the
cache.
The trick is that we replace the current type definitions with this:
```patch
- smoothing_groups = list(SMOOTH_GROUP_TURF_OPEN, SMOOTH_GROUP_FLOOR_ASH)
- canSmoothWith = list(SMOOTH_GROUP_FLOOR_ASH, SMOOTH_GROUP_CLOSED_TURFS)
+ smoothing_groups = SMOOTH_GROUP_TURF_OPEN + SMOOTH_GROUP_FLOOR_ASH
+ canSmoothWith = SMOOTH_GROUP_FLOOR_ASH + SMOOTH_GROUP_CLOSED_TURFS
```
These defines, instead of being numbers, are now segments of a string,
delimited by commas.
For instance, if ASH used to be 13, and CLOSED_TURFS used to be 37, this
used to equal `list(13, 37)`. Now, it equals `"13,37,"`.
Then, when the cache misses, we take that string, and treat it as part
of a JSON list, and decode it from there. Meaning:
```java
// Starting value
"13,37,"
// We have a trailing comma, so add a dummy value
"13,37,0"
// Make it an array
"[13,37,0]"
// Decode
list(13, 37, 0)
// Chop off the dummy value
list(13, 37) // Done!
```
This on its own eliminates 265ms *without space ruins*, with the
combined savings of turf/Initialize, atom/Initialize, and the hidden
(init) procs that no longer exist.
Furthermore, there's some other fun stuff we gain from this approach
emergently.
We previously had a difference between `S_TURF` and `S_OBJ`. The idea is
that if you have any smoothing groups with `S_OBJ`, then you will gain
the `SMOOTH_OBJ` bitflag (though note to self, I need to check that the
cost of adding this is actually worth it). This is achieved by the fact
that `S_OBJ` simply takes the last turf, and adds onto that, meaning
that if the biggest value in the sorting groups is greater than that,
then we know we're going to be smoothing to objects.
This new method provides a limitation here. BYOND has no way of
converting a number to a string at compile time, meaning that we can't
evaluate `MAX_S_TURF + offset` into a string. Instead, in order to
preserve the nice UX, `S_OBJ` now instead opts to make the numbers
negative. This means that what used to be something like:
```dm
smoothing_groups = list(SMOOTH_GROUP_ALIEN_RESIN, SMOOTH_GROUP_ALIEN_WEEDS)
```
...which may have been represented as
```dm
smoothing_groups = list(15, MAX_S_TURF + 3)
```
...will now become, at compile time:
```dm
smoothing_groups = "15,-3,"
```
Except! Because we guarantee smoothing groups are sorted through unit
testing, this is actually going to look like:
```dm
smoothing_groups = "-3,15,"
```
Meaning that we can now check if we're smoothing with objects just by
checking if `smoothing_groups[1] == "-"`, as that's the only way that is
possible. Neat!
Furthermore, though much simpler, what used to be `if
(length(smoothing_groups))` (and canSmoothWith) on every single
atom/Initialize and turf/Initialize can now be `if (smoothing_groups)`,
since empty strings are falsy. `length` is about 15% slower than doing
nothing, so in procs as hot as this, this gives some nice gains just on
its own.
For developers, very little changes. Instead of using `list`, you now
use `+`. The order might change, as `S_OBJ` now needs to come first, but
unit tests will catch you if you mess up. Also, you will notice that all
`S_OBJ` have been increased by one. This is because we used to have
`S_TURF(0)` and `S_OBJ(0)`, but with this new trick, -0 == 0, and so
they conflicted and needed to be changed.
* Sorting how did I miss it
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Funce <funce.973@gmail.com>
* fixes holodecks directly changing baseturfs (#72067)
## About The Pull Request
i did this with #59355 to fix a bug but it breaks guarantees with
baseturfs. now they arent broken.
## Why It's Good For The Game
this probably causes bugs under some conditions
* fixes holodecks directly changing baseturfs
Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
* Adds missing descriptions again (#72013)
Adds descriptions to some base types (such as walls, floors,
machines frames and computer frames) to make the world feel
more alive.
Authored-by: etherware-novice <candy@ notarealaddr.com>
Co-authored-by: OrionTheFox <76465278+OrionTheFox@ users.noreply.github.com>
* Adds missing descriptions again
Co-authored-by: texan-down-under <73374039+etherware-novice@users.noreply.github.com>
Co-authored-by: OrionTheFox <76465278+OrionTheFox@ users.noreply.github.com>
* Refactors Rabbits to be a Basic Mob (#71205)
## About The Pull Request
Back in #64175, I reworked rabbits such that their base behavior was
just a cute fluffy snuggle monster, and not have the "easter" variant be
the default. Now that we're transitioning everything from simple_animal
to basic, I figured now was the time to shift that over too.
Pretty much everything should be the same as it was before, I even took
some time to add behavior to some elements to allow it to work (let me
know if I should handle it a different way) but rabbits as a
simple_animal and rabbits as a basic mob should now not be very
distinguishable (beyond the fact that they only speak via subtrees).
I also got rid of the single-letter icon_states in the DMI and
accomodated the code to fix because I finally got irritated enough to do
something about that.
## Why It's Good For The Game
Although I didn't really have any pressing urge to add more complex AI
behavior to rabbits than just pretty much re-implementing what they had
as a simple_animal, this is an excellent first-step to allowing much
more extensible behaviors to these fuzzy creatures.
Also, it takes three more mobs off "the frozen list". Whoopie!
## Changelog
🆑
fix: Dead Black Space Rabbits should now properly have a sprite.
/🆑
The UpdatePaths is useless for the maps we have on our repository
(holodecks use a spawner code-side), but I'm going to be nice to
downstreams who need it.
* Refactors Rabbits to be a Basic Mob
* Fixed the CI and the rabbit on VoidRaptor
* Oops, forgot to remove it from here too
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* changes holodeck crab to a holographic crab (#69850)
Properly makes the crab on the holodeck beach into a holocrab
RUDE people were butchering the poor crab for infinite crab meat
leave him alone hes nice :(
* changes holodeck crab to a holographic crab
Co-authored-by: YakumoChen <king_yoshi42@yahoo.com>
* [MDB Ignore][Bounty][Complete Refactor] Papercode Redux: Too Many Damn Files <Map Conflict Edition>
* Fixes merge conflicts and compilation errors, alongside fixing the joker card to make it fully functional again
* Fixed a bunch of info variables in map files
* Alright this is why I wanted this merged yesterday
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* Adds Baseballs (#68249)
Adds baseballs to the game (There is a baseball field in the holodeck).
You can now bat thrown objects with the baseball bat to launch them away at high speed.
https://streamable.com/471jvv (baseball is a boomerang here because otherwise this would have been impossible to test singleplayer)
Why It's Good For The Game
it could be fun to have a game of baseball, and people trying to bat an item thrown at them sounds funny
image
Changelog
cl Fikou, sprite by Mooster
add: Baseballs are now available in the Baseball Field on the Holodeck.
add: Baseball Bats can now hit thrown objects mid-air to send them back.
/cl
* Adds Baseballs
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
* Virtually Visualized Microwave Holodeck Hell (#67187)
Hello there,
Do you ever wake up and find yourself thinking: I need more microwaves? Well, look no further.
* Virtually Visualized Microwave Holodeck Hell
Co-authored-by: san7890 <the@san7890.com>
* [MDB IGNORE] More /area/ typepath organization and cleanup (#67107)
This further continues what I did in b4fb8f3ed1 (but instead of just stations, its now every (most) applicable area in the game
* [MDB IGNORE] More /area/ typepath organization and cleanup
* wew
* e
* Update CentCom_skyrat.dmm
* wew
* ews
Co-authored-by: Jolly <70232195+Jolly-66@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
* Improper forced qdel cleanup, some expanded del all verbs (#66595)
* Removes all supurfolus uses of QDEL_HINT_LETMELIVE
This define exists to allow abstract, sturucturally important things to
opt out of being qdeleted.
It does not exist to be a "Immune to everything" get out of jail free
card.
We have systems for this, and it's not appropriate here.
This change is inherently breaking, because things might be improperly
qdeling these things. Those issues will need to be resolved in future,
as they pop up
* Changes all needless uses of COMSIG_PARENT_PREQDELETED
It exists for things that want to block the qdel. If that's not you,
don't use it
* Adds force and hard del verbs, for chip and break glass cases
respectively
The harddel verb comes with two options before it's run, to let you
tailor it to your level of fucked
* Damn you nova
Adds proper parent returns instead of . = ..()
Co-authored-by: Seth Scherer <supernovaa41@ gmx.com>
* Ensures immortality talismans cannot delete their human if something goes fuckey. Thanks ath/oro for pointing this out
Co-authored-by: Seth Scherer <supernovaa41@ gmx.com>
* Improper forced qdel cleanup, some expanded del all verbs
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Seth Scherer <supernovaa41@ gmx.com>
* The Rabbit Separatist Movement from Easter (BNUYY EDITION) (#64175)
Moves rabbits, updates some docs for them
* The Rabbit Separatist Movement from Easter (BNUYY EDITION)
Co-authored-by: san7890 <34697715+san7890@users.noreply.github.com>
* Moves Pun Pun away from the kitchen on Delta (and makes monkeys actually look like monkeys in the map editor) (#62108)
* Moves Pun Pun away from the kitchen on Delta (and makes monkeys actually look like monkeys in the map editor)
* Update DeltaStation2.dmm
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
* Fixes exploit that allowed players to disable the safety of holodeck consoles without the proper conditions being followed (#62563)
About The Pull Request
As the title says. Players were able to disable the safety of the holodeck without the console being emagged, and without being a robot.
Why It's Good For The Game
I think it would be interesting to add some sort of replacement to this, like players with high gamer skill could disable the safety.
Changelog
cl
fix: Fixes an exploit that allowed players to disable holodeck safety without following the proper conditions
/cl
* Fixes exploit that allowed players to disable the safety of holodeck consoles without the proper conditions being followed
Co-authored-by: CocaColaTastesGood <47264839+CocaColaTastesGood@users.noreply.github.com>
* Refactor /turf/var/intact (#62331)
Turfs have a variable, intact, which conflates three meanings:
Determining whether there's something that can be pried out, such as directly with a crowbar or indirectly with a tile stack and a crowbar off-hand.
Determining whether underfloor pieces are visible.
Determining whether underfloor pieces can be interacted with - by players with tools, through interaction with effects like chemical acid, or foam.
When plating is hit with a stack of tiles, /turf/open/floor/attackby checks whether the turf is intact, and if so, ends the attack chain regardless of whether or not the attempt to hotswap a turf (with a crowbar) is successful or not. However, turfs which want the underfloor to be visible - such as catwalks and glass - set the intact variable to FALSE, and so can be repeatedly placed over one another, as if they were the first tile to be placed over the plating.
This refactors /turf/var/intact into two distinct variables:
/turf/var/overfloor_placed, for whether or not there is something over plating.
/turf/var/underfloor_visible, for whether or not the various underfloor pieces should be invisible, visible, or both visible and interactable.
All references to /turf/var/intact have been replaced with an equivalent overfloor_placed or underfloor_visible reference, depending on which check is appropriate. underfloor_accessibility can take one of UNDERFLOOR_HIDDEN, UNDERFLOOR_VISIBLE, or UNDERFLOOR_INTERACTABLE. This prevents cases such as acid foam or tools phasing through glass floors to affect the underfloor pieces underneath, and covers all kinds of unusual, not-wiring-visiblity usage such as Holodeck completeness, Revenant interaction, or station integrity checking.
* Refactor /turf/var/intact
* Thank
Co-authored-by: esainane <esainane+github@gmail.com>
Co-authored-by: Funce <funce.973@gmail.com>
* Adds SHOULD_NOT_SLEEP to Destroy. Why didn't we do this before. (#61943)
* Adds SHOULD_NOT_SLEEP to Destroy. Why didn't we do this before.
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
* holographic esword doesnt have blockchance (#61548)
fixes the holosword having inherited block chance from its parent after the transforming weapons refactor.
* holographic esword doesnt have blockchance
Co-authored-by: manofpepsi <71612753+manofpepsi@users.noreply.github.com>
* Baton refactor. item/melee/baton is now a subtype of item/melee/baton (formerly classic_baton)
* EEEE
* E
* follow the fucking guidelines
* E
* Update CentCom_skyrat.dmm
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
* large refactor of machine/power code to cut down on processing time and wasted lists (#60317)
original pr here: #59789 (Closed because he didn't think it was good enough)
came back to this because i realized that
all machines were area sensitive, meaning they had a list with at least a reference to themselves (assuming they arent in the contents of another movable which most arent) for the purposes of handling power differences when their area changes
pipes are machines
there are ~14k machines and ~6k pipes
i made this problem worse with a recent pr by making it a nested list
so i needed to track what machines needed power, and this pr had work already done that could be used for that purpose. now machines that have use_power == NO_POWER_USE do not have this extra memory overhead for no reason
currently every machine that uses power draws that amount from its area from a dynamic channel via auto_use_power() which is called every SSmachines fire(), then in apc/process() the area's dynamic power draw is reset and the power is used. with static power its not calculated then reset every loop, its just taken from the grid. so now machines handle updating their static power usage from their current area (this doesnt touch power machines that require a wire connection). in order to allow this, use_power, idle_power_usage, and active_power_usage have setters to track state correctly and update the static power usage on the machines current area and handle area sensitivity.
also goes through a lot of heavy abusers of SSmachine processing time and tries to make it faster. makes airalarm/process() into a signal handler for COMSIG_TURF_EXPOSE since air alarms only need to process for changes.
Why It's Good For The Game
SSmachines isnt the heaviest hitter in terms of total cpu and certainly not in terms of overtime, but its not a lightweight. it frequently takes > 50ms to complete a run and seems to be in the top 5 or so of subsystem costs looking at some round profilers
also gets rid of a few thousand lists since every pipe no longer has two useless lists each (and any other machines that dont use power)
Love ya kyler
Co-authored-by: Rohesie <rohesie@ gmail.com>
* large refactor of machine/power code to cut down on processing time and wasted lists
Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: Rohesie <rohesie@ gmail.com>
* fixes hard del with objects created from holodeck spawners (#60140)
turns out mobs spawned from holodeck spawners dont get registered for qdeletion, now they do. hard dels btfo
hard dels are poo poo and holodeck issues are definitely 100x worse
* fixes hard del with objects created from holodeck spawners
Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
* Adds Neon Carpet (#59140)
Adds a couple varieties of neon carpet.
Makes decals care about their plane in addition to their layer.
* 0
* A
* a
Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
* fixes bug with holodecks referencing self deleting atoms in spawned (#59355)
decals were hard deleting whenever you loaded a holodeck program with them because it wasnt taking them out of the spawned list, now it does that. also goes around holodeck code and changes for loops to as anything and puts in better var names.
also since its been a while since i looked at holodeck code, the thing could really use a better rewrite one of these days.
* fixes bug with holodecks referencing self deleting atoms in spawned
Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>