Jump to content
  • 0

How to make the enemies act this way?


Szuran

Question

So I have this enemy that shoots projectiles: 

 

Missile:
    ENEM E 10 A_FaceTarget
    ENEM F 8 A_BruisAttack
    ENEM E 8

 Goto See

 

But I'd like him, during a single attack, to have 50% chance to shoot once, 30% chance to shoot twice and 20% chance to shoot thrice. How exactly do I code it?

 

Also, is there a way to increase the frequency of attack?

Edited by Szuran

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 0

You can use the A_jump :P

 

https://zdoom.org/wiki/A_Jump

 

something like this

 

Missile:

    TNT1 A 0 A_Jump(128,"One") //Remember 256 is 100% 

    TNT1 A 0 A_Jump(76,"Two")

    TNT1 A 0 A_Jump(51,"Three")

   Goto See

 One:
    ENEM E 10 A_FaceTarget
    ENEM F 8 A_BruisAttack
    ENEM E 8

    Goto See

 Two:

   ENEM E 10 A_FaceTarget
   ENEM F 8 A_BruisAttack
   ENEM E 8 A_FaceTarget

   ENEM F 8 A_BruisAttack
   ENEM E 8 A_FaceTarget

   Goto See

 Three:

   ENEM E 10 A_FaceTarget
   ENEM F 8 A_BruisAttack
   ENEM E 8 A_FaceTarget

   ENEM F 8 A_BruisAttack
   ENEM E 8 A_FaceTarget

   ENEM F 8 A_BruisAttack

   Goto See

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   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.

×
×
  • Create New...