public SpriteInfoExtended CreateWalkingDummy(Texture64[] _Stand, Texture64[][] _Walk, Texture64[] Hit, Texture64[] Death, Texture64[] Shooting)
		{
			var Walk = _Walk;
			var Stand = _Stand;

			var tt = default(Timer);
			var s = new SpriteInfoExtended();

			s.Health = GuardMaxHealth;

			int WalkingAnimationFrame = 0;

			Action start =
				delegate
				{
					s.WalkingAnimationRunning = true;

					if (Walk.Length > 0)
						tt = (200).AtInterval(
							t =>
							{
								#region dead people do not walk
								if (s.Health <= 0)
								{
									t.stop();
									return;
								}
								#endregion


								if (!s.AIEnabled)
									return;

								WalkingAnimationFrame = t.currentCount % Walk.Length;

								s.Frames = Walk[WalkingAnimationFrame];
							}
						);
				};

			Action stop =
				delegate
				{
					s.WalkingAnimationRunning = false;

					if (tt != null)
						tt.stop();

					s.Frames = Stand;
				};


			s.Position = new Point { x = EgoView.ViewPositionX, y = EgoView.ViewPositionY };
			s.Frames = Stand;
			s.Direction = EgoView.ViewDirection;
			s.StartWalkingAnimation = start;
			s.StopWalkingAnimation = stop;
			s.Range = PlayerRadiusMargin;

			s.AddTo(EgoView.Sprites);

			Action UpdateCurrentFrame =
				delegate
				{
					if (s.Health <= 0)
						return;
					if (!s.AIEnabled)
						return;

					if (s.WalkingAnimationRunning)
						s.Frames = Walk[WalkingAnimationFrame];
					else
						s.Frames = Stand;
				};

			if (Shooting != null)
			{
				#region prepare
				#region clone

				var WalkShooting = Enumerable.ToArray(
					_Walk.Select(r0 => Enumerable.ToArray(r0))
				);

				var StandShooting = Enumerable.ToArray(
					_Stand
				);

				#endregion

				// 0 .. 8
				Action<int> ApplyShootingFrame =
					ShootingFrameIndex =>
					{
						var k = Shooting.AtModulus(ShootingFrameIndex);

						StandShooting[1] = k;
						StandShooting[2] = k;
						StandShooting[3] = k;

						foreach (var v in WalkShooting)
						{
							v[1] = k;
							v[2] = k;
							v[3] = k;
						}

						UpdateCurrentFrame();
					};
				#endregion

				var PlayShootingAnimationTimer = default(Timer);

				s.PlayShootingAnimation +=
					delegate
					{
						// for a short period of time we need to overwrite
						// stand and walk frames

						Walk = WalkShooting;
						Stand = StandShooting;

						if (PlayShootingAnimationTimer != null)
							PlayShootingAnimationTimer.stop();

						PlayShootingAnimationTimer = FrameRate_ShootingAnimation.Chain(
							() => ApplyShootingFrame(0)
						).Chain(
							() => ApplyShootingFrame(1)
						).Chain(
							() => ApplyShootingFrame(2)
						).Chain(
							() => ApplyShootingFrame(1)
						).Chain(
							() => ApplyShootingFrame(0)
						).Chain(
							delegate
							{
								// revert soon after animation finishes
								Walk = _Walk;
								Stand = _Stand;
								UpdateCurrentFrame();

								PlayShootingAnimationTimer = null;
							}
						).Do();
					};
			}

			if (Hit != null)
				s.TakeDamage +=
					(DamageToBeTaken, DamageOwner) =>
					{
						// we have nothing to do here if we are dead 
						if (s.Health < 0)
							return;

						s.Health -= DamageToBeTaken;

						if (s.Health > 0)
						{
							Assets.Default.Sounds.hit.play();

							#region just show being hurt for a short moment
							s.AIEnabled = false;

							var q = s.Frames;
							s.Frames = Hit;

							300.AtDelayDo(
								delegate
								{
									s.Frames = q;
									s.AIEnabled = true;
								}
							);
							#endregion

							// remove old blood which is too near
							EmitBloodUnderSprite(s);
						}
						else
						{
							if (Sync_GuardKilled != null)
								Sync_GuardKilled(DamageOwner);

							RemoveBloodUnderSprite(s);

							Assets.Default.Sounds.death.play();

							// player wont be blocked by a corpse
							s.Range = 0;

							// animate death
							FrameRate_DeathAnimation.AtInterval(
								ttt =>
								{
									if (Death.Length == ttt.currentCount)
									{
										ttt.stop();
										return;
									}

									s.Frames = new[] { Death[ttt.currentCount] };
								}
							);
						}

						if (s.TakeDamageDone != null)
							s.TakeDamageDone(DamageToBeTaken, DamageOwner);

					};


			return s;
		}
        public SpriteInfoExtended CreateWalkingDummy(Texture64[] _Stand, Texture64[][] _Walk, Texture64[] Hit, Texture64[] Death, Texture64[] Shooting)
        {
            //            1:0072:0051 FlashTreasureHunt.ApplicationSprite create FlashTreasureHunt.ActionScript.FlashTreasureHunt+<>c__DisplayClassb8

            //error at CopyType:
            //         * Illegal one-byte branch at position: 84. Requested branch was: 128.
            //         * FlashTreasureHunt.ActionScript.FlashTreasureHunt+<>c__DisplayClassb8 0200003d

            //         * IllegalBranchAt 00000054

            //         * RequestedBranch 128

            var Walk = _Walk;
            var Stand = _Stand;

            var tt = default(Timer);
            var s = new SpriteInfoExtended();

            s.Health = GuardMaxHealth;

            int WalkingAnimationFrame = 0;

            Action start =
                delegate
                {
                    s.WalkingAnimationRunning = true;

                    if (Walk.Length > 0)
                        tt = (200).AtInterval(
                            t =>
                            {
                                WalkingAnimationFrame = CreateWalkingDummy_Walk(Walk, s, WalkingAnimationFrame, t);
                                return;
                            }
                        );
                };

            Action stop =
                delegate
                {
                    s.WalkingAnimationRunning = false;

                    if (tt != null)
                        tt.stop();

                    s.Frames = Stand;
                };


            s.Position = new Point { x = EgoView.ViewPositionX, y = EgoView.ViewPositionY };
            s.Frames = Stand;
            s.Direction = EgoView.ViewDirection;
            s.StartWalkingAnimation = start;
            s.StopWalkingAnimation = stop;
            s.Range = PlayerRadiusMargin;

            s.AddTo(EgoView.Sprites);

            Action UpdateCurrentFrame =
                delegate
                {
                    if (s.Health <= 0)
                        return;
                    if (!s.AIEnabled)
                        return;

                    if (s.WalkingAnimationRunning)
                        s.Frames = Walk[WalkingAnimationFrame];
                    else
                        s.Frames = Stand;
                };

            if (Shooting != null)
            {
                #region prepare
                #region clone

                var WalkShooting = Enumerable.ToArray(
                    _Walk.Select(r0 => Enumerable.ToArray(r0))
                );

                var StandShooting = Enumerable.ToArray(
                    _Stand
                );

                #endregion

                // 0 .. 8
                Action<int> ApplyShootingFrame =
                    ShootingFrameIndex =>
                    {
                        var k = Shooting.AtModulus(ShootingFrameIndex);

                        StandShooting[1] = k;
                        StandShooting[2] = k;
                        StandShooting[3] = k;

                        foreach (var v in WalkShooting)
                        {
                            v[1] = k;
                            v[2] = k;
                            v[3] = k;
                        }

                        UpdateCurrentFrame();
                    };
                #endregion

                var PlayShootingAnimationTimer = default(Timer);

                s.PlayShootingAnimation +=
                    delegate
                    {
                        // for a short period of time we need to overwrite
                        // stand and walk frames

                        Walk = WalkShooting;
                        Stand = StandShooting;

                        if (PlayShootingAnimationTimer != null)
                            PlayShootingAnimationTimer.stop();

                        PlayShootingAnimationTimer = FrameRate_ShootingAnimation.Chain(
                            () => ApplyShootingFrame(0)
                        ).Chain(
                            () => ApplyShootingFrame(1)
                        ).Chain(
                            () => ApplyShootingFrame(2)
                        ).Chain(
                            () => ApplyShootingFrame(1)
                        ).Chain(
                            () => ApplyShootingFrame(0)
                        ).Chain(
                            delegate
                            {
                                // revert soon after animation finishes
                                Walk = _Walk;
                                Stand = _Stand;
                                UpdateCurrentFrame();

                                PlayShootingAnimationTimer = null;
                            }
                        ).Do();
                    };
            }

            if (Hit != null)
                s.TakeDamage +=
                    (DamageToBeTaken, DamageOwner) =>
                    {
                        CreateWalkingDummy_TakeDamage.Invoke(this, Hit, Death, s, DamageToBeTaken, DamageOwner);
                        return;

                    };


            return s;
        }