Skip to content

Commit

Permalink
style: dnd
Browse files Browse the repository at this point in the history
修改DND作成格式为不对应具体属性
  • Loading branch information
mystringEmpty committed Mar 2, 2024
1 parent 8c98acf commit 56a7e2a
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 47 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-io_${{ matrix.triplet }}
package-name: aws-c-auth_${{ 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-io_${{ matrix.triplet }}
package-name: aws-c-auth_${{ 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-io_${{ matrix.triplet }}
package-name: aws-c-auth_${{ matrix.triplet }}
package-type: nuget
min-versions-to-keep: 0
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions Dice/Dice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void loadData(){
}
}
}
DD::debugLog("预加载selfdata" + to_string(selfdata_byStem.size()) + "");
if (selfdata_byStem.size())DD::debugLog("预加载selfdata" + to_string(selfdata_byStem.size()) + "");
}
if (!logList.empty())
{
Expand Down Expand Up @@ -887,22 +887,22 @@ EVE_GroupInvited(eventGroupInvited)
DD::answerGroupInvited(fromGID, 2);
}
else if (blacklist->get_user_danger(fromUID)){
strMsg += "\n已拒绝(黑名单用户)";
strMsg += "\n(黑名单用户×";
console.log(strMsg, 0b10, strNow);
DD::answerGroupInvited(fromGID, 2);
}
else if (Chat& grp = chat(fromGID); grp.is("许可使用")) {
grp.setLst(0);
grp.invited(fromUID);
strMsg += "\n已同意(已许可使用)";
strMsg += "\n(已许可使用";
console.log(strMsg, 1, strNow);
DD::answerGroupInvited(fromGID, 1);
}
else if (trustedQQ(fromUID))
{
grp.set("许可使用").reset("未审核").reset("协议无效");
grp.invited(fromUID);
strMsg += "\n已同意(信任用户)";
strMsg += "\n(信任用户";
console.log(strMsg, 1, strNow);
DD::answerGroupInvited(fromGID, 1);
}
Expand Down
27 changes: 24 additions & 3 deletions Dice/GlobalVar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,27 @@ bool Enabled = false;

std::string Dice_Short_Ver = "Dice! by 溯洄 & Shiki Ver " + Dice_Ver;
std::string Dice_Full_Ver_On;
#ifdef __clang__

#ifdef _MSC_VER
std::string Dice_Full_Ver = Dice_Short_Ver + " [CLANG " + std::to_string(__clang_major__) + "." + std::to_string(__clang_minor__) + "." + std::to_string(__clang_patchlevel__) + " with MSVC " + std::to_string(_MSC_VER) + " " + __DATE__ + " " + __TIME__;
#elif defined(__GNUC__)
std::string Dice_Full_Ver = Dice_Short_Ver + " [CLANG " + std::to_string(__clang_major__) + "." + std::to_string(__clang_minor__) + "." + std::to_string(__clang_patchlevel__) + " with GNUC " + std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__) + " " + __DATE__ + " " + __TIME__;
#else
std::string Dice_Full_Ver = Dice_Short_Ver + " [CLANG " + std::to_string(__clang_major__) + "." + std::to_string(__clang_minor__) + "." + std::to_string(__clang_patchlevel__);
#endif

#else
#ifdef _MSC_VER
std::string Dice_Full_Ver = std::string(Dice_Short_Ver) + "[MSVC " + std::to_string(_MSC_VER) + " " + __DATE__ +
" " + __TIME__ + "]";
#elif defined(__GNUC__)
std::string Dice_Full_Ver = Dice_Short_Ver + " [GNUC " + std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__) + " " + __DATE__ + " " + __TIME__;
#else
std::string Dice_Full_Ver = Dice_Short_Ver + " [UNKNOWN COMPILER";
#endif

#endif

//std::unique_ptr<ExtensionManager> ExtensionManagerInstance;

