示例#1
0
文件: Action5401.cs 项目: 0jpq0/Scut
        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()
 {
     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;
 }
示例#3
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;
        }