Ejemplo n.º 1
0
        private void UpgradeMainSpeed()
        {
            int needCoin = VirusTool.GetUpgradeCoin(VirusPlayerDataAdapter.GetShootSpeed());

            VirusGameDataAdapter.MinusTotalCoin(needCoin);
            VirusPlayerDataAdapter.AddShootSpeed();
        }
Ejemplo n.º 2
0
        private void UpgradeMainFire()
        {
            int needCoin = VirusTool.GetUpgradeCoin(VirusPlayerDataAdapter.GetShootLevel());

            VirusGameDataAdapter.MinusTotalCoin(needCoin);
            VirusPlayerDataAdapter.AddShootPower(1);
        }
 internal void SubCoin()
 {
     //扣除玩家金币
     VirusGameDataAdapter.MinusTotalCoin(m_NeedCoin);
 }
Ejemplo n.º 4
0
    private void OnUpgradeEnter()
    {
        //这里是对玩家武器进行升级
        bool   isUpdgrade = false;
        string tipStr     = "";

        if (IGamerProfile.Instance == null)
        {
            int coin     = VirusGameDataAdapter.GetTotalCoin();
            int needCoin = VirusTool.GetUpgradeCoin(VirusPlayerDataAdapter.GetWeaponLevel());
            //coin = 50 * needCoin; //testSyq
            while (true)
            {
                if (coin >= needCoin)
                {
                    isUpdgrade = true;
                    int value = VirusPlayerDataAdapter.GetUpgradeValue();
                    //扣除玩家金币
                    VirusGameDataAdapter.MinusTotalCoin(needCoin);
                    //增加武器等级
                    VirusPlayerDataAdapter.AddWeaponLevel();
                    //增加武器伤害
                    VirusPlayerDataAdapter.AddShootPower(value);
                    //增加子弹射速,暂时无用
                    VirusPlayerDataAdapter.AddShootSpeed();

                    bool b1 = VirusPlayerDataAdapter.GetShootNum() <= VirusPlayerDataAdapter.GetMaxShootNum();
                    bool b2 = VirusPlayerDataAdapter.UpgradeShoot();
                    if (b1 && b2)
                    {
                        //增加武器发射的子弹数量
                        VirusPlayerDataAdapter.AddShootNum(1);
                    }

                    coin = VirusGameDataAdapter.GetTotalCoin();
                    //升级需要的金币数
                    needCoin = VirusTool.GetUpgradeCoin(VirusPlayerDataAdapter.GetWeaponLevel());
                }
                else
                {
                    break;
                }
            }

            if (isUpdgrade)
            {
                _uiMrg.CoinPanel.SetCoinText();
                _virusPlayer.Upgrade();
                VirusSoundMrg.Instance.PlaySound(VirusSoundType.UpgradeGun);
                tipStr = "火力升级";
            }
        }
        else
        {
            //对于玩家的武器属性进行配置
            int indexWeapon = (int)UiSceneSelectGameCharacter.CharacterId.MainWeapon;
            //int levelA = IGamerProfile.Instance.playerdata.characterData[indexWeapon].levelA;
            int levelB = IGamerProfile.Instance.playerdata.characterData[indexWeapon].levelB;
        }

        float delayTime = 0.1f;
        //int level = VirusTool.UnlockViceWeapon(VirusGameDataAdapter.GetLevel());
        int level = 0;

        //获取玩家选择的副武器
        if (IGamerProfile.Instance != null)
        {
            level = IGamerProfile.Instance.gameEviroment.characterIndex;
        }
        //level = 8; //testSyq
        if (level > 0)
        {
            if (_virusPlayer.WeaponLevel != level)
            {
                _virusPlayer.WeaponLevel = level;
                //这里是升级副武器的
                delayTime = 0.1f;
                _virusPlayer.InitiViceWeapon(level);
                tipStr = "装备升级";
            }
        }

        if (!string.IsNullOrEmpty(tipStr))
        {
            var tip = EffectPools.Instance.Spawn("FloatTip");
            tip.transform.position   = _virusPlayer.transform.position;
            tip.transform.localScale = new Vector3(1.5f, 1.5f, 1);
            tip.GetComponent <FastlaneFloatTip>().Float(tipStr, () => { EffectPools.Instance.DeSpawn(tip); });
        }

        DOVirtual.DelayedCall(delayTime, _uiMrg.FadeOut).OnComplete(() =>
        {
            _fsm.ChangeState(VirusGameState.GamePlay);
        });
    }
Ejemplo n.º 5
0
 private void UpgradeWeaponFire(int needCoin)
 {
     VirusGameDataAdapter.MinusTotalCoin(needCoin);
 }