Dragon – Enemy

Type: Animal Brain
Level: not in gallery
Pages:1
Description: Found in the Dragon character model. This character shoots fireballs from its mouth as well as a melee attack which involves a swing of the head.

Kode

  1. WHEN [once] DO [team][equals][team 2]
  2. …WHEN DO [#melee distance][equals][8][multiplied by][scale]
  3. …WHEN DO [#ranged distance][equals][20][multiplied by][scale] // this sets the melee and ranged distances in proportion to the size of your dragon
  4. WHEN [enemies][nearest object][or][player][neutrals][nearest object] DO [objvar:my enemy][equals][it]
  5. WHEN DO [turn][toward][objvar:my enemy][angle][3][divided by][scale]
  6. WHEN [distance to][objvar:my enemy][less than][#ranged distance][multiplied by][1.5] [and][distance to][objvar:my enemy][greater than or equal to][#ranged distance][multiplied by][0.5]
  7. …WHEN DO [move][in direction][forward][at speed][0.5]
  8. WHEN [is ally with][objvar:my enemy] DO [objvar:my enemy][equals][nothing]
  9. WHEN [countdown timer][#pause attack][loop]
  10. …WHEN [distance to][objvar:my enemy][less than or equal to][#melee distance]
  11. …/…WHEN DO [#random attack][equals][random number][1][to][3][as integer]
  12. …/…WHEN [#random attack][equal to][1] DO [attack][light][objvar:my enemy][with windup][end combo]
  13. …/…/…WHEN [else][#random attack][equal to][2] DO [attack][objvar:my enemy][with windup][end combo]
  14. …/…/…/…WHEN [else] DO [attack][heavy][objvar:my enemy][with windup][end combo]
  15. WHEN [distance to][objvar:my enemy][less than or equal to][#ranged distance][and][distance to][objvar:my enemy][greater than][#melee distance]
  16. …WHEN [started to]
  17. …/…WHEN DO [vectorvar:target position][equals][objvar:my enemy][position]
  18. …/…WHEN DO [objvar:my fireball][equals][create][fx:Fireball][at position][mouth][position]
  19. …/…WHEN DO [objvar:my fireball][scale][equals][2][multiplied by][scale]
  20. …/…WHEN DO [shoot][objvar:my fireball][with windup][at][vectorvar:target position][at speed][15][lifetime][3]disallow friendly fire]
  21. …WHEN DO [#pause attack][equals][random number][2][to][4]
  22. WHEN [not][objvar:my fireball][is projectile] DO [objvar:my fireball][position][equals][mouth][position]
  23. …WHEN [else]
  24. …/…WHEN [started to][ DO [objvar:my fireball][scale][equals][3][multiplied by][scale] // the fireball gets bigger as it leaves the dragons mouth
  25. WHEN [for each of][projectiles]
  26. …WHEN DO [objvar:my projectile][equals][it]
  27. …WHEN [distance to][objvar:my enemy][from][objvar:my projectile][less than][0.25][multiplied by][objvar:my projectile][scale]
  28. …/…WHEN DO [damage][shoot damage][objvar:my enemy][interrupt]
  29. …/…WHEN DO [play fx][fx:Fireball Impact][at position][objvar:my projectile][scale][0.3][multiplied by][objvar:my projectile][scale]
  30. …/…WHEN DO [destroy][objvar:my projectile]

Comments are closed.

Powered by WordPress.com.

Up ↑

%d bloggers like this: