Beispiel #1
0
        public void Run(int horseId)
        {
            MatchModule           matchModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule;
            UIBattleMainComponent uiComponent = matchModule.uIBattleMainComponent;

            if (uiComponent != null)
            {
                var    tips      = GameObjectTool.GetLanguage(50138133);
                string skillInfo = string.Format(tips, horseId);//$"<color=#24f50a>{horseId}号赛马</color>:开始冲刺";
                uiComponent.AddSkillInfo(skillInfo);
            }
        }
Beispiel #2
0
        public void Run(int horseId, bool IsBursting)
        {
            MatchModule           matchModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule;
            UIBattleMainComponent uiComponent = matchModule.uIBattleMainComponent;

            if (uiComponent != null)
            {
                string skillInfo = "";
                var    start     = GameObjectTool.GetLanguage(50138133);
                var    stop      = GameObjectTool.GetLanguage(50139205);
                if (IsBursting)
                {
                    skillInfo = string.Format(start, horseId);// $"<color=#24f50a>{horseId}号赛马</color>:开始加速";
                }
                else
                {
                    skillInfo = string.Format(stop, horseId);//$"<color=#24f50a>{horseId}号赛马</color>:停止加速";
                }
                uiComponent.AddSkillInfo(skillInfo);
            }
        }
Beispiel #3
0
        public void Run(int horseId, int skillId, bool isRemove)
        {
            //GameRunMatchComponent gameRunMatchComponent = Game.Scene.GetComponent<GameRunMatchComponent>();
            //if (gameRunMatchComponent == null || gameRunMatchComponent.IsDisposed)
            //    return;

            MatchModule    matchModule   = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule;
            ModelHorseView findHorseView = matchModule.ModelHorseViewSet.Find(x => x.data.Id == horseId);

            //HorseView findHorseView = gameRunMatchComponent.GetHorseView(horseId);
            if (findHorseView == null)
            {
                Log.Error("没有这个马匹:" + horseId);
                return;
            }
            HorseSkillDefine horseSkillDefine = ModelComTools.Config.GetHorseSkillByID(skillId);

            if (horseSkillDefine == null)
            {
                Log.Error("没有这个技能:" + skillId);
                return;
            }
            List <int> skills = new List <int> {
                50080040, 50080041, 50080042, 50080043, 50080044, 50080045, 50080046, 50080047, 50080048, 50080049, 50080050, 50080051, 50080052, 50080053, 50080054, 50080055, 50080056, 50080057, 50080058, 50080059, 50080060, 50080061, 50080062, 50080063, 50080064, 50080065, 50080066, 50080067, 50080068, 50080069, 50080070
            };

            if (skills.Contains(horseSkillDefine.Name))
            {
                return;
            }
            string skillName = GameObjectTool.GetLanguage(horseSkillDefine.Name);
            string skillDesc = GameObjectTool.GetLanguage(horseSkillDefine.Describe);
            UIBattleMainComponent uiComponent = matchModule.uIBattleMainComponent;

            if (uiComponent != null)
            {
                var    tips      = GameObjectTool.GetLanguage(50138126);        //触发
                var    tips1     = GameObjectTool.GetLanguage(50138127);        //结束
                string skillInfo = string.Format(tips, horseId + 1, skillName); // $"<color=#24f50a>{horseId + 1}号赛马</color>:触发{skillName}技能";//,{skillDesc}";
                if (isRemove)
                {
                    skillInfo = string.Format(tips1, horseId + 1, skillName);//$"<color=#24f50a>{horseId + 1}号赛马</color>:技能{skillName}结束";
                }
                else
                {
                    if (horseSkillDefine.ExistTime > 0)
                    {
                        TimeCountDownComponent TimeCountDownComponentSkill = ComponentFactory.Create <TimeCountDownComponent>();
                        TimeCountDownComponentSkill.Init(horseSkillDefine.ExistTime, null, string.Empty, () =>
                        {
                            skillInfo = string.Format(tips1, horseId + 1, skillName);//$"<color=#24f50a>{horseId + 1}号赛马</color>:技能{skillName}结束";
                            uiComponent.AddSkillInfo(skillInfo);
                            TimeCountDownComponentSkill.Dispose();
                        });
                    }
                }
                uiComponent.AddSkillInfo(skillInfo);

                if (findHorseView.data.playerUid == matchModule.playerUID)
                {
                    uiComponent.SetSelfSkill(skillName, isRemove, skillId, horseSkillDefine.ExistTime);
                }
            }
        }