#include "unitptr.h"
#include "vec2i.h"
Go to the source code of this file.
|
| enum | UnitAction {
UnitActionNone,
UnitActionStill,
UnitActionStandGround,
UnitActionFollow,
UnitActionDefend,
UnitActionMove,
UnitActionAttack,
UnitActionAttackGround,
UnitActionDie,
UnitActionSpellCast,
UnitActionTrain,
UnitActionUpgradeTo,
UnitActionResearch,
UnitActionBuilt,
UnitActionBoard,
UnitActionUnload,
UnitActionPatrol,
UnitActionBuild,
UnitActionRepair,
UnitActionResource,
UnitActionTransformInto
} |
| |
| typedef COrder * | COrderPtr |
| |
| unsigned | SyncHash |
| |
| int | GetNumWaitingWorkers (const CUnit &mine) |
| | Hash calculated to find sync failures. More...
|
| |
| bool | AutoAttack (CUnit &unit) |
| |
| bool | AutoRepair (CUnit &unit) |
| |
| bool | AutoCast (CUnit &unit) |
| |
| void | UnHideUnit (CUnit &unit) |
| |
| int | DoActionMove (CUnit &unit) |
| | Generic move action. More...
|
| |
| void | AnimateActionAttack (CUnit &unit, COrder &order) |
| | Show attack animation. More...
|
| |
| void | CclParseOrder (lua_State *l, CUnit &unit, COrderPtr *order) |
| | Parse order. More...
|
| |
| void | UnitActions () |
| | Handle the actions of all units each game cycle. More...
|
| |
All possible unit actions.
- Note
- Always change the table ::HandleActionTable
- See also
- HandleActionTable
| Enumerator |
|---|
| UnitActionNone |
|
| UnitActionStill |
No valid action.
|
| UnitActionStandGround |
unit stand still, does nothing
|
| UnitActionFollow |
unit stands ground
|
| UnitActionDefend |
unit follows units
|
| UnitActionMove |
unit defends unit
|
| UnitActionAttack |
unit moves to position/unit
|
| UnitActionAttackGround |
unit attacks position/unit
|
| UnitActionDie |
unit attacks ground
|
| UnitActionSpellCast |
unit dies
|
| UnitActionTrain |
unit casts spell
|
| UnitActionUpgradeTo |
building is training
|
| UnitActionResearch |
building is upgrading itself
|
| UnitActionBuilt |
building is researching spell
|
| UnitActionBoard |
building is under construction
|
| UnitActionUnload |
unit entering transporter
|
| UnitActionPatrol |
unit leaving transporter
|
| UnitActionBuild |
unit paroling area
|
| UnitActionRepair |
unit builds building
|
| UnitActionResource |
unit repairing
|
| UnitActionTransformInto |
unit harvesting resources
unit transform into type.
|
| void AnimateActionAttack |
( |
CUnit & |
unit, |
|
|
COrder & |
order |
|
) |
| |
Show attack animation.
Animate unit attack!
- Parameters
-
| unit | Unit, for that the attack animation is played. |
- Todo:
- manage correctly unit with no animation attack.
| bool AutoAttack |
( |
CUnit & |
unit | ) |
|
Auto attack nearby units if possible
| bool AutoCast |
( |
CUnit & |
unit | ) |
|
Auto cast a spell if possible
- Returns
- true if a spell was auto cast, false otherwise
| bool AutoRepair |
( |
CUnit & |
unit | ) |
|
Auto repair a unit if possible
- Returns
- true if the unit is repairing, false otherwise
| void CclParseOrder |
( |
lua_State * |
l, |
|
|
CUnit & |
unit, |
|
|
COrderPtr * |
orderPtr |
|
) |
| |
Parse order.
Parse order
- Parameters
-
| l | Lua state. |
| order | OUT: resulting order. |
| int DoActionMove |
( |
CUnit & |
unit | ) |
|
Generic move action.
Unit moves! Generic function called from other actions.
- Parameters
-
- Returns
- >0 remaining path length, 0 wait for path, -1 reached goal, -2 can't reach the goal.
| int GetNumWaitingWorkers |
( |
const CUnit & |
mine | ) |
|
Hash calculated to find sync failures.
| void UnHideUnit |
( |
CUnit & |
unit | ) |
|
Handle the actions of all units each game cycle.
Update the actions of all units each game cycle/second.
(C) Copyright 1998-2012 by The