[+] Added CclDefineSpell parameter "force-use-animation" to use animation code for "self" targeted spells (enables to use spells as some type of commands promted through button panel)
This commit is contained in:
parent
cb88d6b3f7
commit
9cbf372306
4 changed files with 6 additions and 2 deletions
src
|
@ -333,7 +333,7 @@ bool COrder_SpellCast::SpellMoveToTarget(CUnit &unit)
|
|||
}
|
||||
// FALL THROUGH
|
||||
case 2: // Cast spell on the target.
|
||||
if (!spell.IsCasterOnly()) {
|
||||
if (!spell.IsCasterOnly() || spell.ForceUseAnimation) {
|
||||
AnimateActionSpellCast(unit, *this);
|
||||
if (unit.Anim.Unbreakable) {
|
||||
return ;
|
||||
|
|
|
@ -224,6 +224,7 @@ public:
|
|||
bool IsCasterOnly() const {
|
||||
return !Range && Target == TargetSelf;
|
||||
}
|
||||
bool ForceUseAnimation;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -333,6 +333,9 @@ static int CclDefineSpell(lua_State *l)
|
|||
} else if (!strcmp(value, "repeat-cast")) {
|
||||
spell->RepeatCast = 1;
|
||||
--i;
|
||||
} else if (!strcmp(value, "force-use-animation")) {
|
||||
spell->ForceUseAnimation = true;
|
||||
--i;
|
||||
} else if (!strcmp(value, "target")) {
|
||||
value = LuaToString(l, i + 1);
|
||||
if (!strcmp(value, "self")) {
|
||||
|
|
|
@ -485,7 +485,7 @@ SpellType::SpellType(int slot, const std::string &ident) :
|
|||
Ident(ident), Slot(slot), Target(), Action(),
|
||||
Range(0), ManaCost(0), RepeatCast(0),
|
||||
DependencyId(-1), Condition(NULL),
|
||||
AutoCast(NULL), AICast(NULL)
|
||||
AutoCast(NULL), AICast(NULL), ForceUseAnimation(false)
|
||||
{
|
||||
memset(Costs, 0, sizeof(Costs));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue