コード例 #1
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static float GetPerkDamageReductionBonus(int prefabID)
    {
        float total = 0;  int statID = (int)_PerkTypeTB.BonusDamageReduc;

        UnitStatModifier uStats = GetSpecificUnitStat(prefabID);

        total += uStats.unit.damageReduc * uStats.stats[statID].mod + uStats.stats[statID].value;
        total += uStats.unit.damageReduc * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        return(total);
    }
コード例 #2
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static int GetPerkMoveAPReductionBonus(int prefabID)
    {
        float total = 0;  int statID = (int)_PerkTypeTB.APMoveReduc;

        UnitStatModifier uStats = GetSpecificUnitStat(prefabID);

        total -= uStats.unit.APCostMove * uStats.stats[statID].mod + uStats.stats[statID].value;
        total -= uStats.unit.APCostMove * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        return((int)total);
    }
コード例 #3
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static float GetPerkDefendBonus(int prefabID)
    {
        float total = 0;  int statID = (int)_PerkTypeTB.BonusDodge;

        UnitStatModifier uStats = GetSpecificUnitStat(prefabID);

        total += uStats.unit.defend * uStats.stats[statID].mod + uStats.stats[statID].value;
        total += uStats.unit.defend * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        return(total);
    }
コード例 #4
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static float GetPerkCritImmuneBonus(int prefabID)
    {
        float total = 0;  int statID = (int)_PerkTypeTB.BonusCritImmune;

        UnitStatModifier uStats = GetSpecificUnitStat(prefabID);

        total += uStats.unit.critDef * uStats.stats[statID].mod + uStats.stats[statID].value;
        total += uStats.unit.critDef * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        return(total);
    }
コード例 #5
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static float GetPerkMeleeAttackBonus(int prefabID)
    {
        float total = 0;  int statID = (int)_PerkTypeTB.BonusHitMelee;

        UnitStatModifier uStats = GetSpecificUnitStat(prefabID);

        total += uStats.unit.attMelee * uStats.stats[statID].mod + uStats.stats[statID].value;
        total += uStats.unit.attMelee * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        return(total);
    }
コード例 #6
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static int GetPerkCounterCountBonus(int prefabID)
    {
        float total = 0;  int statID = (int)_PerkTypeTB.BonusCounter;

        UnitStatModifier uStats = GetSpecificUnitStat(prefabID);

        total += uStats.unit.counterPerTurn * uStats.stats[statID].mod + uStats.stats[statID].value;
        total += uStats.unit.counterPerTurn * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        return((int)total);
    }
コード例 #7
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static int GetPerkAttackRangeBonus(int prefabID)
    {
        float total = 0;  int statID = (int)_PerkTypeTB.BonusAttackRange;

        UnitStatModifier uStats = GetSpecificUnitStat(prefabID);

        total += uStats.unit.attackRangeMax * uStats.stats[statID].mod + uStats.stats[statID].value;
        total += uStats.unit.attackRangeMax * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        return((int)total);
    }
コード例 #8
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static int GetPerkAPRegenBonus(int prefabID)
    {
        float total = 0;  int statID = (int)_PerkTypeTB.BonusAPRegen;

        UnitStatModifier uStats = GetSpecificUnitStat(prefabID);

        total += (.5f * (uStats.unit.APGainMin + uStats.unit.APGainMax)) * uStats.stats[statID].mod + uStats.stats[statID].value;
        total += (.5f * (uStats.unit.APGainMin + uStats.unit.APGainMax)) * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        return((int)total);
    }
コード例 #9
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static int GetPerkMaxMeleeDamageBonus(int prefabID)
    {
        float total = 0;  int statID = (int)_PerkTypeTB.BonusDamageMax;

        UnitStatModifier uStats = GetSpecificUnitStat(prefabID);

        total += uStats.unit.meleeDamageMax * uStats.stats[statID].mod + uStats.stats[statID].value;
        total += uStats.unit.meleeDamageMax * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        statID = (int)_PerkTypeTB.BonusMeleeDamageMax;
        uStats = GetSpecificUnitStat(prefabID);
        total += uStats.unit.meleeDamageMax * uStats.stats[statID].mod + uStats.stats[statID].value;
        total += uStats.unit.meleeDamageMax * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        return((int)total);
    }
コード例 #10
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static int GetPerkRangeDamageBonus(int prefabID, int dmg)
    {
        float total = 0;  int statID = (int)_PerkTypeTB.BonusDamage;

        UnitStatModifier uStats = GetSpecificUnitStat(prefabID);

        total += dmg * uStats.stats[statID].mod + uStats.stats[statID].value;
        total += dmg * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        statID = (int)_PerkTypeTB.BonusRangeDamage;
        uStats = GetSpecificUnitStat(prefabID);
        total += dmg * uStats.stats[statID].mod + uStats.stats[statID].value;
        total += dmg * globalUnitStats.stats[statID].mod + globalUnitStats.stats[statID].value;

        return((int)total);
    }
コード例 #11
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static void LoadUnit()
    {
        GameObject obj = Resources.Load("PrefabList/UnitListPrefab", typeof(GameObject)) as GameObject;

        if (obj == null)
        {
            Debug.Log("load unit fail, make sure the resource file exists");
            return;
        }

        UnitListPrefab prefab = obj.GetComponent <UnitListPrefab>();

        unitList = prefab.unitList;

        for (int i = 0; i < unitList.Count; i++)
        {
            unitStats.Add(new UnitStatModifier(unitList[i]));
        }

        globalUnitStats = new UnitStatModifier(null);
    }
コード例 #12
0
ファイル: PerkManagerTB.cs プロジェクト: phelow/FallOfTheTzar
    public static void LoadUnit()
    {
        GameObject obj=Resources.Load("PrefabList/UnitListPrefab", typeof(GameObject)) as GameObject;
        if(obj==null){
            Debug.Log("load unit fail, make sure the resource file exists");
            return;
        }

        UnitListPrefab prefab=obj.GetComponent<UnitListPrefab>();
        unitList=prefab.unitList;

        for(int i=0; i<unitList.Count; i++){
            unitStats.Add(new UnitStatModifier(unitList[i]));
        }

        globalUnitStats=new UnitStatModifier(null);
    }