Commit Graph

359 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
SkyratBot
6ee8dbb9c7 [MIRROR] Code clean-up & refactor for all RCD related & like devices. [MDB IGNORE] (#20394)
* Code clean-up & refactor for all RCD related & like devices. (#74527)

## About The Pull Request

1. Debloats the RCD.dm file i.e. renames it to RHD[Rapid handheld device
the base for all rcd like devices] and moves its subtypes into their
respective files
`/obj/item/construction/rcd` moved to RCD.dm
`/obj/item/construction/rld` moved to RLD.dm
`/obj/item/construction/plumbing` moved to RPLD.dm
`/obj/item/construction/rtd` stays in RTD.dm
Other rcd like device i.e. RPD, RFC, RWD, along with the above mentioned
files are now all moved into 1 folder called "rcd"
majority of the `to_chat()` are now replaced with `balloon_alert()` to
reduce spam

2. Adds early returns, optimizes & adds extra resource sanity checks
before and after the `do_after()` proc for the RLD. RLD silo links now
works again.
- RLD now uses an ammo bar just like the RCD for updating only its
overlays & not its entire icon state, it also has a blinking yellow icon
state when low on ammo
- Remove unused empty blinking yellow icon state for plumbing RCD.
nobody designed the ammo bars for them so having`has_ammobar = TRUE`
caused the unit tests to fail

4. Adds extra structure placement & resource sanity checks for RCD, RTD
& Plumbing RCD before & after the `do_after()` proc
  RCD Patches
- removes unused vars window_type & window_glass, these can be infered
from window_type directly
- removes furnish type & cost and let the rcd_vals() proc decide those
for consistency
- copies the rcd stuff from turf/floor to turf/open/misc with some
exceptions, It wasen't updated in a long time
- rcd vals i.e. cost & delay for window types are set for each
directional, full-tile, reinforced types. These all used constant values
& now they are adjusted accordingly

   RTD patches
      - Fixes #74526 RTD can lay floor tiles on all types of plating's
- The cost of deconstructing tiles was not calculated correctly i.e. it
always used the cost of the selected design & not the cost of the actual
floor type we are trying to deconstruct
- The construction & deconstruction time was constant & very fast for
all tile types, now the delay is adjusted based on the cost of the type
of tile in question
- RTD now has a blinking yellow empty icon state just like the RCD when
low on ammo

6. Fixes #73479 RCL now updates its pipe cleaning coil appearance when
changing colours & selecting white colour no longer yields a random coil
colour

7. makes sure `useResource() ` actually succeeds before doing any
action. The return value of this proc was not previously checked for
some devices

## Why It's Good For The Game
1. rcd like devices all moved into 1 folder for better organization
2. splits the original RCD.dm file into more logical & manageable files
for better maintainability
3. removes unused code & adds some extra sanity checks for everything
4. adds missing sprites for RLD & RTD

## Changelog
🆑
code: RCD & all its subtypes and other devices like it[RTD, RLD,
Plumbing RCD, RWD, RFC, RPD] now moved into 1 folder, removes unused
vars
refactor: RCD window type cost & delay are set based on the window type
selected.
refactor: RLD, RCD & plumbing RCD now has extra resource & target
placement sanity checks, optimizes RLD and code readability.
refactor: RTD now sets the correct delay with the cost of the tile type
currently being constructed/deconstructed taken into account
refactor: large majority of to_chat() replaced with balloon alerts
fix: RLD silo link now works again
fix: RTD can place tiles on any subtype of plating
fix: RCL now lays the correct colour of pipe cleaner when its colour is
changed
imageadd: empty blinking yellow icon states for RTD & RLD & an ammo bar
for RLD
/🆑

* Code clean-up & refactor for all RCD related & like devices.

* Update RHD.dm

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2023-04-12 20:29:46 +01:00
SkyratBot
1afaf1562a [MIRROR] [MDB IGNORE] UpdatePaths to convert directional pane windows to their proper subtypes, also creates the /south spawner for consistency [MDB IGNORE] (#20463)
* [MDB IGNORE] UpdatePaths to convert directional pane windows to their proper subtypes, also creates the /south spawner for consistency

* wew

---------

Co-authored-by: Jolly <70232195+Jolly-66@users.noreply.github.com>
Co-authored-by: Paxilmaniac <paxilmaniac@gmail.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2023-04-12 20:08:08 +01:00
SkyratBot
5ffa941627 [MIRROR] Removes opacity from non fulltile tinted windows [MDB IGNORE] (#20288)
* Removes opacity from non fulltile tinted windows (#74452)

## About The Pull Request

IT DOESN'T WORK, OPACITY IS NOT DIRECTIONAL, IT JUST LOOKS FUCKING
STUPID

WHY DO WE USE THIS 48 TIMES WHY ARE YOU PEOPLE LIKE THIS

## Why It's Good For The Game

![image](https://user-images.githubusercontent.com/58055496/229333339-78f1c4d8-51e2-4370-a9a9-b9ecf045a7c4.png)

## Changelog
🆑
fix: Directional frosted/tinted windows will no longer fuck up vision
/🆑

* Removes opacity from non fulltile tinted windows

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-04-03 04:00:09 +01:00
SkyratBot
093d20a2df [MIRROR] Makes all CTF windows actually indestructible [MDB IGNORE] (#19922)
* Makes all CTF windows actually indestructible (#74021)

## About The Pull Request

Adds a spawner for indestructible shuttle windows
Replaces all "hardened windows" (which were actually not unbreakable)
with proper unbreakable windows

## Why It's Good For The Game

Fixes #73297, people shouldn't be breaking into space in CTF

## Changelog
🆑
fix: All CTF windows are now indestructible, fixes breaking into space
during CTF.
/🆑

* Makes all CTF windows actually indestructible

---------

Co-authored-by: jimmyl <70376633+mc-oofert@users.noreply.github.com>
2023-03-17 22:46:18 -04:00
SkyratBot
8805502dc4 [MIRROR] Fixes the metallic hydrogen axe being silent when being used as a crowbar and crowbars can now hit windows. [MDB IGNORE] (#19852)
* Fixes the metallic hydrogen axe being silent when being used as a crowbar and crowbars can now hit windows. (#73974)

## About The Pull Request

The metallic hydrogen axe had no usesound var set despite having a
tool_behavior applied to it, this meant that when using it as a crowbar,
for example to remove floor tiles no sound was played. I've given it the
default crowbar sound for this.

Bonus fix: Crowbars were incapable of hitting fully constructed default
windows, this included the H2 axe, They are now able to be used on
standard windows (they already worked on reinforced windows)

## Why It's Good For The Game

Missing sound bad. Pretty sure the crowbar thing is a bug too.
## Changelog
🆑
fix: The metallic hydrogen axe is no longer silent when using it as a
crowbar.
fix: You are now capable of hitting standard windows with a crowbar when
they're fully constructed.
/🆑

* Fixes the metallic hydrogen axe being silent when being used as a crowbar and crowbars can now hit windows.

---------

Co-authored-by: NamelessFairy <40036527+NamelessFairy@users.noreply.github.com>
2023-03-15 00:48:13 +00:00
SkyratBot
d17b330c5b [MIRROR] De-hardcodes spawnDebris in windows, fixes a bunch of issues with windows. [MDB IGNORE] (#19357)
* De-hardcodes spawnDebris in windows, fixes a bunch of issues with windows. (#73274)

## About The Pull Request

spawnDebris was being overridden by almost every type of window, I've
set up some new vars for it to pull shard and its debris decal from so
spawnDebris only needed to be set up once (+ once more for paper windows
which are unique).
Fixes an issue with reinforced plasma glass windows dropping regular
glass when broken.
Fixes an oversight where tram windows were dropping only 1 rod instead
of 2 and dropping glass sheets instead of shards.
Cleans up tram window code a bunch.
## Why It's Good For The Game

Fixes several issues, cleans up code and cuts down on a lot of repeat
code.
## Changelog
🆑
fix: Reinforced plasma windows will now drop plasma glass instead of
regular glass when broken.
fix: Tram windows drop the correct number of rods and a shard when
broken instead of a sheet.
code: Removed a ton of duplicate vars in tram window code and
re-organize the file slightly.
refactor: spawnDebris has been un-hardcoded and all (but one) override
of it has been removed.
/🆑

* De-hardcodes spawnDebris in windows, fixes a bunch of issues with windows.

---------

Co-authored-by: NamelessFairy <40036527+NamelessFairy@users.noreply.github.com>
2023-02-15 13:04:19 -08:00
lessthanthree
2127d305b3 [MANUAL MIRROR] Tram Mk. IV (#19131)
Tram Mk. IV (#73057)

- After one too many tram malfunctions, Nanotrasen's insurance provider
finally sprung the cash for a new tram. Made with the latest in
lightweight materials, there's more capacity than ever before to shuttle
your crew around the station.

https://user-images.githubusercontent.com/83487515/215639768-3f7fcb84-cfd2-4efe-b578-998197651f13.mp4

- Consolidates all the tram turfs, objs, and structures into respective
.dm files because they were haphazardly spread everywhere.
- Fixes tram doors playing open/close animations when they're already in
the correct state, corrects timing for when they change density.
- Tram now correctly has an operating status and will stop functioning
when power is lost.
- Call buttons no longer dispatch a tram that doesn't have power.
- Fix for emergency exit when tram has no power.
- Running at closing tram doors is a gamble, you may be crushed
- Fixes https://github.com/tgstation/tgstation/issues/73125

Looks nice, more space, tram doors demand a pound of flesh.
🆑 LT3
imageadd: Nanotrasen's insurance provider finally sprung the cash for a
new tram. Made with the latest in lightweight and mostly* non-flammable
materials, travel in comfort and style!
code: All tram components are now organised based on type
code: Tram is now aware if it has power or not
del: Removed movement slowdown running on tram plates
fix: Tram call buttons will not work calling an unpowered tram
fix: Tram doors will no longer cycle open/closed when they're already in
the correct position
fix: Fixed an edge case where running onto the tram you bounce off the
open door as if it was closed
fix: Unpowered tram doors can only be forced into the open position
fix: Westbound travel shows the correct controls animation
add: Tram doors take a chunk of flesh if you run at them last minute
qol: Reduced duration of amber stage on tram crossing signals
/🆑
2023-02-03 15:55:39 +00:00
Zonespace
8fabd54ad6 Mirrors #72354 (#18654)
* [no gbp] removes all duplicate armor datums (#72354)

closes #72348
Title

My bad

Heres the script I used this time if you want to
```cs
var baseDir = Environment.CurrentDirectory;

var allFiles = Directory.EnumerateFiles($@"{baseDir}\code", "*.dm", SearchOption.AllDirectories).ToList();
var known = new Dictionary<string, List<KeyValuePair<string, int>>>();

foreach (var file in allFiles)
{
	var fileLines = File.ReadAllLines(file);
	for (var i = 0; i < fileLines.Length; i++)
	{
		var line = fileLines[i];
		if (line.StartsWith("/datum/armor/"))
		{
			var armorName = line.Replace("/datum/armor/", "").Trim();
			if (!known.ContainsKey(armorName))
				known[armorName] = new List<KeyValuePair<string, int>>();
			var knownList = known[armorName];
			knownList.Add(new KeyValuePair<string, int>(file, i));
		}
	}
}

Console.WriteLine($"There are {known.Sum(d => d.Value.Count)} duplicate armor datums.");

var duplicates = new Dictionary<string, List<int>>();
foreach (var (_, entries) in known)
{
	var actuals = entries.Skip(1).ToList();
	foreach (var actual in actuals)
	{
		if (!duplicates.ContainsKey(actual.Key))
			duplicates[actual.Key] = new List<int>();
		duplicates[actual.Key].Add(actual.Value);
	}
}

Console.WriteLine($"There are {duplicates.Count} files to update.");

foreach (var (file, idxes) in duplicates)
{
	var fileContents = File.ReadAllLines(file).ToList();
	foreach (var idx in idxes.OrderByDescending(i => i))
	{
		string line;
		do
		{
			line = fileContents[idx];
			fileContents.RemoveAt(idx);
		}
		while (!String.IsNullOrWhiteSpace(line));
	}
	File.WriteAllLines(file, fileContents);
}
```

* modular

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
2023-01-13 18:05:12 -05:00
SkyratBot
b44967501c [MIRROR] Optimizes explosions (very slightly) [MDB IGNORE] (#18624)
* Optimizes explosions (very slightly)

* Update explosions.dm

* Update atoms_movable.dm

* Update dungeon.dm

* Update stone.dm

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
2023-01-10 12:34:26 -08:00
SkyratBot
36bc850a11 [MIRROR] fixes silly stuff about basic mobs [MDB IGNORE] (#18368)
* fixes silly stuff about basic mobs

* merge conflicts, also apply upstream 72120

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
2023-01-09 06:00:48 -05:00
SkyratBot
011fefdd81 [MIRROR] Refactors armor into dedicated subtypes [MDB IGNORE] (#18291)
* Refactors armor into dedicated subtypes

* start

* most tg things

* pain (#18584)

* shit

* non-mod changes

* compile

Co-authored-by: John Doe <gamingskeleton3@gmail.com>

* #18291

* compile fix

* ???

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: John Doe <gamingskeleton3@gmail.com>
Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
2023-01-07 20:06:16 -08:00
SkyratBot
2b9eba0fe0 [MIRROR] Smoothing groups optimization, save 265ms with configs, more on production & w/ space ruins [MDB IGNORE] (#18189)
* 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>
2023-01-07 23:51:36 +13: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
35238c9139 [MIRROR] Glass inconsistency fixes [MDB IGNORE] (#17350)
* Glass inconsistency fixes (#70961)

## About The Pull Request
Some glass types strangely had no radiation blocking abilities like
normal plasma glass, which doesn't make any sense, though reinforced
glass was able to block almost all. This also fixes fulltile plasma
glass to have twice as much integrity as the normal amount, like with
all the other glass types.
## Why It's Good For The Game
Inconsistency fixes
## Changelog
🆑
fix: Fixes radiation blocking properties of glass types.
/🆑

* Glass inconsistency fixes

Co-authored-by: Comxy <tijntensen@gmail.com>
2022-11-04 11:03:35 -07:00
SkyratBot
3bf620006b [MIRROR] Moves cleaning to an atom proc to afterattack signal [MDB IGNORE] (#16813)
* Moves cleaning to an atom proc to afterattack signal

* Fixing conflict!

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
2022-10-12 14:49:04 -04:00
SkyratBot
28ec8d73b1 [MIRROR] fixes a typo during window construction [MDB IGNORE] (#16407)
* fixes a typo during window construction (#70087)

replaces 'from the floor' to 'to the floor' since you're building the window, not deconstructing it.

* fixes a typo during window construction

Co-authored-by: coldud13 <coldud13@users.noreply.github.com>
2022-09-24 22:21:19 +01:00
SkyratBot
8f697c2a9e [MIRROR] Planks create barricades on doors/windows and can be crowbarred [MDB IGNORE] (#16241)
* Planks create barricades on doors/windows and can be crowbarred (#69676)

* Wooden planks can be used on doors/windows to barricade it, using a can_barricade Element.

Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>

* Planks create barricades on doors/windows and can be crowbarred

Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>
2022-09-23 22:15:11 +01:00
SkyratBot
29e29b6375 [MIRROR] Save 2.2s minimum (with zero ruins, likely a good bit more in production) of atom init time [MDB IGNORE] (#15967)
* Save 2.2s minimum (with zero ruins, likely a good bit more in production) of atom init time (#69564)

Pre-sort smoothing_groups and canSmoothWith
Without any ruins, these sorts were taking more than 0.6s, and the bulk of the runtime cost of sortTim during init time.

This only happens on init and they are never changed apart from that, so pre-sorts everything and adds a unit test (in the form of #ifdef UNIT_TESTS, because you can't initial a list) to ensure that they are proper.

Keep visibilityChanged() to mapload only for turf/Initialize
Saves about 0.4s worst case scenario (e.g. with no ruins). Very expensive code (175k loop iterations) for 0 side effects.

Space areas now have the fullbright overlay, not the space turfs
Saves about 0.8s worst case scenario. Seems to work fine with starlight.

Remove is_station_level check for window spawners assigning RCD memory.
Saves about 0.3s worst case scenario. The logic for this isn't consistent since neither walls nor floors check this (for performance), plus some minor micro-opts to spawners.

Optimize is_station_level
Doubles in speed, used heavily in /turf/open/floor and in other initialization procs. Bit hard to tell exactly how much is saved, though.

* Save 2.2s minimum (with zero ruins, likely a good bit more in production) of atom init time

* Hopefully fixes the broken CI

* Okay now it shouldn't be failing CI anymore (hopefully)

* Fixes even more issues with smoothing_groups, this time hopefully for good

* Okay NOW it's going to pass CI, surely...

* Okay haha what if it passes this time? :)

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
2022-09-15 19:57:33 -04:00
SkyratBot
5efeef1c03 [MIRROR] Buff regular windows more and place them on Metastation [MDB IGNORE] (#15934)
* Buff regular windows more and place them on Metastation  (#69246)

The feedback on the previous version of this PR made me realize that the windows weren't buffed enough to be seen as actual companions to regular walls. This PR buffs the windows to the level that the old reinforced windows were. They have 50 melee armor, take 14 hits to destroy and deconstruction consists of screwdriver -> crowbar -> screwdriver

This pull request changes all reinforced windows in low security areas on Metasation with regular windows.

Areas with normal walls that still have reinforced windows:
Arrivals
Departures
Security stations

Because the regular windows are buffed so much in this PR they are arguably stronger than the regular walls (its easier to smash the windows, but the walls take less tool time) so I don't really see any reason to not place this on almost every place with regular walls

* Buff regular windows more and place them on Metastation

Co-authored-by: Vincent <CPTANT@users.noreply.github.com>
Co-authored-by: Jolly-66 <70232195+Jolly-66@users.noreply.github.com>
2022-09-01 10:18:54 -04:00
SkyratBot
a64db8fe1c [MIRROR] Buffs regular windows so they can start replacing reinfoced windows in low security areas [MDB IGNORE] (#15290)
* Buffs regular windows so they can start replacing reinfoced windows in low security areas (#68817)

Buffs windows to 100 health with 30 melee armor so toolbox takes 10 hits

* Buffs regular windows so they can start replacing reinfoced windows in low security areas

Co-authored-by: Vincent <CPTANT@users.noreply.github.com>
2022-07-30 08:13:12 -07:00
SkyratBot
f02a42b1e8 [MIRROR] reinforced windows no longer runtime when heated up by non welding tools that can weld [MDB IGNORE] (#14027)
* reinforced windows no longer runtime when heated up by non welding tools that can weld (#67416)

About The Pull Request

            if(tool.tool_behaviour == TOOL_WELDER)
                var/obj/item/weldingtool/welder = tool
                if(welder.isOn())

cmon bro
Changelog

cl
fix: reinforced windows can be heated up by things that can weld but arent welding tools
/cl

* reinforced windows no longer runtime when heated up by non welding tools that can weld

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
2022-06-01 07:14:12 +01:00
SkyratBot
26271d8f69 [MIRROR] Fixes foam spreading through public airlocks and windoors [MDB IGNORE] (#13935)
* Fixes foam spreading through public airlocks and windoors (#67101)

* Fixes foam spreading through public airlocks and windoors

* nova

* Fixes foam spreading through public airlocks and windoors

Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
2022-05-27 12:45:26 +01:00
SkyratBot
effc8fb75e [MIRROR] Titanium and plastitanium shards and weapons + missing textures. [MDB IGNORE] (#13457)
* Titanium and plastitanium shards and weapons + missing textures.

* ew

Co-authored-by: Comxy <tijntensen@gmail.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-05-09 01:30:21 +01:00
SkyratBot
c1a1683db6 [MIRROR] removes permeability, rolling it into bio armor [MDB IGNORE] (#13435)
* removes permeability, rolling it into bio armor

* e

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-05-09 01:16:27 +01:00
SkyratBot
04acd22860 [MIRROR] Fixes titanium glass shuttle windows not being anchorable when crafted [MDB IGNORE] (#13066)
* Fixes them (#66391)

* Fixes titanium glass shuttle windows not being anchorable when crafted

Co-authored-by: Bond <58570888+TheBonded@users.noreply.github.com>
2022-04-24 19:38:40 +01:00
SkyratBot
17e4f6ad76 [MIRROR] Converts SFX keys into DEFINES [MDB IGNORE] (#11990)
* Converts SFX keys into DEFINES

* fixes and updates

Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
Co-authored-by: John Doe <gamingskeleton3@gmail.com>
2022-03-11 16:43:39 -07:00
SkyratBot
80d6870000 [MIRROR] Tool act superpack 2 [MDB IGNORE] (#11947)
* Tool act superpack 2 (#64428)

About The Pull Request

Continuation of #64375, extracting tool behavior from attackby() and moving it into discrete _act procs. This is about as many files as I had in the last version, as I still want this to be reviewable.

As before, I've tested everything in game and it works as it previously did.
Why It's Good For The Game

The more code moved out of attackby, the more modular things become.
Changelog

cl
refactor: Moves more tool behavior out of attackby().
/cl

* Tool act superpack 2

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
2022-03-07 22:11:04 -07:00
SkyratBot
02d97ef416 [MIRROR] Change hydroponics tray and chem dispenser AltClick behavior to be used by RMB [MDB IGNORE] (#11700)
* Change hydroponics tray and chem dispenser AltClick behavior to be used by RMB  (#64939)

* Change hydroponics tray and chem dispenser AltClick behavior to be used by RMB

Co-authored-by: Tim <timothymtorres@gmail.com>
2022-02-24 06:50:41 -05: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
b11b087a7e [MIRROR] Ports flying bloodsplatters from Hippie for Wounds [MDB IGNORE] (#10713)
* Ports flying bloodsplatters from Hippie for Wounds

* Feex

* Okay now linter, shut up

* Forgot two :(

Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
2022-01-16 20:56:00 +00:00
SkyratBot
58f82b5161 [MIRROR] [Ready] MODsuits [MDB IGNORE] (#10244)
* [Ready] MODsuits

* we dont need to add these people as codeowners, goodness gracious

* have to remove this because upstream

* part 1 of these fixes

* EEEE

* Update peacekeeper_clothing.dm

* E

* E

* Auto stash before merge of "upstream-merge-59109" and "origin/upstream-merge-59109"

* E

* Update expeditionary_trooper.dm

* more removal

* nice

* modsuti modstui modusuti

* fixes

* E

* ITS MODsuit not HARDSUIT

* more hardsuit references

* MODSUIT NOT HARSUITEDSA

* Maps

* More ,map

* oop

* e

* oo aa

* 0

* ting tang

* Update modsuit_tailsprites.dm

* hi fikou

* bs tech update

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
2021-12-25 13:32:49 +00:00
SkyratBot
d51d6c0de3 [MIRROR] Fixes up multiz atmos connection, cleans some things up in general [MDB IGNORE] (#10061)
* Fixes up multiz atmos connection, cleans some things up in general (#63270)

About The Pull Request

ALLLRIGHT so
Multiz atmos was letting gas flow down into things that should be well, not flowable into
Like say doors, or windows.

This is weird.

Let's get into some context on why yeah?

First, how do things work currently?

atoms have a can_atmos_pass var defined on them. This points to a define that describes how they interact with
flow.
ATMOS_PASS_NO means well, if we're asked, block any attempts at flow. This is what walls use.
ATMOS_PASS_YES means the inverse
ATMOS_PASS_DENSITY means check our current density
ATMOS_PASS_PROC means call can_atmos_pass, we need some more details about this attempt

These are effectively optimizations.

That var, can_atmos_pass is accessed by CANATMOSPASS() the macro
It's used for 3 things.

1: Can this turf share at all?
2: Can this turf share with another turf
3: Does this atom block a share to another turf

All of this logic is bundled together to weed out the weak.

Anyway, so when we added multiz atmos, we effectively made a second version of this system, but for vertical
checks.

Issue here, we don't actually need to.
The only time we care if a check is vertical or not is if we're talking to another turf, it's not like you'll
have an object that only wants to block vertical atmos.
And even if you did, that's what ATMOS_PASS_PROC is for.

As it stands we need to either ignore any object behavior, or just duplicate can_atmos_pass but again.
Silly.

So I've merged the two, and added an arg to mark if this is a verical attempt.
This'll fix things that really should block up/down but don't, like windows and doors and such.

Past that, I've cleaned can_atmos_pass up a bit so it's easier for people to understand in future.
Oh and I removed the second CANATMOSPASS from immediate_calculate_adjacent_turfs.
It isn't a huge optimization, and it's just not functional.

It ties into zAirOut and zAirIn, both of which expect to be called with a valid direction.
So if say, you open a door that's currently blocking space from leaking in from above, you end up with the door
just not asking the space above if it wants to share, since the door can't zAirOut with itself.

Let's just wipe it out.

This makes the other code much cleaner too, heals the soul.

Anyway yadeyada old as ass bug, peace is restored to the kingdom, none noticed this somehow you'd think people
would notice window plasma, etc etc.
Why It's Good For The Game

MUH SIMULATION
Also fuck window gas
Changelog

cl
fix: Fixed gas flowing into windows from above, I am.... so tired
fix: Fixes gas sometimes not moving up from below after a structure change, see above
/cl

* Fixes up multiz atmos connection, cleans some things up in general

* Update large_doors.dm

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-12-17 01:36:33 +00:00
SkyratBot
53cbe26e89 [MIRROR] Increases volume of the sound effect for knocking on firelocks [MDB IGNORE] (#9981)
* Increases volume of the sound effect for knocking on firelocks

* E

* Update inflatable.dm

Co-authored-by: BlueMemesauce <47338680+BlueMemesauce@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-12-13 11:39:28 +00:00
SkyratBot
e90627be0e [MIRROR] Modernizing Radiation -- TL;DR: Radiation is now a status effect healed by tox healing, and contamination is removed [MDB IGNORE] (#9176)
* Modernizing Radiation -- TL;DR: Radiation is now a status effect healed by tox healing, and contamination is removed

* Fixing conflicts

* Makes it compile, yeet all the RAD armor from everywhere (thanks RegEx!)

* Removing more lingering rad armor (woo)

* Damnit powerarmors

* Bye bye rad collectors!

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
2021-11-02 10:36:46 -04:00
SkyratBot
404a603dc2 [MIRROR] runtime fix for borgs cryoing with upgrade modules + no more mmi laying around after they cryo, and various other runtime fixes [MDB IGNORE] (#8975)
* runtime fix for borgs cryoing with upgrade modules + no more mmi laying around after they cryo, and various other runtime fixes

* Fixing conflicts

Co-authored-by: Seris02 <49109742+Seris02@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
2021-10-23 00:25:25 +01:00
SkyratBot
230a34588f [MIRROR] modules/atmospherics major cleanup [MDB IGNORE] (#8818)
* modules/atmospherics major cleanup

* E

* E

* 0

Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-10-14 22:44:30 +01:00
Gandalf
0b8421f298 Collars the singularity (#8509)
* Collars the singularity

* Update singularity.dm

* Update singularity.dm
2021-09-30 19:54:11 -04:00
SkyratBot
13fe213621 [MIRROR] [MDB Ignore] Make shuttle windows deconstructable [MDB IGNORE] (#8463)
* [MDB Ignore] Make shuttle windows deconstructable

* E

* re

Co-authored-by: Mooshimi <85910816+Mooshimi@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-10-01 00:21:36 +01:00
SkyratBot
93583cde8c [MIRROR] Fix connect loc not respecting phasing in some cases when it should [MDB IGNORE] (#8451)
* Fix connect loc not respecting phasing in some cases when it should (#61698)

* Fix connect loc not respecting phasing in some cases when it should

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
2021-09-28 16:02:14 +01:00
SkyratBot
c23bd1cb8c [MIRROR] every case of initialize that should have mapload, does (#8374)
* every case of initialize that should have mapload, does

* E

Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-09-24 23:07:53 +01:00
SkyratBot
04302a770a [MIRROR] moves obj_integrity and associated procs to the atom level (#8016)
* moves obj_integrity and associated procs to the atom level

* Feex good

* Whoops forgot the maps

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-09-10 16:47:01 +01:00
SkyratBot
e7f0aeea72 [MIRROR] Fixes window opacity when repainting bug (#8083)
* Fixes window opacity when repainting bug (#61268)

Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>

* Fixes window opacity when repainting bug

Co-authored-by: ArcaneDefence <51932756+ArcaneDefence@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
2021-09-10 07:44:09 -04:00
SkyratBot
146469e37e [MIRROR] Fixes some unnecessary attack chain cancels (#7910)
* Fixes some unnecessary attack chain cancels (#61038)

Replaced attack chain cancels on some objects with parent calls

* Fixes some unnecessary attack chain cancels

Co-authored-by: GoblinBackwards <kinggreenyoshi@gmail.com>
2021-09-01 16:50:47 +01:00
SkyratBot
1211d28c90 [MIRROR] Fixes blockers blocking themselves + cleanup (#6528)
* Fixes blockers blocking themselves + cleanup (#59808)

* Fixes blockers blocking themselves + cleanup

Co-authored-by: Rohesie <rohesie@gmail.com>
2021-06-25 22:34:02 +01:00
SkyratBot
a14b1dadb5 [MIRROR] CanPass refactor (#6527)
* CanPass refactor (#59804)

* CanPass refactor

Co-authored-by: Rohesie <rohesie@gmail.com>
2021-06-25 22:33:51 +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
Useroth
873144d8ef Adds a setter for density (#59529) (#6437)
Adds set_density()
Fixes one instance of a duplicate density assignment on an object.
Comments two hacky usages of density which will have to forgo using the setter for now.

Lets us append code to the event of density changing.
Pretty sure this is leading up to some multitile object thing -Lemon

Co-authored-by: Rohesie <rohesie@gmail.com>
2021-06-22 01:24:59 +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