Exemplo n.º 1
0
        public Ally(BattleState battle, int index, int e)
            : base(battle)
        {
            _c = battle.Party[index];

            // the (index * 1) is for separation for targeting purposes.
            _x = (index * 1) + (_c.BackRow ? X_BACK_ROW : X_FRONT_ROW);
            _y = (index * 1) + y0 + (index * ys);

            GetMagicSpells();
            GetSummons();

            if (HP == 0)
            {
                Kill();
            }

            V_Timer = new BattleClock(battle.SpeedValue * 2);
            TurnTimer = new AllyTurnTimer(this, e);

            PrimaryAttack = new WeaponAttack(this);
            PrimaryAttackX2 = new WeaponAttack(this, 2);
            PrimaryAttackX4 = new WeaponAttack(this, 4);
        }
Exemplo n.º 2
0
        public List<Enemy> GetEnemyList(BattleState battle)
        {
            int[] e = new int[Enemies.Count];

            for (int i = 0; i < Enemies.Count; i++)
            {
                e[i] = RANDOM.Next(0, (int)TurnTimer.TURN_TIMER_MAX_VALUE / 2);
            }

            switch (Type)
            {
                case FormationType.PreEmptive:
                case FormationType.Side:

                    for (int i = 0; i < Party.PARTY_SIZE; i++)
                    {
                        e[i] /= 8;
                    }

                    break;
            }

            List<Enemy> enemies = new List<Enemy>();

            for (int i = 0; i < Enemies.Count; i++)
            {
                EnemyRecord record = Enemies[i];

                XmlDocument gamedata = Resource.GetXmlFromResource("data.enemies.xml", battle.Seven.Data.Assembly);

                XmlNode node = gamedata.SelectSingleNode(String.Format("//enemy[name = '{0}']", record.Name));

                if (node == null)
                {
                    throw new GameDataException("Formation '{0}' references nonexistent enemy '{1}'", ID, record.Name);
                }

                Enemy enemy = new Enemy(battle, node, record.X, record.Y, record.Row, e[i], record.Designation);

                enemies.Add(enemy);
            }

            return enemies;
        }
Exemplo n.º 3
0
        internal void BeginBattle()
        {
            int i = 0; //_random.Next(2);

            String battleId = "debug" + i;
            //battleId = "gelnika.e";

            _battleState = new BattleState(this, battleId);
            _battleState.Init();

            SetState(_battleState);
        }
Exemplo n.º 4
0
 public RemoveEnemyEvent(BattleState battle, List<Enemy> enemies)
     : base()
 {
     Enemies = enemies;
     Battle = battle;
     Text = "(clear dead)";
 }
Exemplo n.º 5
0
 protected Combatant(BattleState battle)
 {
     CurrentBattle = battle;
     C_Timer = new BattleClock(136);
 }