コード例 #1
0
ファイル: SpecialAbilityList.cs プロジェクト: dmacy5/RPG
        public SpecialAbilityList(SpecialAbility one, SpecialAbility two, SpecialAbility three)
        {
            abilities    = new SpecialAbility[4];
            abilityCount = 3;

            abilities[0] = one;
            abilities[1] = two;
            abilities[2] = three;
            abilities[3] = null;
        }
コード例 #2
0
ファイル: SpecialAbilityList.cs プロジェクト: dmacy5/RPG
        public SpecialAbilityList(SpecialAbility one, SpecialAbility two, SpecialAbility three, SpecialAbility four)
        {
            abilities    = new SpecialAbility[4];
            abilityCount = 4;

            abilities[0] = one;
            abilities[1] = two;
            abilities[2] = three;
            abilities[3] = four;
        }
コード例 #3
0
ファイル: SpecialAbilityList.cs プロジェクト: dmacy5/RPG
        public SpecialAbilityList(SpecialAbility one)
        {
            abilities    = new SpecialAbility[4];
            abilityCount = 1;

            abilities[0] = one;
            abilities[1] = null;
            abilities[2] = null;
            abilities[3] = null;
        }
コード例 #4
0
ファイル: SpecialAbilityList.cs プロジェクト: dmacy5/RPG
        public SpecialAbilityList(SpecialAbility one, SpecialAbility two, SpecialAbility three, SpecialAbility four)
        {
            abilities = new SpecialAbility[4];
            abilityCount = 4;

            abilities[0] = one;
            abilities[1] = two;
            abilities[2] = three;
            abilities[3] = four;
        }
コード例 #5
0
ファイル: SpecialAbilityList.cs プロジェクト: dmacy5/RPG
        public SpecialAbilityList(SpecialAbility one, SpecialAbility two, SpecialAbility three)
        {
            abilities = new SpecialAbility[4];
            abilityCount = 3;

            abilities[0] = one;
            abilities[1] = two;
            abilities[2] = three;
            abilities[3] = null;
        }
コード例 #6
0
ファイル: SpecialAbilityList.cs プロジェクト: dmacy5/RPG
        public SpecialAbilityList(SpecialAbility one)
        {
            abilities = new SpecialAbility[4];
            abilityCount = 1;

            abilities[0] = one;
            abilities[1] = null;
            abilities[2] = null;
            abilities[3] = null;
        }
コード例 #7
0
ファイル: SpecialAbilityList.cs プロジェクト: dmacy5/RPG
        public void addAbility(SpecialAbility newAbility)
        {
            if( abilityCount >= 0 && abilityCount < 4 )
            {
                abilities[abilityCount] = newAbility;
                abilityCount++;
            }
            else
            {
                int removedIndex = removeAbility();

                if(removedIndex >= 0)
                    abilities[removedIndex] = newAbility;
            }
        }
コード例 #8
0
ファイル: SpecialAbilityList.cs プロジェクト: dmacy5/RPG
        public void addAbility(SpecialAbility newAbility)
        {
            if (abilityCount >= 0 && abilityCount < 4)
            {
                abilities[abilityCount] = newAbility;
                abilityCount++;
            }
            else
            {
                int removedIndex = removeAbility();

                if (removedIndex >= 0)
                {
                    abilities[removedIndex] = newAbility;
                }
            }
        }
コード例 #9
0
ファイル: Player.cs プロジェクト: dmacy5/RPG
        public override void turn(Character enemy)
        {
            Console.WriteLine(Name + "'s turn: ");
            Console.WriteLine("1. Basic attack");
            Console.WriteLine("2. Special abilities");
            Console.WriteLine("3. Inventory");
            Console.WriteLine("4. Run");

            int option = GameManager.getInputBetween(1, 4);

            if (option == 1)
            {
                basicAttack(enemy);
            }
            else if (option == 2)
            {
                SpecialAbility picked = abilities.getAbility();
                picked.useAbility(this, enemy);
            }
            else if (option == 3)
            {
                inventory.useItem(this, enemy);
            }
        }