Type: Allies brain
Level: 3 star
Pages: 1
Description: NPC Ally brain. This character is armed with a Nomad sword and a Fighter shield. The character will attack with a melee and block with their shield.
Kode
- WHEN [once] DO [equip][Nomad’s Sword]
- …WHEN DO [equip][Fighter’s Shield]
- …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 ready- lets go]
- WHEN [objvar:my leader][equal to][nothing]
- …WHEN [objects closer than][5][allies] DO [objvar:my leader][equals][it]
- WHEN [enemies][objects closer than][17]
- …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 [move][toward][objvar:my enemy]
- …WHEN [distance to][objvar:my enemy][less than][2]
- …/…WHEN [countdown timer][numvar:pause attack][loop] DO [attack][objvar:my enemy][with windup][end combo]
- …/…/…WHEN DO [numvar:pauseattack][equals][random number][0.5][to][2.5]
- …WHEN [objvar:my enemy][attacking] DO [DO [numvar:block chance][equals][random number][1][to][4][as integer]
- …/…WHEN [numvar:block chance][equals][1] DO [block] // there is a 1 in 4 chance that the Character will raise their shield when attacked.