菜谱全部导入 水稻tick 2
This commit is contained in:
1 parent
c41a6d3665
commit
199821911b
4 files changed
+39
-47
No files matched your search
+3
-14
@@ -184,8 +184,6 @@ class NaturalService(BlueFoxServerSystem):
|
||||
|
||||
# 放置水稻刚种下
|
||||
self.replaceBlock(targetPos, dim, RICE_PLANT["target"], playerId)
|
||||
if RICE_PLANT.get("tip"):
|
||||
comp.CreateMsg(playerId).NotifyOneMessage(playerId, RICE_PLANT["tip"])
|
||||
return True
|
||||
|
||||
# ============================================================================
|
||||
@@ -223,22 +221,13 @@ class NaturalService(BlueFoxServerSystem):
|
||||
comp.CreateMsg(playerId).NotifyOneMessage(playerId, recipe["tip"])
|
||||
|
||||
def _applyBoneMeal(self, playerId, pos, dim, blockName, itemDict):
|
||||
"""骨粉催熟水稻: 消耗1个骨粉, 按原版概率一次长多级(无失败时2~3级), 封顶成熟"""
|
||||
"""骨粉催熟水稻: 消耗1个骨粉, 让水稻长大一级(不越级, 到成熟为止), 无提示"""
|
||||
try:
|
||||
if blockName == RICE_BLOCKS[-1]:
|
||||
comp.CreateMsg(playerId).NotifyOneMessage(playerId, "§c水稻已成熟, 无需施肥")
|
||||
return
|
||||
return # 已成熟, 不再消耗
|
||||
index = RICE_BLOCKS.index(blockName)
|
||||
# 原版骨粉给作物有失败几率: 20% 无效消耗
|
||||
if random.random() < 0.2:
|
||||
self.consumeItem(playerId, itemDict, 1)
|
||||
comp.CreateMsg(playerId).NotifyOneMessage(playerId, "§7施肥没有起效…")
|
||||
return
|
||||
add = random.choice([2, 3]) # 生长2级或3级(封顶到成熟)
|
||||
end = min(index + add, len(RICE_BLOCKS) - 1)
|
||||
self.consumeItem(playerId, itemDict, 1)
|
||||
self.replaceBlock(pos, dim, RICE_BLOCKS[end], playerId)
|
||||
comp.CreateMsg(playerId).NotifyOneMessage(playerId, "§a水稻长大了!")
|
||||
self.replaceBlock(pos, dim, RICE_BLOCKS[index + 1], playerId)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
Reference in new issue
Block a user