Ranger

Type: NPC Brain
Level: not in gallery
Pages: 9
Description: Found in the Enemy – Bandit Shooter Assembly. This enemy shoots arrows. This brain contains multibrains that are not included in the brain gallery and are therefore inaccessible. I will not be writing out this kode. Contains the same page structure as most of the Enemy Bandit brains

page 1 @Wander

  1. WHEN [once]
  2. …WHEN DO [textvar:name][equals][text:Bandit Shooter]
  3. …WHEN DO [team][equals][team 2]
  4. …WHEN DO [call page] [page:@Init]
  5. WHEN [boolvar:alerted] DO [switch page][page:@Pursue]
    Detect enemy
  6. WHEN [detect][enemies][nearest object]
  7. …WHEN [it][attackable][and][it][visible] DO [boolvar:alerted][equals][true]
  8. …/…WHEN DO [objvar:target][equals][it]
  9. WHEN [else][see][enemies][nearest object][or][see][player][neutrals][nearest object] DO [boolvar:alerted][equals][true]
  10. …WHEN DO [objvar:target][equals][it]
  11. …WHEN DO [else][health][changed]
  12. …/….WHEN DO [objvar:target][equals][it]
  13. …/…WHEN DO [boolvar:alerted][equals][true]
    Alerted to an enemy
  14. WHEN DO [boolvar:alerted]
  15. …WHEN [for each of][detect][allies]
  16. …/…WHEN DO [it][objvar:target][equals][objvar:target]
  17. …/…WHEN DO [it][boolvar:alerted][equals][true]
  18. …WHEN DO [switch page][page:@Pursue]
    Wander when not engaged
  19. WHEN [countdown timer][numvar:wander time][loop][trigger on start]
  20. …WHEN [distance to][vectorvar:Spawn position][greater than][Max Wander distance] DO [vectorvar:Wander Direction][equals][vectorvar:Spawn position][minus][position]
  21. …/…WHEN [else][distance to][allies][nearest object][less than][numvar:Spread DIstance]
  22. …/…./….WHEN DO [objvar:Near object][equals][allies][nearest object]
  23. …/…./…/…WHEN DO [vectorvar:Wander Direction][equals][position][minus][objvar:Near object][position]
  24. …/…/….WHEN [else] DO [vectorvar:Wander direction][equals][random vector]
  25. WHEN DO [move][in direction][vectorvar:Wander Direction][at speed][numvar Wander Move Speed]

page 2 @Pursue

  1. WHEN [once]
  2. …WHEN DO [numvar:combat range][equals][9]
  3. …WHEN DO [numvar:repel ally distance][equals][2.5][plus][random number][0.25][to][-0.25]
  4. WHEN DO [call page][@Targeting]
  5. WHEN [countdown timer][1][and][(][numvar:target distance][greater than][numvar: combat range][)]
  6. …WHEN DO [ground acceleration][equals][5]
  7. …WHEN DO [numvar:walk or run][equals][1.75]
  8. …WHEN [else]
  9. …/…WHEN DO [ground acceleration][equals][3.5]
  10. …/…WHEN DO [numvar:walk or run][equals][0.75]
  11. WHEN DO [move][toward][objvartarget][at speed][numvar:walk or run]
  12. WHEN [detect][allies]
  13. …WHEN [distance to][it][less than][numvar:repel ally distance]
  14. …/….WHEN DO [move][away from][it][with strafing][at speed][0.75]
  15. WHEN [numvar:target distance][less than][numvar:combat range] DO [switch page][page:@Orbit]

