◆Comment:Mysteriously fails without Wait
◆Wait:10 frames
◆Comment:Group Events by their Identity
◆Control Variables:#0001 All Living NPC = this.SearchNotes('NPC', 0, 0, '!this.get(\"Dead\", eventId)');
◆Control Variables:#0002 All Guards = this.SearchNotes('Guard', 0, 0, 'S1')
◆Control Variables:#0003 Normal Guards = this.SearchNotes('Normal Guard', 0, 0, 'S2')
◆Control Variables:#0004 Bank Guards = this.SearchNotes('Bank Guard', 0, 0, 'S2')
◆Comment:Check if Hostile Guards Mode
◆If:Guards Guards! is ON
◆If:Hiding is ON
◆Comment:Player is hiding, low detection range
◆Comment:Guards, not chasing, show balloon before they start
◆Control Variables:#0005 Temporary = this.SearchCondition('!this.get(\"Chase\", eventId) && Galv.DETECT.event(eventId,3,false)', 0, 0, 'S2')
◆Script:var angrybirds = $gameVariables.value(5);
: :if ( angrybirds.length > 0 ) {
: : for ( i = 0; i < angrybirds.length; i++ ) {
: : $gameMap.event(angrybirds).requestBalloon(5);
: : }
: :}
◆Comment:If not chasing, start chasing player when player gets close
◆Script:this.SetSSw('Alert', false, 'S2', 'thisM', 'this.get(\'Alert\',eventId) && Galv.DETECT.event(eventId,3,false)')
: :this.SetSSw('Chase', true, 'S2', 'thisM', '!this.get(\'Chase\',eventId) && Galv.DETECT.event(eventId,3,false)')
◆
:Else
◆Comment:Player in full sight, high detection range
◆Comment:Guards, not chasing, show balloon before they start
◆Control Variables:#0005 Temporary = this.SearchCondition('!this.get(\"Chase\", eventId) && Galv.DETECT.event(eventId,5,false)', 0, 0, 'S2')
◆Script:var angrybirds = $gameVariables.value(5);
: :if ( angrybirds.length > 0 ) {
: : for ( i = 0; i < angrybirds.length; i++ ) {
: : $gameMap.event(angrybirds).requestBalloon(5);
: : }
: :}
◆Comment:If not chasing, start chasing player when player gets close
◆Script:this.SetSSw('Alert', false, 'S2', 'thisM', 'this.get(\'Alert\',eventId) && Galv.DETECT.event(eventId,5,false)')
: :this.SetSSw('Chase', true, 'S2', 'thisM', '!this.get(\'Chase\',eventId) && Galv.DETECT.event(eventId,5,false)')
◆
:End
◆
:Else
◆Comment:Normal Guards AI
◆Comment:Get suspicious when player is too close
◆Script:this.SetSSw('Alert', true, 'S3', 'thisM', '!this.get(\'Alert\',eventId) && Galv.DETECT.event(eventId,3,false)')
◆Comment:Stop being suspicious if player goes away
◆Script:this.SetSSw('Alert', false, 'S3', 'thisM', 'this.get(\'Alert\',eventId) && !Galv.DETECT.event(eventId,4,false)')
◆Comment:All Guards AI
◆Comment:Attack when player next to guard
◆Script:this.SetSSw('Chase', true, 'S2', 'thisM', '!this.get(\'Chase\',eventId) && Galv.DETECT.event(eventId,1,false)')
◆
:End