Пример #1
0
        public Army(ArmySideEnum armySide, Controller controller, int id)
        {
            Init(armySide);

            _controller = controller;

            if (!Heroes.Core.Setting._armyAnimationKIdKPurs.ContainsKey(id)) return;
            _animationDataKPurs = Heroes.Core.Setting._armyAnimationKIdKPurs[id];

            if (!_animationDataKPurs.ContainsKey(Heroes.Core.Armies.ArmyAnimationData.PURPOSE_STANDING)) return;
            AnimationData animationStanding = (AnimationData)_animationDataKPurs[Heroes.Core.Armies.ArmyAnimationData.PURPOSE_STANDING];

            _imgPath = string.Format(@"{0}\Images\Battle\Sprites\Armies\{1}", Setting._appStartupPath, animationStanding._folder);
            _prefix = animationStanding._prefix;
            _moveSpeed = animationStanding._moveSpeed;

            this._animations._firstStandingRight = new Animation(
                new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"{0}\{1}{2}.{3}", _imgPath, _prefix, animationStanding._fileNos[0], animationStanding._ext)),
                    AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * animationStanding._turnPerFrame, _rightPt, _imgSize)
            );

            this._animations._firstStandingLeft = new Animation(
                new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"{0}\{1}{2}f.{3}", _imgPath, _prefix, animationStanding._fileNos[0], animationStanding._ext)),
                    AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * animationStanding._turnPerFrame, _leftPt, _imgSize)
            );
        }
Пример #2
0
        public Bless(Controller controller)
        {
            _controller = controller;
            this._imgPath = string.Format(@"{0}\Images\Battle\Sprites\Spells\Bless", Setting._appStartupPath);

            _imgSize = new Size(43, 123);
            _rightPt = new Point(22, 123);
            _leftPt = _rightPt;
        }
Пример #3
0
        public Haste(Controller controller)
        {
            _controller = controller;
            this._imgPath = string.Format(@"{0}\Images\Battle\Sprites\Spells\Haste", Setting._appStartupPath);

            _imgSize = new Size(113, 106);
            _rightPt = new Point(57, 106);
            _leftPt = _rightPt;
        }
Пример #4
0
        public MagicArrow(Controller controller)
        {
            _controller = controller;
            this._imgPath = string.Format(@"{0}\Images\Battle\Sprites\Spells\MagicArrow", Setting._appStartupPath);

            _imgSize = new Size(123, 47);
            _rightPt = new Point(123, 24);
            _leftPt = _rightPt;
        }
Пример #5
0
        public static Army CreateArmy(Heroes.Core.Army army, Controller controller, ArmySideEnum armySide)
        {
            Heroes.Core.Battle.Characters.Armies.Army army2
                = new Army(armySide, controller, army._id);

            army2.CopyFrom(army);

            return army2;
        }
Пример #6
0
        int[] _rowTops; // each row bottom

        #endregion Fields

        #region Constructors

        public BattleTerrain(Controller controller)
        {
            _controller = controller;

            _rowCount = 11;
            _colCount = 15;

            BuildCells(_controller);
        }
Пример #7
0
        public override void Render(Controller controller)
        {
            controller.Sprite.Draw(controller.TextureStore._texBg.Texture, new Rectangle(0, 0, 800, 556), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), Color.White);
            controller.Sprite.Draw(controller.TextureStore._texBar.Texture, new Rectangle(0, 0, 800, 44), new Vector3(0f, 0f, 0f), new Vector3(0f, 556f, 0f), Color.White);

            _engine._battleTerrain.Draw();

            RenderHeroes(controller);
            RenderCharacters(controller);
            RenderSpells(controller);
        }
