412 SetGearMessage(CurrentHedgehog, 0) |
412 SetGearMessage(CurrentHedgehog, 0) |
413 AddAnim(killAnim) |
413 AddAnim(killAnim) |
414 AddFunction({func = AfterKillAnim, args = {}}) |
414 AddFunction({func = AfterKillAnim, args = {}}) |
415 end |
415 end |
416 |
416 |
|
417 function CheckPutCrates(gear) |
|
418 if gear and GetHealth(gear) then |
|
419 return StoppedGear(gear) |
|
420 else |
|
421 return false |
|
422 end |
|
423 end |
|
424 |
417 function PutCrates(index) |
425 function PutCrates(index) |
418 if index <= 7 then |
426 if index <= 7 then |
419 cratesNum = cratesNum + 1 |
427 cratesNum = cratesNum + 1 |
420 SpawnCrateByID(cratesNum) |
428 SpawnCrateByID(cratesNum) |
421 AddNewEvent(CheckGearDead, {crates[cratesNum]}, PutCrates, {index + 1}, 0) |
429 AddNewEvent(CheckGearDead, {crates[cratesNum]}, PutCrates, {index + 1}, 0) |
422 FollowGear(native) |
430 FollowGear(native) |
423 else |
431 else |
424 AddEvent(StoppedGear, {native}, DoCratesTaken, {}, 0) |
432 AddEvent(CheckPutCrates, {native}, DoCratesTaken, {}, 0) |
425 end |
433 end |
426 if index == 4 then |
434 if index == 4 then |
427 AnimSay(native, loc("I'm a ninja."), SAY_THINK, 0) |
435 AnimSay(native, loc("I'm a ninja."), SAY_THINK, 0) |
428 end |
436 end |
429 end |
437 end |