Interestingly in the Debug version there is some sort of Sprite tester, maybe an early version of a sprite editor.
-Martin
-Martin
g_gevManager->AddEvent(GEV_INSERT_Tail, GEV_BuyFront, GEA_City, city, GEA_End);
// JJB removed the following: // g_gevManager->AddEvent(GEV_INSERT_Tail, GEV_BuyFront, GEA_City, city, GEA_End); // and replaced it with the following: if (!city.GetCityData()->AlreadyBoughtFront()) { city.GetCityData()->AddBuyFront(); } // in the hope of fixing the rush buy bug.
// JJB added this inner if so that things add up properly if (!city.GetCityData()->AlreadyBoughtFront()) { rushBuyTotal += city.GetCityData()->GetOvertimeCost(); }
class CombatUnit { private: double m_offense, m_defense, m_strength, m_armor, m_ranged, m_hp; bool m_veteran; UNIT_TYPE m_type; sint32 m_preferredCol; sint32 m_priority; bool m_valid; public: bool m_alreadyExploded; bool m_alreadyAttacked; #ifdef TEST_APP uint32 m_id; #else Unit m_unit; #endif CombatUnit() { m_valid = false; } #ifdef TEST_APP CombatUnit::CombatUnit(double offense, double defense, double strength, double armor, double ranged, double hp, bool veteran, UNIT_TYPE type); //bool veteran added #else CombatUnit::CombatUnit(double offense, double defense, double strength, double armor, double ranged, double hp, bool veteran, Unit &u); //bool veteran added by solver #endif double GetOffense() { return m_offense; } double GetDefense() { return m_defense; } double GetStrength() { return m_strength; } double GetArmor() { return m_armor; } double GetRangedAttack() { return m_ranged; } UNIT_TYPE GetCombatType() { return m_type; } sint32 GetPreferredCol() { return m_preferredCol; } void SetPreferredCol(sint32 col) { m_preferredCol = col; } sint32 GetPriority() { return m_priority; } void SetPriority(sint32 pri) { m_priority = pri; } //following two added by Solver void SetAttack (double att) { m_offense = att; } void SetDefense (double def) { m_defense = def; } double GetHP() { return m_hp; } bool IsVeteran(){ return m_veteran; } void DeductHP(double amt) #ifndef TEST_APP ; #else { m_hp -= amt; if(m_hp < 0.001) { m_hp = 0; } } #endif bool IsValid() { return m_valid; } bool IsAlive() { return m_hp > 0.001; } bool IsActive() { return IsValid() && IsAlive(); } void AddKill(); void Invalidate() { m_valid = false; } };
CombatUnit newUnit(rec->GetAttack(), rec->GetDefense(), rec->GetFirepower(), rec->GetArmor(), rec->GetZBRangeAttack(), u->GetHP(), u->IsVeteran(), u);
void CTP2Combat::ExecuteAttack(CombatField *attacker, sint32 attX, sint32 attY, CombatField *defender, sint32 defX, sint32 defY) { m_noAttacksPossible = false; CombatUnit *att = &attacker->GetUnit(attX, attY); CombatUnit *def = &defender->GetUnit(defX, defY); //Solver added the following to add veteran check if (att->IsVeteran()) { double vetattack; double vetdefense; vetattack=att->GetOffense() + att->GetOffense() * g_theConstDB->GetVetCoef(); att->SetAttack(vetattack); vetdefense=att->GetDefense() + att->GetDefense() * g_theConstDB->GetVetCoef(); att->SetDefense(vetdefense); }
#include "ConstDB.h" //the const db for veteran extern ConstDB *g_theConstDB; //to get vetstatus
Comment