Fixed a visual gear in Mission 5
authorbelphegorr <szabibibi@gmail.com>
Mon, 16 Jul 2012 20:56:55 +0300
changeset 7255 93cf6b3b89be
parent 7253 86814ed9feab
child 7257 566bdf2f023b
Fixed a visual gear in Mission 5 Animate.lua: added an optional boolean parameter to AnimVisualGear - follow
share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua
share/hedgewars/Data/Scripts/Animate.lua
--- a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua	Mon Jul 16 20:38:31 2012 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua	Mon Jul 16 20:56:55 2012 +0300
@@ -681,7 +681,7 @@
   table.insert(wave3DeadAnim, {func = AnimTurn, args = {deployedHog, "Left"}})
   table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, "That ought to show them!", SAY_SAY, 4000}})
   table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, "Guys, do you think there's more of them?", SAY_SHOUT, 7000}})
-  table.insert(wave3DeadAnim, {func = AnimVisualGear, args = {deployedHog, unpack(nativePos[wiseNum]), vgtEvilTrace, 0, true}})
+  table.insert(wave3DeadAnim, {func = AnimVisualGear, args = {deployedHog, unpack(nativePos[wiseNum]), vgtFeather, 0, true, true}})
   table.insert(wave3DeadAnim, {func = AnimWait, args = {deployedHog, 1000}})
   table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, "Where are they?!", SAY_THINK, 3000}})
   table.insert(wave3DeadAnim, {func = AnimCustomFunction, args = {deployedHog, RestoreCyborg, {}}})
--- a/share/hedgewars/Data/Scripts/Animate.lua	Mon Jul 16 20:38:31 2012 +0300
+++ b/share/hedgewars/Data/Scripts/Animate.lua	Mon Jul 16 20:56:55 2012 +0300
@@ -72,9 +72,10 @@
 end
 
 function AnimSwitchHog(gear)
+  --SetGearMessage(gear, 0)
+  --SetState(gear, 0)
   SwitchHog(gear)
   FollowGear(gear)
-  SetGearMessage(gear, 0)
   return true
 end
 
@@ -213,8 +214,11 @@
   return true
 end
 
-function AnimVisualGear(gear, x, y, vgType, state, critical)
-  AddVisualGear(x, y, vgType, state, critical)
+function AnimVisualGear(gear, x, y, vgType, state, critical, follow)
+  local vgear = AddVisualGear(x, y, vgType, state, critical)
+  if follow == true then 
+    FollowGear(vgear)
+  end
   return true
 end