private bool ListenKilled(EvtKilled evt) { switch (Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.targetID)) { case 3: { AvatarStastics avatarStastics = this.GetAvatarStastics(evt.targetID); if (avatarStastics == null) { return(true); } avatarStastics.isAlive = 0; break; } case 4: { MonsterStastics monsterStastics = this.GetMonsterStastics(evt.targetID); if (monsterStastics != null) { monsterStastics.isAlive = false; } break; } } return(false); }
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); }
public AvatarStastics GetAvatarStastics(uint avatarRuntimeID) { BaseMonoAvatar helperAvatar = Singleton <AvatarManager> .Instance.GetHelperAvatar(); if ((helperAvatar != null) && (helperAvatar.GetRuntimeID() == avatarRuntimeID)) { return(null); } AvatarActor actor = Singleton <EventManager> .Instance.GetActor <AvatarActor>(avatarRuntimeID); if (actor == null) { return(null); } if (!this._avatarStasticsDict.ContainsKey(actor.avatarDataItem.avatarID)) { AvatarStastics stastics = new AvatarStastics(actor.avatarDataItem.avatarID) { avatarLevel = actor.level, avatarStar = actor.avatarDataItem.star, stageID = Singleton <LevelScoreManager> .Instance.LevelId }; this._avatarStasticsDict[actor.avatarDataItem.avatarID] = stastics; } return(this._avatarStasticsDict[actor.avatarDataItem.avatarID]); }
private void OnLevelComboChanged(int from, int to) { int num = to + 1; AvatarStastics avatarStastics = this.GetAvatarStastics(Singleton <AvatarManager> .Instance.GetLocalAvatar().GetRuntimeID()); if ((avatarStastics != null) && (avatarStastics.comboMax < num)) { avatarStastics.comboMax = (SafeFloat)num; } }
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); }
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); }
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); }
private void OnHPChanged(float from, float to, float delta) { if (this.isUpdating) { AvatarStastics avatarStastics = this.GetAvatarStastics(Singleton <AvatarManager> .Instance.GetLocalAvatar().GetRuntimeID()); if (to > from) { avatarStastics.hpGain += to - from; } if (avatarStastics.hpMax < to) { avatarStastics.hpMax = to; } } }
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); }
private bool ListenAvatarCreated(EvtAvatarCreated evt) { if (Singleton <AvatarManager> .Instance.IsPlayerAvatar(evt.avatarID)) { AvatarActor actor = Singleton <EventManager> .Instance.GetActor <AvatarActor>(evt.avatarID); actor.onHPChanged = (Action <float, float, float>)Delegate.Combine(actor.onHPChanged, new Action <float, float, float>(this.OnHPChanged)); actor.onSPChanged = (Action <float, float, float>)Delegate.Combine(actor.onSPChanged, new Action <float, float, float>(this.OnSPChanged)); AvatarStastics avatarStastics = this.GetAvatarStastics(evt.avatarID); avatarStastics.hpBegin = actor.HP; avatarStastics.spBegin = actor.SP; avatarStastics.hpMax = actor.maxHP; avatarStastics.spMax = actor.maxSP; } return(true); }
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); } }
public override void Core() { if (!this._isInit) { this.InitDate(); } if (this.isStageCreated && (this._playerStastics != null)) { this.stageTime += Time.deltaTime; this._playerStastics.stageTime += Time.deltaTime; } if (this.isUpdating) { this._updateTimer += Time.deltaTime; foreach (KeyValuePair <int, AvatarStastics> pair in this._avatarStasticsDict) { AvatarStastics stastics = pair.Value; if ((stastics.isAlive != 0) && (stastics.isOnStage != 0)) { stastics.battleTime += Time.deltaTime; stastics.onStageTime += Time.deltaTime; } } Dictionary <uint, MonsterStastics> .Enumerator enumerator2 = this._monsterStasticsDict.GetEnumerator(); try { while (enumerator2.MoveNext()) { KeyValuePair <uint, MonsterStastics> current = enumerator2.Current; MonsterStastics stastics2 = current.Value; if (stastics2.isAlive) { stastics2.aliveTime += Time.deltaTime; } } } finally { Dictionary <int, AvatarStastics> .Enumerator enumerator; enumerator.Dispose(); } } }
public void CollectAntiCheatData() { this.cheatDataList = new List <StageCheatData>(); this.AddData(0x3e9, (float)this._levelStartTime); this.AddData(0x3ea, (float)this._unscaledLevelTime); this.AddData(0x3eb, this._unscaledLevelTime / ((float)this._frameCount)); List <BaseMonoAvatar> allPlayerAvatars = Singleton <AvatarManager> .Instance.GetAllPlayerAvatars(); for (int i = 0; i < allPlayerAvatars.Count; i++) { BaseMonoAvatar avatar = allPlayerAvatars[i]; AvatarActor actor = Singleton <EventManager> .Instance.GetActor <AvatarActor>(avatar.GetRuntimeID()); AvatarStastics avatarStastics = this._damagePlugin.GetAvatarStastics(avatar.GetRuntimeID()); int num2 = i * 100; this.AddData((StageCheatData.Type)(0x7d1 + num2), (float)avatar.AvatarTypeID); this.AddData((StageCheatData.Type)(0x7d2 + num2), (float)actor.level); this.AddData((StageCheatData.Type)(0x7d3 + num2), actor.avatarDataItem.CombatNum); this.AddData((StageCheatData.Type)(0x7d4 + num2), (float)actor.attack); this.AddData((StageCheatData.Type)(0x7e6 + num2), (float)avatarStastics.onStageTime); this.AddData((StageCheatData.Type)(0x7da + num2), (float)avatarStastics.hpMax); this.AddData((StageCheatData.Type)(0x7db + num2), (float)avatarStastics.hpBegin); this.AddData((StageCheatData.Type)(0x7dc + num2), (float)actor.HP); this.AddData((StageCheatData.Type)(0x7dd + num2), (float)avatarStastics.hpGain); this.AddData((StageCheatData.Type)(0x7d5 + num2), (float)avatarStastics.spMax); this.AddData((StageCheatData.Type)(0x7d6 + num2), (float)avatarStastics.spBegin); this.AddData((StageCheatData.Type)(0x7d7 + num2), (float)actor.SP); this.AddData((StageCheatData.Type)(0x7d8 + num2), (float)avatarStastics.SpRecover); this.AddData((StageCheatData.Type)(0x7d9 + num2), (float)avatarStastics.spUse); this.AddData((StageCheatData.Type)(0x7de + num2), (float)avatarStastics.avatarHitTimes); this.AddData((StageCheatData.Type)(0x7df + num2), (float)avatarStastics.avatarDamage); this.AddData((StageCheatData.Type)(0x7e0 + num2), (float)avatarStastics.hitNormalDamageMax); this.AddData((StageCheatData.Type)(0x7e1 + num2), (float)avatarStastics.hitCriticalDamageMax); this.AddData((StageCheatData.Type)(0x7e2 + num2), (float)avatarStastics.avatarBeingHitTimes); this.AddData((StageCheatData.Type)(0x7e3 + num2), (float)avatarStastics.behitNormalDamageMax); this.AddData((StageCheatData.Type)(0x7e4 + num2), (float)avatarStastics.behitCriticalDamageMax); this.AddData((StageCheatData.Type)(0x7e5 + num2), (float)avatarStastics.comboMax); } }
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; } }
private void OnSPChanged(float from, float to, float delta) { if (this.isUpdating) { AvatarStastics avatarStastics = this.GetAvatarStastics(Singleton <AvatarManager> .Instance.GetLocalAvatar().GetRuntimeID()); if (to > from) { avatarStastics.SpRecover += to - from; if ((to - from) <= AvatarStastics.SELF_SP_RECOVE_UPBOUND) { avatarStastics.selfSPRecover += to - from; } this.spGet += to - from; } else { avatarStastics.spUse += from - to; } if (avatarStastics.spMax < to) { avatarStastics.spMax = to; } } }
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); }