public static void Process(NotifyTeamPos info) { int senderId = info.senderId; TeamSignalType signalType = (TeamSignalType)info.signalType; Position pos = info.pos; if (pos == null) { return; } if (!Singleton <PvpManager> .Instance.IsOurPlayer(senderId)) { return; } TeamSignalManager.TryUpdateCd(senderId, signalType); TeamSignalManager.CreateNotifyEffect(signalType, pos); switch (signalType) { case TeamSignalType.Danger: AudioMgr.Play("Play_SignalRisk", null, false, false); AudioMgr.Play("Play_CN_Risk", null, false, false); break; case TeamSignalType.Miss: AudioMgr.Play("Play_SignalMiss", null, false, false); break; case TeamSignalType.Converge: AudioMgr.Play("Play_SignalHelp", null, false, false); AudioMgr.Play("Play_CN_Help", null, false, false); break; case TeamSignalType.Fire: AudioMgr.Play("Play_SignalAttack", null, false, false); AudioMgr.Play("Play_CN_Gather", null, false, false); break; case TeamSignalType.Defense: AudioMgr.Play("Play_SignalDefense", null, false, false); break; case TeamSignalType.Goto: AudioMgr.Play("Play_SignalOntheWay", null, false, false); break; } Singleton <MiniMapView> .Instance.ShowTeamSignal(senderId, signalType, new Vector3(pos.x, pos.y, pos.z)); string playerHero = Singleton <PvpManager> .Instance.GetPlayerHero(senderId); HUDModuleMsgTools.CallBattleMsg_SiderTipsModule_Signal(playerHero, signalType); }
public void TryUpdateTargetIcon() { Units selectedTarget = this.GetSelectedTarget(); if (this.NeedUpdateTargetInfo(selectedTarget)) { HUDModuleMsgTools.Get_AttactTarget(selectedTarget); this.BackupTargetInfo(selectedTarget); } if (selectedTarget == null || !selectedTarget.isLive) { HUDModuleMsgTools.Get_AttactTarget(null); } }
public void SetSelectedTarget(Units target) { if (BattleCameraMgr.Instance == null || PlayerControlMgr.Instance == null || PlayerControlMgr.Instance.GetPlayer() == null) { return; } if (target != null && target.teamType == PlayerControlMgr.Instance.GetPlayer().teamType) { return; } if (target == null) { HUDModuleMsgTools.Get_AttactTarget(null); if (this._selectedTarget != null) { this._selectedTarget.MarkAsTarget(false); } this.CleanSelectTag(); } else { if (NewbieManager.Instance.IsForbidSelectTower(target)) { return; } if (target != this._selectedTarget) { if (this._selectedTarget != null) { this._selectedTarget.MarkAsTarget(false); this.CleanSelectTag(); } HUDModuleMsgTools.Get_AttactTarget(target); target.MarkAsTarget(true); this._selectedTarget = target; Singleton <TriggerManager> .Instance.SendGameStateEvent(GameEvent.ClickEnemyHero); BattleCameraMgr.Instance.SetTarget(this._selectedTarget); } NewbieManager.Instance.TryStopCheckSelEnemyHero(target); } }
public Units GetSelectedTarget() { if (this._selectedTarget != null && (!this._selectedTarget.isSelected || !this._selectedTarget.isLive)) { HUDModuleMsgTools.Get_AttactTarget(null); this._selectedTarget.MarkAsTarget(false); this._selectedTarget = null; this.ClearOtherTargetTag(); return(null); } Units player = MapManager.Instance.GetPlayer(); if (player != null && player.transform != null && this._selectedTarget != null && Vector3.Distance(this._selectedTarget.transform.position, player.transform.position) > this.maxselecteddistance) { this._selectedTarget.MarkAsTarget(false); HUDModuleMsgTools.Get_AttactTarget(null); this._selectedTarget = null; this.ClearOtherTargetTag(); return(null); } return(this._selectedTarget); }
private void SetAttackTarget(bool ismark) { if (this._player != null) { Units attackTarget = this._player.GetAttackTarget(); if (ismark) { if (attackTarget != null && attackTarget.isLive) { attackTarget.MarkAsTarget(true); this._selectedTarget = attackTarget; BattleCameraMgr.Instance.SetTarget(attackTarget); HUDModuleMsgTools.Get_AttactTarget(attackTarget); } } else if (this._selectedTarget != null) { this._selectedTarget.MarkAsTarget(false); HUDModuleMsgTools.Get_AttactTarget(null); } } }
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; } }