Esempio n. 1
0
        public void ForceSetSoulLevel(int inNewLevel)
        {
            int maxSoulLvl = ValueProperty.GetMaxSoulLvl();

            if (inNewLevel > maxSoulLvl)
            {
                inNewLevel = maxSoulLvl;
            }
            if (inNewLevel < 1)
            {
                inNewLevel = 1;
            }
            this.actorSoulLevel = inNewLevel;
            int num = inNewLevel - 1;

            if (num >= 1)
            {
                ResSoulLvlUpInfo resSoulLvlUpInfo = Singleton <BattleLogic> .get_instance().incomeCtrl.QuerySoulLvlUpInfo((uint)num);

                if (resSoulLvlUpInfo != null)
                {
                    this.actorSoulExp = (int)(resSoulLvlUpInfo.dwExp + 1u);
                }
            }
            else
            {
                this.actorSoulExp = 1;
            }
        }
Esempio n. 2
0
 public void AddSoulExp(int addVal, bool bFloatDigit, AddSoulType type)
 {
     if (!Singleton <BattleLogic> .get_instance().m_LevelContext.IsSoulGrow())
     {
         return;
     }
     this.actorSoulExp += addVal;
     while (this.actorSoulExp >= this.actorSoulMaxExp)
     {
         this.actorSoulExp -= this.actorSoulMaxExp;
         int num        = this.actorSoulLevel + 1;
         int maxSoulLvl = ValueProperty.GetMaxSoulLvl();
         if (num > maxSoulLvl)
         {
             this.actorSoulLevel = maxSoulLvl;
             this.actorSoulExp   = this.actorSoulMaxExp;
             break;
         }
         this.actorSoulLevel = num;
         this.ObjValueStatistic.iSoulExpMax = ((this.ObjValueStatistic.iSoulExpMax <= addVal) ? addVal : this.ObjValueStatistic.iSoulExpMax);
     }
     if (bFloatDigit && addVal > 0 && this.actor.Visible && ActorHelper.IsHostCtrlActor(ref this.actorPtr))
     {
         Singleton <CBattleSystem> .GetInstance().CreateBattleFloatDigit(addVal, DIGIT_TYPE.ReceiveSpirit, this.actor.myTransform.position);
     }
     Singleton <EventRouter> .GetInstance().BroadCastEvent <PoolObjHandle <ActorRoot>, int, int, int>("HeroSoulExpChange", this.actorPtr, addVal, this.actorSoulExp, this.actorSoulMaxExp);
 }
Esempio n. 3
0
 private void OnSoulLvlChange(PoolObjHandle <ActorRoot> act, int curSoulLevel)
 {
     if (((curSoulLevel <= ValueProperty.GetMaxSoulLvl()) && (curSoulLevel != 0)) && (act != 0))
     {
         SoulLevelDetail item     = null;
         uint            playerId = act.handle.TheActorMeta.PlayerId;
         bool            flag     = false;
         for (int i = 0; i < this.playerSoulLevelDetail.Count; i++)
         {
             if (this.playerSoulLevelDetail[i].playerId == playerId)
             {
                 flag = true;
                 item = this.playerSoulLevelDetail[i];
                 break;
             }
         }
         if (!flag)
         {
             item = new SoulLevelDetail(playerId);
             this.playerSoulLevelDetail.Add(item);
         }
         if ((curSoulLevel <= ValueProperty.GetMaxSoulLvl()) && (curSoulLevel > 0))
         {
             item.changeTime[curSoulLevel - 1] = (uint)Singleton <FrameSynchr> .instance.LogicFrameTick;
         }
     }
 }
 private void OnSoulLvlChange(PoolObjHandle <ActorRoot> act, int curSoulLevel)
 {
     if (curSoulLevel > ValueProperty.GetMaxSoulLvl() || curSoulLevel == 0)
     {
         return;
     }
     if (act)
     {
         CPlayerSoulLevelStat.SoulLevelDetail soulLevelDetail = null;
         uint playerId = act.handle.TheActorMeta.PlayerId;
         bool flag     = false;
         for (int i = 0; i < this.playerSoulLevelDetail.get_Count(); i++)
         {
             if (this.playerSoulLevelDetail.get_Item(i).playerId == playerId)
             {
                 flag            = true;
                 soulLevelDetail = this.playerSoulLevelDetail.get_Item(i);
                 break;
             }
         }
         if (!flag)
         {
             soulLevelDetail = new CPlayerSoulLevelStat.SoulLevelDetail(playerId);
             this.playerSoulLevelDetail.Add(soulLevelDetail);
         }
         if (curSoulLevel <= ValueProperty.GetMaxSoulLvl() && curSoulLevel > 0)
         {
             soulLevelDetail.changeTime[curSoulLevel - 1] = (uint)Singleton <FrameSynchr> .instance.LogicFrameTick;
         }
     }
 }
Esempio n. 5
0
 public SoulLevelDetail(uint playerId)
 {
     this.playerId   = playerId;
     this.changeTime = new uint[ValueProperty.GetMaxSoulLvl()];
 }
Esempio n. 6
0
 public uint GetPlayerLevelChangedTime(uint playerId, uint soulLevel)
 {
     for (int i = 0; i < this.playerSoulLevelDetail.Count; i++)
     {
         if (((this.playerSoulLevelDetail[i].playerId == playerId) && (soulLevel <= ValueProperty.GetMaxSoulLvl())) && (soulLevel > 0))
         {
             return(this.playerSoulLevelDetail[i].changeTime[(int)((IntPtr)(soulLevel - 1))]);
         }
     }
     return(0);
 }
 public uint GetPlayerLevelChangedTime(uint playerId, uint soulLevel)
 {
     for (int i = 0; i < this.playerSoulLevelDetail.get_Count(); i++)
     {
         if (this.playerSoulLevelDetail.get_Item(i).playerId == playerId && (ulong)soulLevel <= (ulong)((long)ValueProperty.GetMaxSoulLvl()) && soulLevel > 0u)
         {
             return(this.playerSoulLevelDetail.get_Item(i).changeTime[(int)((uint)((UIntPtr)(soulLevel - 1u)))]);
         }
     }
     return(0u);
 }