]> ruin.nu Git - hbs.git/blobdiff - bs/planet.cpp
added code so you lose ships if you steal..
[hbs.git] / bs / planet.cpp
index f57d20877ed5455f262c495271204c4daa1f6795..d62bf579996a1f0d583a66302fce706531c9ac59 100644 (file)
@@ -23,6 +23,7 @@ using namespace std;
 Planet::Planet()
 {
        m_sRace = "Planet";
+       m_iStays = -1;
 }
 
 Planet::~Planet(){
@@ -225,6 +226,7 @@ void Planet::calcOneTick(Planet* friendly, Fleet* hostile, std::map<std::string,
        map<string, int> pods;
 
 
+       //FIXME: Need to change this and allow multiple shiptypes with the same initiative.
        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;
@@ -247,6 +249,9 @@ void Planet::calcOneTick(Planet* friendly, Fleet* hostile, std::map<std::string,
                {
                        hostiletemp->takeShoot(unittype, friendly->freeFleet(unittype, 1), stealfriendly[unittype]);
                        friendlytemp->takeShoot(unittype, hostile->freeFleet(unittype, 1), stealhostile[unittype]);
+
+                       friendlytemp->calculateLostStealships(unittype, stealfriendly[unittype], 1);
+                       hostiletemp->calculateLostStealships(unittype, stealhostile[unittype], 1);
                }
                else
                {
@@ -257,6 +262,7 @@ void Planet::calcOneTick(Planet* friendly, Fleet* hostile, std::map<std::string,
 
                if (s_Units[unittype].type() == "Pod")
                {
+                       //FIXME: Prolly need to recode the whole capping section for r7, due to multiple pods thingy
                        cerr << "Capping is: " << capping(tick) << endl;
        
                        if (capping(tick) > 0)