Пример #8
0
        public Spell(Controller controller, int id)
        {
            Init();

            _controller = controller;

            if (!Heroes.Core.Setting._spellAnimationKIdKPurs.ContainsKey(id)) return;
            _animationDataKPurs = Heroes.Core.Setting._spellAnimationKIdKPurs[id];

            if (!_animationDataKPurs.ContainsKey(Heroes.Core.Heros.SpellAnimationData.PURPOSE_ON_ARMY)) return;
            AnimationData animationStanding = (AnimationData)_animationDataKPurs[Heroes.Core.Heros.SpellAnimationData.PURPOSE_ON_ARMY];
        }
Пример #9
0
        public BattleEngine(Controller controller, Heroes.Core.Hero attacker, 
            Heroes.Core.Hero defender, Heroes.Core.Monster monster, Heroes.Core.Town castle)
            : base()
        {
            _isFirstRun = true;
            _disableControl = false;

            _controller = controller;
            _inputCommand = new InputCommand();

            _battleTerrain = new Heroes.Core.Battle.Terrains.BattleTerrain(controller);

            _spells = new Hashtable();
            _spellActions = new ArrayList();

            // init hero and armies
            {
                _activeCharacters = new ArrayList();

                InitHero(attacker, ArmySideEnum.Attacker, controller, out _attacker);

                if (defender != null)
                {
                    InitHero(defender, ArmySideEnum.Defender, controller, out _defender);
                }

                if (monster != null)
                {
                    InitMonster(monster, ArmySideEnum.Defender, controller, out _monster);
                }

                // sort armies by speed
                SortBySpeed(_activeCharacters);
            }

            // initialize graphics
            {
                foreach (StandardCharacter c in _activeCharacters)
                {
                    c.Initalize();
                    c.Command = _inputCommand;
                    c.Command.InitalizeGraphics(c);
                }

                _attacker.Initalize();
                if (_defender != null) _defender.Initalize();
            }

            _turn = new Turn(_activeCharacters, _attacker, _defender);
            _turn.NextTurned += new Turn.NextTurnedEventHandler(_turn_NextTurned);

            _actions = new ArrayList();
        }
Пример #10
0
        public Pikeman(Controller controller, ArmySideEnum armySide)
            : base(armySide)
        {
            _controller = controller;
            _imgPath = string.Format(@"{0}\Images\Battle\Sprites\Armies\Pikeman", Setting._appStartupPath);
            _prefix = "Cpkman";

            this._animations._firstStandingRight = new Animation(
                new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"{0}\Cpkman03.png", _imgPath)), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            );

            this._animations._firstStandingLeft = new Animation(
                new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"{0}\Cpkman03f.png", _imgPath)), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            );
        }
Пример #11
0
        public Knight(Controller controller)
        {
            this._controller = controller;
            this._imgPath = string.Format(@"{0}\Images\Battle\Sprites\Heros\Knight", Setting._appStartupPath);

            this._animations._standingRightMale = new Animation(
                new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"{0}\ch00_01.png", _imgPath)), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            );

            this._animations._standingLeftMale = new Animation(
                new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"{0}\ch00_01f.png", _imgPath)), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            );

            this._animations._standingRightFemale = this._animations._standingRightMale;
            this._animations._standingLeftFemale = this._animations._standingLeftMale;
        }
Пример #12
0
        public override void Render(Controller controller)
        {
            //TexturePlus bkgd = controller.TextureStore.GetTexture(controller.Device, _imageId);

            //controller.Sprite.Draw(bkgd.Texture, new Rectangle(0, 0, 800, 600), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), Color.White);

            //if (i > 3) i = 0;

            //TexturePlus tex = null;
            //if (i == 0) tex = controller.TextureStore._tex1;
            //else if (i == 1) tex = controller.TextureStore._tex2;
            //else if (i == 2) tex = controller.TextureStore._tex3;
            //else if (i == 3) tex = controller.TextureStore._tex4;

            //controller.Sprite.Draw(tex.Texture, new Rectangle(0, 0, 800, 600), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), Color.White);
            //i += 1;
        }
