//allFriends.printFleet();
allFriends.distributeLossesGains(friends, tick);
//allFriends.printFleet();
allFriends.distributeLossesGains(friends, tick);
allHostiles.distributeLossesGains(hostiles, tick);
allHostiles.distributeCappedRoids(hostiles, tick);
allHostiles.distributeLossesGains(hostiles, tick);
allHostiles.distributeCappedRoids(hostiles, tick);
setRoids(i->first, roids(i->first, 1), tick);*/
}
setRoids(i->first, roids(i->first, 1), tick);*/
}
for (RoidList::iterator i = m_Roids.begin(); i != m_Roids.end(); ++i)
{
for (vector<int>::iterator j = i->second.begin(); j != i->second.end(); ++j)
for (RoidList::iterator i = m_Roids.begin(); i != m_Roids.end(); ++i)
{
for (vector<int>::iterator j = i->second.begin(); j != i->second.end(); ++j)
-void Planet::calcOneTick(Planet* friendly, Fleet* hostile, std::map<std::string, std::map<std::string, int> >& stealfriendly, std::map<std::string, std::map<std::string, int> >& stealhostile, int tick = 1)
+void Planet::calcOneTick(Planet* friendly, Fleet* hostile, std::map<std::string, std::map<std::string, int> >& stealfriendly, std::map<std::string, std::map<std::string, int> >& stealhostile, int tick)
{
if (planetScore(tick - 1) > 0)
setCapping(float(planetScore(tick - 1)) / hostile->score() / 10, tick);
else
setCapping(0, tick);
{
if (planetScore(tick - 1) > 0)
setCapping(float(planetScore(tick - 1)) / hostile->score() / 10, tick);
else
setCapping(0, tick);
map<int, string> unitsinit; // order units after their ininitiative
for (UnitList::iterator i = s_Units.begin(); i != s_Units.end(); ++i)
unitsinit[i->second.initiative()] = i->first;
map<int, string> unitsinit; // order units after their ininitiative
for (UnitList::iterator i = s_Units.begin(); i != s_Units.end(); ++i)
unitsinit[i->second.initiative()] = i->first;
for (RoidList::iterator roid = m_Roids.begin(); roid != m_Roids.end(); ++roid)
{
int caproids = capping(tick) * roids(roid->first, tick - 1);
for (RoidList::iterator roid = m_Roids.begin(); roid != m_Roids.end(); ++roid)
{
int caproids = capping(tick) * roids(roid->first, tick - 1);
cerr << caproids << " roids stolen\n";
takeRoids(roid->first, caproids, tick);
cerr << caproids << " roids stolen\n";
takeRoids(roid->first, caproids, tick);
//FIXME: Going to move this to the distribute roids section instead.. Not really move, I'll keep this, but "regenerate" the pods in the distribute ships function.
hostiletemp->killFleet(unittype, caproids, 1);
pods[unittype] += caproids;
//int totroids = caproids + hostiletemp->resource(roid->first, 0);
//FIXME: Going to move this to the distribute roids section instead.. Not really move, I'll keep this, but "regenerate" the pods in the distribute ships function.
hostiletemp->killFleet(unittype, caproids, 1);
pods[unittype] += caproids;
//int totroids = caproids + hostiletemp->resource(roid->first, 0);