Skip to content

Commit

Permalink
master配置项 等
Browse files Browse the repository at this point in the history
+ master配置项
- COC7默认规则修改为C0
  • Loading branch information
lunzhiPenxil committed Dec 1, 2021
1 parent 3a9c471 commit e685432
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 26 deletions.
8 changes: 7 additions & 1 deletion OlivaDiceCore/msgCustom.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
'strSetStr': '回复词[{tStrName}]已更新',
'strBecomeMaster': '口令正确,[{tName}]已成为Master',
'strCantBecomeMaster': '口令错误,拒绝认证',
'strMasterConsoleShow': '[{tConsoleKey}]当前为[{tConsoleValue}]',
'strMasterConsoleSet': '[{tName}]已将[{tConsoleKey}]设置为[{tConsoleValue}]',
'strMasterConsoleSetInvalid': '非法的配置值',
'strMasterConsoleNotFound': '无法访问的配置项',
'strNeedMaster': '需要Master权限',
'strHello': '欢迎使用本机器人! 请使用[.help]查看帮助',
'strBot': '欢迎使用本机器人! 请使用[.help]查看帮助',
Expand Down Expand Up @@ -158,5 +162,7 @@
'tInitMasterKey': '不可用',
'tInitDataType': '未知',
'tHelpDocResult': 'N/A',
'tDrawDeckResult': 'N/A'
'tDrawDeckResult': 'N/A',
'tConsoleKey': 'N/A',
'tConsoleValue': 'N/A'
}
40 changes: 37 additions & 3 deletions OlivaDiceCore/msgReply.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,48 @@ def unity_reply(plugin_event, Proc):
tmp_reply_str = dictStrCustom['strBotNotUnderHost'].format(**dictTValue)
replyMsg(plugin_event, tmp_reply_str)
return
else:
tmp_reast_str = tmp_reast_str.strip(' ')
tmp_reast_list = tmp_reast_str.split(' ')
if len(tmp_reast_list) == 1:
if plugin_event.bot_info.hash in OlivaDiceCore.console.dictConsoleSwitch:
if tmp_reast_list[0] in OlivaDiceCore.console.dictConsoleSwitch[plugin_event.bot_info.hash]:
if type(OlivaDiceCore.console.dictConsoleSwitch[plugin_event.bot_info.hash][tmp_reast_list[0]]) == int:
dictTValue['tConsoleKey'] = tmp_reast_list[0]
dictTValue['tConsoleValue'] = str(OlivaDiceCore.console.dictConsoleSwitch[plugin_event.bot_info.hash][tmp_reast_list[0]])
tmp_reply_str = dictStrCustom['strMasterConsoleShow'].format(**dictTValue)
replyMsg(plugin_event, tmp_reply_str)
return
tmp_reply_str = dictStrCustom['strMasterConsoleNotFound'].format(**dictTValue)
replyMsg(plugin_event, tmp_reply_str)
elif len(tmp_reast_list) > 1:
tmp_reast_str = ' '.join(tmp_reast_list[1:])
tmp_reast_str = tmp_reast_str.strip(' ')
if not tmp_reast_str.isdigit():
tmp_reply_str = dictStrCustom['strMasterConsoleSetInvalid'].format(**dictTValue)
replyMsg(plugin_event, tmp_reply_str)
return
if plugin_event.bot_info.hash in OlivaDiceCore.console.dictConsoleSwitch:
if tmp_reast_list[0] in OlivaDiceCore.console.dictConsoleSwitch[plugin_event.bot_info.hash]:
if type(OlivaDiceCore.console.dictConsoleSwitch[plugin_event.bot_info.hash][tmp_reast_list[0]]) == int:
OlivaDiceCore.console.dictConsoleSwitch[plugin_event.bot_info.hash][tmp_reast_list[0]] = int(tmp_reast_str)
OlivaDiceCore.console.saveConsoleSwitch()
dictTValue['tConsoleKey'] = tmp_reast_list[0]
dictTValue['tConsoleValue'] = tmp_reast_str
tmp_reply_str = dictStrCustom['strMasterConsoleSet'].format(**dictTValue)
replyMsg(plugin_event, tmp_reply_str)
return
tmp_reply_str = dictStrCustom['strMasterConsoleNotFound'].format(**dictTValue)
replyMsg(plugin_event, tmp_reply_str)
return
elif isMatchWordStart(tmp_reast_str, 'str'):
tmp_reast_str = tmp_reast_str.strip(' ')
tmp_reast_list = tmp_reast_str.split(' ')
if len(tmp_reast_list) == 1:
if tmp_reast_list[0] in OlivaDiceCore.msgCustom.dictStrCustomDict[plugin_event.bot_info.hash]:
tmp_reply_str = OlivaDiceCore.msgCustom.dictStrCustomDict[plugin_event.bot_info.hash][tmp_reast_list[0]]
replyMsg(plugin_event, tmp_reply_str)
if plugin_event.bot_info.hash in OlivaDiceCore.msgCustom.dictStrCustomDict:
if tmp_reast_list[0] in OlivaDiceCore.msgCustom.dictStrCustomDict[plugin_event.bot_info.hash]:
tmp_reply_str = OlivaDiceCore.msgCustom.dictStrCustomDict[plugin_event.bot_info.hash][tmp_reast_list[0]]
replyMsg(plugin_event, tmp_reply_str)
elif len(tmp_reast_list) >= 2:
tmp_new_str = ' '.join(tmp_reast_list[1:])
OlivaDiceCore.msgCustom.dictStrCustomUpdateDict[plugin_event.bot_info.hash][tmp_reast_list[0]] = tmp_new_str
Expand Down
64 changes: 42 additions & 22 deletions OlivaDiceCore/pcCardData.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,32 @@
]
},
'greatSuccess': {
'.and': [
{
'.>=': ['$roll', 1]
},
{
'.<=': ['$roll', 5]
}
]
'.==': ['$roll', 1]
},
'greatFail': {
'.and': [
'.or': [
{
'.>=': ['$roll', 96]
'.and': [
{
'.<': ['$skill', 50]
},
{
'.>=': ['$roll', 96]
},
{
'.<=': ['$roll', 100]
}
]
},
{
'.<=': ['$roll', 100]
'.and': [
{
'.>=': ['$skill', 50]
},
{
'.==': ['$roll', 100]
}
]
}
]
}
Expand Down Expand Up @@ -229,22 +239,32 @@
]
},
'greatSuccess': {
'.and': [
{
'.>=': ['$roll', 1]
},
{
'.<=': ['$roll', 5]
}
]
'.==': ['$roll', 1]
},
'greatFail': {
'.and': [
'.or': [
{
'.>=': ['$roll', 96]
'.and': [
{
'.<': ['$skill', 50]
},
{
'.>=': ['$roll', 96]
},
{
'.<=': ['$roll', 100]
}
]
},
{
'.<=': ['$roll', 100]
'.and': [
{
'.>=': ['$skill', 50]
},
{
'.==': ['$roll', 100]
}
]
}
]
}
Expand Down

0 comments on commit e685432

Please sign in to comment.