Commit Graph

12 Commits

Author SHA1 Message Date
Bloop
4c870f71ca Fixes a bunch of callbacks that were being qdeleted, and code cleanup (#77904)
## About The Pull Request


![image](https://github.com/tgstation/tgstation/assets/13398309/559eb50a-461c-4220-b628-55412baaffc3)

Continuing the work of
https://github.com/tgstation/tgstation/pull/77850.

it started with finding one that was being missed and causing a
runtime...then I noticed a whole lot more. While I was doing this I
found callbacks that weren't being nulled in `Destroy()`, so I added
that wherever I found these spots as well as some general code cleanup.

There were a lot more of these than I initially hoped to encounter so
I'm labeling it as a refactor.

## Why It's Good For The Game

Fixes lots of runtimes, improves code resiliency.

## Changelog

🆑
refactor: fixed a bunch of instances of callbacks being qdeleted and
cleaned up related code
/🆑
2023-08-25 16:03:27 -06:00
necromanceranne
c8266cf0a2 Settler Quirk: Tame the Outdoors! Have trouble with tall shelves... (#77654)
## About The Pull Request

Adds the Settler quirk. This gives you bonuses to taming animals and
fishing, as well as making you gain hunger slower than others.

However, you are quite a bit slower than most people, and have trouble
with vaulting objects. You do, however, suffer significantly less from
equipment slowdown. (to the point that it is almost zero)

Settler riders are faster on their mounts than others if they're at
least sane. They start to slow down if they're less sane.

You are also shorter than most people. 

<details>
  <summary>Typical Settler encounters the typical Spacer</summary>
  

![Dr_Xr1nU0AAMsSE](https://github.com/tgstation/tgstation/assets/40847847/86ed4947-de5f-4bdf-a8ae-521dc7c30662)
  
</details>

## Why It's Good For The Game

I wanted to add a lightweight quirk that was kind of the 'opposite' of
Spacer, but a little more focused on interacting with elements of the
game world that would enjoy some attention. So, I thought 'what about an
outdoorsman quirk?'

So, I based it around being from people who lived out on the rim, under
unideal circumstances (and probably heavier gravity than Earth), and
taming the land. The slower movespeed encourages finding an animal to
tame that you can ride, and the bonuses to taming should help make that
a bit easier. The other additions just made sense for someone living it
a bit rough in the wilderness.

Having a bunch of settlers taming cows and riding around on them all
shift just kind of sounds hilarious to me.

## Changelog
🆑
add: Settler quirk! Conqueror the great outdoors....in space. Just make
sure nobody asks you to get anything from the top shelf.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2023-08-17 12:09:08 -06:00
LemonInTheDark
ae5a4f955d Pulls apart the vestiges of components still hanging onto signals (#75914)
## About The Pull Request

Signals were initially only usable with component listeners, which while
no longer the case has lead to outdated documentation, names, and a
similar location in code.

This pr pulls the two apart. Partially because mso thinks we should, but
also because they really aren't directly linked anymore, and having them
in this midstate just confuses people.

[Renames comp_lookup to listen_lookup, since that's what it
does](102b79694f)

[Moves signal procs over to their own
file](33d07d01fd)

[Renames the PREQDELETING and QDELETING comsigs to drop the parent bit
since they can hook to more then just comps
now](335ea4ad08)

[Does something similar to the attackby comsigs (PARENT ->
ATOM)](210e57051d)

[And finally passes over the examine
signals](65917658fb)

## Why It's Good For The Game

Code makes more sense, things are better teased apart, s just good imo

## Changelog
🆑
refactor: Pulled apart the last vestiges of names/docs directly linking
signals to components
/🆑
2023-06-09 06:14:31 +00:00
Timberpoes
07f03c3433 You no longer have to sacrifice your soul to give a mouse sentience. (#72782)
## About The Pull Request

Some Manuel shift I didn't take note of the round ID for.

A player ahelps because they LITERALLY VANISH. They think it's a genetic
meltdown. I check the logs and I don't think it is.

The player mentions they got attacked by a mouse just before they died.
I check the logs and what do we have, but the same game tick the player
gets yeeted into the void that a mouse gains sentience.

```
    Line 11801: [2023-01-17 23:39:00.036] ACCESS: Mob Login: Cheeseromancer/(Lemmiwinks) was assigned to a /mob/living/basic/mouse/white
    Line 11802: [2023-01-17 23:39:00.052] GAME: Cheeseromancer/(Lemmiwinks) Client Cheeseromancer/(Lemmiwinks) has taken ownership of mob Lemmiwinks(/mob/living/basic/mouse/white) (Medbay Treatment Center (155,85,2))
    Line 11804: [2023-01-17 23:39:00.068] ACCESS: Mob Login: Super17andre/(Carter Wolfe) was assigned to a /mob/dead/observer
    Line 11806: [2023-01-17 23:39:00.111] GAME: Cheeseromancer/(Lemmiwinks) has gained antag datum �Sentient Creature(/datum/antagonist/sentient_creature).
```

There's other chatter IC about sentience potions, which narrows down the
investigation.

Long story short, 20 month ago arm couldn't code and 20 month ago
maintainers couldn't review code. On this blessed day, we're all
complicit.

`on_tame` signal handler proc. Without source parameter. Signal handler.
Without source parameter.


![image](https://user-images.githubusercontent.com/24975989/213057552-feb1c0c4-9119-4ea2-85f0-04ff5db8ae74.png)

This leads to your classic offset-by-1 arg error. The signal's source is
the mouse. The tamer is the player that used the intelligence potion.
There is no food. But because the signal handler omits source, the tamer
is the mouse and the food is the tamer. Makes perfect sense in my head.

The food then, obviously, gets qdeleted in the later after_tame callback
invocation. Meaning the player using the sentience potion gets sent to
the Shadow Realm with no log entries suggesting cause of death.

Add in the missing source param, pass the source arg in the really,
really bad signal handler proc being called directly. And we feex.


![image](https://user-images.githubusercontent.com/24975989/213058176-5a4ecb74-756a-46ef-b83b-fc61df8364c6.png)
## Why It's Good For The Game

Players being randomly qdeleted leads to admins crying. In the future
I'm going to log qdeletions of cliented mobs. March. Because I have time
off work then.
## Changelog
🆑
fix: Mice given sentience through intelligence potions no longer
immediately consume the body and soul of the person whom uplifted them.
/🆑
2023-01-21 09:41:32 -08:00
Jacquerel
583f65f28b Dogs become tamed when given bones (#72363)
## About The Pull Request

Previous to this PR Ian (and any other dog) would swear allegiance and
kill (or at least growl aggressively) in the name of anyone who clicked
on them sufficiently with combat mode disabled, which is boring.
Now instead Ian wants Jumbo Dog Bones.
The HoP and Warden (as dog owners) both start with one of these mythical
items which otherwise can be ordered from cargo if you want to get into
a dog's heart, but they're not cheap.
You can also use regular bones of the kind you may harvest from Lavaland
animals or Skeleton crew members but these dogs are picky and so you
have significantly less chance of success than if you buy the premium
package.

Jumbo Dog Bones also fully heal dogs, as a bonus.

Additionally to this, I added functionality to the `tameable` component
to allow it to not delete itself upon successful taming, to preserve
Ian's ability to have more than one friend.
Additionally to that, I split the "stop being friends if you attack me"
behaviour into its own element rather than being part of the "start
being friends if you pet me a lot" one, so he could also keep doing
that.
And finally I added a new signal `COMSIG_ATOM_AFTER_ATTACKEDBY` which is
sent by an atom after an item attacks it (so if it manages to get
through the attack chain and is probably actually being used for an
attack) and registered to this in the `relay_attackers` element in place
of `COMSIG_PARENT_ATTACKBY`. This means that dogs can now recognise that
when you use a bone on them you are trying to feed them, not attack
them.

## Why It's Good For The Game

The loyalty of Ian and McGriff will now be most easily available to
their owners rather than anyone with access to their office.
... which doesn't really effect very much, I just think spam-clicking
Ian was boring as a solution and spending money is at least marginally
better.
Gives you something to spend money on if you want to befriend a dog, for
instance if you're a mailperson or felinid who is tired of getting
growled at by one. Or if you bought a dog from cargo.
Removes some unintuitive edge cases where a mob might get mad at you
doing something helpful to them.

## Changelog

🆑
balance: While Ian still enjoys being petted, his heart will now most
closely belong to anyone who gives him an expensive luxury dog bone.
code: Using an item which _can_ deal damage on a mob tracking hostile
actions (such as a dog) won't automatically be considered to be a
hostile action if you aren't actually hitting it with the item.
/🆑
2023-01-06 12:44:39 -08:00
Jacquerel
8cb4947084 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.
/🆑
2022-12-22 00:41:36 -08:00
Jacquerel
38bd952b19 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.
/🆑
2022-12-13 12:34:23 -08: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
Vladin Heir
addb220e60 Consciousness Transference potions tame creatures (#70782)
Consciousness Transference potions now send the COMSIG_SIMPLEMOB_TRANSFERPOTION signal. This is also used so the potion will tame the mob you transfer to, such as a xenobio-spawned chaos magicarp.

Fixes #70777
2022-10-28 13:09:52 -07:00
Watermelon914
a57a04b320 Fixed carps being untameable and fixes tameable code not properly removing itself from something (#59955)
Fixes #59897
2021-07-03 14:44:09 -03:00
Watermelon914
375a20e49b Refactors most spans into span procs (#59645)
Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs.
Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines.

Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing.
Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc.

(Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
2021-06-14 13:03:53 -07:00
tralezab
9904e2a244 Refactors both taming + egg laying + animal colors into components (#58919)
Co-authored-by: Floyd <Floydje123@hotmail.com>
2021-05-22 17:55:25 -07:00