Пример #1
0
 public PlayerStastics()
 {
     this.screenRotateTimes = 0;
     this.stageTime         = 0f;
     this.screenRotateTimes = 0;
     this.stageTime         = 0f;
 }
Пример #2
0
 public PlayerStastics(float levelTime, int screenRotateTimes)
 {
     this.screenRotateTimes = 0;
     this.stageTime         = 0f;
     this.stageTime         = levelTime;
     this.screenRotateTimes = screenRotateTimes;
 }
Пример #3
0
 private bool ListenSkillStart(EvtSkillStart evt)
 {
     if (this.isUpdating && (Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.targetID) == 3))
     {
         AvatarStastics avatarStastics = this.GetAvatarStastics(evt.targetID);
         if (avatarStastics == null)
         {
             return(true);
         }
         if (evt.skillID == "SKL01")
         {
             avatarStastics.avatarSkill01Times     = SafeInt32.op_Increment(avatarStastics.avatarSkill01Times);
             avatarStastics.avatarEvadeEffectTimes = SafeInt32.op_Increment(avatarStastics.avatarEvadeEffectTimes);
             this.avatarSkill01Times++;
         }
         else if (evt.skillID == "SKL02")
         {
             avatarStastics.avatarSkill02Times = SafeInt32.op_Increment(avatarStastics.avatarSkill02Times);
             this.avatarSkill02Times++;
         }
         else if (evt.skillID == "SKL_WEAPON")
         {
             avatarStastics.avatarActiveWeaponSkillTimes = SafeInt32.op_Increment(avatarStastics.avatarActiveWeaponSkillTimes);
             this.avatarActiveWeaponSkillTimes++;
         }
     }
     return(true);
 }
Пример #4
0
 public void AddScreenRotateTimes()
 {
     this.screenRotateTimes++;
     if (this.isStageCreated && (this._playerStastics != null))
     {
         this._playerStastics.screenRotateTimes = SafeInt32.op_Increment(this._playerStastics.screenRotateTimes);
     }
 }
Пример #5
0
        public static void UpdateField(ref SafeInt32 field, int newValue, Action <int, int> updateDelegate)
        {
            int num = field.Value;

            field.Value = newValue;
            if (updateDelegate != null)
            {
                updateDelegate(num, newValue);
            }
        }
Пример #6
0
 private bool ListenEvadeStart(EvtEvadeStart evt)
 {
     if (this.isUpdating)
     {
         AvatarStastics avatarStastics = this.GetAvatarStastics(evt.targetID);
         if (avatarStastics != null)
         {
             avatarStastics.avatarEvadeTimes = SafeInt32.op_Increment(avatarStastics.avatarEvadeTimes);
         }
     }
     return(true);
 }
Пример #7
0
 private bool ListenDefendSuccess(EvtDefendSuccess evt)
 {
     if (this.isUpdating)
     {
         AvatarStastics avatarStastics = this.GetAvatarStastics(evt.targetID);
         if (avatarStastics != null)
         {
             avatarStastics.avatarEvadeSuccessTimes = SafeInt32.op_Increment(avatarStastics.avatarEvadeSuccessTimes);
         }
         this.evadeSuccessTimes++;
     }
     return(true);
 }
Пример #8
0
        private bool ListenAvatarSwapOutStart(EvtAvatarSwapOutStart evt)
        {
            AvatarStastics avatarStastics = this.GetAvatarStastics(evt.targetID);

            if (avatarStastics != null)
            {
                avatarStastics.swapOutTimes = SafeInt32.op_Increment(avatarStastics.swapOutTimes);
                avatarStastics.isOnStage    = 0;
                AvatarActor actor = Singleton <EventManager> .Instance.GetActor <AvatarActor>(Singleton <AvatarManager> .Instance.GetLocalAvatar().GetRuntimeID());

                actor.onSPChanged = (Action <float, float, float>)Delegate.Remove(actor.onSPChanged, new Action <float, float, float>(this.OnSPChanged));
            }
            return(true);
        }