Пример #13
0
        public Archer(Controller controller, ArmySideEnum armySide)
            : base(armySide)
        {
            _controller = controller;
            _imgPath = string.Format(@"{0}\Images\Battle\Sprites\Armies\Archer", Setting._appStartupPath);
            _prefix = "clcbow";

            //_portrait = Heroes.Core.Battle.Properties.Resources.archerp;

            this._animations._firstStandingRight = new Animation(
                new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"{0}\clcbow00.png", _imgPath)), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            );

            this._animations._firstStandingLeft = new Animation(
                new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"{0}\clcbow00f.png", _imgPath)), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            );
        }
Пример #14
0
        private void RenderCharacters(Controller controller)
        {
            // sort by cell
            ArrayList stdCharacters = new ArrayList();
            foreach (StandardCharacter cs in _engine.ActiveCharacters)
            {
                stdCharacters.Add(cs);
            }
            BattleEngine.SortByCell(stdCharacters);

            foreach (StandardCharacter cs in stdCharacters)
            {
                AnimationRunner runner = cs.CurrentAnimationRunner;
                if (runner == null) continue;

                controller.Sprite.Draw(runner._currentCue._tex.Texture,
                    new Rectangle(new Point(0, 0), runner._currentCue._size),
                    new Vector3(0.0F, 0.0F, 0.0F),
                    new Vector3(cs._currentAnimationPt.X - runner._currentCue._point.X, cs._currentAnimationPt.Y - runner._currentCue._point.Y, 0.0F), Color.White);

                // draw qty left
                Color fontColor;
                if (cs._armySide == ArmySideEnum.Attacker)
                    fontColor = Color.Red;
                else
                    fontColor = Color.Cyan;

                if (cs._qtyLeft > 0)
                {
                    controller._font.DrawText(controller.Sprite, cs._qtyLeft.ToString(),
                        new Rectangle((int)cs._currentAnimationPt.X + 25, (int)cs._currentAnimationPt.Y - 20, 50, 32),
                        DrawTextFormat.Left | DrawTextFormat.Top | DrawTextFormat.WordBreak, fontColor);
                }
            }

            // draw status message
            controller._font.DrawText(controller.Sprite, _engine._statusMsg,
                _engine._rectStatusMsg,
                //new Rectangle(_engine._rectStatusMsg.X + 10, (_engine._rectStatusMsg.Y + _engine._rectStatusMsg.Height / 2) - 10, _engine._rectStatusMsg.Width, _engine._rectStatusMsg.Height),
                DrawTextFormat.Center | DrawTextFormat.Center | DrawTextFormat.WordBreak, Color.White);
        }
Пример #15
0
        private void InitMonster(Heroes.Core.Monster monster, ArmySideEnum armySide, 
            Controller controller,
            out Heroes.Core.Battle.Characters.Monster monster2)
        {
            monster2 = new Heroes.Core.Battle.Characters.Monster();
            monster2.CopyFrom(monster);
            monster2._originalMonster = monster;
            monster2._armySide = armySide;

            // add armies
            {
                foreach (Heroes.Core.Army army in monster._armyKSlots.Values)
                {
                    Heroes.Core.Battle.Characters.Armies.Army c
                        = Heroes.Core.Battle.Characters.Armies.Army.CreateArmy(army, controller, monster2._armySide);
                    if (c == null) continue;

                    c._qtyLeft = c._qty;
                    c._healthRemain = c._health;
                    c._shotRemain = c._noOfShot;
                    c._retaliateRemain = c._noOfRetaliate;

                    if (c != null)
                    {
                        c.InitCell(GetCell(c._armySide, c._slotNo, c._isBig));

                        c._cell._character = c;

                        monster2._armyKSlots.Add(c._slotNo, c);
                        _activeCharacters.Add(c);
                    }
                }
            }
        }
