इस तुलना का शेष भाग लोड हो रहा है।

Untitled diff

बनाया गया Diff कभी समाप्त नहीं होता
220 हटाए गए
835 लाइनें
245 जोड़े गए
846 लाइनें
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// general ai for skirmish game
// general ai for skirmish game
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// Warzone2100, Pumpkin Studios,
// Warzone2100, Pumpkin Studios,
// alex lee.98/99.
// alex lee.98/99.
//
//
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////


//Tile in world units
//Tile in world units
#define TILE 128
#define TILE 128
#define NONE (-1)
#define NONE (-1)


// These are final rules of the lexical parser
// These are final rules of the lexical parser
#define R_REQUEST_HELP "help me"
#define R_REQUEST_HELP "help me"
#define R_REQUEST_BEACON "drop a beacon"
#define R_REQUEST_BEACON "drop a beacon"
#define R_REPORT_SAFETY "i'm ok"
#define R_REPORT_SAFETY "i'm ok"
#define R_REQUEST_ALLY "ally me"
#define R_REQUEST_ALLY "ally me"


// These are our own messages - lexical parser should be able to handle them
// These are our own messages - lexical parser should be able to handle them
#define M_REQUEST_HELP "help me!!"
#define M_REQUEST_HELP "help me!!"
#define M_REQUEST_BEACON "drop a beacon"
#define M_REQUEST_BEACON "drop a beacon"
#define M_AFFIRMATIVE_OK "ok"
#define M_AFFIRMATIVE_OK "ok"
#define M_AFFIRMATIVE_ROGER "roger"
#define M_AFFIRMATIVE_ROGER "roger"
#define M_ANNOYED "bug off"
#define M_ANNOYED "bug off"
#define M_HELPERS_KILLED "that was all I had.."
#define M_HELPERS_KILLED "that was all I had.."
#define M_HELP_NO_UNITS "I don't have anything"
#define M_HELP_NO_UNITS "I don't have anything"


#define MAX_PROBABILITY 100
#define MAX_PROBABILITY 100


// Base threat range in world units
// Base threat range in world units
#define W_BASE_THREAT_RANGE ((17 + (mapWidth + mapHeight) / 2 / 35) * TILE)
#define W_BASE_THREAT_RANGE ((17 + (mapWidth + mapHeight) / 2 / 35) * TILE)
#define ALL_ALLIES -1
#define ALL_ALLIES -1


#define BASE_DEFEND_DURATION (3 * 60)
#define BASE_DEFEND_DURATION 1


// Delay before we repeat our request, in seconds
// Delay before we repeat our request, in seconds
#define HELP_REQUEST_INTERVAL (3 * 60)
#define HELP_REQUEST_INTERVAL 20


//in secs
//in secs
#define BEACON_TIMEOUT 30
#define BEACON_TIMEOUT 25


#define MAX_DROIDS 150
#define MAX_DROIDS 150


//range for trucks to look for more oil
//range for trucks to look for more oil
#define MORE_OIL_RANGE (10 * TILE)
#define MORE_OIL_RANGE (10 * TILE)
//don't try to build on oil if there's threat within this range
//don't try to build on oil if there's threat within this range
#define OIL_THREAT_RANGE (9 * TILE)
#define OIL_THREAT_RANGE (9 * TILE)


#define MAX_TRUCKS 12
#define MAX_TRUCKS 14
#define MIN_TRUCKS 5
#define MIN_TRUCKS 2


//Enter power saving mode when lower than this
//Enter power saving mode when lower than this
#define LOW_POWER 250
#define LOW_POWER 250


//Target type values
//Target type values
#define NO_TARGET_VALUE 0
#define NO_TARGET_VALUE 0
#define DROID_TARGET_VALUE 1
#define DROID_TARGET_VALUE 1
#define OTHER_TARGET_VALUE 2
#define OTHER_TARGET_VALUE 2
#define DEFENSE_TARGET_VALUE 3
#define DEFENSE_TARGET_VALUE 3
#define RESEARCH_TARGET_VALUE 4
#define RESEARCH_TARGET_VALUE 4
#define HQ_TARGET_VALUE 5
#define HQ_TARGET_VALUE 5
#define OIL_TARGET_VALUE 6
#define OIL_TARGET_VALUE 6
#define FACTORY_TARGET_VALUE 7
#define FACTORY_TARGET_VALUE 7


