-
Notifications
You must be signed in to change notification settings - Fork 9
/
guoba.support.js
222 lines (218 loc) · 6.64 KB
/
guoba.support.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
import setting, {setting as pluginSetting} from './GachaMOD/Genshin/model/setting.js'
import lodash from "lodash";
import { pluginResources } from "./model/path.js";
import path from 'path'
export function supportGuoba () {
return {
pluginInfo: {
name: 'flower-plugin',
title: '抽卡插件',
author: '@听语惊花',
authorLink: 'https://github.com/Nwflower',
link: 'https://github.com/Nwflower/flower-plugin',
isV3: true,
isV2: false,
description: '集百连与单抽于一体的综合性模拟抽卡插件',
icon: 'iconoir:3d-three-pts-box',
iconColor: '#d19f56',
iconPath: path.join(pluginResources, 'img/logo_flower_plugin.png'),
},
configInfo: {
schemas: [
{
field: 'gacha.enable',
label: '自定义抽卡',
bottomHelpMessage: '使用抽卡插件的抽卡服务',
component: 'Switch'
},
{
field: 'wordListener.enable',
label: '违禁词开关',
bottomHelpMessage: '开启违禁词监听',
component: 'Switch'
},
{
field: 'block.enable',
label: '隐形拉黑开关',
bottomHelpMessage: '开启隐形拉黑',
component: 'Switch'
},
{
field: 'gacha.more',
label: '百连开关',
bottomHelpMessage: '关闭后,无法使用二十连、三十连以及百连',
component: 'Switch'
},
{
field: 'wordListener.time',
label: '违禁词禁言时长',
bottomHelpMessage: '禁言时长,秒',
component: 'InputNumber',
required: false,
componentProps: {
min: 1,
max: 86400,
placeholder: '请设置时长'
}
},
{
field: 'coin.default.pink',
label: '每日纠缠之缘',
bottomHelpMessage: '全局通用',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 10000,
placeholder: '请输入数量'
}
},
{
field: 'coin.default.blue',
label: '每日相遇之缘',
bottomHelpMessage: '全局通用',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 10000,
placeholder: '请输入数量'
}
},
{
field: 'gacha.relifeCD',
label: '转生CD',
bottomHelpMessage: 'CD时长,单位分钟',
component: 'InputNumber',
required: false,
componentProps: {
min: 1,
max: 1440,
placeholder: '请输入时长'
}
},
{
field: 'gacha.wai',
label: '小保底概率',
bottomHelpMessage: '小保底必中概率',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 100,
placeholder: '请输入概率'
}
},
{
field: 'gacha.chance5',
label: '五星角色概率',
bottomHelpMessage: '角色池5星的出货概率,0-10000',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 10000,
placeholder: '请输入概率'
}
},
{
field: 'gacha.chance4',
label: '四星角色概率',
bottomHelpMessage: '角色池4星的出货概率,0-10000',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 10000,
placeholder: '请输入概率'
}
},
{
field: 'gacha.chanceW5',
label: '五星武器概率',
bottomHelpMessage: '武器池5星的出货概率,0-10000',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 10000,
placeholder: '请输入概率'
}
},
{
field: 'gacha.chanceW4',
label: '四星武器概率',
bottomHelpMessage: '武器池4星的出货概率,0-10000',
component: 'InputNumber',
required: true,
componentProps: {
min: 0,
max: 10000,
placeholder: '请输入概率'
}
},
{
field: 'gacha.setchance',
label: '概率复位',
bottomHelpMessage: '如果需要将概率恢复默认概率,请将滑块滑到100%后点击保存',
component: 'Slider',
componentProps: {
min: 0,
max: 100,
tipFormatter: function (v) {
return v + '%'
}
}
},
{
field: 'gacha.sync',
label: '卡池自动同步',
bottomHelpMessage: '抽卡前检查卡池是否正确',
component: 'Switch'
}
],
getConfigData () {
let pluginConfig = pluginSetting.merge()
return lodash.merge(setting.merge(),pluginConfig)
},
setConfigData (data, { Result }) {
let allConfig = setting.merge()
for (let [keyPath, value] of Object.entries(data)) {
if (keyPath === 'wordListener.enable') {
let config = pluginSetting.getConfig('wordListener')
config.enable = value
pluginSetting.setConfig('wordListener',config)
continue
}
if (keyPath === 'wordListener.time') {
let config = pluginSetting.getConfig('wordListener')
config.time = value
pluginSetting.setConfig('wordListener',config)
continue
}
if (keyPath === 'block.enable') {
let config = pluginSetting.getConfig('block')
config.enable = value
pluginSetting.setConfig('block',config)
continue
}
switch (keyPath) {
case 'gacha.setchance':
if (value === 100) {
lodash.set(allConfig, 'gacha.chance5', '60')
lodash.set(allConfig, 'gacha.chanceW5', '70')
lodash.set(allConfig, 'gacha.chance4', '510')
lodash.set(allConfig, 'gacha.chanceW4', '600')
lodash.set(allConfig, 'gacha.wai', '50')
}
break
default:
lodash.set(allConfig, keyPath, value)
}
}
setting.analysis(allConfig)
return Result.ok({}, '设置成功~')
}
}
}
}