瀏覽代碼

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

DjWarmonger 13 年之前
父節點
當前提交
b6a20b6e99
共有 3 個文件被更改,包括 14 次插入9 次删除
  1. 2 1
      client/BattleInterface/CBattleAnimations.cpp
  2. 5 1
      config/creatures.json
  3. 7 7
      lib/CCreatureHandler.cpp

+ 2 - 1
client/BattleInterface/CBattleAnimations.cpp

@@ -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;
 	}

+ 5 - 1
config/creatures.json

@@ -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"

+ 7 - 7
lib/CCreatureHandler.cpp

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