Пример #9
0
        private bool ListenAttackStart(EvtAttackStart evt)
        {
            if (this.isUpdating)
            {
                switch (Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.targetID))
                {
                case 3:
                {
                    this.avatarAttackTimes++;
                    if (this.attackTimeList.ContainsKey(evt.skillID))
                    {
                        Dictionary <string, uint> dictionary;
                        string str;
                        uint   num3 = dictionary[str];
                        (dictionary = this.attackTimeList)[str = evt.skillID] = num3 + 1;
                    }
                    else
                    {
                        this.attackTimeList[evt.skillID] = 1;
                    }
                    AvatarActor actor = Singleton <EventManager> .Instance.GetActor <AvatarActor>(evt.targetID);

                    if (((actor != null) && actor.config.Skills.ContainsKey(evt.skillID)) && (actor.config.Skills[evt.skillID].SkillCategoryTag != null))
                    {
                        for (int i = 0; i < actor.config.Skills[evt.skillID].SkillCategoryTag.Length; i++)
                        {
                            if ((actor.config.Skills[evt.skillID].SkillCategoryTag[i] == AttackResult.AttackCategoryTag.Branch) || (actor.config.Skills[evt.skillID].SkillCategoryTag[i] == AttackResult.AttackCategoryTag.Charge))
                            {
                                AvatarStastics avatarStastics = this.GetAvatarStastics(evt.targetID);
                                if (avatarStastics != null)
                                {
                                    avatarStastics.avatarSpecialAttackTimes = SafeInt32.op_Increment(avatarStastics.avatarSpecialAttackTimes);
                                }
                                this.specialAttackTimes++;
                                break;
                            }
                        }
                    }
                    break;
                }

                case 4:
                    this.monsterAttackTimes++;
                    break;
                }
            }
            return(true);
        }
Пример #10
0
 public void ShowResult()
 {
     if (!Singleton <LevelScoreManager> .Instance.useDebugFunction)
     {
         List <AvatarStastics>  avatarInfoList  = new List <AvatarStastics>();
         List <MonsterStastics> monsterInfoList = new List <MonsterStastics>();
         foreach (KeyValuePair <int, AvatarStastics> pair in this._avatarStasticsDict)
         {
             AvatarStastics item = pair.Value;
             item.dps = (item.battleTime <= 0f) ? 0f : (item.avatarDamage / item.battleTime);
             item.restrictionDamageRatio  = (item.avatarDamage <= 0f) ? 0f : (item.restrictionDamage / item.avatarDamage);
             item.beRestrictedDamageRatio = (item.avatarDamage <= 0f) ? 0f : (item.beRestrictedDamage / item.avatarDamage);
             item.normalDamageRatio       = (item.avatarDamage <= 0f) ? 0f : (item.normalDamage / item.avatarDamage);
             avatarInfoList.Add(item);
         }
         foreach (KeyValuePair <uint, MonsterStastics> pair2 in this._monsterStasticsDict)
         {
             MonsterStastics stastics2 = pair2.Value;
             stastics2.dps = stastics2.damage / stastics2.aliveTime;
             if (!this._monsterAverageStasticsDict.ContainsKey(stastics2.key))
             {
                 this._monsterAverageStasticsDict[stastics2.key] = new MonsterStastics(stastics2.key.monsterName, stastics2.key.configType, stastics2.key.level);
             }
             MonsterStastics stastics3 = this._monsterAverageStasticsDict[stastics2.key];
             stastics3.monsterCount      = SafeInt32.op_Increment(stastics3.monsterCount);
             stastics3.damage           += stastics2.damage;
             stastics3.aliveTime        += stastics2.aliveTime;
             stastics3.hitAvatarTimes   += stastics2.hitAvatarTimes;
             stastics3.breakAvatarTimes += stastics2.breakAvatarTimes;
             stastics3.dps += stastics2.dps;
         }
         foreach (KeyValuePair <MonsterKey, MonsterStastics> pair3 in this._monsterAverageStasticsDict)
         {
             MonsterStastics stastics4 = pair3.Value;
             stastics4.damage         /= (float)stastics4.monsterCount;
             stastics4.aliveTime      /= (float)stastics4.monsterCount;
             stastics4.hitAvatarTimes /= stastics4.monsterCount;
             stastics4.dps            /= (float)stastics4.monsterCount;
             monsterInfoList.Add(stastics4);
         }
         PlayerStastics playerData = this._playerStastics;
         Singleton <NetworkManager> .Instance.RequestStageInnerDataReport(avatarInfoList, monsterInfoList, playerData);
     }
 }
