Пример #1
0
        public override bool TakeAction()
        {
            if (CombatHelper.IsBossKill(_activeId))
            {
                this.ErrorCode = 1;
                this.ErrorInfo = LanguageManager.GetLang().St5405_BossKilled;
                return(false);
            }
            BossCombat bossCombat = new BossCombat(_activeId);

            _gameActive = bossCombat.GameActive;
            CombatStatus combatStatus = _gameActive.RefreshStatus();

            if (combatStatus == CombatStatus.Wait || combatStatus == CombatStatus.Combat)
            {
                bossCombat.Append(ContextUser);
                BossUser bossUser = bossCombat.GetCombatUser(Uid);
                if (bossUser != null)
                {
                    _inspirePercent       = bossUser.InspirePercent;
                    _reliveInspirePercent = bossUser.ReliveInspirePercent;
                    _reLiveNum            = bossUser.ReliveNum;
                    _combatNum            = bossUser.CombatNum;
                    _damageNum            = bossUser.DamageNum;
                    _codeTime             = bossUser.CodeTime;
                }
            }
            List <BossUser> userList = bossCombat.GetCombatUser();

            _regNum = userList.Count;
            int recordCount = 0;

            _bossUserList = userList.GetPaging(_pageIndex, _pageSize, out recordCount);

            CombatGeneral boss = bossCombat.Boss;

            if (boss != null)
            {
                _bossLiftNum = boss.LifeNum;
                _bossMaxLift = boss.LifeMaxNum;
            }
            return(true);
        }
Пример #2
0
        public override bool TakeAction()
        {
            if (!VipHelper.GetVipOpenFun(ContextUser.VipLv, ExpandType.BossChongSheng))
            {
                this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                this.ErrorInfo = LanguageManager.GetLang().St_VipNotEnoughNotFuntion;
                return(false);
            }
            if (CombatHelper.IsBossKill(_activeId))
            {
                this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                this.ErrorInfo = LanguageManager.GetLang().St5405_BossKilled;
                return(false);
            }
            BossCombat   bossCombat   = new BossCombat(_activeId);
            GameActive   gameActive   = bossCombat.GameActive;
            CombatStatus combatStatus = gameActive.CombatStatus;

            if (combatStatus != CombatStatus.Wait && combatStatus != CombatStatus.Combat)
            {
                this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                this.ErrorInfo = LanguageManager.GetLang().St5402_CombatNoStart;
                return(false);
            }
            this.ErrorCode = Ops;

            BossUser bossUser = bossCombat.GetCombatUser(Uid);

            if (bossUser != null && !bossUser.IsRelive)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St5403_IsLive;
                return(false);
            }
            if (bossUser != null && bossUser.ReliveNum >= MaxNum)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St5403_IsReLiveMaxNum;
                return(false);
            }
            int goldNum = GoldNum * (bossUser.ReliveNum + 1);

            if (Ops == 1)
            {
                ErrorInfo = string.Format(LanguageManager.GetLang().St5403_CombatGoldTip, goldNum);
            }
            else if (Ops == 2)
            {
                if (ContextUser.GoldNum < goldNum)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
                    return(false);
                }
                if (bossUser != null && bossUser.IsRelive)
                {
                    ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, goldNum, int.MaxValue);
                    //ContextUser.Update();
                    bossUser.IsRelive             = false;
                    bossUser.ReliveBeginDate      = DateTime.MinValue;
                    bossUser.ReliveInspirePercent = MathUtils.Addition(bossUser.ReliveInspirePercent, CountryCombat.InspireIncrease, 1);
                    _reliveInspirePercent         = bossUser.ReliveInspirePercent;
                    bossUser.ReliveNum++;
                }
            }
            return(true);
        }
