Add clays mod
This commit is contained in:
47
mods/GAME/ITEMS/clays/init.lua
Normal file
47
mods/GAME/ITEMS/clays/init.lua
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
local Item, Node, TileSheet = Smc.requireItem(), Smc.requireNode(), Smc.requireTileSheet()
|
||||||
|
local CraftSystem = Smc.requireCraftSystem()
|
||||||
|
|
||||||
|
-- local InventoryCraftHandler = CraftSystem:getPrimitiveCraftHandler('inside_player_inventory')
|
||||||
|
|
||||||
|
---@type TileSheet
|
||||||
|
local clayTileSheet = TileSheet:new('clays_sheet.png', 16, 16)
|
||||||
|
|
||||||
|
---@param type string
|
||||||
|
---@param y integer
|
||||||
|
local function registerSand(type, y)
|
||||||
|
Node:new({
|
||||||
|
settings = {
|
||||||
|
name = type..'_clay_block',
|
||||||
|
groups = { clay_block = 1, dig_immediate = 2 },
|
||||||
|
tiles = { clayTileSheet:t(0, y)}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
Item:new({
|
||||||
|
settings = {
|
||||||
|
name = type..'_clay',
|
||||||
|
inventory_image = clayTileSheet:t(1, y),
|
||||||
|
groups = { clay = 1 }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
Node:new({
|
||||||
|
settings = {
|
||||||
|
name = type..'_clay_bricks',
|
||||||
|
tiles = { clayTileSheet:t(2, y)},
|
||||||
|
groups = { clay_bricks = 1, dig_immediate = 2 }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
Item:new({
|
||||||
|
settings = {
|
||||||
|
name = type..'_clay_brick',
|
||||||
|
inventory_image = clayTileSheet:t(3, y),
|
||||||
|
groups = { clay_brick = 1 }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
registerSand('red', 0)
|
||||||
|
registerSand('white', 1)
|
||||||
|
registerSand('fireproof', 2)
|
||||||
2
mods/GAME/ITEMS/clays/mod.conf
Normal file
2
mods/GAME/ITEMS/clays/mod.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
name = smc__game__items__clays
|
||||||
|
depends = smc__core__node, smc__core__tilesheet
|
||||||
BIN
mods/GAME/ITEMS/clays/textures/sheets/clays_sheet.png
Normal file
BIN
mods/GAME/ITEMS/clays/textures/sheets/clays_sheet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Reference in New Issue
Block a user