71 virtual void Parse(lua_State *l,
int startIndex,
int endIndex) = 0;
150 #define CONDITION_FALSE 1
151 #define CONDITION_TRUE 0
152 #define CONDITION_ONLY 2
174 #define ACP_NOVALUE -1
175 #define ACP_DISTANCE -2
208 SpellType(
int slot,
const std::string &ident);
221 #define INFINITE_RANGE 0xFFFFFFF
290 #endif // !__SPELLS_H__
int Range
Definition: spells.h:182
ConditionInfo()
Definition: spells.h:139
int Corpse
If it should be casted on unit which attacks.
Definition: spells.h:196
virtual void Parse(lua_State *l, int startIndex, int endIndex)=0
~SpellType()
Definition: spells.cpp:584
SpellType(int slot, const std::string &ident)
Definition: spells.cpp:572
TargetType
Definition: spells.h:80
resource 6
Definition: upgrade_structs.h:70
int RepeatCast
Required mana for each cast.
Definition: spells.h:223
~ConditionInfo()
Definition: spells.h:141
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)
Definition: spells.cpp:455
std::string Name
Spell unique identifier (spell-holy-vision)
Definition: spells.h:213
int Attacker
If it should be casted in combat.
Definition: spells.h:195
int ManaCost
Definition: spells.h:222
int AutoCastSpell(CUnit &caster, const SpellType &spell)
auto cast the spell if possible
Definition: spells.cpp:472
bool ReverseSort
Variable to sort autocast targets by priority.
Definition: spells.h:188
ConditionInfoVariable * Variable
User defined boolean flag.
Definition: spells.h:159
The big unit structure.
Definition: unit.h:119
AutoCastInfo * AICast
AutoCast information for your own units.
Definition: spells.h:232
ConditionInfoVariable()
Definition: spells.h:112
int ExactValue
True if need to check that variable.
Definition: spells.h:119
bool IsCasterOnly() const
Sound played if cast.
Definition: spells.h:237
bool ForceUseAnimation
Definition: spells.h:241
int Combat
Conditions to cast the spell.
Definition: spells.h:194
int MinValuePercent
Target must have more Max than that.
Definition: spells.h:124
Definition: unitsound.h:54
int PriorytyVar
Min range of the target.
Definition: spells.h:187
LuaCallback * CheckFunc
Definition: spells.h:160
char Enable
Definition: spells.h:114
int MinRange
Max range of the target.
Definition: spells.h:185
Definition: unittype.h:467
TargetType Target
Spell numeric identifier.
Definition: spells.h:217
AutoCastInfo * AutoCast
Conditions to cast the spell. (generic (no test for each target))
Definition: spells.h:231
virtual int Cast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &goalPos)=0
#define ACP_NOVALUE
Definition: spells.h:174
bool Check
Target is 'user defined variable'.
Definition: spells.h:117
TargetType Type
Definition: spells.h:98
char TargetSelf
Target is opponent. (neutral is neither allied, nor opponent)
Definition: spells.h:155
~AutoCastInfo()
Definition: spells.h:178
int CoolDown
Resource costs of spell.
Definition: spells.h:225
SpellActionType(int mod=0)
Definition: spells.h:66
void CleanSpells()
done spell tables
Definition: spells.cpp:603
int Costs[MaxCosts]
If the spell will be cast again until out of targets.
Definition: spells.h:224
char Alliance
Definition: spells.h:153
SoundConfig SoundWhenCast
AutoCast information for ai. More detalied.
Definition: spells.h:235
int MinMax
Target must have less Value than that.
Definition: spells.h:123
Diplomacy states for CommandDiplomacy.
Definition: player.h:79
std::string Ident
Definition: spells.h:212
Target(TargetType type, CUnit *unit, const Vec2i &pos)
Definition: spells.h:95
int ExceptValue
Target must have exactly ExactValue of it's value.
Definition: spells.h:120
Base structure of missile-types.
Definition: missile.h:343
AutoCastInfo()
Definition: spells.h:176
char Opponent
Target is allied. (neutral is neither allied, nor opponent)
Definition: spells.h:154
SpellType * SpellTypeByIdent(const std::string &ident)
return spell type by ident string
Definition: spells.cpp:416
int MinValue
Target mustn't have ExceptValue of it's value.
Definition: spells.h:121
Definition: luacallback.h:38
int Range
More arguments for spell (damage, delay, additional sounds...).
Definition: spells.h:220
LuaCallback * PositionAutoCast
If it should be casted on corpses.
Definition: spells.h:199
void SpellCclRegister()
register fonction.
Definition: script_spell.cpp:425
ConditionInfo * Condition
Id of upgrade, -1 if no upgrade needed for cast the spell.
Definition: spells.h:228
int SpellCast(CUnit &caster, const SpellType &spell, CUnit *target, const Vec2i &goalPos)
cast spell on target unit or place at x,y
Definition: spells.cpp:509
int DependencyId
How much time spell needs to be cast again.
Definition: spells.h:227
char ConditionApplyOnCaster
Target must have less (100 * Value / Max) than that.
Definition: spells.h:127
virtual ~SpellActionType()
Definition: spells.h:67
int MaxValue
Target must have more Value than that.
Definition: spells.h:122
int MaxValuePercent
Target must have more (100 * Value / Max) than that.
Definition: spells.h:125
char * BoolFlag
Target is the same as the caster.
Definition: spells.h:157
std::vector< SpellType * > SpellTypeTable
Definition: spells.cpp:64
CUnit * Unit
type of target.
Definition: spells.h:99
#define CONDITION_FALSE
Definition: spells.h:150
ConditionInfo * Condition
If true, small values have the highest priority.
Definition: spells.h:190
std::vector< SpellActionType * > Action
Targeting information. See TargetType.
Definition: spells.h:218
const int ModifyManaCaster
Definition: spells.h:73
void InitSpells()
init spell tables
Definition: spells.cpp:405
char Ccl2Condition(lua_State *l, const char *value)
return 0, 1, 2 for true, only, false.
Definition: script_spell.cpp:118
Vec2i targetPos
Unit target.
Definition: spells.h:100
bool SpellIsAvailable(const CPlayer &player, int SpellId)
return 1 if spell is available, 0 if not (must upgrade)
Definition: spells.cpp:437
int Slot
Spell name shown by the engine.
Definition: spells.h:214