#include <AISkirmishPlayer.h>
Inherits AIPlayer.
Public Member Functions | |
| AISkirmishPlayer (Player *p) | |
| constructor | |
| virtual Bool | computeSuperweaponTarget (const SpecialPowerTemplate *power, Coord3D *pos, Int playerNdx, Real weaponRadius) |
| Calculates best pos for weapon given radius. | |
| virtual void | update () |
| simulates the behavior of a player | |
| virtual void | newMap () |
| New map loaded call. | |
| virtual void | onUnitProduced (Object *factory, Object *unit) |
| Invoked when a unit I am training comes into existence. | |
| virtual void | buildSpecificAITeam (TeamPrototype *teamProto, Bool priorityBuild) |
| Builds this team immediately. | |
| virtual void | buildSpecificAIBuilding (const AsciiString &thingName) |
| Builds this building as soon as possible. | |
| virtual void | buildAIBaseDefense (Bool flank) |
| Builds base defense on front or flank of base. | |
| virtual void | buildAIBaseDefenseStructure (const AsciiString &thingName, Bool flank) |
| Builds base defense on front or flank of base. | |
| virtual void | recruitSpecificAITeam (TeamPrototype *teamProto, Real recruitRadius) |
| Builds this team immediately. | |
| virtual Bool | isSkirmishAI (void) |
| virtual Bool | checkBridges (Object *unit, Waypoint *way) |
| virtual Player * | getAiEnemy (void) |
| Solo AI attacks based on scripting. Only skirmish auto-acquires an enemy at this point. jba. | |
Public Member Functions inherited from AIPlayer | |
| AIPlayer (Player *p) | |
| constructor | |
| virtual void | onStructureProduced (Object *factory, Object *structure) |
| Invoked when a structure I am building comes into existence. | |
| virtual void | repairStructure (ObjectID structure) |
| virtual void | selectSkillset (Int skillset) |
| Bool | getBaseCenter (Coord3D *pos) const |
| GameDifficulty | getAIDifficulty (void) const |
| Difficulty level for this player. | |
| void | setAIDifficulty (GameDifficulty difficulty) |
| void | buildBySupplies (Int minimumCash, const AsciiString &thingName) |
| Builds a building by supplies. | |
| void | buildSpecificBuildingNearestTeam (const AsciiString &thingName, const Team *team) |
| void | buildUpgrade (const AsciiString &upgrade) |
| void | aiPreTeamDestroy (const Team *team) |
| A team is about to be destroyed. | |
| Bool | isSupplySourceSafe (Int minSupplies) |
| Is the nearest supply source safe? | |
| Bool | isSupplySourceAttacked (void) |
| Is a supply source attacked? | |
| Bool | isLocationSafe (const Coord3D *pos, const ThingTemplate *tthing) |
| void | guardSupplyCenter (Team *team, Int minSupplies) |
| Have the team guard a supply center. | |
| void | setTeamDelaySeconds (Int delay) |
| Bool | calcClosestConstructionZoneLocation (const ThingTemplate *constructTemplate, Coord3D *location) |
| Calculates the closest construction zone location based on a template. | |
Public Member Functions inherited from MemoryPoolObject | |
| void | deleteInstance () |
Public Member Functions inherited from Snapshot | |
| Snapshot (void) | |
| ~Snapshot (void) | |
Protected Member Functions | |
| virtual void | crc (Xfer *xfer) |
| virtual void | xfer (Xfer *xfer) |
| virtual void | loadPostProcess (void) |
| virtual void | doBaseBuilding (void) |
| virtual void | checkReadyTeams (void) |
| virtual void | checkQueuedTeams (void) |
| virtual void | doTeamBuilding (void) |
| virtual Object * | findDozer (const Coord3D *pos) |
| virtual void | queueDozer (void) |
| virtual Bool | selectTeamToBuild (void) |
| determine the next team to build | |
| virtual Bool | selectTeamToReinforce (Int minPriority) |
| determine the next team to reinforce | |
| virtual Bool | startTraining (WorkOrder *order, Bool busyOK, AsciiString teamName) |
| find a production building that can handle the order, and start building | |
| virtual Bool | isAGoodIdeaToBuildTeam (TeamPrototype *proto) |
| return true if team should be built | |
| virtual void | processBaseBuilding (void) |
| do base-building behaviors | |
| virtual void | processTeamBuilding (void) |
| do team-building behaviors | |
| void | adjustBuildList (BuildListInfo *list) |
| Int | getMyEnemyPlayerIndex (void) |
| void | acquireEnemy (void) |
Protected Member Functions inherited from AIPlayer | |
| virtual void | doUpgradesAndSkills (void) |
| MAKE_DLINK_HEAD (TeamInQueue, TeamBuildQueue) | |
| List of teams being build. | |
| MAKE_DLINK_HEAD (TeamInQueue, TeamReadyQueue) | |
| List of teams built, waiting to reach rally point. | |
| Bool | isPossibleToBuildTeam (TeamPrototype *proto, Bool requireIdleFactory, Bool &needMoney) |
| return true if team can be considered for building | |
| Object * | buildStructureNow (const ThingTemplate *bldgPlan, BuildListInfo *info) |
| Build a base buiding. | |
| Object * | buildStructureWithDozer (const ThingTemplate *bldgPlan, BuildListInfo *info) |
| Build a base buiding. | |
| void | clearTeamsInQueue (void) |
| Delete all teams in the build queue. | |
| void | computeCenterAndRadiusOfBase (Coord3D *center, Real *radius) |
| Object * | findFactory (const ThingTemplate *thing, Bool busyOK) |
| Find a factory to build a unit. If force is true, may return a busy factory. | |
| void | queueUnits (void) |
| Check the team build list, & queue up units at any idle factories. | |
| void | checkForSupplyCenter (BuildListInfo *info, Object *bldg) |
| void | queueSupplyTruck (void) |
| void | updateBridgeRepair (void) |
| Bool | dozerInQueue (void) |
| Object * | findSupplyCenter (Int minSupplies) |
Protected Member Functions inherited from MemoryPoolObject | |
| virtual | ~MemoryPoolObject () |
| void * | operator new (size_t s) |
| void | operator delete (void *p) |
| virtual MemoryPool * | getObjectMemoryPool ()=0 |
Additional Inherited Members | |
Protected Types inherited from AIPlayer | |
| enum | { MAX_STRUCTURES_TO_REPAIR = 2 } |
Static Protected Member Functions inherited from AIPlayer | |
| static Int | getPlayerSuperweaponValue (Coord3D *center, Int playerNdx, Real radius, Bool includeMilitaryUnits=TRUE) |
| static void | getPlayerStructureBounds (Region2D *bounds, Int playerNdx, Bool conservative=FALSE) |
The computer-controlled opponent.
Definition at line 44 of file AISkirmishPlayer.h.
| AISkirmishPlayer::AISkirmishPlayer | ( | Player * | p | ) |
constructor
Definition at line 73 of file AISkirmishPlayer.cpp.
|
protected |
Get the AI's enemy. Recalc if it has been a while (5 seconds.)
Definition at line 485 of file AISkirmishPlayer.cpp.
|
protected |
Adjusts the build list to match the starting position.
Definition at line 965 of file AISkirmishPlayer.cpp.
|
virtual |
Builds base defense on front or flank of base.
Build base defense structures on the front or flank of the base.
Reimplemented from AIPlayer.
Definition at line 566 of file AISkirmishPlayer.cpp.
|
virtual |
Builds base defense on front or flank of base.
Build base defense structures on the front or flank of the base.
Base defenses are placed as follows: m_baseCenter and m_baseRadius are calculated on map load. Defenses are placed along the this circle. Front defenses (!flank) are placed starting at the "Center" approach path.
The first front defense is placed towards th Center path. Number 2 is placed to the left of #1, #3 is placed to the right of #1, #4 is placed to the left of #2 and so on. So it looks like:
#1
#2 #3
#6 #4 #5 #7
#8 #9
The flank base defenses cover the "Flank" approach, and the "Backdoor" approach. They alternate between these two, so the first flank defense covers flank, and the second covers backdoor, and continue to alternate. They cover the approach using the same pattern as front above. John A.
Reimplemented from AIPlayer.
Definition at line 604 of file AISkirmishPlayer.cpp.
|
virtual |
Builds this building as soon as possible.
Build a specific building.
Reimplemented from AIPlayer.
Definition at line 415 of file AISkirmishPlayer.cpp.
|
virtual |
Builds this team immediately.
Build a specific team. If priorityBuild, put at front of queue with priority set.
Reimplemented from AIPlayer.
Definition at line 743 of file AISkirmishPlayer.cpp.
Checks bridges along a waypoint path. If any are destroyed, sends a dozer to fix, and returns true. If there is no bridge problem, returns false.
Reimplemented from AIPlayer.
Definition at line 718 of file AISkirmishPlayer.cpp.
|
protectedvirtual |
See if any queued teams have finished building, or have run out of time.
Reimplemented from AIPlayer.
Definition at line 913 of file AISkirmishPlayer.cpp.
|
protectedvirtual |
See if any ready teams have finished moving to the rally point.
Reimplemented from AIPlayer.
Definition at line 904 of file AISkirmishPlayer.cpp.
|
virtual |
Calculates best pos for weapon given radius.
Find a good spot to fire a superweapon.
Reimplemented from AIPlayer.
Definition at line 1135 of file AISkirmishPlayer.cpp.
|
protectedvirtual |
|
protectedvirtual |
See if it's time to build another base building.
Reimplemented from AIPlayer.
Definition at line 871 of file AISkirmishPlayer.cpp.
|
protectedvirtual |
See if it is time to start another ai team building.
Reimplemented from AIPlayer.
Definition at line 922 of file AISkirmishPlayer.cpp.
Finds a dozer that isn't building or collecting resources.
Reimplemented from AIPlayer.
Definition at line 1125 of file AISkirmishPlayer.cpp.
|
virtual |
Solo AI attacks based on scripting. Only skirmish auto-acquires an enemy at this point. jba.
Get the AI's enemy. Recalc if it has been a while (20 seconds.)
Reimplemented from AIPlayer.
Definition at line 554 of file AISkirmishPlayer.cpp.
|
protected |
Gets the player index of my enemy.
Definition at line 468 of file AISkirmishPlayer.cpp.
|
protectedvirtual |
return true if team should be built
Check if this team is buildable, doesn't exceed maximum limits, meets conditions, and isn't under construction.
Reimplemented from AIPlayer.
Definition at line 357 of file AISkirmishPlayer.cpp.
|
inlinevirtual |
Reimplemented from AIPlayer.
Definition at line 72 of file AISkirmishPlayer.h.
|
protectedvirtual |
Load post process
Reimplemented from AIPlayer.
Definition at line 1234 of file AISkirmishPlayer.cpp.
|
virtual |
New map loaded call.
Find any things that build stuff & add them to the build list. Then build any initially built buildings.
Reimplemented from AIPlayer.
Definition at line 1075 of file AISkirmishPlayer.cpp.
Invoked when a unit I am training comes into existence.
Invoked when a unit I am training comes into existence
Reimplemented from AIPlayer.
Definition at line 319 of file AISkirmishPlayer.cpp.
|
protectedvirtual |
do base-building behaviors
Build our base.
Reimplemented from AIPlayer.
Definition at line 99 of file AISkirmishPlayer.cpp.
|
protectedvirtual |
do team-building behaviors
Train our teams.
Reimplemented from AIPlayer.
Definition at line 859 of file AISkirmishPlayer.cpp.
|
protectedvirtual |
Queues up a dozer.
Reimplemented from AIPlayer.
Definition at line 1116 of file AISkirmishPlayer.cpp.
|
virtual |
Builds this team immediately.
Recruit a specific team, within the specific radius of the home position.
Reimplemented from AIPlayer.
Definition at line 752 of file AISkirmishPlayer.cpp.
|
protectedvirtual |
determine the next team to build
Determine the next team to build. Return true if one was selected.
Reimplemented from AIPlayer.
Definition at line 407 of file AISkirmishPlayer.cpp.
determine the next team to reinforce
See if any existing teams need reinforcements, and have higher priority.
Reimplemented from AIPlayer.
Definition at line 399 of file AISkirmishPlayer.cpp.
|
protectedvirtual |
find a production building that can handle the order, and start building
Search the computer player's buildings for one that can build the given request and start training the unit. If busyOK is true, it will queue a unit even if one is building. This lets script invoked teams "push" to the front of the queue.
Reimplemented from AIPlayer.
Definition at line 330 of file AISkirmishPlayer.cpp.
|
virtual |
simulates the behavior of a player
Perform computer-controlled player AI
Reimplemented from AIPlayer.
Definition at line 956 of file AISkirmishPlayer.cpp.
|
protectedvirtual |
Xfer method Version Info; 1: Initial version
Reimplemented from AIPlayer.
Definition at line 1194 of file AISkirmishPlayer.cpp.
|
protected |
Definition at line 109 of file AISkirmishPlayer.h.
|
protected |
Definition at line 108 of file AISkirmishPlayer.h.
|
protected |
Definition at line 110 of file AISkirmishPlayer.h.
|
protected |
Definition at line 111 of file AISkirmishPlayer.h.
|
protected |
Definition at line 112 of file AISkirmishPlayer.h.
|
protected |
Definition at line 113 of file AISkirmishPlayer.h.
|
protected |
Definition at line 118 of file AISkirmishPlayer.h.
|
protected |
Definition at line 114 of file AISkirmishPlayer.h.
|
protected |
Definition at line 115 of file AISkirmishPlayer.h.
|
protected |
Definition at line 117 of file AISkirmishPlayer.h.