| | |
| | |
|
| | | return ""
|
| | |
|
| | | def RMBToCoin(floatRMB):
|
| | | ''' 元转为分,统一函数,方便修改及搜索
|
| | | @param floatRMB: 单位元,float 类型,支持 RMB 或 美元
|
| | | @return: 转化为分数值
|
| | | def CoinToYuan(orderCoin, rate=1):
|
| | | '''coin转化为元
|
| | | '''
|
| | | # 由于float会有不精确的现象出现xxx.9999999的问题,所以这里计算出的结果向上取整
|
| | | return int(math.ceil(floatRMB * 100))
|
| | | yuan = orderCoin / float(rate)
|
| | | if str(yuan).endswith(".0"):
|
| | | return int(yuan)
|
| | | return yuan
|
| | |
|
| | | def RMBToCoin(floatRMB, rate=100):
|
| | | ''' 元转为coin,统一函数,方便修改及搜索
|
| | | @param floatRMB: 单位元,float 类型,支持 RMB 或 美元
|
| | | @param rate: 转化比例,越南版本配表及coin均使用越南盾原值,即比例为1:1,故默认值改1
|
| | | @return: 转化为coin数值
|
| | | '''
|
| | | # 由于float会有不精确的现象出现xxx.9999999或xxx.0000000000001的问题,所以这里计算出的结果向上取整
|
| | | return int(math.ceil(round(floatRMB * rate)))
|
| | |
|
| | | #64进制符号,前端用*号补空
|
| | | symbols64 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/'
|
| | | def Convert10To64(number):
|
| | | """将十进制数转换为64进制"""
|
| | | if number < 0:
|
| | | number = abs(number)
|
| | | result = ''
|
| | | while number > 0:
|
| | | result = symbols64[number % 64] + result
|
| | | number //= 64
|
| | | return result or '0'
|
| | |
|
| | | def Convert64To10(number64):
|
| | | """将64进制数转换为十进制"""
|
| | | value = 0
|
| | | for digit in number64:
|
| | | value = value * 64 + symbols64.index(digit)
|
| | | return value
|
| | |
|
| | | def ParseSetting(playerSetting, index, cLen=1):
|
| | | """解析玩家设置存储"""
|
| | | s = playerSetting[index:index+cLen]
|
| | | s = s.replace("*", "") # 前端*代表空
|
| | | if not s:
|
| | | return 0
|
| | | return Convert64To10(s)
|
| | |
|
| | | def ParseSetting_AutoSkillList(playerSetting, defaultSkillList):
|
| | | '''解析玩家设置 - 自动释放技能顺序列表
|
| | | @param playerSetting: 玩家设置保存串
|
| | | @param skillOrderList: 技能默认顺序列表
|
| | | '''
|
| | | playerSkillSetList = []
|
| | | SkillMatchPage = ParseSetting(playerSetting, 30, 1)
|
| | | fromIndex = 32 + SkillMatchPage * 15
|
| | | indexNum = 0
|
| | | for index in range(fromIndex, fromIndex + 15):
|
| | | skillIndex = indexNum
|
| | | v = ParseSetting(playerSetting, index, 1)
|
| | | if v:
|
| | | skillIndex = v - 1
|
| | | |
| | | if skillIndex >= len(defaultSkillList):
|
| | | break
|
| | | skillID = defaultSkillList[skillIndex]
|
| | | playerSkillSetList.append(skillID)
|
| | | indexNum += 1
|
| | | return playerSkillSetList
|
| | |
|