Пример #16
0
        public static Animation CreateAnimation(Controller controller, string path, string prefix, string suffix,
            string[] nos, Point pt, Size sz,
            AnimationCueDirectionEnum lastCueDirection, int duration)
        {
            AnimationCue[] cues = new AnimationCue[nos.Length];
            for (int i = 0; i < nos.Length; i++)
            {
                AnimationCueDirectionEnum cueDirection = AnimationCueDirectionEnum.MoveToNext;
                if (i == nos.Length - 1) cueDirection = lastCueDirection;

                cues[i] = new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"{0}\{1}{2}{3}.png", path, prefix, nos[i], suffix)),
                    cueDirection, BasicEngine.TurnTimeSpan.Ticks * duration, pt, sz);
            }

            Animation animation = new Animation(cues);
            return animation;
        }
Пример #17
0
        public Crusader(Controller controller, ArmySideEnum armySide)
            : base(armySide)
        {
            //    #region Standing
            //    _standingRight = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd54.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd30.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd31.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd32.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd33.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd32.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd31.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd30.dds")), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            //    );

            //    _standingRightActive = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd54s.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd30s.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd31s.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd32s.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd33s.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd32s.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd31s.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd30s.dds")), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            //    );

            //    _standingLeft = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd54f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd30f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd31f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd32f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd33f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd32f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd31f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd30f.dds")), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            //    );

            //    _standingLeftActive = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd54sf.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd30sf.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd31sf.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd32sf.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd33sf.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd32sf.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd31sf.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Standing.ccrusd30sf.dds")), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            //    );
            //    #endregion

            //    #region Moving
            //    _startMovingRight = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.StartMoving.ccrusd34.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.StartMoving.ccrusd35.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            //    );

            //    _startMovingLeft = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.StartMoving.ccrusd34f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.StartMoving.ccrusd35f.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            //    );

            //    _stopMovingRight = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.StopMoving.ccrusd44.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.StopMoving.ccrusd45.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            //    );

            //    _stopMovingLeft = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.StopMoving.ccrusd44f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.StopMoving.ccrusd45f.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            //    );

            //    _movingRight = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd36.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd37.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd38.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd39.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd40.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd41.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd42.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd43.dds")), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            //    );

            //    _movingLeft = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd36f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd37f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd38f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd39f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd40f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd41f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd42f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Moving.ccrusd43f.dds")), AnimationCueDirectionEnum.MoveToBeginning, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            //    );
            //    #endregion

            //    #region Attack
            //    _attackStraightRightBegin = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd01.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd02.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd03.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd04.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            //    );

            //    _attackStraightRightEnd = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd05.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd06.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd07.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            //    );

            //    _attackStraightLeftBegin = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd01f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd02f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd03f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd04f.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            //    );

            //    _attackStraightLeftEnd = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd05f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd06f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.AttackStraight.ccrusd07f.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            //    );
            //    #endregion

            //    #region Hit
            //    _gettingHitRight = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd46.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd47.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd48.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd49.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd50.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd51.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            //    );

            //    _gettingHitLeft = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd46f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd47f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd48f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd49f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd50f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.GettingHit.ccrusd51f.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            //    );

            //    _deathRight = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd16.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd17.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd18.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd19.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd20.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd21.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _rightPt, _imgSize)
            //    );

            //    _deathLeft = new Animation(
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd16f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd17f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd18f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd19f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd20f.dds")), AnimationCueDirectionEnum.MoveToNext, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize),
            //        new AnimationCue(controller.TextureStore.GetTexture(controller.Device, string.Format(@"Heroes.Core.Battle.Images.Sprites.Armies.Crusader.Death.ccrusd21f.dds")), AnimationCueDirectionEnum.StayHere, BasicEngine.TurnTimeSpan.Ticks * 2, _leftPt, _imgSize)
            //    );
            //    #endregion

            //    _animations = new ArmyAnimations(_standingRight, _standingLeft,
            //        _standingRightActive, _standingLeftActive,
            //        _standingRight, _standingLeft,
            //        _startMovingRight, _startMovingLeft,
            //        _startMovingRight, _stopMovingLeft,
            //        _movingRight, _movingLeft,
            //        _attackStraightRightBegin, _attackStraightRightEnd,
            //        _attackStraightLeftBegin, _attackStraightLeftEnd,
            //        null, null,
            //        null, null,
            //        null, null,
            //        _gettingHitRight, _gettingHitLeft,
            //        _deathRight, _deathLeft);
        }
