nonebot-plugin-fishing2 0.0.2__tar.gz → 0.0.4__tar.gz
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-0.0.2 → nonebot_plugin_fishing2-0.0.4}/LICENSE +1 -1
- nonebot_plugin_fishing2-0.0.4/PKG-INFO +168 -0
- nonebot_plugin_fishing2-0.0.4/README.md +148 -0
- nonebot_plugin_fishing2-0.0.4/nonebot_plugin_fishing2/__init__.py +473 -0
- nonebot_plugin_fishing2-0.0.4/nonebot_plugin_fishing2/config.py +306 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/nonebot_plugin_fishing2/data_source.py +415 -311
- nonebot_plugin_fishing2-0.0.4/nonebot_plugin_fishing2/fish_helper.py +157 -0
- nonebot_plugin_fishing2-0.0.4/nonebot_plugin_fishing2.egg-info/PKG-INFO +168 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/nonebot_plugin_fishing2.egg-info/SOURCES.txt +1 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/pyproject.toml +1 -1
- nonebot_plugin_fishing2-0.0.2/PKG-INFO +0 -144
- nonebot_plugin_fishing2-0.0.2/README.md +0 -124
- nonebot_plugin_fishing2-0.0.2/nonebot_plugin_fishing2/__init__.py +0 -240
- nonebot_plugin_fishing2-0.0.2/nonebot_plugin_fishing2/config.py +0 -182
- nonebot_plugin_fishing2-0.0.2/nonebot_plugin_fishing2.egg-info/PKG-INFO +0 -144
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/nonebot_plugin_fishing2/migrations/68463f3e5f33_.py +0 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/nonebot_plugin_fishing2/migrations/7609e6d106dd_init_db.py +0 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/nonebot_plugin_fishing2/migrations/c5ab992c9af3_add_achievements.py +0 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/nonebot_plugin_fishing2/migrations/e9015df43907_add_special_fishes_field.py +0 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/nonebot_plugin_fishing2/migrations/f70bdeaec7a4_add_specialfishes_table.py +0 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/nonebot_plugin_fishing2/model.py +0 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/nonebot_plugin_fishing2.egg-info/dependency_links.txt +0 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/nonebot_plugin_fishing2.egg-info/requires.txt +0 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/nonebot_plugin_fishing2.egg-info/top_level.txt +0 -0
- {nonebot_plugin_fishing2-0.0.2 → nonebot_plugin_fishing2-0.0.4}/setup.cfg +0 -0
@@ -0,0 +1,168 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: nonebot-plugin-fishing2
|
3
|
+
Version: 0.0.4
|
4
|
+
Summary: 更好的电子钓鱼
|
5
|
+
Author-email: ALittleBot <160833462+C14H22O@users.noreply.github.com>, Polaris_Light <995905922@qq.com>
|
6
|
+
License-Expression: MIT
|
7
|
+
Project-URL: Homepage, https://github.com/FDCraft/nonebot-plugin-fishing2
|
8
|
+
Keywords: fishing
|
9
|
+
Requires-Python: >=3.8
|
10
|
+
Description-Content-Type: text/markdown
|
11
|
+
License-File: LICENSE
|
12
|
+
Requires-Dist: nonebot2>=2.2.1
|
13
|
+
Requires-Dist: nonebot-adapter-onebot>=2.0.0-beta.1
|
14
|
+
Requires-Dist: pydantic>=1.10
|
15
|
+
Requires-Dist: nonebot-plugin-localstore>=0.6.0
|
16
|
+
Requires-Dist: sqlalchemy>=2.0.27
|
17
|
+
Requires-Dist: aiosqlite>=0.20.0
|
18
|
+
Requires-Dist: nonebot-plugin-orm>=0.7.1
|
19
|
+
Dynamic: license-file
|
20
|
+
|
21
|
+
<div align="center">
|
22
|
+
<a href="https://v2.nonebot.dev/store"><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
|
23
|
+
<br>
|
24
|
+
<p><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div align="center">
|
28
|
+
|
29
|
+
# nonebot-plugin-fishing2
|
30
|
+
|
31
|
+
_✨ 更好的电子钓鱼 ✨_
|
32
|
+
|
33
|
+
<a href="./LICENSE">
|
34
|
+
<img src="https://img.shields.io/github/license/FDCraft/nonebot-plugin-fishing2.svg" alt="license">
|
35
|
+
</a>
|
36
|
+
<a href="https://pypi.python.org/pypi/nonebot-plugin-fishing2">
|
37
|
+
<img src="https://img.shields.io/pypi/v/nonebot-plugin-fishing2.svg" alt="pypi">
|
38
|
+
</a>
|
39
|
+
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
|
40
|
+
|
41
|
+
</div>
|
42
|
+
|
43
|
+
## 💿 安装
|
44
|
+
|
45
|
+
<details open>
|
46
|
+
<summary>使用 nb-cli 安装</summary>
|
47
|
+
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
|
48
|
+
|
49
|
+
nb plugin install nonebot-plugin-fishing2
|
50
|
+
|
51
|
+
</details>
|
52
|
+
|
53
|
+
<details>
|
54
|
+
<summary>使用包管理器安装</summary>
|
55
|
+
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
|
56
|
+
|
57
|
+
<details>
|
58
|
+
<summary>pip</summary>
|
59
|
+
|
60
|
+
pip install nonebot-plugin-fishing2
|
61
|
+
</details>
|
62
|
+
<details>
|
63
|
+
<summary>pdm</summary>
|
64
|
+
|
65
|
+
pdm add nonebot-plugin-fishing2
|
66
|
+
</details>
|
67
|
+
<details>
|
68
|
+
<summary>poetry</summary>
|
69
|
+
|
70
|
+
poetry add nonebot-plugin-fishing2
|
71
|
+
</details>
|
72
|
+
<details>
|
73
|
+
<summary>conda</summary>
|
74
|
+
|
75
|
+
conda install nonebot-plugin-fishing2
|
76
|
+
</details>
|
77
|
+
|
78
|
+
打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入
|
79
|
+
|
80
|
+
plugins = ["nonebot_plugin_fishing2"]
|
81
|
+
|
82
|
+
</details>
|
83
|
+
|
84
|
+
注意:安装过后,需在控制台输入 `nb orm upgrade` 指令以初始化数据库。本插件数据库与 [Nonebot-plugin-fishing](https://github.com/ALittleBot/nonebot-plugin-fishing) 通用,可以互换。
|
85
|
+
|
86
|
+
## ⚙️ 配置
|
87
|
+
|
88
|
+
在 nonebot2 项目的`.env`文件中添加下表中的配置
|
89
|
+
|
90
|
+
| 配置项 | 必填 | 说明 |
|
91
|
+
|:------------------------:|:----:|:--------------------------------------------------------------:|
|
92
|
+
| fishes | 否 | 配置鱼塘内的普通鱼(大概是鱼……) |
|
93
|
+
| fishing_achievement | 否 | 配置钓鱼成就 |
|
94
|
+
| fishing_coin_name | 否 | 填入卖鱼获取的货币名称 |
|
95
|
+
| fishing_limit | 否 | 填入每次钓鱼后,限制钓鱼的秒数 |
|
96
|
+
| punish_limit | 否 | 短时间多次钓鱼后,禁言所需次数,防止刷屏 |
|
97
|
+
| special_fish_enabled | 否 | 是否启用赛博放生 & 特殊鱼(默认为否) |
|
98
|
+
| special_fish_price | 否 | 特殊鱼出售的价格 |
|
99
|
+
| special_fish_free_price | 否 | 特殊鱼放生的价格 |
|
100
|
+
| special_fish_probability | 否 | 钓上特殊鱼的概率,注意这个判定在空军判定之后 |
|
101
|
+
| no_fish_probability | 否 | 空军的概率 |
|
102
|
+
| rare_fish_weight | 否 | 稀有鱼权重分界线,影响 rare_fish 属性与 normal_fish 属性的区分 |
|
103
|
+
| buy_rate | 否 | 在不指定 buy_price 时,购买价格/基准价格比,应大于 1 |
|
104
|
+
| backpack_forward | 否 | 背包是否使用聊天记录 |
|
105
|
+
|
106
|
+
其中 `fishes` 配置项说明如下。预设配置经过了计算以平衡,如果需要自行填表,请使用“钓鱼预测”命令进行预测。
|
107
|
+
|
108
|
+
```dotenv
|
109
|
+
FISHES='
|
110
|
+
[
|
111
|
+
{
|
112
|
+
"type": "fish", # 类型,必填,可用值:fish, item,同类型物品不能同时作为鱼饵
|
113
|
+
"name": "小鱼", # 名称,必填
|
114
|
+
"price": 15, # 基准价格,必填
|
115
|
+
"amount": 1, # 单份数量,模拟耐久
|
116
|
+
"props": [ # 属性,选填,作为鱼饵时改变
|
117
|
+
{
|
118
|
+
"type": "rm_fish", # 可用值: rare_fish, normal_fish, fish, rm_fish, special_fish, no_fish
|
119
|
+
"key": "小鱼", # 如果为 fish 或 rm_fish,需要填写鱼名
|
120
|
+
"value": 0 # 如果为 rare_fish, normal_fish, fish,填写权重;如果为 special_fish, no_fish,填写概率
|
121
|
+
}
|
122
|
+
],
|
123
|
+
"description": "一条小鱼。把它当做鱼饵可以防止钓到小鱼。", # 描述,必填
|
124
|
+
"can_catch": True, # 是否可以抓取,必填
|
125
|
+
"sleep_time": 2, # 钓上来需要的时间,默认 60
|
126
|
+
"weight": 1000, # 权重
|
127
|
+
"can_buy": True, # 是否可以购买,必填
|
128
|
+
"buy_price": 50, # 购买价格
|
129
|
+
"can_sell": True # 是否可以出售,必填
|
130
|
+
},
|
131
|
+
]
|
132
|
+
'
|
133
|
+
```
|
134
|
+
|
135
|
+
## 🔨 更新
|
136
|
+
|
137
|
+
每一次更新后,需执行 `nb orm upgrade`。
|
138
|
+
|
139
|
+
## 🎉 使用
|
140
|
+
|
141
|
+
### 指令表
|
142
|
+
|
143
|
+
在群聊或私聊发送“钓鱼帮助”查看本插件的帮助,或者使用[NoneBot-Plugin-PicMenu-Next](https://github.com/lgc-NB2Dev/nonebot-plugin-picmenu-next)等帮助插件查看。
|
144
|
+
|
145
|
+
### 管理员指令表
|
146
|
+
|
147
|
+
| 指令 | 范围 | 说明 |
|
148
|
+
|:--------:|:----:|:----------------------------------------------:|
|
149
|
+
| 钓鱼预测 | 所有 | 对钓鱼进行模拟,查看各鱼的概率与期望,便于填表 |
|
150
|
+
| 鱼池 | 所有 | 查看数据库里面的所有特殊鱼 |
|
151
|
+
|
152
|
+
### 赛博放生
|
153
|
+
|
154
|
+
当用户使用货币放生由自己取名的一条鱼后,每个用户在钓鱼时都有机会钓到那一条鱼。但此功能开关 `special_fish_enabled` 默认关闭,原因是用户生成内容如果不符合规范,可能导致出现不可预料的情况,请谨慎开启。
|
155
|
+
|
156
|
+
## 📝 Todo
|
157
|
+
|
158
|
+
- [x] 重写数据库逻辑(改为使用 [nonebot/plugin-orm](https://github.com/nonebot/plugin-orm))
|
159
|
+
- [x] 增加系统商店,卖出钓到的鱼
|
160
|
+
- [x] 赛博放生 [#4](https://github.com/C14H22O/nonebot-plugin-fishing/issues/4) (已基本完成)
|
161
|
+
- [ ] ~~使用 [nonebot_plugin_chikari_economy](https://github.com/mrqx0195/nonebot_plugin_chikari_economy) 经济系统~~
|
162
|
+
- [x] 为鱼竿增加耐久度,耐久度为0时需重新购买鱼竿
|
163
|
+
- [x] 为钓鱼背包添加排序
|
164
|
+
- [x] 添加成就系统
|
165
|
+
- [x] 买装备!
|
166
|
+
- [ ] 支持卖与普通鱼同名的特殊鱼
|
167
|
+
- [ ] 管理员命令:捞鱼
|
168
|
+
- [ ] 屏蔽词库
|
@@ -0,0 +1,148 @@
|
|
1
|
+
<div align="center">
|
2
|
+
<a href="https://v2.nonebot.dev/store"><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
|
3
|
+
<br>
|
4
|
+
<p><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<div align="center">
|
8
|
+
|
9
|
+
# nonebot-plugin-fishing2
|
10
|
+
|
11
|
+
_✨ 更好的电子钓鱼 ✨_
|
12
|
+
|
13
|
+
<a href="./LICENSE">
|
14
|
+
<img src="https://img.shields.io/github/license/FDCraft/nonebot-plugin-fishing2.svg" alt="license">
|
15
|
+
</a>
|
16
|
+
<a href="https://pypi.python.org/pypi/nonebot-plugin-fishing2">
|
17
|
+
<img src="https://img.shields.io/pypi/v/nonebot-plugin-fishing2.svg" alt="pypi">
|
18
|
+
</a>
|
19
|
+
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
|
20
|
+
|
21
|
+
</div>
|
22
|
+
|
23
|
+
## 💿 安装
|
24
|
+
|
25
|
+
<details open>
|
26
|
+
<summary>使用 nb-cli 安装</summary>
|
27
|
+
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
|
28
|
+
|
29
|
+
nb plugin install nonebot-plugin-fishing2
|
30
|
+
|
31
|
+
</details>
|
32
|
+
|
33
|
+
<details>
|
34
|
+
<summary>使用包管理器安装</summary>
|
35
|
+
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
|
36
|
+
|
37
|
+
<details>
|
38
|
+
<summary>pip</summary>
|
39
|
+
|
40
|
+
pip install nonebot-plugin-fishing2
|
41
|
+
</details>
|
42
|
+
<details>
|
43
|
+
<summary>pdm</summary>
|
44
|
+
|
45
|
+
pdm add nonebot-plugin-fishing2
|
46
|
+
</details>
|
47
|
+
<details>
|
48
|
+
<summary>poetry</summary>
|
49
|
+
|
50
|
+
poetry add nonebot-plugin-fishing2
|
51
|
+
</details>
|
52
|
+
<details>
|
53
|
+
<summary>conda</summary>
|
54
|
+
|
55
|
+
conda install nonebot-plugin-fishing2
|
56
|
+
</details>
|
57
|
+
|
58
|
+
打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入
|
59
|
+
|
60
|
+
plugins = ["nonebot_plugin_fishing2"]
|
61
|
+
|
62
|
+
</details>
|
63
|
+
|
64
|
+
注意:安装过后,需在控制台输入 `nb orm upgrade` 指令以初始化数据库。本插件数据库与 [Nonebot-plugin-fishing](https://github.com/ALittleBot/nonebot-plugin-fishing) 通用,可以互换。
|
65
|
+
|
66
|
+
## ⚙️ 配置
|
67
|
+
|
68
|
+
在 nonebot2 项目的`.env`文件中添加下表中的配置
|
69
|
+
|
70
|
+
| 配置项 | 必填 | 说明 |
|
71
|
+
|:------------------------:|:----:|:--------------------------------------------------------------:|
|
72
|
+
| fishes | 否 | 配置鱼塘内的普通鱼(大概是鱼……) |
|
73
|
+
| fishing_achievement | 否 | 配置钓鱼成就 |
|
74
|
+
| fishing_coin_name | 否 | 填入卖鱼获取的货币名称 |
|
75
|
+
| fishing_limit | 否 | 填入每次钓鱼后,限制钓鱼的秒数 |
|
76
|
+
| punish_limit | 否 | 短时间多次钓鱼后,禁言所需次数,防止刷屏 |
|
77
|
+
| special_fish_enabled | 否 | 是否启用赛博放生 & 特殊鱼(默认为否) |
|
78
|
+
| special_fish_price | 否 | 特殊鱼出售的价格 |
|
79
|
+
| special_fish_free_price | 否 | 特殊鱼放生的价格 |
|
80
|
+
| special_fish_probability | 否 | 钓上特殊鱼的概率,注意这个判定在空军判定之后 |
|
81
|
+
| no_fish_probability | 否 | 空军的概率 |
|
82
|
+
| rare_fish_weight | 否 | 稀有鱼权重分界线,影响 rare_fish 属性与 normal_fish 属性的区分 |
|
83
|
+
| buy_rate | 否 | 在不指定 buy_price 时,购买价格/基准价格比,应大于 1 |
|
84
|
+
| backpack_forward | 否 | 背包是否使用聊天记录 |
|
85
|
+
|
86
|
+
其中 `fishes` 配置项说明如下。预设配置经过了计算以平衡,如果需要自行填表,请使用“钓鱼预测”命令进行预测。
|
87
|
+
|
88
|
+
```dotenv
|
89
|
+
FISHES='
|
90
|
+
[
|
91
|
+
{
|
92
|
+
"type": "fish", # 类型,必填,可用值:fish, item,同类型物品不能同时作为鱼饵
|
93
|
+
"name": "小鱼", # 名称,必填
|
94
|
+
"price": 15, # 基准价格,必填
|
95
|
+
"amount": 1, # 单份数量,模拟耐久
|
96
|
+
"props": [ # 属性,选填,作为鱼饵时改变
|
97
|
+
{
|
98
|
+
"type": "rm_fish", # 可用值: rare_fish, normal_fish, fish, rm_fish, special_fish, no_fish
|
99
|
+
"key": "小鱼", # 如果为 fish 或 rm_fish,需要填写鱼名
|
100
|
+
"value": 0 # 如果为 rare_fish, normal_fish, fish,填写权重;如果为 special_fish, no_fish,填写概率
|
101
|
+
}
|
102
|
+
],
|
103
|
+
"description": "一条小鱼。把它当做鱼饵可以防止钓到小鱼。", # 描述,必填
|
104
|
+
"can_catch": True, # 是否可以抓取,必填
|
105
|
+
"sleep_time": 2, # 钓上来需要的时间,默认 60
|
106
|
+
"weight": 1000, # 权重
|
107
|
+
"can_buy": True, # 是否可以购买,必填
|
108
|
+
"buy_price": 50, # 购买价格
|
109
|
+
"can_sell": True # 是否可以出售,必填
|
110
|
+
},
|
111
|
+
]
|
112
|
+
'
|
113
|
+
```
|
114
|
+
|
115
|
+
## 🔨 更新
|
116
|
+
|
117
|
+
每一次更新后,需执行 `nb orm upgrade`。
|
118
|
+
|
119
|
+
## 🎉 使用
|
120
|
+
|
121
|
+
### 指令表
|
122
|
+
|
123
|
+
在群聊或私聊发送“钓鱼帮助”查看本插件的帮助,或者使用[NoneBot-Plugin-PicMenu-Next](https://github.com/lgc-NB2Dev/nonebot-plugin-picmenu-next)等帮助插件查看。
|
124
|
+
|
125
|
+
### 管理员指令表
|
126
|
+
|
127
|
+
| 指令 | 范围 | 说明 |
|
128
|
+
|:--------:|:----:|:----------------------------------------------:|
|
129
|
+
| 钓鱼预测 | 所有 | 对钓鱼进行模拟,查看各鱼的概率与期望,便于填表 |
|
130
|
+
| 鱼池 | 所有 | 查看数据库里面的所有特殊鱼 |
|
131
|
+
|
132
|
+
### 赛博放生
|
133
|
+
|
134
|
+
当用户使用货币放生由自己取名的一条鱼后,每个用户在钓鱼时都有机会钓到那一条鱼。但此功能开关 `special_fish_enabled` 默认关闭,原因是用户生成内容如果不符合规范,可能导致出现不可预料的情况,请谨慎开启。
|
135
|
+
|
136
|
+
## 📝 Todo
|
137
|
+
|
138
|
+
- [x] 重写数据库逻辑(改为使用 [nonebot/plugin-orm](https://github.com/nonebot/plugin-orm))
|
139
|
+
- [x] 增加系统商店,卖出钓到的鱼
|
140
|
+
- [x] 赛博放生 [#4](https://github.com/C14H22O/nonebot-plugin-fishing/issues/4) (已基本完成)
|
141
|
+
- [ ] ~~使用 [nonebot_plugin_chikari_economy](https://github.com/mrqx0195/nonebot_plugin_chikari_economy) 经济系统~~
|
142
|
+
- [x] 为鱼竿增加耐久度,耐久度为0时需重新购买鱼竿
|
143
|
+
- [x] 为钓鱼背包添加排序
|
144
|
+
- [x] 添加成就系统
|
145
|
+
- [x] 买装备!
|
146
|
+
- [ ] 支持卖与普通鱼同名的特殊鱼
|
147
|
+
- [ ] 管理员命令:捞鱼
|
148
|
+
- [ ] 屏蔽词库
|