Beispiel #1
0
    void CreatePlayerSquad(Squad squad)
    {
        Character newChar;

        #region create characters
        for (int i = 0; i < 6; i++)
        {
            //Create a new character with some random base stats
            newChar = new Character();

            newChar.Side         = (squad == squadView.PlayerSquad) ? TrialByFire.SquadSide.LEFT : TrialByFire.SquadSide.RIGHT;
            newChar.CurrentState = CharacterState.ALIVE;

            newChar.setBaseStat(TrialByFire.CharacterStats.ACCURACY, Random.Range(40, 70));
            newChar.setBaseStat(TrialByFire.CharacterStats.ARMOUR, Random.Range(20, 50));
            newChar.setBaseStat(TrialByFire.CharacterStats.ENERGY, Random.Range(40, 70));
            newChar.setBaseStat(TrialByFire.CharacterStats.HEALTH, 100);
            newChar.setBaseStat(TrialByFire.CharacterStats.SPEED, Random.Range(20, 70));
            newChar.setBaseStat(TrialByFire.CharacterStats.STRENGTH, Random.Range(40, 70));
            newChar.setBaseStat(TrialByFire.CharacterStats.SYNC, Random.Range(20, 70));

            //Random name
            int  num1 = Random.Range(0, 26);
            int  num2 = Random.Range(0, 26);
            int  num3 = Random.Range(0, 26);
            char let1 = (char)('a' + num1);
            char let2 = (char)('a' + num2);
            char let3 = (char)('a' + num3);
            newChar.Name = let1.ToString() + let2.ToString() + let3.ToString();
            //Random moves
            for (int j = 0; j < 6; j++)
            {
                newChar.setMove(MoveFactory.generateMove((TrialByFire.MoveList)Random.Range(0, 9)), j);
            }

            squad.setCharacterAtPosition
                (newChar, (TrialByFire.SquadPosition)i);
            actionController.AddCharactersToTurnList(newChar);
        }
        #endregion
    }