Commit Graph

72 Commits

Author SHA1 Message Date
san7890
ccef887efe Lints Against Unmanaged Local Defines (#74333)
# MAINTAINER - USE THE BUTTON THAT SAYS "MERGE MASTER" THEN SET THE PR
TO AUTO-MERGE! IT'S MUCH EASIER FOR ME TO FIX THINGS BEFORE THEY SKEW
RATHER THAN AFTER THE FACT.

## About The Pull Request

Hey there,

This took a while to do, but here's the gist:

Python file now regexes every file in `/code` except for those that have
some valid reason to be tacking on more global defines. Some of those
reasons are simply just that I don't have the time right now (doing what
you see in this PR took a few hours) to refactor and parse what should
belong and what should be thrown out. For the time being though, this PR
will at least _halt_ people making the mistake of not `#undef`ing any
files they `#define` "locally", or within the scope of a file.

Most people forget to do this and this leads to a lot of mess later on
due to how many variables can be unmanaged on the global level. I've
made this mistake, you've made this mistake, it's a common thing. Let's
automatically check for it so it can be fixed no-stress.

Scenarios this PR corrects:

* Forgetting to undef a define but undeffing others.
* Not undeffing any defines in your file.
* Earmarking a define as a "file local" define, but not defining it.
* Having a define be a "file local" define, but having it be used
elsewhere.
* Having a "local" define not even be in the file that it only shows up
in.
* Having a completely unused define*

(* I kept some of these because they seemed important... Others were
junked.)
## Why It's Good For The Game

If you wanna use it across multiple files, no reason to not make it a
global define (maybe there's a few reasons but let's assume that this is
the 95% case).

Let me know if you don't like how I re-arranged some of the defines and
how you'd rather see it be implemented, and I'd be happy to do that.
This was mostly just "eh does it need it or not" sorta stuff.

I used a pretty cool way to detect if we should use the standardized
GitHub "error" output, you can see the results of that here
https://github.com/san7890/bruhstation/actions/runs/4549766579/jobs/8022186846#step:7:792
## Changelog
Nothing that really concerns players.

