Exemplo n.º 1
0
 public void SetVitalityToLevel(int level)
 {
     playerLevel              += level - vitality;
     vitality                  = level;
     gm.playerStatus.maxHp     = (float)powerRuleForMaxHp.retrieveValueForLevel(level);
     gm.playerStatus.currentHp = gm.playerStatus.maxHp;
 }
Exemplo n.º 2
0
 public void SetSkillToLevel(int level)
 {
     playerLevel += level - skill;
     skill        = level;
     gm.playerStatus.maxChargeBarValue      = (float)powerRuleForMaxChargeBarValue.retrieveValueForLevel(level);
     gm.playerStatus.chargeCoolDownDuration = (float)powerRuleForChargeCoolDownDuration.retrieveValueForLevel(level) / 1000;
     gm.playerStatus.chargeBarIncreaseRate  = (float)powerRuleForChargeBarIncreaseRate.retrieveValueForLevel(level) / 1000;
     gm.playerStatus.chargeBarDecreaseRate  = (float)powerRuleForChargeBarDecreaseRate.retrieveValueForLevel(level) / 1000;
     gm.playerStatus.shootCoolDownDuration  = (float)powerRuleForShootCoolDownDuration.retrieveValueForLevel(level) / 1000;
 }
Exemplo n.º 3
0
 public void SetStrengthToLevel(int level)
 {
     playerLevel += level - strength;
     strength     = level;
     gm.weaponStatus.bulletDamage       = (float)powerRuleForBulletDamage.retrieveValueForLevel(level);
     gm.weaponStatus.bulletSpeed        = (float)powerRuleForBulletSpeed.retrieveValueForLevel(level) / 100;
     gm.weaponStatus.swordDamage        = (float)powerRuleForSwordDamage.retrieveValueForLevel(level);
     gm.weaponStatus.swordRepelForce    = (float)powerRuleForSwordRepelForce.retrieveValueForLevel(level);
     gm.weaponStatus.chargeBulletDamage = (float)powerRuleForChargeBulletDamage.retrieveValueForLevel(level);
     gm.weaponStatus.chargeBulletSpeed  = (float)powerRuleForChargeBulletSpeed.retrieveValueForLevel(level) / 100;
     gm.weaponStatus.chargeSwordDamage  = (float)powerRuleForChargeSwordDamage.retrieveValueForLevel(level);
     gm.weaponStatus.chargeSwordSpeed   = (float)powerRuleForChargeSwordSpeed.retrieveValueForLevel(level) / 100;
 }
Exemplo n.º 4
0
    void SpawnMiniBoss()
    {
        EnemyTarget playerTarget = GameObject.FindGameObjectWithTag("Player").GetComponent <EnemyTarget>();
        GameObject  newEnemy     = CreateSimpleEnemy(PrefabManager.instance.enemy_tower_builder, playerTarget);

        newEnemy.transform.localScale = new Vector3(2, 2, 1);
        newEnemy.GetComponent <SimpleEnemyController>().maxHp    = powerRuleForMiniBossMaxHp.retrieveValueForLevel(GameManager.instance.wave);
        newEnemy.GetComponent <SimpleEnemyController>().coinDrop = (int)powerRuleForMiniBossCoinDrop.retrieveValueForLevel(GameManager.instance.wave);

        newEnemy.GetComponent <EnemyController>().baseCoolDownTime = newEnemy.GetComponent <EnemyController>().baseCoolDownTime / 2f;
        newEnemy.GetComponent <EnemyController>().baseForce        = powerRuleForMiniBossForce.retrieveValueForLevel(GameManager.instance.wave);
        newEnemy.GetComponent <EnemyController>().Speed            = powerRuleForMiniBossSpeed.retrieveValueForLevel(GameManager.instance.wave);
    }
Exemplo n.º 5
0
    private GameObject CreateSimpleEnemy(GameObject enemyPrefab, EnemyTarget enemyTarget)
    {
        GameObject newEnemy = Instantiate(enemyPrefab);

        newEnemy.GetComponent <EnemyController>().Target = enemyTarget;

        float randX = Random.Range(-horzExtent * 0.8f, +horzExtent * 0.8f);
        float randY = Random.Range(vertExtent, vertExtent + vertExtent / 10);

        newEnemy.transform.position = new Vector3(randX, randY, 0);

        newEnemy.GetComponent <SimpleEnemyController>().healthBarType = PrefabManager.instance.healthBarType.GetComponent <HealthBar>();
        newEnemy.GetComponent <SimpleEnemyController>().maxHp         = powerRuleForEnemyMaxHp.retrieveValueForLevel(GameManager.instance.wave);
        newEnemy.GetComponent <SimpleEnemyController>().coinDrop      = (int)powerRuleForEnemyCoinDrop.retrieveValueForLevel(GameManager.instance.wave);

        newEnemy.GetComponent <EnemyController>().baseForce = powerRuleForEnemyForce.retrieveValueForLevel(GameManager.instance.wave);
        newEnemy.GetComponent <EnemyController>().Speed     = powerRuleForEnemySpeed.retrieveValueForLevel(GameManager.instance.wave);
        return(newEnemy);
    }
Exemplo n.º 6
0
    void StartSpawn()
    {
        spawnCount             = powerRuleForEnemyNumbers.retrieveValueForLevel(GameManager.instance.wave);
        towerBuilderSpawnCount = powerRuleForEnemyBuilderNumbers.retrieveValueForLevel(GameManager.instance.wave);
        currentCount           = spawnCount + towerBuilderSpawnCount;

        isMiniBossSpawned = false;

        MarkTileAsTarget();

        EnemyTarget playerTarget = GameObject.FindGameObjectWithTag("Player").GetComponent <EnemyTarget>();

        for (int i = 0; i < spawnCount; i++)
        {
            CreateSimpleEnemy(PrefabManager.instance.enemy, playerTarget);
        }

        for (int i = 0; i < towerBuilderSpawnCount; i++)
        {
            CreateSimpleEnemy(PrefabManager.instance.enemy_tower_builder, tileTarget);
        }
    }
Exemplo n.º 7
0
 public long GetCoinToLevelUpToLevel(int level)
 {
     return(powerRuleForLevelUpCost.retrieveValueForLevel(level));
 }