예제 #1
0
    public void UpdateTheStats()
    {
        Debug.Log("updatestats");
        float tempShotDamage = 0f;
        float tempShotArc    = 0f;
        float tempShotRange  = 0f;
        float tempShotSpeed  = 0f;
        float tempMoveSpeed  = 0f;
        float tempBarSize    = 0f;
        float tempShotVamp   = 0f;
        int   tempNumPickups = 0;
        int   tempNumShots   = 0;

        foreach (GameObject upgrade in currentUpgrades)
        {
            UpgradeStats stats = upgrade.GetComponent <UpgradeStats>();
            tempMoveSpeed  += stats.moveSpeedBonus;
            tempShotDamage += stats.shotDamageBonus;
            tempShotSpeed  += stats.shotSpeedBonus;
            tempShotArc    += stats.shotArcBonus;
            tempShotRange  += stats.shotRangeBonus;
            tempBarSize    += stats.barSizeBonus;
            tempNumShots   += stats.numShotsBonus;
            tempNumPickups += stats.numPickupsBonus;
        }

        currentMoveSpeed  = tempMoveSpeed + startMoveSpeed;
        currentShotDamage = tempShotDamage + startShotDamage;
        currentShotSpeed  = tempShotSpeed + startShotSpeed;
        currentShotArc    = tempShotArc + startShotArc;
        currentShotRange  = tempShotRange + startShotRange;
        currentBarSize    = tempBarSize + startBarSize;
        currentNumShots   = tempNumShots + startNumShots;
        currentNumPickups = tempNumPickups + startNumPickups;
    }
예제 #2
0
 public void Attacked(UpgradeStats stats, BaseBullet.damageTypes damageType)
 {
     TakeDamage(stats.damage, damageType);
     EffectCheck(stats);
     Armor += stats.armorReduce;
     HPReg += stats.hpRegReduce;
 }
예제 #3
0
    public static void InstanceBullet(Transform spawnTransform, float speed, GameObject prefab, movementPaten movement = movementPaten.line)
    {
        if (inActiveBullets == null)
        {
            inActiveBullets = new Dictionary <string, Queue <GameObject> >();
        }

        BulletScript bulletStats;

        if (inActiveBullets.Count == 0)
        {
            GameObject bullet = Instantiate(prefab, spawnTransform.position, spawnTransform.rotation);
            bulletStats = bullet.AddComponent <BulletScript>();
        }
        else
        {
            bulletStats = inActiveBullets[prefab.ToString()].Dequeue().GetComponent <BulletScript>();
        }
        UpgradeStats stat = new UpgradeStats();

        stat.damage                   = 5;
        bulletStats.prefabName        = prefab.ToString();
        bulletStats.setStats          = stat;
        bulletStats.damageType        = BaseBullet.damageTypes.medium;
        bulletStats.setMovementPatern = movementPaten.line;
        bulletStats.speed             = speed;
    }
예제 #4
0
    protected float GetCurrentStatInfo(UpgradeStats upgrades)
    {
        // Gets the coresponding player stat
        switch (upgrades)
        {
        default:
        case UpgradeStats.ArmourUpgrade:
            return(playerStats.GetPlayerDefence());

        case UpgradeStats.HealthUpgrade:
            return(playerStats.GetPlayerMaxHealth());

        case UpgradeStats.AgilityUpgrade:
            return(playerStats.GetPlayerMovementSpeed());

        case UpgradeStats.JumpingUpgrade:
            return(playerStats.GetPlayerNumberOfJumps());

        case UpgradeStats.WeaponUpgrade:
            return(playerStats.GetPlayerDamage());

        case UpgradeStats.RangedUpgrade:
            return(playerStats.GetPlayerRangedDamage());
        }
    }
예제 #5
0
 public void setStat(UpgradeStat stat, UpgradeStatContainer stats)
 {
     this.stat    = stat;
     abilityStats = stats;
     //update to current value
     Slider.sliderValue = abilityStats.Data[stat] / 10f;
     NameLabel.text     = (UpgradeStats.getUpgradeName(stat)).ToUpper();
 }
예제 #6
0
    public UpgradeStats GetUpgradeStats()
    {
        UpgradeStats stats = new UpgradeStats();

        stats.SetStandartStats(range, duration, damage, attackRate, projectileSpeed);
        stats.SetEffectStats(slow, DOT, splash, leech, curse, armorReduce, hpRegReduce);
        return(stats);
    }
예제 #7
0
    protected override void SetStats(int val)
    {
        if (val >= UpgradeLevels.Length)
        {
            return;
        }

        UpgradeStats upgStats = UpgradeLevels[val];

        this.stats       = new AttackStats(upgStats.velocity, upgStats.damage, upgStats.damagePerSecond, upgStats.damageDuration, upgStats.slowDuration, upgStats.slow, stunDuration, upgStats.radius, this.gameObject);
        this.range       = upgStats.range;
        this.attackSpeed = upgStats.attackSpeed;
        this.targetCount = upgStats.targetCount;
    }
