CO Function: Difference between revisions
(A list of functions you can use to create your CO) |
(Add bio functions) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
This page will look at all the functions that are in the base game related to CO. You can use these functions to create the CO that you want to do. | This page will look at all the functions that are in the base game related to CO. You can use these functions to create the CO that you want to do. | ||
First, we will look at common terminology that you will see most of the CO's have. | First, we will look at common terminology that you will see most of the CO's have. These are the function parameters which will be needed for all functions. | ||
* "co": Refers to the current CO in play. | |||
* "map": Refers to the current map in play (including game rules, players). | |||
* "unit": Refers to the current unit of interest. | |||
* "x": Refers to the position of the current tile along the X axis (left to right). | |||
* "y": Refers to the position of the current tile along the Y axis (top to bottom). | |||
* "posX": Refers to the position of the current tile along the X axis (left to right). | |||
* "posY": Refers to the position of the current tile along the Y axis (top to bottom). | |||
* "atkPosX": Refers to the position of the attacker along the X axis (left to right). | |||
* "atkPosY": Refers to the position of the attacker along the Y axis (top to bottom). | |||
* "defPosX": Refers to the position of the defender along the X axis (left to right). | |||
* "defPosY": Refers to the position of the defender along the Y axis (top to bottom). | |||
* "isDefender": Refers to what the current unit is doing in battle, attacking or defending, returns true or false. | |||
* "attacker": Refers to the unit that is currently attacking. | |||
* "defender": Refers to the unit that is currently defending. | |||
* "damage": Refers to the incoming damage to the unit, includes chip damage numbers (0-100+). | |||
* "attackerBaseHp": Referes to the attackers hp. | |||
* "luckmode": Beats me. | |||
* "action": Refers to the current action that is being performed, returns as a game action class. | |||
* "id": Refers to unit ID. | |||
* "fuelCost": Refers to the amount of fuel used to move. | |||
* "building": Refers to the building of interest. | |||
* "income": Refers to the income you get for a particular building. | |||
* "index": could't have a clue. | |||
* "info": Refers to the CO info page. | |||
* "unitID": Refers to the unit ID that is currently being looked at. | |||
* "powerSurplus": Refers to surplus on the co power e.g 1 if one more star is filled over the normal co power. | |||
* "turnMode": Refers to start, during or end turn for AI. | |||
* "unitCount": Refers to the amount of units owned by the player. | |||
* "count": there is a unitcount in the same parameter. | |||
* "repairUnits": Refers to the amount of units that need to be repaired. | |||
* "indirectUnits": Refers to the amount of indirect units. | |||
* "directUnits": Refers to the amount of direct units. | |||
* "enemyUnits": Refers to the amount of enemy units. | |||
Listed below is a list of functions that will appear in the CO select page, which will give information about your custom CO.<syntaxhighlight lang="js"> | |||
// CO - Intel | |||
this.getBio = function(co, map) | |||
{ | |||
return ""; | |||
}; | |||
this.getLongBio = function(co, map) | |||
{ | |||
return ""; | |||
}; | |||
this.getHits = function(co, map) | |||
{ | |||
return ""; | |||
}; | |||
this.getMiss = function(co, map) | |||
{ | |||
return ""; | |||
}; | |||
this.getCODescription = function(co, map) | |||
{ | |||
return ""; | |||
}; | |||
this.getLongCODescription = function(co, map) | |||
{ | |||
return ""; | |||
}; | |||
this.getPowerDescription = function(co, map) | |||
{ | |||
return ""; | |||
}; | |||
this.getPowerName = function(co, map) | |||
{ | |||
return ""; | |||
}; | |||
this.getSuperPowerDescription = function(co, map) | |||
{ | |||
return ""; | |||
}; | |||
this.getSuperPowerName = function(co, map) | |||
{ | |||
return ""; | |||
}; | |||
this.getPowerSentences = function(co, map) | |||
{ | |||
return []; | |||
}; | |||
this.getVictorySentences = function(co, map) | |||
{ | |||
return []; | |||
}; | |||
this.getDefeatSentences = function(co, map) | |||
{ | |||
return []; | |||
}; | |||
this.getName = function(co, map) | |||
{ | |||
return ""; | |||
}; | |||
</syntaxhighlight> |
Latest revision as of 12:09, 27 November 2023
This page will look at all the functions that are in the base game related to CO. You can use these functions to create the CO that you want to do.
First, we will look at common terminology that you will see most of the CO's have. These are the function parameters which will be needed for all functions.
- "co": Refers to the current CO in play.
- "map": Refers to the current map in play (including game rules, players).
- "unit": Refers to the current unit of interest.
- "x": Refers to the position of the current tile along the X axis (left to right).
- "y": Refers to the position of the current tile along the Y axis (top to bottom).
- "posX": Refers to the position of the current tile along the X axis (left to right).
- "posY": Refers to the position of the current tile along the Y axis (top to bottom).
- "atkPosX": Refers to the position of the attacker along the X axis (left to right).
- "atkPosY": Refers to the position of the attacker along the Y axis (top to bottom).
- "defPosX": Refers to the position of the defender along the X axis (left to right).
- "defPosY": Refers to the position of the defender along the Y axis (top to bottom).
- "isDefender": Refers to what the current unit is doing in battle, attacking or defending, returns true or false.
- "attacker": Refers to the unit that is currently attacking.
- "defender": Refers to the unit that is currently defending.
- "damage": Refers to the incoming damage to the unit, includes chip damage numbers (0-100+).
- "attackerBaseHp": Referes to the attackers hp.
- "luckmode": Beats me.
- "action": Refers to the current action that is being performed, returns as a game action class.
- "id": Refers to unit ID.
- "fuelCost": Refers to the amount of fuel used to move.
- "building": Refers to the building of interest.
- "income": Refers to the income you get for a particular building.
- "index": could't have a clue.
- "info": Refers to the CO info page.
- "unitID": Refers to the unit ID that is currently being looked at.
- "powerSurplus": Refers to surplus on the co power e.g 1 if one more star is filled over the normal co power.
- "turnMode": Refers to start, during or end turn for AI.
- "unitCount": Refers to the amount of units owned by the player.
- "count": there is a unitcount in the same parameter.
- "repairUnits": Refers to the amount of units that need to be repaired.
- "indirectUnits": Refers to the amount of indirect units.
- "directUnits": Refers to the amount of direct units.
- "enemyUnits": Refers to the amount of enemy units.
Listed below is a list of functions that will appear in the CO select page, which will give information about your custom CO.
// CO - Intel
this.getBio = function(co, map)
{
return "";
};
this.getLongBio = function(co, map)
{
return "";
};
this.getHits = function(co, map)
{
return "";
};
this.getMiss = function(co, map)
{
return "";
};
this.getCODescription = function(co, map)
{
return "";
};
this.getLongCODescription = function(co, map)
{
return "";
};
this.getPowerDescription = function(co, map)
{
return "";
};
this.getPowerName = function(co, map)
{
return "";
};
this.getSuperPowerDescription = function(co, map)
{
return "";
};
this.getSuperPowerName = function(co, map)
{
return "";
};
this.getPowerSentences = function(co, map)
{
return [];
};
this.getVictorySentences = function(co, map)
{
return [];
};
this.getDefeatSentences = function(co, map)
{
return [];
};
this.getName = function(co, map)
{
return "";
};