Expand Down Expand Up @@ -175,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 Down Expand Up @@ -515,6 +536,7 @@ const dict_ci<string> GlobalComment{
};
const dict_ci<> HelpDoc = {
{"更新",R"(
658:重写.dnd展示
657:角色卡模板支持别名
656:重做文本转义
655:st优化且增加触发时点
Expand All @@ -530,7 +552,6 @@ const dict_ci<> HelpDoc = {
645:重定义.sc回执
644:定义脚本内角色卡Actor类型
643:rc支持跨角色卡调用
642:优化helpdoc
641:SelfData支持yaml
640:支持调用JavaScript
639:支持reply调用python
Expand Down Expand Up @@ -740,7 +761,7 @@ const dict_ci<> HelpDoc = {
{"nn","设置群内称呼:.nn [昵称] / .nn / .nnn(cn/jp/en) \n.nn kp\t//昵称前的./!等符号会被自动忽略\n.nn del\t//删除当前窗口称呼\n.nn clr\t//删除所有记录的称呼\n.nnn\t//从随机姓名牌堆设置随机称呼\n.nnn jp\t/从指定子牌堆随机昵称\n私聊.nn视为操作全局称呼\n该称呼用于\\{nick\\}的显示,优先级:群内称呼>全局称呼>群名片>QQ昵称\n无角色卡或未命名时也用于显示\\{pc\\}"},
{"人物作成","该版本人物作成支持COC7(.coc、.draw调查员背景/英雄天赋)、COC6(.coc6、.draw煤气灯)、DND(.dnd)、AMGC(.draw AMGC)"},
{"coc","克苏鲁的呼唤(COC)人物作成:.coc([7/6])(d)([生成数量])\n.coc 10\t//默认生成7版人物\n.coc6d\t//接d为详细作成,一次只能作成一个\n仅用作骰点法人物作成,可应用变体规则,参考.rules创建调查员的其他选项"},
{"dnd","龙与地下城(DND)人物作成:.dnd([生成数量])\n.dnd 5\t//仅作参考,可自行应用变体规则"},
{"dnd","龙与地下城(DND)人物作成:.dnd (生成数量)\n例`.dnd 5` //生成6维降序排列,仅作参考,可自行应用变体规则"},
{"属性记录","&st"},
{"st","属性记录:.st (del/clr/show) ([属性名]:[属性值])\n用户默认所有群使用同一张卡,pl如需多开请使用.pc指令切卡\n.st力量:50 体质:55 体型:65 敏捷:45 外貌:70 智力:75 意志:35 教育:65 幸运:75\n.st hp-1 后接+/-时视为从原值上变化\n.st san+1d6 修改属性时可使用掷骰表达式\n.st del kp裁决\t//删除已保存的属性\n.st clr\t//清空当前卡\n.st show 灵感\t//查看指定属性\n.st show\t//无参数时查看所有属性,请使用只st加点过技能的半自动人物卡!\n部分COC属性会被视为同义词,如智力/灵感、理智/san、侦查/侦察"},
{"角色卡","&pc"},
Expand Down
26 changes: 2 additions & 24 deletions Dice/GlobalVar.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,13 @@
* Please Do not modify Dice_Build, Dice_Ver_Without_Build, DiceRequestHeader or Dice_Ver
* To costum version info, please modify const Dice_Short_Ver or Dice_Full_Ver
*/
constexpr unsigned short Dice_Build = 657u;
constexpr unsigned short Dice_Build = 658u;
inline const std::string Dice_Ver_Without_Build = "2.7.0beta7";
constexpr auto DiceRequestHeader = "Dice/2.7.0";
inline const std::string Dice_Ver = Dice_Ver_Without_Build + "(" + std::to_string(Dice_Build) + ")";
extern std::string Dice_Short_Ver;
constexpr bool isDev = true;

#ifdef __clang__

#ifdef _MSC_VER
inline const std::string Dice_Full_Ver = Dice_Short_Ver + " [CLANG " + std::to_string(__clang_major__) + "." + std::to_string(__clang_minor__) + "." + std::to_string(__clang_patchlevel__) + " with MSVC " + std::to_string(_MSC_VER) + " " + __DATE__ + " " + __TIME__;
#elif defined(__GNUC__)
inline const std::string Dice_Full_Ver = Dice_Short_Ver + " [CLANG " + std::to_string(__clang_major__) + "." + std::to_string(__clang_minor__) + "." + std::to_string(__clang_patchlevel__) + " with GNUC " + std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__) + " " + __DATE__ + " " + __TIME__;
#else
inline const std::string Dice_Full_Ver = Dice_Short_Ver + " [CLANG " + std::to_string(__clang_major__) + "." + std::to_string(__clang_minor__) + "." + std::to_string(__clang_patchlevel__);
#endif

#else

#ifdef _MSC_VER
inline const std::string Dice_Full_Ver = std::string(Dice_Short_Ver) + "[MSVC " + std::to_string(_MSC_VER) + " " + __DATE__ +
" " + __TIME__ + "]";
#elif defined(__GNUC__)
inline const std::string Dice_Full_Ver = Dice_Short_Ver + " [GNUC " + std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__) + " " + __DATE__ + " " + __TIME__;
#else
inline const std::string Dice_Full_Ver = Dice_Short_Ver + " [UNKNOWN COMPILER";
#endif

#endif
extern std::string Dice_Full_Ver;

#ifdef _WIN32
// DLL hModule
Expand Down
24 changes: 12 additions & 12 deletions Dice/RD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* Dice! QQ Dice Robot for TRPG
* Copyright (C) 2018-2021 w4123溯洄
* Copyright (C) 2019-2022 String.Empty
* Copyright (C) 2019-2024 String.Empty
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation,
Expand Down Expand Up @@ -647,23 +647,23 @@ string COC6(int intNum)

string DND(int intNum)
{
string strOutput;
string strOutput = "力量/体质/敏捷/智力/感知/魅力";
const RD rdDND("4D6K3");
string strDNDName[6] = {"力量", "体质", "敏捷", "智力", "感知", "魅力"};
const bool boolAddSpace = intNum != 1;
int intAllTotal = 0;
while (intNum--)
{
std::priority_queue<int> pool;
while (intNum--){
strOutput += "\n";
for (int i = 0; i <= 5; i++)
{
for (int i = 0; i <= 5; i++){
rdDND.Roll();
strOutput += strDNDName[i] + ":" + to_string(rdDND.intTotal) + " ";
if (rdDND.intTotal < 10 && boolAddSpace)
strOutput += " ";
pool.emplace(rdDND.intTotal);
intAllTotal += rdDND.intTotal;
}
strOutput += "共计:" + to_string(intAllTotal);
while (!pool.empty()) {
if (pool.top() < 10)strOutput += ' ';
strOutput += to_string(pool.top()) + " /";
pool.pop();
}
strOutput += "总计" + to_string(intAllTotal);
intAllTotal = 0;
}
return strOutput;
Expand Down
2 changes: 1 addition & 1 deletion Dice/RD.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* Dice! QQ Dice Robot for TRPG
* Copyright (C) 2018-2021 w4123溯洄
* Copyright (C) 2019-2023 String.Empty
* Copyright (C) 2019-2024 String.Empty
*
* This program is free software: you can redistribute it and/or modify it under the terms
* of the GNU Affero General Public License as published by the Free Software Foundation,
Expand Down

0 comments on commit 56a7e2a

Please sign in to comment.