#include <Player.h>
Inherits Snapshot.
Public Types | |
| typedef std::list< TeamPrototype * > | PlayerTeamList |
Public Member Functions | |
| Player (Int playerIndex) | |
| virtual | ~Player () |
| void | update () |
| player update opportunity | |
| void | newMap () |
| player after map loaded opportunity | |
| void | init (const PlayerTemplate *pt) |
| void | initFromDict (const Dict *d) |
| void | setDefaultTeam (void) |
| UnicodeString | getPlayerDisplayName () |
| NameKeyType | getPlayerNameKey () const |
| AsciiString | getSide () const |
| AsciiString | getBaseSide () const |
| const PlayerTemplate * | getPlayerTemplate () const |
| const Handicap * | getHandicap () const |
| return the Player's Handicap sub-object | |
| Handicap * | getHandicap () |
| Money * | getMoney () |
| return the Player's Money sub-object | |
| const Money * | getMoney () const |
| UnsignedInt | getSupplyBoxValue () |
| Many things can affect the alue of a crate, but at heart it is a GlobalData ratio. | |
| Energy * | getEnergy () |
| const Energy * | getEnergy () const |
| void | addPowerBonus (Object *obj) |
| void | removePowerBonus (Object *obj) |
| ResourceGatheringManager * | getResourceGatheringManager () |
| TunnelTracker * | getTunnelSystem () |
| Color | getPlayerColor () const |
| Color | getPlayerNightColor () const |
| PlayerType | getPlayerType () const |
| return the type of controller | |
| void | setPlayerType (PlayerType t, Bool skirmish) |
| PlayerIndex | getPlayerIndex () const |
| PlayerMaskType | getPlayerMask () const |
| return a bitmask that is unique to this player. | |
| Bool | allowedToBuild (const ThingTemplate *tmplate) const |
| Bool | canBuild (const ThingTemplate *tmplate) const |
| true if we have the prereqs for this item | |
| Bool | canAffordBuild (const ThingTemplate *whatToBuild) const |
| Bool | canBuildMoreOfType (const ThingTemplate *whatToBuild) const |
| GameDifficulty | getPlayerDifficulty (void) const |
| Difficulty level for this player. | |
| Object * | findNaturalCommandCenter () |
| Object * | findAnyExistingObjectWithThingTemplate (const ThingTemplate *thing) |
| Object * | findMostReadyShortcutSpecialPowerOfType (SpecialPowerType spType) |
| Object * | findMostReadyShortcutWeaponForThing (const ThingTemplate *thing, UnsignedInt &mostReadyPercentage) |
| Object * | findMostReadyShortcutSpecialPowerForThing (const ThingTemplate *thing, UnsignedInt &mostReadyPercentage) |
| Bool | hasAnyShortcutSpecialPower () |
| Int | countReadyShortcutSpecialPowersOfType (SpecialPowerType spType) |
| Bool | hasScience (ScienceType t) const |
| return t if the player has the given science, either intrinsically, via specialization, or via capture. | |
| Bool | isScienceDisabled (ScienceType t) const |
| Can't purchase this science because of script reasons. | |
| Bool | isScienceHidden (ScienceType t) const |
| This science is effectively hidden due to script reasons. | |
| void | setScienceAvailability (ScienceType science, ScienceAvailabilityType type) |
| ScienceAvailabilityType | getScienceAvailabilityTypeFromString (const AsciiString &name) |
| Bool | hasPrereqsForScience (ScienceType t) const |
| return t iff the player has all sciences that are prereqs for knowing the given science | |
| Bool | hasUpgradeComplete (const UpgradeTemplate *upgradeTemplate) |
| does player have totally done and produced upgrade | |
| Bool | hasUpgradeComplete (UpgradeMaskType testMask) |
| does player have totally done and produced upgrade | |
| UpgradeMaskType | getCompletedUpgradeMask () const |
| get list of upgrades that are completed | |
| Bool | hasUpgradeInProduction (const UpgradeTemplate *upgradeTemplate) |
| does player have this upgrade in progress right now | |
| Upgrade * | addUpgrade (const UpgradeTemplate *upgradeTemplate, UpgradeStatusType status) |
| add upgrade, or update existing upgrade status | |
| void | removeUpgrade (const UpgradeTemplate *upgradeTemplate) |
| remove thsi upgrade from us | |
| Upgrade * | findUpgrade (const UpgradeTemplate *upgradeTemplate) |
| void | onUpgradeCompleted (const UpgradeTemplate *upgradeTemplate) |
| An upgrade just finished, do things like tell all objects to recheck UpgradeModules. | |
| void | onUpgradeRemoved () |
| An upgrade just got removed, this doesn't do anything now. | |
| void | onPowerBrownOutChange (Bool brownOut) |
| one of my command centers just fired a special power, let us reset timers for all command centers. | |
| void | resetOrStartSpecialPowerReadyFrame (const SpecialPowerTemplate *temp) |
| my new command center wants to init his timers to the status quo | |
| UnsignedInt | getOrStartSpecialPowerReadyFrame (const SpecialPowerTemplate *temp) |
| void | expressSpecialPowerReadyFrame (const SpecialPowerTemplate *temp, UnsignedInt frame) |
| void | addNewSharedSpecialPowerTimer (const SpecialPowerTemplate *temp, UnsignedInt frame) |
| void | addRadar (Bool disableProof) |
| One more producer of Radar exists. | |
| void | removeRadar (Bool disableProof) |
| One less thing produces radar. | |
| void | disableRadar () |
| No matter how many radar producers I have, I do not have radar. | |
| void | enableRadar () |
| remove the restriction imposed by disableRadar | |
| Bool | hasRadar () const |
| A positive number of radar producers, plus my radar is not disabled. | |
| Bool | okToPlayRadarEdgeSound () |
| just like it "sounds" | |
| void | changeBattlePlan (BattlePlanStatus plan, Int delta, BattlePlanBonuses *bonus) |
| Int | getNumBattlePlansActive () const |
| Int | getBattlePlansActiveSpecific (BattlePlanStatus plan) const |
| void | applyBattlePlanBonusesForObject (Object *obj) const |
| void | removeBattlePlanBonusesForObject (Object *obj) const |
| void | applyBattlePlanBonusesForPlayerObjects (const BattlePlanBonuses *bonus) |
| Bool | doesObjectQualifyForBattlePlan (Object *obj) const |
| void | friend_applyDifficultyBonusesForObject (Object *obj, Bool apply) const |
| void | removeKindOfProductionCostChange (KindOfMaskType kindOf, Real percent) |
| Decrement the ref counter on the typeof production list node. | |
| void | addKindOfProductionCostChange (KindOfMaskType kindOf, Real percent) |
| add type of production cost change (Used for upgrades) | |
| Real | getProductionCostChangeBasedOnKindOf (KindOfMaskType kindOf) const |
| Returns production cost change based on typeof (Used for upgrades) | |
| Real | getProductionCostChangePercent (AsciiString buildTemplateName) const |
| Real | getProductionTimeChangePercent (AsciiString buildTemplateName) const |
| VeterancyLevel | getProductionVeterancyLevel (AsciiString buildTemplateName) const |
| void | friend_setSkillset (Int skillSet) |
| void | becomingTeamMember (Object *obj, Bool yes) |
| void | becomingLocalPlayer (Bool yes) |
| Bool | isLocalPlayer () const |
| Is this player the local player? | |
| void | setListInScoreScreen (Bool listInScoreScreen) |
| this player should be listed in the score screen. | |
| Bool | getListInScoreScreen () |
| return TRUE if this player should be listed in the score screen. | |
| void | onUnitCreated (Object *factory, Object *unit) |
| A unit was just created and is ready to control. | |
| void | preTeamDestroy (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? | |
| void | setTeamDelaySeconds (Int delay) |
| Set delay between team production. | |
| void | guardSupplyCenter (Team *team, Int minSupplies) |
| Have the team guard a supply center. | |
| virtual Bool | computeSuperweaponTarget (const SpecialPowerTemplate *power, Coord3D *pos, Int playerNdx, Real weaponRadius) |
| Calculates best pos for weapon given radius. | |
| Player * | getCurrentEnemy (void) |
| Get the enemy an ai player is currently focused on. NOTE - Can be NULL. | |
| Bool | isSkirmishAIPlayer (void) |
| Is this player a skirmish ai player? | |
| virtual Bool | checkBridges (Object *unit, Waypoint *way) |
| Have the ai check for bridges. | |
| virtual Bool | getAiBaseCenter (Coord3D *pos) |
| Get the center of the ai's base. | |
| virtual void | repairStructure (ObjectID structureID) |
| Have the ai check for bridges. | |
| void | onStructureCreated (Object *builder, Object *structure) |
| a structuer was just created, but is under construction | |
| void | onStructureConstructionComplete (Object *builder, Object *structure, Bool isRebuild) |
| a structure that was under construction has become completed | |
| void | onStructureUndone (Object *structure) |
| a structure that was created has been pre-emptively removed and shouldn't be counted in the score. | |
| void | countObjectsByThingTemplate (Int numTmplates, const ThingTemplate *const *things, Bool ignoreDead, Int *counts, Bool ignoreUnderConstruction=TRUE) const |
| Int | countBuildings (void) |
| Int | countObjects (KindOfMaskType setMask, KindOfMaskType clearMask) |
| Object * | findClosestByKindOf (Object *queryObject, KindOfMaskType setMask, KindOfMaskType clearMask) |
| Returns the closest of a given type to the given object. | |
| Bool | hasAnyBuildings (void) const |
| Bool | hasAnyBuildings (KindOfMaskType kindOf) const |
| Bool | hasAnyUnits (void) const |
| Bool | hasAnyObjects (void) const |
| Bool | hasAnyBuildFacility (void) const |
| void | updateTeamStates (void) |
| void | healAllObjects () |
| void | iterateObjects (ObjectIterateFunc func, void *userData) const |
| Team * | getDefaultTeam () |
| const Team * | getDefaultTeam () const |
| void | setBuildList (BuildListInfo *pBuildList) |
| sets the build list. | |
| BuildListInfo * | getBuildList (void) |
| returns the build list. (build list might be modified by the solo AI) | |
| void | addToBuildList (Object *obj) |
| Adds this to the build list. Used for factories placed instead of in build list. | |
| void | addToPriorityBuildList (AsciiString templateName, Coord3D *pos, Real angle) |
| Adds this to the build list. Used for factories placed instead of in build list. | |
| Relationship | getRelationship (const Team *that) const |
| get the relationship between this->that. | |
| void | setPlayerRelationship (const Player *that, Relationship r) |
| set the relationship between this->that. (note that this doesn't affect the that->this relationship.) | |
| Bool | removePlayerRelationship (const Player *that) |
| void | setTeamRelationship (const Team *that, Relationship r) |
| Bool | removeTeamRelationship (const Team *that) |
| void | addTeamToList (TeamPrototype *team) |
| void | removeTeamFromList (TeamPrototype *team) |
| const PlayerTeamList * | getPlayerTeams () const |
| Int | getMpStartIndex (void) |
| void | setUnitsShouldHunt (Bool unitsShouldHunt, CommandSourceType source) |
| Set that all units should begin hunting. | |
| Bool | getUnitsShouldHunt () const |
| void | setUnitsVisionSpied (Bool setting, KindOfMaskType whichUnits, PlayerIndex byWhom) |
| All of our units are new spied upon; they sight for the given enemy. | |
| void | killPlayer (void) |
| Destroy all of the teams for this player, causing him to DIE. | |
| void | setObjectsEnabled (AsciiString templateTypeToAffect, Bool enable) |
| Enabled/Disable all objects of type templateTypeToAffect. | |
| void | buildSpecificTeam (TeamPrototype *teamProto) |
| Build an instance of a specific team. Gets passed to aiPlayer. | |
| void | buildSpecificBuilding (const AsciiString &thingName) |
| Build an instance of a specific building. Gets passed to aiPlayer. | |
| void | buildBySupplies (Int minimumCash, const AsciiString &thingName) |
| Build a building near a supply dump with at least cash. Gets passed to aiPlayer. | |
| void | buildSpecificBuildingNearestTeam (const AsciiString &thingName, const Team *team) |
| Build an instance of a specific building nearest specified team. Gets passed to aiPlayer. | |
| void | buildUpgrade (const AsciiString &upgrade) |
| Build an upgrade. Gets passed to aiPlayer. | |
| void | buildBaseDefense (Bool flank) |
| Build base defense on front or flank of base. Gets passed to aiPlayer. | |
| void | buildBaseDefenseStructure (const AsciiString &thingName, Bool flank) |
| Build structure type on front or flank of base. Gets passed to aiPlayer. | |
| void | recruitSpecificTeam (TeamPrototype *teamProto, Real recruitRadius) |
| Recruits an instance of a specific team. Gets passed to aiPlayer. | |
| Bool | calcClosestConstructionZoneLocation (const ThingTemplate *constructTemplate, Coord3D *location) |
| Calculates the closest construction zone location based on a template. Gets plassed to aiPlayer. | |
| Bool | getCanBuildUnits (void) |
| Enable/Disable the construction of units. | |
| void | setCanBuildUnits (Bool canProduce) |
| Bool | getCanBuildBase (void) |
| Enable/Disable the construction of base buildings. | |
| void | setCanBuildBase (Bool canProduce) |
| void | transferAssetsFromThat (Player *that) |
| Transfer all assets from player that to this. | |
| void | sellEverythingUnderTheSun (void) |
| Sell everything this player owns. | |
| void | garrisonAllUnits (CommandSourceType source) |
| void | ungarrisonAllUnits (CommandSourceType source) |
| void | setUnitsShouldIdleOrResume (Bool idle) |
| Bool | isPlayableSide (void) const |
| Bool | isPlayerObserver (void) const |
| Bool | isPlayerDead (void) const |
| Bool | isPlayerActive (void) const |
| Bool | didPlayerPreorder (void) const |
| ScoreKeeper * | getScoreKeeper (void) |
| Grab the scorekeeper so we can score up in here! | |
| void | processCreateTeamGameMessage (Int hotkeyNum, GameMessage *msg) |
| time to create a hotkey team based on this GameMessage | |
| void | processSelectTeamGameMessage (Int hotkeyNum, GameMessage *msg) |
| time to select a hotkey team based on this GameMessage | |
| void | processAddTeamGameMessage (Int hotkeyNum, GameMessage *msg) |
| void | getCurrentSelectionAsAIGroup (AIGroup *group) |
| void | setCurrentlySelectedAIGroup (AIGroup *group) |
| void | addAIGroupToCurrentSelection (AIGroup *group) |
| Squad * | getHotkeySquad (Int squadNumber) |
| Int | getSquadNumberForObject (const Object *objToFind) const |
| void | removeObjectFromHotkeySquad (Object *objToRemove) |
| void | setAttackedBy (Int playerNdx) |
| Bool | getAttackedBy (Int playerNdx) const |
| UnsignedInt | getAttackedFrame (void) |
| Real | getCashBounty () const |
| void | setCashBounty (Real percentage) |
| void | doBountyForKill (const Object *killer, const Object *victim) |
| AcademyStats * | getAcademyStats () |
| const AcademyStats * | getAcademyStats () const |
| Bool | isLogicalRetaliationModeEnabled () const |
| void | setLogicalRetaliationModeEnabled (Bool set) |
| Int | getSkillPoints () const |
| Int | getSciencePurchasePoints () const |
| Int | getRankLevel () const |
| Int | getSkillPointsLevelUp () const |
| Int | getSkillPointsLevelDown () const |
| UnicodeString | getGeneralName () const |
| void | setGeneralName (UnicodeString name) |
| Bool | setRankLevel (Int level) |
| returns TRUE if rank level really changed. | |
| Bool | addSkillPoints (Int delta) |
| returns TRUE if the player gained/lost levels as a result. | |
| Bool | addSkillPointsForKill (const Object *killer, const Object *victim) |
| returns TRUE if the player gained/lost levels as a result. | |
| void | addSciencePurchasePoints (Int delta) |
| void | setSkillPointsModifier (Real expMod) |
| Real | getSkillPointsModifier (void) const |
| void | resetSciences () |
| reset the sciences to just the intrinsic ones from the playertemplate, if any. | |
| void | resetRank () |
| reset rank to 1. | |
| Bool | attemptToPurchaseScience (ScienceType science) |
| Bool | grantScience (ScienceType science) |
| Bool | isCapableOfPurchasingScience (ScienceType science) const |
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) |
| void | deleteUpgradeList (void) |
| delete all our upgrades | |
A "Player" as an entity that contains the persistent info of the Player, as well as containing transient mission data.
Some of the Player's attributes persist between missions, whereas others are "transient" and only have meaning in a mission, wherein they change a lot (current tech tree state, current buildings built, units trained, money, etc). (For clarity of nomenclature, we'll refer to all "persistent" vs "non-persistent" attributes, since "transient" has an unclear duration.)
A "Player" consists of an entity controlling a single set of units in a mission. A Player may be human or computer controlled.
All Players have a (transient) "Player Index" associated which allows us to do some shorthand for representing Players in some cases (mainly in bitfields). This is always a 0-based number (-1 is used as an illegal index). Note that a logical conclusion of this is that it makes it desirable to limit the maximum number of simultaneous Players to 32, but that seems quite reasonable.
All persistent data associated with the Player will be saved to local storage and/or synchronized with one of our servers for online play.
Note, simple accessor methods are omitted for brevity... for now, you may infer them from the data structures.
Note also that the class (and the relevant subclasses) are almost certainly incomplete; a short perusal of the RA2 equivalent class(es) have waaay more tweaky data fields, some of which will probably be necessary (in some form, at some point), some of which won't ever be necessary. Rather than trying to guess at all of them here, we're limiting the initial setup to be the almost-certainly-necessary, filling in the extra things as needed. (Note that most of these will be non-persistent!)
| typedef std::list<TeamPrototype*> Player::PlayerTeamList |
| Player::Player | ( | Int | playerIndex | ) |
Definition at line 303 of file Player.cpp.
|
virtual |
Definition at line 537 of file Player.cpp.
| void Player::addAIGroupToCurrentSelection | ( | AIGroup * | group | ) |
Select a hotkey team based on this GameMessage
Definition at line 3805 of file Player.cpp.
| void Player::addKindOfProductionCostChange | ( | KindOfMaskType | kindOf, |
| Real | percent ) |
add type of production cost change (Used for upgrades)
addTypeOfProductionCostChange adds a production change to the typeof list
Definition at line 3824 of file Player.cpp.
| void Player::addNewSharedSpecialPowerTimer | ( | const SpecialPowerTemplate * | temp, |
| UnsignedInt | frame ) |
Definition at line 3283 of file Player.cpp.
| void Player::addRadar | ( | Bool | disableProof | ) |
One more producer of Radar exists.
The parameter object has just aquired a radar
Definition at line 3164 of file Player.cpp.
| void Player::addSciencePurchasePoints | ( | Int | delta | ) |
Definition at line 2587 of file Player.cpp.
returns TRUE if the player gained/lost levels as a result.
Definition at line 2469 of file Player.cpp.
returns TRUE if the player gained/lost levels as a result.
Definition at line 2494 of file Player.cpp.
| void Player::addTeamToList | ( | TeamPrototype * | team | ) |
Definition at line 1761 of file Player.cpp.
| void Player::addToBuildList | ( | Object * | obj | ) |
Adds this to the build list. Used for factories placed instead of in build list.
Definition at line 685 of file Player.cpp.
| void Player::addToPriorityBuildList | ( | AsciiString | templateName, |
| Coord3D * | pos, | ||
| Real | angle ) |
Adds this to the build list. Used for factories placed instead of in build list.
Definition at line 698 of file Player.cpp.
| Upgrade * Player::addUpgrade | ( | const UpgradeTemplate * | upgradeTemplate, |
| UpgradeStatusType | status ) |
add upgrade, or update existing upgrade status
Give the player an upgrade or change status on an existing upgrade entry
Definition at line 3037 of file Player.cpp.
| Bool Player::allowedToBuild | ( | const ThingTemplate * | tmplate | ) | const |
a convenience function to test the ThingTemplate against the players canBuild flags called by canBuild
Definition at line 2327 of file Player.cpp.
| void Player::applyBattlePlanBonusesForObject | ( | Object * | obj | ) | const |
Definition at line 3597 of file Player.cpp.
| void Player::applyBattlePlanBonusesForPlayerObjects | ( | const BattlePlanBonuses * | bonus | ) |
Definition at line 3625 of file Player.cpp.
| Bool Player::attemptToPurchaseScience | ( | ScienceType | science | ) |
attempt to purchase the science, but use prereqs, and charge points. return true if successful.
Definition at line 2601 of file Player.cpp.
| void Player::becomingLocalPlayer | ( | Bool | yes | ) |
this is called when the player becomes the local player (yes==true) or ceases to be the local player (yes==false). you can't stop this from happening; you can only react to it.
Definition at line 1110 of file Player.cpp.
the given object has just become (or just ceased to be) a member of one of our teams (or subteams)
Definition at line 1060 of file Player.cpp.
| void Player::buildBaseDefense | ( | Bool | flank | ) |
Build base defense on front or flank of base. Gets passed to aiPlayer.
Definition at line 2351 of file Player.cpp.
| void Player::buildBaseDefenseStructure | ( | const AsciiString & | thingName, |
| Bool | flank ) |
Build structure type on front or flank of base. Gets passed to aiPlayer.
Definition at line 2361 of file Player.cpp.
| void Player::buildBySupplies | ( | Int | minimumCash, |
| const AsciiString & | thingName ) |
Build a building near a supply dump with at least cash. Gets passed to aiPlayer.
Definition at line 2381 of file Player.cpp.
| void Player::buildSpecificBuilding | ( | const AsciiString & | thingName | ) |
Build an instance of a specific building. Gets passed to aiPlayer.
Definition at line 2371 of file Player.cpp.
| void Player::buildSpecificBuildingNearestTeam | ( | const AsciiString & | thingName, |
| const Team * | team ) |
Build an instance of a specific building nearest specified team. Gets passed to aiPlayer.
Definition at line 2390 of file Player.cpp.
| void Player::buildSpecificTeam | ( | TeamPrototype * | teamProto | ) |
Build an instance of a specific team. Gets passed to aiPlayer.
Definition at line 2341 of file Player.cpp.
| void Player::buildUpgrade | ( | const AsciiString & | upgrade | ) |
Build an upgrade. Gets passed to aiPlayer.
Definition at line 2399 of file Player.cpp.
| Bool Player::calcClosestConstructionZoneLocation | ( | const ThingTemplate * | constructTemplate, |
| Coord3D * | location ) |
Calculates the closest construction zone location based on a template. Gets plassed to aiPlayer.
Definition at line 2421 of file Player.cpp.
| Bool Player::canAffordBuild | ( | const ThingTemplate * | whatToBuild | ) | const |
Definition at line 2959 of file Player.cpp.
| Bool Player::canBuild | ( | const ThingTemplate * | tmplate | ) | const |
true if we have the prereqs for this item
Definition at line 2912 of file Player.cpp.
| Bool Player::canBuildMoreOfType | ( | const ThingTemplate * | whatToBuild | ) | const |
Definition at line 2886 of file Player.cpp.
| void Player::changeBattlePlan | ( | BattlePlanStatus | plan, |
| Int | delta, | ||
| BattlePlanBonuses * | bonus ) |
Definition at line 3423 of file Player.cpp.
Have the ai check for bridges.
Do any bridges need repair, and if so repair them.
Definition at line 1563 of file Player.cpp.
|
virtual |
Calculates best pos for weapon given radius.
Find a good spot to fire a superweapon.
Definition at line 1198 of file Player.cpp.
| Int Player::countBuildings | ( | void | ) |
simply returns the number of buildings owned by this player
Definition at line 1824 of file Player.cpp.
| Int Player::countObjects | ( | KindOfMaskType | setMask, |
| KindOfMaskType | clearMask ) |
simply returns the number of objects owned by this player with a specific KindOfMaskType
Definition at line 1837 of file Player.cpp.
| void Player::countObjectsByThingTemplate | ( | Int | numTmplates, |
| const ThingTemplate *const * | things, | ||
| Bool | ignoreDead, | ||
| Int * | counts, | ||
| Bool | ignoreUnderConstruction = TRUE ) const |
a convenience routine to count the number of owned objects that match a set of ThingTemplates. You input the count and an array of ThingTemplate*, and provide an array of Int of the same size. It fills in the array to the correct counts. This is handy because we must traverse the player's list-of-objects only once.
Definition at line 1808 of file Player.cpp.
| Int Player::countReadyShortcutSpecialPowersOfType | ( | SpecialPowerType | spType | ) |
Definition at line 1539 of file Player.cpp.
|
protectedvirtual |
|
protected |
delete all our upgrades
Definition at line 2971 of file Player.cpp.
| void Player::disableRadar | ( | ) |
No matter how many radar producers I have, I do not have radar.
Definition at line 3207 of file Player.cpp.
Definition at line 2432 of file Player.cpp.
Definition at line 3406 of file Player.cpp.
| void Player::enableRadar | ( | ) |
remove the restriction imposed by disableRadar
Definition at line 3223 of file Player.cpp.
| void Player::expressSpecialPowerReadyFrame | ( | const SpecialPowerTemplate * | temp, |
| UnsignedInt | frame ) |
Definition at line 3315 of file Player.cpp.
| Object * Player::findAnyExistingObjectWithThingTemplate | ( | const ThingTemplate * | thing | ) |
Definition at line 1514 of file Player.cpp.
| Object * Player::findClosestByKindOf | ( | Object * | queryObject, |
| KindOfMaskType | setMask, | ||
| KindOfMaskType | clearMask ) |
Returns the closest of a given type to the given object.
Definition at line 1850 of file Player.cpp.
| Object * Player::findMostReadyShortcutSpecialPowerForThing | ( | const ThingTemplate * | thing, |
| UnsignedInt & | mostReadyPercentage ) |
Definition at line 1501 of file Player.cpp.
| Object * Player::findMostReadyShortcutSpecialPowerOfType | ( | SpecialPowerType | spType | ) |
Definition at line 1476 of file Player.cpp.
| Object * Player::findMostReadyShortcutWeaponForThing | ( | const ThingTemplate * | thing, |
| UnsignedInt & | mostReadyPercentage ) |
Definition at line 1488 of file Player.cpp.
| Object * Player::findNaturalCommandCenter | ( | ) |
return the player's command center. (must be one of his "normal" ones, not a captured one.) if he has none, return null. if he has multiple, return one arbitrarily.
Definition at line 1466 of file Player.cpp.
| Upgrade * Player::findUpgrade | ( | const UpgradeTemplate * | upgradeTemplate | ) |
find upgrade, NOTE, the upgrade may NOT be "complete" and therefore "active", it could be in production This function is for actually retrieving the Upgrade. To test existance, use the fast bit testers hasUpgradeX()
Find an upgrade in our list of upgrades with matching name key
Definition at line 2994 of file Player.cpp.
Definition at line 3370 of file Player.cpp.
| void Player::friend_setSkillset | ( | Int | skillSet | ) |
Definition at line 2003 of file Player.cpp.
| void Player::garrisonAllUnits | ( | CommandSourceType | source | ) |
Definition at line 2179 of file Player.cpp.
|
inline |
|
inline |
Get the center of the ai's base.
Do any bridges need repair, and if so repair them.
Definition at line 1571 of file Player.cpp.
getAttackedBy
Definition at line 3907 of file Player.cpp.
|
inline |
|
inline |
| Int Player::getBattlePlansActiveSpecific | ( | BattlePlanStatus | plan | ) | const |
Definition at line 3497 of file Player.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
| Player * Player::getCurrentEnemy | ( | void | ) |
Get the enemy an ai player is currently focused on. NOTE - Can be NULL.
Get this player's current enemy. NOTE - Can be NULL.
Definition at line 1210 of file Player.cpp.
| void Player::getCurrentSelectionAsAIGroup | ( | AIGroup * | group | ) |
Select a hotkey team based on this GameMessage
Definition at line 3741 of file Player.cpp.
|
inline |
|
inline |
|
inline |
Select a hotkey team based on this GameMessage
Definition at line 3765 of file Player.cpp.
| Bool Player::getListInScoreScreen | ( | ) |
return TRUE if this player should be listed in the score screen.
Definition at line 1953 of file Player.cpp.
|
inline |
| UnsignedInt Player::getOrStartSpecialPowerReadyFrame | ( | const SpecialPowerTemplate * | temp | ) |
Definition at line 3337 of file Player.cpp.
| GameDifficulty Player::getPlayerDifficulty | ( | void | ) | const |
Difficulty level for this player.
Difficulty level for this player
Definition at line 1551 of file Player.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| Real Player::getProductionCostChangeBasedOnKindOf | ( | KindOfMaskType | kindOf | ) | const |
Returns production cost change based on typeof (Used for upgrades)
getProductionCostChangeBasedOnKindOf gets the cost percentage change based off of Kindof Mask
Definition at line 3876 of file Player.cpp.
| Real Player::getProductionCostChangePercent | ( | AsciiString | buildTemplateName | ) | const |
Return bonus or penalty for construction of this thing.
Definition at line 1966 of file Player.cpp.
| Real Player::getProductionTimeChangePercent | ( | AsciiString | buildTemplateName | ) | const |
Return bonus or penalty for construction of this thing.
Definition at line 1978 of file Player.cpp.
| VeterancyLevel Player::getProductionVeterancyLevel | ( | AsciiString | buildTemplateName | ) | const |
Return starting veterancy level of a newly built thing of this type
Definition at line 1990 of file Player.cpp.
| Relationship Player::getRelationship | ( | const Team * | that | ) | const |
get the relationship between this->that.
Definition at line 574 of file Player.cpp.
|
inline |
| ScienceAvailabilityType Player::getScienceAvailabilityTypeFromString | ( | const AsciiString & | name | ) |
Definition at line 2829 of file Player.cpp.
|
inline |
|
inline |
return the hotkey squad that a unit is in, or NO_HOTKEY_SQUAD if it isn't in one
Definition at line 3776 of file Player.cpp.
| UnsignedInt Player::getSupplyBoxValue | ( | ) |
Many things can affect the alue of a crate, but at heart it is a GlobalData ratio.
Definition at line 1959 of file Player.cpp.
|
inline |
| Bool Player::grantScience | ( | ScienceType | science | ) |
grant the science, ignore prereqs & charge no points, but still restrict you to purchasable sciences (ie, intrinsic and rank sciences are not allowed) return true if successful.
Definition at line 2624 of file Player.cpp.
Have the team guard a supply center.
Guard supply center
Definition at line 1640 of file Player.cpp.
| Bool Player::hasAnyBuildFacility | ( | void | ) | const |
a convenience routine to quickly check if any buildfacilities are owned.
Definition at line 1919 of file Player.cpp.
| Bool Player::hasAnyBuildings | ( | KindOfMaskType | kindOf | ) | const |
a convenience routine to quickly check if any buildings with a specific KindOfType flag are owned.
Definition at line 1880 of file Player.cpp.
| Bool Player::hasAnyBuildings | ( | void | ) | const |
a convenience routine to quickly check if any buildings are owned.
Definition at line 1867 of file Player.cpp.
| Bool Player::hasAnyObjects | ( | void | ) | const |
a convenience routine to quickly check if any objects are owned.
Definition at line 1906 of file Player.cpp.
| Bool Player::hasAnyShortcutSpecialPower | ( | ) |
Definition at line 1527 of file Player.cpp.
| Bool Player::hasAnyUnits | ( | void | ) | const |
a convenience routine to quickly check if any units are owned.
Definition at line 1893 of file Player.cpp.
| Bool Player::hasPrereqsForScience | ( | ScienceType | t | ) | const |
return t iff the player has all sciences that are prereqs for knowing the given science
Definition at line 2462 of file Player.cpp.
| Bool Player::hasRadar | ( | ) | const |
A positive number of radar producers, plus my radar is not disabled.
Definition at line 3239 of file Player.cpp.
| Bool Player::hasScience | ( | ScienceType | t | ) | const |
return t if the player has the given science, either intrinsically, via specialization, or via capture.
Definition at line 2761 of file Player.cpp.
| Bool Player::hasUpgradeComplete | ( | const UpgradeTemplate * | upgradeTemplate | ) |
does player have totally done and produced upgrade
Does the player have this completed upgrade
Definition at line 3009 of file Player.cpp.
| Bool Player::hasUpgradeComplete | ( | UpgradeMaskType | testMask | ) |
does player have totally done and produced upgrade
Does the player have this completed upgrade. This form is exposed so Objects can do quick lookups.
Definition at line 3020 of file Player.cpp.
| Bool Player::hasUpgradeInProduction | ( | const UpgradeTemplate * | upgradeTemplate | ) |
does player have this upgrade in progress right now
Does the player have this upgrade In Production
Definition at line 3028 of file Player.cpp.
| void Player::healAllObjects | ( | ) |
This player will heal everything owned by it
Definition at line 1788 of file Player.cpp.
| void Player::init | ( | const PlayerTemplate * | pt | ) |
Definition at line 360 of file Player.cpp.
| void Player::initFromDict | ( | const Dict * | d | ) |
Definition at line 808 of file Player.cpp.
| Bool Player::isCapableOfPurchasingScience | ( | ScienceType | science | ) | const |
return true attemptToPurchaseScience() would succeed for this science.
Definition at line 2636 of file Player.cpp.
| Bool Player::isLocalPlayer | ( | ) | const |
Is this player the local player?
Definition at line 1941 of file Player.cpp.
|
inline |
| Bool Player::isPlayableSide | ( | void | ) | const |
Definition at line 3961 of file Player.cpp.
| Bool Player::isPlayerActive | ( | void | ) | const |
Definition at line 3955 of file Player.cpp.
| Bool Player::isPlayerDead | ( | void | ) | const |
Definition at line 3949 of file Player.cpp.
| Bool Player::isPlayerObserver | ( | void | ) | const |
Definition at line 3943 of file Player.cpp.
| Bool Player::isScienceDisabled | ( | ScienceType | t | ) | const |
Can't purchase this science because of script reasons.
Definition at line 2767 of file Player.cpp.
| Bool Player::isScienceHidden | ( | ScienceType | t | ) | const |
This science is effectively hidden due to script reasons.
Definition at line 2773 of file Player.cpp.
| Bool Player::isSkirmishAIPlayer | ( | void | ) |
Is this player a skirmish ai player?
Is this player a skirmish ai player?
Definition at line 1188 of file Player.cpp.
| Bool Player::isSupplySourceAttacked | ( | void | ) |
Is a supply source attacked?
Is a supply source attacked?
Definition at line 1619 of file Player.cpp.
Is the nearest supply source safe?
Is the nearest supply source safe?
Definition at line 1608 of file Player.cpp.
| void Player::iterateObjects | ( | ObjectIterateFunc | func, |
| void * | userData ) const |
Iterate all objects that this player has
Definition at line 1798 of file Player.cpp.
| void Player::killPlayer | ( | void | ) |
Destroy all of the teams for this player, causing him to DIE.
Definition at line 2055 of file Player.cpp.
|
protectedvirtual |
| void Player::newMap | ( | ) |
player after map loaded opportunity
Definition at line 761 of file Player.cpp.
| Bool Player::okToPlayRadarEdgeSound | ( | void | ) |
just like it "sounds"
Definition at line 3150 of file Player.cpp.
| void Player::onPowerBrownOutChange | ( | Bool | brownOut | ) |
one of my command centers just fired a special power, let us reset timers for all command centers.
Definition at line 3264 of file Player.cpp.
| void Player::onStructureConstructionComplete | ( | Object * | builder, |
| Object * | structure, | ||
| Bool | isRebuild ) |
a structure that was under construction has become completed
Definition at line 1668 of file Player.cpp.
a structuer was just created, but is under construction
Definition at line 1660 of file Player.cpp.
| void Player::onStructureUndone | ( | Object * | structure | ) |
a structure that was created has been pre-emptively removed and shouldn't be counted in the score.
Definition at line 1755 of file Player.cpp.
A unit was just created and is ready to control.
A unit was just created and is ready to control
Definition at line 1590 of file Player.cpp.
| void Player::onUpgradeCompleted | ( | const UpgradeTemplate * | upgradeTemplate | ) |
An upgrade just finished, do things like tell all objects to recheck UpgradeModules.
An upgrade just finished, do things like tell all objects to recheck UpgradeModules
Definition at line 3086 of file Player.cpp.
|
inline |
| void Player::preTeamDestroy | ( | const Team * | team | ) |
A team is about to be destroyed.
A team is about to be destroyed
Definition at line 1650 of file Player.cpp.
| void Player::processAddTeamGameMessage | ( | Int | hotkeyNum, |
| GameMessage * | msg ) |
Select a hotkey team based on this GameMessage
Definition at line 3716 of file Player.cpp.
| void Player::processCreateTeamGameMessage | ( | Int | hotkeyNum, |
| GameMessage * | msg ) |
time to create a hotkey team based on this GameMessage
Create a hotkey team based on this GameMessage
Definition at line 3661 of file Player.cpp.
| void Player::processSelectTeamGameMessage | ( | Int | hotkeyNum, |
| GameMessage * | msg ) |
time to select a hotkey team based on this GameMessage
Select a hotkey team based on this GameMessage
Definition at line 3686 of file Player.cpp.
| void Player::recruitSpecificTeam | ( | TeamPrototype * | teamProto, |
| Real | recruitRadius ) |
Recruits an instance of a specific team. Gets passed to aiPlayer.
Definition at line 2408 of file Player.cpp.
| void Player::removeBattlePlanBonusesForObject | ( | Object * | obj | ) | const |
Definition at line 3605 of file Player.cpp.
| void Player::removeKindOfProductionCostChange | ( | KindOfMaskType | kindOf, |
| Real | percent ) |
Decrement the ref counter on the typeof production list node.
addTypeOfProductionCostChange adds a production change to the typeof list
Definition at line 3850 of file Player.cpp.
| void Player::removeObjectFromHotkeySquad | ( | Object * | objToRemove | ) |
Remove an object from any hotkey squads its on. (Should never be more than one, but do them all for good measure.
Definition at line 3791 of file Player.cpp.
Definition at line 617 of file Player.cpp.
| void Player::removeRadar | ( | Bool | disableProof | ) |
One less thing produces radar.
The parameter object has is taking its radar away from the player
Definition at line 3186 of file Player.cpp.
| void Player::removeTeamFromList | ( | TeamPrototype * | team | ) |
Definition at line 1774 of file Player.cpp.
Definition at line 650 of file Player.cpp.
| void Player::removeUpgrade | ( | const UpgradeTemplate * | upgradeTemplate | ) |
remove thsi upgrade from us
Remove upgrade from a player
Definition at line 3118 of file Player.cpp.
|
virtual |
Have the ai check for bridges.
Repair bridge or structure.
Definition at line 1579 of file Player.cpp.
| void Player::resetOrStartSpecialPowerReadyFrame | ( | const SpecialPowerTemplate * | temp | ) |
my new command center wants to init his timers to the status quo
Definition at line 3293 of file Player.cpp.
| void Player::resetRank | ( | ) |
reset rank to 1.
Definition at line 2669 of file Player.cpp.
| void Player::resetSciences | ( | ) |
reset the sciences to just the intrinsic ones from the playertemplate, if any.
Definition at line 2510 of file Player.cpp.
| void Player::sellEverythingUnderTheSun | ( | void | ) |
Sell everything this player owns.
Definition at line 2320 of file Player.cpp.
| void Player::setAttackedBy | ( | Int | playerNdx | ) |
setAttackedBy
Definition at line 3896 of file Player.cpp.
| void Player::setBuildList | ( | BuildListInfo * | pBuildList | ) |
sets the build list.
Definition at line 673 of file Player.cpp.
| void Player::setCurrentlySelectedAIGroup | ( | AIGroup * | group | ) |
Select a hotkey team based on this GameMessage
Definition at line 3750 of file Player.cpp.
| void Player::setDefaultTeam | ( | void | ) |
Definition at line 793 of file Player.cpp.
|
inline |
| void Player::setListInScoreScreen | ( | Bool | listInScoreScreen | ) |
this player should be listed in the score screen.
Definition at line 1947 of file Player.cpp.
|
inline |
| void Player::setObjectsEnabled | ( | AsciiString | templateTypeToAffect, |
| Bool | enable ) |
Enabled/Disable all objects of type templateTypeToAffect.
Definition at line 2106 of file Player.cpp.
| void Player::setPlayerRelationship | ( | const Player * | that, |
| Relationship | r ) |
set the relationship between this->that. (note that this doesn't affect the that->this relationship.)
Definition at line 607 of file Player.cpp.
| void Player::setPlayerType | ( | PlayerType | t, |
| Bool | skirmish ) |
Definition at line 768 of file Player.cpp.
returns TRUE if rank level really changed.
Definition at line 2686 of file Player.cpp.
| void Player::setScienceAvailability | ( | ScienceType | science, |
| ScienceAvailabilityType | type ) |
Definition at line 2779 of file Player.cpp.
| void Player::setTeamDelaySeconds | ( | Int | delay | ) |
Set delay between team production.
Set delay between team production
Definition at line 1630 of file Player.cpp.
| void Player::setTeamRelationship | ( | const Team * | that, |
| Relationship | r ) |
Definition at line 640 of file Player.cpp.
| void Player::setUnitsShouldHunt | ( | Bool | unitsShouldHunt, |
| CommandSourceType | source ) |
Set that all units should begin hunting.
Definition at line 2011 of file Player.cpp.
| void Player::setUnitsShouldIdleOrResume | ( | Bool | idle | ) |
Definition at line 2266 of file Player.cpp.
| void Player::setUnitsVisionSpied | ( | Bool | setting, |
| KindOfMaskType | whichUnits, | ||
| PlayerIndex | byWhom ) |
All of our units are new spied upon; they sight for the given enemy.
Definition at line 3932 of file Player.cpp.
| void Player::transferAssetsFromThat | ( | Player * | that | ) |
Transfer all assets from player that to this.
Definition at line 2132 of file Player.cpp.
| void Player::ungarrisonAllUnits | ( | CommandSourceType | source | ) |
Definition at line 2232 of file Player.cpp.
| void Player::update | ( | ) |
player update opportunity
Definition at line 711 of file Player.cpp.
| void Player::updateTeamStates | ( | void | ) |
a convenience routine to quickly update the state flags on all teams.
Definition at line 1931 of file Player.cpp.
|
protectedvirtual |
Xfer Method Version Info: 1: Initial version 2: Player can now have a modifier on his skill points (multiplicative) 3: Player can be excluded from the score screen via script. 4: Player stores a list of specialpowerreadyframe timers, used by specialpowermodules abroad 5: ??? (Profit) 6: Store m_unitsShouldHunt, set to true after the script "Tell player to hunt" is called. 7: added Preorder flag 8: Save m_disabledSciences & m_hiddenSciences. jba.
Implements Snapshot.
Definition at line 4007 of file Player.cpp.