Пример #11
0
 private void InitDate()
 {
     if (Singleton <AvatarManager> .Instance.TryGetLocalAvatar() != null)
     {
         if (this._levelActor.levelMode == LevelActor.Mode.Single)
         {
             AvatarStastics avatarStastics = this.GetAvatarStastics(Singleton <AvatarManager> .Instance.GetLocalAvatar().GetRuntimeID());
             avatarStastics.isOnStage   = 1;
             avatarStastics.swapInTimes = SafeInt32.op_Increment(avatarStastics.swapInTimes);
         }
         else if (this._levelActor.levelMode == LevelActor.Mode.Multi)
         {
             foreach (BaseMonoAvatar avatar2 in Singleton <AvatarManager> .Instance.GetAllPlayerAvatars())
             {
                 AvatarStastics stastics2 = this.GetAvatarStastics(avatar2.GetRuntimeID());
                 stastics2.isOnStage   = 1;
                 stastics2.swapInTimes = SafeInt32.op_Increment(stastics2.swapInTimes);
             }
         }
         this._isInit = true;
     }
 }
Пример #12
0
 public AvatarStastics(int avatarID)
 {
     this.avatarID = avatarID;
 }
Пример #13
0
 public void ResetPlayerStasticsData()
 {
     this.screenRotateTimes = 0;
     this.stageTime         = 0f;
 }
Пример #14
0
 public override void SetValue(object value)
 {
     this.mSafeValue = (int)value;
 }
Пример #15
0
 public override void Core()
 {
     base.Core();
     this._unscaledLevelTime += Time.unscaledDeltaTime;
     this._frameCount        += 1;
 }
