Adds another attempt at example

This commit is contained in:
AliasAlreadyTaken 2024-07-02 15:12:49 +02:00
parent 3e220129b1
commit 626997268f
2 changed files with 54 additions and 24 deletions

View File

@ -1,39 +1,69 @@
local overwrite = false
local modname = "canned_food"
local itemname = "melon_jam"
local stages = {}
stages["1"] = {
next_stage = "2",
duration = 5,
next_stage_chance = {["2"] = 55, ["3"] = 99, ["4"] = 7},
table.insert(stages, {
--stage related
stage_name = "yl_canned_food:melon_jam_1",
duration = 10,
next_stages = "yl_canned_food:melon_jam_2", --same as next_stage = { {"yl_canned_food:melon_jam_2", 1} }
--node definition
tiles = {"yl_canned_food_melon_jam_1.png"},
description = "Awesome melon jam",
node_definition = yl_canned_food.get_node_definition()
}
stages["2"] = {
next_stage = "3",
})
table.insert(stages, {
--stage related
stage_name = "yl_canned_food:melon_jam_2",
--[[
duration = {10, 20},
duration = {20, 10},
duration = {10},
duration = {10, 10},
]]--
duration = 10,
next_stage_chance = {["3"] = 99, ["4"] = 7},
--duration = "10",
next_stages = {
{ "yl_canned_food:melon_jam_3", 50 },
{ "yl_canned_food:melon_jam_4", 50 },
{ "default:cobble", 50 }
},
--node definition
tiles = {"yl_canned_food_melon_jam_2.png"},
description = "Awesome melon jam Stage 2",
node_definition = yl_canned_food.get_node_definition()
}
stages["3"] = {
next_stage = "4",
duration = 15,
})
table.insert(stages, {
--stage related
stage_name = "yl_canned_food:melon_jam_3",
--duration = nil,
--next_stages = nil,
--node definition
tiles = {"yl_canned_food_melon_jam_3.png"},
description = "Awesome melon jam Stage 3",
node_definition = yl_canned_food.get_node_definition()
}
stages["4"] = {
next_stage = "",
duration = 0,
next_stage_chance = {},
tiles = {"yl_canned_food_melon_jam_4.png"},
})
--[[
table.insert(stages, {
--stage related
stage_name = "yl_canned_food:melon_jam_4",
-- duration = {10, 20},
-- duration = {20, 10},
-- duration = {10},
-- duration = {10, 10},
duration = 10,
duration = "10",
next_stages = {
{ "yl_canned_food:melon_jam_1", 50 },
{ "yl_canned_food:melon_jam_2", 50 }
},
--node definition
tiles = {"yl_canned_food_melon_jam_2.png"},
description = "Awesome melon jam Stage 4",
node_definition = yl_canned_food.get_node_definition()
}
})
]]--
assert(yl_api_food.register_stages(modname, itemname, stages, overwrite))
assert(yl_api_food.register_stages(stages, overwrite))

View File

@ -1,5 +1,5 @@
name = yl_canned_food
description = Adds canned food
depends = yl_api_food
depends = yl_api_food, default
author = AliasAlreadyTaken
title = Canned Food