@@ -1762,13 +1762,19 @@ int DiceEvent::InnerOrder() {
17621762 reply (getMsg (" strDefaultCOCSet" ) + " 5\n 出1-2且<五分之一大成功\n 不满50出96-100大失败,满50出99-100大失败" );
17631763 break ;
17641764 case 6 :
1765- reply (getMsg (" strDefaultCOCSet" ) + " 6\n 绿色三角洲\n 出1或出个位十位相同且<=成功率大成功\n 出100或出个位十位相同且>成功率大失败" );
1765+ reply (getMsg (" strDefaultCOCSet" ) + " 6-绿色三角洲\n 出1或出个位十位相同且<=成功率大成功\n 出100或出个位十位相同且>成功率大失败" );
1766+ break ;
1767+ case 7 :
1768+ reply (getMsg (" strDefaultCOCSet" ) + " 7-BRP\n 简单难度成功率翻倍,五分之一成功率特殊成功\n 出96-100必定失败且视成功率判大失败" );
17661769 break ;
17671770 default :
17681771 replyMsg (" strDefaultCOCNotFound" );
17691772 return 1 ;
17701773 }
17711774 if (isPrivate ())getUser (fromChat.uid ).setConf (" rc房规" , intRule);
1775+ else if (auto game{ thisGame () }) {
1776+ game->set (" rr_rc" , intRule);
1777+ }
17721778 else chat (fromChat.gid ).set (" rc房规" , intRule);
17731779 return 1 ;
17741780 }
@@ -3535,8 +3541,9 @@ int DiceEvent::InnerOrder() {
35353541 replyHelp (" rc" );
35363542 return 1 ;
35373543 }
3538- int intRule = isPrivate ()
3539- ? getUser (fromChat.uid ).getConf (" rc房规" , console[" DefaultCOCRoomRule" ])
3544+ auto game{ thisGame () };
3545+ int intRule = isPrivate () ? getUser (fromChat.uid ).getConf (" rc房规" , console[" DefaultCOCRoomRule" ])
3546+ : (game && game->has (" rr_rc" )) ? game->get_int (" rr_rc" )
35403547 : chat (fromChat.gid ).getConf (" rc房规" , console[" DefaultCOCRoomRule" ]);
35413548 int intTurnCnt = 1 ;
35423549 if (strMsg[intMsgCnt] == ' h' && isspace (static_cast <unsigned char >(strMsg[intMsgCnt + 1 ]))) {
@@ -3563,6 +3570,7 @@ int DiceEvent::InnerOrder() {
35633570 // 困难等级
35643571 string strDifficulty;
35653572 int intDifficulty = 1 ;
3573+ int multiSuccess = 1 ;
35663574 int intSkillModify = 0 ;
35673575 // 乘数
35683576 int intSkillMultiple = 1 ;
@@ -3572,7 +3580,6 @@ int DiceEvent::InnerOrder() {
35723580 bool isAutomatic = false ;
35733581 // D100且有角色卡时计入统计
35743582 bool isStatic = PList.count (fromChat.uid );
3575- auto game{ thisGame () };
35763583 bool isRoulette = game && game->is_part (fromChat.uid ) && game->roulette .count (100 );
35773584 PC pc{ isStatic ? PList[fromChat.uid ][fromChat.gid ] : std::make_shared<CharaCard>(0 )};
35783585 if ((strLowerMessage[intMsgCnt] == ' p' || strLowerMessage[intMsgCnt] == ' b' ) && strLowerMessage[intMsgCnt - 1 ] != ' ' ) {
@@ -3618,9 +3625,16 @@ int DiceEvent::InnerOrder() {
36183625 attr = attr.substr (12 );
36193626 isAutomatic = true ;
36203627 }
3621- if (attr.find (" 困难" ) == 0 || attr.find (" 极难" ) == 0 || attr.find (" 极限" ) == 0 ) {
3622- strDifficulty += attr.substr (0 , 6 );
3623- intDifficulty = (attr.substr (0 , 6 ) == " 困难" ) ? 2 : 5 ;
3628+ if (attr.find (" 困难" ) == 0 || attr.find (" 极难" ) == 0 || attr.find (" 极限" ) == 0
3629+ || attr.find (" 简单" ) == 0 ) {
3630+ string adj{ attr.substr (0 , 6 ) };
3631+ strDifficulty += adj;
3632+ if (adj != " 简单" ) {
3633+ intDifficulty = (adj == " 困难" ) ? 2 : 5 ;
3634+ }
3635+ else {
3636+ multiSuccess = 2 ;
3637+ }
36243638 attr = attr.substr (6 );
36253639 }
36263640 if (pc) {
@@ -3675,7 +3689,7 @@ int DiceEvent::InnerOrder() {
36753689 intSkillVal = stoi (strSkillVal);
36763690 }
36773691 // 最终成功率计入检定统计
3678- int intFianlSkillVal = (intSkillVal * intSkillMultiple + intSkillModify) / intSkillDivisor / intDifficulty;
3692+ int intFianlSkillVal = (intSkillVal * intSkillMultiple + intSkillModify) * multiSuccess / intSkillDivisor / intDifficulty;
36793693 if (intFianlSkillVal < 0 || intFianlSkillVal > 1000 ) {
36803694 replyMsg (" strSuccessRateErr" );
36813695 return 1 ;
@@ -3707,23 +3721,22 @@ int DiceEvent::InnerOrder() {
37073721 pc->cntRcStat (rdMainDice.intTotal , intFianlSkillVal);
37083722 }
37093723 strAns = rdMainDice.FormCompleteString () + " /" + std::to_string (intFianlSkillVal) + " " ;
3710- int intRes = RollSuccessLevel (rdMainDice.intTotal , intFianlSkillVal, intRule);
3724+ auto intRes = RollSuccessLevel (rdMainDice.intTotal , intFianlSkillVal, intRule);
37113725 switch (intRes) {
3712- case 0 : strAns += getMsg (" strRollFumble" );
3726+ case SuccessLevel::Fumble : strAns += getMsg (" strRollFumble" );
37133727 break ;
3714- case 1 : strAns += isAutomatic ? getMsg (" strRollRegularSuccess" ) : getMsg (" strRollFailure" );
3728+ case SuccessLevel::Failure : strAns += isAutomatic ? getMsg (" strRollRegularSuccess" ) : getMsg (" strRollFailure" );
37153729 break ;
3716- case 5 : strAns += getMsg (" strRollCriticalSuccess" );
3730+ case SuccessLevel::Critical : strAns += getMsg (" strRollCriticalSuccess" );
37173731 break ;
3718- case 4 : if (intDifficulty == 1 ) {
3732+ case SuccessLevel::ExtremeSuccess:
37193733 strAns += getMsg (" strRollExtremeSuccess" );
37203734 break ;
3721- }
3722- case 3 : if (intDifficulty == 1 ) {
3735+ case SuccessLevel::HardSuccess: if (multiSuccess == 1 ) {
37233736 strAns += getMsg (" strRollHardSuccess" );
37243737 break ;
37253738 }
3726- case 2 : strAns += getMsg (" strRollRegularSuccess" );
3739+ case SuccessLevel::RegularSuccess : strAns += getMsg (" strRollRegularSuccess" );
37273740 break ;
37283741 }
37293742 strReply += strAns;
@@ -3737,23 +3750,23 @@ int DiceEvent::InnerOrder() {
37373750 pc->cntRcStat (rdMainDice.intTotal , intFianlSkillVal);
37383751 }
37393752 strAns = rdMainDice.FormCompleteString () + " /" + std::to_string (intFianlSkillVal) + " " ;
3740- int intRes = RollSuccessLevel (rdMainDice.intTotal , intFianlSkillVal, intRule);
3753+ auto intRes = RollSuccessLevel (rdMainDice.intTotal , intFianlSkillVal, intRule);
37413754 switch (intRes) {
3742- case 0 : strAns += getMsg (" strFumble" );
3755+ case SuccessLevel::Fumble : strAns += getMsg (" strFumble" );
37433756 break ;
3744- case 1 : strAns += isAutomatic ? getMsg (" strSuccess" ) : getMsg (" strFailure" );
3757+ case SuccessLevel::Failure : strAns += isAutomatic ? getMsg (" strSuccess" ) : getMsg (" strFailure" );
37453758 break ;
3746- case 5 : strAns += getMsg (" strCriticalSuccess" );
3759+ case SuccessLevel::Critical : strAns += getMsg (" strCriticalSuccess" );
37473760 break ;
3748- case 4 : if (intDifficulty == 1 ) {
3761+ case SuccessLevel::ExtremeSuccess : if (intDifficulty == 1 ) {
37493762 strAns += getMsg (" strExtremeSuccess" );
37503763 break ;
37513764 }
3752- case 3 : if (intDifficulty == 1 ) {
3765+ case SuccessLevel::HardSuccess : if (intDifficulty == 1 ) {
37533766 strAns += getMsg (" strHardSuccess" );
37543767 break ;
37553768 }
3756- case 2 : strAns += getMsg (" strSuccess" );
3769+ case SuccessLevel::RegularSuccess : strAns += getMsg (" strSuccess" );
37573770 break ;
37583771 }
37593772 Res << strAns;
@@ -3887,34 +3900,31 @@ int DiceEvent::InnerOrder() {
38873900 int intRule = fromChat.gid
38883901 ? chat (fromChat.gid ).getConf (" rc房规" , console[" DefaultCOCRoomRule" ])
38893902 : getUser (fromChat.uid ).getConf (" rc房规" , console[" DefaultCOCRoomRule" ]);
3890- int res = RollSuccessLevel (intTmpRollRes, intSan, intRule);
3903+ auto res = RollSuccessLevel (intTmpRollRes, intSan, intRule);
38913904 switch (res) {
3892- case 5 :
3893- case 4 :
3894- case 3 :
3895- case 2 :
3896- rdLoss = RD (strSanCostSuc);
3905+ case SuccessLevel::Failure:
3906+ rdLoss = RD (strSanCostFail);
38973907 if (rdLoss->Roll () != 0 ) {
38983908 replyMsg (" strSanCostInvalid" );
38993909 return 1 ;
39003910 }
39013911 set (" change" , rdLoss->FormShortString ());
39023912 break ;
3903- case 1 :
3913+ case SuccessLevel::Fumble :
39043914 rdLoss = RD (strSanCostFail);
3905- if (rdLoss->Roll () != 0 ) {
3915+ if (rdLoss->Max () != 0 ) {
39063916 replyMsg (" strSanCostInvalid" );
39073917 return 1 ;
39083918 }
3909- set (" change" , rdLoss->FormShortString ( ));
3919+ set (" change" ," Max{ " + rdLoss->strDice + " }= " + std::to_string (rdLoss-> intTotal ));
39103920 break ;
3911- case 0 :
3912- rdLoss = RD (strSanCostFail );
3913- if (rdLoss->Max () != 0 ) {
3921+ default :
3922+ rdLoss = RD (strSanCostSuc );
3923+ if (rdLoss->Roll () != 0 ) {
39143924 replyMsg (" strSanCostInvalid" );
39153925 return 1 ;
39163926 }
3917- set (" change" ," Max{ " + rdLoss->strDice + " }= " + std::to_string (rdLoss-> intTotal ));
3927+ set (" change" , rdLoss->FormShortString ( ));
39183928 break ;
39193929 }
39203930 AttrObject trans{ AnysTable{{
@@ -3926,7 +3936,7 @@ int DiceEvent::InnerOrder() {
39263936 intSan = max (0 , intSan - sanLoss);
39273937 trans->set (" new" , intSan);
39283938 set (" final" ,intSan);
3929- set (" rank" , res);
3939+ set (" rank" , int ( res) );
39303940 if (pc && sanLoss){
39313941 pc->set (attr, intSan);
39323942 set (" trans" , AnysTable{ AttrVars{
0 commit comments