string CUBuild::GetBOMBER(){ NLOG("CUBuild::GetBOMBER"); const vector<CommandDescription>* di = G->cb->GetUnitCommands(uid); if(di == 0) return string(""); list<string> possibles; float best_score = 0; string best = ""; for(vector<CommandDescription>::const_iterator is = di->begin(); is != di->end();++is){ if(is->id<0){ CUnitTypeData* p =G->UnitDefLoader->GetUnitTypeDataByName(is->name); if(G->Pl->feasable(p,utd)==false) continue; if(p->IsBomber()){ float temp = G->efficiency->GetEfficiency(p->GetName()); temp /= (p->GetUnitDef()->energyCost+(p->GetUnitDef()->metalCost*45)); temp = temp - G->mrand()%max(int(temp/4),1); if(temp > best_score){ best_score = temp; best = p->GetName(); } } } } return best; }