Пример #3
0
        public override bool TakeAction()
        {
            if (ContextUser.VipLv < 3)
            {
                this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                this.ErrorInfo = LanguageManager.GetLang().St_VipNotEnough;
                return(false);
            }
            if (CombatHelper.IsBossKill(_activeId))
            {
                this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                this.ErrorInfo = LanguageManager.GetLang().St5405_BossKilled;
                return(false);
            }
            BossCombat   bossCombat   = new BossCombat(_activeId);
            GameActive   gameActive   = bossCombat.GameActive;
            CombatStatus combatStatus = gameActive.CombatStatus;

            if (combatStatus != CombatStatus.Wait && combatStatus != CombatStatus.Combat)
            {
                this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                this.ErrorInfo = LanguageManager.GetLang().St5402_CombatNoStart;
                return(false);
            }
            this.ErrorCode = ops;
            if (ops == 1)
            {
                this.ErrorInfo = string.Format(LanguageManager.GetLang().St5202_InspireTip, ExpNum);
            }
            else if (ops == 2)
            {
                if (ContextUser.ExpNum < ExpNum)
                {
                    this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                    this.ErrorInfo = LanguageManager.GetLang().St_ExpNumNotEnough;
                    return(false);
                }
                if (!bossCombat.Inspire(Uid, false, out inspirePercent))
                {
                    this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                    this.ErrorInfo = LanguageManager.GetLang().St_InspireFailed;
                }
                ContextUser.ExpNum = MathUtils.Subtraction(ContextUser.ExpNum, ExpNum, 0);
                //ContextUser.Update();
            }
            else if (ops == 3)
            {
                this.ErrorInfo = string.Format(LanguageManager.GetLang().St5202_InspireGoldTip, GlodNum);
            }
            else if (ops == 4)
            {
                if (ContextUser.GoldNum < GlodNum)
                {
                    this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                    this.ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
                    return(false);
                }
                if (!bossCombat.Inspire(Uid, true, out inspirePercent))
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St_InspireFailed;
                }
                ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, GlodNum, int.MaxValue);
                //ContextUser.Update();
            }
            return(true);
        }
Пример #4
0
        public override bool TakeAction()
        {
            BossCombat   bossCombat   = new BossCombat(_activeId);
            GameActive   gameActive   = bossCombat.GameActive;
            CombatStatus combatStatus = gameActive.RefreshStatus();

            if (combatStatus == CombatStatus.Killed || CombatHelper.IsBossKill(_activeId))
            {
                this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                this.ErrorInfo = LanguageManager.GetLang().St5405_BossKilled;
                return(false);
            }
            else if (combatStatus == CombatStatus.Wait)
            {
                this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                this.ErrorInfo = LanguageManager.GetLang().St5405_CombatWait;
                return(false);
            }
            else if (combatStatus == CombatStatus.Over)
            {
                this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                this.ErrorInfo = LanguageManager.GetLang().St5405_CombatOver;
                return(false);
            }
            else if (combatStatus == CombatStatus.Combat)
            {
                var cuser = bossCombat.GetCombatUser(Uid);
                if (cuser != null && cuser.CodeTime > 0)
                {
                    this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                    this.ErrorInfo = LanguageManager.GetLang().St5402_IsReliveError;
                    return(false);
                }
                var boss = bossCombat.Boss;
                if (boss.IsOver)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St5405_BossKilled;
                    return(false);
                }
                lock (thisLock)
                {
                    if (boss.IsOver)
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().St5405_BossKilled;
                        return(false);
                    }
                    IsWin = bossCombat.Combat(ContextUser, bossProcess);
                }
                _userTalPriority = CombatHelper.TotalPriorityNum(ContextUser.UserID, 0);
                _npcTalPriority  = 0;
            }
            else
            {
                this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                this.ErrorInfo = LanguageManager.GetLang().St5402_CombatNoStart;
                return(false);
            }
            selfAbilityEffectList = UserAbilityHelper.GetSelfAbilityEffectList(ContextUser.UserID, 0);
            return(true);
        }