Skip to content

Commit

Permalink
新增ra指令的记录功能
Browse files Browse the repository at this point in the history
  • Loading branch information
lunzhiPenxil committed Dec 27, 2023
1 parent 3688678 commit d9d2955
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions OlivaDiceCore/msgReply.py
Original file line number Diff line number Diff line change
Expand Up @@ -3912,6 +3912,13 @@ def unity_reply(plugin_event, Proc):
'roll': rd_para.resInt,
'skill': tmp_skill_value
}
OlivaDiceCore.onediceOverride.saveRDDataUser(
data = rd_para,
botHash = plugin_event.bot_info.hash,
userId = tmp_pc_id,
platform = tmp_pc_platform,
skillValue = tmp_skill_value
)
tmpSkillCheckType = OlivaDiceCore.skillCheck.getSkillCheckByTemplate(
dictRuleTempData,
tmp_Template,
Expand Down
10 changes: 9 additions & 1 deletion OlivaDiceCore/onediceOverride.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def random(self, nMin, nMax, mode = None):

OlivaDiceCore.onedice.RD = RD

def saveRDDataUser(data:OlivaDiceCore.onedice.RD, botHash:str, userId:str, platform:str):
def saveRDDataUser(data:OlivaDiceCore.onedice.RD, botHash:str, userId:str, platform:str, skillValue:'None|int' = None):
if data.resError == None:
OlivaDiceCore.userConfig.setUserConfigByKey(
userConfigKey = 'RDRecord',
Expand Down Expand Up @@ -142,6 +142,14 @@ def saveRDDataUser(data:OlivaDiceCore.onedice.RD, botHash:str, userId:str, platf
userType = 'user',
platform = platform
)
OlivaDiceCore.userConfig.setUserConfigByKey(
userConfigKey = 'RDRecordSkillInt',
userConfigValue = skillValue,
botHash = botHash,
userId = userId,
userType = 'user',
platform = platform
)
OlivaDiceCore.userConfig.writeUserConfigByUserHash(
userHash = OlivaDiceCore.userConfig.getUserHash(
userId = userId,
Expand Down
1 change: 1 addition & 0 deletions OlivaDiceCore/userConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
'RDRecord' : None,
'RDRecordInt' : 0,
'RDRecordRaw' : '',
'RDRecordSkillInt' : None,
'userName' : '用户',
'trustLevel' : 0,
'trustRank' : 1000
Expand Down

0 comments on commit d9d2955

Please sign in to comment.