if ((gEnemyY4 = 7) and (gEnemyX4 < 7)) or ((gEnemyY4 = 6) and (gEnemyX4 < 6)) or ((gEnemyY4 = 5) and (gEnemyX4 < 5)) or ((gEnemyY4 = 4) and (gEnemyX4 < 4)) or ((gEnemyY4 = 3) and (gEnemyX4 < 3)) or ((gEnemyY4 = 2) and (gEnemyX4 < 2)) then
if gEnemyY4 = 7 then
if gLineFlip6[gEnemyX4] = 9 then
EnemyUpRight4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 6 then
if gLineFlip5[gEnemyX4] = 9 then
EnemyUpRight4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 5 then
if gLineFlip4[gEnemyX4] = 9 then
EnemyUpRight4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 4 then
if gLineFlip3[gEnemyX4] = 9 then
EnemyUpRight4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 3 then
if gLineFlip2[gEnemyX4] = 9 then
EnemyUpRight4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 2 then
if gLineFlip1[gEnemyX4] = 9 then
EnemyUpRight4()
pNoChoice = 0
exit
end if
end if
end if
end if
end if
end if
end if
else
if gEnemyY4 < 7 then
if gEnemyY4 = 6 then
if gLineFlip7[gEnemyX4] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 5 then
if gLineFlip6[gEnemyX4] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 4 then
if gLineFlip5[gEnemyX4] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 3 then
if gLineFlip4[gEnemyX4] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 2 then
if gLineFlip3[gEnemyX4] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 1 then
if gLineFlip2[gEnemyX4] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
end if
end if
end if
end if
end if
end if
else
if gEnemyY4 < 7 then
if gEnemyY4 = 6 then
if gLineFlip7[gEnemyX4 + 1] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 5 then
if gLineFlip6[gEnemyX4 + 1] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 4 then
if gLineFlip5[gEnemyX4 + 1] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 3 then
if gLineFlip4[gEnemyX4 + 1] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 2 then
if gLineFlip3[gEnemyX4 + 1] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
else
if gEnemyY4 = 1 then
if gLineFlip2[gEnemyX4 + 1] = 9 then
EnemyDownLeft4()
pNoChoice = 0
exit
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
if pNoChoice = 1 then
if (gHikerX <= gEnemyX4) and (gHikerY <= gEnemyY4) then
if gEnemyX4 > 1 then
EnemyUpLeft4()
end if
else
if (gHikerX >= gEnemyX4) and (gHikerY <= gEnemyY4) then
if ((gEnemyY4 = 7) and (gEnemyX4 < 7)) or ((gEnemyY4 = 6) and (gEnemyX4 < 6)) or ((gEnemyY4 = 5) and (gEnemyX4 < 5)) or ((gEnemyY4 = 4) and (gEnemyX4 < 4)) or ((gEnemyY4 = 3) and (gEnemyX4 < 3)) or ((gEnemyY4 = 2) and (gEnemyX4 < 2)) then
EnemyUpRight4()
end if
else
if (gHikerX <= gEnemyX4) and (gHikerY >= gEnemyY4) then
if gEnemyY4 < 7 then
EnemyDownLeft4()
end if
else
if (gHikerX >= gEnemyX4) and (gHikerY >= gEnemyY4) then