Commit Graph

3880 Commits

Author SHA1 Message Date
Jacquerel
7d7f55ee53 Heretic Ascension Tweaks (#78472)
## About The Pull Request

Some changes to Cosmic and Knock heretic ascensions, in response to
feedback.

- Cosmic Heretics can no longer control their summon while jaunted. 
- Additionally the death link element the Star Gazer used... wouldn't
work if there was more than one cosmic heretic. I refactored it into a
component, so that it would.

Frankly there are probably a lot of _other_ abilities which shouldn't be
usable while jaunted but are, but I have been burned in the past by
adding defaults which were applied too widely so we'll leave it
case-by-case for now.

- The Knock rift can no longer summon Flesh Worms of any kind.
- But it _can_ summon fire sharks (we really need to reflavour these...)
and any future "basic mob" heretic mobs (or ones which are converted).
- Additionally the rift can't be clicked by ghosts while it's polling
ghosts automatically because that would create funky empty-minded mobs.
- Finally it goes away when the heretic dies.

## Why It's Good For The Game

For Cosmic Heretics, controlling the Star Gazer in conjunction with
Space Jaunt essentially meant that the heretic was playing an RTS as an
invincible observer with an invulnerable unit, now they have to actually
be present and killable in order to sic The Beast on you.

For Knock Heretics, Minor Flesh Worms are a proof of concept which was
never meant to be used except by admins. They're _barely_ weaker than a
normal flesh worm, extraordinarily tanky, delete walls, and generally
devalue the Flesh path ascension.
Vanishing upon heretic death is because every _other_ ascension is at
least theoretically stoppable except this one. Now this one is too.
It's still _very hard_ to kill the heretic because every _10 seconds_
they can transform into a heretic mob which acts as an extra health
pool.

## Changelog

🆑
fix: If two cosmic heretics ascend in the same round, their star gazer
survival will be linked to each individual heretic and not shared by
just one of them.
fix: You can't click the Knock heretic portal to join as a mob while
already signed up to become a mob.
balance: Cosmic heretics can't order the Star Gazer around while
jaunting.
balance: The Knock Heretic portal cannot summon Flesh Worms, but can
summon Fire Sharks.
balance: The Knock Heretic portal will disperse if its creator is
killed.
/🆑
2023-09-29 16:52:19 -04:00
san7890
ef3fdef094 tweaks mob-creation message_admins() message (#78654)
## About The Pull Request

Right now it says "ADMIN created 10ea spiders.", which is really odd
syntax since nothing else in the game does this. This just fixes it so
the message reads "ADMIN created 10 spiders.", which is a lot more clear
to my eyes.

## Changelog
I'll be honest I had no idea you could spawn mobs this way and I don't
think it's measurable enough to even put an `admin` changelog.
2023-09-29 16:38:56 -04:00
Jacquerel
f5aa244939 Adds add/remove mob ability to VV dropdown menu (#78652)
## About The Pull Request

You add spells to mobs via a dropdown in VV but mob abilities via
marking the mob and pressing a button in the admin status panel.
I like opening the VV menu more than I like marking mobs (I am usually
going to need to open it anyway) so I added an alternate route in the VV
dropdown.

## Why It's Good For The Game

It's better for my personal workflow.

## Changelog

🆑
admin: Mob abilities can be granted to arbitrary mobs via the VV menu in
a similar way to spells.
/🆑
2023-09-28 21:37:17 -06:00
MrMelbert
9e1c71f794 Reworks transformation sting to be temporarily in living mobs, forever in dead mobs (#78502)
## About The Pull Request

- Reworks transformation sting. 
- Transformation sting is now temporary, lasting 8 minutes (number not
final) in humans.
      - If used on a monkey, it lasts forever instead. 
- While the target mob is dead or in stasis, the duration will not
progress, making it functionally infinite until revived and taken off
stasis, where it will resume its timer where it left off.
   - Chemical cost reduced to 33
   - DNA cost reduced to 2

- Removes TRAIT_NO_TRANSFORMATION_STING, instead just checks for
TRAIT_NO_DNA_COPY
   - These were essentially the same traits, so I just combined the two

- Organizes some trait lists alphabetically

- Adds TRAIT_STASIS, to allow for reacting to mobs entering and exiting
stasis via COMSIGS
- Everything that checks IS_IN_STASIS now checks HAS_TRAIT TRAIT_STASIS,
which is probably more performant, so that's a bonus.

## Why It's Good For The Game

A lot of people don't like the current iteration of Transformation
Sting, me included

Right now it's only use is for a meme - you make the entire station into
felinids until you get lynched, and that's it.

It's not really a healthy ability for ling's current kit, so this pr
attempts to soft rework it to make it a bit more in line with how ling
should be acting - turning it into a source of short term confusion
between people, or using it on a body to cover your tracks.

This accomplish it two fold - One, it is now cheap enough to use twice
in rapid succession, allowing for quick on-the-spot "BE CONFUSED"
situations while you abscond. Two, as mentioned in the last paragraph,
you can poke a body of someone you murder to obfuscate the crime scene
and maybe help out in taking over someone's identity.

## Changelog

🆑 Melbert
balance: Transformation sting now lasts 8 minutes, down from permanent.
However, the effect is paused for dead and stasis mobs, making it
permanent SO LONG AS they stay dead or in stasis. The effect is also
permanent if used on a monkey.
balance: Transformation sting now costs 33 chemicals, down from 50. 
balance: Transformation sting now costs 2 dna points, down from 3. 
fix: Transformation sting works on monkeys again.
refactor: Refactored a bit of human randomization. 
/🆑
2023-09-28 13:47:39 -06:00
SyncIt21
0b58af5df2 Fixes incorrect logging for some admin secrets (#78641)
## About The Pull Request

Open admin secrets panel try to power full station
![Screenshot
(307)](https://github.com/tgstation/tgstation/assets/110812394/879b0f0f-d05d-4d8a-801d-adc4e89ff067)

Get stack trace
![Screenshot
(308)](https://github.com/tgstation/tgstation/assets/110812394/1b0491c3-7b00-4985-a706-fa16bee5792f)

Cause we didn't pass a list to log as its data. instead we passed a
number `1` for no reason
![Screenshot
(311)](https://github.com/tgstation/tgstation/assets/110812394/84108cd2-eab4-43eb-8d21-abdc9047d80a)

This fixes that for this event & some others

## Changelog
🆑
fix: removes incorrect stack traces when using some admin secrets
/🆑
2023-09-28 14:01:52 -04:00
GPeckman
634ab94156 Adds an Admin Tool for the DNA Infuser (#78496)
## About The Pull Request

Adds some an vv admin tool for DNA Infusions. The tool will
automatically grant all of the relevant organs to the target.


![pic1](https://github.com/tgstation/tgstation/assets/21979502/e34548af-9648-4842-a089-02cffc9989cf)

![pic4](https://github.com/tgstation/tgstation/assets/21979502/1c0aa855-e284-4891-800e-717383425b76)

![pic3](https://github.com/tgstation/tgstation/assets/21979502/c955a35f-5835-4271-88cb-f1ab198cb8df)
## Why It's Good For The Game

It was already possible to do this with the organ manipulation tool, but
that's a lot slower and probably has issues when replacing brains. This
new tool will hopefully streamline the testing of new DNA infuser
entries.
## Changelog
🆑
admin: There is now a tool to apply a DNA Infuser entry to any human.
/🆑
2023-09-27 21:24:18 -04:00
LemonInTheDark
99950517aa Quick Harddel Fixeees (#78253) 2023-09-27 21:05:55 -04:00
carlarctg
d86550773b Valentines and ERTs will no longer get mood boosts from traitor moodener items (#78597)
## About The Pull Request

Valentines and ERTs will no longer get mood boosts from traitor moodener
items

Closes #73432

## Why It's Good For The Game

bugge

## Changelog

🆑
fix: Valentines and ERTs will no longer get mood boosts from traitor
moodener items
/🆑
2023-09-27 17:02:11 +01:00
MrMelbert
a69ede8114 Adds respawn config option forcing respawn as another character slot (#78459)
## About The Pull Request

Adds an option to the respawn config which forces you to pick another
character (slot) before you respawn.

## Why It's Good For The Game

Just an idea i'm throwing out there, not necessarily pushing for it to
be enabled on any servers.

Respawning as an alternative character can be a good way to make people
less frustrated at dying, particularly if paired with the cooldown
config that already exists:

"Oh shucks, I died and got my head cut off and got absorbed and got
spaced by some changeling. I won't be able to finish my project or
whatever. At least in 15 minutes I may be able to join as my botanist
character to try something else rather than having to wait an hour and a
half for the round to tick over."

Also nice for downstream support. 

(Obviously you can just, *ban* people who respawn as the same character,
use an honor system, but codifying it seems better than not.)

## Changelog

🆑 Melbert
config: Adds a config option for player respawning that enables
respawns, but forces you pick a new character.
config: "NORESPAWN" has been replaced with "ALLOW_RESPAWN 0". Unlimited
respawns is "ALLOW_RESPAWN 1" and character limited respawns is
"ALLOW_RESPAWN 2".
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-09-26 19:17:37 -06:00
LemonInTheDark
cd125e6b9e Refsearch Info Injection (#78574)
## About The Pull Request

Adds a proc that types can override to inject extra information into the
refsearch
This'll allow us to more easily track and deal with refs held by general
datums, like callbacks.
I've implemented a template example FOR callbacks, to provide an example
and assist in solving future issues

Done to help lumipharon from TGMC, they were having trouble with this
case.

This isn't perfectly optimized, but this proc has a LOT of issues just
in general. Need to rework it to cut down on string churn someday
2023-09-26 11:44:41 -06:00
Watermelon914
41bba9931f Prevents players from getting antagonist if they can't qualify for any role beforehand. (#78511)
## About The Pull Request
As the title says, you can no longer become an antagonist if you can't
qualify for a role beforehand. How this works is that it runs job
assignment before antagonist roles are handed out to see which players
can qualify for a job role. It then undoes job assignments and then runs
antagonist assignment.
This is to prevent players from setting a highly contested role to low
priority so that they have a 0% chance of ever getting it, whilst still
being eligible for every antag role.

It's not completely foolproof as it's not really possible to account for
the fact that some players may become antagonists, thereby freeing up
some job slots. Since it's an approximation, it means that players who
put themselves at a high chance of returning back to lobby due to their
preference choices have an overall lower chance of becoming an
antagonist as they can be excluded from the antagonist roll due to the
random nature of job selection.
If players want to prevent this from happening, simply set a lot of jobs
to low/medium priority or adjust the "Return back to lobby" preference
to any other preference.

## Why It's Good For The Game
Prevents players from rolling antag without ever intending to play the
game as a non-antagonist.

## Changelog
🆑
fix: Fixed players being able to roll antagonist without ever being
eligible to play any role. Players who have their preferences set up so
that they're likely to return to lobby when the round starts have a
lowered chance of becoming antagonist.
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2023-09-23 20:42:45 -04:00
Jacquerel
ad81ca6f4c Allows admins to overrule God (#78429)
## About The Pull Request

Adds a "manage religious sect" verb to the "game" menu of the admin
panel.
It can be used to assign the chaplain's sect if they haven't picked one
yet, or reassign it (to a different one, or to nothing) if they already
have.
This is likely mostly going to be used for ahelps where someone
misclicks or suddenly logs off and wants to be replaced by a different
chaplain with different ideas.

## Why It's Good For The Game

Admins asked me to make it

## Changelog

🆑
admin: Admins can now reset or modify the chaplain's sect from a UI
panel
/🆑
2023-09-22 19:13:38 -06:00
GPeckman
bb1a4a05bc Fixes Boneless Smite (#78449)
## About The Pull Request

The boneless smite was using a list of strings instead of a list of
numbers, and didn't work as a result. This just fixes it. Fixes #78437.
## Why It's Good For The Game

Bugfixes good.
## Changelog
🆑
admin: Boneless smite should work properly again.
/🆑
2023-09-22 13:46:39 +01:00
Jacquerel
7025e5da5e Replaces "Bread" smite with "Objectify" (#78445)
Instead of turning people into bread, the bread smite can now turn people into any object (including bread).
2023-09-21 08:24:37 +02:00
Zephyr
1b96345e44 Multi-Z Support for Lazy Templates | Cleans up some turf flag misuse (#77786)
## About The Pull Request

Adds multi-z support for lazy templates
Also fixes some improper use and placement for turf flags
## Why It's Good For The Game

Shadow needs/wants this for bit runner maps.
Turf flags are also why lava has been generating in places it shouldnt.
(inside of ruins)
## Changelog
🆑
fix: Lava can no longer occasionally generate inside of previously
loaded templates and breach and/or destroy shit
/🆑

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-09-19 01:06:08 +00:00
LemonInTheDark
e8537d489e Adds NONE to empty bitflags in VV (#78355)
This has annoyed me forever. Let's do somethin about it.
2023-09-17 01:14:32 -05:00
LemonInTheDark
0e723b5bb7 Removes Sleep Printing Library (#78324)
## About The Pull Request

#76286, which spawned it, is dead. Don't need to hang onto it anymore
per moth's instructions
2023-09-14 18:04:10 -06:00
GoldenAlpharex
ceb0ab6029 Fixes the admin log when adding a new admin from the permissions panel not displaying the ckey of the new admin (#78245)
## About The Pull Request
It was just displaying nothing, which was only a mild annoyance, but
after tolerating it for a few years, today I've had enough and fixed it.

## Why It's Good For The Game
Finally others can know who was added to the team without having
`R_PERMISSIONS` themselves.

![image](https://github.com/tgstation/tgstation/assets/58045821/5a945bea-1f1f-4b3d-bd96-c18062cecae4)


## Changelog

🆑 GoldenAlpharex
fix: The message sent to admins when a new admin has been added via the
Permissions Panel will now properly show the new admin's ckey.
/🆑
2023-09-11 13:18:51 -06:00
nikothedude
009af8c2ce [TEST-MERGE FIRST] Wound refactor number two: Full synthetic support (#78124)
## About The Pull Request

Heavily refactors wounds AGAIN.

The primary thing this PR does is completely change how wounds are
generated and added - while the normal "hit a guy til they bleed" stuff
works about the same, asking for a specific type of wound, say, like how
vending machines try to apply a compound fracture sometimes, isnt going
to work if we ever get any non-organic wounds, which the previous
refactor allowed.

With this PR, however...
* You can now ask for a specific type of wound via
get_corresponding_wound_type(), which takes wound types, a limb, wound
series, etc. and will try to give you a wound fitting those
specifications - but also, a wound that can be applied to a limb.
* This will allow for a vending machine to apply a compound fracture to
a human, but a collapsed superstructure (assuming my synth wounds go in)
to a robot

There are now new "series types" and "wound specific types" that allow
us to designate what series are "mainline" and randomly generatable, and
what are "alternate types" and must be generated manually - you can see
the documentation in wounds.dm.

The behavior of limping and interaction delays has been abstracted to
datum/wound from bone wounds to allow just, general ease of development

Pregen data now allows for series-specific wound penalties. Example: You
could set a burn wound's series wound penalty to 40, which would make
wound progression in the burn category easier - but it would not make it
any easier to get a slashing wound. As it stands wound penalties are for
wounds globally

Scar files are now picked in a "priority" list, where the wound checks
to see if the limb has a biostate before moving down in said list.
Example: Wounds will check for flesh first, if it finds it - it will use
the flesh scar list. Failing that, they then check bone - if it uses
that, it will use the bone scar list. This allows for significantly more
modular scars that dont even need much proc editing when a new wound
type is added

Misc changes: most initial() usage has been replaced by singleton
datums, wound_type is now wound_types and thus wounds can accept
multiple wound types, wounds can now accept multiple tool behaviors for
treatment, wounds now have a picking weight so we can make certain
wounds rarer flatly,

This PR also allows for wounds to override lower severity wounds on
generation, allowing eswords to jump to avulsions - but in spirit of
refactoring, this has been disabled by default (see pregen data's
competition_mode var).
## Why It's Good For The Game

Code quality is good!

Also, all the changes above allow wounds to be a MUCH more modular
system, which is one of its biggest problems right now - everything is
kinda hardcoded and static, making creative work within wounds harder to
do.

## Changelog
🆑
refactor: Refactored wounds yet again
fix: Wounds are now picked from the most severe down again, meaning
eswords can jump to avulsions
fix: Scar descs are now properly applied
/🆑
2023-09-09 19:20:21 -04:00
distributivgesetz
d1ef1ec402 The Create Command Report verb has the option to prevent printing reports now (#78208)
## About The Pull Request

Title summarizes all.
## Why It's Good For The Game

<details>


![image](https://github.com/tgstation/tgstation/assets/47710522/ae71a6f9-b22d-467a-8da9-6a0bec576215)

</details>

Prevents this nightmare on a comms console during an event with
particularly high centcom announcement traffic.

No, don't come at me with "it's soul", it's just highly annoying to deal
with and having the option to prevent it is better. If you leave a
downvote and tell me in the comments that I'm "taking" soul out of the
game then I will come find you and actually take your soul out of your
body.
## Changelog
🆑
admin: The "Create Command Report" verb now has the option to not print
report papers at communications consoles.
/🆑
2023-09-09 16:18:27 -04:00
Jacquerel
6d258e5527 Choose your own Objective (#78118)
## About The Pull Request


![image](https://github.com/tgstation/tgstation/assets/7483112/12d3cf8d-4538-42c3-a962-bf2d6653ef55)

![image](https://github.com/tgstation/tgstation/assets/7483112/60981726-8495-47e8-8924-dd18c000fdfe)

This PR adds the ability for solo antagonists (Traitor, Changeling,
Heretic, Wizard, Malfunctioning AI, and Ninja) to "write-in" their own
objectives in place of the ones the game gave them.
For traitors this is located on the uplink (though the button is not
present if you aren't the owner of the uplink, thieves can't give you a
troll objective) and for everyone else it is on the antagonist
information panel.

Pressing this button will replace all of your objectives _except_ ones
like "escape alive" or "survive" or "die a glorious death".
By default a player can only do this once per round, but the Traitor
Panel admin tool contains a button which can display the prompt again.

Custom-entered objectives are not mechanically tracked in any way and do
not report success or failure on the round end screen, whether they were
successful or not is up to you the audience. Resultingly, doing this
will make you ineligible for getting the hardcore random points from
completing your objectives.

Admins are capable of using this button to show the prompt to _any_
antagonist, including team antagonists, but do so at their own risk. A
single cultist changing their objective to something else only updates
them, not their team.
Admins can also choose whether or not it replaces existing objectives or
just adds a new one entered by the player.

When someone sets a new objective, it informs any active administrators
of their choice and provides linked buttons to send them a syndicate
radio message or immediately smite them, because unfortunately our
players cannot always be trusted with arbitrary text entry.
I _didn't_ make this a system which requires approval because I don't
think admins _want_ that level of micromanagement, although plausibly if
it is thought to be a good idea I could add a time delay and reject
button similar to the "rename the station" charter item.

Heretics work slightly differently and have an "Are you sure?"
confirmation other antagonists lack.
This is because Heretic objectives are directly tied to ascension, thus
by replacing the objectives you are locking yourself out from being able
to do it.
I don't _necessarily_ think this is a terrible thing, because "try to
ascend" _is_ the default objective. There's no point entering a new one
if that is what you want to do anyway.

While I was in here I gave Ninjas a very rudimentary custom antagonist
panel, because they didn't have one.
I also made their C4 display where it can be detonated on examine, in
case you no longer have the relevant objective to reference.

<details>
  <summary>Other previews</summary>
  

![image](https://github.com/tgstation/tgstation/assets/7483112/55ca6ce5-a5a5-4201-9bc6-88dd4e4e35a1)

![image](https://github.com/tgstation/tgstation/assets/7483112/cba5b921-addd-4886-8d83-b0b383607efc)

![image](https://github.com/tgstation/tgstation/assets/7483112/69212c87-5a93-4524-ab9a-f2540fc61617)

![image](https://github.com/tgstation/tgstation/assets/7483112/fc5c1d26-18ef-4481-857d-ae4142e13f95)

![image](https://github.com/tgstation/tgstation/assets/7483112/046589ac-e7a5-4006-8087-42e9bcd1016e)
</details>

## Why It's Good For The Game

It's a reasonably frequent refrain that "Objectives are just guidelines"
and that more interesting players should strive to ignore them and do
something else, I would hope this would encourage that kind of
behaviour.
If you _are_ going off and doing your own thing, now other players can
actually see what it was that you were trying to do when the round ends
(and judge you based on whether you actually did it).

## Changelog

🆑
add: Traitors, Changelings, Heretics, Wizards, Malfunctioning AIs, and
Ninjas can now all reject their original objectives and provide one of
their own in its place. A Heretic doing this will no longer be able to
ascend.
add: "Custom" objectives which aren't mechanically tracked will no
longer report success or failure upon round end.
qol: Space Ninja spider charges will now display where they can be
detonated when examined, if you are a ninja.
/🆑
2023-09-07 20:25:52 +01:00
Jacquerel
6d8664f876 Don't gib a player if you click the 'X' button in the confirmation window (#78043)
## About The Pull Request

Fixes #78011
Does the same thing also for the "force everyone to play as a random
character" button.

## Why It's Good For The Game

It shouldn't do that.

## Changelog

🆑
fix: Prevents admins from accidentally gibbing people by closing a
confirmation window.
/🆑
2023-09-01 14:12:30 +02:00
nikothedude
554edc60e9 [TEST-MERGE FIRST] Allows all limbs to be dismembered and significantly refactors wounds (#77813)
## About The Pull Request
**_THIS PR UPDATES THE SCAR VERSION - ALL EXISTING SCARS WILL BE
WIPED_**

Expands the wound system functionality to support any type of limb at
all.

To do this, wounds have been significantly refactored. For starters,
wounds now use limb biotype instead of wound type for determining what
they can be applied to. They also use singleton instances for most "can
we apply this" checks instead if copy pasted initial().

Wounds now use a "wound series" instead of wound_type for determining
the, well, series. Previously, all WOUND_BLUNT wounds were considered
bone wounds, making it impossible to have multiple WOUND_BLUNT wounds at
once. Now, its based on wound series - bone wounds are of the blunt bone
wound series, and use the typical logic.
One change that results from this is the ability for everything with a
jointed limb to get a dislocation. Yes, this includes things like
prosthetics.

On the note of external and internal biotypes: Exterior are bones,
Interior is flesh. Interior protects exterior from slash until its
mangled, at which point it either exposes exterior to slash or allows
dismemberment if theres no exterior.
Basically - it acts the exact same way, except its not hardcoded, and
its more modular.

A lot, lot more changes were made - I cant name them all, but if youre
interested, you can read up. Wounds have more procs, more
modularization, and less hardcoding.

Sadly, scars have been updated in such a way so that the wound version
must be updated. Scars will be deleted.

## Why It's Good For The Game

As it stands, half the limbs in the game can't be dismembered. This
changes that, allowing every single limb to be dismembered.

The two dismemberment critera are now:

1. If able to get mangled flesh or bone, it can be dismembered once it
gets mangled flesh and bone (or JUST flesh if it only has a internal
biostate, vice vers afor bone if external only)
2. If it cant be dismembered by the above, it will have a chance to
dismember when at or above 80% of its total max damage

Finally, code being better is usually a good thing.

## Changelog
🆑
balance: Prosthetics and slimepeople can now have limbs dismembered
balance: Slimepeople can now receive slash wounds, but cannot bleed
balance: Most limbs can now be dislocated
refactor: Scar backend reworked, scars will be wiped as they update to
the new format
/🆑
2023-08-29 21:00:36 -04:00
Timberpoes
a56270cb05 Fixes issue where role banned players can still play roles they're banned from. (#77738)
## About The Pull Request

`is_banned_from(...)` expects a ckey.

`/obj/effect/mob_spawn/ghost_role/attack_ghost(...)` checks for role
bans by using key instead.

This can lead to players whose keys and ckeys are different being able
to evade certain ghost role bans; by accident or otherwise.

This PR takes a two-pronged approach. The first fixes ghost roles
passing in the key instead of the ckey to is_banned_from. This fixes the
bug, and makes it consistent with all other cases of
`is_banned_from(...)` being called.

The second is to redefine the behaviour of `is_banned_from(...)` to
accept either a ckey OR a key, since converting from key to canonical
key should be a fairly trivial operation. This prevents this specific
bug from ever occuring again, by making it intended functionality to
pass either key or ckey similar to how the roles param accepts either a
string role or a list of roles.

### ***Please review the code carefully, my changes to
`is_banned_from(...)` have not been tested. No logical flow should have
been changed.***
## Why It's Good For The Game

Ban systems working good.
## Changelog
🆑
fix: Fixes an issue where role banned players would be able to accept
certain ghost roles they're meant to be banned from.
/🆑
2023-08-29 16:42:50 +02:00
Ghom
d0d16a2ae3 Fixes an issue with the "recolor from string" option in the greyscale modify menu (#77798)
## About The Pull Request
The number of colors has to match the expected color of the greyscale
configuration, otherwise the whole proc chain behind the generation of
the resulting icon will crash here:
ac446d8bad/code/datums/greyscale/_greyscale_config.dm (L253)

## Why It's Good For The Game
One of the thousands runtimes I've seen in the runtime viewer.

## Changelog

🆑
fix: Fixed an issue with the "recolor from string" option in the
greyscale modify menu that resulted in invisible icons.
/🆑
2023-08-27 16:16:07 +00:00
Bloop
1bfee08d54 Fixes greyscale colors not updating when changing their colors via VV, and fixes some issues with accessories (#77806)
## About The Pull Request

Fixes https://github.com/Skyrat-SS13/Skyrat-tg/issues/23214

This fixes a few bugs and cleans up code a bit:

1) Greyscale colors that were changed via the VV modify greyscale menu
will now update the mob's worn clothing accordingly. It wasn't doing
this before. Accessories in particular needed a bit of extra work to
update in this way because it wasn't coded with this case in mind.

2) Accessories will call `equipped()` and `dropped()` when they get
added/removed. This will fix issues like item flags being incorrectly
set, action bars not being added, etc.

3) Accessories will now be returned by `get_all_gear()`. This will
probably fix a few issues I'm not aware of.

## Why It's Good For The Game

<details><summary>Works</summary>


![dreamseeker_xijzQB0ALa](https://github.com/tgstation/tgstation/assets/13398309/eccb35d5-e1ea-4e2c-9906-f5b8c2187d24)

</details>

<details><summary>get_all_gear()</summary>


![dreamseeker_WsG0Uu2tIe](https://github.com/tgstation/tgstation/assets/13398309/d5c272d4-1990-454c-b48f-4da7b6a5f859)

</details>

<details><summary>get_equipped_items()</summary>


![dreamseeker_qe4hMngAO3](https://github.com/tgstation/tgstation/assets/13398309/06469b93-2a58-49db-be7f-c748576bf481)

</details>


<details><summary>item_flags get set now, hopefully preventing future
issues related to that</summary>


![image](https://github.com/tgstation/tgstation/assets/13398309/29a0e25a-a88f-4547-99f8-888da6b85e4d)

</details>

## Changelog

🆑
fix: greyscale colors will now update on the mob when modifying them via
the VV menu
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2023-08-26 20:47:59 +02:00
John Willard
ef352ca731 minor changes to living and mob vars (#77820)
## About The Pull Request

Renames m_intent to move_intent and moves it to the living level
renames tod to station_timestamp_timeofdeath
removes stun_absorption and see_override as one was unused and the other
was never actually implemented

## Why It's Good For The Game

Many vars on the mob and living level were intended to be on the living
and carbon level, but weren't for one reason or another. Generally it
was out of laziness to ensure the mobs being checked for these vars were
the intended mobs, and there's some todo comments on how they want it
changed in the future, though it never happened.
I'm hoping to get these all down in the future, I originally wanted to
move ``stat`` from mob to living but it had hundreds of errors so I
didn't want to do it all here.

## Changelog

Nothing player-facing.
2023-08-26 02:24:15 +01:00
Bloop
4c870f71ca Fixes a bunch of callbacks that were being qdeleted, and code cleanup (#77904)
## About The Pull Request


![image](https://github.com/tgstation/tgstation/assets/13398309/559eb50a-461c-4220-b628-55412baaffc3)

Continuing the work of
https://github.com/tgstation/tgstation/pull/77850.

it started with finding one that was being missed and causing a
runtime...then I noticed a whole lot more. While I was doing this I
found callbacks that weren't being nulled in `Destroy()`, so I added
that wherever I found these spots as well as some general code cleanup.

There were a lot more of these than I initially hoped to encounter so
I'm labeling it as a refactor.

## Why It's Good For The Game

Fixes lots of runtimes, improves code resiliency.

## Changelog

🆑
refactor: fixed a bunch of instances of callbacks being qdeleted and
cleaned up related code
/🆑
2023-08-25 16:03:27 -06:00
LemonInTheDark
6d3e268f6a Implements byond_status() for harddel hunting (#77818)
## About The Pull Request

In addition, improves dump_harddel_deets usage to hopefully hit in unit
testing

byond_status() will dump as a part of find_references(). While I'd like
to expand that if we ever get a proper version, this is good for how we
have things setup rn.
2023-08-21 22:59:18 -07:00
Fikou
b77c1c85ea MODLink System (+ NWTLMM) (#77639)
## About The Pull Request
A pact made with `@Kapu1178`
Small changes you should not care about:
RD MODsuit outfit (admin only) no longer has a beret that blocks the
activation of the suit
The beret used by death squad officers no longer is blocked from being
put on a hat stabilizer module
Admins can now Shear matrices of objects in Modify Transform
Multitool buffers have been a little refactored to use a setter proc
that saves them from causing hard dels
Cooler stuff:
A revival and remake of [Nobody Wants To Learn Matrix
Math](https://github.com/tgstation/tgstation/pull/59103), this time with
additional tooling for quick matrix calculations.

![image](https://github.com/tgstation/tgstation/assets/23585223/eb387738-0839-463a-aed8-4703d139b11a)
The MODLink system, available through every MODsuit and MODLink scryers
(a neck item obtainable from advanced modsuit research or
charliestation)
Let's you make a holographic call with any other MODLink user, where you
can chat in realtime and see what's up with em

![image](https://github.com/tgstation/tgstation/assets/23585223/5a822f9f-e823-497e-b766-40055f2fc0d6)
![image](https://github.com/tgstation/tgstation/assets/23585223/062983ee-6058-4e78-a3aa-bccda1a3e224)


## Why It's Good For The Game
Adds a fun way for the crew to communicate with each other that can be
done in real-time with relative privacy compared to radio.

## Changelog
🆑 Fikou, Armhulen, Sheets (+rep for Mothblocks and Potato)
fix: RD MODsuit outfit (admin only) no longer has a beret that blocks
the activation of the suit
fix: The beret used by death squad officers no longer is blocked from
being put on a hat stabilizer module
admin: Admins can now Shear matrices of objects in Modify Transform
admin: Admins now have access to Test Matrices in the VV dropdown, an
all-in-one tool for editing transforms.
add: MODLink system, available through scryers (from RnD and Charlie
Station) and through MODsuits. Lets you call people with holographs!
/🆑
2023-08-19 06:24:57 +00:00
Helg2
803f9edabe Few CTF changes. (#77533)
## About The Pull Request
- Fixed that if you chose to press a cross while toggling instagib mode
it will react as `Yes` instead of just canceling
- Added description for assault class (with shotgun and rocket gloves)
so you know that you have faster moving speed and lover armor.
- Fixed that when you already chose a team and try to click on other
teams spawners you'll be asked to consider other teams to make them
equal.
- Decreased time of recharge start delay from 20 seconds to 12, because
when it takes soo much to regen your shield its just faster to die and
respawn with a new one.
- Added 1.7 scope to marksmans rifle.
- Little cleanup.

**Everything is arguable.**
**Ask if something is unclear or confusing.**
## Why It's Good For The Game
Less buggs, less wondering why do you die in 1 hit and others don't, a
little bit of consistency.
## Changelog
🆑
qol: CTF assault class' (with shotgun and rocket gloves) description now
mentions that it has low armor and increased moving speed.
balance: Decreased CTF recharge start delay for shields from 20 seconds
to 12 seconds.
balance: Marksmans rifle now has 1.7 scope.
fix: When toggling instagib mode for CTF and pressing a cross now will
just cancel instead of proceeding.
fix: When clicking on other CTF teams spawners and after you already
chose your team no more will ask you to join some other team to make
them even.
/🆑
2023-08-19 01:10:22 +02:00
Jacquerel
5c9a990df6 Add Mob Ability menu now displays ability names before typepath (#77682)
## About The Pull Request

Look at this menu:

![image](https://github.com/tgstation/tgstation/assets/7483112/2ecf0839-a7b6-4038-b772-7ffcdec8bd8d)

Isn't this basically useless?
When you try to add a mob ability to a mob, it displays a huge list of
typepaths.
Literally none of the typepaths are short enough that they even fit in
the window, and the data about what the ability actually is usually lies
at the end of the typepath.
This is clearly silly.

I made it look like this instead:

![image](https://github.com/tgstation/tgstation/assets/7483112/13af9a9c-39b5-4a47-8ae4-3f6ac242f9f9)

Now you see the name _and_ the typepath (it's still useful information
in cases where there are several similar abilities).
Also I gave the lobster charge ability its own name because it didn't
have one.

## Why It's Good For The Game

Increases usability of this admin feature.

## Changelog

🆑
admin: The Add Mob Ability menu now prefixes the typepath of the ability
with the ability's name, so you can much more quickly see what the
ability is.
/🆑
2023-08-17 15:18:26 -06:00
Bloop
ed8445a312 Adds sanity checking to prefs checks, fixing a bug that can cause emotes to stop displaying intermittently (#76946)
## About The Pull Request

This PR adds a bunch of sanity checking to the `prefs.chat_toggles` var
accesses.

Prefs can be null when client is creating/deleting and this causes a
runtime where you might not be able to use emotes.


![image](https://github.com/tgstation/tgstation/assets/13398309/d89649d4-19c7-439f-b080-332709196505)

EDIT: as per suggestion I stopped masking the issue and added stack
traces instead. And made them into helper procs to avoid code
duplication.

For some of these procs it is important that we are able to continue
running to get to the end. **A ghost having null prefs should not stop
everyone else from hearing/seeing the emote.**

So now they will put the stack trace and keep on trucking if that issue
occurs. This is the main 'point' of the PR, which has seemingly gotten
bogged down in the creation of the two helper procs--apologies.

See https://github.com/tgstation/tgstation/pull/70404 for essentially
the same issue but applied to chat messages. I have gone back and
replaced the duplicated code from that to use the new helper procs
instead.

## Why It's Good For The Game

Anything chat related is a bad place to runtime. Some messages can take
a while to type out and to have it not display is frustrating at worst,
possibly detrimental if you have to communicate something urgently.

## Changelog

🆑
fix: fixes a bug that can cause emotes to stop working if a client is
being created or deleted
/🆑
2023-08-14 22:30:35 +02:00
Watermelon914
c2b0d9bf29 More lua harddel fixes (#77556)
## About The Pull Request
Fixes some more lua harddel problems with lingering refs on the gc_guard
variable. This variable has been changed to a list instead and will get
cleared every time the SSlua subsystem fires so that lua instantiated
objects that are not tracked by the subsystem will essentially delete
themselves on the next tick, aka whenever the lua script sleeps.

Also removed the unnecessary and not completely functional
lua_reference_cleanup proc which wasn't even being called reliably
because the signal handler was the datum itself.

## Why It's Good For The Game
Fixes more harddel bugs, increases consistency.

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2023-08-13 14:46:51 -06:00
Watermelon914
c4763f2621 Fixes some lua problems, specifically with qdeling callbacks and adds lua utility functions (#77468)
## About The Pull Request
See title. Callbacks were getting deleted in SS13.lua which is
non-ideal. They should be automatically collected by the garbage
collector.
Also adds some utility lua functions like SS13.is_valid,
SS13.stop_tracking, SS13.new_untracked, SS13.type and SS13.qdel

## Why It's Good For The Game
Fixes some harddel issues, as well as callbacks clogging up the garbage
subsystem.

## Changelog
🆑
admin: Added new lua functions: SS13.is_valid, SS13.stop_tracking,
SS13.new_untracked, SS13.type and SS13.qdel
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2023-08-10 06:45:31 -04:00
Ghom
d1880d18fc Polishing the greyscale modify menu's lackluster support for non-atom targets. (#77322)
## About The Pull Request

So, I've been recently told that Skyrat uses the greyscale modify menu
for loadouts, and the new ui state kinda borked it. I honestly haven't
taken the possibility that the target could be anything but a subtype of
`/atom` (and still work) into account because much of the code assumes
the target is an atom. It's kinda crappy. Also I hadn't noticed we've an
`unlocked` variable, which makes `vv_mode` var superflous, so i'm going
to remove the latter.
2023-08-09 12:30:33 -05:00
Watermelon914
9d61c652e3 Fixed lua-created atoms from hard deleting (#77391)
## About The Pull Request
Lua created atoms hard delete because they get added to a references
list without ever being cleared. This fixes that by registering a
qdeleting signal on them and removing them from the list on delete.

## Why It's Good For The Game
Harddel fixes

## Changelog
🆑
fix: Fixed a hard delete that would occur with lua-created atoms.
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2023-08-07 14:28:12 -04:00
LemonInTheDark
1fed91837c Adds a system for logging metadata about hard deletes (#76956)
## About The Pull Request

I'm sick of the progress bar harddel, and I've ran into this problem in
the past, so I'm just gonna do something about it

If you want to provide an individual logged bit of info about a harddel,
you can override `/datum/proc/dump_harddel_info()` and return a string
containing "whatever"

Use of this should be limited, this could potentially clutter del logs,
especially if it's used on something that fails often, like pipes

I do think it's still useful tho. It's output ingame, in the logs, and
in unit test failures. Hopefully all nicely tho I'm only really 100%
sure about in game.
2023-08-04 14:15:00 -07:00
Jacquerel
41b11f513d Improved Imaginary Friend Smite (#77331)
## About The Pull Request

By admin request:
- The Imaginary Friend smite now allows you to select "Offer to ghosts"
rather than selecting an observer mob manually.
- If you select this option you can also select to bulk-accept multiple
ghosts at a time, if you want to give people twelve imaginary friends
without having to smite them 12 times.

This necessitated changing the order of events a little bit so nwo you
choose whether they have a randomised appearance before picking a
candidate.

## Why It's Good For The Game

Makes it easier to drop the entire end of round deadchat into one guy's
brain with just a couple of clicks

## Changelog

🆑
admin: The imaginary friend smite now allows selecting "offer to ghosts"
instead of having to perform that poll yourself manually. When offering
to ghosts you can also offer for several ghosts to volunteer at the same
time.
/🆑
2023-08-04 12:29:19 -06:00
distributivgesetz
ebbc45b161 Improved PDA Direct Messenger (#75820)
## About The Pull Request

Fixes #76708, Closes #76729 (sorry Zephyr)

This PR expands the Direct Messenger UI, adding a chat screen for each
available messenger that you can find, and moving message sending over
to TGUI.

This chat screen includes a message log that displays messages sent by
you as well as messages received from the recipient. This gets rid of
the previous chat log, which just had all messages thrown together that
you received or have sent, in one big list.

Furthermore, all messaging is now done inside the UI. This kills all
TGUI popups you would ever need to send messages forever (except for
quick replies). Use the input bar on the bottom, press Enter or the Send
button, and it sends your message. Spam mode is now done in the UI too,
via a text field you can find in the contacts list.

Additionally, because I have a habit of blowing things massively out of
scope, I've also completely refactored how messages and chat logs are
stored in the PDA messenger. I plan on using this in a PR that merges
the chat client with the messenger, sometime in the future. Sorry this
took so long.

Stuff left to do before I open this PR for review:
- [x] Add "recent messages"
- [x] Add "unread messages"
- [x] Add message drafts
- [x] Make photo sending not shit
- [x] Implement the edge cases for automated and rigged messages
- [x] Make sure shit isn't fucked
- [x] Profit

<details>
  <summary>Screenshots</summary>
  

![dreamseeker_HIrEfrap5X](https://github.com/tgstation/tgstation/assets/47710522/97c713b7-dda3-44d3-a8f5-d0ec11c92668)

![qIOWhVld4l](https://github.com/tgstation/tgstation/assets/47710522/3ab4e2c1-a38f-4b20-8e9f-509ea14c0434)

![dreamseeker_LIqwi05i4O](https://github.com/tgstation/tgstation/assets/47710522/c051c791-b595-4166-a4d3-82cb7568411f)

![BIYxNVjGL7](https://github.com/tgstation/tgstation/assets/47710522/b9c97eab-52b5-449f-b00f-a0d8aa5f865c)

![dreamseeker_IWdoSsUinC](https://github.com/tgstation/tgstation/assets/47710522/2a4cd76a-2bdc-4283-b642-09e92476fef5)

![L9DxzFHDEF](https://github.com/tgstation/tgstation/assets/47710522/6a5b0e29-d535-4c7e-a88e-e9b71198719b)

![rAuDgqBLNE](https://github.com/tgstation/tgstation/assets/47710522/128a0291-91da-4f9e-9bc5-a65cf411ea6d)

![dreamseeker_voui6S8MUf](https://github.com/tgstation/tgstation/assets/47710522/6e3ba044-b8df-492d-b58d-6c73ab07233d)

![image](https://github.com/tgstation/tgstation/assets/47710522/522c1d85-b9cf-4e0e-9588-9d3993eea03f)

</details>

## Why It's Good For The Game

The UI has largely stayed the same since modular tablets were added a
year ago. Even better, direct messaging has been the same since PDAs
were first added *more than a decade ago*. Imagine that.

Now we finally actually (!) make use of those brand new features that we
got from the TGUI switch in this regard.
## Changelog
🆑 distributivgesetz
add: Updated Direct Messenger to v6.5.3. Now including brand new
individual chat rooms, proper image attachments and a revolutionary
message input field!
add: Added a "Reset Imprint" option to the PDA painter.
refactor: Refactored PDA imprinting code just a bit.
fix: PDAs should now properly respond to rigged messages.
/🆑

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
2023-08-03 14:43:31 -07:00
Ghom
7945598305 [NO GBP] Actually fixing the greyscale_modify_menu. (#77208)
## About The Pull Request
EDIT: So, I've to admit and bow my head: #77165 fucked up because I
hadn't properly tested the code. However, this time around, I can assure
you it's been tested.

## Why It's Good For The Game
Fixing my mistakes. This will fix #77246 

## Changelog
N/A.
2023-08-01 14:39:46 -07:00
OrionTheFox
025f4c4759 Updates all the icons in under/suits.dmi and related sorting/cleanup (#76865)
Somebody was pointing out how our suits varied WILDLY in quality
Figured I'd go through and tidy them up
2023-08-01 09:11:13 +00:00
MrMelbert
298b5d3719 Doubles the time you can get the "Long shift" achievement, makes it not grant on admin restarts (#77195)
## About The Pull Request

- "Long shift" can now be earned from sub 10 minute rounds rather than
sub 5 minute rounds

- Admin restarts no longer give out "Long shift"

## Why It's Good For The Game

I do not think this achievement can *possibly* be earned right now. Like
at all.

Nuke Ops and cult are the only antags that can possibly do it and it's
incredibly infeasible (requiring that they nuke the station or summon
Nar'sie in just 3 minutes!)

So I bumped up the timer to 10 minutes. This means that ops can get it
if they nuke the station in 8 minutes, cult can get it if they REALLY
speedrun, and revs can get it if they beeline the heads.

I checked the DB for stats on this achievement and it's only been earned
in 3 rounds across the last year - `208780` (admin restart due to a bug)
`192892` (admin restart due to a bug?) `186192` (admin restart).

So I also prevented admin forcing the round to end. (I don't know if it
catches admin reboots directly I'll have to check that.)

## Changelog

🆑 Melbert
balance: The "Long Shift" achievement is now feasibly obtainable, and
admins can no longer trigger it unknowingly
/🆑
2023-07-29 13:00:16 -06:00
Ghom
3ee89a7aa7 Fixing the greyscale modify menu not sanitizing inputs. (#77165)
## About The Pull Request
exactly what it reads on the tin. Also the ui is now anchored to the
target and uses their state unless a specific one is set, so that it'll
correctly close or be unusable if the mob user is incapacitated or too
far.

## Why It's Good For The Game
this will fix #70444.

## Changelog

🆑
fix: Fixing some jank with the a greyscale modify menu, like inputs not
being sanitized.
/🆑
2023-07-28 21:03:57 -06:00
Ghom
5d5492e111 Implements usage of the REVERSE_DIR macro throughout the code. (#77122)
## About The Pull Request
Replaces a ton of `turn(dir, 180)` calls with the aforementioned macro.

## Why It's Good For The Game
Afaik, `REVERSE_DIR` was coded to be faster than the classic `turn(dir,
180)` call, being a simple set of binary operations. To sum it up, micro
optimization.

## Changelog

N/A
2023-07-28 15:16:09 +02:00
san7890
ae8d72bfd6 Fixes undeleted SQL queries in IsBanned() (#77105)
Discovered while working on #76663

## About The Pull Request

We were getting undeleted SQL stack traces with the following:
`[2023-07-25 19:27:33.832] DEBUG-SQL: Undeleted query: "SELECT 1 FROM
player WHERE ckey = :ckey" LA: NextRow LAT: 39397`

There's only one spot in the code (which happens to be the newest,
introduced in #74496 / 8fc56cbda0) where
we don't always qdel the query regardless of the path the proc takes
(and that seems to match the error per the `LA` field), so let's make
sure we always clean that up since it's a drather silly runtime. It's
also rather spontaneous, as this code is only executed when servers are
bunkered up (which Sybil presently is)

This is my first time dealing with SQL Query code, so let me know if I'm
missing something critical here.
2023-07-26 18:29:22 -05:00
Time-Green
b3558f04e9 [NO-GBP] Changing shuttle events now alerts admins (#76939)
If an admin forces 10 alien queen shuttle events, you'd probably want to
alert the other admins. Previously this just put it in the admin log
without telling anyone, but it's probably more fitting to just pop it in
asay for how infrequent it is and considering forcing other events does
it too

🆑
admin: Changing shuttle events now alerts admins
/🆑

Thanks to @Rex9001 for calling it out
2023-07-26 19:47:01 +12:00
Ben10Omintrix
43737e0b4b made the bee a basic insect (#76971)
## About The Pull Request
the bee now a baisc insect he will now go to find his home and he will
go and pollinated the plants and helped the queen make children by
polliniting the plants and he will. the queen will leve the hive more
rarely than the normal bees so she can stay in the hive to make kids

## Why It's Good For The Game
the bee now is a basic insect so it means he have a better ai

## Changelog
🆑
balance: the bee now can fly over the machines so its easy for him to go
to the hydroponics machine
fix: player bees now will not be stuck inside the hive if he entered it,
they can now leave it
fix: fixed a har deleted when the hive is deleted all the bees still
have a refence to the hive now its fixed
fix: now when a player interacted with the bee hive the bees will now
leave the hive to defend the hive (it was glitched)
refactor: the bees now are a basic insect.
/🆑
2023-07-23 22:22:14 -06:00
thebleh
99d5ae2d13 Fix APC related issues (#77005)
## About The Pull Request
Fixes a bunch of stuff broken by #76822, including APC control console,
malf blackout ability, shunted malf pinpointing, Admin APC recharge and
others.
## Why It's Good For The Game
Yes.
## Changelog
:cl:Thebleh
fix: Fixed several APC related issues.
/🆑
2023-07-22 17:16:22 +02:00
LemonInTheDark
41f20bc3ce [MDB IGNORE] Angled Lights & Lighting Prototyping Tool (#74365)
## About The Pull Request

Hello friends, I've been on a bit of a lighting kick recently, and I
decided I clearly do not have enough things to work on as it is.
This pr adds angle support to static lights, and a concepting/debug tool
for playing with lights on a map.

Let's start from first principles yeah?

### Why Angled Lights?

Mappers, since they can't actually see a light's effect in editor, tend
to go off gut.
That gut is based more off what "makes sense" then how things actually
work
This means they'll overplace light sources, and also they tend to treat
lights, particularly light "bars" (the bigger ones) as directional.
So you'll have two lights on either sides of a pillar, lights inside a
room with lights outside pointing out, etc.


![image](https://user-images.githubusercontent.com/58055496/228785032-63b86120-ea4c-4e52-b4e8-40a4b61e5bbc.png)

This has annoying side effects. A lot of our map is overlit, to the
point that knocking out a light does.... pretty much nothing.
I find this sad, and would like to work to prevent it. I think dark and
dim, while it does not suit the normal game, is amazing for vibes, and I
want it to be easier to see that.

Angled lights bring how lights work more in line with how mappers expect
lights work, and avoids bleedover into rooms that shouldn't be bled
into, working towards that goal of mine.

### How Angled Lights?

This is more complex then you'd first think so we'll go step by step


![image](https://user-images.githubusercontent.com/58055496/228786117-d937b408-9bc2-4066-9aee-aae21b047151.png)

Oh before we start, some catchup from the last time I touched lighting
code.
Instead of doing a lighting falloff calculation for each lighting corner
(a block that represents the resolution of our lights) in view we
instead generate cached lightsheets. These precalculate and store all
possible falloffs for x and y distances from a source.

This is very useful for angle work, since it makes it almost totally
free.
 
Atoms get 2 new values. light_angle and light_dir
Light angle is the angle the light uses, and light_dir is a cardinal
direction it displays in

We take these values, and inside sheetbuilding do some optional angle
work. getting the center angle, the angle of a pair of coords, and then
the delta between them.
This is then multiplied against the standard falloff formula, and job
done.

We do need some extra fenangling to make this all work nicely tho.

We currently use a pixel turf var stored on the light source to do
distance calculations.
This is the turf we pretend the light source is on for visuals, most
often used to make wall lights work nice.
The trouble is it's not very granular, and doesn't always have the
effect you might want.

So, instead of generating and storing a pixel turf to do our distance
calculations against, we store x and y offset variables.
We use them to expand our working range and sheet size to ensure things
visually make sense, and then offset any positions by them.

I've added a way for sources to have opinions on their offsets too, and
am using them for wall lights.
This ensures the angle calculations don't make the wall behind a light
fulldark, which would be silly.

### Debug Tool?

In the interest of helping with that core problem, lights being complex
to display, I've added a prototyping tool to the game.
It's locked behind mapping verbs, and works about like this.

Once the verb is activated, it iterates over all the sources in the
world (except turfs because those are kinda silly), outlining and
"freezing" them, preventing any future changes.
Then, it adds 3 buttons to the owners of a light source.

![image](https://user-images.githubusercontent.com/58055496/228776539-4b1d82af-1244-4ed6-8754-7f07e3e47cda.png)
The first button toggles the light on and off, as desired.
The third allows you to move the source around, with a little targeting
icon replacing your mouse
The second tho, that's more interesting.

The second button opens a debug menu for that light

![image](https://user-images.githubusercontent.com/58055496/228777811-ae620588-f08a-4b50-93a0-beea593aea77.png)
There's a lot here, let's go through it.

Bit on the left is a list of templates, which allow you to sample
existing light types (No I have no idea why the background is fullwhite,
need to work on that pre merge)
You can choose one by clicking it, and hitting the upload button.

This replaces your existing lighting values with the template's,
alongside replacing its icon and icon state so it looks right.
There are three types as of now, mostly for categorization. Bar, which
are the larger typically stronger lights, Bulb, which are well, bulbs,
and Misc which could be expanded, but currently just contains floor
lights.

Alongside that you can manually edit the power, range, color and angle
of the focused light.
I also have support for changing the direction of the light source,
since anything that uses directional lighting would also tie light dir
to it.
This isn't *always* done tho, so I should maybe find a way to edit light
dir too.

My hope is this tool will allow for better concepting of a room's
lights, and easier changing of individual object's light values to suit
the right visuals.

### Lemon No Why What

Ok so I applied angle lights to bars and bulbs, which means I am
changing the lighting of pretty much every map in the codebase.
I'm gonna uh, go check my work.

Alongside this I intend to give lighting some depth. So if there's room
to make a space warmer, or highlight light colors from other sources, I
will do that.

(Images as examples)

![image](https://user-images.githubusercontent.com/58055496/228786801-111b6493-c040-4199-ab99-ac1c914d034c.png)

I also want to work on that other goal of mine, making breaking lights
matter. So I'll be doing what I can to ensure you only need to break one
light to make a meaningful change in the scene.

This is semi complicated by one light source not ever actually reaching
fullbright on its own, but we do what we must because we can.


![image](https://user-images.githubusercontent.com/58055496/228786483-b7ad6ecd-874f-4d90-b5ca-6ef78cb70d2b.png)

I'm as I hope you know biased towards darker spaces, I think contrast
has vibes.
In particular I do not think strong lights really suit maintenance. 

Most of what is used there are bulbs, so I'm planning on replacing most
uses with low power bulbs, to keep light impacts to rooms, alongside
reducing the amount of lights placed in the main tunnels


![image](https://user-images.githubusercontent.com/58055496/228786594-c6d7610c-611e-478b-bcba-173ebf4c4b12.png)

**If you take issue with this methodology please do so NOW**, I don't
want to have to do another pass over things.
Oh also I'm saving station maps for last since ruins are less likely to
get touched in mapping march and all.

### Misc + Finishing Thoughts

Light templates support mirroring vars off typepaths using a subtype,
which means all the templates added here do not require updating if the
source type changes somehow. I'd like to expand the template list at
some point, perhaps in future.

I've opened this as a draft to make my intentions to make my changes to
lights known, and to serve as motivation for all the map changes I need
to do.

### Farish Future

I'm unhappy with how we currently configure lights. I would like a
system that more directly matches the idea of drawing falloff curves,
along with allowing for different falloffs for different colors,
alongside extending the idea to angle falloff.
This would make out of engine lighting easier, allow for nicer looking
lights (red to pink, blue to purple, etc), and improve accessibility by
artists.

This is slightly far off, because I have other obligations and it's
kinda complicated, but I'd like to mention it cause it's one of my many
pipedreams.

## Changelog
🆑
add: Added angle lighting, applies it to most wall lights!
add: Adds a lighting prototyping tool, mappers go try it out (it's
locked behind the mapping verb)
/🆑

---------

Co-authored-by: MMMiracles <lolaccount1@hotmail.com>
2023-07-19 04:39:55 +00:00