胡萝卜牛肉汤ceshi1
This commit is contained in:
1 parent
fcb08e0119
commit
0c48f7f546
3 files changed
+47
-20
No files matched your search
@@ -1,31 +1,55 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
配方数据文件 - 所有烹饪配方都在这里
|
||||
===================================
|
||||
每加一道菜,在这里加一条配方就行,不用写代码。
|
||||
配方数据文件 - 所有"右键方块→消耗物品→替换方块"的配方都在这里
|
||||
每加一道新菜,只需要在这里加一条配方,不用写任何Python代码。
|
||||
|
||||
字段说明:
|
||||
source = 被右键的方块ID(必填)
|
||||
item = 手里必须拿的物品,None=空手也行
|
||||
target = 替换成什么方块
|
||||
consume = 消耗几个物品(默认1,0=不消耗)
|
||||
giveItem = 额外给玩家什么物品
|
||||
below = 方块下面必须垫什么(可选)
|
||||
配方字段说明:
|
||||
source: 被右键的方块ID(必填)
|
||||
item: 玩家手里必须拿的物品,None=空手也行
|
||||
target: 替换成什么方块,None=不替换
|
||||
consume: 消耗物品数量,0=不消耗(默认1)
|
||||
giveItem: 额外给玩家什么物品
|
||||
stirCount: 需要翻炒几次才变身
|
||||
stirCd: 翻炒冷却时间(秒)
|
||||
onDone: "finish"=标记熟了不替换
|
||||
doneMsg: 完成后的提示消息
|
||||
failMsg: 冷却中/失败时的提示
|
||||
dropIfDone: 熟了后拆掉掉落什么
|
||||
dropIfNot: 没熟拆掉掉落什么
|
||||
"""
|
||||
|
||||
RECIPES = [
|
||||
|
||||
# ================================================================
|
||||
# 测试配方(最简单的一条,验证引擎能不能跑通)
|
||||
# ================================================================
|
||||
# 玩法:放一个 rtdd:wok(炒锅),手里拿生牛肉右键它
|
||||
# 锅会变成钻石块,牛肉消失,背包里多一块熟牛肉
|
||||
# ===== 步骤1:炒锅 + 生牛肉 → 胡萝卜牛肉锅 =====
|
||||
{
|
||||
"source": "rtdd:wok",
|
||||
"item": "minecraft:beef",
|
||||
"target": "minecraft:diamond_block",
|
||||
"target": "rtdd:carrotandbeef",
|
||||
"consume": 1,
|
||||
"giveItem": "minecraft:cooked_beef",
|
||||
},
|
||||
|
||||
# ===== 步骤2:胡萝卜牛肉锅 + 木剑翻炒5次 → 第二阶段 =====
|
||||
{
|
||||
"source": "rtdd:carrotandbeef",
|
||||
"item": "minecraft:wooden_sword",
|
||||
"target": "rtdd:carrotandbeef_1",
|
||||
"consume": 0,
|
||||
"stirCount": 5,
|
||||
"stirCd": 1.2,
|
||||
"failMsg": "这时候翻动会不好熟的!",
|
||||
},
|
||||
|
||||
# ===== 步骤3:第二阶段 + 木剑翻炒3次 → 标记熟了 =====
|
||||
{
|
||||
"source": "rtdd:carrotandbeef_1",
|
||||
"item": "minecraft:wooden_sword",
|
||||
"target": None,
|
||||
"consume": 0,
|
||||
"stirCount": 3,
|
||||
"stirCd": 0.8,
|
||||
"onDone": "finish",
|
||||
"doneMsg": "出锅啦!拿盘子盛出来",
|
||||
"failMsg": "这时候翻动会不好熟的!",
|
||||
"dropIfDone": ["minecraft:cooked_beef", "rtdd:wok"],
|
||||
"dropIfNot": ["minecraft:beef", "rtdd:wok"],
|
||||
},
|
||||
]
|
||||
@@ -148,8 +148,6 @@ class CookingService(BlueFoxServerSystem):
|
||||
|
||||
# 冷却检查
|
||||
if now - data["lastTime"] < recipe.get("stirCd", 1.0):
|
||||
if recipe.get("failMsg"):
|
||||
comp.CreateMsg(playerId).NotifyOneMessage(playerId, recipe["failMsg"])
|
||||
return
|
||||
|
||||
# 翻炒次数+1
|
||||
@@ -157,6 +155,10 @@ class CookingService(BlueFoxServerSystem):
|
||||
data["lastTime"] = now
|
||||
self.stirData[key] = data
|
||||
|
||||
# 提示进度
|
||||
comp.CreateMsg(playerId).NotifyOneMessage(
|
||||
playerId, "翻炒中... %s/%s" % (data["count"], recipe["stirCount"]))
|
||||
|
||||
# 判断是否翻够了
|
||||
if data["count"] >= recipe["stirCount"]:
|
||||
if recipe.get("onDone") == "finish":
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from BlueFoxTools.ModLoader import *
|
||||
from ceshi.service.CookingService import CookingService
|
||||
|
||||
if not serverApi.IsInServer():
|
||||
pass
|
||||
|
||||
Reference in new issue
Block a user