Members
-
constant getDraftSets
-
Get draft sets to play draft mode
-
constant getHeroesIdsByFaction
-
Get 12 heroes id by faction in random order.
-
constant shuffleHeroes
-
Shuffle Heroes
-
TH_Ability :object
-
Ability of an Hero
Properties:
Name Type Description name
string name of the ability
hook
TH_AbilityHook when ability has an effect
isOptionnal
boolean If true, player will have choice wether to activate ability or not
desc
string Description of the ability effect
-
TH_AbilityHook :'AfterDeploy'|'AfterDiscard'|'AfterRecruit'|'BeforeControl'|'BeforeMaintenance'|'BeforeMilitary'
-
Ability Hook
-
TH_AdvRule :'popularity'|'discard'
-
Possible advanced rules
-
TH_BattleTile :object
-
Battle Tile object
Properties:
Name Type Description id
number unique ID of tile
name
string name of tile
victoryPoints
number Number of victory points
victories/blue
number Number of red player victories
victories/red
number Number of blue player victories
-
TH_Color :'blue'|'red'
-
player colors
-
TH_CommStatus :object
-
Comm status
Properties:
Name Type Description status
TH_ReqStatus Status of the request
text
string Text describing current status
-
TH_DeckMode :'faction'|'draft'|'tournament'
-
Values For Deck Mode.
-
TH_Faction :'orcs'|'humans'|'elves'|'meca'|'none'
-
Faction of a hero
-
TH_GameDataStore :object
-
Game Data Store
Properties:
Name Type Description game
TH_GameGlobalState The game global state in store
bluePlayer
TH_PlayerGameState The game state for blue player
redPlayer
TH_PlayerGameState The game state for red player
-
TH_GameGlobalState :object
-
One game global state
Properties:
Name Type Description gameState
TH_GameStateEnum Current status of the game
allHeroes
Array.<TH_HeroCard> Array containing all heroes
deckMode
TH_DeckMode Deck mode of the game
advRules
Array.<TH_AdvRule> Array describing the active advandced rules, if any
waitingFor/blue
boolean If true, we are waiting for blue to play
waitingFor/red
boolean If true, we are waiting for red to play
currentPlayer
TH_Color | 'both' Who is current player, can be 'both'
battleTiles/left/ofBlue
Array.<TH_BattleTile> Battle tiles on left side of blue player
battleTiles/center/ofBlue
Array.<TH_BattleTile> Battle tiles on center of blue player
battleTiles/right/ofBlue
Array.<TH_BattleTile> Battle tiles on right side of blue player
totalFood
number Total food available for players to take
allHeroesJson
string All heroes in JSON format (read from a JSON file)
-
TH_GameStateEnum :'0_INIT'|'1_SELECT_DRAFT'|'1_SELECT_FACTION'|'1_SELECT_TOURNAMENT'|'2_CHANGE_UP_TO_3_CARDS'
-
Values for Game state.
-
TH_HeroAction :'recruit'|'deploy'|'move'|'ability'|'dismiss'|'discard'|'replace'
-
Possible action for a hero
-
TH_HeroCard :object
-
Hero card
Properties:
Name Type Description id
number unique ID of hero
name
string name of hero
cost
number cost of hero
power
number power of hero
faction
TH_Faction faction of hero
popularity
TH_Popularity popularity attribute of hero
isDraftable
boolean Is hero available in Draft mode
ability
TH_Ability Ability of a hero
-
TH_HeroInGame :object
-
Hero in game
Properties:
Name Type Description id
number unique ID of hero
position
TH_HeroPosition position of hero in game
possibleActions
Array.<TH_HeroAction> Actions possible on hero
-
TH_HeroPosition :'pile'|'hand'|'discard'|'camp'|'battle_left'|'battle_center'|'battle_right'
-
Possible position for a hero
-
TH_MessageChatFrom :object
-
Message for chat from one player to others
Properties:
Name Type Description from
string From is the message from
text
string The content of chat message
-
TH_MessageDraftStep :object
-
Message from player for draft mode steps. Each turn of draft mode, players choses 2 new Ids which will be added to his twelveHeroes.
Properties:
Name Type Description color
TH_Color color of player
chosenIds
Array.<number> The chosen Ids
-
TH_MessageFaction :object
-
Message from player with faction selected
Properties:
Name Type Description color
TH_Color color of player
faction
TH_Faction The chosen faction
-
TH_MessageTournamentDeckStep :object
-
Message from player for tournament mode. Player chose 12 heroes.
Properties:
Name Type Description color
TH_Color color of player
twelveHeroesIds
Array.<number> The chosen 12 heroes IDs
-
TH_PlayerAction :'supply'|'pass'
-
Possible action for a player
-
TH_PlayerGameState :object
-
Game state for one player
Properties:
Name Type Description name
string username of this player
color
TH_Color color of the player
faction
TH_Faction | '' Chosen faction (empty if not playing faction mode)
draftHeroesIds
Array.<number> Will contain the IDs of the heroes selectable for draft mode
twelveHeroes
Array.<TH_HeroInGame> The 12 Heroes used by player
foodInCamp
number Number of food in camp
foodInBattle/left
number Food on left battle field
foodInBattle/center
number Food on center battle field
foodInBattle/right
number Food on right battle field
actionsPerformed
Array.<object> During military phase it will contain actions made by player to be replayed by other
Array.<TH_PlayerAction> Actions avalaible for the player
-
TH_Popularity :'with'|'without'|'any'
-
popularity attribute of a hero
-
TH_ReqStatus :'idle'|'requested'|'success'|'error'
-
Statuses of a server Request