コード例 #1
0
ファイル: Action5405.cs プロジェクト: rongxiong/Scut
 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;
 }