Commit Graph

14 Commits

Author SHA1 Message Date
Ben10Omintrix
0c34b84939 fixes tamed pets sometimes attacking one another (#92200)
## About The Pull Request
tamed pets would not let previous grudges go so theyd attack one another
even after theyve both been tamed by the same owner. this fixes that

## Why It's Good For The Game
fixes tamed pets sometimes attacking one another

## Changelog
🆑
fix: fixes tamed pets sometimes attacking one another
/🆑
2025-07-30 17:37:23 -04:00
Jacquerel
5bd8784918 Most hostile mobs can no longer be trapped by closets, chairs, and aggro grabs (#91652) 2025-06-21 22:36:04 -04:00
Jacquerel
380ce322a6 Apply AI Controller Admin Verb (#89375)
## About The Pull Request

Melbert asked me to make this and I thought it'd be relatively easy and
plausibly useful so I did.

This PR adds a feature to the VV menu for mobs which allows you to apply
and configure an AI controller from a list of templates.
It's not as versatile as coding one would be, but it should be able to
accomodate a lot of generic scenarios.

Some examples of basic stuff you can set it up to do:
- Give Ian a machine gun he will fire at nearby people while staying
within a specified min/max range.
- Have Poly fire brimstone beams on cooldown at whoever is nearby
(although she won't bother trying to line up cardinally).
- Assign a gorilla to be someone's personal bodyguard which will follow
them around and attack anyone who hurts them.

I have also made an executive decision to remove the restriction that
basic ai controllers can only be placed on basic mobs.
We've removed _most_ non-basic simple mobs from the game, and also have
more recently updated most AI behaviours to work agnostically of whether
they are assigned to a basic mob or not... which means that they'll
largely work on carbons.

Coincidentally, this feature makes sure to ask if you want an AI
controller to remain active on a mob which already has a client.
Assigning an active AI controller to a live player which forces their
character to automatically attempt to run away from whoever the last
person to attack them was is ~~not recommended behaviour because it's
largely untested~~ highly recommended behaviour because I think it's
very funny (makes it very hard to play though).

I'm gonna do another PR some time which cleans up `random_speech` so
it's configurable and then let you slap that on whoever as well.

## Why It's Good For The Game

Enables a greater level of admin abuse.

## Changelog

🆑
admin: Added easier tooling for admins to add or change the AI
controllers on mobs
/🆑
2025-03-12 15:45:46 -04:00
MrMelbert
72491a5e41 Fix monkeys ignoring grabs while restrained/in crit (#88041)
## About The Pull Request

Fixes #84338

When handcuffed or crit, you are unable to resist even a passive grab,
you are truly helpless

Yet monkeys ignore this

They ignore this because the code handling above is on the client:
`/client/proc/Process_Grab()`

The ideal fix for this is to move it off the client, but that carries a
bunch of order of operations shenanigans so I'll leave that for a more
in depth refactor of this kinda stuff

In the meanwhile we can simply tell AI controllers not to move if
grabbed and incapacitated (barring stasis)

## Changelog

🆑 Melbert
fix: Monkeys no longer ignore basic rules such as "you can't escape a
passive grab if you're cuffed or in crit"
/🆑
2024-11-21 18:18:47 +01:00
Ben10Omintrix
f698cea0f4 fixes ai controllers resetting their targets post do_afters (#87426)
## About The Pull Request
mobs would disregard you for a bit if they went through a do_after, such
as goldgrub digging or medbots healing. this fixes that

## Why It's Good For The Game
fixes ai controllers resetting their targets post do_afters

## Changelog
🆑
fix: fixes ai controllers resetting their targets post do_afters
/🆑
2024-10-25 01:49:00 +02:00
Ben10Omintrix
a99a1e6383 slightly redoes how animals hunt for food (#87166)
## About The Pull Request
before, if u wanted to make ur animal hunt for food, u had to give them
the find food subtree, the attacking subtree, and had to edit their
targeting stratedgy to include items. this makes it so u only have to
give them just 1 subtree which will handle everything it needs to. also
makes it alot more customizable, u can now set a hunger cooldown for ur
animals, and cute emotes for them to play after eating food

## Why It's Good For The Game
makes it more convenient for future devs to include food hunting
behaviors to their animals, while also making it more customizable

## Changelog
🆑
code: animals' food hunting behavior has been refactored, please report
any bugs
/🆑
2024-10-15 13:18:37 +13:00
Ben10Omintrix
8ca2c12e14 [no gbp] basic ai pauses during do afters (#86615)
## About The Pull Request
when making able_to_run event based, we forgot to account for this!

## Why It's Good For The Game
closes #86614

## Changelog
🆑
fix: fixes basic AI that are supposed to pause during actions not
pausing
/🆑
2024-09-14 22:25:37 +02:00
Ben10Omintrix
91baa94ac5 event based incapicated and able_to_run (#86031)
## About The Pull Request
this is a revival of #82635 . i got permission from potato to reopen
this, he did almost all the work. i only just solved the conflicts and
fixed all the bugs that were preventing the original from being merged
(but it should be TMed first)

## Why It's Good For The Game
slightly improves the performance of basic mob AI

## Changelog
🆑
LemonInTheDark
refactor: able_to_run and incapacitated have been refactored to be event
based
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: ZephyrTFA <matthew@tfaluc.com>
2024-09-04 10:02:49 -04:00
Jacquerel
5e2c8459dd Basic Heretic Mobs: The Rest of Them (#78757)
## About The Pull Request

Raw Prophet and Armsy had fun stuff going on and merited their own PRs,
but the rest of these guys are basically just statblocks with abilities
so I converted them all at once.

Rust Walkers are present in a ruin and so have new AI which will
actually use their abilities. They rust the area around where they spawn
and throw their rust blast at people.

I also gave Flesh Stalkers AI even though nobody has put them in a map
because I thought it would be cool. This adds an AI behaviour where if
they're not doing anything else they will turn into an animal and chill
until someone's been around them for a bit, before attacking. They will
also use EMP almost immediately upon performing their ambush, which
kills the lights in that room. Spooky!
To support this I needed to make some changes to let AI continue
processing and targetting correctly while shapeshifted.

I didn't give Maids or Ash Spirits AI because they'd be really boring.

Other changes:
I made the maid in the mirror flicker when it takes examine damage
because the `visible_message` says it does but despite having the power,
nobody made it actually flicker...

## Why It's Good For The Game

No more simple mob heretic summons.

## Changelog

🆑
refactor: Rust Walkers, Ash Spirits, Flesh Stalkers, and The Maid in the
Mirror now use the basic mob framework. Please report any unusual
behaviour.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2023-10-06 16:06:22 -06:00
Jacquerel
b2ecd81be4 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
/🆑
2023-09-22 19:12:43 -06:00
Jacquerel
7c30d9d746 Basic Wumborian Fugu & Fugu Gland (#73415)
## About The Pull Request

Fixes #72677 and also converted the "Wumborian Fugu" mob to a basic mob
rather than a simple one.
I will be totally honest: I didn't need to do that in order to fix the
bug. I just didn't like looking at the rest of the code in that file.
Also I have some kind of sickness which makes me do this.

This ended up being one of those "see something related and fix it as
well" ones so there's a couple of only tangentially related changes in
here. If you want me to split it up I will but I think this one is
_probably_ fine because the wide-ranging changes are pretty simple ones?

So what this PR does is:
- Refactors simple mob into basic mob.
- Cleans up its really ugly ability to work in a hopefully nicer way.
- A one line fix to the linked issue above.
- Modifies the default cooldown on `basic_melee_attack` and
`attack_obstructions` to be a widely used cooldown rather than a random
value used by no mob that we have.
- Renamed behaviour "try_mob_ability" to "targeted_mob_ability" and
added a new AI behaviour called "use_mob_ability", the difference
between the two being that the former requires a target and the latter
does not. I... don't actually use this because I realised after adding
it that I still want a target for this mob, but someone will need it
eventually.
- Change everywhere that is passing references to abilities to actions
to pass weak references instead.
- Adds an element to handle "spawn this stuff when a related mob dies".
- Found a few places where people were setting `environment_smash ` as
if it did anything (including me) and replaced them with the proper
ai_controller implementation instead, updated the comment to make it
clearer although that won't prevent copy/paste errors.
- Registered to the "movement speed updated" signal to ensure that basic
mobs actually notice that you have applied a movement speed modifier.

## Why It's Good For The Game

Fixes a linked issue.
Refactors some code which made me sad whenever I saw it.
Restores some mob behaviour which nobody noticed was missing, but was.
Fixes some apparently unreliable code I added in a recent PR reliant on
basic mobs using movespeed modifiers.
Adds element we will definitely need again in the future.

## Changelog

🆑

fix: The Fugu Gland can once more be used on Ian, Carp, Giant Spiders,
or other basic mobs.
fix: Syndicate mobs will once again attack windows to try to reach you,
and space ruin spiders won't.
fix: Netherworld-themed mobs will correctly adjust their speed as they
take damage.
refactor: Made the Wumborian Fugu into a basic mob, which should act
largely the same way but may have slightly different speed and reaction
times.
/🆑
2023-02-15 18:34:41 -07:00
AnturK
4d6a8bc537 515 Compatibility (#71161)
Makes the code compatible with 515.1594+

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

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

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

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-15 03:50:11 +00:00
tralezab
ed9e4c2067 AI improvements regarding taming and riding! (#69247)
* Cow AI improvevments and fixes for tamability and riding, no longer allowing you to grab the cow you're riding, and stopping AI cows from moving while being ridden.
2022-08-18 14:59:37 -04:00
AMonkeyThatCodes
46cb925af0 Basic Mobs: the cooler simple mobs that run on datum AI. (With reworked cockroach AI as proof of concept) (#60694)
Simple_animals / mobs are the biggest lie in this code-base. They're far from simple and have an extreme god-object problem. Especially when you get to /hostile, where there is so many procs, vars, and what not, that you can't make any interesting additions without snowflaking the hell out of the code.

This PR hopes to help kill this problem by introducing a new /living subtype, /living/basic. The idea of this refactor is to slowly start moving all old simple_animals to this new system, moving over behaviors like charging and more extravagant mobs like megafauna over bit by bit similar to how newfood was implemented.

One of the other big goals of this refactor is to move many of the fringe simple animal behaviors into either AI datums, or components/elements. (Some of which still needs to be done in this PR).

As a proof of concept, I created the base mob/living/basic, and moved cockroaches over to the system. Since cockroaches have both a passive, melee and ranged mob.

This PR does slightly affect balance as the behavior isn't 1-on-1 due to it no longer running on the janky /hostile behavior, but I tried to keep the effects to a minimum, and the glockroach and hauberoach are not spawnable through many means as far as I know.
2021-08-30 16:22:24 +01:00