Code: Show/Hide if(p->flagCount == 1) { int brick, decoy, portal, repel, rocket, thor, burst; bool stealth, xradar, cloak, shields, supers; if (p->flash) { if(settings->ships[p->ship].CloakStatus == 0) { brick = p->brick; decoy = p->decoy; portal = p->portal; repel = p->repel; rocket = p->rocket; stealth = p->stealth ; thor = p->thor ; xradar = p->xradar ; sendPrivate(p, "*shipreset"); sendPrivate(p, "*warn Do not warp with the flag!"); if (brick) { for (int i = 0; i <= brick; i++) { sendPrivate(p, "*prize #26"); } } if (decoy) { for (int i = 0; i <= decoy; i++) { sendPrivate(p, "*prize #23"); } } if (portal) { for (int i = 0; i <= portal; i++) { sendPrivate(p, "*prize #28"); } } if (repel) { for (int i = 0; i <= repel; i++) { sendPrivate(p, "*prize #21"); } } if (rocket) { for (int i = 0; i <= rocket; i++) { sendPrivate(p, "*prize #27"); } } if (stealth) { sendPrivate(p, "*prize #4"); } if (thor) { for (int i = 0; i <= thor; i++) { sendPrivate(p, "*prize #24"); } } if (xradar) { sendPrivate(p, "*prize #6"); } String s; s = "*arena "; s += p->name; s += " has dropped the flag!"; sendPublic(s); break; } else { Uint16 oldXCoord = get_tag(p, 0); Uint16 oldYCoord = get_tag(p, 1); if (oldXCoord == 0 && oldYCoord == 0) { set_tag(p, 0, p->tile.x); set_tag(p, 1, p->tile.y); } else { Uint16 newXCoord = (Uint16)p->tile.x; Uint16 newYCoord = (Uint16)p->tile.y; Uint32 dist = distance(oldXCoord, oldYCoord, newXCoord, newYCoord); Uint16 oldXCoord = (Uint16)p->tile.x; Uint16 oldYCoord = (Uint16)p->tile.y; if ( dist > 5) { brick = p->brick; decoy = p->decoy; portal = p->portal; repel = p->repel; rocket = p->rocket; stealth = p->stealth ; thor = p->thor ; xradar = p->xradar ; String t; t = "*arena "; t += p->name; t += "<-name "; t += brick; t += "<-brick "; t += portal; t += "<-portal "; t += thor; t += "<-thor "; sendPublic(t); sendPrivate(p, "*shipreset"); sendPrivate(p, "*warn Do not warp with the flag!"); if (brick) { for (int i = 0; i <= brick; i++) { sendPrivate(p, "*prize #26"); } } if (decoy) { for (int i = 0; i <= decoy; i++) { sendPrivate(p, "*prize #23"); } } if (portal) { for (int i = 0; i <= portal; i++) { sendPrivate(p, "*prize #28"); } } if (repel) { for (int i = 0; i <= repel; i++) { sendPrivate(p, "*prize #21"); } } if (rocket) { for (int i = 0; i <= rocket; i++) { sendPrivate(p, "*prize #27"); } } if (stealth) { sendPrivate(p, "*prize #4"); } if (thor) { for (int i = 0; i <= thor; i++) { sendPrivate(p, "*prize #24"); } } if (xradar) { sendPrivate(p, "*prize #6"); } String s; s = "*arena "; s += p->name; s += " has dropped the flag!"; sendPublic(s); break; } } |