Пример #18
0
        public DialogResult ShowDialog(Heroes.Core.Hero attackHero, Heroes.Core.Hero defendHero, Heroes.Core.Monster monster, Heroes.Core.Town defendCastle)
        {
            _attackHero = attackHero;
            _defendHero = defendHero;
            _monster = monster;
            _defendCastle = defendCastle;

            _controller = new Controller(this, null, new Size(800, 600), null);
            _poller = new Poller(this);
            _inputMethod = new InputPollerCommand(_poller);

            SetupEngine();
            SetupRenderer();

            return this.ShowDialog();
        }
Пример #19
0
 public abstract void Render(Controller controller);
Пример #20
0
        public static Spell CreateSpell(Heroes.Core.Spell spell, Controller controller)
        {
            Heroes.Core.Battle.Characters.Spells.Spell spell2
                = new Spell(controller, spell._id);

            spell2.CopyFrom(spell);

            return spell2;
        }
Пример #21
0
        private void RenderSpells(Controller controller)
        {
            foreach (Heroes.Core.Battle.Characters.Spells.Spell cs in _engine._spellActions)
            {
                AnimationRunner runner = cs.CurrentAnimationRunner;
                if (runner == null) continue;

                controller.Sprite.Draw(runner._currentCue._tex.Texture,
                    new Rectangle(new Point(0, 0), runner._currentCue._size),
                    new Vector3(0.0F, 0.0F, 0.0F),
                    new Vector3(cs._currentAnimationPt.X - runner._currentCue._point.X, cs._currentAnimationPt.Y - runner._currentCue._point.Y, 0.0F), Color.White);
            }
        }
Пример #22
0
        private void RenderHeroes(Controller controller)
        {
            // attacker
            {
                Heroes.Core.Battle.Characters.Hero cs = _engine._attacker;

                AnimationRunner runner = cs._currentAnimationRunner;
                if (runner != null)
                {
                    controller.Sprite.Draw(runner._currentCue._tex.Texture,
                        new Rectangle(new Point(0, 0), runner._currentCue._size),
                        new Vector3(0.0F, 0.0F, 0.0F),
                        new Vector3(cs._currentAnimationPt.X - runner._currentCue._point.X, cs._currentAnimationPt.Y - runner._currentCue._point.Y, 0.0F), Color.White);
                }
            }

            // defender
            if (_engine._defender != null)
            {
                Heroes.Core.Battle.Characters.Hero cs = _engine._defender;

                AnimationRunner runner = cs._currentAnimationRunner;
                if (runner != null)
                {
                    controller.Sprite.Draw(runner._currentCue._tex.Texture,
                        new Rectangle(new Point(0, 0), runner._currentCue._size),
                        new Vector3(0.0F, 0.0F, 0.0F),
                        new Vector3(cs._currentAnimationPt.X - runner._currentCue._point.X, cs._currentAnimationPt.Y - runner._currentCue._point.Y, 0.0F), Color.White);
                }
            }
        }
