- Joined
- Jun 12, 2010
- Messages
- 413
Well, I had said the last one would be the last system I posted for a while, but since this concept was in System Reinventing and IcemanBo told me I should post it, here it is.
Combat States:
A unit can either be in combat or outside of combat. Each unit has its own Combat Group, which contains all units that are currently engaged in combat with it.
There are 2 provided ways for a unit to enter combat:
- Engaging with an enemy. When two units engage, both of them are added to each other's Combat Group and are flagged for combat.
- Supporting an ally. When an ally supports another ally (you can decide what "support" means), the supporter is engaged with all units that are in combat with the supported unit.
////////////////////////////////////////////////////////
//Guhun's Combat State Manager v1.0.0
////////////////////////////////////////////////////////
CODE TO COPY TO MAP HEADER (I recommend including the tags above and below)
////////////////////////////////////////////////////////
//End of Combat State Manager
////////////////////////////////////////////////////////
//This function engages both specified units in combat, adding each to the other's combat group
function GCSM_UnitEnterCombat takes unit target, unit source returns nothing
//This function engages the supporter unit in combat with all units that are in combat with the target unit
function GCSM_UnitAidCombat takes unit target, unit supporter returns boolean
//This function removes a unit from combat, removing it from the combat groups of units in combat with it
//and cleaing its own combat group.
function GCSM_UnitLeaveCombat takes unit target returns nothing
//This function removes the speacified units form eachother's combat groups
function GCSM_UnitLeaveCombatWith takes unit target, unit source returns nothing
//Returns whether a unit is in combat
//You should use the variable udg_GCSM_UnitInCombat[GetUnitUserData(yourUnit)] instead
function GCSM_UnitInCombat takes unit target returns boolean
//Returns whether the target unit is in the source unit's combat group
function GCSM_UnitInCombatWith takes unit target, unit source returns boolean
Command | Action |
kill | kills your selected units |
combat | shows which units are in combat with your selected units |
|