コード例 #1
0
        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;
            }
        }
コード例 #2
0
        public static void TryShowCreepUIMessageInfo(Units inAttacker, Units inCreep, string inBattleMonsterCreepId, int inOldGroupType)
        {
            if (inAttacker == null || inCreep == null)
            {
                return;
            }
            CreepInfoType creepInfoType = CreepHelper.GetCreepInfoType(inCreep, inBattleMonsterCreepId, inOldGroupType);

            if (creepInfoType == CreepInfoType.creep_none)
            {
                return;
            }
            string creepUIMessageCampInfoContent = CreepHelper.GetCreepUIMessageCampInfoContent(inAttacker);

            if (creepInfoType == CreepInfoType.creep_in_control)
            {
                string promptId = PromptHelper.CreepInControlId(inAttacker);
                UIMessageBox.ShowKillPrompt(promptId, inAttacker.npc_id, inCreep.npc_id, EntityType.Hero, EntityType.Creep, string.Empty, string.Empty, TeamType.None, TeamType.None);
            }
            else if (creepInfoType == CreepInfoType.creep_killed)
            {
                string promptId2 = PromptHelper.CreepKilledId(inAttacker);
                UIMessageBox.ShowKillPrompt(promptId2, inAttacker.npc_id, inCreep.npc_id, EntityType.Hero, EntityType.Creep, string.Empty, string.Empty, TeamType.None, TeamType.None);
            }
            else if (creepInfoType == CreepInfoType.creep_gold_killed)
            {
                if (inAttacker.isPlayer || inAttacker.isMyTeam)
                {
                    string promptId3 = PromptHelper.CreepGoldKilledId(inAttacker);
                    UIMessageBox.ShowKillPrompt(promptId3, inAttacker.npc_id, inCreep.npc_id, EntityType.Hero, EntityType.Creep, string.Empty, string.Empty, TeamType.None, TeamType.None);
                }
            }
            else if (creepInfoType == CreepInfoType.creep_gold_plundered)
            {
                string promptId4 = PromptHelper.CreepGoldPlunderedId(inAttacker);
                UIMessageBox.ShowKillPrompt(promptId4, inAttacker.npc_id, inCreep.npc_id, EntityType.Hero, EntityType.Creep, string.Empty, string.Empty, TeamType.None, TeamType.None);
            }
            else if (creepInfoType == CreepInfoType.creep_spawn_assistantcreep)
            {
                string promptId5 = PromptHelper.AssistantCreepKilledId(inAttacker);
                UIMessageBox.ShowKillPrompt(promptId5, inAttacker.npc_id, inCreep.npc_id, EntityType.Hero, EntityType.Creep, string.Empty, string.Empty, TeamType.None, TeamType.None);
            }
            else if (creepInfoType == CreepInfoType.creep_spawn_assistantsoldier)
            {
                string promptId6 = PromptHelper.SoldierCreepKilledId(inAttacker);
                UIMessageBox.ShowKillPrompt(promptId6, inAttacker.npc_id, inCreep.npc_id, EntityType.Hero, EntityType.Creep, string.Empty, string.Empty, TeamType.None, TeamType.None);
            }
        }
コード例 #3
0
    public static void BrocastMsg(string promptId, string selfName, string targetName, TeamType selfTeam, TeamType targetTeam, string selfSummerName = "", string targetSummerName = "")
    {
        Units player = PlayerControlMgr.Instance.GetPlayer();

        if (null == player)
        {
            return;
        }
        EntityType attackerType = EntityType.Hero;

        if (LevelManager.Instance.IsPvpBattleType)
        {
            UIMessageBox.ShowKillPrompt(promptId, selfName, targetName, attackerType, EntityType.None, selfSummerName, targetSummerName, selfTeam, targetTeam);
        }
        else
        {
            UIMessageBox.ShowKillPrompt(promptId, selfName, targetName, attackerType, EntityType.None, string.Empty, string.Empty, TeamType.None, TeamType.None);
        }
    }
コード例 #4
0
    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;
        }
    }