forked from KarisAya/nonebot_plugin_game_collection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
139 lines (126 loc) · 3.51 KB
/
config.py
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
from typing import Tuple
from pydantic import BaseModel, Extra
class Config(BaseModel, extra = Extra.ignore):
# 每日签到的范围
sign_gold:Tuple[int, int] = (200, 500)
# 每日补贴的范围
security_gold:Tuple[int, int] = (100, 300)
# 重置签到的范围
revolt_gold:Tuple[int, int] = (1000, 2000)
# 重置冷却时间,设置为0禁用发起重置
revolt_cd:int = 28800
# 重置的基尼系数
revolt_gini:float = 0.68
# 最大赌注
max_bet_gold:int = 2000
# 默认赌注
bet_gold:int = 200
# 单抽所需金币
gacha_gold:int = 50
# 一个测试字符串,不要动(
lucky_clover = "• LUCKY CLOVER •"
# 默认显示字体
game_fontname = "simsun"
game_fallback_fonts = [
"Arial",
"Tahoma",
"Microsoft YaHei",
"Segoe UI",
"Segoe UI Emoji",
"Segoe UI Symbol",
"Helvetica Neue",
"PingFang SC",
"Hiragino Sans GB",
"Source Han Sans SC",
"Noto Sans SC",
"Noto Sans CJK JP",
"WenQuanYi Micro Hei",
"Apple Color Emoji",
"Noto Color Emoji",
]
"""+++++++++++++++++
——————————
下面是赛马设置
——————————
+++++++++++++++++"""
# 跑道长度
setting_track_length = 20
# 随机位置事件,最小能到的跑道距离
setting_random_min_length = 0
# 随机位置事件,最大能到的跑道距离
setting_random_max_length = 15
# 每回合基础移动力最小值
base_move_min = 1
# 每回合基础移动力最大值
base_move_max = 3
# 最大支持玩家数
max_player = 8
# 最少玩家数
min_player = 2
# 事件概率 = event_rate / 1000
event_rate = 450
import nonebot
from pathlib import Path
# 默认数据存数路径
path = Path() / "data" / "russian"
path.mkdir(exist_ok = True, parents = True)
# 备份路径
backup = path / "backup"
backup.mkdir(exist_ok = True, parents = True)
# 缓存路径
cache = path / "cache"
cache.mkdir(exist_ok = True, parents = True)
# 背景图片路径
BG_image = path / "BG_image"
BG_image.mkdir(exist_ok = True, parents = True)
global_config = nonebot.get_driver().config
config = Config.parse_obj(global_config.dict())
# bot昵称
bot_name = list(global_config.nickname)[0] if global_config.nickname else "bot"
sign_gold = config.sign_gold
security_gold = config.security_gold
revolt_gold = config.revolt_gold
revolt_cd = config.revolt_cd
revolt_gini = config.revolt_gini
max_bet_gold = config.max_bet_gold
bet_gold = config.bet_gold
gacha_gold = config.gacha_gold
lucky_clover = config.lucky_clover
fontname = config.game_fontname
fallback_fonts = config.game_fallback_fonts
setting_track_length = config.setting_track_length
setting_random_min_length = config.setting_random_min_length
setting_random_max_length = config.setting_random_max_length
base_move_min = config.base_move_min
base_move_max = config.base_move_max
max_player = config.max_player
min_player = config.min_player
event_rate = config.event_rate
"""
from .config import *
"""
__all__ = [
bot_name,
sign_gold,
security_gold,
revolt_gold,
revolt_cd,
revolt_gini,
max_bet_gold,
bet_gold,
gacha_gold,
lucky_clover,
fontname,
setting_track_length,
setting_random_min_length,
setting_random_max_length,
base_move_min,
base_move_max,
max_player,
min_player,
event_rate,
path,
backup,
cache,
BG_image,
]