Welcome to the Builder Academy

Question How to add various attack messages of mob?

More
13 Sep 2020 07:31 - 13 Sep 2020 07:35 #9737 by cry1004
This is my thoughts. You don't have to worry too much.

I would like the mob to display a wider variety of attack messages.

It seems to be done by using or adding SEX or chclass of char_player_data.

For example, snakes can only bite.

Lions can attack with their paws or bite with their teeth.

The current attack message is limited to:
The lion bit you with his teeth.
The lion bites you achingly.
The lion bite you sanely with his teeth.

I thought about how to set the attack method according to the chclass of char_player_data.

Choosing where you can attack
For a lion: 1. teeth 2. paws
For alligators: 1. teeth 2. tail
For humans: 1. Fist 2. Feet 3. Head 4. Sword

If the MOB's name is Tom

Tom beats you weakly with a fist.
Tom hit you with his head.
Tom kicked you to the point of distraction.
Tom swung you with a sword.

I thought it would be more realistic if I made it like this, so I wrote down my thoughts.

I'm sorry I don't have enough programming skills to implement this yet.
Last edit: 13 Sep 2020 07:35 by cry1004.

Please Log in or Create an account to join the conversation.

More
13 Sep 2020 10:19 #9738 by thomas
This bit is actually really simple to do in stock code. Whenever an attack is made, it uses an attack type. Then, one of the attack messages for that attack type is chosen randomly.

So, you'll just need to add more attack messages (they're in their own file in the lib/ dir) to get lots of different messages.

It's also easy to add new attack types, it's simply a list in structs.h.
The following user(s) said Thank You: cry1004

Please Log in or Create an account to join the conversation.

Time to create page: 0.615 seconds