Type: Allies brain
Level: 3 star
Pages: 1
Description: NPC Ally brain. This character is armed with a bow and will fire arrows at the enemy.
Kode
- WHEN [once] DO [equip][Rangers Bow]
- …WHEN DO [team][equals][team 1]Determines that the player is an ally and offers help
- …WHEN [after][objects closer than][5][player][allies] DO [objvar:my leader][equals][it]
- …/…WHEN [duration timer][2] DO [say][text:Im here to help]
- WHEN [objvar:my leader][equal to][nothing]
- …WHEN [objects closer than][5][allies] DO [objvar:my leader][equals][it]
- WHEN [enemies][objects closer than][20]
- …WHEN DO [objvar:myenemy][equals][it]
- …WHEN [else] DO [move][toward][my leader][min distance][4]Attack kode
- WHEN [not][objvar:my enemy][is dead] DO
- …WHEN [countdown timer][pause attack][loop][trigger on start]
- …/…WHEN DO [turn][toward][objvar:my enemy]
- …/…WHEN DO [shoot][at][objvar:my enemy]
- …/…WHEN DO [numvar:pause attack][equals][random number][0.9][to][1.25]
Alterations
Combination of melee and ranged
Make him attack with fists at close range. This makes him less deadly, but perhaps more realistic as you are unlikely to fire arrows at close range. Slightly simpler version of the Follower Ranged and Melee brain.
Change from line 10.
- WHEN [not][objvar:my enemy][is dead] DO
- …WHEN [distance to][objvar:my enemy][greater than or equal to ][2]
- …/…WHEN [countdown timer][pause attack][loop][trigger on start]
- …/…/…WHEN DO [turn][toward][objvar:my enemy]
- …/…/…WHEN DO [shoot][at][objvar:my enemy]
- …/…/…/…WHEN DO [numvar:pause attack][equals][random number][0.9][to][1.25]
- …/…WHEN [else]
- …/…/…WHEN [counrdown timer][numvar:pause attack][loop] DO [attack][objvar:my enemy]
- …/…/…/…WHEN DO [numvar:pause attack][rquals][random number][0.5][to][2.5]