Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
88 lines (67 sloc) 2.98 KB
// This file is (C) Carlos Sanchez 2014, released under the MIT license
// This function is called first by the start() function that runs when the game starts for the first time
var h_init = function()
{
}
// This function is called last by the start() function that runs when the game starts for the first time
var h_post = function()
{
}
// This function is called when the engine tries to write any text
var h_writeText = function (text)
{
return text;
}
//This function is called every time the user types any order
var h_playerOrder = function(player_order)
{
return player_order;
}
// This function is called every time a location is described, just after the location text is written
var h_description_init = function ()
{
}
// This function is called every time a location is described, just after the process 1 is executed
var h_description_post = function()
{
}
// this function is called when the savegame object has been created, in order to be able to add more custom properties
var h_saveGame = function(savegame_object)
{
return savegame_object;
}
// this function is called after the restore game function has restored the standard information in savegame, in order to restore any additional data included in a patched (by h_saveGame) savegame.
var h_restoreGame = function(savegame_object)
{
}
// this funcion is called before writing a message about player order beeing impossible to understand
var h_invalidOrder = function(player_order)
{
}
// this function is called when a sequence tag is found giving a chance for any hook library to provide a response
// tagparams receives the params inside the tag as an array {XXXX|nn|mm|yy} => ['XXXX', 'nn', 'mm', 'yy']
var h_sequencetag = function (tagparams)
{
return '';
}
// this function is called from certain points in the response or process tables via the HOOK condact. Depending on the string received it can do something or not.
// it's designed to allow direct javascript code to take control in the start database just installing a plugin library (avoiding the wirter need to enter code to activate the library)
var h_code = function(str)
{
return false;
}
// this function is called from the keydown evente handler used by block and other functions to emulate a pause or waiting for a keypress. It is designed to allow plugin condacts or
// libraries to attend those key presses and react accordingly. In case a hook function decides that the standard keydown functions should not be processed, the hook function should return false.
// Also, any h_keydown replacement should probably do the same.
var h_keydown = function (event)
{
return true;
}
// this function is called every time a process is called, either by the internall loop of by the PROCESS condact, just before running it.
var h_preProcess = function(procno)
{
}
// this function is called every time a process is called just after the process exits (no matter which DONE status it has), either by the internall loop of by the PROCESS condact
var h_postProcess= function (procno)
{
}