page 3 @Orbit

  1. WHEN [once] DO
  2. …WHEN DO [numvar:enemy repel range][equals][2]
  3. WHEN DO [call page][page:@Targeting]
  4. WHEN [numvar:target distance][greater than ][numvar:combat range] DO [switch page][page@Pursue]
  5. WHEN [numvar:target distance][less than][numvar:combat range] DO [switch page][page@Signaling]
  6. WHEN [numvar:target distance][less than or equal to][numvar:enemy repel range] DO [switch page][@Back off]
  7. WHEN [numvar:target distance][less than or equal to][numvar:combat range][and][not][boolvar:attacked recently]
  8. …WHEN DO [switch page][page:@Attack]
  9.  .
  10. WHEN [countdown timer][1][loop][trigger on start DO
  11. …WHEN [detect][allies]
  12. …/….WHEN [distance to][it][less than][numvar:repel ally distance]
  13. …/…/…WHEN DO [move][away from][it][with strafing]

page 4 @Close In

  1. WHEN [once]
  2. …WHEN DO [numvar:attack range][equals][8]
  3. WHEN DO [call page][page:@Targeting]
  4. WHEN [numvar:target distance][less than][numvar:attack range]
  5. …WHEN DO [switch page][page:@Attack]
  6. …WHEN [else] Do [move][toward][target]

page 5 @Back Off

  1. WHEN DO [call page][page:@Targeting]
  2. WHEN DO [move][away from][objvar:target][at speed][0.5][with strafing]
  3. WHEN [countdown timer][1] DO [switch page][page:@Attack]

page 6 @Attack

  1. WHEN [once]
  2. …WHEN DO [#accuracy][equals][1][minus][#accuracy multiplier][multiplied by][1]
  3. …WHEN [#accuracy][less than][0] DO [accuracy][equals][0]
  4. …WHEN DO [#damage][equals][plus][multiplied by][#damage multiplier]
  5. …WHEN DO [#attack speed][equals][0.6][plus][0.6][multiplied by][#attack speed multiplier]
  6. WHEN [countdown timer][#attack speed]
  7. …WHEN [no longer][shooting]
  8. …/…WHEN DO [boolvar:attacked recently][equals][true]
  9. …./….WHEN DO [switch page][@Orbit]
  10. ..
  11. …WHEN [shooting] DO [turn][toward][objvar:target]
  12. …/…WHEN [duration timer][1][in frames] DO [objvar:telegraph signal][equals][create][missing prop: Attack Telegraph Signal][at position][above]
  13. …WHEN DO [play fx][at socket][right hand][fx:Muzzle fire][scale][2]
  14. …WHEN DO [vectorvar:Shoot near target][equals][objvar:target][center][plus][random vector][circle][radius][#accuracy][inside]
  15. …WHEN DO [shoot][with windup][prop:Rustic Arrow][at speed][18][at][vectorvar:Shoot near target][with damage][#damage][launch frequency][#attack speed]

page 7 @Signaling

  1. WHEN DO [#Enemies Attacking Count][equals][0]
  2. WHEN [for each of][objvar:target][enemies][objects closer than][10][from][objvar:target]
  3. …WHEN [it][#target distance][less than][#combat range][and][not][boolvar:attacked recently][and][ir][not equal to][me]
  4. …/…WHEN DO [#Enemies Attacking Count][increment by][1]
  5. ,,,
  6. WHEN [#Enemies Attacking Count][less than][global][#Num Enemies Allowed Attack]
  7. …WHEN DO [boolvar:allowed][equals][true]
  8. …WHEN [else]
  9. …/…WHEN DO [boolvar:allowed][equals][false]

page 8 @Targeting

  1. WHEN [objvar:target][is dead] DO [emote][cheer]
  2. …WHEN DO [alerted][equals][false]
  3. …WHEN DO [switch page][page:@Wander]
  4. WHEN [countdown timer][loop][trigger on start]
  5. …WHEN [enemies][nearest object][or][player][neutrals][nearest object]
  6. …/…WHEN [it][attackable][and][it][visible] DO [objvar:Target][equals][it]
  7. ..
  8. WHEN [countdown timer][0.3][loop][trigger on start] DO [#target distance][equals][distance to][objvar:target]
  9. WHEN DO [turn][toward][target]
  10. WHEN [boolvar:attacked recently]
  11. …WHEN [started to][countdown timer][#attack cooldown]
  12. …/…WHEN DO [boolvar:attacked recently][equals][false]

page 9 @ Init

  1. WHEN [once]
  2. …WHEN DO [add brain][Temporary Health Display]
  3. …WHEN DO [add brain][brain:Enemy Objectives][to slot][@Enemy Objectives Brain][to channel][@Enemy Objectives Channel]
  4. …WHEN DO [add brain][Enemy Lights Brain][to slot][@Lights Brain][to channel][@Lights Channel]
  5. …WHEN DO [vectorvar:Spawn Position][equals][position]
  6. WHEN [once]
  7. …WHEN DO [health][equls][max health]
  8. …WHEN DO [#attack cooldown][equals][1][plus][random number][0][to][1]
  9. …WHEN [objvar:my weapon][equals][IWP:Rangers bow]
  10. …WHEN DO [equip][objvar:my weapon]
  11. …WHEN DO [boolvar:can attack][equals][true]
  12. …WHEN DO [global][#Num Enemies Allowed Attack][equals][2]
  13. …WHEN DO [#target distance][equals][0]
  14. …WHEN DO [boolvar:alerted][equals][false]
  15. WHEN [once]
  16. …WHEN DO [#Wander time][equals][3][plus][random number][-1][to][1]
  17. …WHEN DO [#Wander Turn Speed][equals][8]
  18. …WHEN DO [#Wander Move Speed][equals][0.4]
  19. …WHEN DO [#Max Wander Distance][equals][2.5]
  20. WHEN [once] DO [groundacceleration][equals][10]
  21. WHEN [once] DO [ground turn speed][equals][#Wander turn speed]
  22. ..
  23. WHEN [once]
  24. …WHEN DO [#min health bonus][equals][negative][0.25]
  25. …WHEN DO [max health bonus][equals][1]
  26. …WHEN DO [#min accuracy bonus][equals][negative][0.35]
  27. …WHEN DO [max accuracy bonus][equals][1]
  28. …WHEN DO [#min damage bonus][equals][negative][0.5]
  29. …WHEN DO [max damage bonus][equals][0.75]
  30. …WHEN DO [#min attack speed bonus][equals][negative][0.25]
  31. …WHEN DO [max attack speed bonus][equals][0.5]
  32. WHEN [once]
  33. …WHEN DO [#health multiplier][equals][clamp][global][#Difficulty][max][#max health bonus][min][#min health bonus]
  34. …WHEN DO [#accuracy multiplier][equals][clamp][global][#Difficulty][max][#max accuracy bonus][min][#min accuracy bonus]
  35. …WHEN DO [#damage multiplier][equals][clamp][global][#Difficulty][max][#max damage bonus][min][#min damage bonus]
  36. …WHEN DO [#attack speed multiplier][equals][clamp][global][#Difficulty][max][#max attack speed bonus][min][#min attack speed bonus]
  37. WHEN [once]
  38. …WHEN DO [max health][equals][max health][plus][max health][multiplied by][#health multiplier]
  39. …WHEN DO [health][equals][max health]

Comments are closed.

Powered by WordPress.com.

Up ↑

%d bloggers like this: