equal
deleted
inserted
replaced
1 local animPos, lastx, lasty, jumpTypes, jumpTimes, moveDirs, jumpStarted |
1 local animPos, lastx, lasty, jumpTypes, jumpTimes, moveDirs, jumpStarted |
2 local moveTime = 0 |
2 local moveTime = 0 |
3 local backJumped, jTimer, awTime, globalWait, stageEvents, seNum, curEvent |
3 local backJumped, jTimer, awTime, globalWait, stageEvents, seNum, curEvent |
4 local needtoDecrease |
4 local needToDecrease |
5 local AnimList, AnimListNum |
5 local AnimList, AnimListNum |
6 local FunctionList, FunctionListNum |
6 local FunctionList, FunctionListNum |
7 local skipFuncList |
7 local skipFuncList |
8 local skipping |
8 local skipping |
9 local baseInputMask = 0xFFFFFFFF |
9 local baseInputMask = 0xFFFFFFFF |
166 FollowGear(gear) |
166 FollowGear(gear) |
167 return true |
167 return true |
168 end |
168 end |
169 |
169 |
170 function AnimMove(gear, dir, posx, posy, maxMoveTime) |
170 function AnimMove(gear, dir, posx, posy, maxMoveTime) |
171 dirr = moveDirs[dir] |
171 local dirr = moveDirs[dir] |
172 SetGearMessage(gear, dirr) |
172 SetGearMessage(gear, dirr) |
173 moveTime = moveTime + 1 |
173 moveTime = moveTime + 1 |
174 if (maxMoveTime and moveTime > maxMoveTime) then |
174 if (maxMoveTime and moveTime > maxMoveTime) then |
175 SetGearMessage(gear, 0) |
175 SetGearMessage(gear, 0) |
176 SetGearPosition(gear, posx, posy) |
176 SetGearPosition(gear, posx, posy) |
199 elseif jumpType == "back" and backJumped == false then |
199 elseif jumpType == "back" and backJumped == false then |
200 backJumped = true |
200 backJumped = true |
201 SetGearMessage(gear, jumpTypes[jumpType]) |
201 SetGearMessage(gear, jumpTypes[jumpType]) |
202 AnimGearWait(gear, jumpTimes["backback"]) |
202 AnimGearWait(gear, jumpTimes["backback"]) |
203 else |
203 else |
204 curx = GetX(gear) |
204 local curx = GetX(gear) |
205 cury = GetY(gear) |
205 local cury = GetY(gear) |
206 if curx == lastx and cury == lasty then |
206 if curx == lastx and cury == lasty then |
207 jumpStarted = false |
207 jumpStarted = false |
208 backJumped = false |
208 backJumped = false |
209 AnimGearWait(gear, 100) |
209 AnimGearWait(gear, 100) |
210 return true |
210 return true |
272 |
272 |
273 function AnimCustomFunction(gear, func, args) |
273 function AnimCustomFunction(gear, func, args) |
274 if args == nil then |
274 if args == nil then |
275 args = {} |
275 args = {} |
276 end |
276 end |
277 retval = func(unpack(args)) |
277 local retval = func(unpack(args)) |
278 if retval == false then |
278 if retval == false then |
279 return false |
279 return false |
280 else |
280 else |
281 return true |
281 return true |
282 end |
282 end |
340 and (steps[animPos].swh == nil or steps[animPos].swh == true) then |
340 and (steps[animPos].swh == nil or steps[animPos].swh == true) then |
341 AnimSwitchHog(steps[animPos].args[1]) |
341 AnimSwitchHog(steps[animPos].args[1]) |
342 end |
342 end |
343 |
343 |
344 startCinemaLock() |
344 startCinemaLock() |
345 retVal = steps[animPos].func(unpack(steps[animPos].args)) |
345 local retVal = steps[animPos].func(unpack(steps[animPos].args)) |
346 if (retVal ~= false) then |
346 if (retVal ~= false) then |
347 animPos = animPos + 1 |
347 animPos = animPos + 1 |
348 end |
348 end |
349 |
349 |
350 return false |
350 return false |
425 -- GetHealth returns nil if gear does not exist |
425 -- GetHealth returns nil if gear does not exist |
426 if not GetHealth(gear) then |
426 if not GetHealth(gear) then |
427 -- We consider the gear to be “stopped” if it has been destroyed |
427 -- We consider the gear to be “stopped” if it has been destroyed |
428 return true |
428 return true |
429 end |
429 end |
430 dx,dy = GetGearVelocity(gear) |
430 local dx,dy = GetGearVelocity(gear) |
431 return math.abs(dx) <= 1 and math.abs(dy) <= 1 |
431 return math.abs(dx) <= 1 and math.abs(dy) <= 1 |
432 end |
432 end |