!Person::players[k2]->dead &&
Person::players[k2]->aitype == attacktypecutoff) {
Person::players[k]->victim = Person::players[k2];
+ Person::players[k]->hasvictim = true;
found = true;
break;
}
}
if (!found) {
+ Person::players[k]->hasvictim = false;
Person::players[k]->attackkeydown = 0;
}
} else {
pause = 1;
}
+ if (isPlayerFriend() && aitype == pathfindtype) {
+ aitype = passivetype;
+ }
+
//pathfinding
if (aitype == pathfindtype) {
if (finalpathfindpoint == -1) {
}
if (stunned < 1 && isPlayerFriend()) {
+ // friends help player with its enemies
+ if (Game::musictype == stream_fighttheme && hasvictim) {
+ aitype = attacktypecutoff;
+ } else {
+ aitype = pathfindtype;
+ }
+
// friends follow player
if (!Person::players[0]->dead &&
+ aitype == pathfindtype &&
distsq(&coords, &Person::players[0]->coords) > 5) {
XYZ rotatetarget = Person::players[0]->coords + Person::players[0]->velocity;
XYZ targetpoint = Person::players[0]->coords;
targetyaw = roughDirectionTo(coords, targetpoint);
lookyaw = targetyaw;
forwardkeydown = 1;
- aitype = pathfindtype;
- }
-
- // friends help player with its enemies
- if (Game::musictype == stream_fighttheme) {
- aitype = attacktypecutoff;
}
}