示例#1
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;
 }