private void On_Play_DeltaEnd(int timerSequence) { UT.ResetTimer(this.play_delta_timer, true); if (this.KillInfoList.Count > 0) { KillInfo info = this.KillInfoList[0]; this.KillInfoList.RemoveAt(0); this.PlayKillNotify(info.KillerImgSrc, info.VictimImgSrc, info.MsgType, info.bSrcAllies, info.bPlayerSelf_KillOrKilled, info.actorType); } }
private void On_Play_DeltaEnd(int timerSequence) { UT.ResetTimer(this.play_delta_timer, true); if (this.KillInfoList.get_Count() > 0) { KillInfo killInfo = this.KillInfoList.get_Item(0); this.KillInfoList.RemoveAt(0); this.PlayKillNotify(ref killInfo); } }
public void AddKillInfo(KillDetailInfo info) { if (MonoSingleton <Reconnection> .get_instance().isProcessingRelayRecover) { return; } KillInfo killInfo = KillNotifyUT.Convert_DetailInfo_KillInfo(info); this.AddKillInfo(ref killInfo); }
public void AddKillInfo(ref KillInfo killInfo) { if (this.IsPlaying) { this._AddkillInfo(killInfo); } else { this.PlayKillNotify(ref killInfo); } }
private void _AddkillInfo(KillInfo killInfo) { if (this.IsDragonKilled(killInfo.MsgType)) { this.KillInfoList.Insert(0, killInfo); } else if (killInfo.MsgType == KillDetailInfoType.Info_Type_AllDead) { this.KillInfoList.Add(killInfo); Debug.Log("---KN 添加团灭进队列"); } else { if (this.KillInfoList.Count < max_count) { this.KillInfoList.Add(killInfo); } else { int bPriority = 0x2710; int index = 0; for (int j = 0; j < this.KillInfoList.Count; j++) { KillInfo info2 = this.KillInfoList[j]; if (info2.bPriority < bPriority) { KillInfo info3 = this.KillInfoList[j]; bPriority = info3.bPriority; index = j; } } if (((killInfo.bPriority >= bPriority) && (index >= 0)) && (index < this.KillInfoList.Count)) { this.KillInfoList.RemoveAt(index); this.KillInfoList.Add(killInfo); } } int num4 = -1; for (int i = 0; i < this.KillInfoList.Count; i++) { KillInfo info4 = this.KillInfoList[i]; if (info4.MsgType == KillDetailInfoType.Info_Type_AllDead) { num4 = i; } } if ((num4 >= 0) && (num4 < this.KillInfoList.Count)) { KillInfo info = this.KillInfoList[num4]; this.KillInfoList[num4] = this.KillInfoList[this.KillInfoList.Count - 1]; this.KillInfoList[this.KillInfoList.Count - 1] = info; } } }
public void AddKillInfo(KillInfo killInfo) { if (this.IsPlaying) { this._AddkillInfo(killInfo); } else { this.PlayKillNotify(killInfo.KillerImgSrc, killInfo.VictimImgSrc, killInfo.MsgType, killInfo.bSrcAllies, killInfo.bPlayerSelf_KillOrKilled, killInfo.actorType); } }
private void _AddkillInfo(KillInfo killInfo) { if (this.IsDragonKilled(killInfo.MsgType)) { this.KillInfoList.Insert(0, killInfo); return; } if (killInfo.MsgType == KillDetailInfoType.Info_Type_AllDead) { this.KillInfoList.Add(killInfo); Debug.Log("---KN 添加团灭进队列"); return; } if (this.KillInfoList.get_Count() < KillNotify.max_count) { this.KillInfoList.Add(killInfo); } else { int num = 10000; int num2 = 0; for (int i = 0; i < this.KillInfoList.get_Count(); i++) { if ((int)this.KillInfoList.get_Item(i).bPriority < num) { num = (int)this.KillInfoList.get_Item(i).bPriority; num2 = i; } } if ((int)killInfo.bPriority >= num && num2 >= 0 && num2 < this.KillInfoList.get_Count()) { this.KillInfoList.RemoveAt(num2); this.KillInfoList.Add(killInfo); } } int num3 = -1; for (int j = 0; j < this.KillInfoList.get_Count(); j++) { if (this.KillInfoList.get_Item(j).MsgType == KillDetailInfoType.Info_Type_AllDead) { num3 = j; } } if (num3 >= 0 && num3 < this.KillInfoList.get_Count()) { KillInfo killInfo2 = this.KillInfoList.get_Item(num3); this.KillInfoList.set_Item(num3, this.KillInfoList.get_Item(this.KillInfoList.get_Count() - 1)); this.KillInfoList.set_Item(this.KillInfoList.get_Count() - 1, killInfo2); } }
public void AddKillInfo(KillInfo killInfo) { if (this.IsPlaying) { if (this.KillInfoList.Count < max_count) { if (killInfo.MsgType == KillDetailInfoType.Info_Type_KillDragon) { this.KillInfoList.Insert(0, killInfo); } else { this.KillInfoList.Add(killInfo); } } } else { this.PlayKillNotify(killInfo.KillerImgSrc, killInfo.VictimImgSrc, killInfo.MsgType, killInfo.bSrcAllies, killInfo.bPlayerSelf_KillOrKilled, killInfo.actorType); } }
public static KillInfo Convert_DetailInfo_KillInfo(KillDetailInfo detail) { KillDetailInfoType killDetailInfoType = KillDetailInfoType.Info_Type_None; PoolObjHandle <ActorRoot> killer = detail.Killer; PoolObjHandle <ActorRoot> victim = detail.Victim; bool flag = false; bool flag2 = false; bool flag3 = false; if (killer) { flag = (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ); flag2 = (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster); flag3 = (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero); } KillInfo result = default(KillInfo); result.KillerImgSrc = (result.VictimImgSrc = string.Empty); result.MsgType = detail.Type; result.bPlayerSelf_KillOrKilled = detail.bPlayerSelf_KillOrKilled; result.actorType = ((!killer) ? ActorTypeDef.Invalid : killer.get_handle().TheActorMeta.ActorType); result.bSrcAllies = detail.bSelfCamp; result.assistImgSrc = new string[4]; if (flag2) { result.KillerImgSrc = KillNotify.monster_icon; } if (flag) { result.KillerImgSrc = KillNotify.building_icon; } if (flag3) { result.KillerImgSrc = KillNotifyUT.GetHero_Icon(detail.Killer, false); } if (killer) { if (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ) { result.KillerImgSrc = KillNotify.building_icon; } if (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { MonsterWrapper monsterWrapper = killer.get_handle().AsMonster(); if (killer.get_handle().TheActorMeta.ConfigId == Singleton <BattleLogic> .get_instance().DragonId) { result.KillerImgSrc = KillNotify.dragon_icon; } else if (monsterWrapper.cfgInfo != null && monsterWrapper.cfgInfo.bMonsterType == 2) { result.KillerImgSrc = KillNotify.yeguai_icon; } else { result.KillerImgSrc = KillNotify.monster_icon; } } if (killer.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { result.KillerImgSrc = KillNotifyUT.GetHero_Icon(killer, false); } } if (victim) { if (victim.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { result.VictimImgSrc = KillNotifyUT.GetHero_Icon(victim, false); } if (victim.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ) { result.VictimImgSrc = KillNotify.building_icon; } if (victim.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster && victim.get_handle().TheActorMeta.ConfigId == Singleton <BattleLogic> .get_instance().DragonId) { result.VictimImgSrc = KillNotify.dragon_icon; } } if (detail.assistList != null && result.assistImgSrc != null) { for (int i = 0; i < detail.assistList.get_Count(); i++) { uint num = detail.assistList.get_Item(i); for (int j = 0; j < Singleton <GameObjMgr> .get_instance().HeroActors.get_Count(); j++) { if (num == Singleton <GameObjMgr> .get_instance().HeroActors.get_Item(j).get_handle().ObjID) { result.assistImgSrc[i] = KillNotifyUT.GetHero_Icon(Singleton <GameObjMgr> .get_instance().HeroActors.get_Item(j), false); } } } } if (detail.Type == KillDetailInfoType.Info_Type_Soldier_Boosted) { result.KillerImgSrc = ((!detail.bSelfCamp) ? KillNotify.red_soldier_icon : KillNotify.blue_soldier_icon); return(result); } if (detail.Type == KillDetailInfoType.Info_Type_Reconnect || detail.Type == KillDetailInfoType.Info_Type_RunningMan) { result.VictimImgSrc = string.Empty; return(result); } if (detail.HeroMultiKillType != killDetailInfoType) { result.MsgType = detail.HeroMultiKillType; return(result); } if (detail.Type == KillDetailInfoType.Info_Type_StopMultiKill) { return(result); } if (detail.Type == KillDetailInfoType.Info_Type_First_Kill) { return(result); } if (detail.Type == KillDetailInfoType.Info_Type_DestroyTower) { return(result); } if (detail.Type == KillDetailInfoType.Info_Type_Kill_3V3_Dragon || detail.Type == KillDetailInfoType.Info_Type_Kill_5V5_SmallDragon || detail.Type == KillDetailInfoType.Info_Type_Kill_5V5_BigDragon) { if (flag2) { result.KillerImgSrc = KillNotify.monster_icon; } if (flag) { result.KillerImgSrc = KillNotify.building_icon; } if (flag3) { result.KillerImgSrc = KillNotifyUT.GetHero_Icon(detail.Killer, false); } result.bSrcAllies = detail.bSelfCamp; return(result); } if (detail.bAllDead) { result.MsgType = KillDetailInfoType.Info_Type_AllDead; return(result); } if (detail.HeroContiKillType != killDetailInfoType) { result.MsgType = detail.HeroContiKillType; return(result); } if (detail.Type == KillDetailInfoType.Info_Type_Kill) { return(result); } return(result); }
private void PlayKillNotify(ref KillInfo killInfo) { string killerImgSrc = killInfo.KillerImgSrc; string victimImgSrc = killInfo.VictimImgSrc; string[] assistImgSrc = killInfo.assistImgSrc; KillDetailInfoType msgType = killInfo.MsgType; bool bSrcAllies = killInfo.bSrcAllies; bool bPlayerSelf_KillOrKilled = killInfo.bPlayerSelf_KillOrKilled; ActorTypeDef actorType = killInfo.actorType; string spt = (!bSrcAllies) ? KillNotify.red_assist_frame_icon : KillNotify.blue_assist_frame_icon; if (msgType == KillDetailInfoType.Info_Type_AllDead) { Debug.Log("---KN 播团灭"); } this.Show(); UT.ResetTimer(this.hideTimer, false); string soundEvent = KillNotifyUT.GetSoundEvent(msgType, bSrcAllies, bPlayerSelf_KillOrKilled, actorType); if (!string.IsNullOrEmpty(soundEvent)) { Singleton <CSoundManager> .GetInstance().PlayBattleSound2D(soundEvent); } string animation = KillNotifyUT.GetAnimation(msgType, bSrcAllies); if (!string.IsNullOrEmpty(animation) && this.animatorScript != null) { this.animatorScript.PlayAnimator(animation); } KillNotifyUT.SetImageSprite(this.KillerImg, killerImgSrc); if (string.IsNullOrEmpty(killerImgSrc)) { this.SetKillerShow(false); } else { this.SetKillerShow(true); } bool flag = msgType == KillDetailInfoType.Info_Type_DestroyTower || msgType == KillDetailInfoType.Info_Type_DestroyBase || msgType == KillDetailInfoType.Info_Type_AllDead || msgType == KillDetailInfoType.Info_Type_RunningMan || msgType == KillDetailInfoType.Info_Type_Reconnect || msgType == KillDetailInfoType.Info_Type_Disconnect || msgType == KillDetailInfoType.Info_Type_Kill_3V3_Dragon || msgType == KillDetailInfoType.Info_Type_Game_Start_Wel || msgType == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown3 || msgType == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown5 || msgType == KillDetailInfoType.Info_Type_Soldier_Activate || msgType == KillDetailInfoType.Info_Type_Kill_5V5_SmallDragon || msgType == KillDetailInfoType.Info_Type_Kill_5V5_BigDragon; this.SetVictimShow(!flag); KillNotifyUT.SetImageSprite(this.VictimImg, victimImgSrc); int num = 0; if (assistImgSrc != null) { for (int i = 0; i < 4; i++) { if (!string.IsNullOrEmpty(assistImgSrc[i])) { if (this.assistHeads[i].gameObject != null) { this.assistHeads[i].gameObject.CustomSetActive(true); } KillNotifyUT.SetImageSprite(this.assistHeads[i], assistImgSrc[i]); KillNotifyUT.SetImageSprite(this.assistHeadFrames[i], spt); num++; } else if (this.assistHeads[i].gameObject != null) { this.assistHeads[i].gameObject.CustomSetActive(false); } } } this.assistList.CustomSetActive(num > 0); this.IsPlaying = true; }
private void PlayKillNotify(ref KillInfo killInfo) { string killerImgSrc = killInfo.KillerImgSrc; string victimImgSrc = killInfo.VictimImgSrc; string[] assistImgSrc = killInfo.assistImgSrc; KillDetailInfoType killDetailInfoType = killInfo.MsgType; bool bSrcAllies = killInfo.bSrcAllies; bool bPlayerSelf_KillOrKilled = killInfo.bPlayerSelf_KillOrKilled; ActorTypeDef actorType = killInfo.actorType; string spt = bSrcAllies ? KillNotify.blue_assist_frame_icon : KillNotify.red_assist_frame_icon; this.Show(); UT.ResetTimer(this.hideTimer, false); string soundEvent = KillNotifyUT.GetSoundEvent(killDetailInfoType, bSrcAllies, bPlayerSelf_KillOrKilled, actorType); if (!string.IsNullOrEmpty(soundEvent)) { Singleton <CSoundManager> .GetInstance().PlayBattleSound2D(soundEvent); } string animation = KillNotifyUT.GetAnimation(killDetailInfoType, bSrcAllies); if (!string.IsNullOrEmpty(animation) && this.animatorScript != null) { this.animatorScript.PlayAnimator(animation); } KillNotifyUT.SetImageSprite(this.KillerImg, killerImgSrc); if (string.IsNullOrEmpty(killerImgSrc) || killInfo.bSuicide) { this.SetKillerShow(false); } else { this.SetKillerShow(true); } bool flag = killDetailInfoType == KillDetailInfoType.Info_Type_DestroyTower || killDetailInfoType == KillDetailInfoType.Info_Type_DestroyBase || killDetailInfoType == KillDetailInfoType.Info_Type_AllDead || killDetailInfoType == KillDetailInfoType.Info_Type_RunningMan || killDetailInfoType == KillDetailInfoType.Info_Type_Reconnect || killDetailInfoType == KillDetailInfoType.Info_Type_Disconnect || killDetailInfoType == KillDetailInfoType.Info_Type_Kill_3V3_Dragon || killDetailInfoType == KillDetailInfoType.Info_Type_Game_Start_Wel || killDetailInfoType == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown3 || killDetailInfoType == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown5 || killDetailInfoType == KillDetailInfoType.Info_Type_Soldier_Activate || killDetailInfoType == KillDetailInfoType.Info_Type_Kill_5V5_SmallDragon || killDetailInfoType == KillDetailInfoType.Info_Type_Kill_5V5_BigDragon || killDetailInfoType == KillDetailInfoType.Info_Type_5V5SmallDragon_Suicide; this.SetVictimShow(!flag); KillNotifyUT.SetImageSprite(this.VictimImg, victimImgSrc); int num = 0; if (assistImgSrc != null && killDetailInfoType != KillDetailInfoType.Info_Type_AllDead) { for (int i = 0; i < 4; i++) { if (!string.IsNullOrEmpty(assistImgSrc[i])) { if (this.assistHeads[i].gameObject != null) { this.assistHeads[i].gameObject.CustomSetActive(true); } KillNotifyUT.SetImageSprite(this.assistHeads[i], assistImgSrc[i]); KillNotifyUT.SetImageSprite(this.assistHeadFrames[i], spt); num++; } else if (this.assistHeads[i].gameObject != null) { this.assistHeads[i].gameObject.CustomSetActive(false); } } } this.assistList.CustomSetActive(num > 0); this.IsPlaying = true; bool flag2 = false; if (Singleton <GamePlayerCenter> .instance.GetHostPlayer() != null && Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain&& Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain.handle.ObjID == killInfo.killerObjID) { flag2 = true; } if ((killDetailInfoType == KillDetailInfoType.Info_Type_Odyssey || killDetailInfoType == KillDetailInfoType.Info_Type_QuataryKill || killDetailInfoType == KillDetailInfoType.Info_Type_PentaKill || killDetailInfoType == KillDetailInfoType.Info_Type_TripleKill) && flag2) { if (killDetailInfoType == KillDetailInfoType.Info_Type_Odyssey) { killDetailInfoType = KillDetailInfoType.Info_Type_Legendary; } MonoSingleton <TGPSDKSys> .GetInstance().SendGameEvent2(killDetailInfoType); } }
public static KillInfo Convert_DetailInfo_KillInfo(KillDetailInfo detail) { KillInfo info; KillDetailInfoType type = KillDetailInfoType.Info_Type_None; PoolObjHandle <ActorRoot> killer = detail.Killer; PoolObjHandle <ActorRoot> victim = detail.Victim; bool flag = false; bool flag2 = false; bool flag3 = false; if (killer != 0) { flag = killer.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ; flag2 = killer.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster; flag3 = killer.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero; } info = new KillInfo { KillerImgSrc = info.VictimImgSrc = string.Empty, MsgType = detail.Type, bPlayerSelf_KillOrKilled = detail.bPlayerSelf_KillOrKilled, actorType = (killer == 0) ? ActorTypeDef.Invalid : killer.handle.TheActorMeta.ActorType, bSrcAllies = detail.bSelfCamp }; if (flag2) { info.KillerImgSrc = KillNotify.monster_icon; } if (flag) { info.KillerImgSrc = KillNotify.building_icon; } if (flag3) { info.KillerImgSrc = GetHero_Icon(detail.Killer); } if (killer != 0) { if (killer.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ) { info.KillerImgSrc = KillNotify.building_icon; } if (killer.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { MonsterWrapper wrapper = killer.handle.AsMonster(); if (killer.handle.TheActorMeta.ConfigId == Singleton <BattleLogic> .instance.DragonId) { info.KillerImgSrc = KillNotify.dragon_icon; } else if ((wrapper.cfgInfo != null) && (wrapper.cfgInfo.bMonsterType == 2)) { info.KillerImgSrc = KillNotify.yeguai_icon; } else { info.KillerImgSrc = KillNotify.monster_icon; } } if (killer.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { info.KillerImgSrc = GetHero_Icon(killer); } } if (victim != 0) { if (victim.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { info.VictimImgSrc = GetHero_Icon(victim); } if (victim.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ) { info.VictimImgSrc = KillNotify.building_icon; } if ((victim.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) && (victim.handle.TheActorMeta.ConfigId == Singleton <BattleLogic> .instance.DragonId)) { info.VictimImgSrc = KillNotify.dragon_icon; } } if (detail.Type == KillDetailInfoType.Info_Type_Soldier_Boosted) { info.KillerImgSrc = !detail.bSelfCamp ? KillNotify.red_soldier_icon : KillNotify.blue_soldier_icon; return(info); } if ((detail.Type == KillDetailInfoType.Info_Type_Reconnect) || (detail.Type == KillDetailInfoType.Info_Type_RunningMan)) { info.VictimImgSrc = string.Empty; return(info); } if (detail.HeroMultiKillType != type) { info.MsgType = detail.HeroMultiKillType; return(info); } if (detail.Type != KillDetailInfoType.Info_Type_StopMultiKill) { if (detail.Type == KillDetailInfoType.Info_Type_First_Kill) { return(info); } if (detail.Type == KillDetailInfoType.Info_Type_DestroyTower) { return(info); } if (detail.Type == KillDetailInfoType.Info_Type_KillDragon) { if (flag2) { info.KillerImgSrc = KillNotify.monster_icon; } if (flag) { info.KillerImgSrc = KillNotify.building_icon; } if (flag3) { info.KillerImgSrc = GetHero_Icon(detail.Killer); } info.bSrcAllies = detail.bSelfCamp; return(info); } if (detail.bAllDead) { info.MsgType = KillDetailInfoType.Info_Type_AllDead; return(info); } if (detail.HeroContiKillType != type) { info.MsgType = detail.HeroContiKillType; return(info); } if (detail.Type == KillDetailInfoType.Info_Type_Kill) { return(info); } } return(info); }