#define UNLIMITED (-1)
#define UNLIMITED (-1)


#define AA_THREAT_RANGE (TILE * 12)
#define AA_THREAT_RANGE 1


#define MAX_DEFENDERS_RADIUS (TILE * 40)
#define MAX_DEFENDERS_RADIUS (TILE * 50)


#define MAX_VTOL_DEFEND_RADIUS (TILE * 25)
#define MAX_VTOL_DEFEND_RADIUS (TILE * 50)



// AI will remember max this number of structures
// AI will remember max this number of structures
#define MAX_REBUILD_STRUCT 100
#define MAX_REBUILD_STRUCT 100


//Total number of technology branches
//Total number of technology branches
#define TECHS 2
#define TECHS 6


//How many best templates to choose from when deciding what template to build
//How many best templates to choose from when deciding what template to build
#define MAX_RANDOM_TEMPLATES 4
#define MAX_RANDOM_TEMPLATES 4






private int me; // player for this instance.
private int me; // player for this instance.
public int tileExpand; // rate of exploration
public int tileExpand; // rate of exploration


public int numScouts[TECHS],maxScouts[TECHS]; // aim for...
public int numScouts[TECHS],maxScouts[TECHS]; // aim for...
public int numDefenders[TECHS],maxDefenders[TECHS];
public int numDefenders[TECHS],maxDefenders[TECHS];
public int numAttackers[TECHS],maxAttackers[TECHS];
public int numAttackers[TECHS],maxAttackers[TECHS];
public int numCyborgs[TECHS],maxCyborgs[TECHS];
public int numCyborgs[TECHS],maxCyborgs[TECHS];


public int branchDefault,branchVTOL,techCount[TECHS],maxVtolFacs[TECHS],maxIdleRes[TECHS],
public int branchRocket,branchVTOL,branchCannon,branchArtillery,branchOneAlly,branchTwoAlly,techCount[TECHS],maxVtolFacs[TECHS],maxIdleRes[TECHS],
maxVTOLs[TECHS],numVtolTargets,vtolTargetWeight[10],numRebuildStat[TECHS];
maxVTOLs[TECHS],numVtolTargets,vtolTargetWeight[10],numRebuildStat[TECHS];
public RESEARCHSTAT tech[TECHS][30]; //technology for different research branches
public RESEARCHSTAT tech[TECHS][47]; //technology for different research branches
public STRUCTURESTAT vtolTarget[10],rebuildStat[TECHS][2];
public STRUCTURESTAT vtolTarget[10],rebuildStat[TECHS][2];


// structures
// structures
private int baseX,baseY,minx,miny,maxx,maxy;
private int baseX,baseY,minx,miny,maxx,maxy;
public int numStructs,numIncendrys,numDefStructs,numExtraStructs[TECHS],numWallWeaps,numBaseStruct,numLightCyborgs,numFundamental;
public int numStructs,numIncendrys,numDefStructs,numExtraStructs[TECHS],numWallWeaps,numBaseStruct,numLightCyborgs,numFundamental;
private STRUCTURESTAT structChoice[5];
private STRUCTURESTAT structChoice[5];
public STRUCTURESTAT incendrys[8],structs[13],defStructs[26],extraStructs[TECHS][6],wallWeaps[11];
public STRUCTURESTAT incendrys[11],structs[16],defStructs[37],extraStructs[TECHS][6],wallWeaps[11];
public STRUCTURESTAT sensorTower,wall,cornerWall,resLab,powGen,playerHQ,lassat,factory,derrick,cybFactory,
public STRUCTURESTAT sensorTower,wall,cornerWall,resLab,powGen,playerHQ,lassat,factory,derrick,gderrick,cybFactory,
vtolDefStruct[5],vtolPad,vtolFactory,uplink,baseStruct[8];
vtolDefStruct[9],vtolPad,vtolFactory,uplink,baseStruct[8];