Mod API Reference:GameOrderReceiveCard: Difference between revisions

From Warzone Wiki
Jump to navigation Jump to search
No edit summary
DanWL60 (talk | contribs)
mNo edit summary
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''GameOrderReceiveCard''':  Subclass of [[Mod API Reference:GameOrder|GameOrder]]
'''GameOrderReceiveCard''':  Subclass of [[Mod API Reference:GameOrder|GameOrder]].  This is used to award players cards.  It should never be sent up to the server as part of a client's normal orders, instead it's only inserted into turns by the server.  This happens normally as part of Warzone's normal card-receiving mechanic, or mods can add another one themselves in an AdvanceTurn hook.
* '''CardIDs''' ''Table<[[Mod API Reference:CardID|CardID]],integer>'':  
* '''CardIDs''' ''Table<[[Mod API Reference:CardID|CardID]],integer>'':  
* '''InstancesCreated''' ''Array<[[Mod API Reference:CardInstance|CardInstance]]>'':
* '''InstancesCreated''' ''Array<[[Mod API Reference:CardInstance|CardInstance]]>'':
Line 5: Line 5:
== Functions ==
== Functions ==


* '''WL.GameOrderReceiveCard.Create'''('''cardID''' ''Array<[[Mod API Reference:T|T]]>'', '''playerID''' ''[[Mod API Reference:PlayerID|PlayerID]]'', '''instancesCreated''' ''Array<[[Mod API Reference:T|T]]>'') (static) returns [[Mod API Reference:GameOrderReceiveCard|GameOrderReceiveCard]]:
* '''WL.GameOrderReceiveCard.Create'''('''playerID''' ''[[Mod API Reference:PlayerID|PlayerID]]'', '''instances''' ''Array<[[Mod API Reference:CardInstance|CardInstance]]>'') (static) returns [[Mod API Reference:GameOrderReceiveCard|GameOrderReceiveCard]]:  Creates an instance of the GameOrderReceiveCard class.  Note that mods can only award cards to players if those cards are enabled for the game.
** '''playerID''': Pass the ID of the player who will receive cards.
** '''instances''': Pass an array of whole cards to award to the player.  See [[Mod API Reference:CardInstance|CardInstance]] for instructions on how to create these.
[[Category:Mod API Reference]]

Latest revision as of 17:21, 4 December 2018

GameOrderReceiveCard: Subclass of GameOrder. This is used to award players cards. It should never be sent up to the server as part of a client's normal orders, instead it's only inserted into turns by the server. This happens normally as part of Warzone's normal card-receiving mechanic, or mods can add another one themselves in an AdvanceTurn hook.

Functions

  • WL.GameOrderReceiveCard.Create(playerID PlayerID, instances Array<CardInstance>) (static) returns GameOrderReceiveCard: Creates an instance of the GameOrderReceiveCard class. Note that mods can only award cards to players if those cards are enabled for the game.
    • playerID: Pass the ID of the player who will receive cards.
    • instances: Pass an array of whole cards to award to the player. See CardInstance for instructions on how to create these.