Code: Show/Hide bool grabbing; //in ship int team; //specfreq void botInfo::CheckFlags() { _listnode <Flag> *parse_1 = flaglist->head; while (parse_1) { Flag *flag = parse_1->item; if (matrix.BadPlayerGrid(flag->x, flag->y)) { String s; s += "Taking flag at "; s += flag->x; s += ", "; s += flag->y; tell(makeEcho(s)); IllegalFlag(flag); } parse_1 = parse_1->next; } if(grabbing) dropFlags(); } void botInfo::IllegalFlag(Flag *flag) { if (!grabbing) { tell(makeShip(SHIP_Warbird)); grabbing = true; tell(makeFollowing(false)); tell(makeFlying(true)); String s = "*setfreq "; s += team; sendPrivate(me, s); } tell(makeGrabFlag(flag->ident)); } void botInfo::dropFlags() { grabbing = false; me->move(512 * 16, 512 * 16); tell(makeSendPosition(true)); tell(makeShip(SHIP_Spectator)); tell(makeFollowing(true)); tell(makeFlying(false)); } |
Code: Show/Hide void botInfo::change_flag(int ident, int team)
{ tell(makeShip(SHIP_Warbird)); tell(makeTeam(team)); tell(makeFollowing(false)); tell(makeGrabFlag(ident)); tell(makeFlying(true)); me->move(setts.base_x * 16, setts.base_y[team] * 16); tell(makeSendPosition(true)); tell(makeDropFlags()); tell(makeShip(SHIP_Spectator)); tell(makeFlying(false)); tell(makeFollowing(true)); } |