Commit Graph

601 Commits

Author SHA1 Message Date
MrMelbert
e21dc5fec7 Kicks Martial Arts out of the attack chain (yippee), makes it use signals, plus a large clean up of existing martial arts (#81097)
## About The Pull Request

- Kicks Martial Arts out of the attack chain. 
- All Martial Arts attacks are now handled via unarmed attack or grab
signals
- This means all martial arts are now technically on the living level,
allowing any mob that can unarmed attack to martial arts. Sort of. YMMV.

- All martial arts block checking is now handled by the arts themselves,
meaning you can selectively decide for a martial arts strike to not be
blocked. Maybe good for the future.

- A comprehensive cleanup of all existing martial arts. Improving var
names, code, adding some missing animation calls, etc.

Fixes #74829

## Why It's Good For The Game

Untangles the mess that is martial arts, making it a lot easier to work
with the attack chain and making it overall a ton more consistent.

## Changelog

🆑 Melbert
refactor: Big martial arts refactor, they should now overall act a ton
more consistent. Also technically any mob can do martial arts. Let me
know if something is funky.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-02-01 14:18:46 +00:00
13spacemen
832149261d Dynamic Husk Icons (#81080)
## About The Pull Request
Husk icons are now generated dynamically by greyscaling the limbs and
applying the husk blood overlay
rather than everything using the same husk sprite
## Why It's Good For The Game
Less sprites needed, also good for nonhuman races especially those with
non-humanoid shapes
All that is needed for a husk icon now is a blood overlay instead of an
entire limb set

Human, Lizard, Moth, Monkey husks

PIC IS A BIT OUTDATED, THE BLOOD IN PIC IS DARKER THAN HUSK BLOOD
(fixed) AND IT DOESNT "FIT" TO LIMB SPRITE (fixed)
![Screenshot 2024-01-24
025229](https://github.com/tgstation/tgstation/assets/46101244/12dfc3bc-9983-4dbc-8ace-a7130bb4a4e7)
## Changelog
🆑
refactor: Husk icons are now dynamically generated. See if you can
identify what species it was!
/🆑
2024-01-28 18:54:37 +01:00
Kyle Spier-Swenson
8703eac50d split area.contained_turfs up by zlevel, make init 10 seconds faster (#80941)
## About The Pull Request

Situation: areas have a list of all turfs in their area.

Problem: `/area/space` is an area and has a 6 to 7 digit count of turfs
that has to be traversed for every turf we need to remove from it. This
can take multiple byond ticks just to preform this action for a single
space rune

Solution: split the list by zlevel, and only search the right zlevel
list when removing turfs from areas.

replaces `area.get_contained_turfs()` with a few new procs:

* `get_highest_zlevel()` - returns the highest zlevel the area contains
turfs in. useful for use with `get_turfs_by_zlevel`
* `get_turfs_by_zlevel(zlevel)` - returns a list of turfs in the area in
a given zlevel. Useful for code that only cares about a specific zlevel
or changes behavior based on zlevel like lighting init.
* `get_turfs_from_all_zlevels()` - the replacement for
`get_contained_turfs()`, renamed as such so anybody copying/cargo
culting code gets a hint that a zlevel specific version might exist.
Still used in for loops that type checked so byond would do that all at
once
* `get_zlevel_turf_lists()` - returns the area's zlevel lists of lists
but only for non-empty zlevels. very useful for for loops.

The area contents unit test has been rewritten to ensure any improper
data triggers failures or runtimes by not having it use the helpers
above (some of which ensure a list is always returned) and access the
lists directly.
2024-01-18 12:16:12 -05:00
Time-Green
ca61d0f868 Turns mush cap into an extorgan (#80952)
Pretty self explanatory. I suppose this isn't a 100% fix or refactor,
since it adds a UI for their features and makes it removable, but also
these never happen

🆑
code: The mushroom cap is now an external organ (jungle station will
never happen)
fix: Mushpeople caps are no longer solid black
/🆑
2024-01-16 02:28:36 +01:00
LemonInTheDark
a3bb400816 Optimizes Reftracking (Bigly) (Plus harddel fixes) (#80443)
## About The Pull Request

### Reftracking BS

Alllright so reftracking is slow, really really slow.
That's a problem for me, both because I want it to be fast so I can more
efficiently torture players by running it on live, but also because it
impedes both local and CI runs.

So I've set out to micro optimize the DoSearchVar proc, one of the
hottest in the game.
I've done this in a few different ways.

#### The simple shit

Removing redundant proc args
Yeeting assoc arg setting (extra cost)
Moving if statements around to prioritize the more common case
Ignoring empty lists.

#### The not simple shit

Throwing our snowflake list checking into the sun
(Background, byond has some special lists that cannot be accessed like
an assoc list, trying to will lead to runtimes)
The way we handle this involves inspecting their ref string, and it eats
a LOT of time.

Faster then to mark all the lists we know are special by var name, and
then use try/catch to detect and silence anything that sneaks through
(this is on the order of like 1/3 per run, kinda curious what they are
tbh)
Thanks to MSO for the idea for this btw.

Removes the vars and logic that tied ref searching to clients. 
It's not how this code is used, and it slows everything else down for
really no reason

Added support for handing in a known "hanging reference" count, and then
searching for that.
This lets us early exit the ref search if we find everything we were
looking for, which is REALLY powerful, and why I asked for refcount() in
the first place.

### Harddel Fixes

[Fixes some harddels w gulag stuff born of the 515 one way ref
issues](046d7daa03)

[Ensures proximity cameras clean their ref to their proximity datum if
it's
deleted](ff607e9ccb)

[Deleting a pipe connected via the gas_machine_connector datum to a
machine should also delete that machine (harddel
fix)](9eecca22e7)
## Why It's Good For The Game

All this combined speeds up refsearching massively, on the order of
hundreds of seconds, and makes it far less time consuming for both CI
and running on live.
I'll be bullying some servers semi soon, want to see what I can cut out.
2024-01-16 02:17:03 +01:00
Time-Green
269b84e0cd Fixes assorted head harddels, removes specific organ vars in head (#80950)
Fixes #80926, fixes #80372

The tongue, eyes, ears and brain vars were also being updated and
cleared elsewhere, runtiming whenever a regular head got dismembered and
then emptied, which would eventually cause a harddel due to improper
clean-up

I've fixed the errant proc and just removed those vars because I don't
like having duplicate references for no reason (they should always
already be in contents)

Not player facing
2024-01-15 22:06:03 +01:00
LemonInTheDark
5acc1a3dcb Yeets Hallucination GFI for Images (#80859)
## About The Pull Request

THEY PRODUCE IMAGES ANYWAY WE CAN JUST COPY THE MA

AHHHHHHHHHHH
2024-01-09 14:08:45 -05:00
Ben10Omintrix
4476689439 hygeienbots basic bots (#80435)
## About The Pull Request
turns hygenic bots into basic bots. also now PAIs and people can play as
hygeinebots. and they can wear hats

## Why It's Good For The Game
transforms hyginebots into basic bots. their old AI used to handle all
the logic. i moved some of the logic to the mob itself so players can
also clean (or burn) things. also this pr will add pathing limits to
bots, in the case the jps movement thinks it can reach something, but
actually cant, in which case the bot will give up the chase

## Changelog
🆑
refactor: hygeinebots are now basic bots. please report all the bugs
fix: fixes hygenebots not being able to patrol
add: hygeinebots can now be controlled by Players
/🆑
2023-12-30 20:24:36 -08:00
Mothblocks
ed06502fb6 Fix flaky wizard screenshot test failure, and try to make screenshot tests run more consistently (#80631)
From https://github.com/tgstation/tgstation/pull/80542

Not exactly sure why this only fails once. My hint is that it happens
when the alternate tests are skipped from this:


![image](https://github.com/tgstation/tgstation/assets/35135081/67c261c0-e771-4696-add2-f41bb800ad65)

...though this should still be *consistent* at least.
2023-12-30 00:44:29 +01:00
Fikou
a3fa541e2e Bridge Assistant Station Trait (#80279)
## About The Pull Request
adds a station trait which adds a new role, the bridge assistant
he is designed to help commandeer the bridge and help out other heads
when needed. he is armed with the mini energy gun (the one heads used to
have on kilostation), a flash, a toolbelt (with an inducer), some cool
shades and a swanky scarf.
as he is a nerd he is weak and unable to twohand weapons, preventing him
from wielding the fire axe.
currently he does not have a mindshield but he cannot roll antag
he currently has access to the bridge, announcement console, eva,
teleporter, gateway, maint, and a weapon permit (somewhat (not really
other than for nerds) interestingly this is the first job that isnt
assistant that doesnt have access to any lathes, so he doesnt have orm
access unlike all the other jobs (except assistant))
the trait also makes a coffee machine spawn on the bridge
here is some useful art of your role

![image](https://github.com/tgstation/tgstation/assets/23585223/905e5527-9069-4226-b160-8dedd1ea7b74)
and ingame screenshots

![image](https://github.com/tgstation/tgstation/assets/23585223/0aa537ac-a791-4249-a702-490584919fd9)

![image](https://github.com/tgstation/tgstation/assets/23585223/eb93e2d1-0291-4ade-9208-b1c0b68648c7)

![image](https://github.com/tgstation/tgstation/assets/23585223/1d3c2f11-8ac0-4ee9-91a5-176f81a08dcb)


## Why It's Good For The Game
Adds upon the station trait job system with a straight forward role that
IS just a human (unlike the cargorilla), and is pretty basic with no
custom assets or whatever other than hud icons
Having the bridge assistant in some rounds seems like a neat way to
protect it since it gets fucked up in like half the time, while also not
having enough mechanical depth or gameplay as to warrant it as a
permanent role

## Changelog
🆑
add: Bridge Assistant job accessible from a station trait.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-12-16 20:02:45 -05:00
Time-Green
54ab1e3936 Organ movement refactor *Un-nullspaces your organs* (#79687)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

closes #53931, #70916, #53931

## About The Pull Request

Organs were previously stored in nullspace. Now they are stored in their
prospective bodyparts. Bodyparts are now stored in the mob.

I've also had to refactor a lot of code concerning organ movement.
Previously, organs were only moved into bodyparts once the bodyparts
were removed. To accomodate this change, two major distinctions have
been made:

**Bodypart removal/insertion**
Called only when an organ is taken out of a bodypart. Bodypart overlays,
damage modifiers or other changes that should affect a bodypart itself
goes here.

**Mob insertion/removal**
Called when an organ is removed from a mob. This can either be directly,
by taking the organ out of a mob, or by removing the bodypart that
contains the organ. This lets you add and remove organ effects safely
without having to worry about the bodypart.

Now that we controle the movement of bodyparts and organs, we can fuck
around with them more. Summoning someones head or chest or heart will
actually kill them now (and quite violently I must say (chest summoning
gibs lol)).


https://github.com/tgstation/tgstation/assets/7501474/5efc9dd3-cfd5-4ce4-b70f-d0d74894626e

I´ve also added a unit test that violently tears apart and reconstructs
a person in different ways to see if they get put toghether the right
way

This will definitely need a testmerge. I've done a lot of testing to
make sure interactions work, but more niche stuff or my own incompetence
can always slip through.

## Why It's Good For The Game

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

A lot of organ work is quite restricted. You can't C4 someones heart,
you cant summon their organs and a lot of exceptions have to be made to
keep organs in nullspace. This lets organs (and bodyparts) play more
nicely with the rest of the game. This also makes it a lot easier to
move away from extorgans since a lot of their unique movement code has
been removed and or generalized.

I don't like making PRs of this size (I'm so sorry reviewers), but I was
in a unique position to replace the entire system in a way I couldn't
have done conveniently in multiple PRs

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
refactor: Your organs are now inside your body. Please report any issues
with bodypart and organ movement, including exotic organ, on github and
scream at me
fix: Cases of unexpected organ movement, such as teleporting bodyparts
and organs with spells, now invokes a proper reaction (usually violent
death)
runtime: Fixes HARS runtiming on activation/deactivation
fix: Fixes lag when species swapping
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
2023-12-09 17:50:46 +00:00
Ben10Omintrix
af67bd7490 basic cleanbots refactor and new janitor skillchip (#80128)
## About The Pull Request
this pr refacotrs cleanbots into basic bots. also adds a new skillchip
for janitrs. this skillchip will allow janitors to communicate with
cleanbots and order them around, like pointing at something and telling
them to clean it. also now the cleanbot has an inbuilt mop which it will
use to smack mice and cockroaches

## Why It's Good For The Game
refactors cleanbots into basic bots and fixes them getting stuck
sometimes while patrolling. also janitors being able to order them
around can make them a bit more useful as tools for the janitor

## Changelog
🆑
refactor: cleanbots are refactored into basic bots. please report all
bugs
fix: fixes cleanbots getting stuck sometimes while patrolling
add: janitors get a new skillchip which allow them to communicate with
cleanbots
/🆑
2023-12-08 16:26:10 -07:00
MrMelbert
bb5165100b Deletes unused hydroponics code (#80156)
## About The Pull Request

`/obj/item/seeds/sample` was completely unused, ever since it's
inception in #16082
(d513f52244)
as far as I can tell

(Me when "adds plant samples for future use" never makes use of them in
the future)

All this does is complicate hydro code so it dies. 
Anything it is doing should be handled by genes probably

While I was here I made sure nothing in `can_add` will break and touched
up the code a tiny tiny bit. I kept it as `SHOULD_CALL_PARENT` even
though it doesn't make use of it at the moment because every trait
currently calls parent / respects return value, so sure, why not

## Changelog

Not necessary
2023-12-06 19:58:26 -07:00
distributivgesetz
274eb2a52e Removes Clone Damage (#80109)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

Does what it says on the tin. We don't have any "special" sources of
clone damage left in the game, most of them are rather trivial so I
bunched them together into this PR.

Notable things removed:
- Clonexadone, because its entire thing was centered around clone damage
- Decloner gun, it's also centered around cloning damage, I couldn't
think of a replacement mechanic and nobody uses it anyways
- Everything else already dealt clone damage as a side (rainbow knife
deals a random damage type for example), so these sources were removed

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

Consider the four sources of normal damage that you can get: Brute,
Burn, Toxins and Oxygen. These four horsemen of the apocalypse are very
well put together and it's no surprise that they are in the game, as you
can fit any way of damaging a mob into them. Getting beaten to death by
a security officer? Brute damage. Running around on fire? Burn damage.
Poisoned or irradiated? Toxin damage. Suffocating in space? Brute, burn
and oxygen damage. Technically there's also stamina damage but that's
its own ballpark and it also makes sense why we have a damage number for
it.

Picture this now: We have this cool mechanic called "clone pods" where
you can magically revive dead people with absolute ease. We don't want
it to be for free though, it comes at a cost. This cost is clone damage,
and it serves to restrain people from abusing cloning.

Fast forward time a bit and cloning is now removed from the game. What
stays with us is a damage number that is intrinsically tied to the
context of a removed feature. It was a good idea that we had it for that
feature at the time, but now it just sits there. It's the odd one out
from all the other damage types. You can easily explain why your blade
dealt brute damage, but how are you going to fit clone damage into any
context without also becoming extremely specific?

My point is: **clone damage is conceptually a flawed mechanic because it
is too specific**. That is the major issue why no one uses it, and why
that makes it unworthy of being a damage stat.
Don't take my word for it though, because a while ago we only had a
handful of sources for this damage type in the game. And in most of the
rounds where you saw this damage, it came from only one department. It's
not worthwhile to keep it around as a damage number. People also didn't
know what to do with this damage type, so we currently have two ways of
healing clone damage: Cryotubes as a roundstart way of healing clone
damage and Rezadone, which instantly sets your clone damage to 0 on the
first tick. As a medical doctor, when was the last time you saw someone
come in with clone damage and thought to yourself, "Oh, this person has
clone damage, I cannot wait to heal them!" ?

Now we have replacements for these clone damage sources. Slimes? Slime
status effect that deals brute instead of clone. Cosmic heretics? Random
organ damage, because their mechanics are already pretty fleshed out.
Decloning virus? The virus operated as a "ticking timebomb" which used
cloning damage as the timer, so it has been reworked to not use clone
damage. What remains after all this is now a basically unused damage
type. Every specific situation that used clone damage is now relying on
another damage type. Now it's time to put clone damage to rest once and
for all.

Sure, you can technically add some form of cellular degradation in the
future, but it shouldn't be a damage number. The idea of your cells
being degraded is a cool concept, don't get me wrong, but make it a
status effect or maybe even a wound for that matter.

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
del: Removed clone damage.
del: Removed the decloner gun.
del: Removed clonexadone.
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
2023-12-04 14:42:43 -08:00
distributivgesetz
f8b41f9442 Changes occurrences of recieve in code to receive (#80065)
## About The Pull Request

I've stumbled across this enough to finally go through the entire
codebase and fix it. I left out changelogs simply because rewriting
history logs is bad.
## Why It's Good For The Game

I find it pretty annoying because I stumble across words that are
misspelled for a few seconds, and I'm likely not the only one who feels
like this. Less spelling mistakes in code are better.
## Changelog
🆑
spellcheck: Occurrences of "recieve" has been changed to "receive".
/🆑
2023-12-02 14:50:57 -07:00
Ben10Omintrix
a3c24dd74e Basic bots (medibots) (#79955)
## About The Pull Request
refactors bots into basic bots. i decided to do medibots first because
they were the most complex bots and wanted to get them out of the way
first. if this pr gets merged then i will be rolling out the rest of the
bot refactors over the next months

medibots can now wear any type of hats! some of these hats can trigger
unique new recorded voicelines and interactions!

![chickembot](https://github.com/tgstation/tgstation/assets/138636438/09d4519d-0a34-4b7f-898b-260f894bfdce)

![hatbot](https://github.com/tgstation/tgstation/assets/138636438/088e0618-108d-4fb4-a29b-771cfa027fb3)


## Why It's Good For The Game
converts medbots into basic medbots. they are now a bit more responsive
than before but overall they should act similarly to how they did. also
adds the basic bot ai framework which has all the generic bot behaviors
that the next bots may or may not need to have in their ai. i tried my
best to improve their code and turned some of their bitflags into define
bitfields. this pr may need a careful review because i did it from
scratch as the old bot project branch was too outdated for me to use
## Changelog
🆑
refactor: medbots are now basic bots. please report any bugs
add: medbots can wear hats!
/🆑
2023-12-01 22:49:18 -07:00
Verm
fe6add052a Adds medical record descriptions for quirks without any (#79997)
## About The Pull Request

Adds medical record descriptions to the heterochromatic, signer, spacer,
and voracious quirks.
## Why It's Good For The Game

More flavor text! And also means they show up on medical records or when
using medical HUDs to view quirks.

Right now if you view someone with these quirks the line will be blank
in the medical records, so it makes that less confusing.
## Changelog
🆑
add: Heterochromatic, Signer, Spacer, and Voracious quirks are now
properly accounted for in medical records.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-11-30 04:08:57 +01:00
Ben10Omintrix
ce6f2724cd basic cats and mini kitchen helpers (#79800)
## About The Pull Request
this pr transforms cats into basic pets! cats now have some new
behavior. they can carry fish and hunted mice in their mouths to deliver
it to kittens, and kittens will eat them.


![catmouse](https://github.com/tgstation/tgstation/assets/138636438/8f146be4-c7b2-41d3-8301-734be49b5efc)

![catfish](https://github.com/tgstation/tgstation/assets/138636438/f8df54f2-9183-406d-afbd-f90f415f7f3d)

if a kitten sees you holding food, it will point at you and meow loudly
until u give it the food.
becareful when putting male cats near each other, there is a small
chance they get into a heated argument and meow loudly at each other
until one of them flees.
also added a new small cat house for cats. cats will use these homes if
u build one near them (using 5 wood planks)


![cathouse](https://github.com/tgstation/tgstation/assets/138636438/9515a78c-fdfe-461b-bad2-6b497117c694)

Chefs can craft the cake cat and breadcat. these are useful cats because
they can help the chef around in the kitchen. they will turn stoves and
grills off when food is ready, so they dont burn. and the cake cat will
help the chef decorate his donuts

## Why It's Good For The Game
refactors cats into basic mobs and gives them a deeper ai

## Changelog
🆑
refactor: cats are now basic pets. please report any bugs.
add: the cake cat and bread cat can now help the chef around in the
kitchen
/🆑
2023-11-28 21:51:37 -07:00
oranges
d96dfd098b Fixes failure state indication message (#79988)
This is actually determining if the item was deleted before it had a
chance to Initialize.
2023-11-28 19:09:25 -05:00
oranges
fda8d68015 Add the space turf type to the space unittest (#79986)
This might seem pointless, but it helps identify spurious failures due
to something else blowing a hole in the station before this test runs.
2023-11-28 15:45:14 -07:00
LemonInTheDark
1d6533c525 Bumps compile to 515 (#79134)
## About The Pull Request

LSP supports it, let's GOOOOOO
I've removed the 515 tests since they're stable, alongside the libcall
wrapper. left the rustgcall wrapper cause yaknow memes
Just removed all the 515 and 514 particular define wrappers. gaming

## Changelog
🆑
server: Minimum compile version has been bumped to 515. clients still
support 514 but we're gonna start using 515 restricted features for
serverside now.
/🆑

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2023-11-25 21:03:29 -08:00
Emmett Gaines
67135e22ea Fixes hearing messages from speakers on another z level (515 fix) (#79888)
515 changed get_dist to return inf when either end is on another z
level, instead of just the maximum range. `/mob/living/Hear` early
returns when the speaker is too far away to hear. Previously we would
get around this by passing in INFINITY as the range for the message, but
the INFINITY define is just a very large number instead of real infinity
which is what byond gives back for get_dist.

I also improved the unit test a little while debugging this.
2023-11-23 11:25:48 -08:00
Profakos
64c514e48f Calls Allocate on the spawn humans unit test humans (#79827)
## About The Pull Request

I have found a unit test that spawn instances of
`/mob/living/carbon/human/consistent`, without using `allocate`, so they
won't get into the list of things to be deleted when CI finishes
running. This PR ensures that they won't stick around after the unit
test has finished.

I kept them picking a random tile from the unit test room, instead of
going with `allocate`'s default of the test area's bottom left corner.
Could have maybe swapped it to pick_n_take so there is no chance of them
piling up, but that is not relevant to the CI issue.

## Why It's Good For The Game

Maybe this will stop the random CI failures where
`/mob/living/carbon/human/consistent` fails to be deleted.

## Changelog

Nothing player facing
2023-11-19 20:11:08 +01:00
Jeremiah
7a1b1fa9ad Splits placeontop proc (#79702)
## About The Pull Request
I find the proc hard to read honestly. There's no reason we can't split
this into two functions - the secondary functionality is used only once,
in reader.dmm.
## Why It's Good For The Game
Code improvement
Glorious snake case
## Changelog
N/A nothing player facing

---------

Co-authored-by: san7890 <34697715+san7890@users.noreply.github.com>
2023-11-19 04:58:31 +01:00
san7890
b251b9dbb0 Refactors Parrots into Basic Mobs (ft. Ben10Omintrix/Kobsamobsa) (#79762) 2023-11-18 19:24:32 -08:00
Bloop
3f63a7133f Fixes bug with high luminosity eyes, & fixes eyes being on the wrong side of the head! (#79760) 2023-11-18 19:17:00 -08:00
Jeremiah
ba5ae73dac Adds more bitrunning antagonists + fixes (READY) (#79522)
## About The Pull Request
Reopened #78997
Larger patch for bitrunning that addresses a few issues.

- Two new antagonists: cyber tac and netguardian
- Quantum server emag opportunity
- Modular mob packs: Like random spawners, but for groups
- Antag spawning fixed: vdom antags now have up to a 10% chance to spawn
based on domains loaded
- Virtual domains are no longer all fullbright by default, only the
outdoorsy ones
- Actually deletes legion map file, since it was removed in #79424

<details>
<summary>images</summary>

The netguardian prime

![dreamseeker_eKi7Mhv45s](https://github.com/tgstation/tgstation/assets/42397676/099a0982-d6f8-4c93-a64c-8c7d45d9204e)


![robot_48_animation](https://github.com/tgstation/tgstation/assets/42397676/a2147195-61e6-4584-8645-56333ecd3e07)

The glitch effect - this mob is being mutated

![dreamseeker_NE4j4rCoez](https://github.com/tgstation/tgstation/assets/42397676/273892c7-e396-417b-8a9d-3709a210e3ff)

Cyber tac (t2 antagonist)
![Screenshot 2023-10-27
211732](https://github.com/tgstation/tgstation/assets/42397676/6ff79337-cb0d-4a1f-80cf-dce99a4991d5)

</details>

## Why It's Good For The Game
- Bitrunning antagonists are so incredibly rare that it's underwhelming
to play as one for the solid second they offer if you even get the role
- Bitrunners had basically no traitor route to follow, they became
assistants with black outfits

Fixes #79465

<details>
<summary>More info</summary>

Bitrunners don't have any type of traitor options. If they're made into
traitors, there's nothing bitrunner related they can do, and their
access is particularly bad so it's like they're a worse assistant. I've
coupled this with the bitrunning antagonist system, which is now
fixed.\. Bitrunners can now attempt to coax these entities to come onto
the station, however they are not given any form of allegiance for doing
so (and are quite counterable).

Previously, vdom antagonists relied on so many factors to spawn that it
basically wouldn't happen. Now, it runs on the server each time there is
a map loaded, with increasing probability as the round progresses. This
builds up the list of spawnable antagonists, of which two are new,
including an entirely new giant mech megafauna. This is the first
"megafauna-esque" basic mob in the game. Its AI is bad, it's really only
meant to be player controlled, but this does mean an admin can spawn
them. Being mech, they are very counterable with ion rifles and the
like.

Several refactors, rewrites, and overall bug fixes are included in this
PR.

Lastly, I added a framework for making bitrunner maps more random, the
modular mob spawning system, which works in conjunction with random
crate locations.
</details>

## Changelog
jlsnow301, infraredbaron
🆑
add: Bitrunning Patch 1 features a host of changes!
add: Added randomized mobs to virtual domains, which will be indicated
with a unique icon.
add: New emag interaction with the quantum server. Antags will spawn
more frequently, and they can hack themselves onto the station. You have
been warned.
add: Both living and dead players can now see which mob is going to
spawn an antagonist in the vdom.
add: Two new vdom antagonists: Cyber Tac and the NetGuardian. These
unlock at specific thresholds.
balance: You can no longer stack copies of the same ability with
bitrunning disks.
balance: Some of the disk items have been replaced with stronger
versions.
fix: You can no longer spy on crew using the advanced camera console on
syndicate assault.
fix: Fixed the spawning mechanism of virtual domain antagonists. You
should now have a chance of playing as one. This chance increases as
more domains are completed.
fix: Vdom antagonists shouldn't spawn at the end of the run any longer.
fix: The preference for vdom antagonists has been changed to factor in
the new types. Check your preferences!
fix: The quantum server will now show its balloon alerts to all
observers.
fix: Random domains should be fully random again.
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-11-17 11:56:17 +13:00
Jeremiah
2b8e7196d7 Fixes baseturf helpers (#79697)
## About The Pull Request
Baseturf helpers do this:

![image](https://github.com/tgstation/tgstation/assets/42397676/f73887cc-10b1-4b24-b123-dc99c02ad45a)

And they also do this (up to 3x):
![Screenshot 2023-11-12
164334](https://github.com/tgstation/tgstation/assets/42397676/ac555d9a-785b-4e02-b85d-e90ded3b08ad)

When trying to debug `PlaceOnBottom` I couldn't help but notice it's
trying to encompass use cases that simply aren't used anywhere. YAGNI -
this makes it much more complex than it needs to be.
## Why It's Good For The Game
Fixes weird baseturf handling
FIxes #79172
## Changelog
N/A nothing player facing

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-11-13 20:09:37 -07:00
Ben10Omintrix
7a44f10993 basic gutlunchers and ashwalker ranching (#79508)
## About The Pull Request
this pr transforms gutlunchers into basic mobs and gives them a small
ranch that ashwalkers can manage. gutlunches come in various colors and
sizes! female gutlunches will come in different shades of red and males
will come in shades of blue. the child born will have a mix of his
parent's colors.
![the
farm](https://github.com/tgstation/tgstation/assets/138636438/41fdb1ed-e567-4c8d-bb83-b296f878c862)
female gutlunches can make various healing milk and medicine from its
udder. but it will need to consume ores before it can start making milk,
u can either feed it by hand or u can put ores in the wooden trough and
they will go eat from it whenever they get hungry. feeding it gold or
bluespace ore will improve the healing quality of the milk for a short
while

![trough](https://github.com/tgstation/tgstation/assets/138636438/b9c84d18-fdd8-476b-b779-bdfe49dd7e88)
the male gutlunchers are obedient pets. their stats vary from one
another in speed, attack and health. a male gutlunchers stats will
depend on the stats of his parents, the higher his parent's stats are
the better chances he has at rolling higher stats. so u can selectively
breed them to make sure they have the best stats possible. they will
listen to all ur commands and can mine walls or attack enemies if given
the command. also i wanted the farm to have wood fences so i added them
to the game, they cost 5 wood planks to make



## Why It's Good For The Game
refactors gutlunches into basic mobs. also i turned breeding into a
component so it can be applied to all animals and created a breed
command, pets that have this command and the component will go breed
with a partner u point at.

## Changelog
🆑
refactor: gutlunches have been refactored into basic mobs. please report
any bugs
add: ashwalkers have a small ranch they can manage
fix: wall tearer compnent wont runtime when interacting with mineral
walls
/🆑
2023-11-13 01:20:19 -07:00
Bloop
6b259fee24 Fixes the EMP Barsign sprite not displaying (#79599)
## About The Pull Request

The logic that sets the icon_state had an error in it. When the sign got
emp'd, they'd get the `NOPOWER` flag which was causing them to get the
`empty` `icon_state` instead of that of the emped barsign.

This just fixes that by adding a conditional check for `EMPED`, and also
resprites the emissive lightmask for the emped barsign to match the
individual signs that make up its sprite, where previously it was just a
static square.

Also added it to the barsigns unit tests because I can see someone
breaking this again.

## Why It's Good For The Game

Fixes bug where emped barsigns would show the turned off sprite instead
of their animated sprite. Also improves the light mask:

Note: this is in complete darkness. The colored backdrops of the signs
are not supposed to be emissive.

<details> <summary>Before </summary>


![dreamseeker_jiXgQtteGK](https://github.com/tgstation/tgstation/assets/13398309/4c576c3d-8758-4ce8-b1b5-00d0fb341f38)

</details>

<details> <summary>After </summary>


![dreamseeker_tCu8YSTJuZ](https://github.com/tgstation/tgstation/assets/13398309/10c328c9-8e99-47c7-98a4-e6f66c4e5eee)

</details>


![dreamseeker_Lu3TfIzkWO](https://github.com/tgstation/tgstation/assets/13398309/c7251cc0-84ab-432d-85e9-2b93b94b63e4)

## Changelog

🆑
fix: emped bar signs will now display the correct sprite
image: added a more detailed lightmask for the emp bar sign sprite
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: orange man <61334995+comfyorange@users.noreply.github.com>
Co-authored-by: Profakos <profakos@gmail.com>
Co-authored-by: Changelogs <action@github.com>
Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Andrew <mt.forspam@gmail.com>
Co-authored-by: DaCoolBoss <142358580+DaCoolBoss@users.noreply.github.com>
2023-11-12 12:47:07 -08:00
LemonInTheDark
3223d2a3fb Lemon fixes ci (#79384)
## About The Pull Request

Sets up moveloops to better catch issues with duplicated loops

Letting people modify the timer var AND have it track what bucket we're
in was a bad idea.
So instead let's store the queued time separate. Also makes
allowed_to_move return true/false instead of flags

This fixed? the null loop issue locally, I honestly have no damn idea
why. I'm gonna be working on the rest of ci here, left trackers so if it
pops up between now and merge I'll know what the issue is.

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
2023-11-12 09:25:59 +00:00
Jacquerel
a1e46c5d31 Basic Guardians/Holoparasites (#79473)
## About The Pull Request

Fixes #79485
Fixes #77552

Converts Guardians (aka Holoparasites) into Basic Mobs.
Changes a bunch of their behaviours into actions or components which we
can reuse.
Replaces some verbs it would give to you and hide in the status panel
with action buttons that you may be able to find more quickly.

They _**should**_ work basically like they did before but a bit
smoother. It is not unlikely that I made some changes by accident or
just by changing framework though.

My one creative touch was adding random name suggestions.
The Wizard federation have a convention of naming their arcane spirit
guardians by combining a colour and a major arcana of the tarot. The
Syndicate of course won't truck with any of that mystical claptrap and
for their codenames use the much more sensible construction of a colour
and a gamepiece.

This lets you be randomly assigned such creative names as "Sparkling
Hermit", "Bloody Queen", "Blue World", or "Purple Diamond".
You can of course still ignore this entirely and type "The Brapmaster"
into the box if so desired.

I made _one_ other intentional change, which is to swap to Mothblocks'
nice leash component instead of instantly teleporting guardians back to
you when they are pulled out of the edge of their range. They should now
be "dragged" along behind you until they can't path, at which point they
will teleport. This should make the experience a bit less disorienting,
you have the recall button if you _want_ to instantly catch up.

This is unfortunately a bumper-sized PR because it did not seem
plausible to not do all of it at once, but I can make a project branch
for atomisation if people think this is too much of a pain in the ass to
review.

Other changes:
- Some refactoring to how the charge action works so I could
individually override "what you can hit" and "what happens when you hit"
instead of those being the same proc
- Lightning Guardian damage chain is now a component
- Explosive Guardian explosive trap is now a component
- Added even more arguments to the Healing Touch component to allow it
to heal tox/oxy damage and require a specific click modifier
- Life Link component which implements the Guardian behaviour of using
another mob as your health bar
- Moved some stuff about deciding what guardians look and are described
like into a theming datum
- Added a generic proc which can return whether your mob is meant to
apply some kind of damage multiplier to a certain damage type. It's not
perfect because I couldn't figure out how ot cram limb modifiers in
there, which is where most of it is on carbons. Oh well.
- Riders of vehicles now inherit all movement traits of those vehicles,
so riding a charging holoparasite will let you cross chasms. Also works
if you piggyback someone with wings, probably.

## Changelog

🆑
refactor: Guardians/Powerminers/Holoparasites now use the basic mob
framework. Please report any unexpected changes or behaviour.
qol: The verbs used to communicate with, recall, or banish your Guardian
are now action buttons.
balance: If (as a Guardian) your host moves slightly out of range you
will now be dragged back into range if possible, rather than being
instantly teleported to them.
balance: Protectors now have a shorter leash range rather than a longer
one, in order to more easily take advantage of their ability to drag
their charge out of danger.
balance: Ranged Guardians can now hold down the mouse button to fire
automatically.
balance: People riding vehicles or other mobs now inherit all of their
movement traits, so riding a flying mob (or vehicle, if we have any of
those) will allow you to cross chasms and lava safely.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-11-10 21:04:52 -07:00
Thunder12345
acbe9282bd Renames the icon var in barsign datums to icon_state for sanity (#79559)
## About The Pull Request

See title.

## Why It's Good For The Game

Calling this var `icon` is confusing and illogical. It will be applied
to the barsign's `icon_state`, and is not an actual icon itself.
Renaming to `icon_state` makes this var consistent with `name` and
`desc`, which are also applied the same named vars on the sign.

## Changelog
Not player facing
2023-11-06 19:52:45 -07:00
Bloop
f158947a17 Makes tails stop wagging in death (#79511)
## About The Pull Request

What it says on the tin. Tails would keep wagging after the mob died. It
would also not update the sprite if the `stop_after` option was used, so
I fixed that too. Not a commonly seen thing except downstream, but
nevertheless!

edit: I also noticed some improperly ordered parameters and fixed those.
Did you know that the way it was set up, tails would actually _start
wagging_ after they got `Remove()`d? It wouldn't do anything because
they're no longer on the mob, but still...

unsettling

## Why It's Good For The Game

Removes the super cursed tails.

## Changelog

🆑
fix: tails will no longer keep wagging even in death
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
2023-11-05 23:32:24 -07:00
Ben10Omintrix
42c8e1adf9 new wizard ability and basic leaper refactor (#79237)
## About The Pull Request
refactors leapers into basic mobs and adds a new ability for wizards.
for 2 points wizards can buy their own leaper pet. they will get a
contract which lets them pick their pet's name and color

![thefrogs](https://github.com/tgstation/tgstation/assets/138636438/8df9b893-d07d-4e51-a9fa-644830cc7a81)

after they sign the contract they will get a frog statue which is used
to contain the leaper. players can use this statue to release or recall
the leaper into the statue. when its in the statue it will slowly regain
health or even revive from the dead, but if it gets gibbed then the
statue will be useless.

also adds a new ai behavior for leapers which lets them go swim in water
(and splash around) for a period of time. i gave this behavior to frogs
and crabs too

when riding the leaper, the players will get access to all its
abilities, it now has new abilities, it can create frog minions that
suicide bomb the enemies and it can also create a shower of poisonous
structures.


https://github.com/tgstation/tgstation/assets/138636438/931aa7b4-09f0-493f-bdb6-f3bdd0915b22

also when riding the leaper, players can point at walls near it so it
will destroy it. alternatively players can give commands to their
leapers to use abilities and to follow them if they are not riding it.
wizards cant be force dismounted from their frogs, and only wizards can
ride the frogs.

this also removes leapers from cytology as they now are much more
dangerous and have a new home


## Why It's Good For The Game
refactors leapers into basic mobs, and gives more gameplay opportunities
for wizards
## Changelog
🆑
refactor: leapers have been refactored into basic mobs please report any
bugs
add: wizards can now summon a leaper pet
removal: removes leapers from cytology
/🆑
2023-11-06 00:05:29 +00:00
John Willard
88bb3afcce Mafia now starts without admin intervention (#79348)
## About The Pull Request

Mafia should now start without the need of admin intervention.
I made a unit test that should always have a PDA and a ghost spawning in
a game of Mafia and having it run through basic setup to confirm they
both successfully sign up and the game starts.

I had to change a lot of things in order to get this working, such as
giving unique ckeys to mock clients, fixing harddels in Mafia, and
plenty of minor fixes. This is the first time any of this code is put in
CI, so a lot of uncaught errors are now showing their faces.

Because loading maps mid-round runtimes due to smoothing, I have mafia
their own unit test-only map that doesn't use smoothing.

I also split the mafia ui code into its own file, and moved a single
helper that was sitting around in mafia's file into a helpers file.

I also added some comments to explain why certain things are the way
they are, because I wrote some undocumented code previously and forgot a
few things, leading to self-inflicted wasted time.

## Why It's Good For The Game

^

## Changelog

🆑
fix: Mafia games can now start properly.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2023-11-05 01:26:24 +00:00
lizardqueenlexi
07f2214ac4 Basic Wizards (#79476)
## About The Pull Request

Makes NPC wizard mobs into basic mobs. These aren't actually used
anywhere, since their away mission was removed, so I figured I'd have
some fun with them.


![image](https://github.com/tgstation/tgstation/assets/105025397/901f3a92-74a3-492b-8435-43813ad2afa8)

Noteworthy changes are as follows:
- Wizard mobs can now wear any of the four basic colors of wizard robe
and hat. Rarely, they will wear the witch ("Marisa") outfit instead.
There was going to be a rare Tape Wizard spawn too, but the outfit
doesn't work correctly for some reason (see comments below).
- Wizard mobs no longer have a set spell loadout. Instead, they always
receive a random **targeted, primary spell**, a random **untargeted,
secondary spell**, and the spell **Blink**.
- Wizard subtypes (or var-edited wizards) can have any of the above
specified rather than random.
- Wizard AI will try to avoid ever being in melee, and will fire off
spells whenever possible with the priority order of primary > secondary
> blink. There is a mandatory 1-second waiting period between casts.
- Wizard mobs use "lesser" versions of Fireball and Blink. Lesser
Fireball does a little less damage and has a smaller explosion, though
it is still extremely dangerous. Lesser Blink simply has a smaller blink
radius so that wizard mobs don't just decide to leave.

Depending on their spell loadout, wizards can be _incredibly_ dangerous
mobs - stunning you with tesla blasts, shooting you with fireballs, and
more. Even weakened, fireball is the nastiest of these by far, able to
set you on fire or remove your limbs if you aren't properly protected.
Watch out!

The random lists have been kept pretty small, since I only wanted to use
spells that I know for sure work. Spell cards is pretty weak in AI
hands, since they don't take advantage of the fact that a human player
can spam it, but I wanted there to be a little variety in primary
attacks.

I included an UpdatePaths script here in case a downstream is using
these, but I doubt it was necessary.
## Why It's Good For The Game

Removes another simplemob.

The actual impact of this change is negligible, since this is an unused
mob, but it's possible that this lays the groundwork for these actually
being used - particularly since mappers can make them as powerful or
weak as they want by specifying a spell loadout. Wizards may make for a
tough boss challenge for a ruin or away mission, or a very mean surprise
for an admin to drop on an unsuspecting station.
## Changelog
As this is an unused mob, there are no player-facing changes.
2023-11-04 16:22:19 +00:00
lizardqueenlexi
7b720a0081 Basic Shades (#79469)
## About The Pull Request

Makes shades into basic mobs. As they are solely player-controller and
have no AI, this was a very simple conversion.

Things of note:
- I've made shades use the same "theme" system as constructs, to
determine their drops and coloration - as opposed to these things being
manually set by the type of soulstone they're held in.
- I've reorganized files slightly, putting both constructs and shades in
a new "cult" basic mob folder.

That's more or less it. As I said, shades are simple.
## Why It's Good For The Game

Basic-izes another mob and cleans up the code a little. Removes the last
cult-related simplemob, too.
## Changelog
🆑
refactor: Shades now use the basic mob framework. Please report any
bugs.
/🆑
2023-11-03 22:39:33 +00:00
Jeremiah
af00850356 Removes virtual-specific megafauna, fixes boss map issues [NO GBP] (#79424)
## About The Pull Request
Another atomization of the content patch-
Let's not subtype everything into virtual variants

This also fixes some bugs that were present with vdom boss maps
- Made the bubblegum map larger so he wouldn't teleport out
- Legion is just far too annoying to have to fix code wise, given that
few if anyone tries it with the base virtual equipment

<details>
<summary>what do you mean too annoying?</summary>

Legion doesn't handle dying like the standard megafauna - each time it
"dies" it looks to see if there's another legion in the entire game
world. Given the real one very likely exists, this basically means it
won't drop anything. I'd have to modify legion's death proc specifically
for the virtual domain. No other megafauna has this level of weirdness
(nor splitting behavior) and coupled with the fact I think no one tries
the domain, I'm just removing it.

</details>

## Why It's Good For The Game
Cleans up megafauna subtypes that were specific for the virtual domain.
Now, we won't need to keep adding to the list if there's ever a new one
Fixes #79203
Fixes #79200

## Changelog
🆑
fix: Bubblegum should no longer teleport out of the simulation when
threatened
del: Chamber of Echoes map removed as it conflicts with the actual
Legion
/🆑
2023-11-02 13:21:04 +00:00
lizardqueenlexi
08274f8343 Basic Constructs: Proteon (#79425)
## About The Pull Request

Last one! Makes proteons into a basic mob, and completely removes the
simple_animal construct supertype.

Proteons aren't really designed to be played by a player, instead being
a nuisance mapped into various ruins and traps. As such, they don't
really have any special abilities. Instead, the hostile variant has a
somewhat unique behavior. They'll viciously attack anyone who comes
close, but, being frail little cowards, if a proteon takes damage it
will immediately flee. After a random period between 2 and 4 seconds, it
will stop fleeing and come back for more.

In addition to this, a few other things have been done, some only
related because they're in files I touched.
- Moved proteons from the file for the Cleric's Den to their own file in
the basic constructs folder. Given that they're used in several
different ruins, they might as well not just be in the file for one.
- Simple constructs have been cut, and with them the procs for
healing/repairing on shades and cult structures, as those are no longer
needed.
- Because I was touching it anyway, I touched up the file for trap
structures. They no longer use any one-letter variable names, and time
is now universally listed in seconds rather than deciseconds in that
file.
- I removed a completely unused blackboard key from ice demons. This is
something I noticed due to a change I ended up not making while working
on proteon AI, but I figured I might as well leave it gone.
## Why It's Good For The Game

Kills the last three simple construct typepaths, bringing us to the
destined 19 removed. Huzzah!

The proteon AI routine should inject a little spice into fighting
proteons, especially for the unprepared - unlike many mobs, they won't
stand there and take it if you decide to fight back, but you can never
safely ignore them when they run away. They still aren't particularly
dangerous.
## Changelog
🆑
refactor: Proteon constructs now use the basic mob framework. The ones
encountered in ruins are a bit flightier now, and will briefly flee
combat if attacked - only so that they can return and menace you again
soon after. Please report any bugs.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-11-01 17:07:20 -06:00
Profakos
bc18450afe Converts traders to basic mobs (#79187)
## About The Pull Request

This PR converts the two trader mobs into basic mobs, these being the
basic debug trader that buys ectoplasm and sells ghost burgers, and Mr
Bones, who buys empty milk cartons and bones, and sells bone relate
paraphernalia.

Traders now use dynamic appearance generation. The old sprites still
exist as hallucinations, and as shop signs.

Trader UI is now summoned via `COMSIG_ATOM_ATTACK_HAND`, which properly
cancels the attack chain, so there is no longer need to put it on
Interact.

I kept most of the original behaviour, but moved them off into a
component. I have also cached all the images generated for the radials,
I hope I have not overengineered it. I have also created a new datum,
which stores the trader's wares, needs, and speech patterns.

Admins can put the component along with the trader data on any living
mobs with an AI controller, turning them into traders. Keep in mind that
most AI has random idle movement, meaning they have a chance to walk
off, closing your trader radial.


![image](https://github.com/tgstation/tgstation/assets/2676196/a2b216e9-f9bf-46e1-83fa-3a41c8447176)

The trader AI consists of the following, first, when a trader sees
someone, they will deploy their shop, if one does not already exists.
The shop consists of a chair, and a holographic sign. If you attack
them, they will chase you with their weapons, and then return to their
chair when victorious. If the chair is somehow destroyed, they will
create a new shop when they see a new potential customer.


![image](https://github.com/tgstation/tgstation/assets/2676196/ad5fcd5a-996c-490f-938b-6bc11c91c4ee)

Mr Bones uses a variant of the AI, where they will run at you, and
deploy their shop when they reach you. I call this the jumpscare
variant. Below you can see me getting actually jumpscared because Mr
Bones has stepped on a yelling frog when I opened the maintenance door.


![image](https://github.com/tgstation/tgstation/assets/2676196/f47a5baa-e32d-4454-97f9-d90d027003d2)

I have also made an element that toggles an ai controlled combat mode
when it gains a target, and when it loses it. I am using it to make
Traders unable to trade while they are trying to kill a robber. To aid
this, I a have made
`/datum/ai_controller/proc/sig_remove_from_blackboard` send the
`COMSIG_AI_BLACKBOARD_KEY_CLEARED` signal, in case the trader kills a
mob that deletes itself on death. This means I could remove a signup
`/datum/component/appearance_on_aggro` was doing towards Qdeleting.

Below you can see Mr Bones shooting me with candy corn.

![image](https://github.com/tgstation/tgstation/assets/2676196/489e1072-e15a-412c-a8eb-9a3f0cca7bf6)


![image](https://github.com/tgstation/tgstation/assets/2676196/8f74b50f-ea35-467c-bb07-2ef38f84c453)

Traders actually only shoot you until you are conscious, so I survived
here in crit. Most mobs don't have crit state, so they just die, so I am
sticking by this voice line.

Thank you @CoiledLamb  for help with the sale sign!

## Why It's Good For The Game

Two more mobs off the list. The AI and Componentized behaviours allows
us to set up new kind of traders.

## Changelog

🆑
refactor: Traders are basic mobs now. Please alert us of any strange
behaviours!
code: If there is only one option, radial lists will autopick it. This
behaviour can be turned off via a new argument.
/🆑
2023-10-31 01:49:56 +00:00
lizardqueenlexi
0036e13af0 Basic Constructs: Wraith (#79235)
## About The Pull Request

Converts wraith constructs to basic mobs. The last of the "mainline"
constructs, though there's still one to go after this.

Wraiths are pretty much the same as they've always been - speedy
constructs that pack a bit of a punch, built around doing hit-and-run
tactics with their ability to ethereal jaunt. Notably, I've converted
their ability to recharge their jaunts with attacks into a new
component, `recharging_attacks`. This can be placed on any basic mob to
let them recharge a cooldown action by landing hits, which could
possibly be useful in the future.

NPC wraiths are pretty straightforward, with a twist - they will always
chase down and beat to death the lowest-hp mob they can see. Happening
upon one of these while wounded will end very badly! While I originally
wanted them to be more flighty and use hit-and-run tactics, I couldn't
figure out a way to do this that didn't look kind of silly and make them
less effective overall.

In addition to the wraiths, I've done some much-needed cleanup to basic
constructs as a whole, improving some things and covering some things I
missed along the way.
- Ectoplasm drop types from constructs is now properly based on their
theme. I _believe_ I've done this in a way that will pass unit tests
this time, but we'll see if my local tests were being honest with me.
- Player-controlled constructs now attack faster. I didn't realize that
being basic mobs capped them to attacking once every 2 seconds, which is
a gigantic nerf over the simple animal version. I cut this to just 1
second, which should be much closer to how it originally was.
- Artificers actually seek out and heal the most damaged ally they can
find, instead of the least damaged. Turns out the sort was doing the
exact opposite order from what I thought, which became much more obvious
when using the same targeting behavior on wraiths.
- I put the PR number in the juggernaut update script, which I somehow
missed on that one.
- Removed the extraneous "noncult" construct subtypes that didn't do
anything. The Artificer one, which does something, is still around.
## Why It's Good For The Game

For the same reasons as the previous three. 5 more simple animals gone,
and only one construct to go until I can nuke simple constructs from the
codebase entirely. Other than that, the new component could possibly
come in handy in future designs, and the NPC behavior should hopefully
be a little scary - even if just a little.
## Changelog
🆑
refactor: Wraith constructs have been converted to the basic mob
framework. NPC wraiths are now extra cruel and will attack the
lowest-health mob they can see at any given time. Make sure this isn't
you! Please report any bugs.
fix: Artificers and juggernauts no longer attack significantly more
slowly than intended.
/🆑
2023-10-30 02:28:32 +00:00
lizardqueenlexi
9e18c6575a Basic Pirate NPCs (#79284)
## About The Pull Request

Converts hostile pirate NPCs to basic mobs - specifically, a subtype of
trooper. As their behavior is not meaningfully distinct from other
troopers, this conversion mostly just sticks them on the existing AI
behavior while keeping the rest the same.

Pirates do have one new thing going for them, though, to differentiate
them from other troopers. They use the new **plundering attacks**
component, which means that every time they land a melee attack, they
steal money from the bank account of whoever they hit. This requires the
target to be wearing an ID with a linked bank account, so it's not the
hardest thing in the world to hide your money from them - but it's still
something to be wary of! If killed, any mob with this component will
drop everything they've stolen in a convenient holochip.
## Why It's Good For The Game

Takes down 5 more simplemobs, and (I think) converts the last remaining
trooper-type enemy to be a basic trooper. (It's possible there's more
I've forgotten that could use the same AI, though.)

The money-stealing behavior is mostly good because I think it's funny,
but it also makes the pirates something a little distinct from "yet
another mob that runs at you and punches you until you die". They still
do that, but now there's a little twist! This can be placed on other
mobs too, if we want to make any other sorts of thieves or brigands.
## Changelog
🆑
refactor: Pirate NPCs now use the basic mob framework. They'll be a
little smarter in combat, and if you're wearing your ID they'll siphon
your bank account with every melee attack! Beware! Please report any
bugs.
/🆑
2023-10-30 02:27:46 +00:00
Jacquerel
0d5f9907a2 Shapechange health transfer tweaks (#79009)
## About The Pull Request

Fixes #78721
This PR does a handful of things behind the scenes to increase the
consistency of shapechange health tracking.

First of all we adjust the order of operations taken when you restore
the original body. The implementation as-was would remove the status
effect midway through and null a bunch of variables we tried to continue
using. This would result in several runtimes and code failing to run,
with the upshot that untransforming upon death would leave the caster
completely alive, with the corpse of its transformed shape at its feet.
Oops.

Additionally while testing this I realised that transferring the damagew
as also kind of fucked.
We wouldn't bother to do it at _all_ if you died, which is a shame, so I
made it simply heal you instead of reviving you so we can always do it.
Then as noted in the linked issue, we were applying all transferred
damage to a single limb, which could exceed the health of the limb and
remove damage. Now we spread it around the body.

Finally, applying damage to a human using the "force" flag would often
actually apply less damage to their _health_ than expected. This is
because arms and legs contribute only 75% of their damage taken to a
mob's overall health.
Now instead of reading `health` we read `total damage` which ignores the
limb damage modifier.

The end result of this is that if you transform into a corgi, take 50%
of your health, and transform back then you will have 50% of your health
as a human.
Previously the result would be that you'd have ~63%, then transforming
into a corgi would leave you with ~63% of a corgi's health, then
transforming back into a human would leave you at about 71%... and so on
and so forth. Now it doesn't do that.

## Changelog

🆑
fix: Dying when using (most) shapeshift spells will now kill you rather
than having you pop out of the corpse of your previous form.
fix: Damage will now be accurately carried between forms rather than
being slightly reduced upon each transformation.
/🆑
2023-10-26 01:30:53 +00:00
lizardqueenlexi
ff325208bf Monkey Business actually spawns monkeys on the station. (#79276)
## About The Pull Request

The monkey business unit test was apparently not actually spawning
monkeys on the station like it was supposed to. It was trying to find
open turfs inside of area _typepaths_, which obviously do not contain
turfs. Functionally, this means it was summoning a number of monkeys
into the same turf of the unit test z-level equal to the number of areas
on the station map. Now it will actually place one monkey in every area
of the station itself.

This was an incidental discovery while trying to diagnose #79147 with
Jacquerel. We still don't know what's causing that one, and I doubt this
will do anything about it, but nonetheless the unit test wasn't working
right.
## Why It's Good For The Game

Makes a unit test do what it was actually intended to do, which is put a
bunch of monkeys all over the station and see if they ruin anything.
This might actually cause _more_ test failures since they're being put
in a less controlled environment, but we'll see.
## Changelog
Nothing player facing.
2023-10-25 18:09:41 -07:00
lizardqueenlexi
b65f729901 Nanotrasen basic mobs. (#78917)
## About The Pull Request

First and foremost, converts all Nanotrasen simplemobs into basic mobs.

To avoid messy and redundant code, or god forbid, making Nanotrasen mobs
a subtype of Syndicate ones, I've made Syndicate, Russian, and
Nanotrasen mobs all share a unified "Trooper" parent. This should have
no effect on their behaviors, but makes things much easier to extend
further in the future.

While most of this PR is pretty cut-and-dry, I've done a couple notable
things. For one, all types of ranged trooper will now avoid friendly
fire, instead of shooting their friends in the back. Even the Russians
have trigger discipline.

I've also created a new AI subtree that allows mobs to call for
reinforcements. I've hopefully made this easy to extend, but the
existing version works as follows:

- A mob with this subtree that gains a target that is also a mob will
call out to all mobs within 15 tiles.
- If they share a faction, mobs receiving the call will have the target
added to their retaliate list, and have a new key set targeting the
calling mob.
- If they have the correct subtree in their AI controller, called-to
mobs will then run over to help out.

Sadly, this behavior is currently used only by a few completely unused
Nanotrasen mobs, so in practice it will not yet be seen.

Finally, I've fixed a minor issue where melee Russian mobs punch people
to death despite holding a knife. They now use the proper effects for
stabbing instead of punching.
## Why It's Good For The Game

Removes 8 more simple animals from the list.

As said above, making all "trooper" type mobs share a common parent cuts
down on code reuse, ensures consistency of behavior, and makes it much
easier to add new troopers not affiliated with these groups. I expect
that I'll make pirates share this same parent next.

The new "reinforcements" behavior, though extremely powerful, opens up
exciting new opportunities in the future. There aren't many existing
behaviors that allow basic mobs to work _together_ in interesting ways,
and I think adding some enemy teamwork could be fun.
## Changelog
🆑
refactor: Hostile Nanotrasen mobs now use the basic mob framework. This
should make them a little smarter and more dangerous. Please report any
bugs.
fix: Russian mobs will now actually use those knives they're holding.
/🆑
2023-10-24 23:20:27 +00:00
lizardqueenlexi
6dde9e4c4e Basic Constructs: Juggernaut (#79170)
## About The Pull Request

Converts juggernaut constructs to basic mobs. These guys are really
simple, so this is a pretty straightforward one.

The one notable thing about this PR is that I got annoyed that
projectile reflection code was copy-pasted in two different places (the
main one for things like the ablative trenchcoat, and right here on the
juggernaut). So, trenchcoat-style reflection is now a proc on
`/obj/projectile`, which is used in both places.

AI-controlled juggernauts are as simple as befits these big lugs, doing
nothing but slowly walking toward mobs and beating them to death with
their giant fists.
## Why It's Good For The Game

Removes another 5 simple animals.

Not too much else to say about this one, but it's easier to make
projectiles bounce off of things now if anyone wants to do that.
## Changelog
🆑
refactor: Juggernaut constructs now use the basic mob framework. Please
report any bugs.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-10-23 23:53:19 -06:00
lizardqueenlexi
9e6cbf2538 Basic skeletons (#79206)
## About The Pull Request

Turns skeletons (the simple animal version) into basic mobs. This was
another incredibly simple conversion, since skeletons don't really do
anything but walk at you and beat you to death.

Because I thought it was funny, though, skeletons will now seek out
cartons of milk and drink them. Real milk will heal them for a
significant amount, but soymilk, being false milk, will deal them
grievous injury instead! Skeletons beware... I didn't add any other
sorts of milk due to limited ability with existing AI behaviors to
identify milk containers (they actually only look for the carton items).

Other than that, I've done some flavor adjustment for skeletons' attacks
- their effects and sounds will now suit the weapon they're actually
holding - for example, skeleton templars now actually use their swords
instead of slashing you with their horrible fingers. Along with this I
gave the basic skeletons a normal slashing sound, instead of the weird,
impactless hallucination sound they used to use for some reason. I never
liked that sound.

Finally, I've reflavored the spear-wielding skeleton mobs to "undead
settlers", following the naming of the corpses dropped by snow legions
as of #76898, rather than being named after an offensive term for Inuit
people. These skeletons do, after all, appear in settlements on alien
worlds.

To enable the flavor of milk drinking, I expanded the `basic_eating`
component to allow drinking rather than eating flavor, with a different
sound and its own set of verbs. This deletes whatever they drink from,
but c'est la vie.
## Why It's Good For The Game

Ticks 6 more entries off the simple animal freeze. While skeletons are
still extremely simple, being largely-identical mobs that only exist to
beat you to death, being basic mobs should make them slightly better at
this job. Also, again, I think it's really funny that you can distract
skeleton mobs with milk, or even hurt them.
## Changelog
🆑
refactor: Hostile skeleton NPCs now use the basic mob framework. They're
a little smarter, and they also have a slightly improved set of attack
effects and sounds. They love to drink milk, but will be harmed greatly
if any heartless spaceman tricks them into drinking soymilk instead.
Please report any bugs.
/🆑
2023-10-23 23:48:22 -06:00
lizardqueenlexi
1b8bcd0365 Basic drones (#79109)
## About The Pull Request

Fixes #68825
Fixes #72249
Fixes #70184

Converts maintenance drones to use the basic mob framework. As drones
don't use AI, this was mostly a perfunctory conversion, but I took the
opportunity to clean up drone code a bit and fixed a few bugs.

Noteworthy changes:
- Drones now have a `can_unhack` field. This is set to FALSE on
syndrones, because unhacking them doesn't make them stop being evil but
does cause some weirdness. Syndrones are unused right now, but you never
know.
- Drones use the Dextrous component for hand-having.
- Drones no longer have an internal ID card, instead being given
all-access with the `simple_access` component.
- Picking up drones now works the same as for other mobs, instead of
pointlessly copying the code into `attack_hand`. As a consequence, it is
now possible to punch drones if you want to for some reason.
- Drones can now reboot/cannibalize dead drones without being in combat
mode.
- Cannibalizing a drone that contains a client no longer runtimes - the
client is ghosted ahead of time.
- Drones now have TRAIT_ADVANCEDTOOLUSER, allowing them to properly
interact with machines.
- Trying to screwdriver a dead drone now gives a balloon alert about why
you can't do that.

In addition to these changes, I cleaned up the code quite a bit,
organizing things better and placing more useful comments throughout.
And removing a hell of a lot of single-letter variable names.

I will note that this PR does _not_ address #72129. The issue there is
that sprites for drones-as-hats are entirely nonexistent, and I'm not a
spriter. It shouldn't be too hard to fix if someone makes dronehat
sprites, though!

## Why It's Good For The Game
Kills 8 more simple animals.

In addition to that, drones were clearly a bit neglected, so this fixes
them up a bit and makes the code a little bit clearer. Maybe not that
much clearer, but it's something. It certainly leaves them in a better
place for further work if anyone wants to do that. Plus, a bunch of bugs
and other jankiness are fixed now, which is nice.

## Changelog
🆑
refactor: Maintenance Drones now use the basic mob framework. This
shouldn't come with any noticeable gameplay changes, but please report
any bugs.
fix: Drones can now interact normally with electrified doors.
fix: Drones' built-in tools can no longer be placed in storage objects
and/or thrown on the floor.
fix: Drones can now perform right-click interactions correctly, such as
deconstructing reinforced windows.
fix: Drones can now reboot or cannibalize other drones without being in
combat mode.
/🆑
2023-10-21 23:36:48 +00:00
Jolly
6a9a323f5f GAGSify colored/job labcoats (#79096)
## About The Pull Request
Title.

## Why It's Good For The Game
Cuts down on sprites, converts colored labcoats into GAGS labcoats.

GAGS labcoats are primarily built by 3 components on top of the, well,
actual labcoat.

- The shoulder parts
- Back pattern
- Belt/sash thing

<details>
<summary> Before Image </summary>


![image](https://github.com/tgstation/tgstation/assets/70232195/b8f953ca-91c8-4320-ad3b-a6c09001f946)

</details>

<details>
<summary> After Image </summary>


![image](https://github.com/tgstation/tgstation/assets/70232195/eb228b20-d992-441d-8240-96a1acb92dbb)

</details>

## Changelog

🆑 Jolly
image: Colored labcoats have been GAGSed! Please report any weird
oddities on Github.
fix: The coroners lab coat is no longer offset by one pixel.
/🆑
2023-10-21 18:39:23 +01:00