nsmryan / RustRoguelike

This Rust Roguelike is a Roguelike written in Rust.
17 stars 3 forks source link

Throwing stones at golems #418

Open MicroChasm opened 2 years ago

MicroChasm commented 2 years ago

Throwing stones directly at golems should be a special case. Currently, golems simply investigate the location of the sound. However, having a stone thrown at them is different, they should investigate the direction that the stone came from.

nsmryan commented 2 years ago

I started to implement this, but ran into a problem.

Throwing an item at a golem stuns them. After being stunned, they currently do not know where the player is since they return to idle.

We could consider making thrown items not stun in order to make this work. Then the sling turns stones into stunning items. Another option is that stones could stun only attacking golems, and simply alert golems that are idle or investigating.

MicroChasm commented 2 years ago

While the idea of throwing a stone at a golem to stun them is cool, I think the idea of throwing a stone at a golem to purposefully get them to attack you is equally cool. It makes the most sense to me to have it so that stones only stun golems when thrown with a sling.

nsmryan commented 2 years ago

I will implement this and we can try it out.

nsmryan commented 2 years ago

I made the stun turns for thrown items configurable. In config.yaml:

stun_turns_throw_stone: 0
stun_turns_throw_spear: 3
stun_turns_throw_default: 1

Currently golems will immediately attack the player- they are able to move or attack the same turn that they are hit by a stone.

There are a couple of decisions to make here: Should the golem be 'alert' if they were previously idle? The other option is to allow them to investigate or attack, but to take up their turn so they have to wait until next turn to do anything about it.

If they were previous investigating, should they behave differently from if they were previously idle?

What about if they are hit by something else, such as a weapon that did not stun them? Currently they only know about being hit, not about what hits them, but we could make thrown items or stones a special case. The question is whether if being hit by a stone requires an extra turn before the golem reacts, should other attacks also have them take an extra turn to react? Writing this out, its not actually very likely to matter unless there is a way to hit a golem that does not stun them. I suppose something like pushing them might result in this situation.

nsmryan commented 2 years ago

The golems now enter alert state when hit. Again, this usually doesn't come up as the golems are usually stunned when hit. It comes up with stones as they no longer stun.