Пример #16
0
        private bool ListenBeingHit(EvtBeingHit evt)
        {
            if (evt.attackData.rejected)
            {
                return(false);
            }
            if (this.isUpdating)
            {
                if (!evt.attackData.IsFinalResolved())
                {
                    return(false);
                }
                if (!evt.attackData.isAnimEventAttack)
                {
                    return(false);
                }
                this.allDamage += evt.attackData.GetTotalDamage();
                ushort num = Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.targetID);

                ushort num2 = Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.sourceID);

                switch (num)
                {
                case 3:
                {
                    if (num2 == 4)
                    {
                        MonsterStastics monsterStastics = this.GetMonsterStastics(evt.sourceID);
                        if (monsterStastics != null)
                        {
                            monsterStastics.damage        += evt.attackData.GetTotalDamage();
                            monsterStastics.hitAvatarTimes = SafeInt32.op_Increment(monsterStastics.hitAvatarTimes);
                            if (evt.attackData.hitEffect > AttackResult.AnimatorHitEffect.Light)
                            {
                                monsterStastics.breakAvatarTimes = SafeInt32.op_Increment(monsterStastics.breakAvatarTimes);
                            }
                        }
                    }
                    AvatarStastics avatarStastics = this.GetAvatarStastics(evt.targetID);
                    if (avatarStastics == null)
                    {
                        return(true);
                    }
                    avatarStastics.avatarBeDamaged    += evt.attackData.GetTotalDamage();
                    avatarStastics.avatarBeingHitTimes = SafeInt32.op_Increment(avatarStastics.avatarBeingHitTimes);
                    if (evt.attackData.hitEffect > AttackResult.AnimatorHitEffect.Light)
                    {
                        avatarStastics.avatarBeingBreakTimes = SafeInt32.op_Increment(avatarStastics.avatarBeingBreakTimes);
                    }
                    this.monsterDamage += evt.attackData.GetTotalDamage();
                    this.avatarBeingHitTimes++;
                    if (evt.attackData.attackerAniDamageRatio > evt.attackData.attackeeAniDefenceRatio)
                    {
                        this.avatarBeingHitTimes++;
                    }
                    if (evt.attackData.hitLevel == AttackResult.ActorHitLevel.Normal)
                    {
                        avatarStastics.behitNormalDamageMax = Mathf.Max(evt.attackData.GetTotalDamage(), (float)avatarStastics.behitNormalDamageMax);
                    }
                    else if (evt.attackData.hitLevel == AttackResult.ActorHitLevel.Critical)
                    {
                        avatarStastics.behitCriticalDamageMax = Mathf.Max(evt.attackData.GetTotalDamage(), (float)avatarStastics.behitCriticalDamageMax);
                    }
                    break;
                }

                case 4:
                {
                    MonsterActor attackee = Singleton <EventManager> .Instance.GetActor <MonsterActor>(evt.targetID);

                    if (num2 == 3)
                    {
                        AvatarStastics stastics3 = this.GetAvatarStastics(evt.sourceID);
                        if (stastics3 == null)
                        {
                            return(true);
                        }
                        float a = DamageModelLogic.GetNatureDamageBonusRatio(evt.attackData.attackerNature, evt.attackData.attackeeNature, attackee);
                        if (a > 1f)
                        {
                            stastics3.restrictionDamage += evt.attackData.GetTotalDamage();
                        }
                        else if (a < 1f)
                        {
                            stastics3.beRestrictedDamage += evt.attackData.GetTotalDamage();
                        }
                        else if (Mathf.Approximately(a, 1f))
                        {
                            stastics3.normalDamage += evt.attackData.GetTotalDamage();
                        }
                        if (evt.attackData.attackCategoryTag.ContainsTag(AttackResult.AttackCategoryTag.Weapon))
                        {
                            stastics3.avatarActiveWeaponSkillDamage += evt.attackData.GetTotalDamage();
                            this.avatarWeaponDdamage += evt.attackData.GetTotalDamage();
                        }
                        if (evt.attackData.hitEffect > AttackResult.AnimatorHitEffect.Light)
                        {
                            stastics3.avatarBreakTimes = SafeInt32.op_Increment(stastics3.avatarBreakTimes);
                        }
                        stastics3.avatarDamage  += evt.attackData.GetTotalDamage();
                        stastics3.avatarHitTimes = SafeInt32.op_Increment(stastics3.avatarHitTimes);
                        if (evt.attackData.isInComboCount)
                        {
                            stastics3.avatarEffectHitTimes = SafeInt32.op_Increment(stastics3.avatarEffectHitTimes);
                        }
                        if (evt.attackData.hitLevel == AttackResult.ActorHitLevel.Normal)
                        {
                            stastics3.hitNormalDamageMax = Mathf.Max(evt.attackData.GetTotalDamage(), (float)stastics3.hitNormalDamageMax);
                        }
                        else if (evt.attackData.hitLevel == AttackResult.ActorHitLevel.Critical)
                        {
                            stastics3.hitCriticalDamageMax = Mathf.Max(evt.attackData.GetTotalDamage(), (float)stastics3.hitCriticalDamageMax);
                        }
                    }
                    this.avatarDamage += evt.attackData.GetTotalDamage();
                    if (evt.attackData.isInComboCount)
                    {
                        this.avatarEffectHitTimes++;
                    }
                    this.monstersBeingHitTimes++;
                    if (evt.attackData.attackerAniDamageRatio > evt.attackData.attackeeAniDefenceRatio)
                    {
                        this.avatarBreakTimes++;
                    }
                    break;
                }
                }
            }
            return(true);
        }