コード例 #1
0
ファイル: Enemy.cs プロジェクト: TeamVlissides/SourceRepo
        public Enemy( Armor[] armor, string name, int[] stats, Weapon weapon, int experienceWorth, AI ai, EnemyType type )
            : base(armor,  name, stats, weapon, ai)
        {
            /* start constructor */

            mExperienceWorth = experienceWorth;
            mAI = ai;
            mIsPlayer = false;
            mType = type;

            mAI.Enemy = this;
        }
コード例 #2
0
        public Enemy getDragon()
        {
            /* start getDragon */

            Random random = new Random();
            mArmor = ArmorFactory.getInstance().getBasicArmorSet(ClassEnum.WARRIOR);
            mName = "The Dragon";
            mType = EnemyType.DRAGON;
            mWeapon = WeaponFactory.getWeapon(WeaponEnum.WETIREDSWORD);
            mExperienceWorth = 100000;

            mAi = new Striker();

            mStats = new int[Character.MAXSTATS];

            mStats[(int)StatEnum.AGILITY] = 50 + random.Next(STATVARIANCE);
            mStats[(int)StatEnum.MAGIC] = 50 + random.Next(STATVARIANCE);
            mStats[(int)StatEnum.STRENGTH] = 50 + random.Next(STATVARIANCE);
            mStats[(int)StatEnum.STAMINA] = 50 + random.Next(STATVARIANCE);

            mAi.addAbility( AbilitiesFactory.getInstance().getAbility(AbilitesEnum.BLAZE));

            return new Enemy(mArmor, mName, mStats, mWeapon, mExperienceWorth, mAi, mType);
        }
コード例 #3
0
        private void setAI()
        {
            /* start setAI */

            Random random = new Random();
            int choice = random.Next(AI.AMOUNTOFAI);

            if (choice == 0)
                mAi = new Berserker();

            if (choice == 1)
                mAi = new Striker();

            if (choice == 2)
                mAi = new HealerAttacker();
        }