예제 #8
0
    protected override void SetStats(int val)
    {
        if (val >= UpgradeLevels.Length)
        {
            return;
        }

        UpgradeStats upgStats = UpgradeLevels[val];

        this.stats       = new AttackStats(0, upgStats.damage, upgStats.damagePerSecond, upgStats.damageDuration, upgStats.slowDuration, upgStats.slow, stunDuration, 0, this.gameObject);
        this.range       = upgStats.range;
        this.attackSpeed = upgStats.attackSpeed;
        hitAnimationObject.transform.parent.localScale = Vector3.one * upgStats.range;
    }
예제 #9
0
            public float CalculateUpgradedStat(byte stat, byte level, byte health = 0xFF)
            {
                byte  s  = Helper.Clamp(stat, (byte)0, (byte)14);
                float bs = stats[s];

                if (Upgrade.MapFromStat.ContainsKey(s))
                {
                    UpgradeStats u = Upgrade.Stats[Upgrade.MapFromStat[s]];
                    return(u.CalculateStat(bs, level, health));
                }
                else
                {
                    return(bs);
                }
            }
예제 #10
0
 public void PlusTwoUpgradeStats(UpgradeStats stats)
 {
     range           += stats.range;
     duration        += stats.duration;
     damage          += stats.damage;
     attackRate      += stats.attackRate;
     projectileSpeed += stats.projectileSpeed;
     slow            += stats.slow;
     DOT             += stats.DOT;
     splash          += stats.splash;
     leech           += stats.leech;
     curse           += stats.curse;
     armorReduce     += stats.armorReduce;
     hpRegReduce     += stats.hpRegReduce;
 }
예제 #11
0
    public void BuyUpgrade(int upgradeType)
    {
        int upgradeCurrentLevel = 0;

        switch (upgradeType)
        {
        case 0:
            upgradeCurrentLevel = clickLevel;
            clickLevel++;
            break;

        case 1:
            upgradeCurrentLevel = amountLevel;
            amountLevel++;
            break;

        case 2:
            upgradeCurrentLevel = rateLevel;
            rateLevel++;
            break;

        default:
            break;
        }

        if (upgradeCurrentLevel < 4 && ScoreAmount.Score >= UpgradePrices.GetPrice(upgradeCurrentLevel))
        {
            scoreManager.ChangeScore(-UpgradePrices.GetPrice(upgradeCurrentLevel));
            switch (upgradeType)
            {
            case 0:
                UpgradeStats.UpgradeClickPower();
                break;

            case 1:
                UpgradeStats.UpgradeAmount();
                break;

            case 2:
                UpgradeStats.UpgradeRate();
                break;

            default:
                break;
            }
        }
        UpdatePrices();
    }
예제 #12
0
    private void Start()
    {
        SaveData saveData = SaveSystem.LoadData();

        if (saveData != null)
        {
            Coins = saveData.coins;
            Keys  = saveData.keys;
            TopBar.UpdateCoins(current._coins);
            TopBar.UpdateKeys(current._keys);
            UpgradeStats.LoadStats(saveData);
            FightStage.bossHealthLeft       = saveData.bossHealthLeft;
            FightStage.defendersLeft        = saveData.defendersLeft;
            CollectableObjectContainer.keys = saveData.collectedKeys;
        }
    }
예제 #13
0
 // Use this for initialization
 void Awake()
 {
     upgrade = this;
     _hero = PlayerPrefs.GetInt("Hero");
     switch (_hero)
     {
         case 0:
             break;
         case 1:
             break;
         case 2:
             health = SpartanStatistics.control._health;
             armor = SpartanStatistics.control._armor;
             energy = SpartanStatistics.control._energy;
             spearAmount = SpartanStatistics.control._spearAmount;
             currency = SpartanStatistics.control._currency;
             break;
         case 3:
             break;
     }
 }
예제 #14
0
 private void EffectCheck(UpgradeStats stats)
 {
     if (stats.duration > 0)
     {
         if (stats.slow > 0 && stats.slow < slowAmount)
         {
             StopCoroutine("SlowTimer");
             StartCoroutine(SlowTimer(stats.duration, stats.slow));
         }
         if (stats.DOT > 0 && stats.DOT > dotAmount)
         {
             StopCoroutine("DamageOverTime");
             StartCoroutine(DamageOverTime(stats.duration, stats.DOT));
         }
         if (stats.curse > 0 && stats.curse > curseAmount)
         {
             StopCoroutine("CurseDuration");
             StartCoroutine(CurseDuration(stats.duration, stats.DOT));
         }
     }
 }
예제 #15
0
 public void SetBaseBullet(UpgradeStats stats, Transform target, damageTypes bulletDamageType)
 {
     this.stats   = stats;
     this.target  = target;
     myDamageType = bulletDamageType;
 }
예제 #16
0
 public void SetBullet(UpgradeStats stats, float rotaionspeed, Transform target, damageTypes myDamageType)
 {
     this.rotationspeed = rotaionspeed;
     SetBaseBullet(stats, target, myDamageType);
 }
예제 #17
0
 public void UpdateRange(UpgradeStats stat)
 {
     collider.height = stat.range * 3;
     collider.radius = stat.range * 2;
 }