private void OnActorBattleCoinChanged(PoolObjHandle <ActorRoot> actor, int changeValue, bool isIncome, PoolObjHandle <ActorRoot> target) { if (isIncome) { CampInfo campInfo = this.campStat[(uint)actor.handle.TheActorMeta.ActorCamp]; campInfo.coinTotal += changeValue; } }
private void onActorDead(ref DefaultGameEventParam prm) { NONHERO_STATISTIC_INFO nonhero_statistic_info; DictionaryView <uint, NONHERO_STATISTIC_INFO> view; this.doDestroyStat(prm.src, prm.orignalAtker); if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { HeroWrapper actorControl = prm.src.handle.ActorControl as HeroWrapper; if (actorControl.IsKilledByHero()) { CampInfo campInfoByCamp = null; PoolObjHandle <ActorRoot> inAtker = new PoolObjHandle <ActorRoot>(null); if (actorControl.LastHeroAtker != 0) { campInfoByCamp = this.GetCampInfoByCamp(actorControl.LastHeroAtker.handle.TheActorMeta.ActorCamp); inAtker = actorControl.LastHeroAtker; } else if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)) { campInfoByCamp = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp); inAtker = prm.orignalAtker; } if ((campInfoByCamp != null) && (inAtker != 0)) { campInfoByCamp.IncCampScore(prm.src, inAtker); uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey(0x6d).dwConfValue; campInfoByCamp.IncHeadPoints((int)dwConfValue, prm.src, inAtker); } } } else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { MonsterWrapper wrapper2 = prm.src.handle.ActorControl as MonsterWrapper; if (wrapper2.IsKilledByHero()) { CampInfo info2 = this.GetCampInfoByCamp(wrapper2.LastHeroAtker.handle.TheActorMeta.ActorCamp); DebugHelper.Assert(info2 != null); if (info2 != null) { info2.IncHeadPoints(wrapper2.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker); } } else if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)) { CampInfo info3 = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp); DebugHelper.Assert(info3 != null); if (info3 != null) { info3.IncHeadPoints(wrapper2.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker); } } } if (((prm.src != 0) && (prm.src.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)) && (this.m_NonHeroInfo.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorType, out view) && view.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorCamp, out nonhero_statistic_info))) { nonhero_statistic_info.uiTotalDeadNum++; } }
protected override void OnClose() { DictionaryView <uint, CampInfo> campStat = Singleton <BattleLogic> .GetInstance().battleStat.GetCampStat(); if (campStat.ContainsKey((uint)this.SubjCamp)) { CampInfo campInfo = campStat[(uint)this.SubjCamp]; campInfo.onCampScoreChanged -= new CampInfo.CampInfoValueChanged(this.ValidateKill); } }
protected override void OnStart() { DictionaryView <uint, CampInfo> campStat = Singleton <BattleLogic> .GetInstance().battleStat.GetCampStat(); if (campStat.ContainsKey(this.SubjCamp)) { CampInfo campInfo = campStat.get_Item(this.SubjCamp); campInfo.onCampScoreChanged += new CampInfo.CampInfoValueChanged(this.ValidateKill); base.Current = campInfo.campScore; } }
public void GetCampsByScoreRank(RES_STAR_CONDITION_DATA_SUB_TYPE inDataSubType, out List <COM_PLAYERCAMP> result, out List <int> resultScore) { result = new List <COM_PLAYERCAMP>(); resultScore = new List <int>(); Dictionary <uint, int> dictionary = new Dictionary <uint, int>(); DictionaryView <uint, CampInfo> .Enumerator enumerator = this.campStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, CampInfo> current = enumerator.Current; CampInfo info = current.Value; if (info != null) { KeyValuePair <uint, CampInfo> pair2 = enumerator.Current; uint key = pair2.Key; int score = info.GetScore(inDataSubType); if (score >= 0) { dictionary.Add(key, score); } } } Dictionary <uint, int> .Enumerator enumerator2 = dictionary.GetEnumerator(); while (enumerator2.MoveNext()) { KeyValuePair <uint, int> pair3 = enumerator2.Current; COM_PLAYERCAMP item = pair3.Key; KeyValuePair <uint, int> pair4 = enumerator2.Current; int num3 = pair4.Value; bool flag = false; int count = result.Count; for (int i = 0; i < count; i++) { if (resultScore[i] < num3) { result.Insert(i, item); resultScore.Insert(i, num3); flag = true; break; } } if (!flag) { result.Add(item); resultScore.Add(num3); } } DebugHelper.Assert(resultScore.Count == result.Count); }
public void GetCampsByScoreRank(RES_STAR_CONDITION_DATA_SUB_TYPE inDataSubType, out List <COM_PLAYERCAMP> result, out List <int> resultScore) { result = new List <COM_PLAYERCAMP>(); resultScore = new List <int>(); Dictionary <uint, int> dictionary = new Dictionary <uint, int>(); DictionaryView <uint, CampInfo> .Enumerator enumerator = this.campStat.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <uint, CampInfo> current = enumerator.Current; CampInfo value = current.get_Value(); if (value != null) { KeyValuePair <uint, CampInfo> current2 = enumerator.Current; uint key = current2.get_Key(); int score = value.GetScore(inDataSubType); if (score >= 0) { dictionary.Add(key, score); } } } Dictionary <uint, int> .Enumerator enumerator2 = dictionary.GetEnumerator(); while (enumerator2.MoveNext()) { KeyValuePair <uint, int> current3 = enumerator2.get_Current(); COM_PLAYERCAMP key2 = (COM_PLAYERCAMP)current3.get_Key(); KeyValuePair <uint, int> current4 = enumerator2.get_Current(); int value2 = current4.get_Value(); bool flag = false; int count = result.get_Count(); for (int i = 0; i < count; i++) { if (resultScore.get_Item(i) < value2) { result.Insert(i, key2); resultScore.Insert(i, value2); flag = true; break; } } if (!flag) { result.Add(key2); resultScore.Add(value2); } } DebugHelper.Assert(resultScore.get_Count() == result.get_Count()); }
private void onSoulExpChange(PoolObjHandle <ActorRoot> act, int changeValue, int curVal, int maxVal) { CampInfo campInfo = this.campStat[(uint)act.handle.TheActorMeta.ActorCamp]; campInfo.soulExpTotal += changeValue; }
private void onActorDead(ref GameDeadEventParam prm) { if (prm.bImmediateRevive) { return; } this.doDestroyStat(prm.src, prm.orignalAtker); if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { HeroWrapper heroWrapper = prm.src.handle.ActorControl as HeroWrapper; CampInfo campInfo = null; PoolObjHandle <ActorRoot> poolObjHandle = new PoolObjHandle <ActorRoot>(null); if (prm.orignalAtker && prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { campInfo = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp); poolObjHandle = prm.orignalAtker; } else if (heroWrapper.IsKilledByHero() && heroWrapper.LastHeroAtker) { campInfo = this.GetCampInfoByCamp(heroWrapper.LastHeroAtker.handle.TheActorMeta.ActorCamp); poolObjHandle = heroWrapper.LastHeroAtker; } if (campInfo != null && poolObjHandle) { campInfo.IncCampScore(prm.src, poolObjHandle); uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey(109u).dwConfValue; campInfo.IncHeadPoints((int)dwConfValue, prm.src, poolObjHandle); } } else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { MonsterWrapper monsterWrapper = prm.src.handle.ActorControl as MonsterWrapper; if (monsterWrapper.IsKilledByHero()) { CampInfo campInfoByCamp = this.GetCampInfoByCamp(monsterWrapper.LastHeroAtker.handle.TheActorMeta.ActorCamp); DebugHelper.Assert(campInfoByCamp != null); if (campInfoByCamp != null) { campInfoByCamp.IncHeadPoints(monsterWrapper.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker); } } else if (prm.orignalAtker && prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { CampInfo campInfoByCamp2 = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp); DebugHelper.Assert(campInfoByCamp2 != null); if (campInfoByCamp2 != null) { campInfoByCamp2.IncHeadPoints(monsterWrapper.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker); } } } DictionaryView <uint, NONHERO_STATISTIC_INFO> dictionaryView; NONHERO_STATISTIC_INFO nONHERO_STATISTIC_INFO; if (prm.src && prm.src.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero && this.m_NonHeroInfo.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorType, out dictionaryView) && dictionaryView.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorCamp, out nONHERO_STATISTIC_INFO)) { nONHERO_STATISTIC_INFO.uiTotalDeadNum += 1u; } if (prm.atker && prm.src && prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ) { OrganWrapper organWrapper = prm.src.handle.ActorControl as OrganWrapper; if (organWrapper != null && organWrapper.cfgInfo.bOrganType == 1) { CampInfo campInfoByCamp3 = this.GetCampInfoByCamp(prm.atker.handle.TheActorMeta.ActorCamp); if (campInfoByCamp3 != null) { campInfoByCamp3.destoryTowers++; Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_TOWER_DESTROY_CHANGED); } } } }
private void onSoulExpChange(PoolObjHandle <ActorRoot> act, int changeValue, int curVal, int maxVal) { CampInfo campInfo = this.campStat.get_Item(act.get_handle().TheActorMeta.ActorCamp); campInfo.soulExpTotal += changeValue; }
private void onActorDead(ref GameDeadEventParam prm) { if (!prm.bImmediateRevive) { NONHERO_STATISTIC_INFO nonhero_statistic_info; DictionaryView <uint, NONHERO_STATISTIC_INFO> view; this.doDestroyStat(prm.src, prm.orignalAtker); if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { HeroWrapper actorControl = prm.src.handle.ActorControl as HeroWrapper; CampInfo campInfoByCamp = null; PoolObjHandle <ActorRoot> inAtker = new PoolObjHandle <ActorRoot>(null); if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)) { campInfoByCamp = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp); inAtker = prm.orignalAtker; } else if (actorControl.IsKilledByHero() && (actorControl.LastHeroAtker != 0)) { campInfoByCamp = this.GetCampInfoByCamp(actorControl.LastHeroAtker.handle.TheActorMeta.ActorCamp); inAtker = actorControl.LastHeroAtker; } if ((campInfoByCamp != null) && (inAtker != 0)) { campInfoByCamp.IncCampScore(prm.src, inAtker); uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey((uint)0x6d).dwConfValue; campInfoByCamp.IncHeadPoints((int)dwConfValue, prm.src, inAtker); } } else if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { MonsterWrapper wrapper2 = prm.src.handle.ActorControl as MonsterWrapper; if (wrapper2.IsKilledByHero()) { CampInfo info2 = this.GetCampInfoByCamp(wrapper2.LastHeroAtker.handle.TheActorMeta.ActorCamp); DebugHelper.Assert(info2 != null); if (info2 != null) { info2.IncHeadPoints(wrapper2.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker); } } else if ((prm.orignalAtker != 0) && (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)) { CampInfo info3 = this.GetCampInfoByCamp(prm.orignalAtker.handle.TheActorMeta.ActorCamp); DebugHelper.Assert(info3 != null); if (info3 != null) { info3.IncHeadPoints(wrapper2.cfgInfo.iHeadPoints, prm.src, prm.orignalAtker); } } } if (((prm.src != 0) && (prm.src.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)) && (this.m_NonHeroInfo.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorType, out view) && view.TryGetValue((uint)prm.src.handle.TheActorMeta.ActorCamp, out nonhero_statistic_info))) { nonhero_statistic_info.uiTotalDeadNum++; } if (((prm.atker != 0) && (prm.src != 0)) && (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)) { OrganWrapper wrapper3 = prm.src.handle.ActorControl as OrganWrapper; if ((wrapper3 != null) && (wrapper3.cfgInfo.bOrganType == 1)) { CampInfo info4 = this.GetCampInfoByCamp(prm.atker.handle.TheActorMeta.ActorCamp); if (info4 != null) { info4.destoryTowers++; Singleton <EventRouter> .instance.BroadCastEvent(EventID.BATTLE_TOWER_DESTROY_CHANGED); } } } } }