Skip to content

Commit

Permalink
fix: game is_part
Browse files Browse the repository at this point in the history
DND指令移除属性名显示
调换Game指令与全局指令的触发顺序
玩家列表为空时置is_part判定条件始终为真
  • Loading branch information
mystringEmpty committed Mar 11, 2024
1 parent 56a7e2a commit 752fbf4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Package Clear
uses: actions/delete-package-versions@v4
with:
package-name: aws-c-auth_${{ matrix.triplet }}
package-name: aws-c-mqtt_${{ matrix.triplet }}
package-type: nuget
min-versions-to-keep: 1
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
- name: Package Clear
uses: actions/delete-package-versions@v4
with:
package-name: aws-c-auth_${{ matrix.triplet }}
package-name: aws-c-mqtt_${{ matrix.triplet }}
package-type: nuget
min-versions-to-keep: 0
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -261,7 +261,7 @@ jobs:
- name: Package Clear
uses: actions/delete-package-versions@v4
with:
package-name: aws-c-auth_${{ matrix.triplet }}
package-name: aws-c-mqtt_${{ matrix.triplet }}
package-type: nuget
min-versions-to-keep: 0
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
12 changes: 6 additions & 6 deletions Dice/DiceEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void DiceEvent::logEcho(){
}
if (auto game{ thisGame() }; game && game->is_logging()
&& strLowerMessage.find(".log") != 0
&& (game->is_simple() || game->is_part(fromChat.uid))) {
&& game->is_part(fromChat.uid)) {
ofstream logout(game->log_path(), ios::out | ios::app);
logout << GBKtoUTF8(getMsg("strSelfName")) + "(" + std::to_string(console.DiceMaid) + ") " + printTTime((time_t)get_ll("time")) << endl
<< GBKtoUTF8(filter_CQcode(strReply, fromChat.gid)) << endl << endl;
Expand All @@ -235,7 +235,7 @@ void DiceEvent::fwdMsg(){
}
if (auto game{ thisGame() }; game && game->is_logging()
&& strLowerMessage.find(".log") != 0
&& (game->is_simple() || game->is_part(fromChat.uid))) {
&& game->is_part(fromChat.uid)) {
ofstream logout(game->log_path(), ios::out | ios::app);
logout << GBKtoUTF8(idx_pc(*this).to_str()) + "(" + std::to_string(fromChat.uid) + ") " + printTTime((time_t)get_ll("time")) << endl
<< GBKtoUTF8(filter_CQcode(strMsg, fromChat.gid)) << endl << endl;
Expand Down Expand Up @@ -3129,7 +3129,7 @@ int DiceEvent::InnerOrder() {
}
if (strAttr.empty())strAttr = getMsg("strEnDefaultName");
auto game{ thisGame() };
const int intTmpRollRes = ( game && game->is_part(fromChat.uid)) ? game->roll(100) : RandomGenerator::Randint(1, 100);
const int intTmpRollRes = (game && game->is_part(fromChat.uid)) ? game->roll(100) : RandomGenerator::Randint(1, 100);
//成长检定仅计入掷骰统计,不计入检定统计
if (pc)pc->cntRollStat(intTmpRollRes, 100);
string& res{ (at("res") = "1D100=" + std::to_string(intTmpRollRes) + "/" + std::to_string(intVal) + " ").text};
Expand Down Expand Up @@ -4546,9 +4546,6 @@ bool DiceEvent::DiceFilter()
isDisabled = true;
}
if (isDisabled || blacklist->get_user_danger(fromChat.uid) > 0)return 1;
if (!is("order_off") && (fmt->listen_order(this) || InnerOrder())) {
return monitorFrq();
}
if (auto game{ thisGame() }) {
if (auto ruleName{ getGameRule() }; ruleName
&& (game->is_part(fromChat.uid))
Expand All @@ -4562,6 +4559,9 @@ bool DiceEvent::DiceFilter()
return monitorFrq();
}
}
if (!is("order_off") && (fmt->listen_order(this) || InnerOrder())) {
return monitorFrq();
}
if (fmt->listen_reply(this)) {
return monitorFrq();
}
Expand Down
2 changes: 1 addition & 1 deletion Dice/DiceSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class DiceSession: public AnysTable{
}
bool del_pl(long long uid);
bool is_simple() const { return player->empty() && master->empty(); }
bool is_part(long long uid) const { return player->count(uid) || master->count(uid); }
bool is_part(long long uid) const { return is_simple() || player->count(uid) || master->count(uid); }
bool del_ob(long long uid) {
if (obs->count(uid))obs->erase(uid);
else return false;
Expand Down
4 changes: 2 additions & 2 deletions Dice/GlobalVar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const dict_ci<string> PlainMsg
{"strPcLockedRead","{self}已锁定{pc},不予查看属性×" },
{"strSetDefaultDice","{self}已将{pc}的默认骰设置为D{default}√"},
{"strCOCBuild","{pc}的调查员作成:{res}"},
{"strDNDBuild","{pc}的冒险者作成:{res}"},
{"strDNDBuild","{pc}的冒险者生成随机六维(降序):{res}"},
{"strCensorCaution","提醒:{nick}的指令包含敏感词,{self}已上报"},
{"strCensorWarning","警告:{nick}的指令包含敏感词,{self}已记录并上报!"},
{"strCensorDanger","警告:{nick}的指令包含敏感词,{self}拒绝指令并已上报!"},
Expand All @@ -214,7 +214,7 @@ const dict_ci<string> PlainMsg
{"strReplyKeyNotFound","{self}未找到回复关键词{key}×"},
{"strScriptRunErr","{self}似乎出了点问题,请{nick}耐心等待({lang}脚本运行出错)" },
//{"strStModify","{self}已记录{pc}的{cnt}条属性变化:\n{change}"}, //存在技能值变化情况时,优先使用此文本
{"strStDetail","{self}已设置{pc}的{cnt}条属性:\n{detail}"}, //存在掷骰时,使用此文本
{"strStDetail","{self}已编辑{pc}的{cnt}条属性:\n{detail}"}, //存在掷骰时,使用此文本
//{"strStValEmpty","{self}未记录{attr}原值×"},
{"strBlackQQAddNotice","{nick},你已被{self}加入黑名单,详情请联系Master:{print:master}"},
{"strBlackQQAddNoticeReason","{nick},由于{reason},你已被{self}加入黑名单,申诉解封请联系管理员。Master:{print:master}"},
Expand Down
2 changes: 1 addition & 1 deletion Dice/RD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ string COC6(int intNum)

string DND(int intNum)
{
string strOutput = "力量/体质/敏捷/智力/感知/魅力";
string strOutput;
const RD rdDND("4D6K3");
int intAllTotal = 0;
std::priority_queue<int> pool;
Expand Down

0 comments on commit 752fbf4

Please sign in to comment.