Difference between revisions of "Hook Functions"
From theFarWilds
(→Implemented) |
(→Implemented) |
||
Line 7: | Line 7: | ||
[[Config Functions]] | [[Config Functions]] | ||
− | bool isDeckValid(Player player); | + | bool '''isDeckValid'''(Player player); |
// if you want to implement non-standard deck requirements | // if you want to implement non-standard deck requirements | ||
// use statusMsg to tell them why their deck is invalid | // use statusMsg to tell them why their deck is invalid |
Revision as of 18:04, 7 April 2010
The scripts you write interact with the game via a collection of hook functions. These functions are called by the game at the appropriate times and execute your code.
Implemented
void configGame(); // Sets up the game state such as # of players, Map Size, if they need to set a deck or not, etc Config Functions bool isDeckValid(Player player); // if you want to implement non-standard deck requirements // use statusMsg to tell them why their deck is invalid void beforeStart(); // Do things here before any action. Place creatures and buildings, change their decks etc. void afterStart(); // Send any welcome messages here void onNewRound(); // called after all the new round events void onPlayersTurn(Player player); bool entityCallback(Entity entity) // called for each entity in the game if you call forEachEntity(); void onDialogResponse(Player player,int resp);
Not implemented yet
void afterAction(); bool canPass(Player player); // called when the real players try to pass. // This is so you can ensure they do a particular action before passing.