Compare commits
3 Commits
934a8a8e83
...
600c83ea04
| Author | SHA1 | Date | |
|---|---|---|---|
| 600c83ea04 | |||
| e8f547e98b | |||
| c7d2b94603 |
@@ -1,16 +1,40 @@
|
|||||||
local Plant, TileSheet = Smc.requirePlant(), Smc.requireTileSheet()
|
local Plant, TileSheet = Smc.requirePlant(), Smc.requireTileSheet()
|
||||||
|
|
||||||
|
local placeParam2 = {
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
34,
|
||||||
|
35,
|
||||||
|
36
|
||||||
|
}
|
||||||
|
|
||||||
|
local function afterPlaceNode(pos, placer, itemstack, pointed_thing)
|
||||||
|
local node = core.get_node(pos)
|
||||||
|
node.param2 = 8 + placeParam2[math.random(#placeParam2)]
|
||||||
|
core.set_node(pos, node)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- --- Bog plants ---
|
||||||
|
local BogPlantsTileSheet = TileSheet:new('plants_bog_sheet.png', 16, 16)
|
||||||
|
|
||||||
|
for i=1, 3 do
|
||||||
Plant:new({
|
Plant:new({
|
||||||
settings = {
|
settings = {
|
||||||
name = 'plants',
|
name = 'bog_grass_'..tostring(i),
|
||||||
tiles = { "test_plant.png" },
|
tiles = { BogPlantsTileSheet:t(i-1, 0) },
|
||||||
place_param2 = 3,
|
place_param2 = 8,
|
||||||
},
|
},
|
||||||
|
callbacks = {
|
||||||
|
after_place_node = afterPlaceNode,
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- DEBUG
|
||||||
|
|
||||||
local PlantsTileSheet = TileSheet:new('plants_test_sheet.png', 16, 16)
|
local PlantsTileSheet = TileSheet:new('plants_test_sheet.png', 16, 16)
|
||||||
|
|
||||||
|
|
||||||
for i=0, 3 do
|
for i=0, 3 do
|
||||||
Plant:new({
|
Plant:new({
|
||||||
settings = {
|
settings = {
|
||||||
@@ -53,6 +77,3 @@ Plant:new({
|
|||||||
place_param2 = 3,
|
place_param2 = 3,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
mods/GAME/ITEMS/plants/textures/sheets/plants_bog_sheet.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,7 +1,9 @@
|
|||||||
local Node, TileSheet = Smc.requireNode(), Smc.requireTileSheet()
|
local Node, TileSheet = Smc.requireNode(), Smc.requireTileSheet()
|
||||||
|
|
||||||
---@type TileSheet
|
---@type TileSheet
|
||||||
local soilTileSheet = TileSheet:new("soils_sheet.png", 16, 16)
|
local soilTileSheet = TileSheet:new('soils_sheet.png', 16, 16)
|
||||||
|
---@type TileSheet
|
||||||
|
local grassTileSheet = TileSheet:new('soils_grass_sheet.png', 16, 16)
|
||||||
|
|
||||||
---@class SoilDef
|
---@class SoilDef
|
||||||
---@field rarity Item.Rarity?
|
---@field rarity Item.Rarity?
|
||||||
@@ -28,7 +30,10 @@ local function registerSoil(name, x, def, turfs)
|
|||||||
defaultSoil:new({
|
defaultSoil:new({
|
||||||
settings = {
|
settings = {
|
||||||
name = name,
|
name = name,
|
||||||
tiles = { soilTexture }
|
tiles = { soilTexture },
|
||||||
|
paramtype2 ='color4dir',
|
||||||
|
palette = 'soils_grass_palette.png',
|
||||||
|
drop = 'soils:'..name,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -56,238 +61,35 @@ local function registerSoil(name, x, def, turfs)
|
|||||||
})
|
})
|
||||||
|
|
||||||
if turfs ~= nil then
|
if turfs ~= nil then
|
||||||
for turfName, turfX in pairs(turfs) do
|
for turfName, turfY in pairs(turfs) do
|
||||||
defaultSoil:new({
|
defaultSoil:new({
|
||||||
settings = {
|
settings = {
|
||||||
name = turfName,
|
name = turfName,
|
||||||
tiles = {
|
tiles = {
|
||||||
--soilTileSheet:t(turfX,2),
|
grassTileSheet:t(0, turfY),
|
||||||
{ name = 'soils_test_top.png', align_style = 'world', scale = 2},
|
{name = soilTexture, color = 'white'},
|
||||||
soilTexture,
|
|
||||||
{ soilTexture..'^'..soilTileSheet:t(turfX,3) }
|
|
||||||
},
|
},
|
||||||
|
overlay_tiles = {
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
grassTileSheet:t(1, turfY),
|
||||||
|
grassTileSheet:t(2, turfY),
|
||||||
|
grassTileSheet:t(3, turfY),
|
||||||
|
grassTileSheet:t(4, turfY),
|
||||||
|
},
|
||||||
|
paramtype2 ='color4dir',
|
||||||
|
palette = 'soils_grass_palette.png',
|
||||||
|
drop = 'soils:'..turfName,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
registerSoil('mud', 0, {maxFertility = 20, rarity = 'common'}, {
|
||||||
local clayTiles = {
|
turf_bog = 0,
|
||||||
ts:t(0,0)
|
})
|
||||||
}
|
|
||||||
|
|
||||||
local sandyTiles = {
|
registerSoil('chernozem', 1, {maxFertility = 100, rarity = 'uncommon'}, {
|
||||||
ts:t(2,0)
|
turf_meadow = 0,
|
||||||
}
|
})
|
||||||
|
|
||||||
local mixedTiles = {
|
|
||||||
ts:t(4,0)
|
|
||||||
}
|
|
||||||
|
|
||||||
local rockyTiles = {
|
|
||||||
ts:t(6,0)
|
|
||||||
}
|
|
||||||
|
|
||||||
soilFactory:registerItems({
|
|
||||||
--- Clay soils
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "clay_soil_baren",
|
|
||||||
_title = "Barren Clay Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = clayTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "clay_soil_poor",
|
|
||||||
_title = "Poor Clay Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = clayTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "clay_soil_moderate",
|
|
||||||
_title = "Moderate Clay Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = clayTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "clay_soil_fertile",
|
|
||||||
_title = "Fertile Clay Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = clayTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "clay_soil_rich",
|
|
||||||
_title = "Rich Clay Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = clayTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Sandy soils
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "sandy_soil_baren",
|
|
||||||
_title = "Barren Sandy Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = sandyTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "sandy_soil_poor",
|
|
||||||
_title = "Poor Sandy Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = sandyTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "sandy_soil_moderate",
|
|
||||||
_title = "Moderate Sandy Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = sandyTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "sandy_soil_fertile",
|
|
||||||
_title = "Fertile Sandy Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = sandyTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "sandy_soil_rich",
|
|
||||||
_title = "Rich Sandy Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = sandyTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Mixed soils
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "mixed_soil_baren",
|
|
||||||
_title = "Barren Mixed Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = mixedTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "mixed_soil_poor",
|
|
||||||
_title = "Poor Mixed Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = mixedTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "mixed_soil_moderate",
|
|
||||||
_title = "Moderate Mixed Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = mixedTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "mixed_soil_fertile",
|
|
||||||
_title = "Fertile Mixed Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = mixedTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "mixed_soil_rich",
|
|
||||||
_title = "Rich Mixed Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = mixedTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Rocky soils
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "rocky_soil_baren",
|
|
||||||
_title = "Barren Rocky Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = rockyTiles,
|
|
||||||
rarity = 'uncommon'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "rocky_soil_poor",
|
|
||||||
_title = "Poor Rocky Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = rockyTiles,
|
|
||||||
rarity = 'distinguished'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "rocky_soil_moderate",
|
|
||||||
_title = "Moderate Rocky Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = rockyTiles,
|
|
||||||
rarity = 'eminent'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "rocky_soil_fertile",
|
|
||||||
_title = "Fertile Rocky Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = rockyTiles,
|
|
||||||
rarity = 'prime'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
---@type Node.NodeDefinition
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
name = "rocky_soil_rich",
|
|
||||||
_title = "Rich Rocky Soil",
|
|
||||||
--description = "",
|
|
||||||
tiles = rockyTiles,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
})--]]
|
|
||||||
|
|
||||||
registerSoil('humus', 0, {maxFertility = 100, rarity = 'uncommon'}, {turf_meadow=0})
|
|
||||||
|
|||||||
BIN
mods/GAME/ITEMS/soils/textures/palettes/soils_grass_palette.png
Normal file
|
After Width: | Height: | Size: 438 B |
BIN
mods/GAME/ITEMS/soils/textures/sheets/soils_grass_sheet.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -83,6 +83,7 @@ local function registerWood(name, x, def)
|
|||||||
def = {}
|
def = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Tree log with cut annual rings
|
||||||
defaultLog:new({
|
defaultLog:new({
|
||||||
settings = {
|
settings = {
|
||||||
name = name..'_log',
|
name = name..'_log',
|
||||||
@@ -96,6 +97,7 @@ local function registerWood(name, x, def)
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Stripped Log
|
||||||
defaultLog:new({
|
defaultLog:new({
|
||||||
settings = {
|
settings = {
|
||||||
name = name..'_log_stripped',
|
name = name..'_log_stripped',
|
||||||
@@ -108,25 +110,11 @@ local function registerWood(name, x, def)
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Tree trunk completely covered in bark
|
||||||
defaultLog:new({
|
defaultLog:new({
|
||||||
settings = {
|
settings = {
|
||||||
name = name..'_timber',
|
name = name..'_trunk',
|
||||||
tiles = {
|
|
||||||
woodTileSheet:t(x, 8)..'^[transformR90', woodTileSheet:t(x, 8)..'^[transformR90',
|
|
||||||
woodTileSheet:t(x, 8), woodTileSheet:t(x, 8),
|
|
||||||
woodTileSheet:t(x, 7), woodTileSheet:t(x, 7)
|
|
||||||
},
|
|
||||||
paramtype2 = 'facedir',
|
|
||||||
_rarity = def.rarity,
|
|
||||||
groups = {segments = 1}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
defaultLog:new({
|
|
||||||
settings = {
|
|
||||||
name = name..'_trunk_6_sides',
|
|
||||||
tiles = {woodTileSheet:t(x, 3)},
|
tiles = {woodTileSheet:t(x, 3)},
|
||||||
inventory_overlay = 'wood_trunk_overlay.png',
|
|
||||||
drop = 'wood:'..name..'_log',
|
drop = 'wood:'..name..'_log',
|
||||||
paramtype2 = 'facedir',
|
paramtype2 = 'facedir',
|
||||||
_rarity = def.rarity,
|
_rarity = def.rarity,
|
||||||
@@ -136,24 +124,13 @@ local function registerWood(name, x, def)
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- --- Tree branches ---
|
||||||
|
|
||||||
|
-- Branch completely covered in bark
|
||||||
defaultLog:new({
|
defaultLog:new({
|
||||||
settings = {
|
|
||||||
name = name..'_trunk_4_sides',
|
|
||||||
tiles = getLogTiles(x, 2),
|
|
||||||
inventory_overlay = 'wood_trunk_overlay.png',
|
|
||||||
drop = 'wood:'..name..'_log',
|
|
||||||
paramtype2 = 'facedir',
|
|
||||||
_rarity = def.rarity,
|
|
||||||
},
|
|
||||||
callbacks = {
|
|
||||||
on_place = core.rotate_node
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
local defaultBranch6Sides = defaultLog:getExtended({
|
|
||||||
settings = {
|
settings = {
|
||||||
drawtype = 'nodebox',
|
drawtype = 'nodebox',
|
||||||
name = '',
|
name = name..'_log_branch_6_sides',
|
||||||
tiles = {woodTileSheet:t(x, 3)},
|
tiles = {woodTileSheet:t(x, 3)},
|
||||||
paramtype = 'light',
|
paramtype = 'light',
|
||||||
node_box = {
|
node_box = {
|
||||||
@@ -171,24 +148,11 @@ local function registerWood(name, x, def)
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
local node = defaultBranch6Sides:new({
|
-- Branch with cut annual rings
|
||||||
settings = {
|
defaultLog:new({
|
||||||
name = name..'_log_branch_6_sides',
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
defaultBranch6Sides:new({
|
|
||||||
settings = {
|
|
||||||
name = name..'_trunk_branch_6_sides',
|
|
||||||
inventory_overlay = 'wood_trunk_overlay.png',
|
|
||||||
drop = name..'_log_branch_6_sides',
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
local defaultBranch4Sides = defaultLog:getExtended({
|
|
||||||
settings = {
|
settings = {
|
||||||
drawtype = 'nodebox',
|
drawtype = 'nodebox',
|
||||||
name = '',
|
name = name..'_log_branch_4_sides',
|
||||||
tiles = getLogTiles(x, 2),
|
tiles = getLogTiles(x, 2),
|
||||||
drop = 'wood:'..name..'_log',
|
drop = 'wood:'..name..'_log',
|
||||||
paramtype = 'light',
|
paramtype = 'light',
|
||||||
@@ -203,20 +167,43 @@ local function registerWood(name, x, def)
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
defaultBranch4Sides:new({
|
-- Tree leafs
|
||||||
|
defaultLeafs:new({
|
||||||
settings = {
|
settings = {
|
||||||
name = name..'_log_branch_4_sides',
|
name = name..'_leafs',
|
||||||
}
|
tiles = { woodTileSheet:t(x, 1) },
|
||||||
})
|
_rarity = def.rarity,
|
||||||
|
},
|
||||||
defaultBranch4Sides:new({
|
})
|
||||||
settings = {
|
|
||||||
name = name..'_trunk_branch_4_sides',
|
|
||||||
inventory_overlay = 'wood_trunk_overlay.png',
|
-- --- Tree lumber ---
|
||||||
drop = name..'_log_branch_4_sides',
|
|
||||||
|
-- Timber (block)
|
||||||
|
defaultLog:new({
|
||||||
|
settings = {
|
||||||
|
name = name..'_timber',
|
||||||
|
tiles = {
|
||||||
|
woodTileSheet:t(x, 8)..'^[transformR90',
|
||||||
|
woodTileSheet:t(x, 8)..'^[transformR90',
|
||||||
|
woodTileSheet:t(x, 8), woodTileSheet:t(x, 8),
|
||||||
|
woodTileSheet:t(x, 7), woodTileSheet:t(x, 7)
|
||||||
|
},
|
||||||
|
paramtype2 = 'facedir',
|
||||||
|
_rarity = def.rarity,
|
||||||
|
groups = {segments = 1}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Bar (item)
|
||||||
|
defaultStick:new({
|
||||||
|
settings = {
|
||||||
|
name = name..'_bar',
|
||||||
|
inventory_image = woodTileSheet:t(x, 11)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Planks (block)
|
||||||
defaultPlanks:new({
|
defaultPlanks:new({
|
||||||
settings = {
|
settings = {
|
||||||
name = name..'_planks',
|
name = name..'_planks',
|
||||||
@@ -226,21 +213,7 @@ local function registerWood(name, x, def)
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
defaultLeafs:new({
|
-- Plank (item)
|
||||||
settings = {
|
|
||||||
name = name..'_leafs',
|
|
||||||
tiles = { woodTileSheet:t(x, 1) },
|
|
||||||
_rarity = def.rarity,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
defaultStick:new({
|
|
||||||
settings = {
|
|
||||||
name = name..'_stick',
|
|
||||||
inventory_image = woodTileSheet:t(x, 9)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
defaultStick:new({
|
defaultStick:new({
|
||||||
settings = {
|
settings = {
|
||||||
name = name..'_plank',
|
name = name..'_plank',
|
||||||
@@ -248,13 +221,15 @@ local function registerWood(name, x, def)
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Stick
|
||||||
defaultStick:new({
|
defaultStick:new({
|
||||||
settings = {
|
settings = {
|
||||||
name = name..'_bar',
|
name = name..'_stick',
|
||||||
inventory_image = woodTileSheet:t(x, 11)
|
inventory_image = woodTileSheet:t(x, 9)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- --- Crafts ---
|
||||||
InventoryCraftHandler:registerCraft('wood:'..name..'_planks', {
|
InventoryCraftHandler:registerCraft('wood:'..name..'_planks', {
|
||||||
recipe = {
|
recipe = {
|
||||||
'wood:'..name..'_log'
|
'wood:'..name..'_log'
|
||||||
|
|||||||