Esempio n. 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;
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 3
0
 public static void TryShowCreepSpecialEffect(string inBattleMonsterCreepId, Units inMonster)
 {
     if (inMonster == null)
     {
         return;
     }
     if (StringUtils.CheckValid(inBattleMonsterCreepId))
     {
         SysBattleMonsterCreepVo dataById      = BaseDataMgr.instance.GetDataById <SysBattleMonsterCreepVo>(inBattleMonsterCreepId);
         string fxNameByBattleMonsterCreepData = CreepHelper.GetFxNameByBattleMonsterCreepData(dataById, CreepFxType.creep_under_control);
         if (StringUtils.CheckValid(fxNameByBattleMonsterCreepData))
         {
             ActionManager.PlayEffect(fxNameByBattleMonsterCreepData, inMonster, null, null, true, string.Empty, null);
         }
     }
 }