the problem is that the outer if function limits it to 50 mp or whatever you set.
the solution would be to use a condition.
i think this should work.
i don't know if you need to define or create this condition somewhere first (never actually did AI programming).
the solution would be to use a condition.
AI-Code:
int ego(){ if (((target.x-self.x) >= 300) && self.mp < 50 && charging=false) { charging=true; DJA(); } if(charging) { if(self.mp >=500 || (target.x-self.x) < 300) ) { charging=false; } A(1,0); } } |
i think this should work.
i don't know if you need to define or create this condition somewhere first (never actually did AI programming).