Ejemplo n.º 1
0
    //............................................................................................................Battle Choice
    // For each player Recycle the function to where each player has a turn to choose attack or item on them
    // ane recycle the slots for each one
    public void SetCurrentPlayerOptions()
    {
        // fill the Attack,Item,and skill lists data with the current player data
        // the when the player gose into battle select mode  and enable attack skill or item
        // constructslots  functions will be filled with the current players data
        // then after the player choses its choice Do function check to see if there are any remaining players
        // that need a battle choice then commence battle event
        GameDataHolder.Player currentPlayer = Playerfighters[PlayerBattleChoiceTurn];

        for (int i = 0; i < GamData.Attacks.Count; i++)
        {
            // check all player attacks
            // set it to the player at begining soon
            if (currentPlayer.Etype == GamData.Attacks[i].Etype && GamData.Attacks[i].LevelRequirment <= currentPlayer.Level && GamData.Attacks[i].isItemAttack == false)
            {
                PlayerAttacks.Add(PlayerAttacks[i]);
            }
            // add skills list
            if (currentPlayer.Etype == GamData.Attacks[i].Etype && GamData.Attacks[i].isItemAttack == true)
            {
                for (int a = 0; a < inventory.PlayerInventory.Count; a++)
                {
                    if (inventory.PlayerInventory[a] == GamData.Attacks[i].ItemForAttack)
                    {
                        PlayerSkills.Add(GamData.Attacks[i]);
                    }
                }
            }

            PlayerBattleChoiceTurn += 1;
            if (PlayerBattleChoiceTurn > Playerfighters.Count)
            {
                // Begive battle Event Phase
                // Set PlayerBattleChoiceTurn to 0
                PlayerBattleChoiceTurn = 0;
            }
            // do for enamy Attacks
            //  if (attack.AttackList[i].type == Attacks.attacks.AttackType.normal && attack.AttackList[i].RecLevel <= TempEnamy.Level)
            // {
            //     EnamyAttacks.Add(attack.AttackList[i]);
            //  }
        }



        for (int i = 0; i < Playerfighters.Count; i++)
        {
            //  Setup battle face
            PlayerBattleChoiceTurn += 1;
            if (PlayerBattleChoiceTurn > Playerfighters.Count)
            {
                PlayerBattleChoiceTurn = 0;
                // start battle event fase
            }

            // Setup Slots
        }
    }
Ejemplo n.º 2
0
    // Do attacks and events in order
    // Check if player has died

    // Go back to battle choice



    // Chooses the next players turn based on ............................................................................Choose Fighter turn
    public void ChooseFightersTurn()
    {
        // add enemy speeds
        for (int i = 0; i < EnemyFighters.Count; i++)
        {
            Speeds.Add(EnemyFighters[i].Speed);
        }

        // add player speeds
        for (int i = 0; i < EnemyFighters.Count; i++)
        {
            Speeds.Add(EnemyFighters[i].Speed);
        }

        // set list of speeds in order from least to fastest
        Speeds.Sort();
        // reverse list so fastest is first
        Speeds.Reverse();

        for (int i = 0; i < EnemyFighters.Count + Playerfighters.Count; i++)
        {
            //If is Enemy
            if (EnemyFighters[i].Speed == Speeds[PlayerTurn])
            {
                // if is its speed do turn
                ChosenEnemy = EnemyFighters[i];
            }

            //If is Player
            else if (Playerfighters[i].Speed == Speeds[PlayerTurn])
            {
                // if is its speed do turn
                DoPlayersTurn();
                ChosenPlayer = Playerfighters[i];
            }
        }
    }