Commit Graph

33 Commits

Author SHA1 Message Date
itseasytosee
bcfd895c14 Functionality for custom human examine messages when possessed by an AI controller. Implements on humans with monkey AI (#70356)
The "They don't appear to be themselves" line on humans that have AI controllers is now controllable by the AI controller, and is only "They don't appear to be themselves" by default.
Monkeized human now have the line
2022-10-13 18:00:32 -07:00
tralezab
85394d6b0a Fixes monkey ai runtime (#69601) 2022-09-01 22:12:42 +02:00
itseasytosee
497fa7b23f Monkey trip mechanic removed from AI controller and added to brain. Adds organ based trait system. (#69496)
Alright, big exciting PR.

First big thing! Traits can now be tried to organs which are granted and removed from the mob with the organ.
The traits PRIMATIVE, LITERATE, CAN_STRIP, and ADVANCED_TOOL_USER have been removed from species inherent traits list, because they apply to the species brain in specific, not their whole body.
The baseline brain gives the traits LITERATE, CAN_STRIP, and ADVANCED_TOOL_USER, all species that had these traits have a baseline brain.
Ashwalkers have been given a "primitive brain" which gives ADVANCEDTOOLUSER, CAN_STRIP, PRIMITIVE, and notably not literacy. These give them the same traits as before, but their privative nature and lack of reading followers their brain no matter which body they inhabit.

Monkeys have been given the "primate brain" which gives CAN_STRIP and PRIMITIVE. The monkey's brain now holds the logic for the monkey tripping mechanic instead of the AI datum which is a huge win. Monkeys with clients can also now toggle if they would like to be tripped by people, in order to better blend in. AI monkeys will always have tripping on. I also have implemented my qol monkey tripping changes from #69478 (the videos on that PR are still accurate)

What this means, is a human's brain in a monkey's body will still be able to use tools, read, and even operate mechs. but will still have the other non mental monkey traits like being able to crawl though vents while naked. So lovely.

Conversely a monkey's brain (even a sentient one) that is put in a human body will still be illiterate, and will be unable to use complex tools.

Transforming into a monkey via genetics or other means will also change your brain into a monkey brain (this mechanic existed before now, it just wasn't applicable)

Some of this code might not be up to standard, please give me your corrections.
2022-08-29 11:41:26 -07:00
itseasytosee
784ce3f568 Improvement to monkey AI's weapon selection ability. Won't attack With zero force items. (#69490)
Monkeys will now drop the item in their hand when selecting a weapon to attack with if it is worse than their basic bite attack, and will avoid picking up a weapon if they can't find one that's better than their basic bite attack.
Because of this, you can no longer completely disable monkeys by filling their hands with zero force items. This also means you can no longer trick monkeys into using sutures and other medical items on you.
2022-08-29 11:35:45 -07:00
Seth Scherer
f1a363c825 Converts a shitload of istypes to their more concise macros (#69260)
* Converts a lot of istypes() to use their istype macro helpers.
2022-08-18 22:08:44 -04:00
John Willard
b4f19a7e0f Greatly increases Pun Pun's abilities and strengths (using desk bells, cross stun immunity) (#68870)
About The Pull Request

Pun Pun has a new AI, with it they received the following:

    Instead of screeching/roaring/scratching/jumping/rolling, Pun Pun will instead sing/dance/bow/clear throat/sign.
    Pun Pun now rings desk bells instead of finding random shit to pick up, and doesn't intentionally seek out weapons.
    Pun Pun has a higher chance of giving people stuff in their hand, so the Bartender can give them a drink and let them go walking around.

Additionally:

    Pun Pun is now immune to being hardstunned by walking into them, giving them a little more bite for greytiders beating them up.
    Monkeys can now use desk bells.

Why It's Good For The Game

I like Pun Pun and when Monkey AIs were originally added, there was a note about giving them a unique AI. Since we're slowly turning the poor monkey into an actual Bartender assistant, I find it thematic that they would ring the bell and give out drinks in their hand, as if the Bartender taught them themselves.

For the hardstun immunity, I mostly did it because I find it annoying for a Bartender to have to carefully navigate around Pun Pun to not knock them over and make them drop an instrument (or anything else) in their hand, but it also works as a buff to people trying to kill them. Pun pun is a unique monkey so I don't believe they should be as easy to kill as any other.

Desk bell addition was necessary for Pun Pun to use it.
Changelog

cl
add: Pun Pun now gives stuff in their hand frequently and rings desk bells.
add: Pun Pun now has gentleman-like emotes, rather than screeching and roaring.
balance: Pun Pun no longer looks for weapons in their off time.
balance: Pun Pun is no longer vulnerable to stuns by being walked into.
qol: Monkeys can now use desk bells.
/cl
2022-08-05 12:38:59 +12:00
John Willard
cab70f4d1a Restores old monkey knockdowns (monkey nerf) (#65080)
Monkey knockdown used to be on Crossed until it was made an AI here: 55238

Now it instead uses COMSIG_ATOM_ENTERED, which only takes into account walking over the monkey. Something that you can't do unless you are non-dense or they are lying on the floor, in which case you aren't even knocking them down?
Now it uses COMSIG_MOVABLE_CROSS instead so it's how it used to be, actually functional and useful.
2022-03-03 13:45:52 -08:00
John Willard
968795fab7 Makes non-dense mobs not knock monkeys over (#65040)
Monkeys only get knocked over when you walk over them (not even when you swap places with them, which I thought was supposed to be the case), this makes non-dense mobs not knock them over. Which means Revenants, bots, small animals (lizards/butterflies), larvas, ect. will not knock monkeys over.
2022-02-22 09:22:40 +00:00
LemonInTheDark
f8aad14ae8 Harddel Fix Pack #42 + Better Live Reftracking Support (#63877)
* Hard Del Fixes, Ref Tracking Changes
2022-01-12 22:46:13 +01:00
Ghom
7d3b98705f Chimps no longer get grumpy when you hug them or throw things with no throw force at them. (#62685)
* Chimps no longer get pissed when you hug them.

* Pun Pun no longer hates hat throwing.
2021-11-09 22:54:05 -05:00
tralezab
3d37916558 Monkey subtree breakup refactor! (#61741)
Splitting up monkey ai into subtrees allows me to make a punpun ai after this pr is merged, makes stopping planning matter for the AI subtrees, and more generic subtrees that can be used by most ais

It also gets rid of bad practices like setting blackboards in the ai controller.
2021-10-10 22:19:33 +01:00
tralezab
d9ede137aa if you give a monkey an instrument, it will begin playing the donkey kong theme (#61726) 2021-09-27 16:35:15 -07:00
AMonkeyThatCodes
f2b6fcb253 Refactors datum AI idle behaviors into datums (#61455)
Co-authored-by: MonkeyThatCodes <monkey>
2021-09-18 23:00:17 -07:00
aaaa1023
f04df890dd fixes misspellings of "aggressive" in a few areas. (#61092)
Fixes the spelling of "aggressive" in a few items, comments and a define.
2021-08-30 20:49:35 +01:00
Timberpoes
5c601e026f Feex (#60976) 2021-08-22 15:39:34 +02:00
AMonkeyThatCodes
a1f113b0eb All AI datum behaviors are now added using a wrapper (#60667) 2021-08-20 20:39:59 -07:00
Watermelon914
ffe2750744 Refactors connect_loc_behalf into a component (#60678)
See title. Also refactors caltrops into a component because they use connect_loc_behalf which requires them to hold the state.

This also fixes COMPONENT_DUPE_SELECTIVE from just outright not working.

connect_loc_behalf doesn't make sense as an element because it tries to hold states. There is also no way to maintain current behaviour and not have the states that it needs.
Due to the fact that it tries to hold states, it means the code itself is a lot more buggy because it's a lot harder to successfully manage these states without runtimes or bugs. 

On metastation, there is only 2519 connect_loc_behalf components at roundstart. MrStonedOne has told me that datums take up this much space:
image

If we do the (oversimplified) math, there are only ever 5 variables that'll likely be changed on most connect_loc_behalf components at runtime:
connections,
tracked,
signal_atom,
parent,
signal_procs

This means that on metastation at roundstart, we take up this amount: (24 + 16 * 5) * 2519 = 261.97600 kilobytes
This is not really significant and the benefits of moving this to a component greatly outweighs the memory cost.

(Basically the memory cost is outweighed by the maint cost of tracking down issues with the thing. It's too buggy to be viable longterm basically)
2021-08-17 12:16:12 -07:00
Ghom
393c80136d Monkeys can now retaliate against xenomorph and animal attacks. (#60157)
Co-authored-by: Rohesie <rohesie@gmail.com>
2021-07-29 03:36:43 -07:00
ma44
7b5e83e1e9 Revives PR #58579; Sligh refactor to AI datums that allows for basic support of subtrees (#60249)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: coiax <yellowbounder@gmail.com>
Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Rohesie <rohesie@gmail.com>
Co-authored-by: Matthew J. <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: Jonathan Rubenstein <jrubcop@gmail.com>
Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
Co-authored-by: Jordan Brown <Cyberboss@users.noreply.github.com>
Co-authored-by: Fikou <piotrbryla@onet.pl>
Co-authored-by: Emmanuel S. <emmanuelssr@gmail.com>
2021-07-28 17:56:31 -07:00
Ghom
209d60913b Sentient monkeys are no longer knocked over by mobs in the way. (#60139)
Title. They used to be immune to this in the past, but then they were refactored into a species and things have changed.
2021-07-26 13:47:18 -03:00
Rohesie
2c5a357035 Reverts Entered() passing dir instead of old loc (#59910) 2021-07-01 17:06:42 -07:00
LemonInTheDark
6fcbce39cd Makes turfs persist their signals, uses this to optimize connect_loc (#59608)
* Makes turfs persist signals

* Splits connect_loc up into two elements, one for stuff that wishes to connect on behalf of something, and one for stuff that just wants to connect normally. Connecting on behalf of someone has a significant amount of overhead, so let's do this to keep things clear

* Converts all uses of connect_loc over to the new patterns

* Adds some comments, actually makes turfs persist signals

* There's no need to detach connect loc anymore, since all it does is unregister signals. Unregisters a signal from formorly decal'd turfs, and makes the changeturf signal persistance stuff actually work

* bro fuck documentation

* Changes from a var to a proc, prevents admemems and idiots

* Extra detail on why we do the copy post qdel
2021-06-22 23:12:34 -04:00
Rohesie
e03cd1aada Refactors move procs to support multitle objects (#59658)
Enter(), Entered(), Exit() and Exited() all passed the old loc forward, but everything except a single a case cared about the direction of the movement more than about the specific source.
Since moving multi-tile objects will have multiple sources of movement but a single direction, this change makes it easier to track their movement.

Cleaned up a lot of code around and made proc inputs compatible.

I'll add opacity support for multi-tile objects in a different PR after this is merged, as this has grown large enough and I don't want to compromise the reviewability.

Tested this locally and as expected it didn't impair movement nor produced any runtimes.
2021-06-20 14:55:37 -07:00
LemonInTheDark
f90e8cf7a3 Fixes a bunch of harddels that are sourced from player action (#59371)
Sourced from #59118 and a cursed project I'll pr later, This pr contains a lot of harddel fixes for stuff that pops up after a player interacts with something. I'm not gonna list them all here because there's something like 60 130, check the commit log if you're curious

Oh and I moved ref tracking screaming to a separate define, and made some optimizations to the thing in general. I think that's it, this pr is a bit of a frankenstine
2021-06-10 21:44:23 -03:00
Kylerace
08df8798ce (code bounty) refactors all uses of Crossed() and Uncrossed() into signals sent to loc, tracked by connect_loc (#58340)
Co-authored-by: Jared-Fogle <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
2021-05-07 03:54:03 -07:00
Emmett Gaines
4367cb09bd Adds new wrinkles to monkey brains (#58631)
This does a variety of improvements to monkey ai that I got drawn into after fixing a relatively simple bug with monkeys and guns. This pr is in support of #58565 so that in the rare chance pun pun gets a gun, they know how to use it. Previously #16630 made it so monkeys could use guns but semi-recently that was broken. Now that's fixed and in addition some other monkey ai capabilities were enhanced, read the changelog for the full list.
2021-05-04 08:32:31 +01:00
LemonInTheDark
7f444f510e Fixes a ton of harddels (#57736)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
2021-03-17 05:51:53 -07:00
Qustinnus
bb8faec7a1 Adds a subsystem for ai movement (#57111)
* done

* straight walk

* movement

* yep

* removes unused macro

* done

* Update ai_movement.dm
2021-02-23 22:29:32 +01:00
Qustinnus
707fc287b4 Replaces intents with combat mode (#56601)
About The Pull Request

This PR removes intents and replaces them with a combat mode. An explanation of what this means can be found below
Major changes:

    Disarm and Grab intents have been removed.
    Harm/Help is now combat mode, toggled by F or 4 by default
    The context/verb/popup menu now only works when you do shift+right-click
    Right click is now disarm, both in and out of combat mode.
    Grabbing is now on ctrl-click.
    If you're in combat mode, and are currently grabbing/pulling someone, and ctrl-click somewhere else, it will not release the grab (To prevent misclicks)

Minor interaction changes:

Right click to dissasemble tables, racks, filing cabinets (When holding the right tool to do so)
Left click to stunbaton, right click to harmbaton
Right click to tip cows
Right click to malpractice surgery
Right click to hold people at gunpoint (if youre holding a gun)
Why It's Good For The Game

Intents heavily cripple both the code and the UI design of interactions. While I understand that a lot of people will dislike this PR as they are used to intents, they are one of our weakest links in terms of explaining to players how to do specific things, and require a lot more keypresses to do compared to this.

As an example, martial arts can now be done without having to juggle 1 2 3 and 4 to switch intents quickly.

As some of you who saw the first combat mode PR, the context menu used to be disabled in combat mode. In this version it is instead on shift-right click ensuring that you can always use it in the same way.

In this version, combat mode also no longer prevents you from attacking with items when you would so before, as this was something that was commonly complained about.

The full intention of this shift in control scheme is that right click will become "secondary interaction" for items, which prevents some of the awkward juggling we have now with item modes etcetera.
Changelog

cl Qustinnus
add: Intents have been replaced with a combat mode. For more info find the PR here: #56601
/cl
2021-02-04 16:37:32 +13:00
NightRed
5e4421847c Monkeys drop forced two handed items (#56329)
Monkeys cannot wield twohanded items.
But are not forced to drop items that must be wielded two handed.
This forces monkeys to drop items if they need to be two handed.
(Also makes monkey ais not try and pick up 2 handed weapons)
2021-01-27 01:23:03 -08:00
Qustinnus
f66ca34626 Refactors monkeys into a species (#55614)
Changes monkeys from carbon subtype to species.
2020-12-30 16:30:15 +01:00
Qustinnus
611cc41f0a Makes it so player-controller monkeyized humans dont also keep AI control + extra AI controller fixes (#55515)
AI controllers now properly check if a mob is client-controlled and dont start processing if its the case.
AI controllers now handle deletion on unpossesion if that's filled in as an argument
Dead monkeys stop attacking things
2020-12-17 14:20:28 -08:00
Qustinnus
12c1464bc3 [READY] Creates Datumized AI and applies it to monkeys (#55238)
New AI system, implemented for monkeys.
2020-12-13 13:19:54 +01:00