Beispiel #1
0
    public void SetInfo()
    {
        level.text = string.Format("LV.{0}", GameConfigs.SkillLevel(skillType));
        cost.text  = GameStatics.GetRequiredShardsForUpgrade(skillType).ToString();
        switch (skillType)
        {
        case GameStatics.SKILL_TYPE.MAXHP:

            int currentHPAmount = PlayerManager.Instance().PlayerStatus.MaxHP;
            expect.text = string.Format("{0} > {1}", currentHPAmount, currentHPAmount + (GameStatics.default_IncHP));

            break;

        case GameStatics.SKILL_TYPE.AIRTIME_DURATION:

            double currentDJCoolAmount = PlayerManager.Instance().PlayerStatus.AirTimeDuration;
            expect.text = string.Format("{0:0.0} > {1:0.0}", currentDJCoolAmount, currentDJCoolAmount + (GameStatics.default_IncAirTimeDuration));

            break;

        case GameStatics.SKILL_TYPE.SHARD_PULL_DIST:

            double currentSPDist = GameStatics.GetShardPullDistance();
            expect.text = string.Format("{0:0.0} > {1:0.0}", currentSPDist, currentSPDist + (GameStatics.default_IncShardsPullDistance));

            break;

        default:
            break;
        }

        SetUpgradeStatus();
    }
Beispiel #2
0
    public static int GetRequiredShardsForUpgrade(SKILL_TYPE skillType)
    {
        int result = int.MaxValue;

        switch (skillType)
        {
        case SKILL_TYPE.MAXHP:
            const int default_IncHPShards = 10;
            result = (GameConfigs.SkillLevel(skillType) + 1) * default_IncHPShards;
            break;

        case SKILL_TYPE.AIRTIME_DURATION:
            const int default_IncCoolShards = 30;
            result = (GameConfigs.SkillLevel(skillType) + 1) * default_IncCoolShards;
            break;

        case SKILL_TYPE.SHARD_PULL_DIST:
            const int default_IncDistShards = 40;
            result = (GameConfigs.SkillLevel(skillType) + 1) * default_IncDistShards;
            break;

        default:
            break;
        }

        return(result);
    }
Beispiel #3
0
    public void SetUpgradeStatus()
    {
        if (GameConfigs.SkillLevel(this.skillType) >= GameConfigs.MAXSkillLevel(this.skillType))
        {
            level.text = "LV.MAX";

            Color tColor = cost.color;
            tColor.a   = 0.4f;
            cost.color = tColor;

            upgradeStatus = GameStatics.UPGRADE_STATUS.MAX_LEVEL;

            switch (this.skillType)
            {
            case GameStatics.SKILL_TYPE.MAXHP:
                expect.text = PlayerManager.Instance().PlayerStatus.MaxHP.ToString();
                break;

            case GameStatics.SKILL_TYPE.AIRTIME_DURATION:
                expect.text = PlayerManager.Instance().PlayerStatus.AirTimeDuration.ToString();
                break;

            case GameStatics.SKILL_TYPE.SHARD_PULL_DIST:
                expect.text = GameStatics.GetShardPullDistance().ToString();
                break;

            default:
                break;
            }
        }
        else if (GameStatics.GetRequiredShardsForUpgrade(skillType) > PlayerManager.Instance().PlayerStatus.CurrentMemoryShards)
        {
            // 조각 부족
            Color tColor = cost.color;
            tColor.a   = 0.4f;
            cost.color = tColor;

            upgradeStatus = GameStatics.UPGRADE_STATUS.NOT_ENOUGH_SHARD;
        }
        else
        {
            // 업그레이드 가능
            Color tColor = cost.color;
            tColor.a   = 1f;
            cost.color = tColor;

            upgradeStatus = GameStatics.UPGRADE_STATUS.POSSIBLE;
        }
    }
Beispiel #4
0
    void OnClickUpgradeButton(SKILL_TYPE skillType)
    {
        // Upgrade Possible
        if ((GetRequiredShardsForUpgrade(skillType) <= PlayerManager.Instance().PlayerStatus.CurrentMemoryShards) &&
            (currentGameUIStatus == TOPUI_STATUS.GAMEOVER))
        {
            int requiredShards = GetRequiredShardsForUpgrade(skillType);

            PlayerManager.Instance().PlayerStatus.CurrentMemoryShards -= requiredShards;
            GameConfigs.SetCurrentMemoryShards(PlayerManager.Instance().PlayerStatus.CurrentMemoryShards);

            GameConfigs.SetSkillLevel(skillType, GameConfigs.SkillLevel(skillType) + 1);

            foreach (UpgradeElement element in upgradeElements)
            {
                element.SetInfo();
            }


            int effectShardAmount = (GameConfigs.SkillLevel(skillType) / 3) + 1;

            if (effectShardAmount < 1)
            {
                effectShardAmount = 1;
            }
            if (effectShardAmount > 10)
            {
                effectShardAmount = 10;
            }

            StageLoader.Instance().Generate_SkillUpgradeEffectShards(skillType, effectShardAmount);

            Vibration.Vibrate(3);
            StartGlobalLightEffect(Color.white, 1f, 0.2f);
            SoundManager.PlayOneShotSound(SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_powerUp], SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_powerUp].clip);

            if (onCameraShake != null)
            {
                onCameraShake(2);
            }
        }
    }
Beispiel #5
0
 public static double GetShardPullDistance()
 {
     return(default_ShardsPullDistance + (default_IncShardsPullDistance * GameConfigs.SkillLevel(GameStatics.SKILL_TYPE.SHARD_PULL_DIST)));
 }