Merge branch 'main' of http://diuse.work:3210/Diuse/zhenxun_plugin_farm
This commit is contained in:
commit
6b3137e015
@ -17,6 +17,7 @@ __plugin_meta__ = PluginMetadata(
|
||||
usage="""
|
||||
你也要种地?
|
||||
指令:
|
||||
at 开通农场
|
||||
我的农场
|
||||
我的农场币
|
||||
种子商店
|
||||
@ -28,6 +29,7 @@ __plugin_meta__ = PluginMetadata(
|
||||
我的作物
|
||||
出售作物 [作物/种子名称] [数量]
|
||||
偷菜 at
|
||||
开垦
|
||||
购买农场币 [数量] 金币转换农场币比率是 1 : 2
|
||||
""".strip(),
|
||||
extra=PluginExtraData(
|
||||
@ -49,6 +51,9 @@ async def start():
|
||||
# 初始化读取Json
|
||||
await g_pJsonManager.init()
|
||||
|
||||
# await g_pFarmManager.reclamation("1754798088")
|
||||
# await g_pSqlManager.initUserInfoByUid("1754798088", "Art_Sakura", 0, 100)
|
||||
|
||||
# 析构函数
|
||||
@driver.on_shutdown
|
||||
async def shutdown():
|
||||
|
||||
27
command.py
27
command.py
@ -258,6 +258,33 @@ async def _(session: Uninfo):
|
||||
res = await g_pFarmManager.reclamation(uid)
|
||||
await MessageUtils.build_message(res).send(reply_to=True)
|
||||
|
||||
diuse_farm.shortcut(
|
||||
"开垦",
|
||||
command="我的农场",
|
||||
arguments=["reclamation"],
|
||||
prefix=True,
|
||||
)
|
||||
|
||||
@diuse_farm.assign("reclamation")
|
||||
async def _(session: Uninfo):
|
||||
uid = str(session.user.id)
|
||||
point = await g_pSqlManager.getUserPointByUid(uid)
|
||||
|
||||
if point < 0:
|
||||
await MessageUtils.build_message("尚未开通农场,快at我发送 开通农场 开通吧").send()
|
||||
return None
|
||||
|
||||
result = await g_pFarmManager.getUserPlantByUid(uid)
|
||||
await MessageUtils.build_message(result).send(reply_to=True)
|
||||
|
||||
diuse_farm.set_path_arg("reclamation", "result")
|
||||
|
||||
|
||||
@diuse_farm.got_path("test", "测试一下")
|
||||
async def _(name: str):
|
||||
await MessageUtils.build_message(name).send(reply_to=True)
|
||||
|
||||
|
||||
diuse_farm.shortcut(
|
||||
"出售作物(?P<name>.*?)",
|
||||
command="我的农场",
|
||||
|
||||
@ -1,7 +1,32 @@
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
"soil":[1, 1, 1, 2, 3, 5, 7, 9, 11, 13,
|
||||
15, 17, 19, 21, 23, 25, 27, 29, 31, 33,
|
||||
36, 39, 42, 45, 48, 51, 54, 57, 60, 70
|
||||
=======
|
||||
"level":
|
||||
{
|
||||
"0": 0,
|
||||
"1": 50,
|
||||
"2": 75,
|
||||
"3": 125,
|
||||
"4": 185,
|
||||
"5": 200,
|
||||
"6": 250,
|
||||
"7": 275,
|
||||
"8": 350,
|
||||
"9": 500,
|
||||
"10": 850,
|
||||
"11": 1250,
|
||||
"12": 2250,
|
||||
"13": 3500,
|
||||
"14": 4500,
|
||||
"15": 5800
|
||||
},
|
||||
"soil":[1, 1, 1, 2, 3, 5, 7, 9, 12, 15,
|
||||
18, 21, 25, 29, 33, 38, 43, 48, 54, 60,
|
||||
66, 72, 78, 85, 92, 99, 106, 114, 120, 130
|
||||
>>>>>>> f85ab9758c44ce45c6aae9e792f7a5d9e2f7459a
|
||||
],
|
||||
"reclamation":
|
||||
{
|
||||
|
||||
@ -579,6 +579,8 @@ class CFarmManager:
|
||||
return "你已经偷过目标啦,请手下留情"
|
||||
else:
|
||||
userStealing[1] = int(userStealing[1]) - 1
|
||||
# 转换所有元素为字符串
|
||||
userStealing_str = [str(item) for item in userStealing]
|
||||
|
||||
sql = f"UPDATE user SET stealing = '{userStealing[0]}|{userStealing[1]}' WHERE uid = {uid}"
|
||||
|
||||
@ -586,6 +588,8 @@ class CFarmManager:
|
||||
await g_pSqlManager.executeDB(sql)
|
||||
|
||||
return "\n".join(harvestRecords)
|
||||
# @classmethod
|
||||
# async def reclamation(cls, uid: str) -> str:
|
||||
|
||||
@classmethod
|
||||
async def reclamationCondition(cls, uid: str) -> str:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user