Beispiel #1
0
    public float GetUnitUpgrades(UnitType unit, BonusType sType)
    {
        BonusSubject mySubject = (BonusSubject)(-1);
        BonusType    myType    = sType;

        switch (unit)
        {
        case UnitType.Swordsman:
            mySubject = BonusSubject.Melee;
            break;

        case UnitType.Archer:
            mySubject = BonusSubject.Ranged;
            break;

        case UnitType.Mage:
            mySubject = BonusSubject.Special;
            break;
        }
        if (mySubject != (BonusSubject)(-1))
        {
            return(GetBonus(mySubject, myType));
        }
        else
        {
            return(1.0f);
        }
    }
    public void SetTab(GameObject CurTab, GameObject TabButtons, BonusSubject curSub)
    {
        mCurrentTab.renderer.sortingOrder = 1;
        mCurrentTabButtons.SetActive(false);

        mCurrentTab	= CurTab;
        mCurrentTabButtons = TabButtons;

        mCurrentTab.renderer.sortingOrder = 10;
        mCurrentTabButtons.SetActive(true);

        mStore.mCurBonusSubject = curSub;
    }
Beispiel #3
0
    public void SetTab(GameObject CurTab, GameObject TabButtons, BonusSubject curSub)
    {
        mCurrentTab.renderer.sortingOrder = 1;
        mCurrentTabButtons.SetActive(false);

        mCurrentTab        = CurTab;
        mCurrentTabButtons = TabButtons;

        mCurrentTab.renderer.sortingOrder = 10;
        mCurrentTabButtons.SetActive(true);

        mStore.mCurBonusSubject = curSub;
    }
    public float GetBonus(BonusSubject subject, BonusType bonus)
    {
        float bonusLevel = mBonusArray[(int)subject ,(int) bonus];

        //spawn size needs to return a whole number
        if(bonus == BonusType.SpawnSize)
            return bonusLevel;

        //no bonuses purchases
        if(bonusLevel <= 0)
            return 1.0f;
        //max bonuses cap
        if(bonusLevel >= 5)
           return 2.0f;

        //each level represents 20%
        return 1 + bonusLevel * mBonusMagnitude;
    }
Beispiel #5
0
    public float GetBonus(BonusSubject subject, BonusType bonus)
    {
        float bonusLevel = mBonusArray[(int)subject, (int)bonus];

        //spawn size needs to return a whole number
        if (bonus == BonusType.SpawnSize)
        {
            return(bonusLevel);
        }

        //no bonuses purchases
        if (bonusLevel <= 0)
        {
            return(1.0f);
        }
        //max bonuses cap
        if (bonusLevel >= 5)
        {
            return(2.0f);
        }

        //each level represents 20%
        return(1 + bonusLevel * mBonusMagnitude);
    }
Beispiel #6
0
 public void SetBonus(BonusSubject subject, BonusType bonus, int value)
 {
     mBonusArray[(int)subject, (int)bonus] = value;
 }
 public void SetBonus(BonusSubject subject, BonusType bonus, int value)
 {
     mBonusArray[(int)subject ,(int) bonus] = value;
 }
Beispiel #8
0
 public int GetOringalValue(BonusSubject sub, BonusType typ)
 {
     return(OriginalUpgrades[(int)sub, (int)typ]);
 }
Beispiel #9
0
 public void SetUpgrade(BonusSubject curSub, BonusType curType, int curValue)
 {
     DynamicUpgrades[(int)curSub, (int)curType] = curValue;
     //mCurUpgrades.SetBonus(mCurBonusSubject, mCurBonusType, mCurQuantity);
 }
Beispiel #10
0
 public int GetUpgrade(BonusSubject curSub, BonusType curType)
 {
     return(DynamicUpgrades[(int)curSub, (int)curType]);
 }
 public void SetUpgrade(BonusSubject curSub, BonusType curType, int curValue )
 {
     DynamicUpgrades[(int)curSub, (int)curType] = curValue;
     //mCurUpgrades.SetBonus(mCurBonusSubject, mCurBonusType, mCurQuantity);
 }
 public int GetUpgrade(BonusSubject curSub, BonusType curType)
 {
     return DynamicUpgrades[(int)curSub, (int)curType];
 }
 public int GetOringalValue(BonusSubject sub, BonusType typ)
 {
     return OriginalUpgrades[(int)sub, (int)typ];
 }