示例#1
0
    // Awake is called when game boots up.
    //  Pre: pkmnSpecies string must be filled out and found within the baseStatInv in the static BaseStats class
    void Awake()
    {
        if (fighterName == null || level <= 0 || level > 100)
        {
            throw new System.Exception("Error: Parameters for PKMNEntity not filled out appropriately");
        }

        statChangeQ      = new SE_PriorityQueue(this);              //Establish stat priority queue
        curStats         = new float[BaseStat.BASE_STATS_LENGTH];   //Establish curStats
        statUpgradesUsed = new int[BaseStat.BASE_STATS_LENGTH];
        controller       = (transform.parent != null) ? transform.parent.GetComponent <Controller>() : GetComponent <Controller>();
        soundFXs         = GetComponent <AudioSource>();

        shieldDamageMult = BASE_SHIELD_DAMAGE_MULT;
        restoreCurStats();
        armor = baseArmor;
        curStats[BaseStat.HEALTH] = baseStats[BaseStat.HEALTH];
        //Establish stats for character
        moves = new List <IMove>();

        //Adds move to the list
        for (int i = 0; i < moveList.Length; i++)
        {
            IMove curMove = BaseStat.moveInv(moveList[i], GetComponent <Animator>(), this, progress);

            if (curMove != null)
            {
                moves.Add(curMove);
            }
        }

        maxExp       = BASE_MAX_EXP;
        curExp       = 0f;
        aTimer       = 0.0f;
        hTimer       = 0.0f;
        assistStatus = false;
        dead         = false;

        //numOpenStatBoosts = 6;
    }