Follower – Ranged and Dodge

Type: Allies brain
Level: 3 star
Pages: 1
Description: NPC Ally brain. This character is armed with an astro blaster and will run around in a circular motion firing at enemies.

Kode

  1. WHEN [once] DO  [equip][Astro Blaster
  2. …WHEN DO [team][equals][team 1]Determines that the player is an ally and offers help
  3. …WHEN [after][objects closer than][5][player][allies] DO [objvar:my leader][equals][it]
  4. …/…WHEN [duration timer][2] DO [say][text:Following]
  5. WHEN [objvar:my leader][equal to][nothing]
  6. …WHEN [objects closer than][5][allies] DO [objvar:my leader][equals][it]
  7. WHEN [enemies][objects closer than][20][minus][dead objects]
  8. …WHEN [countdown timer][1][loop][trigger on start] DO [objvar:myenemy][equals][it]
  9. …WHEN [else] DO [move][toward][my leader][min distance][4]Attack kode
  10. WHEN [not][objvar:my enemy][is dead] DO
  11. …WHEN DO [turn][toward][objvar:my enemy]
  12. …WHEN [distance to][my enemy][less than][4]
  13. …/…WHEN [duration][4] DO [move][in direction][right][with strafing][at speed][0.65]
  14. …WHEN [distance to][objvar:my enemy][less than][15]
  15. …/…WHEN [countdown timer][numvar:pause attack][loop][trigger on start
  16. …/…/….WHEN DO [shoot][at][objvar:my enemy][without hit reaction]
  17. …/…/…WHEN DO [numvar:pause attack][equals][random number][0.9][to][1.25]
  18. …/…WHEN [else][countdown timer][0.5] DO [move][toward][objvar:my enemy]

 Alterations

Randomise the movement direction
Just for a bit more variety randomize which direction the character will move in.

Add at line 13

  1. …WHEN [started to] DO [numvar:turndirection][equals][random number][1][to][2][as integer]
  2. …WHEN [numvar:turn direction][equal to][1]
  3. …/…WHEN  [duration][4] DO [move][in direction][right][with strafing][at speed][0.65]
  4. …WHEN [numvar:turn direction][equal to][2]
  5. …/…WHEN  [duration][4] DO [move][in direction][left][with strafing][at speed][0.65]

Comments are closed.

Website Powered by WordPress.com.

Up ↑

%d bloggers like this: