#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,
UnitActionExplore,
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...
|
|
◆ COrderPtr
◆ UnitAction
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
|
UnitActionExplore | unit builds building
|
UnitActionRepair | unit explores map
|
UnitActionResource | unit repairing
|
UnitActionTransformInto | unit harvesting resources
unit transform into type.
|
◆ AnimateActionAttack()
Show attack animation.
Animate unit attack!
- Parameters
-
unit | Unit, for that the attack animation is played. |
- Todo:
- manage correctly unit with no animation attack.
◆ AutoAttack()
bool AutoAttack |
( |
CUnit & |
unit | ) |
|
Auto attack nearby units if possible
◆ AutoCast()
bool AutoCast |
( |
CUnit & |
unit | ) |
|
Auto cast a spell if possible
- Returns
- true if a spell was auto cast, false otherwise
◆ AutoRepair()
bool AutoRepair |
( |
CUnit & |
unit | ) |
|
Auto repair a unit if possible
- Returns
- true if the unit is repairing, false otherwise
◆ CclParseOrder()
Parse order.
Parse order
- Parameters
-
l | Lua state. |
order | OUT: resulting order. |
◆ DoActionMove()
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.
◆ GetNumWaitingWorkers()
int GetNumWaitingWorkers |
( |
const CUnit & |
mine | ) |
|
Hash calculated to find sync failures.
◆ UnHideUnit()
◆ UnitActions()
Handle the actions of all units each game cycle.
Update the actions of all units each game cycle/second.
◆ SyncHash
(C) Copyright 1998-2012 by The