protected override void Prepare()
        {
            var   effect = Factory.Create1by1Sprite();
            float size   = 0.3f;

            effect.transform.localScale = new UnityEngine.Vector3(size, size, size);
            var target = ((XmasEntity)Spell.Targets[0][0]);
            var pos    = Factory.ConvertPos(target.PositionAs <TilePosition>().Point, 0.8f);

            pos.y += 0.5f;
            effect.transform.position = pos;
            ParallelAnimation parallelani = new ParallelAnimation();
            TextureAnimation  texani      = new TextureAnimation(this.Factory.LoadSpellTexture("lightningbolt"), 5, 5);

            texani.Frames       = Enumerable.Range(1, 20).ToArray();
            texani.FrameRepeats = new int[] { 1, 1, 1, 1, 1,
                                              1, 1, 1, 1, 1,
                                              1, 1, 1, 1, 1,
                                              1, 1, 1, 1, 1 };
            parallelani.Add(texani, true);

            SizeChangeAnimation sizeani = new SizeChangeAnimation(0.02f);

            parallelani.Add(sizeani, false);
            this.EnqueueAnimation(effect, parallelani);
        }
        protected override void Prepare()
        {
            var effect = Factory.Create1by1Sprite();
            effect.transform.position = Factory.ConvertPos(Spell.Controller.Hero.PositionAs<TilePosition>().Point, 0.8f);
            ParallelAnimation parallelani = new ParallelAnimation();
            TextureAnimation texani = new TextureAnimation(this.Factory.LoadSpellTexture("inspiration"), 5, 3);
            texani.Frames = Enumerable.Range(1, 15).ToArray();
            texani.FrameRepeats = new int[] { 1, 1, 1, 1, 1,
                                              1, 1, 1, 1, 1,
                                              1, 1, 1, 1, 1 };
            parallelani.Add(texani, true);

            SizeChangeAnimation sizeani = new SizeChangeAnimation(0.02f);
            parallelani.Add(sizeani, false);
            this.EnqueueAnimation(effect, parallelani);
        }
        protected override void Prepare()
        {
            var effect = Factory.Create1by1Sprite();
            float size = 0.4f;
            effect.transform.localScale = new UnityEngine.Vector3(size, size, size);
            var terrain = (TerrainEntity)Spell.Targets[0][0];
            var toPos = Factory.ConvertPos(terrain.PositionAs<TilePosition>().Point, 0.8f);
            effect.transform.position = toPos;
            ParallelAnimation parallelani = new ParallelAnimation();
            TextureAnimation texani = new TextureAnimation(this.Factory.LoadSpellTexture("raise_dead"), 5, 6);
            texani.Frames = Enumerable.Range(1, 30).ToArray();
            texani.FrameRepeats = Enumerable.Repeat<int>(1, 30).ToArray();
            parallelani.Add(texani, true);

            SizeChangeAnimation sizeani = new SizeChangeAnimation(0.02f);
            parallelani.Add(sizeani, false);
            this.EnqueueAnimation(effect, parallelani);
        }
Example #4
0
        protected override void Prepare()
        {
            var effect = Factory.Create1by1Sprite();

            effect.transform.position = Factory.ConvertPos(Spell.Controller.Hero.PositionAs <TilePosition>().Point, 0.8f);
            ParallelAnimation parallelani = new ParallelAnimation();
            TextureAnimation  texani      = new TextureAnimation(this.Factory.LoadSpellTexture("inspiration"), 5, 3);

            texani.Frames       = Enumerable.Range(1, 15).ToArray();
            texani.FrameRepeats = new int[] { 1, 1, 1, 1, 1,
                                              1, 1, 1, 1, 1,
                                              1, 1, 1, 1, 1 };
            parallelani.Add(texani, true);

            SizeChangeAnimation sizeani = new SizeChangeAnimation(0.02f);

            parallelani.Add(sizeani, false);
            this.EnqueueAnimation(effect, parallelani);
        }
