Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions CEconomy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,23 +1065,20 @@ void CEconomy::tryBuildingDefense(CGroup* group) {
if (mstall || estall)
return;

//bool allow;
int size;
float k;
unitCategory incCats, excCats;
buildType bt;
CCoverageCell::NType layer;
// CCoverageCell::NType layer;

if (ai->intel->getEnemyCount(AIR) > 0 && rng.RandFloat() > 0.66f) {
bt = BUILD_AA_DEFENSE;
layer = CCoverageCell::DEFENSE_ANTIAIR;
// layer = CCoverageCell::DEFENSE_ANTIAIR;
// TODO: replace STATIC with DEFENSE after all config files updated
incCats = STATIC|ANTIAIR;
excCats = TORPEDO;
}
else if (ai->gamemap->IsWaterMap() && rng.RandFloat() > 0.5f) {
bt = BUILD_UW_DEFENSE;
layer = CCoverageCell::DEFENSE_UNDERWATER;
// layer = CCoverageCell::DEFENSE_UNDERWATER;
// TODO: replace STATIC with DEFENSE after all config files updated
incCats = STATIC|TORPEDO;
// NOTE: we do not support coastal torpedo launchers
Expand All @@ -1090,15 +1087,17 @@ void CEconomy::tryBuildingDefense(CGroup* group) {
else
{
bt = BUILD_AG_DEFENSE;
layer = CCoverageCell::DEFENSE_GROUND;
// layer = CCoverageCell::DEFENSE_GROUND;
incCats = ATTACKER|DEFENSE;
excCats = ANTIAIR|TORPEDO;
}

size = ai->coverage->getLayerSize(layer);
k = size / (ai->unittable->staticUnits.size() - size + 1.0f);
/*
int size = ai->coverage->getLayerSize(layer);
const float k = size / (ai->unittable->staticUnits.size() - size + 1.0f);
bool allow;

/* switch (ai->difficulty) {
switch (ai->difficulty) {
case DIFFICULTY_EASY:
allow = k < 0.11f;
break;
Expand All @@ -1108,7 +1107,8 @@ void CEconomy::tryBuildingDefense(CGroup* group) {
case DIFFICULTY_HARD:
allow = k < 0.51f;
break;
}*/
}
*/

buildOrAssist(*group, bt, incCats, excCats);
}
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### Generic native Skirmish AI config
#
set(mySourceDirRel "") # Common values are "" or "src"
set(additionalSources ${CUtils_SRC})
set(additionalSources "")
set(additionalCompileFlags "")
set(additionalLibraries ${LegacyCpp_AIWRAPPER_TARGET} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY})
set(additionalLibraries ${LegacyCpp_AIWRAPPER_TARGET} CUtils ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY})

ConfigureNativeSkirmishAI(mySourceDirRel additionalSources additionalCompileFlags additionalLibraries)
2 changes: 1 addition & 1 deletion headers/Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/* AI meta data */
#define AI_VERSION_NR aiexport_getVersion()
#define AI_NAME std::string("E323AI")
#define AI_VERSION AI_NAME + " " + AI_VERSION_NR + " - High Templar (" + __DATE__ + ")"
#define AI_VERSION AI_NAME + " " + AI_VERSION_NR + " - High Templar"
#define AI_CREDITS "Error323 & Simon Logic"
#define AI_NOTES "This A.I. mainly focusses on the XTA and BA mods"

Expand Down