Commit Graph

429 Commits

Author SHA1 Message Date
san7890
3415828c6b Refactors Revenants into Basic Mobs (#78782)
## About The Pull Request

I felt bad about taking all the "easy" ones, so let's change it up with
a decently difficult one. Revenants are now basic mobs! This alone
doesn't change much of anything because it pretty much overrode much of
simple_animal code. However we do a few new things.

* Multiple code improvements! No more weird proc names that aren't
`snake_case`, cleaner variable names, more dmdoccing, etc.
* Files are now reorganized, Rather than a 800-line dogshit monofile,
we're all nice now
* Multiple logic improvements, like early returns to make stuff more
readable and the like. many `isnull()` yes
* Instead of abusing key ownership logic, we use `mind.transfer_to()`
instead for much cleaner behavior when we need to change stuff
* Instead of iterating over the entire list of mobs to find dead mobs,
we use a new `revenant_relay()` system that automatically handles
broadcasting revenant messages to all observers and fellow revenants
(like `blob_talk()`)
* Instead of having a weird invisible "corpse", we move the revenant
inside the actual ectoplasm when they die. This drastically simplifies a
lot of wacky code that was completely useless since we still had the mob
to work with, but now it's a lot cleaner when it comes down to it.
* Some more hooks into stuff like `Life()` that might be useful for
other people in the same way this is.
* Less <span> crap, more macros, wahoo
* Uses an `examine_block()` for when we relay instructions to new
revenants. also cache those instructions to save time in the long run
* Revenants being stunned, inhibited, and revealed are now managed by
status effects rather than being chicanery on `Life()`
* Everything should now just in general be a lot nicer to work with.
This list is not exhaustive but a lot of the junk 7-year-old code has
been gutted and replaced with the modern standards.

There are stuff that I explicitly didn't touch and will not be touching
in this PR as it's already rather large.
* Revenant actions. I touched some proc names but I didn't alter the key
ways they work.
* Revenant movement. That's another can of worms.
* Revenant event code. I just made it use the transfer to system to make
a closed loop and that's about it.
* Revenant AI. They don't have any, it's an event/admin spawn. I'm not
adding AI here.
## Why It's Good For The Game

Revenants are more extensible now rather than being a real big
clusterfuck of bullshit, should be much easier to tweak stuff here and
there or logically follow how the code for this fella should go. The
number of weird revenant bugs should go down since we do stuff more
simply- but there could be some sleeper bugs that can bite us.
## Changelog
🆑
refactor: Revenants, the mob that's split between planes of Life and
Death, have been refactored into a basic mob. While this alone shouldn't
touch behavior, a lot of the backend code has been gutted and refactored
to try and furnish a better antagonist experience. This might mean that
some weird stuff can come up and around, report something if it's
utterly broken.
code: In order to better facilitate some code, you do not ghost outside
of a revenant on death, you simply get transferred into the ectoplasm.
You should still be able to speak with your ghost friends on how hard
you got wrecked or if you'll be able to resurrect though.
code: The timing on revenant stuff such as being revealed, stunned, and
inhibited (by holy weapons) should be tweaked a bit to allow better
management. This should mean that getting unstunned and such should be a
bit more precise now.
qol: Revenant instructions are now relayed in a neat little examine
block.
/🆑
2023-10-09 23:15:20 +01:00
Tim
d6f79f4427 Refactor gib code to use bitflags and have documentation (#78754)
## About The Pull Request
This takes all the gib related procs:
- `gib()`
- `spawn_gibs()` 
- `spill_organs()`
- `spread_bodyparts()`

And adds heavy documentation that communicates what the procs are used
for and how the different bitflags affect them. The difference is
noticeable:

`gib(TRUE, FALSE, FALSE, null)` vs `gib(DROP_ORGANS|DROP_BODYPARTS)`

The code is now much more legible which is important considering it's
used in a lot of places!

Another robust change, is that we had several places in the code where
there were double negatives like so:

```
/mob/living/carbon/spill_organs(no_brain, no_organs, no_bodyparts)
	if(!no_bodyparts) // DOUBLE NEGATIVES ARE BAD M'KAY?!?
		// do stuff here
```

This is a mindfuck to untangle. I inverted a lot of these parts so we
don't lose our sanity.

Last thing that was changed was a big `if()` loop in the `spill_organ()`
proc. This was refactored to just be a simple `for` loop with `continue`
statements where we needed to skip enabled bitflags. It's now shorter
and cleaner than before.

The only slight gameplay change this affects is that gibbing a mob now
guarantees to drop all items unless the `DROP_ITEMS` bitflag is
deliberately omitted. Some places like admin gib self, we don't want
this to happen.

## Why It's Good For The Game
Gib code is very old. (~15 years) People kept adding more arguments to
the procs when it should have been a bitflag initially. By doing it this
way, there is more flexibility and readability when it comes to adding
new code in the future.

## Changelog
🆑
refactor: Refactor gib code to be more robust.
qol: Gibbing a mob will result in all items being dropped instead of
getting deleted. There are a few exceptions (like admin gib self) where
this will not take place.
/🆑
2023-10-06 13:12:22 +01:00
Bloop
68b798efa0 A thorough audit of damage procs and specifically their use in on_mob_life() (with unit tests!) (#78657) 2023-10-03 04:01:32 -04:00
Ghom
db8eca7bf3 The fishing portal generator expansion (plus skill-chip) (#78203)
## About The Pull Request
This is a PR I worked on last month, but had to put on hold while
dealing with some pressing issues with fishing feature, minigame and
other stuff, and because I had to atomize out some of the stuff
previously present here.

I've expanded on the fishing portal generator to do something other than
dispense guppies and goldfishes. It now has multiple settings,
unlockable by performing scanning experiments for fish types, available
from the get go, which also reward a meager amount of techweb points
upon completion. The generator can now be built too. No longer it has to
be ordered from cargo.
It can also be emagged for the syndicate setting, tho right now it only
dispenses donkfish and emulsijack, both otherwise impossible to get
outside of... exodrone adventures.

The advanced fishing rod now comes with an experiment handler component,
specific to the fish scanning experiment, that automatically scans
fished content. The node to get it now requires 2000 points and the
first fish scanning exp to be unock.

A new skillchip has been added, which adds a trait that changes the icon
of the fish shown in the minigame UI, giving some clues on what the
reward will be. The same trait is also gained by reaching the master
(penultimate) level of the fishing skill.

A new fish type has been added, with its own quirks. One of these quirks
included temporarily switching movement direction of the bait.
Currently, it can only be fished in the hyperspace and randomizer
setting of the fishing portal.

Screenshots:
![fuck
yea](https://github.com/tgstation/tgstation/assets/42542238/b4c75951-fa07-44ae-99ee-f602adf8a5a4)

![radial](https://github.com/tgstation/tgstation/assets/42542238/68ff21d8-69fd-4ba5-aa58-9976b6e3282f)

## Why It's Good For The Game
The fishing portal generator is but a stale and underdeveloped prototype
of the fishing feature right now, so much I was thinking of removing it
at first. However, we also have a lot of fishes which are pretty much
unfishable, so I came up with the idea of adding new portal settings
that allow people to actually get them.

As for the skillchip and trait, it's but an extra to both the vending
machine in the library and the fishing skill itself, which has an
overall humble impact on the minigame.

## Changelog

🆑
add: Expanded the fishing portal generator. It now comes with several
portal options that can be unlocked by performing fish scanning
experiments, which also award a modest amount of techweb points.
balance: The fishing portal generator is now buildable and no longer
orderable. The board can be printed from cargo, service and science
lathes.
balance: Advanced fishing tech is no longer a BEPIS design. It now
requires the base fish scanning experiment and 2000 points to be
unlocked.
add: The advanced fishing rod now comes with an incorporated
experiscanner specific for fish scanning.
add: Added a new skillchip that may change the icon of the "fish" shown
in the minigame UI to less generic ones. Reaching master level in
fishing also does that.
qol: The experiment handler UI no longer shows unselectable experiments.
/🆑
2023-10-01 04:11:55 +01:00
Sealed101
d93dfbc35c Adds Summon Cheese (#77778)
oh apparently this is my 100th PR on tg, which is weird because github
reports 99 total, and i made at least one to the old voidcrew repo, and
filtering tg prs by my name still shows 99. weird. here's to 100 more i
guess?

<sub>could have been better if it was a get, jhonflupwliiard watch ur
back 🔫 </sub>

## About The Pull Request

Adds a new spell granter book to the Wizard's Den - Summon Cheese, which
grants the spell by the same name, which summons 9 heads of cheese.
That's about it, I think.

## Why It's Good For The Game

Wizards are a hungry bunch, so why can't they just summon food? They can
even share, if they'd like, since the notion of a friendly wizard still
exists

<details>
<summary>... </summary>

alright fine
i'm slightly malding over not getting the 77777 get so no more
roleplaying in the pr body

Wizard Grand Ritual now has a hidden goal of sacrificing 50 cheese
wheels. Sacrificing a cheese wheel is done with invoking the grand rune,
and each invocation/pulse of the rune will whisk away more cheese until
all cheese on the rune is taken by whichever entity lurks in the other
realm. The sacrifice will be hinted at in an _ancient parchment_ which
will be on the bookshelf (when i add it lmao) alongside the spell book.

Meeting this cheese goal will lock the wizard's grand finale rune and
grand finale effect to special ones. The cheese rune is mostly identical
to the normal grand rune, barring the custom sprites/animations.
The cheese finale consists of the wizard getting permanent Levitation
(nogravity + free space movement), a 0.5 modifier(reducing incoming
damage in half) to every damage type, a comically strong mood buff and
**The Wabbajack**(separate sprite pending) - a juiced up chaos staff
which can fire a lot more projectiles than a normal one can (it will get
more, I may even make a few just for it).
Everybody else (including any invader antags) gets hallucinations, 175
brain damage and a comically strong mood debuff, as well as a vendetta
against the wizard. If the victim was already suffering from
hallucinations from a trauma (including the quirk), they are instead
healed.

if you didn't catch the obvious reference, this entire shtick is a
tribute to Sheogorath. the rune makes use of daedric script, and most of
the catchphrases are a direct quotation of the Daedric Prince of
Madness, so if any of those things can get us in trouble somehow, let me
know. i will be sad but i will comply.

This shtick is intended as an easter egg, really, so I wasn't really
planning on expanding the wizard grand finale into heretic paths thing
or whatever.

Oh, and finale grand runes now allow the wizard to select the effect
even if it's time-gated. If it is, you just won't be able to invoke it
until the time comes. The rune will tell you how much time is left until
you can invoke it. And grand finale runes with a finale effect selected
also glow in the color of their effect. I also think I fixed some step
of the grand rune animation not triggering but I'm not sure.

<details><summary>Some rune animations (some are subject to
change)</summary>


![rune_cheese_activate](https://github.com/tgstation/tgstation/assets/75863639/62ae184d-b6fc-4883-a169-4d8ca7636b40)


![rune_cheese_flash_2](https://github.com/tgstation/tgstation/assets/75863639/619545c8-3c55-4264-bfa4-d40067ef7406)


</details> 

## Why It's Great For The Game

it's funny

</details> 

## Changelog


🆑 Sealed101, EBAT_BASUHA for spritework
add: Wizard's Den now has a book of Summon Cheese in the Studies Room
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-08-31 10:31:33 -06:00
Andrew
2d34c7433a New Mech UI and equipment refactor (#77221)
![bWJlVIDO53](https://github.com/tgstation/tgstation/assets/3625094/d75030b5-59e9-43f6-96b4-1b7564caceef)

## About The Pull Request

Made a new UI and refactored some mech code in the process.

Fixes #66048
Fixes #77051
Fixes #65958 ??? if it was broken
Fixes #73051 - see details below
Fixes other undocumented things, see changelog.

## Why It's Good For The Game

The UI was too bulky and Mechs were too complex for no reason. 
Now they follow some general rules shared between other SS13 machinery,
and there is less magic happening under the hood.

## Detailed Changes

### New Mech UI, Air Tank and Radio as separate modules

Previous UI for comparison:

<img alt="9SScrXAOjy"
src="https://github.com/tgstation/tgstation/assets/3625094/904e3d07-e7d7-4d3a-a062-93e0e35b4b66">

Previously mechs came with radio pre-installed and air canisters
magically pre-filled with air even when you build one in fab.
Radio and Air Tanks are now both utility modules that are optional to
install. Gas RCS thrusters still require Air Tank module to operate.

This made the Mechs more barebones when built, giving you only the basic
functionality.

<img alt="5SDMlXTJxv"
src="https://github.com/tgstation/tgstation/assets/3625094/b9364230-49ac-416b-aa70-e851fbf2050e">

To compensate this change, all mechs got two extra utility module slots.

All other modules got new UI. And ore box now shows the list of ores
inside.

<img alt="SRX5FjvsHA"
src="https://github.com/tgstation/tgstation/assets/3625094/cbe2e98d-1cd4-4667-8dae-2f9227b4b265">

### Mounted Radio

Works as a normal radio, but with subspace transmission. Available from
the basic mech research node and can be printed in fab.

### Cabin Sealing

To compensate for the lack of air tank by default, mechs with enclosed
cabin (e.g. all except Ripley) got an ability to toggle cabin exposure
to the outside air. Exiting the mech makes cabin air automatically
exposed.

When you seal the cabin, it traps some of the outside air inside the
cabin and you can breathe with this air to perform a short space trips.
But the oxygen will run out quickly and CO2 will build up.

Sealing the cabin in space will make the cabin filled with vacuum, and
it will stay there until you return to air environment and unseal the
cabin, letting the breathable air to enter. There are temperature and
pressure sensors that turn yellow/red when the corresponding warning
thresholds are reached.

You could also use personal internals in combination with cabin sealing
for long space travels, so Air Tank is completely optional now and
mostly needed when you need RCS thruster.

### RCS thrusters

They are now available earlier in tech tree and consume reasonable
amount of air (5 times more than human jetpacks), and they don't work
without Mounted Air Tank, unless it's an Ion thruster variant.

### Mounted Air Tank

Available from the basic mech research node and can be printed in fab.
Built model comes empty, and syndicate mechs come with one full of
oxygen.

<img alt="GrFDrH5Hwe"
src="https://github.com/tgstation/tgstation/assets/3625094/b677b705-bda0-4c8c-96c7-d32bf7bf9f28">

Can be switched to pressurize or not pressurize the cabin. Releases gas
only when the cabin is sealed shut. Starts releasing automatically, but
can be toggled to not release if you want to use it just as a portable
canister.

Cabin pressure can now be configured in the module UI instead of
Maintenance UI.

Can be attached to a pipe network when the mech is parked above a
connection port.

Comes with a pump that works similarly to the portable pump. It lets you
vent the air tank contents outside, or suck air from the room to fill
the air tank. Intended to provide an ability to fill the air tank
without the need to bother with pipes.

Also has gas sensors that display gas mix data of the tank and the cabin
(when sealed).

### Stock part changes

All mechs now require a servo motor and they reduce mech movement power
consumption instead of scanning module.

Scanning modules are optional for mech operation (still required to
build) and the lack of one disables the following UI elements:

- Display of mech integrity (you can still see the alerts or examine the
mech to get rough idea)
- Display of mech status on internal damage (and you can't repair what
you can't diagnose)

The rating of scanning module doesn't have any effect as of now.

Cargo mech comes without it roundstart.

<img alt="2vDtt99oqb"
src="https://github.com/tgstation/tgstation/assets/3625094/147144ca-824e-4501-acf5-6ee104f309e7">

Capacitors now also reduce light power usage and raise the overclocking
temperature thresholds (see below).

### Maintenance

Maintenance UI removed, and its logic migrated to other places.

Access modification now managed inside the mech, and anyone who can
control the mech, can adjust the access in the same way as they can set
DNA key.

To open the maintenance panel you just need a screwdriver. It is instant
when the mech is empty and it has a 5 second delay when there is an
occupant to avoid in-combat hacking and part removal. It will alert the
occupant that someone is trying to tinker with their mech.


![image](https://github.com/tgstation/tgstation/assets/3625094/1abfca3c-8ba9-44b0-913c-c209564b91fd)

Once the panel is open, you can see the part ratings:


![image](https://github.com/tgstation/tgstation/assets/3625094/404f95bb-9f74-4e5b-a975-5ab6f74bdfa9)

With open panel you can hack the mech wires (roboticists can now see
them):

<img alt="mj205G2qDa"
src="https://github.com/tgstation/tgstation/assets/3625094/44cea0d1-44b4-4b50-b1d3-a97c0056bab3">

There are wires for:
- Enabling/Disabling ID and DNA locks
- Toggling mech lights
- Toggling mech circuits malfunction (battery drain, sparks) 
- Toggling mech equipment malfunction (to repair after EMP or cause
EMP-like effect, disarming mech)
- 3 dud wires that do nothing

The hacker may be shocked if the mech power cell allows.

When the panel is open and the user has access to the mech, they can
remove parts with a crowbar:

<img alt="jR40gyTWtJ"
src="https://github.com/tgstation/tgstation/assets/3625094/b573f5b9-b8ea-412e-b3e0-c872e01e0c23">

Hitting the mech with an ID from outside now toggles the ID Lock on/off
if the ID has sufficient access.

### Power consumption and overclocking

Rebalanced mech power consumption. T4 parts were not working in
Syndicate Mechs, as their effect was not calculated until you manipulate
parts manually. Constructed mechs with t1 parts even had their energy
drain reduced with upgrade to t1.

Now all mechs apply their base step power usage correctly don't ignore
the stock parts.

Servo tier now reduces base power consumption by 0% at t1, 50% at t2,
33% at t3 and 25% at t4
Capacitor tier now reduces base power consumption of mele attacks,
phasing and light by the same amounts.

Gygax leg actuators overload replaced with mech overclocking. Any mech
can be overclocked by hacking wires, but only Gygax has a button for
toggling it from the Cabin.

Now there is an overclock coefficient. 1.5 for Gygax and other mechs, 2
for Dark Gygax.

When overclocked, mechs moves N times faster, but consumes N times more
power.


![image](https://github.com/tgstation/tgstation/assets/3625094/01e285fd-6fd6-4558-8277-2ed3abf474d8)

While overclocked, mech heats up every second, regardless of movement,
and starts receiving internal and integrity damage after a certain
temperature threshold. The chance is 0% at the threshold, and 100% at
thresholds * 2. The roll happens every tick. Capacitor upgrades this
threshold, letting you overclock safely for longer periods.


![image](https://github.com/tgstation/tgstation/assets/3625094/80d90cea-0d20-4054-9369-a47deb6f52f2)

When you stop overclock, the temperature goes back down.

### Other changes and fixes

Concealed weapon bay now doesn't show up when you examine the mech, so
it's actually concealed now.

New radio module can properly change its frequency, as it didn't work
for previous radio.

Launcher type weapons were ignoring cooldowns and power usage, so you
could spam explosive banana peals, while they should have a 2 second
cooldown:
<img alt="q5GjUsHwGr"
src="https://github.com/tgstation/tgstation/assets/3625094/d102725d-e9e1-4588-9d6c-b9e38b7a6535">

Now this is fixed and all launcher type weapons properly use power and
have their cooldowns working.
And now they have the kickback effect working (when it pushes you in the
opposite direction in zero gravity on throw).

Thermoregulator now heats/cools considering heat capacity instead of
adding/reducing flat 10 degrees. So you can heat up cabin air quicker if
the pressure is low.

There were some other sloppy mistakes in mech code, like some functions
returning too early, blocking other functionality unintentionally. Fixed
these and made some other minor changes and improvements.

## Changelog

🆑
refactor: Refactored Mech UI
refactor: Refactored mech radio into a utility module, adding extra slot
to all mechs
refactor: Refactored mech air tank into a utility module with an air
pump, adding extra slot to all mechs
refactor: Refactored mech cabin air - there is now a button to seal or
unseal cabin to make it airtight or exchanging gases with the
environment
refactor: Removed mech maintenance UI Access is set in mech UI, and
parts are ejected with a crowbar
add: Mech now has wires and can be hacked
qol: Roboticists now can see MOD suit and mech wires
add: Mechs now require servo motor stock part and it affects movement
power usage instead of scanning module
add: Scanning module absence doesnt block mech movement and hides some
UI data instead. Big Bess starts without one.
qol: Hitting mech with ID card now toggles ID lock on/off if the card
has required access
fix: Fixed concealed weapon bay not being concealed on mech examine
fix: Fixed mech radio not changing frequency
fix: Fixed mech launcher type weapons ignoring specified cooldown
fix: Fixed mech launcher type weapons not using specified power amount
fix: Fixed mech temperature regulator ignoring gas heat capacity
fix: Fixed mech stopping processing other things while not heating
internal air
fix: Fixed mech being able to leave transit tube in transit
fix: Fixed mech internal damage flags working incorrectly
fix: Fixed Gygax leg overloading being useless
fix: Fixed mechs ignoring their stock parts on creation. Syndicate mechs
now stronger against lasers and consume less energy on move. Upgrading
from tier 1 to tier 2 doesn't make mech consume MORE energy than before
the upgrade.
balance: Rebalanced mech energy drain with part upgrades. Base energy
drain reduced by 50%, 33%, 25% with upgrades and applies to movement
(Servo rating), phasing, punching, light (Capacitor rating).
balance: Hydraulic clamp now can force open airlocks
balance: Made mech RCS pack consume reasonable amount of gas
code: Fixed some other minor bugs and made some minor changes in the
mech code
/🆑

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: Sealed101 <cool.bullseye@yandex.ru>
Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-08-15 18:02:28 +01:00
MrMelbert
c92d338dad Refactors chameleon actions, Adds chameleon outfit saving, Adds chameleon scanner (#77140)
## About The Pull Request

- Refactors chameleon actions a good bit, reducing a lot of the
boilerplate copied around chameleon items.
- I noticed that the EMP comsig completely disregarded any EMP
protection the mob might have. I split the comsig into
`COMSIG_ATOM_PRE_EMP_ACT` and `COMSIG_ATOM_EMP_ACT` - the former now
used to aggregate protection flags and the latter to actually do EMP
stuff.
- As a result of above, this fixes a few oversights in which things
using `COMSIG_ATOM_EMP_ACT` disregarded EMP protection.

- Adds Chameleon Outfit saving. 
- RMB clicking the "Select Chameleon Outfit" will now save your current
chameleon setup as a custom outfit. They become selectable as any other
outfit afterwards.
- Because it might be *too* easy to bamboozle people / might make people
think you're a ling, I added a slight "animation" to swapping whole
chameleon outfits. It's less than a second long.

- Adds the Chameleon Scanner.
- The chameleon scanner is, surprise, a chameleon item that can disguise
as small gadgets or items (toys, cameras, analyzers, etc).
- On LMB, the chameleon scanner will copy the outfit of the target to a
custom outfit slot, allowing you to mimic them entirely without going
through all the menus.
- RMB does the same, but instantly equips the disguise you select in
addition to saving it to a slot.

## Why It's Good For The Game

Right now traitor stealth is very capable but cumbersome, which makes it
much less appealing than just running and gunning.

One big problem with it is that the chameleon kit is rather time
consuming to use. You have to sort through hundreds of items for each of
your chameleon items to find exactly the one you need.

These items seek to amend that time gate, allowing for much quicker
swapping between disguises or picking up the disguise of someone you
kill to replace them like a pseudo-changeling.

## Changelog

🆑 Melbert
refactor: Refactored chameleon actions a fair bit
add: Adds outfit saving to chameleon clothes. RMB the "chameleon outfit"
action to save your current chameleon setup for quick swapping.
add: Swapping between chameleon outfits now has a slight "animation"
associated, to distinguish traitors from lings slightly.
add: Adds a new chameleon item, the "Chameleon Scanner". Use it on other
crewmembers to stealthily save their current outfit as a custom outfit
to use later. And of course, it's chameleon too.
fix: Ethereals, the DNA lock mod, GPSs, and storage items now respect
EMP protection
/🆑
2023-07-29 15:39:06 -06:00
itseasytosee
bb0f042861 Buffs the Syndicate Tome (#76733)
## About The Pull Request

Betcha forgot this item even existed huh?
Well the wiki page about it is wrong, and its been pretty much untouched
since its implementation so i'll tell you what it does do before I tell
you about the buff.
So, the syndicate tome is a 5tc traitor item that functions as a bible.
It also has a very high force of 18 burn, and you hurt people with it
instead of healing them with in on harm intent. Because normally only
chaps can use the bible, the first person to use the bible inhand can
"bind" to it which deals 5 damage, gives them the priest trait, and adds
their true name to the item's description.

Now, it also functions like a nullrod, granting anti-magic and allowing
the clearing of heretic/cult runes.

## Why It's Good For The Game

When this thing was introduced magic could hardly even exist in the same
round as a traitor. But in the world of dynamic, we have antag on antag
interactions all the time. This gives traitors the opportunity to go
anti-cultist/anti-wizard/anti-heretic if they wish, and at a cost.
2023-07-17 12:34:23 -05:00
nikothedude
ccf547c142 Adds an extra malf AI ability: Remote emagging. Also tidies up emag code and coverts a lot of things to balloon alerts (#76669)
## About The Pull Request

New malf AI upgrade

Remote safety overrides: Mid-cost, Mid-supply. Allows the AI to remotely
emag things it can see and can access.
1. Very useful for psychological warfare (Emagging APCs to throw the
crew off their trail)
2. Logically makes sense - why, of all things, can the AI not emag
anything when it's fundumentally integrated with the station's
electronics?
3. Generally speaking can only access things that make sense for it to
access - it cannot emag ethereals, sadly

In order for this to work, emag_act now returns a boolean, designating
if the emag had any effect.
While I was in there, I also added args to every single emag_act I could
find and added far more feedback/converted a lot of things to balloon
alerts to allow the AI to see if its emag had any effect.
## Why It's Good For The Game

It just makes sense that the AI, the most electronically-sensitive
entity in the game, would be able to emag things. Plus, more options
given to malf that aren't strictly MURDER KILL MURDER are always a plus,
especially if they allow for fancier plays.
## Changelog
🆑
add: New malf ability: Remote safety overrides. Allows the AI to
remotely emag things it has access to.
code: emag_act() now returns a boolean designating it's success in
emagging
code: All instances of emag_act() now have the proper arguments
qol: Most usecases of emagging now have some kind of feedback, and
existing feedback has been sanity checked and converted to balloon
alerts.
/🆑
2023-07-15 15:35:14 +01:00
YesterdaysPromise
fb10121022 Icons folder cleaning wave two (#76788)
## About The Pull Request

Further continous organizing and cleaning the Icons folder. There are
still some minior nitpicks left to do, but I reached my daily sanity
expenses limit again, and the faster these get in the less issues for
both me and others later. Also cleans some mess I caused by my blindness
last PR.

## Why It's Good For The Game

Saner spriters = better sprites
2023-07-14 18:36:41 +00:00
Jacquerel
e2de2046b5 Bibles, Lighters, and Cowboy Hats can block bullets (#76521)
## About The Pull Request

If you are wearing a bible or lighter in your suit slot, or a cowboy hat
on your head, there is a small (2%) chance that bullets (only bullets,
not lasers) will hit them instead of you.
This destroys lighters, removes the storage capacity of the bible, or
sends the hat flying off your head.

The Bounty Hunter's cowboy hat has a significantly higher chance to
intercept bullets.

## Why It's Good For The Game

Adds some fun flavour to these items.

## Changelog

🆑
add: A bible or lighter in your suit slot, or cowboy hat on your head
will occasionally intercept a bullet.
/🆑
2023-07-07 18:36:04 +08:00
ChungusGamer666
82cf9ea499 Removes shitty "status" variable on organs, makes them use organ_flags instead (#76350)
## About The Pull Request

Title.

## Why It's Good For The Game

Seriously this shit pisses me off, why are ORGAN_SYNTHETIC and
ORGAN_ROBOTIC two different things?

## Changelog

not applicable unless i fucked up

---------

Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
2023-06-29 21:09:55 +00:00
kate
868bfe4d63 Library barcode scanner resprite & unique sound effects (#76182)
## About The Pull Request

Resprites the barcode scanner & adds unique sounds for switching modes &
scanning books
## Why It's Good For The Game

This Pr was a labor of love. I love playing curator and thought the
scanner could use some sounds and then thought it could benefit from a
new sprite
## Changelog
🆑
sound: Adds unique sounds to library barcode scanner
image: Removes soul from library
/🆑

https://github.com/tgstation/tgstation/assets/97811257/3ee693a4-7a75-46c5-aa58-66a870e83357
2023-06-25 12:39:29 -07:00
John Willard
5509c32ced Improves some confusing aspects of the Library (#75781)
## About The Pull Request

The barcode scanner now uses balloon alerts and only has 2 modes: check
in and add to inventory. It used to have 4, 2 of which were useless.

Added a title and author to chuuni granter so it's not broken to the
Curator's console. Moves inventory ui data stuff to ui static data so we
can reference it in checkout, which now uses a dropdown list of all
books in checkout, instead of having you fill out the name of the book
yourself.

Removes sending things to a computer by scanning a book then connecting
it to a computer. Just connect it to a computer first, there's no need
for this copy and paste stuff.

Finally, lets the book bag hold posters, since the Curator prints them
and it would be nice if they can also carry them without filling a bag.

Video was taken before the balloon alert stuff so just ignore that part

https://github.com/tgstation/tgstation/assets/53777086/e78011af-fb23-4553-a92d-f3dcc8bb5601

## Why It's Good For The Game

The library is currently very confusing for new people to figure out, I
thought this might be able to help with that.
The dropdown in the UI now means it's easier to give out books in
inventory, and you can no longer just type whatever the hell you wanted.

## Changelog

🆑
qol: The Curator's barcode scanner has been simplified into 2 modes:
check-in and add to inventory.
qol: The Book bag can now hold posters.
ui: The library console can now lend books out easier with a dropdown
menu to all inventory books.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2023-06-17 00:34:17 -07:00
LemonInTheDark
57ef596898 Admin Library Moderation (in-game edition) (#75645)
For the longest time, the only way admins could moderate the library was
by using statbus's external tool.
But a few months back statbus went down, and ever since then they've
been sitting lost. Shit sucks.

The whole external thing has been bugging me for a while, so let's fix
all that yeah?

This pr adds a new verb to the admin tab that allows admins to
ban/restore books from the library.
It includes expanded (ckey) search, faster response times, in tool book
viewing with and without markdown rendering, and viewing of deleted
books.

This is accomplished with a special subtype of library consoles, stored
on the admin datum.
It shouldn't let you do anything without +BAN, rip my live debugging or
whatever.

I've also hooked into (and fixed) Ned's existing library actions log,
and added viewing support to the ban/restore pages.
This logs banning admin, ban time, ban reason, etc.

As a part of this, I've fixed/expanded on the existing UIs.
I've added ID search to all existing consoles, and fixed an existing bug
with the visitor console not supporting category search (shows how many
people actually use the thing)

Changes to the library_action table were pretty minor. The ckey column
was too small, so longer keys just caused it to fail on ban. Bad.
That and the ip address column was signed, which wasted space and was
non standard with other tables.
2023-05-31 22:45:32 +00:00
Andrew
3773d20c96 Adjust objects to tabletop when wrenched (#75671)
![dreamseeker_2f6HEd87Kb](https://github.com/tgstation/tgstation/assets/3625094/c272df94-cdb6-427e-a3dc-c0e7d9cca4ea)

## About The Pull Request

Added a variable to `/obj/` that can be set to adjust the object sprite
when it mapspawns or being wrenched on top of a table.

Set this variable for some popular tabletop machines, removing the
default `pixel_y` offsets for some of them.

Also moved the wrenching logic to /obj/. It was under machinery for some
reason.

## Why It's Good For The Game

Did you ever unwrench something from the table by accident and then was
annoyed that you can't revet it back?

## Changelog

🆑
qol: Objects have a variable to adjust them visually when they're
wrenched or spawned on a table
refactor: Removed redundant code that had similar purpose, moved `obj`
wrenching logic into the `objs.dm`
qol: food/slime processor can be moved on table and adjusts to it when
wrenched
/🆑
2023-05-27 18:17:08 -04:00
SyncIt21
692052feb1 Book patches (#75565)
## About The Pull Request
1. Fixes #75555 knives already have their `sharpness = SHARP_EDGED` so
there's no need to explicitly type check for them and overall that if
condition was just a mind blender, so it's better now
2. Fixes #75577 bibles can convert other bibles again and will not
attempt to store it inside. Carrying over the fix that was implemented
in #73137

## Changelog
🆑
fix: wire cutter's can carve out book's again.
fix: bibles can convert other bibles
/🆑

---------

Co-authored-by: carlarctg <53100513+carlarctg@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-05-21 11:32:07 -07:00
Thunder12345
9ae549e096 Resprites Skillchips (#75183)
## About The Pull Request

Replaces the skillchip sprite with a new, smaller one that looks more
like a chip rather than an 8-inch floppy. (With a fancy housing because
consumer electronics can't just be bare circuit boards that's not
stylish.)


![image](https://user-images.githubusercontent.com/5479091/236567052-1dc2aee2-9360-45f5-939c-45a1d47061f5.png)

## Why It's Good For The Game

The old one looks like this and takes up most of a tile, need I say
more?


![image](https://user-images.githubusercontent.com/5479091/236566803-d82f2857-99b9-4381-9d41-6abf4a30e0ab.png)

## Changelog
🆑
image: Skillchips have been resprited to be smaller and more chip-like
/🆑
2023-05-14 22:58:44 -06:00
ChungusGamer666
dff70625e7 Bible refactor (#75350)
## About The Pull Request

This started as a simple addition where burning a bible would curse you,
but then I realized... Bibles aren't even proper books, thus can't be
burned!
So yeah, since that is not necessary due to how atom_storage works, I
reworked that.

## Why It's Good For The Game

Because burning bibles and getting cursed for it is funny.

![image](https://github.com/tgstation/tgstation/assets/82850673/2a8489ce-ecd6-45ee-9eb9-168ff820af65)

![image](https://github.com/tgstation/tgstation/assets/82850673/ebe98ad6-2d0d-4d20-9ea1-5d472d6ca465)

## Changelog

🆑
add: You can burn bibles now! But heresy has a steep cost...
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-05-15 04:27:43 +00:00
Zephyr
4178abcc33 Allows the book binder to remember font typing (#75007)
use that for book binding
## About The Pull Request

Closes https://github.com/tgstation/tgstation/issues/74996
## Why It's Good For The Game
## Changelog
🆑
fix: Bookbinder no longer takes your pen's font and throws it out the
nearest window
/🆑
2023-04-28 21:18:40 -06:00
Zephyr
548fc4a104 Books now render Markdown, fixing paper importing (#74902)
## About The Pull Request

Books didn't render markdown and instead just dumped the raw contents,
(after a html encode), into the window.
Changes them to use tgui and support markdown rendering.
## Why It's Good For The Game

Books should should look the same as the paper used to make them.
## Changelog
🆑
fix: Book's no longer take your formatting and throw it out the window.
refactor: Book display and rendering
/🆑

---------

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-04-26 11:38:54 +12:00
ChungusGamer666
0d75ee8e6e Adds book burning (#74873)
## About The Pull Request

For some reason, unlike other paper items, you couldn't ignite books
with a lighter or other hot item.
Now, you can!

(Also made it so the odd obscure mechanic of cutting pages out of books
can be done by any sharp item, not just wirecutters or knives)

## Why It's Good For The Game

Consistency. 
~~Burning copies of WGW.~~

## Changelog

🆑
add: Books can now be burned just like any other paper item.
add: You can cut pages out of books with any sharp item, not just knives
or wirecutters.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-04-23 17:26:17 -06:00
tralezab
c3b78761d2 Adds Chuunibyou Spell + Granter (#74404)
## About The Pull Request

My April fools this year, though not going to call it one because some
people think it should just be actually merged.

### Chuunibyou Powers 🌟

Wizard gets a new spell for 2 points that gives him the powers of
chuuni. This makes them have ridiculous shouted invocations for all
their spells, their spells are colored pink, and they heal slightly when
casting one.

While mostly a meme spell, I could see a tailored loadout like lichdom
and splattercasting that takes advantage of the unique spellcasting
changes, like a very low cooldown spammable loadout to heal quickly.

There is also a granter book in the library, which teaches a version of
chunni that doesn't heal.

#### Medical eyepatch

I added it, chuuni wizards get a NODROP version.

## Why It's Good For The Game

This PR bestows upon the game the glorious gift of chuuni powers, the
ultimate manifestation of my hidden potential and the secret truth of
this world, which only I and a few chosen ones can comprehend and
unleash! Why wouldn't you want it?!

In all seriousness, it is a unique wizard playstyle and it will make for
some funny memes. Beyond wizard, the chaplain, heretics, or mime can
read it in the library for a very silly round. I like it!

## Changelog
🆑
add: Chuunibyou wizards, and chunni granters in the library
add: Medical eyepatches
/🆑
2023-04-03 17:11:00 +02:00
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
Zephyr
ecbcef778d Refactors Regenerate Organs, and a few organ helpers (#74219)
## About The Pull Request

Refactors regenerate organs to be slightly more intelligent in handling
organ changes and replacements.
Noteably:
- We don't remove organs that were modified by the owner; such as
changing out your heart for a cybernetic
- We early break out of the for loop if they aren't supposed to have an
organ there and remove it
- We check for the organ already being correct, and just healing it and
continuing if it is

Also changes the names of some of the organ helpers into snake_case
### Mapping March
Ckey to receive rewards: N/A

## Why It's Good For The Game
## Changelog

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-03-26 17:54:36 +01: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
san7890
bf6f81a9b5 Implements AddTraits and RemoveTraits procs for adding/removing multiple traits + swag unit test (#74037)
On the tin, doing it like this means we can reduce our overall line
fingerprint whenever we have to add two or more traits from the same
source on the same target. Especially helps when we get to the 4+ range
of traits, a breath of fresh air even.

Doesn't mean we have to do for loops, as that's already handled within
the define as well. I replaced some of the checks with `length()`
checks, let me know if I should switch it over to something else (maybe
`islist()`)? We stack_trace whenever we're not passed a list reference
on purpose, and sometimes var/lists are null by default (or just empty,
making this redundant).
## Why It's Good For The Game

I commonly feel the urge to write "use `AddTraits()`" or something in
reviews, then am sad when I remember it doesn't exist. I will no longer
be sad.

Can ensure a lot more trait safety as well by using static lists- when
both ADD_TRAIT_LIST and REMOVE_TRAIT_LIST re-use the same list, you are
confident (from a static point of view) that everything that you want to
be adding/removing works.

I may have missed a few things where this could be used, but both macros
implemented in this PR still use the same framework that was being used
in the last four years- so stuff won't break if left untouched. Just a
nifty new tool for developers.

also fixed up some code in the area, numerous bugs were found and
exploded
2023-03-18 01:57:06 +00:00
Tim
a1ada2c9ef Refactor, improve, and rename canUseTopic to be can_perform_action (#73434)
This builds on what #69790 did and improved the code even further.
Notable things:
- `Topic()` is a deprecated proc in our codebase (replaced with
Javascript tgui) so it makes sense to rename `canUseTopic` to
`can_perform_action` which is more straightforward in what it does.
- Positional and named arguments have been converted into a easier to
use `action_bitflag`
- The bitflags adds some new checks you can use like: `NEED_GRAVITY |
NEED_LITERACY | NEED_LIGHT` when you want to perform an action.
- Redundant, duplicate, or dead code has been removed.
- Fixes several runtimes where `canUseTopic` was being called without a
proper target (IV drips, gibber, food processor)
- Better documentation for the proc and bitflags with examples
2023-02-16 20:22:14 -05: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
san7890
62812844fe Implements Cooldown On Uploading Books to Newscaster (#72112)
## About The Pull Request

Hey there,

Pretty much on the tin. We implement a cooldown on the backend for a set
amount of time to prevent people spamming the newscaster channel with a
shitload of books (rather than have absolutely no safeguards against
it), and then pipe information to the UI for user feedback.
## Why It's Good For The Game

Fixes #71290

In case you weren't already aware, letting users absolutely wreck the
shit out of player's chat via newscaster spam (all newscasters forcesay
a message when something's uploaded to it) as well as just fill the shit
up of a channel with various vulgarities isn't a really good thing.
## Changelog
🆑
fix: To prevent spam, there is now a cooldown on being able to upload
assorted books into the newscaster's channel feed.
/🆑

Let me know if the cooldown seems too long, not hard to change.
2022-12-25 12:49:45 -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
ShizCalev
9dab26371c Throws a bunch of parenthesis around to ensure dear Aunt Sally is always properly excused. (#71281)
Similar vein to #37116

This is supposed to be standard, yet here we are.

SHOULDN'T change anything, but there's likely something out there that's
bound to behave different because of it.


These were done manually, regex to find things that MIGHT need to be
corrected;
`^#define.+\+((?!\)).)*$`
`^#define.+-((?!\)).)*$`
`^#define.+\*((?!\)).)*$`
`^#define.+\/((?!\)).)*$` (yeah that's a lot of stuff.)
`^#define.+%((?!\)).)*$`
`^#define.+SECONDS((?!\)).)*$`
`^#define.+MINUTES((?!\)).)*$`
2022-11-21 20:53:06 -08:00
Jolly
5c2672a4a5 Slightly adjust base pixel off-set for library consoles (#71303)
## About The Pull Request
Title.

## Why It's Good For The Game


![image](https://user-images.githubusercontent.com/70232195/202208894-95bcb3a9-9858-4f18-bca4-086054d1c925.png)
What it is currently vs


![image](https://user-images.githubusercontent.com/70232195/202208930-c34b985f-19b3-4875-a4bb-3e79439b2dfa.png)

7 works too but 8 is an even number and we love even.
The X off-set doesn't need to be set since the entire thing is weirdly
symmetrical with NuTables.

## Changelog

🆑 Jolly
qol: Library Consoles and Book Management Consoles should no longer have
their keyboards hanging over the edge of tables.
/🆑
2022-11-17 11:22:25 -08:00
Paxilmaniac
fdc05066a6 Adds falling hazard element, beware of falling tools, wear your hardhat, comically timed piano falling on the clown (#70970)
## About The Pull Request


https://user-images.githubusercontent.com/82386923/199180691-6605c8cc-e8aa-490e-ab65-909d45d12ca0.mp4

Do note that the damage in this video is extremely exaggerated compared
to what the normal value is.
## Why It's Good For The Game

All these signs about engineers needing to wear their hardhat, and for
what? For the assistant dropping toolboxes onto them from above, that's
what! Also allows people to do as god intended by allowing them to drop
pianos on people.
## Changelog
🆑
add: A variety of items, mainly tools, around the station might hurt if
they fall on your head, remember to wear your hardhat and to avoid
standing under large red X marks on the ground with a piano hanging
above them.
/🆑

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2022-11-17 18:51:27 +00: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
Sealed101
4ad330b585 Adds Sabrage (#70755)
This PR adds an interaction to champagne bottles that allows the user to
pull off the cork with an edged (for code purposes, sharp) item. The
sharper the item, the better your chance is to pull the stunt off.
Minimum force is 5, which lets you do it with a captain's pen, for
instance. It's slower than just removing the cork by hand, as to
simulate the player removing the foil before taking the swing. Heads of
staff get a +20% chance to succeed due to being officers in some
capacity. A skillchip that can be bought from the Library Play Room
vendor increases the chance by +35%. Failing the stunt will smash the
bottle in your hands, spilling the contents all over you. This will
produce a bottle with the neck broken off, instead of its bottom.

Pulling the stunt off provides a weak mood buff for the user, and a
weaker mood buff for any witnesses. However, if someone else pulls the
sabrage off after you, you will get your success buff removed. Think of
it like pulling any other stunt and challenging someone else to do it,
only for them to succeed as well. Makes you bitter, doesn't it? Failing
the stunt also produces a weak mood debuff to the user.
2022-11-05 17:54:39 -05:00
VexingRaven
aead1310af Fixes issues with printing posters from the library management computer (#70471)
## About The Pull Request
Posters are kind of insane and they require that the poster item have
either a poster_type defined in the type or that you pass the structure
version of the poster to /new() otherwise they don't work. The weird
thing is that the structure needs to be in the contents of the item too,
or it again won't work (it won't remove the poster from your hands when
placing it). I fixed it so all you need to do is pass the structure
version of the poster to /new() on the item and it will move the
structure to the contents of the item if needed. It's still a bit insane
but it's better than it was and it fixed the bug.

Also SSLibrary.printable_posters was grabbing the directional mapping
helper of the random poster and so when you printed it and placed it,
you'd get confusing results. I made a quick fix to stop that from
happening.

## Why It's Good For The Game

Bug fixes are generally good things.
Fixes #70382
Fixes #66504


## Changelog

🆑 VexingRaven
fix: Fixed posters printed from the library console staying in your hand
when you place them
fix: Fixed Random Official Poster printed from the library console
always placing the west-facing variant no matter where you place it
/🆑
2022-11-04 00:47:03 -07:00
MrMelbert
1ac4a67c27 Chefs can now kiss food they make to make it with love. (And a lot of cooking refactoring) (#70409)
About The Pull Request

    Adds a skillchip to the chef's vendor. This vendor allows the chef to kiss their food to deliver a chef's kiss.
        Chef's kissing your food will add the "love" reagent to the food, which makes people much happier when they eat it. Be careful, overdosing on love can cause heart attacks.

    Refactors microwaving.
        Separates microwaving out of the edible component and makes it its own element, like grillable and bakeable.
        Also removes some magic numbers from microwave code.

    Code improvements all around baking and grilling code.

    Refactors edible component inheritance.
        Inheriting the edible component is now a viable way to cleanly add food types, flags, and callbacks. This makes it much much easier to change the values of an edible item without adding hacky signals / procs / getcomponent.

Why It's Good For The Game

Emergent chef gameplay.
Being able to further enhance your food with mood buffs.
Better code.
Changelog

cl Melbert
add: Chefs can now make food with love. They can purchase a skillchip from their vendor which enhances their kiss emote. Using your kiss on food you create will add a special reagent to it which makes it nicer.
refactor: Separated Microwavable from the Edible component, refactored microwave act to accompany this
refactor: Refactored how grilled items are generated
refactor: Refactored how silver slime food items are generated
refactor: Refactored how edible items inherit new edible statuses
code: Removed some magic numbers from microwaves
code: General code improvements for grillable / bakeable / etc
/cl
2022-11-04 09:45:01 +13:00
RikuTheKiller
a2fcec6a33 BCIs are now stored in the manipulation chamber's contents, instead of nullspace (#70350)
Fixes a bug where MMIs would be sent into the nullspace room when in an MMI component inside of a BCI that is inserted into a BCI manipulation chamber.

Stores the BCI in the chamber's contents, instead of nullspace, allowing the MMI to talk, the BCI to still act as it would normally and overall just solves the issue and maybe some others alongside it.

Fixes #70349
2022-10-08 15:24:31 +01:00
John Willard
91f02f2a6b canUseTopic now uses TRUE/FALSE instead of defines that just say TRUE (#69790)
* canUseTopic now uses TRUE/FALSE instead of defines that just say TRUE

The most idiotic thing I've seen is canUseTopic's defines, they literally just define TRUE, you can use it however you want, it doesn't matter, it just means TRUE. You can mix and match the args and it will set that arg to true, despite the name.

It's so idiotic I decided to remove it, so now I can reclaim a little bit of my sanity.
2022-10-01 09:47:52 -07:00
tattle
bec80d4856 Bureaucracy logging (#69554)
Sent fax messages' contents and printing out books is now logged to paper.log.
Renaming fax machines is logged to game.log (and to individual players' logs).

Mostly because I was annoyed earlier looking for who printed out books. And then faxes seemed like a logical continuation.
Plus it seems like an interesting way to see how often certain books are printed out!
2022-09-02 13:30:51 +01:00
tattle
fd9f50c552 [IDB IGNORE] Renames the inhand/misc folder to inhand/items (#69573)
Also adds balloons to inhand/items
2022-09-01 03:29:10 +02:00
MrMelbert
20bbe7cd17 Fixes runtime from bookshelves being maploaded in after SSlibrary is done instantiating (#69425)
* Fixes runtime with bookshelves loading.
- If a bookshelf is maploaded after the library subsystem is instantiated, it runtimes due to shelves_to_load being null, and no books are loaded. So, if a bookcase is maploaded after SSinit is done initializing, just load the shelf in init.

* Needs to be asyncronous.
2022-08-25 17:07:47 -04:00
Wallem
856e0a784a Updates the book scanner sprite (#69176)
Improves the book scanner sprite and adds a sound when scanning a book
2022-08-15 20:05:08 -03: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
MrMelbert
92dc954ab5 Fixes 118(give or take) cases of mapload not being passed to initilaize (#69107)
fixes 114 cases of mapload not being passed to initilaize
2022-08-11 10:22:33 -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
Timberpoes
786ac5c855 [MDB Ignore][Bounty][Complete Refactor] Papercode Redux: Too Many Damn Files <Map Conflict Edition> (#68612)
Papercode refactor
2022-08-02 19:27:42 +02:00
magatsuchi
7d0f393f5d Tsu's Brand Spanking New Storage: or, How I Learned To Pass Github Copilot As My Own Code (#67478)
Currently, storage works as a subtype of /datum/component, utilizing GetComponent() and signals to operate. While this is a pretty good idea in theory, the execution was pretty trash, and we end up with alot of GetComponent() snowflake code (something that shouldn't even need to be used frankly), and a heaping load of scattered procs that lead into one another, and procs that don't get utilized properly.

Instead, this PR adds atom_storage and proc/create_storage(. . .) to every atom, allowing for the possibility of storage on quite frankly anything. Not only does this entirely remove the need for signals, but it heavily squashes down the number of needed procs in total (removing snowflake signal procs that just lead to one another), reducing overall proc overhead and improving performance.
2022-07-08 18:13:18 -07:00