Esempio n. 1
0
    private DamageInfo estimateDamage(List <TowerStructure> towerList)
    {
        DamageInfo retVal = new DamageInfo();

        foreach (TowerStructure t in towerList)
        {
            retVal.Add(t.dmg.Multiply(t.attackspeed));
        }
        return(retVal);
    }
Esempio n. 2
0
    public static DamageInfo GetAllDmgAtPosition(Vector3 pos)
    {
        BaseTower[] allTower = FindObjectsOfType <BaseTower>();
        DamageInfo  retDmg   = new DamageInfo();

        foreach (BaseTower t in allTower)
        {
            retDmg.Add(t.GetDmgAtPosition(pos));
        }
        return(retDmg);
    }
Esempio n. 3
0
    internal DamageInfo GetCurrentTowerDmg()
    {
        DamageInfo       myDmg   = new DamageInfo();
        List <BaseTower> turrets = new List <BaseTower>();

        turrets.AddRange(GetComponentsInChildren <BaseTower>());
        foreach (BaseTower t in turrets)
        {
            myDmg.Add(t.turretDmg);
        }
        return(myDmg);
    }
Esempio n. 4
0
 public void CmdUpgrade()
 {
     Debug.Log("Command Upgrade!");
     if (GetComponentInParent <PlayerController>().Gold >= upgradeCost)
     {
         GetComponentInParent <PlayerController>().Gold -= upgradeCost;
         if (level == 1)
         {
             baseDmg.Set(turretDmg.normal / 2, turretDmg.fire / 2, turretDmg.water / 2, turretDmg.nature / 2);
         }
         if (level < 10)
         {
             level++;
             turretDmg.Add(baseDmg);
             range    *= 1.01f;
             cooldown *= 0.99f;
         }
     }
 }