Пример #23
0
        private void InitHero(Heroes.Core.Hero hero, ArmySideEnum armySide, 
            Controller controller,
            out Heroes.Core.Battle.Characters.Hero hero2)
        {
            hero2 = null;

            switch (hero._heroType)
            {
                case HeroTypeEnum.Knight:
                    hero2 = new Heroes.Core.Battle.Characters.Heros.Knight(controller);
                    break;
                case HeroTypeEnum.Cleric:
                    hero2 = new Heroes.Core.Battle.Characters.Heros.Knight(controller);
                    break;
                default:
                    return;
            }

            hero2.CopyFrom(hero);
            hero2._originalHero = hero;
            hero2._player = hero._player;
            hero2._armySide = armySide;
            hero2._spells = hero._spells;

            // add armies
            {
                foreach (Heroes.Core.Army army in hero._armyKSlots.Values)
                {
                    Heroes.Core.Battle.Characters.Armies.Army c
                        = Heroes.Core.Battle.Characters.Armies.Army.CreateArmy(army, controller, hero2._armySide);
                    if (c == null) continue;

                    c._qtyLeft = c._qty;
                    c._healthRemain = c._health;
                    c._shotRemain = c._noOfShot;
                    c._retaliateRemain = c._noOfRetaliate;

                    c.InitCell(GetCell(c._armySide, c._slotNo, c._isBig));
                    c._cell._character = c;

                    hero2._armyKSlots.Add(c._slotNo, c);
                    _activeCharacters.Add(c);
                }
            }

            // add spells
            {
                foreach (Heroes.Core.Spell spell in hero._spells.Values)
                {
                    if (_spells.ContainsKey(spell._id)) continue;

                    Heroes.Core.Battle.Characters.Spells.Spell c
                        = Heroes.Core.Battle.Characters.Spells.Spell.CreateSpell(spell, controller);
                    if (c == null) continue;

                    _spells.Add(c._id, c);
                }
            }
        }
Пример #24
0
        private void BuildCells(Controller controller)
        {
            _cells = new Cell[_rowCount, _colCount];
            _rowTops = new int[_rowCount];
            _rowBottoms = new int[_rowCount];
            _colLefts = new int[_rowCount, _colCount];
            _colRights = new int[_rowCount, _colCount];

            int startx = 58;
            int starty = 86;
            int x = startx;
            int y = starty;

            for (int row = 0; row < _rowCount; row++)
            {
                _rowTops[row] = y;

                if (row % 2 == 1)
                    x = startx;
                else
                    x = startx + Cell.WIDTH_MIDDLE - 1;

                for (int col = 0; col < _colCount; col++)
                {
                    _colLefts[row, col] = x;

                    _cells[row, col] = new Cell(row, col, x, y, controller.TextureStore._texCell, controller.TextureStore._texCellShd);

                    x += Cell.WIDTH_BODY - 1;
                    _colRights[row, col] = x;
                }

                y += Cell.HEIGHT_HEAD + Cell.HEIGHT_BODY;
                _rowBottoms[row] = y + Cell.HEIGHT_HEAD;
            }

            // build surrounding cell
            for (int row = 0; row < _rowCount; row++)
            {
                for (int col = 0; col < _colCount; col++)
                {
                    Cell cell = _cells[row, col];

                    CellPartEnum direction = CellPartEnum.CenterRight;
                    Cell cell2 = GetNextCell(cell, direction);
                    cell._adjacentCells.Add(direction, cell2);

                    direction = CellPartEnum.CenterLeft;
                    cell2 = GetNextCell(cell, direction);
                    cell._adjacentCells.Add(direction, cell2);

                    direction = CellPartEnum.LowerRight;
                    cell2 = GetNextCell(cell, direction);
                    cell._adjacentCells.Add(direction, cell2);

                    direction = CellPartEnum.LowerLeft;
                    cell2 = GetNextCell(cell, direction);
                    cell._adjacentCells.Add(direction, cell2);

                    direction = CellPartEnum.UpperRight;
                    cell2 = GetNextCell(cell, direction);
                    cell._adjacentCells.Add(direction, cell2);

                    direction = CellPartEnum.UpperLeft;
                    cell2 = GetNextCell(cell, direction);
                    cell._adjacentCells.Add(direction, cell2);
                }
            }
        }