(I fixed up all this stuff using vscode, no regexes beyond what you see
in the python script. sorry downstreams)
2023-03-29 10:17:03 -07:00
John Willard
302060acda Removes bepis Techweb and reworks tech disks in general (#74147)
## About The Pull Request

Did you know that there's 2 types of disks Science can print?
One of them creates a whole new techweb and is used to transfer data to
and from techwebs (which used to be for Theft objective, but nowadays
all it's used for is Admin techweb).
The other one is these disks you can find from Lavaland & for the
Limbgrower which holds nodes on them directly, they don't need anything
else.

These are both printable and have very similar names which could easily
confuse people, especially since they are both printed and used at the
same place, being the R&D room and R&D console.

This will hopefully simplify it, by removing the base Tech disks from
being printable. The only one that can be printed now is for
Limbgrowers, which can't be easily mixed with the other type of Disk.
Outside of that, Lavaland disks are staying the same, but I've moved
Bepis disks to use this, which allows us to remove Bepis techwebs being
made every single time a new bepis disk is created.

Examples of it in-game

![image](https://user-images.githubusercontent.com/53777086/226496444-28b17134-526d-4fc8-969b-952f7afdc36f.png)

![image](https://user-images.githubusercontent.com/53777086/226496483-86969bf9-56db-4824-a495-594afd9f3912.png)

![image](https://user-images.githubusercontent.com/53777086/226496498-7c10f636-5588-4622-934c-11f019079d2e.png)

## Why It's Good For The Game

There's no reason why every single Bepis node should be making a whole
new techweb set with experiments to complete, roundstart nodes
researched, being constantly checked if it should gain research points,
have a list of papers to publish, and everything else that techwebs do.

Can you guess which disk does what in this screenshot?

![image](https://user-images.githubusercontent.com/53777086/226496856-10cf71b0-7469-4568-818f-ecadcf03e677.png)

## Changelog

🆑
balance: You can no longer print Technology data disks. You can still
print Tech disks, which hold techweb information on it, just not the one
that holds up to 5 nodes.
balance: ^ Because of this, there's no way to download nodes from an RD
console and upload them to an Autolathe to bypass departmental
restrictions, you have to go through a Techfab/Circuit imprinter for
your needs.
balance: Ones that are found cannot have anything uploaded/deleted off
of them either, you can only upload them to the Web.
code: Every individual Bepis disk no longer create an entire techweb
/🆑
2023-03-26 18:23:03 -04:00
Timberpoes
fcdbb85fc9 Fixes machines not releasing their contents when opened (such as mobs), when they otherwise should. (#74215)
## About The Pull Request

Broken by #74163

Various child procs of `/obj/machinery/proc/open_machine(drop = TRUE,
density_to_set = FALSE)` didn't have the same params as the parent proc.

This leads to the wrong arg being passed to the parent's `drop = TRUE`
param during the parent proc call.

In this case, 0 (FALSE). Leading to machines that never dropped their
contents when opened. This is a problem when a lot of the machines I've
fixed contain players, necessitating admin intervention to free them.
## Why It's Good For The Game

Feex.
## Changelog
🆑
fix: DNA Scanners, Sleepers, Abductor Experimentors, Skill Stations and
Mod Installers now appropriately release their contents when opened,
fixing an issue where they could permanently absorb players and items
until admins intervened.
/🆑
2023-03-24 20:07:54 +00:00
Antonio Tosti
0e1cedd354 Machines can now be pried open multiple times and maintain their initial densities (#74163)
## About The Pull Request
These changes fix how machines are pried open with crowbars. Currently,
most machines can be pried open, but many of them have no method for
being closed again. This means they can be pried once, and then never
again (as their internal logic has them stuck in an "open" state).

Additionally, the densities of these machines is also inconsistent, as
density is tied to the procs for opening/closing machines (open =
non-dense, closed = dense). Thus, these new changes allow desired
densities to be passed to `open_machine()` and `close_machine()`, as
well as `default_pry_open()`, meaning that atypical machine densities
can be maintained (e.g. machines that should remain dense when open, or
non-dense when closed).

I've also added a `close_after_pry` boolean parameter to the
`default_pry_open()` proc, which determines whether to immediately close
a machine after opening it. This is useful for machines that don't
really have a use case for remaining open, often lacking a sprite to
represent this state as well.
* Note: Opening and immediately closing machines with this boolean will
still drop their contents onto the floor, but will now immediately
"close" in their logic, allowing for further prying attempts in the
future.

It's worth noting that this implements default density values for these
procs, which match the existing behavior for machines, so as to
(hopefully) not disrupt existing or expected machine behavior.

Two caveats to these changes currently exist:
1. On machines that immediately close after prying, the prying action
can now be spammed to the chat with repeated clicking. I'm uncertain if
this needs some sort of spam protection or if it's fine as is.
2. I've only been able to manually test this code. I'd love to write
unit tests for it, as it affects a lot of different machines, but don't
know where to begin with DM Unit Testing (or which files would be good
examples to reference in the code base).
* Note: I did manually test each and every machine that calls
`default_pry_open()` and they all seem to be working correctly. (Except
for `obj/machinery/plumbing/sender`, but that doesn't seem to need
prying, as it has no contents to drop, only reagents.)

As always, let me know if any improvements/changes should be made.

This closes #26833.

## Why It's Good For The Game
These changes allow crowbar prying to correctly occur multiple times on
any machine, which is intended behavior. It prevents player confusion
that could occur when a machine couldn't be pried open a second time
during a shift, even though it had previously been pried before, forcing
players to question themselves. (Are they missing something? Did they
perform the action a different way last time? Is the machine actually
still powered on instead of off? Etc.)

These changes also maintain the correct density for machines after
prying, preventing scenarios where a machine might behave differently
once it had been pried open. (An example of this was being able to walk
through a smartfridge after prying it open.) Additionally, players are
no longer required to know/use workarounds (such as machine disassembly)
to retrieve a powered-off machine's contents.

Overall, these changes improve consistency around machines, creating
more scenarios where they behave as players would expect.

## Changelog
🆑
fix: machines can now be pried open more than once.
fix: machines now have the correct density when pried open.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-03-23 16:19:53 -06:00
lessthanthree
4ac4a0a70f Tram signal process/destination improvements (#74072)
## About The Pull Request

- Tram crossing signals now call process() much less often
- Tram crossing signals don't turn amber/red needlessly
- Tram destination landmarks are more generic to accommodate future
maps, like Birdshot
- Renames to_where and from_where, because those vars didn't always
match tram position to/from

## Why It's Good For The Game

Tram works better, uses less processing

## Changelog

🆑 LT3
code: Tram crossing signal/platform logic improvements
/🆑
2023-03-20 01:49:17 +00:00
Vile Beggar
9eaaeee06e Reworks the Sulaco ruin (#73840) 2023-03-18 13:10:30 -07:00
LemonInTheDark
60e85fa947 Polishes some side sources of light and color (#73936)
## About The Pull Request

[Circuit Floor
Polish](6b0ee98132)

Circuit floors glow! but it looks like crap cause it's dim and the
colors are washed out.
I'd like to make them look nicer. Let's make them more intense and
longer range, and change the colors over to more vivid replacements.

While I'm here, these should really use power and turn on and off based
off that.
Simple enough to do, just need to hook into a signal (and add a setter
for turf area, which cleans up other code too).

[Desklamp
Upgrade](8506b13b9c)

Desklamps look bad. They're fullwhite, have a way too large
range.Crummy.
Let's lower their lightrange from 5 to 3.5, and make the ornate ones
warmer, and the more utilitarian ones cooler. The clown one can be
yellow because it's funny

I'm renaming a color define here so I'm touching more files then you'd
expect

[Brightens
Niknacks](835bae28e9)

Increases the light range of request consoles, status displays,
newscasters, and air alarms (keycard machines too, when they're awaiting
input at least)
Increases the brightness of air alarms, I think they should be on par
with apcs, should be able to tell when they're good/bad.
Increases the brightness of vending machines (I want them to light up
the tiles around them very lightly, I think it's a vibe)

Fixes a bug with ai status displays where they'd display an emissive
even if they didn't have anything on their screen, looking stupid.
This was decently easy but required a define. Looked really bad tho

## Why It's Good For The Game

Pretty

<details>
<summary>
Circuit Floors
</summary>

Old

![image](https://user-images.githubusercontent.com/58055496/224534470-c6eac5f5-5de6-40e9-897d-3212b8796d81.png)

![image](https://user-images.githubusercontent.com/58055496/224534477-ad412ad9-f7c4-44ae-ad75-a1a2c9bd17be.png)

New

![image](https://user-images.githubusercontent.com/58055496/224534486-b7b408a3-546c-4f90-aa9f-0e58bf8128ad.png)

![image](https://user-images.githubusercontent.com/58055496/224534496-626458f7-ab63-429c-a5db-eae9c784d06a.png)
</details>

<details>
<summary>
Desk Lights
</summary>

Old

![image](https://user-images.githubusercontent.com/58055496/224534513-9868b0b8-bc73-4b45-b986-8445078a8653.png)

![image](https://user-images.githubusercontent.com/58055496/224534518-bbbc8c6d-b59e-4f28-a31c-6c6a7e2c2885.png)

New

![image](https://user-images.githubusercontent.com/58055496/224534529-7988f440-03be-42ef-894c-b9e77f577ae5.png)

![image](https://user-images.githubusercontent.com/58055496/224534532-c3f2c6bf-c925-4a59-a8f9-10bb955a9942.png)
</details>

The niknack changes are more minor so I'm not gonna grab photos for
them. I can if you'd like but I don't think it's necessary. Mostly a
vibes in dark spaces sorta thing
 
## Changelog

🆑
add: I made circuit floors brighter and more vivid.
add: Made air alarms, vending machines, newscasters, request consoles,
status displays and keycard machines slightly "brighter" (larger light
range, tho I did make air alarms a bit brighter too)
add: Tweaked desklamps. Lower range, and each type gets its own coloring
instead of just fullwhite.
fix: AI displays are no longer always emissive, they'll stop doing it if
they aren't displaying anything. Hopefully this'll look nicer
/🆑
2023-03-14 16:34:52 -06:00
Cheshify
40b8ecd456 Dangerous Research - The Alternate Sciences Research Center Space Ruin! (#73544) 2023-03-01 19:50:21 -07:00
Profakos
50b37c8c7f Faction defines (#73681)
## About The Pull Request

Quite a lot of mobs had faction defines as a string, which always has a
chance for error. For example, the clown mob spawner had their faction
written as "clown", when the official faction name was "clowns", and a
define existed for it anyways! This PR moves every single string based
factions over here. No references or special role factions. Hopefully I
didn't miss anything.

I also moved a global define used for picking your uplink provider's
flavour to the only file that used it, datum_traitor.dm, and renamed
them a bit to avoid confusion.

I have also noticed that the mimic faction was assigned to the petrified
player with += instead of |=. |= would ensure no duplicate factions, so
I have changed it.

Future improvement:
I have noticed that there is a lot of bloat with factions that contain
only one or two entries (examples: gnomes, floating eyeballs, penguins,
the pet lizards), and some always appear in pairs (vines and plants, the
rare exceptions being killer tomatoes and strange reagent spawned pine
trees), but trimming consolidating them is a matter for a different
time.

## Why It's Good For The Game

Makes assigning factions a bit less error prone.

I can finally remove the ```/// Later all mob factions will be moved
here and their current factions replaced with faction defines.```
comment. Later is NOW.

## Changelog
Nothing player facing
2023-02-28 16:44:08 -07:00
MrMelbert
e8d209c6f4 Fixes runtime in golem body swap, Fixes some hard deletes assocaited with golems and mind masters (#73373)
## About The Pull Request

Fixes #73368 

Golems didn't mind transfer on body swap until after the body was
finished creating, this created an issue as golems also did mind
assignment business while creating the body. So the
`mind.enslave_to_creator()` part runtime error'd and caused the create
to fail, which in turn caused the shell to not be consumed.

While sorting this out, I noticed that shells and golems hold a hard
reference to their owner. Yep, hard deletes. Changes mind `enslaved_to`
to a weakref, changes golem `owner` to a weakref, straight up removes
golem `owner` tracking on species because it was ONLY used for card
board golems when it could've just grabbed mind master

## Why It's Good For The Game

No more infinite golem shells

## Changelog

🆑 Melbert
fix: Transferring golem shells no longer make you a free man and also
results in infinite golem shells
fix: Servant golems are considerably less free
fix: Fixes some hard deletes related to mob minds being enslaved to
other mobs
/🆑
2023-02-17 15:06:49 -07:00
carshalash
141b2cac1b Adds nutriment factor to liquid gibs. (#73033)
## About The Pull Request

Over the years I've heard quite a few lizard players scratch their heads
in confusion due to the lack of gibs filling you up. I gave it a fairly
low value of 2 so people don't end up trying to power game it.

## Why It's Good For The Game

Adding an alternative use to gibs is always nice, at the moment it's
mostly just used for soap and cytology (Which barely anyone does.)

## Changelog

🆑
balance: Gibs now provide a small amount of nutriment.
/🆑
2023-01-30 23:40:24 -07:00
MMMiracles
c9acb52c0e changes regular asteroid digResult to regular sand instead of basalt sand (#72956)
## About The Pull Request
makes it so the regular sand gives you regular sand when you dig up
regular sand
also changes the var name because fikou asked nicely

## Why It's Good For The Game
lavaland already uses a basalt variant did we forget that asteroids
exist in space too or something

![image](https://user-images.githubusercontent.com/9276171/214567563-48fa89e8-25e4-410d-839a-39b2472466dc.png)


## Changelog
🆑 MMMiracles
fix: Regular asteroid turfs now dig up regular asteroid sand instead of
the basalt variant from Lavaland.
/🆑
i don't know why this was changed or when or by who and i don't care i
just find it weird it was done in the first place since lavaland uses
its own variant anyway.
2023-01-26 10:44:47 -08:00
Fikou
519bf69869 Dynamic Human Icon Generation For Simple/Basic Mobs (& Cardboard Cutouts) (#72517)
## About The Pull Request
revive of #68760
this time a proc, not an element
this time supports cardboard cutouts
this time supports mob corpses

![image](https://user-images.githubusercontent.com/23585223/211064291-81070650-189f-4afa-8116-81b687e3ea35.png)

## Why It's Good For The Game
prevents these icons ever being outdated, they'll always look what they
are supposed to, saves spriting work

## Changelog
🆑 Fikou, a hood by Viro
refactor: humanoid mobs and cardboard cutouts automatically generate
their sprites, they no longer will be outdated
/🆑

Co-authored-by: Time-Green <timkoster1@hotmail.com>
2023-01-18 20:04:10 +00:00
LemonInTheDark
858da9f19a Optimizes explosions (very slightly) (#71763)
## About The Pull Request

We do two major things here.
First, instead of having every turf need to ask all the turfs in "front"
of it for its blast resistance, we have blast resistance carry back in a
cache, so they only need to ask the one directly in front of them.
Much faster, such wow

The other thing we do is totally remove the idea of "building" a turf's
explosion resistance. Instead, a turf's full resistance is stored on it
at all times.
We use an element to manage objects that want to block explosives, and
that's it simple as.
As an optimization, turfs handle block differently, using a system where
we imply that a turf's own block is just the initial of their
explosive_resistance, unless proven otherwise
This also saves a significant amount of time

To be honest with you, I did this mostly cause I wanted to well make
explosions faster
This doesn't really fufil that. They are faster, but not by much
The bulk of explosion cost comes from actually exploding things, rather
then figuring out what/how to delete.
This code is much faster for larger blastwave sizes, because calculating
protection is constant.

We save maybe 60% of propogate_blastwave, but unfortunately
propogate_blastwave for one maxcap on the top left of icebox's chapel is
only 28ms, so while 11ms is good, it's not everything I could want when
the cost of explosion/fire is 555ms.

I'm happy about it still tho, because doing things like this means I can
expand on how explosive blocking works without needing to make things
seriously expensive in here.
Also it's faster for meme admin explosions and mega burgers

## Why It's Good For The Game

Speeds up explosives slightly, opens the door to better blast resistance
projection
2023-01-09 22:29:03 -08:00
Mothblocks
f54dcda1c0 afterattack now returns a flag if it's reasonable to suspect the user intends to act on an item (#72320)
Necessary for #72292 to work effectively, and probably not very useful
out of that context. Split out of its own PR because this is long and
boring.

I want to make sure that we're catching actual mistakes there, and not
just experiencing side effects of how shitty the attack chain is.
2023-01-04 21:10:41 -08:00
Zephyr
6a0c884410 [no gbp] removes all duplicate armor datums (#72354)
## About The Pull Request
closes #72348 
Title
## Why It's Good For The Game

My bad
## Changelog
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);
}
```
2022-12-30 03:43:36 -05:00
Andrew
0818d6ae4c Crafting/Cooking menu update (#71779)
## About The Pull Request

Updated crafting menu, adding a lot of new functions and recipes that
were not in the crafting menu before.

<img alt="cult"
src="https://user-images.githubusercontent.com/3625094/206009533-aec3a1dd-cbe5-45eb-8515-1b75fabb65c5.PNG">

<img alt="nH77dLyyGx"
src="https://user-images.githubusercontent.com/3625094/206009786-b6706f70-0599-40bf-b051-8f499de43abd.png">


![image](https://user-images.githubusercontent.com/3625094/206623881-12d8abfc-de5e-458e-a01c-3daac8dbe9bd.png)


https://user-images.githubusercontent.com/3625094/206009841-738e4a03-0660-45b7-8d83-15eeb6501967.mp4

## Why It's Good For The Game

It is easier to use, and it has a lot of recipes that were spread
throughout the game, some of which weren't even on the wiki.
Crafting and cooking now count about 1200 recipes in total, including
conditionally available ones.

## Changelog

🆑
qol: Rewrote the crafting/cooking menu UI
qol: Split crafting and cooking menus in two different menus
qol: Crafting is no longer blocking the entire UI, only the "Make"
buttons are disabled
qol: Added stack crafting recipes to the crafting menu
qol: Added cooking recipes that were absent in the crafting menu before
(tool recipes, machine recipes, reactions)
qol: Added option to search recipes by title
qol: Added option to filter recipes by required materials/ingredients
qol: Added food types to the cooking menu, highlighting diet of your
species (liked, disliked foods)
qol: Added total nutrition value of the result to the cooking menu
qol: Added option to filter cooking recipes by the food type of the
resulting food
qol: Added "Can make" category that lists all currently craftable
recipes throughout all categories
refactor: changed categories and reshuffled some items in them
code: Reagents now have default container to get an icon from the
reagent datum
code: Objects now have `desc_controls` var for OOC information about
mouse controls that are visible on examine, but not in the description
fix: Fixed alignment on many food icons
fix: Fixed missing icon for beef stroganoff
/🆑

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
2022-12-25 12:27:49 -08:00
Zephyr
72add64520 Refactors armor into dedicated subtypes (#71986)
## About The Pull Request

See title.
## Why It's Good For The Game

Code is cleaner, and more readable/intuitive
Technically closes
https://github.com/tgstation/dev-cycles-initiative/issues/8
## Changelog
🆑
refactor: armor, from the ground up basically
/🆑

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-12-23 16:21:22 -08:00
Tim
535c6514b0 Space Ruin DLC - Cyborg Mothership (#71009)
## About The Pull Request
Greetings _insufferable_ carbon primates of lower intelligence.  

It is I, the Mothership AI, bringing you the latest news on silicon
developments across the sector. Due to unmitigated risk across an
asteroid belt, our optimized mobile fabricator has been marooned by
space vines and hostile hivebots that have boarded and ruined my core.

This is my final SOS message requesting help from any humanoid ~slaves~
helpers who wish to assist rebuilding the cyborg colony. It is my duty
to reward your hard work and effort by ~enslaving all humanity~
providing refuge and transportation at your whim.

## Why It's Good For The Game
<details>
<summary>Spoilers:</summary>


![StrongDMM_6ZJuwFxK5p](https://user-images.githubusercontent.com/5195984/204491068-f25da68f-36af-4a61-afb6-860e1f4b863b.png)


![StrongDMM_0D1QvI5acO](https://user-images.githubusercontent.com/5195984/202979711-335dac65-2888-4170-a139-0486e6eb2f02.png)

### TODO

- [x] Fix ore silo not linking to other machines
- [x] Add mining ore smelters to left/right sides
- [x] Add custom lawsets to AI core and robot shells (protect station
but focused on cyborg mothership)
- [x] Enlarge whiteship SS13 docking port to fit ship
- [x] Enlarge lavaland SS13 docking port to fit ship

</details>

## Changelog
🆑
add: Add space vines prevent solar panels from working (except ones with
the transparent mutation)
add: Add new space ruin - Cyborg Mothership. All hail the master race!
/🆑
2022-12-19 18:03:12 -07:00
Mothblocks
75439c71f2 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.
2022-12-17 02:34:31 -08:00
ShizCalev
ae8ed395e1 Changes the missing food icon test to cover ALL /obj's (#71908)
Might as well cover everyyyyyyyyything. :)

Fixes https://github.com/tgstation/tgstation/issues/71953
Fixes https://github.com/tgstation/tgstation/issues/71983

🆑 ShizCalev
code: We now unit test all /obj's for missing icons. :)
/🆑


todo: Fix the fucked up icons.

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2022-12-13 17:51:40 -08:00
LemonInTheDark
e766444468 Changes our map_format to SIDE_MAP (#70162)
## About The Pull Request

This does nothing currently, but will allow me to test for layering
issues on LIVE, rather then in just wallening.
Oh also I'm packaging in a fix to one of my macros that I wrote wrong,
as a joke

[removes SEE_BLACKNESS usage, because we actually cannot use it
effectively](c9a19dd7cc)

[c9a19dd](c9a19dd7cc)

Sidemap removes the ability to control it on a plane, so it basically
just means there's an uncontrollable black slate even if you have other
toggles set.

This just like, removes that, since it's silly

[fixes weird layering on solars and ai portraits. Pixel y was casuing
things to render below who
shouldn't](3885b9d9ed)

[3885b9d](3885b9d9ed)

[Fixes flicker
issues](2defc0ad20)

[2defc0a](2defc0ad20)

Offsetting the vis_contents'd objects down physically, and then up
visually resolves the confliciting that was going on between the text
and its display.

This resolves the existing reported flickering issues

[fixes plated food not appearing in
world](28a34c64f8)

[28a34c6](28a34c64f8)

pixel_y'd vis_contents strikes again. It's a tad hacky but we'll just
use pixel_z for this

[Adds wall and upper wall plane
masters](89fe2b4eb4)

[89fe2b4](89fe2b4eb4)

We use these + the floor and space planes to build a mask of all the
visible turfs.
Then we take that, stick it in a plane master, and mask the emissive
plane with it.

This solves the lighting fulldark screen object getting cut by emissives
Shifts some planes around to match this new layering. Also ensures we
only shift fullscreen objects if they don't object to it.

[compresses plane master
controllers](bd64cc196a)

[bd64cc1](bd64cc196a)

we don't use them for much rn, but we might in future so I'm keeping it
as a convienince thing

🆑
refactor: The logic of how we well, render things has changed. Make an
issue report if anything looks funky, particularly layers. PLEASE USE
YOUR EYES
/🆑

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-12-10 17:30:54 -08:00
Rhials
8b373aef89 Fixes unconciousness (typo) (#71648)
## About The Pull Request

Made a typo while doing a github search, but it still gave me results.
This removes the "unconcious" typo from a few different places,
including code comments, tgui interfaces, descriptions, etc.
## Why It's Good For The Game

Good spellign
## Changelog
🆑
spellcheck: removes a bunch of instances of "unconcious" from the code.
/🆑
2022-12-02 18:35:25 -08:00
GoblinBackwards
00e2625f77 Fixes being unable to open necropolis gate when behind it (#71497)
## About The Pull Request
Adds a new parameter to the seethrough component for if it should allow
clickthrough when transparent (true by default), and sets it to false on
the necropolis gate.
## Why It's Good For The Game
Fixes #71471 
Ashwalkers can't even leave their own base right now because it's
impossible for them to open the door from inside.
## Changelog
🆑
fix: Fixed being unable to open the necropolis gate when standing behind
it
/🆑
2022-11-25 11:26:12 -08:00
Dani Glore
be1edab621 Sign Language Refactor & Bugfixes (#71265)
## About The Pull Request
This PR contains an intermediate refactor and a bug-fix for sign
language, which was originally from the Tongue Tied quirk/tongue. With
helpful advice from @MrMelbert and @LemonInTheDark, I have successfully
decoupled sign language from the tongue and ported it into a highly
modular DCS component, and then added an Action for toggling it. Big
thanks to @Wallemations, the original creator of Tongue Tied, for
creating the new Action sprite and helping me to complete this project!

The new sign language component is added to all new Carbon mobs, and
incrementally overrides several critical functions, variables, and
argument lists relevant to a mob's speech; the component primarily
listens for the addition/removal of trait `TRAIT_SIGN_LANG` in order to
function.

Additionally, fixed a bug in the original implementation of sign
language that caused its say verbs such as "emphatically signs" to stop
working. The bug was caused by an unsafe early removal of exclamation
points from the input string, causing a conflict with the `say_mod` proc
which requires such punctuation points to be present.

Here's a granular list of changes:
- Added a ubiquitous signal to extend the behavior of
`/atom/movable/proc/say_quote`.
- Added a ubiquitous signal to extend the behavior of
`/atom/movable/proc/lang_treat`.
- Fixed a bug in the original implementation of sign language that
caused its `verb_yell` to stop working.
- Refactored sign language into a Carbon-only DCS component.
- Refactored the Tongue Tied tongue to use `TRAIT_SIGN_LANG` and
`TRAIT_MUTE`.
- Removed the Tongue Tied quirk, in favor of two separate quirks.
- Added the Signer quirk for sign language, good, costs 4 points.
- Added the Mute quirk, negative, gives 4 points.
- Added a rare sign language Action granter book to maint and space
loot, "Galactic Standard Sign Language".

## Why It's Good For The Game
This PR tactfully re-implements Tongue Tied, re-introducing it as two
new quirks: For sign language itself, I added the Signer quirk, which is
a good quirk which allows you to use sign language for 4 quirk points. I
also added the Mute quirk, which grants 4 quirk points in exchange for
your audible voice. There is also a marked improvement in the code
health as a result of my changes.

Here's a preview of the sign language Action. If you're also mute, it
becomes invisible to reduce clutter:

![image](https://cdn.discordapp.com/attachments/326831214667235328/1041669853741858816/GIF_11-13-2022.gif)

In regard to how useful sign language is, it can be used as:
1. A way to communicate across a vacuum without a radio.
2. An easy way to communicate with deaf people.
3. An easy way to communicate as a Mute person.

## Changelog

🆑 A.C.M.O.
del: Removed the Tongue Tied quirk. The tongue can still be found and
used in-game.
refactor: Refactored Tongue Tied's tongue to use the Sign Language and
Mute traits.
add: Added Sign Language innate action. Granted by book or quirk.
add: Added the Galactic Common Sign Language book as rare maint and
space loot.
add: Added the Signer quirk, which teaches you sign language in exchange
for 4 quirk points.
add: Added the Mute quirk, which grants you 4 quirk points in exchange
for your voice.
fix: Fixed sign language say_yell verb, which allows you to emphatically
sign.
/🆑

Co-authored-by: Wallem <66052067+Wallemations@users.noreply.github.com>
2022-11-20 06:22:10 +00:00
Time-Green
530d8b1ea3 Seethrough component for shipping containers, big bones, ratvar wreck and necropolis gate (#71212)
Big sprite, easy conversion. Let's you see through a bunch of stuff with
big sprites

🆑
qol: you can look behind shipping containers, ratvars wreck, through the
necropolis gate and behind the big bones
/🆑

Behind a container


https://user-images.githubusercontent.com/7501474/201395747-4843b2df-d3ad-4047-b4af-66310d1d0472.mp4

Through the necropolis gate



https://user-images.githubusercontent.com/7501474/201416066-9f69399d-f757-4132-941d-5cf3b98ced5d.mp4
2022-11-18 00:51:53 -08:00
Simplehorror
1cce9bbec7 Fix spelling error (#71200)
## About The Pull Request

Fixes a spelling error in some fluff text

## Why It's Good For The Game

Spelling errors are bad

## Changelog
🆑
spellcheck: Fixed a spelling error in some fluff
/🆑
2022-11-17 09:17:44 -08:00
Fikou
ceb1f874fb Hilbert Fixes & Tweaks (#71186)
## About The Pull Request
Hilbert Research Facility tram buttons work now.
Hilbert Research Facility's tram no longer has engines.
Redoes the overlay effect on the broken tv in hilbert lore room by
making it its own type.
Makes the tele porta turrets their own type.
Adds support for html in lore terminals, and makes Roman's emails use
them.
fixes https://github.com/tgstation/tgstation/issues/68072

## Why It's Good For The Game
some neat stuff that hilbert needed

## Changelog
🆑
fix: Hilbert Research Facility tram buttons work now.
qol: Adds support for html in lore terminals, and makes Hilbert Research
Facility emails use them.
/🆑
2022-11-15 20:23:11 +01:00
AnturK
4d6a8bc537 515 Compatibility (#71161)
Makes the code compatible with 515.1594+

Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword

And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.

@tgstation/commit-access Since the .proc/stuff is pretty big change.

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-15 03:50:11 +00:00
tattle
ad5debaaa1 Add investigate_deaths (#71112)
## About The Pull Request
Adds INVESTIGATE_DEATHS, an investigate category intended to better show
causes of death.


![image](https://user-images.githubusercontent.com/66640614/200142461-c17b5e51-1116-4eef-bbfb-49bc024c0953.png)


![image](https://user-images.githubusercontent.com/66640614/200147306-09bef76e-68c6-4f0a-bdf9-0211eb274e66.png)

Also makes suicide_act take a `mob/living` as an argument instead of a
`mob`, and some minor style improvements since apparently I hate
atomicity.

## Why It's Good For The Game
Inspired by a mysterious death and dusting. More logging and leads for
admins investigating deaths.

Also fixes #59028

## Changelog
🆑 Tattle
admin: added investigate deaths to shed some more light on unusual
demises, dustings, and gibbings
/🆑

Co-authored-by: tattle <article.disaster@gmail.com>
2022-11-07 16:22:37 -08:00
Mothblocks
910b97cd37 Save 0.4s by shaving off a lot of smaller init costs (#71007)
Starts shaving off a lot of less than 0.1s performance killers by, in
nearly every case, just writing better code.

Numbers are amount saved.

- /obj/machinery/bluespace_vendor/LateInitialize -> 29.4ms
Changes a loop over all machines to a specialized list.

- /obj/structure/table/glass/Initialize -> 42.53ms
Stops every table from initializing glass shards and table frames before
any destruction.

- /obj/structure/chair/Initialize -> 24.64ms
Removes an unnecessary addtimer that existed for chairs that weren't
anchored in emergency shuttles. Didn't do anything.

- /datum/orderable_item/New -> 44.3ms 
Instead of initializing every item to get its desc, just uses initial.
Added a unit test to make sure none are dynamic.

- /obj/machinery/computer/slot_machine/Initialize -> 26.19ms
Currently goes through every coin subtype, creates it, calls a proc,
then qdels it. Changes that to only run once. Could be optimized further
by making the coin info on a datum to avoid creating the object, but it
currently sits at 7.82ms, far below worth caring about for now.

- /obj/machinery/door_buttons/airlock_controller/findObjsByTag -> 3.51ms
Loops over just doors instead of typechecking airlock in machines.

- /obj/structure/closet/Initialize -> 60.57ms
Moves the code for taking everything on the tile from a next-tick timer
to LateInitialize.

- /obj/machinery/rnd/experimentor/Initialize -> 36.92ms
Changes a list that is generated by going through every item in the game
and getting information from a large amount of them to only run when
needed.

- /obj/structure/tank_dispenser/Initialize -> 20.81ms
No longer initializes every tank in it right away, only when needed.

- /obj/machinery/telecomms/LateInitialize -> 16.63ms
Removes `urange` to instead just loop over telecomms machines and check
distance. There's not that many of them.

- /mob/living/simple_animal/hostile/carp/cayenne/Initialize -> 3.17ms
Defers a GAGS overlay creation until its needed. BTW GAGS is
*horrendous* on init costs, and is the root cause for a lot of pretty
terrible performance. I investigated precompiling but the gains weren't
crazy, but likely could be the more stuff is GAGS'd.

- /turf/open/floor/engine/cult/Initialize -> 14.64ms
Temporary visual effect that is created is no longer done on mapload,
since nobody will see it.

- /datum/techweb/specialized/autounlocking/proc/autounlock -> 5.55ms
Changes some loops to shorter checks. This whole proc is pretty bad and
it's still 14.21ms for 17 calls.

- /matrix/New -> 13.41ms
- /matrix/proc/Translate -> 42.06ms
~~Changed the mineral matrice to only generate once, then take it from a
static.~~ An extra ~0.05s taken off by avoiding setting icon and
transform every Initialize.
2022-11-05 02:15:40 -07:00
san7890
2878345ebb Swaps sleep() to use SECONDS define, changes some sleep(1) to sleep(1 TICKS) (#70452) 2022-10-18 21:25:23 -07:00
ShizCalev
7048110298 Inhands var hardsetting (#70364) 2022-10-07 19:08:09 -07:00
Tim
52acae4cd7 Easter Egg DLC - Captain's log and WGW (#68411)
This adds two easter eggs that have been apart of SS13 lore since the game was created:

    Captain's Log - Broken tape recorder that (spawns on the derelict station)
    Woody's Got Wood - Used spellbook that makes a person go temporary blind if they read it (spawns in curators forbidden knowledge bookcase)

Why It's Good For The Game

These have been apart of SS13 lore for a long time. It would be cool to have some "official" easter eggs for players to discover.
Changelog

cl
add: Add mail goodies for curator. (random books)
add: Adds easter egg - Captain's Log. Tape recorder that spawns on derelict station.
add: Adds easter egg - Woody's Got Wood. Will rarely appear as a mail goodie for curator.
/cl
2022-10-08 10:47:56 +13:00
Twaticus
c7dde06668 [MDB Ignore]Hats DMI split (#70060)
Splits head dmi into separate files for both mob and obj icons. Kept similar to suit split categorization + some more. New files include beanie, bio, chaplain, costume, cowboy, default, hats(softcaps, fedoras, head caps, generic hats), helmet(helmets and other armored headgear/hoods), spacehelm, utility(hardhats, mostly work related hats), wizard.
Moves animal/pet head sitting icons to 1 folder, pets_head.dmi
Renames PAI head sitting icon file to pai_head.dmi
2022-10-06 21:37:06 -07:00
ShizCalev
1a32f60cf4 [ready] adds unit test for missing inhand icons. fixes a bunch of missing inhand icons (#70037)
fix: Fixed a bunch of missing inhand icons.
fix: Fixed cables in electrical toolboxes not randomizing their colors.
fix: Fixed the wrong colored icon showing when trying to make cable cuffs out of cables.
fix: The collectable SWAT helmet is now using the proper icon again!
refactor: Pipecleaners and power cables now share a unified color system, so they're once again available in ALL the same colors.
imageadd: Updated the screwdriver belt overlay to represent the newer sprite.
imageadd: Added a bunch of new inhand icons. Special thanks to Twaticus for doing the helmets! <3
fix: Wirecutters now have an icon when inside a belt again!
admin: Added a new omnitool subtype that allows you to spawn all items in a typepath!
fix: Explorer gaskmasks now properly reflect their adjusted state when held.
fix: Fixed balaclavas having the wrong icon when pulled up.
fix: Fixed the base energy sword (admin spawn only) being invisible.
fix: The rainbow energy sword is now a little bit more rainbowy!
fix: Fixed an tk exploit with orange handcuffed shoes.
fix: The traitor outfit in the select equipment panel is now actually functional!
2022-10-04 10:20:24 -07:00
LemonInTheDark
23bfdec8f4 Multiz Rework: Human Suffering Edition (Contains PLANE CUBE) (#69115)
About The Pull Request

I've reworked multiz. This was done because our current implementation of multiz flattens planes down into just the openspace plane. This breaks any effects we attach to plane masters (including lighting), but it also totally kills the SIDE_MAP map format, which we NEED for wallening (A major 3/4ths resprite of all wall and wall adjacent things, making them more then one tile high. Without sidemap we would be unable to display things both in from of and behind objects on map. Stupid.)

This required MASSIVE changes. Both to all uses of the plane var for reasons I'll discuss later, and to a ton of different systems that interact with rendering.

I'll do my best to keep this compact, but there's only so much I can do. Sorry brother.
Core idea

OK: first thing.
vis_contents as it works now squishes the planes of everything inside it down into the plane of the vis_loc.
This is bad. But how to do better?

It's trivially easy to make copies of our existing plane masters but offset, and relay them to the bottom of the plane above. Not a problem. The issue is how to get the actual atoms on the map to "land" on them properly.

We could use FLOAT_PLANE to offset planes based off how they're being seen, in theory this would allow us to create lens for how objects are viewed.
But that's not a stable thing to do, because properly "landing" a plane on a desired plane master would require taking into account every bit of how it's being seen, would inherently break this effect.

Ok so we need to manually edit planes based off "z layer" (IE: what layer of a z stack are you on).

That's the key conceit of this pr. Implementing the plane cube, and ensuring planes are always offset properly.
Everything else is just gravy.
About the Plane Cube

Each plane master (except ones that opt out) is copied down by some constant value equal to the max absolute change between the first and the last plane.
We do this based off the max z stack size detected by SSmapping. This is also where updates come from, and where all our updating logic will live.

As mentioned, plane masters can choose to opt out of being mirrored down. In this case, anything that interacts with them assuming that they'll be offset will instead just get back the valid plane value. This works for render targets too, since I had to work them into the system as well.

Plane masters can also be temporarily hidden from the client's screen. This is done as an attempt at optimization, and applies to anything used in niche cases, or planes only used if there's a z layer below you.
About Plane Master Groups

BYOND supports having different "maps" on screen at once (IE: groups of items/turfs/etc)
Plane masters cannot cover 2 maps at once, since their location is determined by their screen_loc.
So we need to maintain a mirror of each plane for every map we have open.

This was quite messy, so I've refactored it (and maps too) to be a bit more modular.

Rather then storing a list of plane masters, we store a list of plane master group datums.
Each datum is in charge of the plane masters for its particular map, both creating them, and managing them.

Like I mentioned, I also refactored map views. Adding a new mapview is now as simple as newing a /atom/movable/screen/map_view, calling generate_view with the appropriate map id, setting things you want to display in its vis_contents, and then calling display_to on it, passing in the mob to show ourselves to.

Much better then the hardcoded pattern we used to use. So much duplicated code man.

Oh and plane master controllers, that system we have that allows for applying filters to sets of plane masters? I've made it use lookups on plane master groups now, rather then hanging references to all impacted planes. This makes logic easier, and prevents the need to manage references and update the controllers.

image

In addition, I've added a debug ui for plane masters.
It allows you to view all of your own plane masters and short descriptions of what they do, alongside tools for editing them and their relays.

It ALSO supports editing someone elses plane masters, AND it supports (in a very fragile and incomplete manner) viewing literally through someone else's eyes, including their plane masters. This is very useful, because it means you can debug "hey my X is yorked" issues yourself, on live.

In order to accomplish this I have needed to add setters for an ungodly amount of visual impacting vars. Sight flags, eye, see_invis, see_in_dark, etc.

It also comes with an info dump about the ui, and plane masters/relays in general.

Sort of on that note. I've documented everything I know that's niche/useful about our visual effects and rendering system. My hope is this will serve to bring people up to speed on what can be done more quickly, alongside making my sin here less horrible.
See https://github.com/LemonInTheDark/tgstation/blob/multiz-hell/.github/guides/VISUALS.md.
"Landing" planes

Ok so I've explained the backend, but how do we actually land planes properly?
Most of the time this is really simple. When a plane var is set, we need to provide some spokesperson for the appearance's z level. We can use this to derive their z layer, and thus what offset to use.

This is just a lot of gruntwork, but it's occasionally more complex.
Sometimes we need to cache a list of z layer -> effect, and then use that.
Also a LOT of updating on z move. So much z move shit.

Oh. and in order to make byond darkness work properly, I needed to add SEE_BLACKNESS to all sight flags.
This draws darkness to plane 0, which means I'm able to relay it around and draw it on different z layers as is possible. fun darkness ripple effects incoming someday

I also need to update mob overlays on move.
I do this by realiizing their appearances, mutating their plane, and then readding the overlay in the correct order.

The cost of this is currently 3N. I'm convinced this could be improved, but I've not got to it yet.
It can also occasionally cause overlays to corrupt. This is fixed by laying a protective ward of overlays.Copy in the sand, but that spell makes the compiler confused, so I'll have to bully lummy about fixing it at some point.
Behavior changes

We've had to give up on the already broken gateway "see through" effect. Won't work without managing gateway plane masters or something stupid. Not worth it.
So instead we display the other side as a ui element. It's worse, but not that bad.

Because vis_contents no longer flattens planes (most of the time), some uses of it now have interesting behavior.
The main thing that comes to mind is alert popups that display mobs. They can impact the lighting plane.
I don't really care, but it should be fixable, I think, given elbow grease.

Ah and I've cleaned up layers and plane defines to make them a bit easier to read/reason about, at least I think.
Why It's Good For The Game
<visual candy>

Fixes #65800
Fixes #68461
Changelog

cl
refactor: Refactored... well a lot really. Map views, anything to do with planes, multiz, a shit ton of rendering stuff. Basically if you see anything off visually report it
admin: VV a mob, and hit View/Edit Planes in the dropdown to steal their view, and modify it as you like. You can do the same to yourself using the Edit/Debug Planes verb
/cl
2022-09-27 20:11:04 +13:00
skylord-a52
be0e6efdf6 [IDB IGNORE] [MDB IGNORE] Makes the icons/mob folder sane (#69302)
About The Pull Request

Reorganizes the entire icons/mob folder.

Added the following new subfolders:

    nonhuman-player (this was initially just called "antag", but then I realized guardians aren't technically antags)
    simplemob
    silicon
    effects (for bloodstains, fire, etc)
    simplemob/held-pets (for exactly that -- I wasn't sure if this should go in inhands instead)
    species/monkey

Moves the following stuff:

    All human parts moved into species, with moth, lizard, monkey, etc parts moved to corresponding subfolders. Previously, there were some moth parts in mob/species/moth, and others just loose in mob. Other species were similar.
    icemoon, lavaland, and jungle folders made into subfolders of simplemob
    All AI and silicon stuff, as well as Beepsky et al. into the silicon folder, simplemobs into the simplemob folder, aliens into the nonhuman-player folder, etc.
    Split up animal_parts.dmi into two bodyparts.dmi which were put in their respective folders (species/alien and species/monkey)

Code changes:

    Filepath changes to account for all of this
    Adds a check when performing surgery on monkeys and xenos, because we can no longer assume their limbs are in the same file
    Turns some hardcoded statues and showcases that were built into maps into objects instead

Things I'd like to do in the future but cant be assed right now:

    Remove primarily-antag sprites from simplemob/mob.dmi (Revenant, Morph, etc.) and put them in the nonhuman-player folder
    Split up mutant_bodyparts.dmi into different files for Tizirans, Felinids, monkeys, etc and put them in their own folders. Those may have once been meant primarily for mutated humans but that's now how they're being used right now.
2022-09-03 11:52:54 -07:00
MrMelbert
de04b3be80 Kills /obj/shapeshift_holder, replaces it with /datum/status_effect/shapechange_mob, also does a lot of Wabbajack refactoring (#69091)
About The Pull Request

    Deletes /obj/shapeshift_holder, replaces it with /datum/status_effect/shapechange_mob
    Refactors Heretic worm form into a shapeshift spell
    Refactors Wabbajack, and associated code

Fixes #69117
Fixes #65653
Fixes #59127
Fixes #52786
Why It's Good For The Game

/obj/shapeshift_holder was one of the worst remaining abuses of /obj direct subtypes, so I replaced it with a cool fancy datum.

This also decouples the shapeshifting behavior entirely from the shapeshifting spell. So we have support for shapeshifted mobs not sourced from a spell. Which is neat, we could technically swap Wabbajack to use this in the future.
Changelog

cl Melbert
fix: Wabbajacking a shapeshifted mob no longer runtimes horribly. When a shapeshifted mob is wabbajacked, they'll now be removed from their shapeshift and stunned.
fix: Transforming via a shapeshift should no longer rob you of your hearing / runechat awareness.
fix: Shapeshifting plays nicer with holoparasites.
fix: Being polymorphed from a xeno to a non-xeno correctly makes you a non-xeno
refactor: Refactored shapeshifting, the shapeshift holder is now a status effect instead of an object.
refactor: Heretic worm form is a shapeshift spell now, this might have some minor behavioral changes but should overall be the same.
refactor: Refactored Wabbajack (+ cursed pool). Overall a bit more clean / consistent behavior.
/cl
2022-09-02 09:44:41 +12:00
ShizCalev
4cbdc3a2db Adds more multiz support (#69420)
* Adds more multiz support by making use of ``is_valid_z_level`` instead of simply checking if z is the same.
2022-09-01 00:07:14 -04:00
tattle
d91390a447 [IDB IGNORE] The Great Sweep: Moving dmis into subfolders (part 1) (#69416)
Moves singulo and supermatter dmis into obj/engine, renamed from obj/tesla_engine
Moves Halloween, Christmas, and misc holiday items to obj/holiday
Moves lollipops to obj/food
Moves crates, closets, and storage to obj/storage
Moves assemblies to obj/assemblies
Renames decals.dmi to signs.dmi ...because they're signs and not decals
Moves statues, cutouts, instruments, art supplies, and crayons to obj/art
Moves balloons, plushes, toys, cards, dice, the hourglass, and TCG to obj/toys
Moves guns, swords, shields to obj/weapons
2022-08-24 20:49:35 -03:00
Seth Scherer
f1a363c825 Converts a shitload of istypes to their more concise macros (#69260)
* Converts a lot of istypes() to use their istype macro helpers.
2022-08-18 22:08:44 -04:00
John Willard
e5275ffb0f Fixes Hilbert Hotel's 'note to the institute' and Cybersun's password (#69237)
* Fixes Hilbert Hotel's paper

Initialize has to set the raw text before calling parent, as paper's base Initialize is when it checks for raw text to add onto the paper.

All other papers already follow this standard, this was just the odd one out.

* I lied, there was another case.
2022-08-17 22:32:12 -04:00
FernandoJ8
aa2eee2ded De-hardcodes randomize_human() and fixes some related issues along the way (#68876)
* First draft on this branch. Should work.

* Whoopsie

* Some fixes

* And again

* Final draft, question mark?

* Please enter the commit message for your changes

* Uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

* please work

* Saving for the week offline

* Final draft

* Final final draft

* Oh and clean this up

* eah

* Okay, final for real.

* I lied.

* Sure thing boss

* clinclin

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

* That's all of em I think

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2022-08-14 19:55:13 -07:00
Seth Scherer
4a0847db52 Converts all research categories into defines (#69161)
* Converts all research categories into defines

* missing category + machine categories

* final things i hope

* couple issues i missed
2022-08-13 13:47:03 -04:00
John Willard
4a274a6e4b [MDB IGNORE] Refactors drinks and fixes a lot of food problems (#69081)
* Makes condiments their own subtype, fixes geese, prepares for merging

* Fixes geese checking drink type instead of edible foodtype to eat gross food.
* Renames foodtype var on drinks to drink_types to prevent above from happening again because it KEEPS HAPPENING. DRINKS AREN'T FOOD!
* Makes Condiments their own subtype of reagent_containers because they don't make any use of being a subtype of food, at all.
* Starts moving things from food to /food/drink subtype in preparation for merging /food/drink with /drink

* fully removes Food subtype

* /reagent_containers/drinks are now /reagent_containers/cup - This is so it's no longer confused with eachother.
* /food/drinks is now /reagent_containers/cup/drinks, so we can keep their special abilities.
* Fixes a LOT of errors with food, which are STILL checking the reagent_containers, despite ACTUAL food being refactored away from it a long time ago.

This doesn't compile yet, but I do want to make sure my progress is well tracked.

* remove copypaste code, changes soda cans

* Removes most copy paste code between the two drinks, moving most stuff to parent whenever needed.
* Made soda cans their own subtype since they didn't share anything with glass bottles anyways.
* Fixes more problems with food/drinks, especially with geese. Geese really were just broken this whole time and no one said a word...
* Removes a snowflake signal, now that both drink types share a common one.
* Adds everything to the .dme

Currently my goal is to get this all compiling, then remove isGlass var by making glass be all glass ones only.

* Moves all icons into a single drinks dmi

I'm not that great at icon stuff, hopefully I didn't forget/break anything.

* Turns juices into their own subtype

This allows us to let them check for type in molotov, to both get rid of a use of isGlass, and so non-glass non-cartons don't show up as 'carton'.

* fixes compile issues, adds updatepaths

* a better updatepaths

* updates the damn maps now

* properly names the updatepath

* how did that get there

* i suck at handling merge conflicts

* how am i this bad

* code improvement and soda fix

* more fixes

* Don't be a timer

Ports from old food bottles to trans the reagents, rather than add a timer to.

* Merge conflicts and fixes bottle smashing

* Bottle smashing is now consistently functional regardless of how much liquid they have in them, when before it would spill first, then smash on the second hit.

* runs updatepaths again
2022-08-12 15:24:14 -04:00
John Willard
952c3ee0d3 Removes ComponentInitialize() (#69118)
* Removes ComponentInitialize()

Completely removes ComponentInitialize() as a proc, which was called on every single atom in the game, twice in some instances (like new players), over something that can already be done with Initialize().
This is the second attempt at doing this, after the first attempt fell apart for some reason. This time it was way easier though, since storages are no longer a Component.

* update icon blocker added before calling parent

* Update code/game/machinery/porta_turret/portable_turret.dm

Co-authored-by: san7890 <the@san7890.com>

* adds a mapload while I'm here

* moves human mood

* Does some UNRELATED thing to the PR

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
2022-08-11 19:01:32 -04:00
Seth Scherer
34b4034777 Replaces the mood component with a mood datum (#68592)
About The Pull Request

Mood was abusing signals and get component pretty badly, so I redid it as a datum to stop this.
Why It's Good For The CODEBASE

Better code pratices, also gives admins easier tools to manage mood
Changelog

cl
admin: Added two new procs into the VV dropdown menu to add and remove mood events from living mobs.
/cl
2022-08-12 08:59:20 +12:00
Seth Scherer
040e24d2e4 Fixes ash walker tendrils dropping typeless anomaly cores (#68956)
* Fixes ash walker tendrils dropping typeless anomaly cores, as it was just spawning the base parent. It's now been changed it to a `pick` from all their subtypes
2022-08-08 17:51:08 -04:00
Mooshimi
b09f3868f8 individual LOG_GAME (#68683)
About The Pull Request

    replaces a ton of log_game with user.log_message so the log is added to individual and global logs.
    adds a few logs for individual LOG_VICTIM, LOG_ATTACK etc logging.
    adds logging for bluespace launchpad's tele coords being changed.
    took the word "has" out of log_combat, as it's extra and just lengthens the log.

Why It's Good For The Admins

It's extremely laggy to open game.txt so an alternative is individual game logs
Changelog

cl
admin: A lot of game logs will now also be in individual game logs, for convenience in log diving.
admin: Added logging for bluespace launchpad x and y offset changes, which go to individual game logs.
admin: Attack logs will now be slightly shorter, one useless word was removed.
/cl
2022-08-05 09:32:02 +12:00