Jump to content

[1.12.2] Switching between two different types of attack AI (Wolf LeapAtTarget and Modified RangedAttacks)


NovaViper

Recommended Posts

This is something momentous I haven't attempted before but here goes nothing. I'm developing a skill for the dogs in DoggyTalents that would basically give the dogs ranged attacks. So the things I'm trying to work out are the following:

 

  1. Make the normal LeapAtTarget and my custom Ranged Attacks AI switch between each other. Whenever the dog's target comes within the normal range of the Leaping AI (in the code it says the distance of the target squared (d0) is 4.0 D<= d0 <= 16.0D Not sure how far this is in blocks however), then it will switch to the leaping ai and attack; while if the target is more than this range, then it will switch to the ranged attack ai and attack
  2. Have different "types" of ranged attacks. So, there would be different 'elements' that the attacks can feature and each respective element would use a specific entity for the actual projectile, such as fire (using a fireball or something like a dragon's breathe), water (potion bottle entity?), poison (dragon's breath possibly or the poison tipped arrow), ice (snowballs), physical (regular arrows/tipped arrows or a stone block). The elements can be switched around via items at the mastery level (which is level 5)
  3. There is a cooldown between each ranged attack. I already have a good idea on what to do with this but since the cooldown is only used
  4. Each attack shoot out differently and have different behaviors. For instance, the fire element is very similar to fire breath, so it shoots out a constant stream of fire particles or small fireballs, then it has a cooldown in between each breathe; ice is the exact same way. Poison and water is more a 'spitting' type of thing so it only shoots out one projectile and it lingers, basically how the Enderdragon's new magic breathe works. Physical is the exact same as a skeleton shooting an arrow.
  5. Each attack has a different effect as well. For instance, fire obviously burns entities, also would be cool if it burns the area around it as well. Ice and water can put out fires, however ice can turn water into ice blocks; water can leave behind a puddle of water. Poison obviously causes poison damage. and physical causes normal damage

Some of the parts I already have started working on but those are the core aspects I need some advice on. If it helps, here is a link to the 1.12.2 source code (as that's the current version I'm working on).

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.