1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-29 21:56:54 +02:00

Fixed teleporting animation (#818). Flying ability with subtype "1" will cause movement animation to skip (teleport).

This commit is contained in:
DjWarmonger 2012-09-29 12:40:12 +00:00
parent a602d7e9da
commit b6a20b6e99
3 changed files with 16 additions and 11 deletions

View File

@ -401,8 +401,9 @@ if( !isEarliest(false) )
Point begPosition = CClickableHex::getXYUnitAnim(curStackPos, movedStack->attackerOwned, movedStack, owner);
Point endPosition = CClickableHex::getXYUnitAnim(nextHex, movedStack->attackerOwned, movedStack, owner);
if(steps < 0) //this creature seems to have no move animation so we can end it immediately
if(steps < 0 || stack->hasBonus(Selector::typeSubtype(Bonus::FLYING, 1))) //no movement or teleport
{
//this creature seems to have no move animation so we can end it immediately
endAnim();
return false;
}

View File

@ -574,7 +574,9 @@
"level": 7,
"name": [ "Devil" ],
"faction": 3,
"ability_remove": [ "FLYING" ], //use teleport instead
"ability_add": [ [ "HATE", 50, 13, 0 ],
[ "FLYING", 0, 1, 0], //teleport
[ "HATE", 50, 12, 0 ],
[ "ENEMY_LUCK_DECREASING", 1, 0, 0 ], //devils //devils hate archangles
[ "BLOCKS_RETALIATION", 0, 0, 0 ] ], //devils //devils hate angels
@ -587,8 +589,10 @@
"level": 7,
"name": [ "ArchDevil" ],
"faction": 3,
"ability_add": [ [ "HATE", 50, 13, 0 ], //wraith
"ability_remove": [ "FLYING" ], //use teleport instead
"ability_add": [ [ "HATE", 50, 13, 0 ],
[ "HATE", 50, 12, 0 ],
[ "FLYING", 0, 1, 0],
[ "ENEMY_LUCK_DECREASING", 1, 0, 0 ], //archdevils //archdevils hate archangles
[ "BLOCKS_RETALIATION", 0, 0, 0 ] ], //archdevils //archdevils hate angels
"defname": "CADEVL.DEF"

View File

@ -387,15 +387,7 @@ void CCreatureHandler::loadCreatures()
if (!value->isNull() && value->Bool())
factionToTurretCreature[c->faction] = creatureID;
value = &creature["ability_add"];
if (!value->isNull()) {
BOOST_FOREACH(const JsonNode &ability, value->Vector())
{
AddAbility(c, ability.Vector());
}
}
value = &creature["ability_remove"];
value = &creature["ability_remove"];//remove first - arch devil
if (!value->isNull())
{
BOOST_FOREACH(const JsonNode &ability, value->Vector())
@ -403,6 +395,14 @@ void CCreatureHandler::loadCreatures()
RemoveAbility(c, ability);
}
}
value = &creature["ability_add"];
if (!value->isNull()) {
BOOST_FOREACH(const JsonNode &ability, value->Vector())
{
AddAbility(c, ability.Vector());
}
}
}
BOOST_FOREACH(const JsonNode &creature, config["unused_creatures"].Vector())