Exemple #1
0
        private void UpdateSourceData()
        {
            Units player = PlayerControlMgr.Instance.GetPlayer();

            if (player == null)
            {
                return;
            }
            if (LevelManager.Instance.IsPvpBattleType)
            {
                int unique_id = player.unique_id;
                PvpStatisticMgr.HeroData heroData = Singleton <PvpManager> .Instance.StatisticMgr.GetHeroData(unique_id);

                this._data.heroKill    = heroData.HeroKill;
                this._data.monsterKill = heroData.MonsterKill;
                this._data.assist      = heroData.Assist;
                this._data.death       = heroData.Death;
                this._data.firstKill   = heroData.FirstKill;
            }
            else
            {
                AchieveData achieveData = GameManager.Instance.AchieveManager.GetAchieveData(player.unique_id, player.teamType);
                if (achieveData != null)
                {
                    this._data.heroKill    = achieveData.TotalKill;
                    this._data.monsterKill = achieveData.MonsterKillNum;
                    this._data.assist      = player.assistantNum;
                    this._data.death       = achieveData.SelfDeathTime;
                }
            }
        }
        private void ShowHeroTargetInfo(Units hero)
        {
            this.SetOtherIndicatorActive(false);
            this.SetHeroIndicatorActive(true);
            if (this.heroName != hero.name)
            {
                this.heroName = hero.name;
                SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(hero.npc_id);
                if (heroMainData != null)
                {
                    this.heroIcon.spriteName = heroMainData.avatar_icon;
                }
            }
            PvpStatisticMgr.HeroData heroData = Singleton <PvpManager> .Instance.StatisticMgr.GetHeroData(hero.unique_id);

            string text  = heroData.MonsterKill.ToString();
            string text2 = string.Concat(new object[]
            {
                heroData.HeroKill,
                "/",
                heroData.Death,
                "/",
                heroData.Assist
            });
            int num = text.Length + text2.Length;

            for (int i = 0; i < 12 - num; i++)
            {
                text += " ";
            }
            this.heroKillInfo.text = text + text2;
            this._heroTarget.SetTarget(hero);
        }
Exemple #3
0
    public int GetGoldById(int uid)
    {
        if (Singleton <PvpManager> .Instance.IsInPvp)
        {
            PvpStatisticMgr.HeroData heroData = Singleton <PvpManager> .Instance.StatisticMgr.GetHeroData(uid);

            if (heroData != null)
            {
                return(heroData.CurGold);
            }
            return(0);
        }
        else
        {
            GoldCounter goldCounter = this.GetCounter(UtilType.Gold) as GoldCounter;
            if (goldCounter == null)
            {
                return(0);
            }
            GoldValue goldValue = goldCounter.GetValue(uid) as GoldValue;
            if (goldValue == null)
            {
                return(0);
            }
            return(goldValue.CurrentGold);
        }
    }
Exemple #4
0
    public float GetHeroExpRatio(int uid)
    {
        float result = 0f;

        if (Singleton <PvpManager> .Instance.IsInPvp)
        {
            PvpStatisticMgr.HeroData heroData = Singleton <PvpManager> .Instance.StatisticMgr.GetHeroData(uid);

            if (heroData != null)
            {
                int exp2LevelUp = UtilExpData.Instance.GetExp2LevelUp(heroData.CurLv);
                if (exp2LevelUp == -1)
                {
                    result = 1f;
                }
                else
                {
                    result = (float)heroData.CurExp / (float)exp2LevelUp;
                }
            }
        }
        else
        {
            ExpCounter expCounter = this.GetCounter(UtilType.Exp) as ExpCounter;
            if (expCounter != null)
            {
                ExpValue expValue = expCounter.GetValue(uid) as ExpValue;
                if (expValue != null)
                {
                    result = expValue.RicherExpRatio;
                }
            }
        }
        return(result);
    }
Exemple #5
0
    public int GetHerolv(int uid)
    {
        int result = 1;

        if (Singleton <PvpManager> .Instance.IsInPvp)
        {
            PvpStatisticMgr.HeroData heroData = Singleton <PvpManager> .Instance.StatisticMgr.GetHeroData(uid);

            if (heroData != null)
            {
                result = heroData.CurLv;
            }
        }
        else
        {
            ExpCounter expCounter = this.GetCounter(UtilType.Exp) as ExpCounter;
            if (expCounter != null)
            {
                ExpValue expValue = expCounter.GetValue(uid) as ExpValue;
                if (expValue != null)
                {
                    result = expValue.CurLv;
                }
            }
        }
        return(result);
    }
    private void RefreshStats()
    {
        PvpStatisticMgr.HeroData heroData = Singleton <PvpManager> .Instance.StatisticMgr.GetHeroData(this.UniqueId);

        this.KillText.text  = string.Format("{0}/{1}/{2}", heroData.HeroKill, heroData.Death, heroData.Assist);
        this.DeathText.text = heroData.MonsterKill.ToString();
        this.GoldText.text  = heroData.CurGold.ToString();
        if (!this._hero.isLive)
        {
            this.OnHeroDead();
        }
    }
Exemple #7
0
        private bool TryTriggerFirOverMoney()
        {
            if (this._isTriggerFirOverMoney)
            {
                return(false);
            }
            if (Time.time - this._lastCheckFirOverMoneyTime > this._checkFirOverMoneyTimeLen)
            {
                this._lastCheckFirOverMoneyTime = Time.time;
                if (this.CachedPlayerHero != null && Singleton <PvpManager> .Instance.StatisticMgr != null)
                {
                    this._playerHeroData = Singleton <PvpManager> .Instance.StatisticMgr.GetHeroData(this.CachedPlayerHero.unique_id);

                    if (this._playerHeroData != null && this._playerHeroData.CurGold > 1000)
                    {
                        NewbieManager.Instance.MoveCertainStep(ENewbieStepType.EleBatFive_FirOverMoney, false, ENewbieStepType.None);
                        this._isTriggerFirOverMoney = true;
                        return(true);
                    }
                }
            }
            return(false);
        }