Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Szuran

How to make the enemies act this way?

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?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×