Commit Graph

56 Commits

Author SHA1 Message Date
SkyratBot
d538bf0de0 [MIRROR] Optimize find_potential_targets self cost [MDB IGNORE] (#25883)
* Optimize find_potential_targets self cost (#80602)

![image](https://github.com/tgstation/tgstation/assets/35135081/84ae20b6-5f44-4a69-bda3-0df1435dea5c)

`find_potential_targets/perform` currently has a pretty bad self cost in
part due to it running a second "loop over everything in range" check to
find turrets and mechs. This doesn't drop it down by as much as I'd like
because it still needs `hearers`, it still shows up pretty high, but
this at least cuts out some unnecessary work.

Best case is likely to minimize work AIs need to do when there are no
players on their z-level, as there are a lot of calls from Lavaland.

* Optimize find_potential_targets self cost

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-12-28 07:55:30 -08:00
SkyratBot
2ed6af479c [MIRROR] [NO GBP] Fixes even more AI related CI runtimes [MDB IGNORE] (#25682)
* [NO GBP] Fixes even more AI related CI runtimes (#80262)

## About The Pull Request

Consider this a continuation of
https://github.com/tgstation/tgstation/pull/80202

![firefox_P62DdMv946](https://github.com/tgstation/tgstation/assets/13398309/1a784a27-e5c9-42d1-b160-7eb9251b3997)

~~It seems I missed a few.~~

Edit: Modified per request to handle this more broadly. If a pawn gets
`qdel`'d, the ai controller should be set to off and get removed from
the list of active controllers, and all their actions should be
canceled.

Also adds some qdeleted checks to `finish_action()`, which can still run
after the pawn gets qdeleted as part of the `CancelActions()` chain.

## Why It's Good For The Game

Less spurious CI failures.

## Changelog

Nothing player facing really.

* [NO GBP] Fixes even more AI related CI runtimes

* Update _ai_controller.dm

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-12-17 15:00:53 +00:00
SkyratBot
3d816fc0d5 [MIRROR] basic cleanbots refactor and new janitor skillchip [MDB IGNORE] (#25511)
* basic cleanbots refactor and new janitor skillchip

* Update medbot.dm

* UpdatePaths

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-12-08 19:59:00 -05:00
SkyratBot
6627b1a9c1 [MIRROR] Refactors Parrots into Basic Mobs (ft. Ben10Omintrix/Kobsamobsa) [MDB IGNORE] (#25100)
* Refactors Parrots into Basic Mobs (ft. Ben10Omintrix/Kobsamobsa)

* UpdatePaths

* Modular, cleanup, porting parrot commands into the new system

* makes poly slightly less of a dick

* Update parrot.dm

* Update parrot.dm

* Update tgstation.dme

* Revert "Update tgstation.dme"

This reverts commit a8b40c4aba524c271db02c271089664649dea1eb.

---------

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-11-20 09:57:34 -05:00
SkyratBot
2f4010c992 [MIRROR] Removes final remnants of 'targetted' [MDB IGNORE] (#24927)
* Removes final remnants of 'targetted' (#79626)

## About The Pull Request

Finishing what https://github.com/tgstation/tgstation/pull/79513/
started, removes 'targetted' typo from code. Also updates the basic mob
guide with the new updated var names.

## Why It's Good For The Game

Typos bad. Accurate guides good.

## Changelog

🆑
code: gets rid of the rest of the instances of 'targetted' typo from
code
/🆑

* Removes final remnants of 'targetted'

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-11-11 08:11:32 -05:00
SkyratBot
bbd547ec95 [MIRROR] Targeting Datums Renamed (and global) [MDB IGNORE] (#24885)
* Targeting Datums Renamed (and global) (#79513)

## About The Pull Request

[Implements the backend required to make targeting datums
global](6901ead12e)

It's inconsistent with the rest of basic ai for these to have a high
degree of state, plus like, such a waste yaknow?

[Implements
GET_TARGETING_STRATEGY](d79c29134d)

Regexes used:
new.*(/datum/targetting_datum[^,(]*)\(*\)* -> GET_TARGETING_STRATEGY($1)

Renamed all instances of targetting to targeting (also targetting datum
-> targeting strategy)

I've used GET_TARGETING_STRATEGY at the source where the keys are
actually used, rather then in the listing. This works out just fine.

## Why It's Good For The Game

Not a misspelled name through the whole codebase, very slightly less
memory load for basically no downside (slight cpu cost maybe but not a
significant one.

---------

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

* Targeting Datums Renamed (and global)

* Update dogs.dm

* Modular

* Modular

* Modular

* Merge skew?

* Revert "Merge skew?"

This reverts commit 0889389ab5cb5c56655f1860d9173ba87efe9a22.

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-11-09 16:37:48 -05:00
SkyratBot
b5eb26abcc [MIRROR] Basic Constructs: Wraith [MDB IGNORE] (#24655)
* 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.
/🆑

* Basic Constructs: Wraith

* Update defcon2.dmm

---------

Co-authored-by: lizardqueenlexi <105025397+lizardqueenlexi@users.noreply.github.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-10-31 03:00:50 -04:00
SkyratBot
e501a5c02e [MIRROR] Converts traders to basic mobs [MDB IGNORE] (#24673)
* 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.
/🆑

* Converts traders to basic mobs

---------

Co-authored-by: Profakos <profakos@gmail.com>
2023-10-31 02:16:50 -04:00
SkyratBot
6e2fcee00b [MIRROR] Basic Constructs: Artificer [MDB IGNORE] (#24456)
* Basic Constructs: Artificer (#79015)

## About The Pull Request

Really getting into the meat of the constructs now. Artificers have
become basic mobs.

On the whole, this was a pretty rote conversion, with no significant
gameplay changes other than the switch to using healing hands rather
than a unique heal ability. The player experience as an artificer is
more or less identical.

The _interesting_ part comes with the AI for the seldom-used "hostile"
variant. Hostile artificers, being squishy and laughably weak, are now a
dedicated "medic" role for constructs. They will perform triage, always
seeking the most wounded construct (or shade!) to give healing to. They
will not attack at all, but they _will_ flee with great speed if
attacked and not busy healing. If they are healing another construct,
they will remain even if they are beaten to death.

I've added some more AI functionality that may come in handy in the
future, and done some refactoring to keep things from getting out of
hand:
- A planning subtree for finding targets that will always select the
most heavily wounded living target that the mob can see (or rather, the
one with the least health). Useful again for medical triage, or for
making a particularly cruel mob that always attacks whoever is easiest
to kill. I plan to use this for NPC wraith constructs when I convert
them.
- Targeting datums can now check a blackboard key to see if they should
only target wounded mobs. This is particularly useful for "medic" type
mobs such as this one.
- I've refactored the "minimum stat" behavior of targeting datums to be
stored in a blackboard key. This removes the need to have unique
subtypes for each different minimum stat we might want. Which... for the
most part, weren't even used, leading to proliferation of several
completely identical targeting datums in a bunch of different files.
Hopefully this change will make things cleaner.

In addition, this PR fixes a pair of bugs from #78807 that I didn't
catch:
- Healing constructs can now actually heal shades. Turns out I forgot to
add the correct biotype.
- Healing hands, when set to print the target's remaining health, no
longer does so as a visible message.

The one thing I didn't do that I kind of wanted to is make NPC
artificers heal themselves when wounded and not busy doing something
else, but it ended up being kind of annoying to make a mob willingly
target itself. NPC artificers never had this behavior before, so I
consider it okay, but maybe I'll circle back to it later.
## Why It's Good For The Game

Another basic conversion, another 5 items off the checklist. Very little
should change in-game, though I think the new NPC AI could make for
interesting challenges in ruins or bitrunning or something.
## Changelog
🆑
refactor: Artificer constructs have been converted to the basic mob
framework. This should change very little about them, but please report
any bugs. NPC artificers are now smarter, and will focus on healing
nearby wounded constructs - if you see them, take them out first!
/🆑

* Basic Constructs: Artificer

* Modular

* Modular paths

* Modular paths

---------

Co-authored-by: lizardqueenlexi <105025397+lizardqueenlexi@users.noreply.github.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-10-20 02:54:31 -04:00
SkyratBot
cffff937f6 [MIRROR] new syndicate item - bee smoker [MDB IGNORE] (#24450)
* new syndicate item - bee smoker (#78988)

## About The Pull Request
this adds a new item for traitor botanists they can buy for 4 tc. it
releases smoke which hypnotizes bees to follow ur every command, it can
be used on a single bee or it can be used on a hive to hypnotize all the
bees who live there. u can command the bees to enter or exit their
beehive, and u can also command them to spiral around u where they will
follow u and swirl around u to confuse whichever opponent u are
fighting, and u can also command them to attack people. the bee smoker
comes with some fuel but u can recharge it by putting cannabis into it.
the stronger the weed the more fuel it will provide

https://github.com/tgstation/tgstation/assets/138636438/18c9a350-8e24-4c49-abfa-dffb7622502f

## Why It's Good For The Game
adds a traitor item which gives a new gameplay alternative for botanist
and pacifist players. also i noticed the pet targetting datum was using
some copy paste code so i made it a subtpye of the basic targetting
datum

## Changelog
🆑
add: added a new syndicate item - the bee smoker
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>

* new syndicate item - bee smoker

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
2023-10-20 00:29:10 -04:00
SkyratBot
3869212f81 [MIRROR] Mook village and basic mook refactor [MDB IGNORE] (#24269)
Mook village and basic mook refactor

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2023-10-11 02:32:36 -04:00
SkyratBot
fd1d9e4ee8 [MIRROR] Fixes fleeing behaviour [MDB IGNORE] (#24223)
* Fixes fleeing behaviour (#78821)

## About The Pull Request

This PR does three things:
- Fixes fleeing, I broke it in a recent PR so mobs would walk to a
location then sort of stand there doing nothing. This is due to using
`>=` instead of `>`.
- Makes lobstrosities stop running and charge at you more responsively
(when they detect they can charge).
- Inverts the `BB_BASIC_MOB_FLEEING` blackboard key to
`BB_BASIC_MOB_STOP_FLEEING` so that the default behaviour is "to perform
the behaviour that you put on the mob" instead of to not do that.

## Why It's Good For The Game

Makes commonly used behaviour work properly.
Removes footgun we hand to ai developers.

## Changelog

🆑
fix: Cowardly mobs will consistently run away from you instead of
getting tired and just sort of standing there after an initial burst of
movement.
/🆑

* Fixes fleeing behaviour

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-10-09 07:34:46 -04:00
SkyratBot
08f914ed28 [MIRROR] Basic Heretic Mobs: The Rest of Them [MDB IGNORE] (#24155)
* Basic Heretic Mobs: The Rest of Them

* Update tgstation.dme

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-10-07 19:13:32 -04:00
SkyratBot
58c20a99fb [MIRROR] Basic blob mobs [MDB IGNORE] (#23938)
* Basic blob mobs

* Update blackmesa.dmm

* Modular update

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-09-30 00:15:55 -04:00
SkyratBot
37a8f73ae3 [MIRROR] Basic Legion & Hivelord [MDB IGNORE] (#23964)
* Basic Legion & Hivelord

* Update modular + fix diffs

* Fixing diffs

* More diffs

* Adds an AI behavior to replace the 'wander = 0' varedit for the hivelord gate guardians

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-09-27 22:30:02 -04:00
SkyratBot
997480df18 [MIRROR] basic mobs ranged attacks can check for friendly fire [MDB IGNORE] (#23918)
* basic mobs ranged attacks can check for friendly fire (#78451)

## About The Pull Request
basic mobs can check for friends in the way before firing a attack. if
they find someone in the way they will try to adjust their position so
their friends dont get hit by the projectiles

## Why It's Good For The Game
nice optional feature people can put on the monsters they create

## Changelog
🆑
add: added ranged attack friendly fire checks for basic mobs. minebots
and hivebots will now try to avoid shooting their friends
/🆑

* basic mobs ranged attacks can check for friendly fire

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2023-09-26 00:55:42 -07:00
SkyratBot
7509292edd [MIRROR] Basic Mob Brimdemon [MDB IGNORE] (#23863)
* Basic Mob Brimdemon (#78424)

## About The Pull Request

Fixes #71330

The brimdemon was basically already perfect (well, it has a novel means
of attacking) so I didn't get too fancy with this one, it's _largely_
just a straightforward conversion.
Following this change it's a little slower to back off, but better at
lining up with people in order to blast them. Additionally, its beam is
now a mob ability so you can give it to other mobs if you so desire.

Because I can't help doing a _little_ tinkering, Brimdemons now explode
2.5 seconds after they die, after a brief warning animation.

## Why It's Good For The Game

Simple mobs must die

## Changelog

🆑
add: Brimdemon corpses release an explosion shortly after death, just to
keep you on your toes.
refactor: Brimdemons now use the basic mob framework which (should)
improve their pathfinding somewhat. Please bug report any unusual
behaviour.
admin: The brimdemon's beam ability can be given to any mob, for your
Binding of Isaac event
/🆑

* Basic Mob Brimdemon

* Modular

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-09-23 03:52:28 -04:00
SkyratBot
c2639c816b [MIRROR] Synchronise AI and Player basic mob melee behaviours [MDB IGNORE] (#23780)
* Synchronise AI and Player basic mob melee behaviours (#78337)

## About The Pull Request

I like for things that mobs do to be consistent regardless of whether
they are controlled by a player or by the AI.
One big offender of this is the melee behaviour cooldown. Basic mobs
piloted by AI have arbitrary melee attack cooldowns which are not
reflected when they are controlled by players who can generally attack
much faster (but in _two_ instances, slower).
To remedy this I added `melee_attack_cooldown` as a var on
`living/basic` (sinful) and the ai now uses NextMove to not click too
often, meaning that players can only bite things as often as the AI can
and also that if you VV the cooldown it can speed the AI up (or slow it
down) as well as a player.
This also gets rid of a lot of subtypes of that datum, as we mostly made
them to change the cooldown.

I also hunted down a few places where there was behaviour placed inside
an AI behaviour which wasn't easily replicable by a player piloting the
same mob, preferably a player should be able to do everything that the
AI can.
Fixing this was largely a simple case of moving code from
`ai_behaviour/melee_attack/perform` to `basic/mob_subtype/melee_attack`
and also adding an element for one thing shared by three different mobs.

Strictly speaking I didn't need the element that much because a player
is perfectly capable of clicking on something they attack to drag it,
but it's nice for it to be automatic?

## Why It's Good For The Game

If you see a mob do something then you should also be able to do it.
Mobs shouldn't have significantly different capabilities when controlled
by a player (aside from usually being smarter).

## Changelog

🆑
balance: Player-controlled basic mobs attack as fast as those mobs can
when controlled by the AI
balance: Player-controlled Faithless can paralyse people they attack,
like the AI does
balance: Player-controlled Star Gazers (if an admin felt like making
one) apply the star mark on attack and deal damage to everything around
them, like the AI does
/🆑

* Synchronise AI and Player basic mob melee behaviours

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-09-18 15:23:14 -04:00
SkyratBot
cafdcdd886 [MIRROR] fix basic mobs ranged burst attacks [MDB IGNORE] (#23554)
* fix basic mobs ranged burst attacks (#78163)

## About The Pull Request
the burst attacks wasnt working because a cooldown in the ranged
component qwas added recently. this now moves the burst attacks option
to the component itself so even sapiant player mobs can use these burst
ranged attacks

## Why It's Good For The Game
fix basic mobs ranged burst attacks

## Changelog
🆑
fix: basic mobs can now use ranged burst attacks
/🆑

* fix basic mobs ranged burst attacks

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2023-09-06 21:55:29 -04:00
SkyratBot
18b0abe4b3 [MIRROR] minebots basic bots [MDB IGNORE] (#23529)
* minebots basic bots (#78032)

## About The Pull Request
Transforms the minebots into basic robots. You can now command these
minebots to extract minerals for you. To activate automated mining mode,
simply instruct them with the command "mine." They will then proceed to
autonomously mine walls and gather ores. If you wish to make the bot
deposit all the collected ores, use the command "drop." Alternatively,
you can leave it in collection mode, and it will gather all the ores you
mine. Additionally, the bot now responds to several more commands; you
can instruct it to follow you, toggle its lights on or off by saying
"lights." In attack mode, it refrains from mining or collecting ores but
will engage in combat alongside you. If it detects you as deceased or
unconscious, it will alert all miners, request assistance, and relay
your coordinates via the mining communication channel. to power it on u
will need to feed it any type of ore first so it may listen to ur
commands

## Why It's Good For The Game
makes the non sapiant minebots more useful

## Changelog
🆑
refactor: the minebots have been refactored please report any bugs
add: minebots can now mine walls and collect ores automatically and they
will alert everyone if they find u dead
/🆑

* minebots basic bots

* Modular

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-09-05 06:46:11 -04:00
SkyratBot
6442f06979 [MIRROR] fix basic ranged mobs not chasing the victims [MDB IGNORE] (#23468)
* fix basic ranged mobs not chasing the victims (#78073)

## About The Pull Request
if the victim is outside the shooting distance the mob will go through
an endless cycle of finding the target and deleting the target instead
of chasing them

## Why It's Good For The Game
fix basic ranged mobs not chasing the targets

## Changelog
🆑
fix: basic ranged mobs will now chase victims
/🆑

* fix basic ranged mobs not chasing the victims

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2023-09-02 17:37:31 -04:00
SkyratBot
2e319c8820 [MIRROR] minor improvement to mob run away behavior [MDB IGNORE] (#23377)
* minor improvement to mob run away behavior (#77924)

## About The Pull Request
my attempt to improve mobs running away from danger

## Why It's Good For The Game
improve the running away behavior of mobs here is a before and after of
me chasing a rabbit in the church for reference

before:

https://github.com/tgstation/tgstation/assets/138636438/f6e5e237-a444-4410-9fe1-525810f475fc

after:

https://github.com/tgstation/tgstation/assets/138636438/94849f4a-aaf6-4862-880b-4a6a44c4341d

## Changelog
🆑
fix: mobs do not get stuck when running away from danger
/🆑

* minor improvement to mob run away behavior

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2023-08-28 01:54:27 -04:00
SkyratBot
3bbd9a254a [MIRROR] basic ice whelps [MDB IGNORE] (#23077)
* basic ice whelps (#77493)

## About The Pull Request
i have refactored ice whelps into basic mobs. They are now the artistic
sort as theyll mark their territory by seeking out icy rocks and carve
out statues of theirselves using their claws to serve as a warning to
players/animals that this is dragon turf and theyll also go out of their
way to burn any trees in vicinity just for the hell of it. they are now
gruesome cannibals if they find a corpse of one of their kin near them
theyll go eat it for nurishment. AS for combat, they have a new ability
which allows them to release fire in all directions however theyll only
use this ability once their enraged meter is full. to make it fair ive
given them a new component which allows them to telegraph abilities and
only do them after a delay so players can react in time for it.

## Why It's Good For The Game
basic mob refactor

## Changelog
🆑
refactor: ice whelps have been refactored to basic mobs
add: ice whelps have a new dangerous ability which theyll use once their
enraged meter is full
/🆑

* basic ice whelps

* Modular paths

---------

Co-authored-by: SMOSMOSMOSMOSMO <95004236+SmoSmoSmoSmok@users.noreply.github.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-08-14 19:17:20 -04:00
SkyratBot
40df076b36 [MIRROR] Fixes things about goliaths: wallhacks/range hacks(no, really) and tentacles not spawning in mineral turfs; also fixes find_potential_targets wallhacks [MDB IGNORE] (#22919)
* Fixes things about goliaths: wallhacks/range hacks(no, really) and tentacles not spawning in mineral turfs; also fixes `find_potential_targets` wallhacks (#77393)

## About The Pull Request

Goliath's sand digging behaviour could potentially target a turf that's
actually unreachable by the goliath, e.g.
```
G#
#T
```
where G - goliath # - wall T - target turf. fixed that, but i think
there could be something easier here, maybe instead grabbing turfs in
goliath's `view()`? unsure

The component goliaths use to telegraph their attacks
(`basic_mob_attack_telegraph`) casts a `do_after()` to perform the
attack, but it was not actually checking for the target staying in melee
range, as it was using the source goliath as both `user` and `target`,
so it didn't actually care at all for the target. Implemented an
`extra_checks` to `Adjacent()` since that's the closest we get for melee
range shenanigans I suppose
This still allows the source basicmob to attack the target if the target
moves around the source basicmob.

`!`Goliaths were also able to summon tentacles on a target that moved
into cover and still stayed in the `find_potential_targets` target
range. Which meant more wallhacks. This was a thing for the base
`find_potential_targets`, meaning that every basic mob using it was a
dirty haxxor (or very vengeful). Fixed that by making
`find_potential_targets` also check for `can_see()` before proceeding
further down `find_potential_targets/perform()`. `!` The only exception
to this check currently are bileworms.

`!`Goliath tentacles were not spawning in mineral turfs as their
`Initialize()` checked for closed turfs before handling mineral turf
mining. Fixed that as well.

## Why It's Good For The Game

![Dr__Hax_by_Didgeridoo_Dealer](https://github.com/tgstation/tgstation/assets/75863639/fbcbfc1b-f489-435e-bb01-677f55398787)

## Changelog

🆑
fix: fixed goliaths digging sand that they can't actually reach (behind
windows or inbetween closed turfs)
fix: fixed goliaths melee attacking their target despite the target
running away from goliath melee range
fix: fixed goliath tentacles not spawning in mineral turfs
fix: fixed goliaths summoning tentacles on targets that moved behind
cover but stayed in their targeting range. this applies for most basic
mobs, really, so if any basic mob was targeting you despite you hauling
ass behind cover, they shouldn't anymore
/🆑

* Fixes things about goliaths: wallhacks/range hacks(no, really) and tentacles not spawning in mineral turfs; also fixes `find_potential_targets` wallhacks

---------

Co-authored-by: Sealed101 <cool.bullseye@yandex.ru>
2023-08-07 09:42:53 -04:00
SkyratBot
377bf92754 [MIRROR] Basic Lobstrosity [MDB IGNORE] (#22827)
* Basic Lobstrosity (#77253)

## About The Pull Request

I'm slowly chipping away at mining mobs. These ones also got some new
sprites because the old ones were a bit weird except when facing South.

![image](https://github.com/tgstation/tgstation/assets/7483112/015b8819-bab8-471a-86ae-70b1597ae327)
Arctic Lobstrosities are now hairy to give them a little more visual
distinction from Lavaland ones.

In terms of behaviour, they're now a little faster and can charge you
from further away.
They will _only_ attack players who are incapacitated in some way
(primarily from being hit by their charge, but could be from a Goliath
or something too) and will otherwise keep their distance until they can
charge again. They move slower for a short duration after charging
though, so you have time to slap them a bit.

If a Lobstrosity downs you then it will try to snip off one of your
arms, then retreat in order to eat it.
Obviously nobody likes losing an arm, but this does give you an
opportunity to get away while it is distracted? Funnily enough the way
our health system works means that sometimes losing that arm actually
takes you out of soft crit so you can stumble back to the station for a
replacement (or try to wrestle yours back?)

All of these things are achievable also by a player if you make one
sapient, they will pull arms off mobs they attack which are in crit and
can eat arms if they see them lying around if they want.
I added an element to let you dismember people with your bare hands,
maybe someone evil can use it to add a beheading attack some day.

Here's a video of their new behaviours:
https://www.youtube.com/watch?v=9eKxsH7hD7Q

## Why It's Good For The Game

Gives mobs more character.
Reduces our list of frozen simple mobs.
Replaces some ugly side sprites.
Medbay enrichment?

## Changelog

🆑
refactor: Lobstrosities are now basic mobs and have different AI
behaviour. Please report anything which seems like it shouldn't be
happening.
add: Lobstrosities will now only opportunistically attack things they
have knocked over with their charge, and are otherwise timid.
add: Lobstrosities are hungry for fingers and will steal one of your
arms if they defeat you in combat, although this gives you time to crawl
away.
sprite: New sprites for Lobstrosities.
/🆑

* Basic Lobstrosity

* Modular paths

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-08-01 21:00:44 -04:00
SkyratBot
3fa227223a [MIRROR] convert the bear to a basic mobster [MDB IGNORE] (#22751)
* convert the bear to a basic mobster

* Merge conflicts

* Fixing the diffs

* Merge conflicts

* Update mob.dm

* Update VoidRaptor.dmm

* why is this pr so cursed

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-07-29 04:40:27 -04:00
SkyratBot
49f61b14a9 [MIRROR] make the pinguen a basic animal [MDB IGNORE] (#22568)
* makes the pinguin a basic animal (#76790)

## About The Pull Request
the penguin now is a basic animal and also now he can go and layed
penguin eggs to make penguin babys also the baby have a new behavier he
will now go and looked for his mom and when he found his mom he will
went to her and be happy when he close to his mom or if he mom is died
he will went to her body and he will be sad and also i putted this
behavier in the baby chicken. also now the pinguen mom will go and
looked for her eggs and when she find a egg she will putted it in the
middile of her legs and walked with it
![penguin with a
eggs](https://github.com/tgstation/tgstation/assets/138636438/e5f3d741-edc0-438f-b1b3-9e4ed2280532)

## Why It's Good For The Game
the pinguen now is a advance ai
## Changelog
the pinguen now have a more advance

🆑
refactor: the penguin is a basic animal
add: the penguin now layed eggs
add: the penguin and the chicken babys will go look for adult penguin or
chicken and be happy when he is near the adult
/🆑

* make the pinguen a basic animal

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2023-07-18 17:00:04 -04:00
SkyratBot
0a03e8a2a7 [MIRROR] Machine list is now stored in SSmachines | Remove excessive use of global lists for specific machine types [MDB IGNORE] (#22481)
* Machine list is now stored in SSmachines | Remove excessive use of global lists for specific machine types

* Resolve merge conflicts

* Modular adjustments

* destroy this double return on destroy

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: Giz <vinylspiders@gmail.com>
2023-07-15 22:51:23 -04:00
SkyratBot
ed294532c6 [MIRROR] transform the paper wizard from a simple to a basic [MDB IGNORE] (#22452)
* transform the paper wizard from a simple to a basic (#76688)

## About The Pull Request
i transfered paper wizard from simple to a basic and i also gaved him
new fetures he can go and do. now when he will go and walked when he
walks there will be a paper effects when he goes to walk. also he will
he will now go to look for paperes on the floor and then he will write
stuff inside the paper, so a player can maybe distracted the wizard with
a paper because the wizard will stop atacked him for a bit until he
finished writted stuff inside the paper. i follow the instrucions in the
learn-ai md to maked this to a new ai subtree behavier.

## Why It's Good For The Game
the paper wizard is now a basic so he is a better ai and he also have
more feture to gaved him depth mechanics

## Changelog
🆑
refactor: paper wizard have been refactored, please report any
bugs/unintended behavior
refactor: refacted the datum/elememt/trial to an bespoken element
add: paper wizard now have effects when he walking and he will now go
and look for paperes and write stuff in them
/🆑

* transform the paper wizard from a simple to a basic

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2023-07-14 13:10:55 -04:00
SkyratBot
2ba69d8b54 [MIRROR] basic mobs & co no longer indiscriminately perform close-range actions in the presence of obstacles. [MDB IGNORE] (#21521)
* basic mobs & co no longer indiscriminately perform close-range actions in the presence of obstacles. (#75687)

## About The Pull Request
Currently, we don't have any such thing as a general ai_behavior flag
for behaviors that need a check for if the current_movement_target is
within reach or not. We could fix it case by case by slapping a
`CanReach()` check in the `performBehavior()` definition of every
`ai_behavior` datum that warrants it, the general issue will keep
resurfacing as long as new behaviors are added to the game anyhow, while
there's a lot less copypasta involved easier to apply solution to
current and future instances of such issue.

Worth mentioning not all ai_behaviors with required_range of 1 have this
flag. Some are fairly innocuous, such as the follow command, some others
kind of handle it already in a more peculiar or complex way, which is
also an argument against making it a hardcoded heck for when the
required_range is 1 or 0.

This has been tested, though there are some rough edges and oddities
also unrelated to his PR that might have evaded scrutiny.

## Why It's Good For The Game
This should fix #74823, fix #69254, and fix #74713 (I guess? it could
have been phrased better).

## Changelog

🆑
fix: basic mobs & co no longer indiscriminately perform close-range
actions in the presence of obstacles such as directional windows between
them and their target.
fix: Doggos should look at you with longing eyes once again if you dare
pick up an edible they are trying to eat.
/🆑

* basic mobs & co no longer indiscriminately perform close-range actions in the presence of obstacles.

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2023-05-31 23:15:23 +12:00
SkyratBot
7028b1d32e [MIRROR] Converts Spiderlings from Structures to Basic Mobs [MDB IGNORE] (#20852)
* Converts Spiderlings from Structures to Basic Mobs (#75001)

If I could've made this more atomic, I would have in a heartbeat, trust
me.

## About The Pull Request

Hey there. People were mocking us for having spiderlings still be a
subtype of `/obj/structure`. I decided to take a lot of time to fix
that. A lot of behavior it was implementing was just pseudo-mob stuff,
so it was actually easier than it looked for the raw conversion. A lot
of the footwork on spider stuff in the basic framework was already done
previously by Jacquerel, so that was pretty nice.

However, there are two new things that weren't introduced in the code
that had to be put in.

A) A component to handle growth and differentiation into a mob. This may
have already existed, no clue. If it does (and it's NOT
evolutionary_leap), let me know.
B) AI Behavior to handle seeking out a vent, entering a vent, and then
exiting out of a different vent. I may have gone a bit wacky on the
code, but it certainly works as expected (spiderling goes in one vent,
exits the other). Let me know if you can think of a way it can be better
optimized, but it was deliberately written to be very failsafey in case
shit goes yonkers.

One fundamental difference between structure spiderlings and basic mob
spiderlings (beyond the AI and not just a random prob() check for
movement) is the fact that they had vent movement coded in... but we
_really_ don't need stuff like that for our intents and purposes. If the
range turns out to be too OP in the current framework, we can always
change it up a bit, but also there's a _lot_ of vents we can end up in
the station (my testing had one spiderling end up in the AI sat to get
obliterated).
## Why It's Good For The Game

Spiderlings aren't structures! They behave like a mob should! Players
can possess spiderlings! They work seamlessly with differentiating into
a giant spider! Better AI! More room for people to add into this very
under-utilized buggers!
## Changelog
🆑
refactor: Spiderlings are now basic mobs, report any complete
weirdness/deviation from known behavior. They should be a lot more
intelligent now though.
add: AI Spiderlings are super fragile, but they're also super fast,
especially when they get into a vent. Once they're in circulation, they
could end up everywhere! Maybe in the armory, maybe in a locked closet
in maintenance. Be sure to be vigilant and splat them whenever you can
to save the station from a whole lotta heartache!
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>

* Converts Spiderlings from Structures to Basic Mobs

---------

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
2023-04-30 12:54:58 -07:00
SkyratBot
e6f66d3a4a [MIRROR] Experiment with replacing weakrefs in AI blackboard with deleting signals, ideally making it easier to work with and harder to cause hard deletes [MDB IGNORE] (#20719)
* Experiment with replacing weakrefs in AI blackboard with deleting signals, ideally making it easier to work with and harder to cause hard deletes (#74791)

## About The Pull Request

Replaces weakref usage in AI blackboards with deleting signals

All blackboard var setting must go through setters rather than directly

## Why It's Good For The Game

This both makes it a ton easier to develop AI for, and also makes it
harder for hard deletes to sneak in, as has been seen with recent 515
prs showing hard deletes in AI blackboards

(To quantify "making it easier to develop AI", I found multiple bugs in
existing AI code due to the usage of weakrefs.)

I'm looking for `@ Jacquerel` `@ tralezab` 's opinions on the matter, also
maybe `@ LemonInTheDark` if they're interested

## Changelog

🆑 Melbert
refactor: Mob ai refactored once again
/🆑

* Experiment with replacing weakrefs in AI blackboard with deleting signals, ideally making it easier to work with and harder to cause hard deletes

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2023-04-26 21:17:15 +01:00
SkyratBot
8164175aa2 [MIRROR] Turns Deer into Basic Mob - They Freeze At The Sight of Vehicles [MDB IGNORE] (#20711)
* Turns Deer into Basic Mob - They Freeze At The Sight of Vehicles (#74784)

## About The Pull Request

deers only show up in the BEPIS but i decided that they would be easy
enough to turn into a basic mob (they were). it was so easy in fact that
i decided to dip my toes into coding AI behavior, and made them freeze
up whenever they see a vehicle. this required a lot of code in a bunch
of places that i was quite unfamiliar with before starting this project,
so do let me know if i glonked up anywhere and i can work on smoothing
it out.
## Why It's Good For The Game

one less simple animal on the list. deers staring at headlights is
pretty cool i think, neato interaction for when you do get them beyond
the joke the bepis makes

i'm also amenable to dropping the whole "deer in headlights" code if you
don't like that for w/e reason- just wanted to make them basic at the
very least
## Changelog
🆑
add: If you ever happen upon a wild deer, try not to ride your fancy
vehicles too close to it as it'll freeze up like a... you know where I'm
going with this.
/🆑

---------

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

* Turns Deer into Basic Mob - They Freeze At The Sight of Vehicles

---------

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
2023-04-23 14:01:36 -04:00
SkyratBot
9a594755f3 [MIRROR] Renames delta time to be a more obvious name [MDB IGNORE] (#20507)
* Renames delta time to be a more obvious name

* updates to our code

---------

Co-authored-by: oranges <email@oranges.net.nz>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2023-04-12 20:45:43 +01:00
SkyratBot
470baf671d [MIRROR] Reduce carp migration devastation [MDB IGNORE] (#20445)
* Reduce carp migration devastation (#74608)

## About The Pull Request

I'm not totally satisfied with the amount of random destruction caused
by space carp wandering around, they should certainly be dangerous and
annoying but the random nature of their spawning and pathfinding means
that they would trap themselves in random rooms and then smash all of
the machinery in there.
Because they could attack any dense object they perceived as being in
their way that could result in venting random gas canisters, breaking
terminals, or I even once saw them destroy the supermatter cooling loop
by eating the thermomachines.
While the latter is pretty funny, arbitrary destruction of machines
simply caused because a fish teleported into a room without you knowing
isn't really very engaging and doesn't create very interesting stories.
This ultimately isn't meant to be a heavily destructive event and its
probability to run isn't tuned as if it is.

So, a couple of changes:

I reduced both the range and cooldown of the carp teleporting ability.
This means that AI carp can use it to pathfind past obstacles pretty
reliably and don't spend so much time smashing things, and also reduces
the chances of them getting the drop on you from a location you can't
see.
I also added a short click cooldown to carp travelling through other
carp rifts so people being teleported _to_ have more of an advantage
over people ambushing them (this was already true for the carp creating
the rift).

Additionally I added an optional whitelist to the "attack obstacles to
your pathfinding" AI script, and heavily culled the kind of obstacles
that carp will attack to be ones which are mostly replaceable. They will
still cause a mess and might even vent a room, but they won't smash
vital infrastructure.

Finally I replaced a couple of instances of `get_ranged_target_turf`
with `get_ranged_target_turf_direct` for better precision, and player
carp using the ability can now just click anywhere on the screen and it
will jaunt in that rough direction. With the reduced range, having to
click within its radius was pretty annoying.

With these changes I ran the event 10 times in a row on kilo and then
watched JoJo's bizzarre adventure for 90 minutes and when I came back
the level of destruction seemed pretty reasonable (aside from the big
hole where one of them ran into the supermatter and delaminated it, but
if there were players around that wouldn't happen).

## Why It's Good For The Game

This event was still just a little bit _too_ annoying.
If something destroys important machines it should have happened on
purpose via an event which was supposed to do that, rather than through
chance. Or preferably just be player-driven.

## Changelog

🆑
balance: Carp can't teleport as far, but can do it more frequently.
People who piggyback through their rifts will be blocked from attacking
for a short duration (the same as the normal attack cooldown).
balance: AI controlled carp will now be more selective about which
objects they smash. Player controlled carp (or carp directly instructed
to attack objects by people who have tamed them) can still attack
whatever they like.
/🆑

* Reduce carp migration devastation

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-04-09 19:11:58 -07:00
SkyratBot
7f31d138c4 [MIRROR] Basic Wumborian Fugu & Fugu Gland [MDB IGNORE] (#19369)
* Basic Wumborian Fugu & Fugu Gland

* Update spider_variants.dm

* wew

* Update wumborian_fugu.dm

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2023-03-10 04:52:34 +00:00
SkyratBot
88f8ef7adc [MIRROR] Netherworld Mobs Refractor [MDB IGNORE] (#19181)
* Netherworld Mobs Refractor

* Update statues.dm

* Update tgstation.dme

* w

---------

Co-authored-by: Comxy <tijntensen@gmail.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2023-03-10 02:44:53 +00:00
SkyratBot
3f0344a741 [MIRROR] Basic Mobs can no longer melee attack you from an arbitrary range [MDB IGNORE] (#19239)
* Basic Mobs can no longer melee attack you from an arbitrary range

* Update targetting.dm

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: KathrinBailey <53862927+KathrinBailey@users.noreply.github.com>
2023-02-24 02:55:48 +00:00
lessthanthree
c7e7cb494f [MANUAL MIRROR] Lazarus Injected mobs don't fight each other (#19072)
* Dominate & Lazarus Inject basic mobs. Lazarus Injected mobs don't fight each other. (#72440)

Fixes #72404
The Lazarus Injector doesn't currently work on basic mobs, but should.

Problem:
The EMPed state of the Lazarus Injector is intended to make a revived
mob hostile to everyone except you, including other mobs you have
revived wtih an EMPed Lazarus Injector.
This is trivial to achieve for Simple Mobs which essentially all share
the same AI, but I could not think of a single workable solution for
Basic Mobs which don't, or at least any which didn't come with a tedious
requirement to closely consider this niche item when programming any
additional AI.

Solution:
Change the default behaviour of the Lazarus Injector so this is not a
problem.
If all it does it make the mob loyal to you _and_ friendly to other mobs
which are loyal to you, then it's pretty easy because we can just use
the existing faction flags.

This is unambiguously a buff to using the item for nefarious purposes as
now if you revive four ice drakes and fulton them onto the station they
won't kill each other until only one is left, but is the only workable
solution I could really think of.
A lot of the very dangerous mining fauna can't be dragged so
transporting your army to the station still poses a question.

The alternate solution was just to replace the AI controller of any
emp-revived basic mob with a "zombie" AI controller, but this has the
problem that
A- It would now make things like cows and dogs into hostile creatures
when they previously weren't.
B- It loses any interesting behaviour the mob previously had and for
cases like Bileworms doesn't even make any sense (they'd try to walk and
just get stuck in place).
This ultimately leads to needing to make bespoke versions for various
mobs, which doesn't seem desirable from a maintainability standpoint.

As a side note it's still not a great idea to revive Bileworms _anyway_
as, their ability to move is tied to their ability to attack so once
they don't have a target they will just kind of sit there and if they
_do_ get a target their attempts to help you fight are difficult to
distinguish from attempts to kill you... but at least being able to
revive them makes it easier to make one sapient if you really want to
trap a player's mind inside a body which is incapable of leaving
lavaland.

Additional edit:
At Fikou's suggestion I've also added a sentience comparison proc to
`mob/living` and removed some code duplication which dealt with this
problem in the sentience/mind transfer potions, as well as added it to
the Dominate spell.

This device is meant to revive mobs and it shouldn't be required for
players to memorise an arbitrary list of which mobs it does and doesn't
work on.
Especially as the goal is eventually that all simple mobs should be
basic mobs.
This way of working is more intuitive, even if it is also stronger. I
was surprised when I used EMPed injectors and my "new minions" just
killed each other.

🆑
fix: You can now revive 'basic mobs' with a Lazarus Injector, such as
dogs, cows, axolotls, or carp.
fix: The same category of mobs can also now be effected by the Runic
Golem Dominate spell.
fix: Basic Mobs will switch target if they can no longer attack their
current target; meaning that if you become a Bileworm's friend it will
stop attacking you.
balance: Mobs injected with the Lazarus Injector while it is EMPed will
no longer attack other mobs revived by EMPed Lazarus Injectors.
/🆑

* Update code/modules/research/xenobiology/xenobiology.dm

* Update code/modules/research/xenobiology/xenobiology.dm

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
2023-02-10 20:22:23 +00:00
SkyratBot
71a25960db [MIRROR] Basic mobs won't shoot walls / Basic mobs won't leave permanent bullet casings [MDB IGNORE] (#18719)
* Basic mobs won't shoot walls / Basic mobs won't leave permanent bullet casings (#72494)

## About The Pull Request

Basic mobs using the generic ranged attack behaviour will now not
attempt to shoot a target which they can no longer see.
If they can still see you through a window that's fine because shooting
in your direction will probably break the window eventually, but a mob
knowing you're on the other side of a wall and pointlessly firing at it
isn't useful.

Additionally, adds a component to bullet casings fired by basic mobs
which deletes them after 30 seconds.

https://user-images.githubusercontent.com/7483112/211012442-027455c7-2846-426e-89fb-c8c89d891e4f.mp4

Here's a demonstration but sped up so they vanish after 5 seconds
instead.

## Why It's Good For The Game

![image](https://user-images.githubusercontent.com/7483112/210862278-f58111d9-917b-43c4-8fa0-b58c02ae8ab5.png)
We're not actually sure that's where these 75,000 bullet casings came
from (it's probably related to that pAI down there) but it's one way it
could happen.

Players with limited ammo leaving persistent bullet casings should
rarely be a problem, mobs have infinite ammo and so should not be able
to generate infinite debris. Having them just sort of disappear after 30
seconds is... less than immersive, but I feel like it's better than the
alternative.
You can attach the element to other things to thanos snap them if you
want.

## Changelog

🆑
fix: Syndicate mobs will no longer attempt to shoot you through walls,
building up massive piles of empty bullet casings in the process.
qol: Bullet casings from "weapons" fired by certain mobs will clean
themselves up after 30 seconds.
/🆑

* Basic mobs won't shoot walls / Basic mobs won't leave permanent bullet casings

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-01-14 12:25:53 -08:00
SkyratBot
4689ba515a [MIRROR] Some tweaks to mobs running away [MDB IGNORE] (#18720)
* Some tweaks to mobs running away (#72529)

## About The Pull Request

Mice running away behaviour wasn't working quite how it was supposed to
due to a couple of bugs.
First of all, the action was written as if it would `perform` every
tick, which it doesn't. This means that the code checking if you had
left line of sight didn't function, meaning mobs would continue fleeing
you even when they couldn't see you any more.

Secondly, mobs spent an awful lot of time pathing into walls which was
especially noticeable on mice who just would _not_ stop repeatedly
squeaking in a way that is kind of funny but gets old when you keep
hearing it. Now the pathing stops if it hits a barrier.
I'm not... totally fond of this solution because it has a few
assumptions baked in (that we want to try and path through doors even if
they're dense for one) but I can't for the moment think of a better
"path away from" implementation that isn't way more complicated, and
this doesn't really need to be complicated.

For good measure I noticed a couple of other actions weren't passing a
`source_atom` into `is_blocked_turf` so rats were potentially attacking
"obstacles" they could simply walk over.
Additionally a couple of places were setting
`controller.movement_target` directly instead of using the helper method
which has a minor risk of runtiming under certain conditions.

## Why It's Good For The Game

Mice will stop constantly screaming if they can see someone, and should
repath once they have a different escape route more quickly rather than
dedicating themselves to trying to burrow through an iron wall.
Rats won't bite at tables and racks they can just climb over.

## Changelog

🆑
fix: Mice won't try to path through walls to escape from sight and
constantly squeak.
fix: Mice will stop running away from you if they can't see you any
more.
fix: Rats won't bite racks and tables while passing over them.
/🆑

* Some tweaks to mobs running away

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-01-14 12:18:07 -08:00
SkyratBot
ff97c189db [MIRROR] Dogs use the Pet Command system [MDB IGNORE] (#18393)
* Dogs use the Pet Command system

* modular pets

* modular dogs

* oops

* NO

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
2023-01-09 08:06:58 -05:00
SkyratBot
cc326f6a87 [MIRROR] Basic Mob Carp IX: Carp Rifts & Migration [MDB IGNORE] (#18581)
Basic Mob Carp IX: Carp Rifts & Migration

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
2023-01-09 07:58:06 -05:00
SkyratBot
7ee524f748 [MIRROR] Basic Mob Carp Part VIII: Basic Mob Carp [MDB IGNORE] (#18344)
* Basic Mob Carp Part VIII: Basic Mob Carp

* maps

* missed killing main carp file

* shorki and ocean biomes

* shorki 2: pet-a-boogaloo

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
2023-01-09 05:48:50 -05:00
SkyratBot
30530f2c96 [MIRROR] AI actions won't unassign each other's movement targets & Mice stop being scared of people if fed cheese [MDB IGNORE] (#18268)
AI actions won't unassign each other's movement targets & Mice stop being scared of people if fed cheese  (#72130)

## About The Pull Request

Fixes #72116 
I've had a persistent issue with basic mob actions reporting this error
and think I finally cracked it
When replanning with `AI_BEHAVIOR_CAN_PLAN_DURING_EXECUTION` it can run
`Setup` on one action leading to the plan changing, meaning that it runs
`finishCommand` to cancel all other existing commands
If you triggered a replan by setting up a movement action in the middle
of another movement action, cancelling the existing action would remove
the target already set by the current one.
We want actions to be able to remove _their own_ movement target but not
if it has been changed by something else in the intervening time.

I fixed this by passing a source every time you set a movement target
and adding a proc which only clears it if you are the source... but this
feels kind of ugly. I couldn't think of anything but if you have a
better idea let me know.

Also while I was doing this I turned it into a feature because I'm
crazy.
If you feed a mouse cheese by hand it will stop being scared of humans
and so will any other mice it attracts from eating more cheese. This is
mostly because I think industrial mouse farming to pass cargo bounties
is funny.
Mice controlled by a Regal Rat lose this behaviour and forget any past
loyalties they may have had.


https://user-images.githubusercontent.com/7483112/208779368-3bd1da0f-4191-4405-86e5-b55a58c2cd00.mp4

Oh also I removed a block about cancelling if you have another target
from the "hunt" behaviour, everywhere using this already achieves that
simply by ordering the actions in expected priority order and it was
messing with how I expected mice to work.
Now if they happen to stop by some cheese they will correctly stop
fleeing in order to eat it before continuing to run away.

## Why It's Good For The Game

Fixes a bug I kept running into.
Makes it possible to set up a mouse farm without them screaming
constantly.
Lets people more easily domesticate mice to support Ratatouille
gameplay.

## Changelog

🆑
add: Mice who are fed cheese by hand will accept humans as friends, at
least until reminded otherwise by their rightful lord.
fix: Fixed a runtime preventing mice from acting correctly when trying
to flee and also eat cheese at the same time.
/🆑

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-01-07 23:30:49 -08:00
SkyratBot
80d1906bd1 [MIRROR] Basic Mobs can run away [MDB IGNORE] (#18196)
* Basic Mobs can run away (#71963)

## About The Pull Request

That's right I'm still atomising #71421, some day I might even post
something related to carp.
This PR adds various behaviours to basic mobs allowing them to run away,
in a couple of variations.

Mice will flee from anyone who doesn't share their factions, at all
times (so they will scatter from most humans, but not regal rats).
Rabbits and Sheep will flee from anyone who has attacked them.
Pigs will run away from people who have attacked them, but only if
they're below half health.

https://user-images.githubusercontent.com/7483112/207127135-d1737f91-d3f7-468a-ac60-7c7ae5d6623d.mp4

Mice are still plenty catchable because they don't run _very far_ (or
very fast) but I think the chase will be good enrichment.

To achieve this I had to change the signal COMSIG_CARBON_HEALTH_UPDATE
into COMSIG_LIVING_HEALTH_UPDATE but frankly the latter seems more
sensible anyway.

## Why It's Good For The Game

More behaviours to use later when designing mobs, gradually gives mobs
more things to do rather than just sort of moving aimlessly around the
area you left them in.
It'll give people hunting rats in maintenance some exercise.

## Changelog

🆑
add: Mice will now run away from you, you have to catch them if you want
to eat them. Use those traps!
add: Rabbits, Sheep, and Pigs likewise won't just sit there and let you
pulverise them if they can see an escape route.
/🆑

* Basic Mobs can run away

* Modular!

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Funce <funce.973@gmail.com>
2023-01-07 23:51:47 +13:00
SkyratBot
bccf824a6c [MIRROR] Turned most syndicate mobs (+ viscerators) into basicmobs [MDB IGNORE] (#18270)
* Turned most syndicate mobs (+ viscerators) into basicmobs (#71871)

## About The Pull Request
Turns the syndicate simpleanimals into basicmobs: (+ stormtrooper, +
space variants) Base Mob, Knife syndies, pistol syndies, SMG
syndies,shotgun syndies, viscerators
also changes some instances of the simple_animal path into the basicmob
ones
Removes civillian syndicates which were useless and also completely
unused
Also removes mech pilots:
![2022-12-09
20_02_18-Window](https://user-images.githubusercontent.com/70376633/206777829-2e49e445-3532-4e8e-8e7c-8d9b0a3a14d0.png)

Also,
makes the basic targetting datums health check configurable
basic attack behavior can now fire in bursts

https://user-images.githubusercontent.com/70376633/206766607-cf2e3659-0c5e-4117-9af7-e573e35bdf80.mp4

https://user-images.githubusercontent.com/70376633/206766630-15b4469f-68be-44c7-9394-1f2b6fe07811.mp4

https://user-images.githubusercontent.com/70376633/206766613-69b42457-a03b-449d-a1b8-a5aa556c76e5.mp4

https://user-images.githubusercontent.com/70376633/206766619-5560a178-8d2f-4b22-adf1-22ace6f63a51.mp4

https://user-images.githubusercontent.com/70376633/206766627-e671d064-fd9e-4204-b823-aa2e07f7fc26.mp4

https://user-images.githubusercontent.com/70376633/206766633-108c1574-3554-4bc1-a9ac-8faed0ec4062.mp4
## Why It's Good For The Game

simpleanimal stinks basic mob good
syndicate AI was really bad to begin with so here we are

## Changelog
🆑
code: Turned most syndicate mobs into basicmobs, making their AI better
and (possibly) more deadlier!
del: Removed syndicate mech pilots and syndicate civvies
/🆑

Co-authored-by: kawoppi <94711066+kawoppi@ users.noreply.github.com>

* Turned most syndicate mobs (+ viscerators) into basicmobs

* map

* code

* Update syndibase.dmm

Co-authored-by: jimmyl <70376633+mc-oofert@users.noreply.github.com>
Co-authored-by: kawoppi <94711066+kawoppi@ users.noreply.github.com>
Co-authored-by: John Doe <gamingskeleton3@gmail.com>
Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>
2023-01-07 02:48:07 -05:00
SkyratBot
fcee54df91 [MIRROR] Pet Command Component + Regal Rats can order their subjects around [MDB IGNORE] (#18131)
* Pet Command Component + Regal Rats can order their subjects around (#71590)

## About The Pull Request

Another atomisation of #71421 but I had a fun idea while I was testing
it.

This adds a component based on the existing system for giving
instructions to tamed carp or dogs, but hopefully more modular.
It also gives it to the rat minions of a regal rat.
The basic function allows the mob to listen and react to spoken
commands, which passes things to its AI blackboard. Additionally if you
alt-click a commandable mob it will show a radial menu which both allows
you to select a command, and also contains tooltips explaining what they
do and what audible words trigger it.

<details>
  <summary>Video</summary>

https://user-images.githubusercontent.com/7483112/204308693-0eccebec-75c9-411c-81c5-5aa0d682d1a5.mp4

</details>

Now if you riot some rats, you can alt click on them individually to
give them specific orders (more useful for other creatures than rats),
or you can speak out loud to command your legion.
Rats aren't very smart so you can't give them many instructions, but
this is expandable for other creatures.

Additional change: Mice don't squeak if stepped on by other mice because
this made an absolutely unholy noise and I am not sure there's a way to
get non-dense mobs to spread out.

## Why It's Good For The Game

Allows for giving more mobs the ability to be tamed and instructable by
their owner, without copy/pasting code which lives inside a specific
mob.
Yelling at your rats to give them commands is funny. It also adds the
possibility of telling your rats to stop biting someone if they have
agreed to your demands, allowing for more courtly roleplay.
When Regal Rat is converted to a basic mob its AI can also give other
AIs instructions by yelling at them which I think is a good feature.

## Changelog

🆑
add: The followers of Regal Rats will now respond to simple
instructions, if given by their rightful lord. Except frogs. They're too
busy licking themselves and watching the colours.
/🆑

* Pet Command Component + Regal Rats can order their subjects around

Co-authored-by: Jacquerel <hnevard@gmail.com>
2022-12-20 14:19:47 +13:00
SkyratBot
23f97dbfca [MIRROR] Allows datum AI to switch to different movement datums [MDB IGNORE] (#17833)
* Allows datum AI to switch to different movement datums (#71595)

## About The Pull Request

Allows basic mobs / datum AI to switch between movement datums. Useful
if you need JPS in some moments, but simple obstacle avoidance in others

This isn't used anywhere yet, but is a building block for basic bots.

## Why It's Good For The Game

Allows us to pick the right tool for the job!

## Changelog

🆑 Capybara Holly
refactor: Datum AI can now switch to different movement datums in their
behavior.
/🆑

Co-authored-by: Capybara <Capybara@ CapybaraMailingServices.com>

* Allows datum AI to switch to different movement datums

Co-authored-by: CapybaraExtravagante <110635252+CapybaraExtravagante@users.noreply.github.com>
Co-authored-by: Capybara <Capybara@ CapybaraMailingServices.com>
2022-12-01 16:47:15 -05:00
SkyratBot
62c02030e3 [MIRROR] Convert mouse and rat to basic mobs [MDB IGNORE] (#17215)
* Convert mouse and rat to basic mobs

* run the UpdatePaths script you borb

* packs and nests

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
2022-10-28 21:27:47 -04:00