Example #5
0
        protected override void Prepare()
        {
            ParallelAnimation parallelani;
            var   ball     = Factory.Create1by1Sprite();
            float ballSize = 0.5f;

            ball.transform.localScale = new UnityEngine.Vector3(ballSize, ballSize, ballSize);
            TextureAnimation       texani;
            SizeChangeAnimation    sizeani;
            MoveTransformAnimation moveani;
            var height  = 1f;
            var terrain = (TerrainEntity)Spell.Targets[0][0];
            var heropos = Spell.Controller.Hero.PositionAs <TilePosition>().Point;
            var fromPos = Factory.ConvertPos(heropos, height);
            var toPos   = Factory.ConvertPos(terrain.PositionAs <TilePosition>().Point, 0.8f);

            parallelani         = new ParallelAnimation();
            texani              = new TextureAnimation(this.Factory.LoadSpellTexture("fireball"), 8, 8);
            texani.Frames       = new int[] { 6 };
            texani.FrameRepeats = Enumerable.Repeat <int>(1, 2).ToArray();
            texani.AutoLooping  = true;
            parallelani.Add(texani, false);

            moveani = new MoveTransformAnimation(fromPos, toPos, 12f);
            parallelani.Add(moveani, true);
            this.EnqueueAnimation(ball, parallelani);

            parallelani.Completed += (sender, evt) =>
            {
                var explosion = Factory.Create1by1Sprite();
                explosion.transform.position = toPos;
                parallelani         = new ParallelAnimation();
                texani              = new TextureAnimation(this.Factory.LoadSpellTexture("fireball"), 8, 8);
                texani.Frames       = Enumerable.Range(1, 38).ToArray();
                texani.FrameRepeats = Enumerable.Repeat <int>(1, 38).ToArray();
                parallelani.Add(texani, true);

                sizeani = new SizeChangeAnimation(0.02f);
                parallelani.Add(sizeani, false);
                this.EnqueueAnimation(explosion, parallelani);
            };
        }
        protected override void Prepare()
        {
            ParallelAnimation parallelani;
            var ball = Factory.Create1by1Sprite();
            float ballSize = 0.5f;
            ball.transform.localScale = new UnityEngine.Vector3(ballSize,ballSize,ballSize);
            TextureAnimation texani;
            SizeChangeAnimation sizeani;
            MoveTransformAnimation moveani;
            var height = 1f;
            var terrain = (TerrainEntity)Spell.Targets[0][0];
            var heropos = Spell.Controller.Hero.PositionAs<TilePosition>().Point;
            var fromPos = Factory.ConvertPos(heropos, height);
            var toPos = Factory.ConvertPos(terrain.PositionAs<TilePosition>().Point, 0.8f);

            parallelani = new ParallelAnimation();
            texani = new TextureAnimation(this.Factory.LoadSpellTexture("fireball"), 8, 8);
            texani.Frames = new int[]{6};
            texani.FrameRepeats = Enumerable.Repeat<int>(1, 2).ToArray();
            texani.AutoLooping = true;
            parallelani.Add(texani, false);

            moveani = new MoveTransformAnimation(fromPos,toPos,12f);
            parallelani.Add(moveani,  true);
            this.EnqueueAnimation(ball, parallelani);

            parallelani.Completed += (sender, evt) =>
                {
                    var explosion = Factory.Create1by1Sprite();
                    explosion.transform.position = toPos;
                    parallelani = new ParallelAnimation();
                    texani = new TextureAnimation(this.Factory.LoadSpellTexture("fireball"), 8, 8);
                    texani.Frames = Enumerable.Range(1, 38).ToArray();
                    texani.FrameRepeats = Enumerable.Repeat<int>(1, 38).ToArray();
                    parallelani.Add(texani, true);

                    sizeani = new SizeChangeAnimation(0.02f);
                    parallelani.Add(sizeani, false);
                    this.EnqueueAnimation(explosion, parallelani);
                };
        }
Example #7
0
        protected override void Prepare()
        {
            var   effect = Factory.Create1by1Sprite();
            float size   = 0.4f;

            effect.transform.localScale = new UnityEngine.Vector3(size, size, size);
            var terrain = (TerrainEntity)Spell.Targets[0][0];
            var toPos   = Factory.ConvertPos(terrain.PositionAs <TilePosition>().Point, 0.8f);

            effect.transform.position = toPos;
            ParallelAnimation parallelani = new ParallelAnimation();
            TextureAnimation  texani      = new TextureAnimation(this.Factory.LoadSpellTexture("raise_dead"), 5, 6);

            texani.Frames       = Enumerable.Range(1, 30).ToArray();
            texani.FrameRepeats = Enumerable.Repeat <int>(1, 30).ToArray();
            parallelani.Add(texani, true);

            SizeChangeAnimation sizeani = new SizeChangeAnimation(0.02f);

            parallelani.Add(sizeani, false);
            this.EnqueueAnimation(effect, parallelani);
        }
        protected override void Prepare()
        {
            var effect = Factory.Create1by1Sprite();
            float size = 0.3f;
            effect.transform.localScale = new UnityEngine.Vector3(size, size, size);
            var target = ((XmasEntity)Spell.Targets[0][0]);
            var pos = Factory.ConvertPos(target.PositionAs<TilePosition>().Point, 0.8f);
            pos.y += 0.5f;
            effect.transform.position = pos;
            ParallelAnimation parallelani = new ParallelAnimation();
            TextureAnimation texani = new TextureAnimation(this.Factory.LoadSpellTexture("lightningbolt"), 5, 5);
            texani.Frames = Enumerable.Range(1, 20).ToArray();
            texani.FrameRepeats = new int[] { 1, 1, 1, 1, 1,
                                              1, 1, 1, 1, 1,
                                              1, 1, 1, 1, 1,
                                              1, 1, 1, 1, 1 };
            parallelani.Add(texani, true);

            SizeChangeAnimation sizeani = new SizeChangeAnimation(0.02f);
            parallelani.Add(sizeani, false);
            this.EnqueueAnimation(effect, parallelani);
        }