Пример #1
0
    //still need to work on
    private void calcType(BaseSkills.PowerTypes powerType, int skillType)
    {
        CalcDerivedOther getModiferOther = new CalcDerivedOther();
        CalcDerivedHP    getModifierHP   = new CalcDerivedHP();
        bool             test            = false;
        byte             tempHolder      = 0;

        //float statModifer = .1f;
        if (powerType == BaseSkills.PowerTypes.NONE)
        {
            Debug.Log("Error based on powerType is " + powerType);
            return;
        }
        else if (powerType == BaseSkills.PowerTypes.AGILITY)
        {
            test = true;
            if (BattleStateMachine.currentUser < BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.players[BattleStateMachine.currentUser].Agility;
            }
            else if (BattleStateMachine.currentUser < BattleStateMachine.npcs.Count + BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.npcs[BattleStateMachine.currentUser - BattleStateMachine.players.Count].Agility;
            }
            else
            {
                tempHolder = BattleStateMachine.monsters[BattleStateMachine.currentUser - 4].Agility;
            }
            modifier = getModiferOther.CalculateDerivedStatByte(tempHolder, 0, StatCalculations.DerivedStatTypes.Speed);
        }
        else if (powerType == BaseSkills.PowerTypes.INTELECT)
        {
            test = true;
            if (BattleStateMachine.currentUser < BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.players[BattleStateMachine.currentUser].Intelect;
            }
            else if (BattleStateMachine.currentUser < BattleStateMachine.npcs.Count + BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.npcs[BattleStateMachine.currentUser - BattleStateMachine.players.Count].Intelect;
            }
            else
            {
                tempHolder = BattleStateMachine.monsters[BattleStateMachine.currentUser - 4].Intelect;
            }
            modifier = getModiferOther.CalculateDerivedStatByte(tempHolder, 0, StatCalculations.DerivedStatTypes.MagicPower);
        }
        else if (powerType == BaseSkills.PowerTypes.SPIRIT)
        {
            test = true;
            if (BattleStateMachine.currentUser < BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.players[BattleStateMachine.currentUser].Spirit;
            }
            else if (BattleStateMachine.currentUser < BattleStateMachine.npcs.Count + BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.npcs[BattleStateMachine.currentUser - BattleStateMachine.players.Count].Spirit;
            }
            else
            {
                tempHolder = BattleStateMachine.monsters[BattleStateMachine.currentUser - 4].Spirit;
            }
            modifier = getModiferOther.CalculateDerivedStatByte(tempHolder, 0, StatCalculations.DerivedStatTypes.MagDmgNeg);
        }
        else if (powerType == BaseSkills.PowerTypes.STAMINA)
        {
            test = true;
            if (BattleStateMachine.currentUser < BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.players[BattleStateMachine.currentUser].Stamina;
            }
            else if (BattleStateMachine.currentUser < BattleStateMachine.npcs.Count + BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.npcs[BattleStateMachine.currentUser - BattleStateMachine.players.Count].Stamina;
            }
            else
            {
                tempHolder = BattleStateMachine.monsters[BattleStateMachine.currentUser - 4].Stamina;
            }
            modifier = getModifierHP.CalculateDerivedStatUshort(tempHolder, 0, StatCalculations.DerivedStatTypes.HealthPoints);
        }
        else if (powerType == BaseSkills.PowerTypes.VITALITY)
        {
            test = true;
            if (BattleStateMachine.currentUser < BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.players[BattleStateMachine.currentUser].Vitality;
            }
            else if (BattleStateMachine.currentUser < BattleStateMachine.npcs.Count + BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.npcs[BattleStateMachine.currentUser - BattleStateMachine.players.Count].Vitality;
            }
            else
            {
                tempHolder = BattleStateMachine.monsters[BattleStateMachine.currentUser - 4].Vitality;
            }
            modifier = getModiferOther.CalculateDerivedStatByte(tempHolder, 0, StatCalculations.DerivedStatTypes.PhyDmgNeg);
        }
        else if (powerType == BaseSkills.PowerTypes.STRENGTH)
        {
            test = true;
            if (BattleStateMachine.currentUser < BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.players[BattleStateMachine.currentUser].Strength;
            }
            else if (BattleStateMachine.currentUser < BattleStateMachine.npcs.Count + BattleStateMachine.players.Count)
            {
                tempHolder = BattleStateMachine.npcs[BattleStateMachine.currentUser - BattleStateMachine.players.Count].Strength;
            }
            else
            {
                tempHolder = BattleStateMachine.monsters[BattleStateMachine.currentUser - 4].Strength;
            }
            modifier = getModiferOther.CalculateDerivedStatByte(tempHolder, 0, StatCalculations.DerivedStatTypes.AttackPower);
        }
        if (test)
        {
            return;
        }
        else if (powerType == BaseSkills.PowerTypes.POWERPOINTS)  //not ready yet
        {
            modifier = skillType * GameInformation.Strength * GameInformation.Intelect;
        }
        else if (powerType == BaseSkills.PowerTypes.MANA)
        {
            modifier = skillType * GameInformation.Intelect;
        }
    }