#include "luacallback.h"
#include "unitsound.h"
#include "vec2i.h"
Go to the source code of this file.
|
enum | TargetType { TargetSelf,
TargetPosition,
TargetUnit
} |
|
std::vector< SpellType * > | SpellTypeTable |
|
void | SpellCclRegister () |
| register fonction. More...
|
|
void | InitSpells () |
| init spell tables More...
|
|
void | CleanSpells () |
| done spell tables More...
|
|
bool | SpellIsAvailable (const CPlayer &player, int SpellId) |
| return 1 if spell is available, 0 if not (must upgrade) More...
|
|
bool | CanCastSpell (const CUnit &caster, const SpellType &spell, const CUnit *target, const Vec2i &goalPos) |
| returns true if spell can be casted (enough mana, valid target) More...
|
|
int | SpellCast (CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &goalPos) |
| cast spell on target unit or place at x,y More...
|
|
int | AutoCastSpell (CUnit &caster, const SpellType &spell) |
| auto cast the spell if possible More...
|
|
SpellType * | SpellTypeByIdent (const std::string &ident) |
| return spell type by ident string More...
|
|
char | Ccl2Condition (lua_State *l, const char *value) |
| return 0, 1, 2 for true, only, false. More...
|
|
◆ ACP_DISTANCE
◆ ACP_NOVALUE
◆ CONDITION_FALSE
#define CONDITION_FALSE 1 |
◆ CONDITION_ONLY
◆ CONDITION_TRUE
◆ INFINITE_RANGE
#define INFINITE_RANGE 0xFFFFFFF |
◆ TargetType
Different targets.
Enumerator |
---|
TargetSelf | |
TargetPosition | |
TargetUnit | |
◆ AutoCastSpell()
auto cast the spell if possible
Check if the spell can be auto cast and cast it.
- Parameters
-
caster | Unit who can cast the spell. |
spell | Spell-type pointer. |
- Returns
- 1 if spell is casted, 0 if not.
◆ CanCastSpell()
returns true if spell can be casted (enough mana, valid target)
Check if unit can cast the spell.
- Parameters
-
caster | Unit that casts the spell |
spell | Spell-type pointer |
target | Target unit that spell is addressed to |
goalPos | coord of target spot when/if target does not exist |
- Returns
- =!0 if spell should/can casted, 0 if not
- Note
- caster must know the spell, and spell must be researched.
◆ Ccl2Condition()
char Ccl2Condition |
( |
lua_State * |
l, |
|
|
const char * |
value |
|
) |
| |
return 0, 1, 2 for true, only, false.
Get a condition value from a scm object.
- Parameters
-
l | Lua state. |
value | scm value to convert. |
- Returns
- CONDITION_TRUE, CONDITION_FALSE, CONDITION_ONLY or -1 on error.
- Note
- This is a helper function to make CclSpellCondition shorter and easier to understand.
◆ CleanSpells()
done spell tables
Cleanup the spell subsystem.
◆ InitSpells()
init spell tables
Spells constructor, inits spell id's and sounds
◆ SpellCast()
cast spell on target unit or place at x,y
Spell cast!
- Parameters
-
caster | Unit that casts the spell |
spell | Spell-type pointer |
target | Target unit that spell is addressed to |
goalPos | coord of target spot when/if target does not exist |
- Returns
- !=0 if spell should/can continue or 0 to stop
◆ SpellCclRegister()
void SpellCclRegister |
( |
| ) |
|
register fonction.
Register CCL features for Spell.
◆ SpellIsAvailable()
bool SpellIsAvailable |
( |
const CPlayer & |
player, |
|
|
int |
spellid |
|
) |
| |
return 1 if spell is available, 0 if not (must upgrade)
Check if spell is research for player player
.
- Parameters
-
player | player for who we want to know if he knows the spell. |
spellid | id of the spell to check. |
- Returns
- 0 if spell is not available, else no null.
◆ SpellTypeByIdent()
SpellType* SpellTypeByIdent |
( |
const std::string & |
ident | ) |
|
return spell type by ident string
Get spell-type struct pointer by string identifier.
- Parameters
-
- Returns
- spell-type struct pointer.
◆ SpellTypeTable
Define the names and effects of all available spells.
Define the names and effects of all im play available spells.
(C) Copyright 1998-2012 by The