nonebot-plugin-fishing2 0.0.3__py3-none-any.whl → 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nonebot_plugin_fishing2/__init__.py +276 -112
- nonebot_plugin_fishing2/config.py +149 -49
- nonebot_plugin_fishing2/data_source.py +435 -412
- nonebot_plugin_fishing2/fish_helper.py +157 -0
- {nonebot_plugin_fishing2-0.0.3.dist-info/licenses → nonebot_plugin_fishing2-0.1.0.dist-info}/LICENSE +1 -1
- nonebot_plugin_fishing2-0.1.0.dist-info/METADATA +176 -0
- nonebot_plugin_fishing2-0.1.0.dist-info/RECORD +14 -0
- {nonebot_plugin_fishing2-0.0.3.dist-info → nonebot_plugin_fishing2-0.1.0.dist-info}/WHEEL +1 -2
- nonebot_plugin_fishing2-0.0.3.dist-info/METADATA +0 -144
- nonebot_plugin_fishing2-0.0.3.dist-info/RECORD +0 -14
- nonebot_plugin_fishing2-0.0.3.dist-info/top_level.txt +0 -1
@@ -1,33 +1,31 @@
|
|
1
1
|
from pydantic import BaseModel
|
2
2
|
from typing import List, Dict
|
3
3
|
|
4
|
-
|
5
|
-
# pydantic v2
|
6
|
-
from nonebot import get_plugin_config
|
7
|
-
except ImportError:
|
8
|
-
# pydantic v1
|
9
|
-
from nonebot import get_driver
|
4
|
+
from nonebot import get_plugin_config
|
10
5
|
|
11
6
|
|
7
|
+
# fmt:off
|
12
8
|
class Config(BaseModel):
|
13
9
|
fishes: List[Dict] = [
|
14
10
|
{
|
15
|
-
"type": "fish",
|
16
|
-
"name": "小鱼",
|
17
|
-
"price":
|
18
|
-
"
|
11
|
+
"type": "fish", # 类型,必填,可用值:fish, item,同类型物品不能同时作为鱼饵
|
12
|
+
"name": "小鱼", # 名称,必填
|
13
|
+
"price": 15, # 基准价格,必填
|
14
|
+
"amount": 1, # 单份数量,模拟耐久
|
15
|
+
"props": [ # 属性,选填,作为鱼饵时改变
|
19
16
|
{
|
20
|
-
"type": "rm_fish",
|
21
|
-
"key": "小鱼"
|
17
|
+
"type": "rm_fish", # 可用值: rare_fish, normal_fish, fish, rm_fish, special_fish, no_fish
|
18
|
+
"key": "小鱼", # 如果为 fish 或 rm_fish,需要填写鱼名
|
19
|
+
"value": 0 # 如果为 rare_fish, normal_fish, fish,填写权重;如果为 special_fish, no_fish,填写概率
|
22
20
|
}
|
23
21
|
],
|
24
|
-
"description": "一条小鱼。把它当做鱼饵可以防止钓到小鱼。",
|
25
|
-
"can_catch": True,
|
26
|
-
"
|
27
|
-
"weight": 1000,
|
28
|
-
"can_buy": True,
|
29
|
-
"
|
30
|
-
"can_sell": True
|
22
|
+
"description": "一条小鱼。把它当做鱼饵可以防止钓到小鱼。", # 描述,必填
|
23
|
+
"can_catch": True, # 是否可以抓取,必填
|
24
|
+
"sleep_time": 2, # 钓上来需要的时间,默认 60
|
25
|
+
"weight": 1000, # 权重
|
26
|
+
"can_buy": True, # 是否可以购买,必填
|
27
|
+
"buy_price": 50, # 购买价格
|
28
|
+
"can_sell": True # 是否可以出售,必填
|
31
29
|
},
|
32
30
|
{
|
33
31
|
"type": "item",
|
@@ -36,7 +34,7 @@ class Config(BaseModel):
|
|
36
34
|
"props": [],
|
37
35
|
"description": "假的。",
|
38
36
|
"can_catch": True,
|
39
|
-
"
|
37
|
+
"sleep_time": 2,
|
40
38
|
"weight": 500,
|
41
39
|
"can_buy": False,
|
42
40
|
"can_sell": True,
|
@@ -48,7 +46,7 @@ class Config(BaseModel):
|
|
48
46
|
"props": [],
|
49
47
|
"description": "杂鱼,杂鱼~",
|
50
48
|
"can_catch": True,
|
51
|
-
"
|
49
|
+
"sleep_time": 10,
|
52
50
|
"weight": 100,
|
53
51
|
"can_buy": False,
|
54
52
|
"can_sell": True
|
@@ -60,7 +58,7 @@ class Config(BaseModel):
|
|
60
58
|
"props": [],
|
61
59
|
"description": "河里为什么会有烤鱼?",
|
62
60
|
"can_catch": True,
|
63
|
-
"
|
61
|
+
"sleep_time": 20,
|
64
62
|
"weight": 20,
|
65
63
|
"can_buy": False,
|
66
64
|
"can_sell": True
|
@@ -72,7 +70,7 @@ class Config(BaseModel):
|
|
72
70
|
"props": [],
|
73
71
|
"description": "邪恶的冰之精灵,是个笨蛋。",
|
74
72
|
"can_catch": True,
|
75
|
-
"
|
73
|
+
"sleep_time": 60,
|
76
74
|
"weight": 20,
|
77
75
|
"can_buy": False,
|
78
76
|
"can_sell": True
|
@@ -84,7 +82,7 @@ class Config(BaseModel):
|
|
84
82
|
"props": [],
|
85
83
|
"description": "非常能吃大米。",
|
86
84
|
"can_catch": True,
|
87
|
-
"
|
85
|
+
"sleep_time": 30,
|
88
86
|
"weight": 10,
|
89
87
|
"can_buy": False,
|
90
88
|
"can_sell": True
|
@@ -96,31 +94,74 @@ class Config(BaseModel):
|
|
96
94
|
"props": [],
|
97
95
|
"description": "Neet姬,非常难在图书馆外见到她。",
|
98
96
|
"can_catch": True,
|
99
|
-
"
|
97
|
+
"sleep_time": 120,
|
100
98
|
"weight": 0,
|
101
99
|
"can_buy": False,
|
102
100
|
"can_sell": True
|
103
101
|
},
|
102
|
+
{
|
103
|
+
"type": "item",
|
104
|
+
"name": "钢制鱼竿",
|
105
|
+
"price": 10,
|
106
|
+
"amount": 30,
|
107
|
+
"props": [
|
108
|
+
{
|
109
|
+
"type": "rare_fish",
|
110
|
+
"value": 5
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"type": "no_fish",
|
114
|
+
"value": 0.05
|
115
|
+
}
|
116
|
+
],
|
117
|
+
"description": "升级的鱼竿,提升钓上大鱼的概率;但是因为偏重,容易空军。",
|
118
|
+
"can_catch": False,
|
119
|
+
"can_buy": True,
|
120
|
+
"can_sell": False
|
121
|
+
},
|
104
122
|
{
|
105
123
|
"type": "item",
|
106
124
|
"name": "钛金鱼竿",
|
107
|
-
"price":
|
125
|
+
"price": 40,
|
126
|
+
"amount": 20,
|
108
127
|
"props": [
|
109
128
|
{
|
110
129
|
"type": "rare_fish",
|
111
130
|
"value": 10
|
112
|
-
}
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"type": "no_fish",
|
134
|
+
"value": -0.05
|
135
|
+
}
|
113
136
|
],
|
114
137
|
"description": "更坚韧的鱼竿,显著提升钓上大鱼的概率。",
|
115
138
|
"can_catch": False,
|
116
139
|
"can_buy": True,
|
117
|
-
"
|
140
|
+
"buy_price": 40,
|
141
|
+
"can_sell": False
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"type": "item",
|
145
|
+
"name": "附魔鱼竿",
|
146
|
+
"price": 20,
|
147
|
+
"amount": 20,
|
148
|
+
"props": [
|
149
|
+
{
|
150
|
+
"type": "normal_fish",
|
151
|
+
"value": -250
|
152
|
+
}
|
153
|
+
],
|
154
|
+
"description": "附魔的鱼竿,大幅减少钓上垃圾的概率。",
|
155
|
+
"can_catch": True,
|
156
|
+
"sleep_time": 30,
|
157
|
+
"weight": 40,
|
158
|
+
"can_buy": False,
|
118
159
|
"can_sell": False
|
119
160
|
},
|
120
161
|
{
|
121
162
|
"type": "fish",
|
122
163
|
"name": "大米",
|
123
|
-
"price":
|
164
|
+
"price": 700,
|
124
165
|
"props": [
|
125
166
|
{
|
126
167
|
"type": "fish",
|
@@ -128,25 +169,52 @@ class Config(BaseModel):
|
|
128
169
|
"value": 10000
|
129
170
|
}
|
130
171
|
],
|
131
|
-
"description": "Fufu
|
172
|
+
"description": "Fufu 最爱吃的大米!",
|
173
|
+
"can_catch": False,
|
174
|
+
"can_buy": True,
|
175
|
+
"can_sell": False
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"type": "fish",
|
179
|
+
"name": "棒棒糖",
|
180
|
+
"price": 50,
|
181
|
+
"props": [
|
182
|
+
{
|
183
|
+
"type": "special_fish",
|
184
|
+
"value": 0.5
|
185
|
+
},
|
186
|
+
{
|
187
|
+
"type": "fish",
|
188
|
+
"key": "帕秋莉",
|
189
|
+
"value": 10
|
190
|
+
}
|
191
|
+
],
|
192
|
+
"description": "可以吸引到一些奇怪的鱼。",
|
193
|
+
"can_catch": False,
|
194
|
+
"can_buy": True,
|
195
|
+
"can_sell": False
|
196
|
+
},
|
197
|
+
{
|
198
|
+
"type": "fish",
|
199
|
+
"name": "传奇棒棒糖",
|
200
|
+
"price": 200,
|
201
|
+
"props": [
|
202
|
+
{
|
203
|
+
"type": "special_fish",
|
204
|
+
"value": 1
|
205
|
+
},
|
206
|
+
{
|
207
|
+
"type": "no_fish",
|
208
|
+
"value": -1
|
209
|
+
}
|
210
|
+
],
|
211
|
+
"description": "必定钓到特殊鱼。",
|
132
212
|
"can_catch": False,
|
133
213
|
"can_buy": False,
|
134
214
|
"can_sell": False
|
135
215
|
}
|
136
216
|
]
|
137
|
-
|
138
|
-
punish_limit: int = 3
|
139
|
-
|
140
|
-
fishing_limit: int = 60
|
141
|
-
|
142
|
-
fishing_coin_name: str = "绿宝石" # It means Fishing Coin.
|
143
|
-
|
144
|
-
special_fish_enabled: bool = True
|
145
|
-
|
146
|
-
special_fish_price: int = 200
|
147
|
-
|
148
|
-
special_fish_probability: float = 0.01
|
149
|
-
|
217
|
+
|
150
218
|
fishing_achievement: List[Dict] = [
|
151
219
|
{
|
152
220
|
"type": "fishing_frequency",
|
@@ -189,13 +257,45 @@ class Config(BaseModel):
|
|
189
257
|
"name": "不动的大图书馆",
|
190
258
|
"data": "帕秋莉",
|
191
259
|
"description": "Neet 姬好不容易出门一次,就被你钓上来了?"
|
260
|
+
},
|
261
|
+
{
|
262
|
+
"type": "fish_type",
|
263
|
+
"name": "工欲善其事,必先利其器",
|
264
|
+
"data": "钛金鱼竿",
|
265
|
+
"description": "在钓鱼用具店购买钛金鱼竿"
|
266
|
+
},
|
267
|
+
{
|
268
|
+
"type": "fish_type",
|
269
|
+
"name": "为啥能钓上鱼竿?",
|
270
|
+
"data": "附魔鱼竿",
|
271
|
+
"description": "钓上附魔鱼竿"
|
192
272
|
}
|
193
273
|
]
|
194
274
|
|
275
|
+
fishing_coin_name: str = "绿宝石" # 货币名称
|
276
|
+
|
277
|
+
fishing_cooldown_time_min: int = 60 # 钓鱼冷却下限,单位为秒
|
278
|
+
|
279
|
+
fishing_cooldown_time_max: int = 90 # 钓鱼冷却上限
|
280
|
+
|
281
|
+
punish_limit: int = 3 # 短时间多次钓鱼后,禁言所需次数,防止刷屏
|
282
|
+
|
283
|
+
special_fish_enabled: bool = False # 是否启用赛博放生 & 特殊鱼
|
284
|
+
|
285
|
+
special_fish_price: int = 200 # 特殊鱼出售的价格
|
286
|
+
|
287
|
+
special_fish_free_price: int = 100 # 特殊鱼放生的价格
|
288
|
+
|
289
|
+
special_fish_probability: float = 0.01 # 钓上特殊鱼的概率,注意这个判定在空军判定之后
|
290
|
+
|
291
|
+
no_fish_probability: float = 0.1 # 空军的概率
|
292
|
+
|
293
|
+
rare_fish_weight: int = 500 # 稀有鱼权重分界线,影响 rare_fish 属性与 normal_fish 属性的区分
|
294
|
+
|
295
|
+
buy_rate: float = 2.0 # 在不指定 buy_price 时,购买价格/基准价格比,应大于 1
|
296
|
+
|
297
|
+
backpack_forward: bool = True # 背包是否使用聊天记录
|
298
|
+
# fmt:on
|
299
|
+
|
300
|
+
config = get_plugin_config(Config)
|
195
301
|
|
196
|
-
try:
|
197
|
-
# pydantic v2
|
198
|
-
config = get_plugin_config(Config)
|
199
|
-
except:
|
200
|
-
# pydantic v1
|
201
|
-
config = Config.parse_obj(get_driver().config)
|