private static string GetCreepUIMessageCampInfoContent(Units inAttacker) { if (Singleton <PvpManager> .Instance.IsObserver) { return(PromptHelper.GetFriendlyText(inAttacker.TeamType)); } int num; if (inAttacker.isPlayer) { num = 162; } else if (inAttacker.isMyTeam) { num = 163; } else { num = 164; } SysPromptVo dataById = BaseDataMgr.instance.GetDataById <SysPromptVo>(num.ToString()); if (dataById != null) { return(LanguageManager.Instance.GetStringById(dataById.prompt_text)); } return(string.Empty); }
public static void Prompt(string id, string text) { SysPromptVo dataById = BaseDataMgr.instance.GetDataById <SysPromptVo>(id); if (dataById != null) { UIMessageBox.ShowMessage(LanguageManager.Instance.GetStringById(text), dataById.text_time, 0); AudioMgr.PlayUI(dataById.sound, null, false, false); } else { ClientLogger.Error("PromptHelper.Prompt: cannot found #" + id); } }
public static void ShowCreepInfo(CreepInfoType type, string arg, CreepHelper.CreepDeathData source = null) { string text = string.Empty; switch (type) { case CreepInfoType.creep_awake: if (arg != null) { SysPromptVo dataById = BaseDataMgr.instance.GetDataById <SysPromptVo>("150"); text = string.Format(LanguageManager.Instance.GetStringById(dataById.prompt_text), arg); if (dataById != null) { CreepHelper.CreepAwakeParam item = new CreepHelper.CreepAwakeParam(text, dataById.text_time, 629); CreepHelper._waittingQueue.Enqueue(item); if (CreepHelper.curTask == null) { CreepHelper.curTask = new Task(CreepHelper.DelayBrocast(), true); } } } break; case CreepInfoType.creep_killed: if (source != null && source.Attacker != null && source.Creep != null) { int num = (source.Attacker.teamType != 0) ? 151 : 152; SysPromptVo dataById = BaseDataMgr.instance.GetDataById <SysPromptVo>(num.ToString()); string stringById = LanguageManager.Instance.GetStringById(dataById.prompt_text); EntityType attackerType; if (source.Attacker.isBuilding) { attackerType = EntityType.Tower; } else if (source.Attacker.isMonster) { attackerType = EntityType.Monster; } else { attackerType = EntityType.Hero; } string sound = dataById.sound2; string promptId = PromptHelper.CreepKilledId(source.Attacker); UIMessageBox.ShowKillPrompt(promptId, "[]", source.Attacker.npc_id, attackerType, EntityType.Creep, string.Empty, string.Empty, TeamType.None, TeamType.None); } break; } }
public static void PromptFormat(string id, params object[] args) { SysPromptVo dataById = BaseDataMgr.instance.GetDataById <SysPromptVo>(id); if (dataById != null) { try { string mess = string.Format(LanguageManager.Instance.GetStringById(dataById.prompt_text), args); UIMessageBox.ShowMessage(mess, dataById.text_time, 0); } catch (Exception e) { ClientLogger.LogException(e); } AudioMgr.PlayUI(dataById.sound, null, false, false); } else { ClientLogger.Error("PromptHelper.Prompt: cannot found #" + id); } }
private void ReadExcel(string rowId, ref int val) { SysPromptVo dataById = BaseDataMgr.instance.GetDataById <SysPromptVo>(rowId); if (dataById != null) { string[] array = dataById.PromptCondition.Split(new char[] { '|' }); if (array.Length > 1) { val = int.Parse(array[1]); } else { ClientLogger.Warn(rowId + " data in Prompt is error"); } } else { ClientLogger.Warn(rowId + " data in Prompt is none"); } }
public void BrocastAchievement(int attackId, int deathId, KillType killtype, List <int> helpers, int killWithTime, int killNoTime, string typeId) { Units units = null; if (attackId != 0) { units = MapManager.Instance.GetUnit(attackId); } Units unit = MapManager.Instance.GetUnit(deathId); if (unit == null) { ClientLogger.Error("Can't get units: " + deathId); return; } TeamType teamType = (TeamType)unit.teamType; int unique_id = unit.unique_id; string npc_id = unit.npc_id; bool flag = teamType != (TeamType)PlayerControlMgr.Instance.GetPlayer().teamType; if (attackId == 0) { SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(typeId); if (monsterMainData != null) { int item_type = monsterMainData.item_type; EntityType attackerType = EntityType.None; string promptId = (!flag) ? "1100" : "1099"; if (Singleton <PvpManager> .Instance.IsObserver) { promptId = ((teamType != TeamType.BL) ? ((teamType != TeamType.LM) ? "1103" : "1102") : "1101"); } if (item_type == 1) { attackerType = EntityType.Monster; } else if (item_type == 3 || item_type == this._bossType) { attackerType = EntityType.Creep; } else if (item_type == 2 || item_type == 4) { attackerType = EntityType.Tower; } UIMessageBox.ShowKillPrompt(promptId, monsterMainData.npc_id, npc_id, attackerType, EntityType.None, string.Empty, string.Empty, units.TeamType, unit.TeamType); return; } UnityEngine.Debug.LogError("can't get monster data with type id:" + typeId); return; } else { if (units == null) { ClientLogger.Error("Can't get units: " + attackId); return; } this.IncHeroDeath(teamType); TeamType teamType2 = (TeamType)units.teamType; int unique_id2 = units.unique_id; string npc_id2 = units.npc_id; SysPromptVo dataById = BaseDataMgr.instance.GetDataById <SysPromptVo>("201"); if (dataById != null) { float icon_time = dataById.icon_time; } List <string> list = new List <string>(); if (helpers != null) { foreach (int current in helpers) { Units unit2 = MapManager.Instance.GetUnit(current); if (unit2 != null) { list.Add(unit2.npc_id); } else { ClientLogger.Error("can't get hero with id:" + current); } } } HUDModuleMsgTools.CallBattleMsg_SiderTipsModule_Kill(npc_id2, npc_id, flag, list, units.TeamType, unit.TeamType); AchieveData achieveData = new AchieveData(attackId, units.npc_id, (TeamType)units.teamType); AchieveData achieveData2 = new AchieveData(deathId, unit.npc_id, (TeamType)unit.teamType); achieveData2.unittype = units.tag; if (killtype == KillType.StopKill) { achieveData.CheckAchievemtCondition(achieveData, achieveData2, KillType.StopKill); return; } if (killtype == KillType.FirstBoold) { achieveData.ContinusKillNoTime = 1; achieveData.ContinusKillWithTime = 1; } else { achieveData.ContinusKillNoTime = killNoTime; achieveData.ContinusKillWithTime = killWithTime; } achieveData.CheckAchievemtCondition(achieveData, achieveData2, killtype); return; } }