Mod API Reference:GamePlayer

From Warzone Wiki
(Difference between revisions)
Jump to: navigation, search
Line 38: Line 38:
 
== Functions ==
 
== Functions ==
  
* '''DisplayName'''('''standingOpt''' ''[[Mod API Reference:GameStanding|GameStanding]]'', '''includeAIWas''' ''boolean'') returns string:
+
* '''DisplayName'''('''standingOpt''' ''[[Mod API Reference:GameStanding|GameStanding]]'', '''includeAIWas''' ''boolean'') returns string: Gets the name of a player.  Typically you will just pass nil and false to the two arguments.
 +
 
 +
* '''Income'''('''armiesFromReinforcementCards''' ''integer'', '''standing''' ''[[Mod API Reference:GameStanding|GameStanding]]'', '''bypassArmyCap''' ''boolean'', '''ignoreSanctionCards''' ''boolean'') returns [[Mod API Reference:PlayerIncome|PlayerIncome]]:  Determine's a player's income (number of armies they receive per turn.)
 +
** armiesFromReinforcementCards: Pass in how many armies this player is receiving from playing reinforcement cards.  Simply pass 0 if they're not playing any or you want to assume they won't play any in this calculation.
 +
** standing: To get a player's current income, simply pass the latest standing.  Otherwise, if you're looking at history, you can pass a standing to get their income at that point in time.
 +
** bypassArmyCap: If this game has the army cap enabled, pass true here to bypass it and get what their income would be if the army cap didn't exist.
 +
** ignoreSanctionCards: If this game has sanction cards, and the player is being affected by them, pass true here to bypass them and get what their income would be if they weren't affected by sanction cards.

Revision as of 17:32, 2 June 2017

GamePlayer: All details about a player in a game.


Functions

  • DisplayName(standingOpt GameStanding, includeAIWas boolean) returns string: Gets the name of a player. Typically you will just pass nil and false to the two arguments.
  • Income(armiesFromReinforcementCards integer, standing GameStanding, bypassArmyCap boolean, ignoreSanctionCards boolean) returns PlayerIncome: Determine's a player's income (number of armies they receive per turn.)
    • armiesFromReinforcementCards: Pass in how many armies this player is receiving from playing reinforcement cards. Simply pass 0 if they're not playing any or you want to assume they won't play any in this calculation.
    • standing: To get a player's current income, simply pass the latest standing. Otherwise, if you're looking at history, you can pass a standing to get their income at that point in time.
    • bypassArmyCap: If this game has the army cap enabled, pass true here to bypass it and get what their income would be if the army cap didn't exist.
    • ignoreSanctionCards: If this game has sanction cards, and the player is being affected by them, pass true here to bypass them and get what their income would be if they weren't affected by sanction cards.
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox