diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..45f3046 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,19 @@ +unused_args = false +allow_defined_top = true + +globals = { + "minetest", +} + +read_globals = { + string = {fields = {"split"}}, + table = {fields = {"copy", "getn"}}, + + -- Builtin + "vector", "ItemStack", + "dump", "DIR_DELIM", "VoxelArea", "Settings", + + -- MTG + "default", "sfinv", "creative", +} + diff --git a/LICENSE b/LICENSE index 2071b23..a5a6612 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) +Copyright (c) 2023 tea@brass.host Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/game.conf b/game.conf new file mode 100644 index 0000000..461d4fe --- /dev/null +++ b/game.conf @@ -0,0 +1,2 @@ +title = Electric +description = hardmode game diff --git a/menu/icon.png b/menu/icon.png new file mode 100644 index 0000000..13a829c Binary files /dev/null and b/menu/icon.png differ diff --git a/mods/ebiome/biomes/grasslands.lua b/mods/ebiome/biomes/grasslands.lua new file mode 100644 index 0000000..0fa0791 --- /dev/null +++ b/mods/ebiome/biomes/grasslands.lua @@ -0,0 +1,75 @@ +local S = minetest.get_translator("eterrain") +minetest.register_biome({ + name = "grasslands", + node_top = "mapgen_topsoil", + depth_top = 1, + node_filler = "mapgen_soil", + depth_filler = 3, + y_max = 1000, + y_min = -3, + heat_point = 50, + humidity_point = 50, +}) +minetest.register_node("ebiome:oak_trunk_normal", { + description = S("Oak tree trunk"), + tiles = { "ebiome_oak_trunk_slice_normal.png", "ebiome_oak_trunk_slice_normal.png","ebiome_oak_trunk_normal.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree = 1, choppy = 2, flammable = 2}, + on_place = minetest.rotate_node +}) +minetest.register_node("ebiome:oak_trunk_normal_corner", { + description = S("Oak tree trunk corner branch"), + tiles = { + "ebiome_oak_trunk_normal.png", + "ebiome_oak_trunk_slice_normal.png", + "ebiome_oak_trunk_corner_normal.png^[transformFX", + "ebiome_oak_trunk_corner_normal.png", + "ebiome_oak_trunk_normal.png", + "ebiome_oak_trunk_slice_normal.png", + }, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree = 1, choppy = 2, flammable = 2}, + on_place = minetest.rotate_node +}) +minetest.register_node("ebiome:oak_sapling", { + description = S("Oak tree sapling"), + drawtype = "plantlike", + tiles = { "ebiome_oak_sapling.png" }, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1} +}) +minetest.register_node("ebiome:grass", { + description = S("Grass"), + tiles = {"ebiome_grass.png"}, + drawtype = "plantlike", + visual_scale = 1.4, + waving = 1, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, attached_node = 1, + flora = 1, grass = 1, flammable = 1, + fuel = 1 + }, +}) +minetest.register_alias("grass", "ebiome:grass") +minetest.register_alias("grassplant", "ebiome:grass") + +minetest.register_decoration({ + deco_type = "simple", + place_on = {"mapgen_topsoil"}, + sidelen = 16, + fill_ratio = 0.9, + biomes = {"grasslands"}, + y_max = 200, + y_min = 1, + decoration = "ebiome:grass", +}) + + diff --git a/mods/ebiome/config.lua b/mods/ebiome/config.lua new file mode 100644 index 0000000..691b5ab --- /dev/null +++ b/mods/ebiome/config.lua @@ -0,0 +1,5 @@ +ebiome = { + blocktypes = { + stone = "eterrain:rock" + } +} diff --git a/mods/ebiome/init.lua b/mods/ebiome/init.lua new file mode 100644 index 0000000..3fc05ac --- /dev/null +++ b/mods/ebiome/init.lua @@ -0,0 +1,2 @@ +dofile(minetest.get_modpath("ebiome") .. "/biomes/grasslands.lua") + diff --git a/mods/ebiome/textures/ebiome_grass.png b/mods/ebiome/textures/ebiome_grass.png new file mode 100644 index 0000000..2ab9593 Binary files /dev/null and b/mods/ebiome/textures/ebiome_grass.png differ diff --git a/mods/ebiome/textures/ebiome_grass.png~ b/mods/ebiome/textures/ebiome_grass.png~ new file mode 100644 index 0000000..b40d9e5 Binary files /dev/null and b/mods/ebiome/textures/ebiome_grass.png~ differ diff --git a/mods/ebiome/textures/ebiome_oak_sapling.png b/mods/ebiome/textures/ebiome_oak_sapling.png new file mode 100644 index 0000000..6b80a29 Binary files /dev/null and b/mods/ebiome/textures/ebiome_oak_sapling.png differ diff --git a/mods/ebiome/textures/ebiome_oak_trunk_corner_normal.png b/mods/ebiome/textures/ebiome_oak_trunk_corner_normal.png new file mode 100644 index 0000000..8f5341a Binary files /dev/null and b/mods/ebiome/textures/ebiome_oak_trunk_corner_normal.png differ diff --git a/mods/ebiome/textures/ebiome_oak_trunk_corner_normal.png~ b/mods/ebiome/textures/ebiome_oak_trunk_corner_normal.png~ new file mode 100644 index 0000000..00627c0 Binary files /dev/null and b/mods/ebiome/textures/ebiome_oak_trunk_corner_normal.png~ differ diff --git a/mods/ebiome/textures/ebiome_oak_trunk_normal.png b/mods/ebiome/textures/ebiome_oak_trunk_normal.png new file mode 100644 index 0000000..65e3d2c Binary files /dev/null and b/mods/ebiome/textures/ebiome_oak_trunk_normal.png differ diff --git a/mods/ebiome/textures/ebiome_oak_trunk_normal.png~ b/mods/ebiome/textures/ebiome_oak_trunk_normal.png~ new file mode 100644 index 0000000..6c936eb Binary files /dev/null and b/mods/ebiome/textures/ebiome_oak_trunk_normal.png~ differ diff --git a/mods/ebiome/textures/ebiome_oak_trunk_slice_normal.png b/mods/ebiome/textures/ebiome_oak_trunk_slice_normal.png new file mode 100644 index 0000000..2344a4f Binary files /dev/null and b/mods/ebiome/textures/ebiome_oak_trunk_slice_normal.png differ diff --git a/mods/eplayer/init.lua b/mods/eplayer/init.lua new file mode 100644 index 0000000..8e75a22 --- /dev/null +++ b/mods/eplayer/init.lua @@ -0,0 +1,14 @@ +minetest.override_item("", { + wield_scale = {x=1,y=1,z=2.5}, + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level = 0, + groupcaps = { + crumbly = {times={[1]=0.01, [2]=0.01, [3]=0.01}, uses=0, maxlevel=1}, + snappy = {times={[1]=0.01, [2]=0.01, [3]=0.01}, uses=0, maxlevel=1}, + choppy = {times={[1]=0.01, [2]=0.01, [3]=0.01}, uses=0, maxlevel=1}, + oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0} + }, + damage_groups = {fleshy=1}, + } +}) diff --git a/mods/eterrain/init.lua b/mods/eterrain/init.lua new file mode 100644 index 0000000..caca654 --- /dev/null +++ b/mods/eterrain/init.lua @@ -0,0 +1 @@ +dofile(minetest.get_modpath("eterrain") .. "/nodes.lua") diff --git a/mods/eterrain/mod.conf b/mods/eterrain/mod.conf new file mode 100644 index 0000000..f83163c --- /dev/null +++ b/mods/eterrain/mod.conf @@ -0,0 +1,4 @@ +name = eterrain +title = Electric game — terrain module +description = provides base terrain blocks and generator aliases + diff --git a/mods/eterrain/nodes.lua b/mods/eterrain/nodes.lua new file mode 100644 index 0000000..47b5a8f --- /dev/null +++ b/mods/eterrain/nodes.lua @@ -0,0 +1,158 @@ +local S = minetest.get_translator("eterrain") + +--------------------------------------------------- +-- eterrain:rock (rock, stone, mapgen_stone) +minetest.register_node("eterrain:rock", { + description = S("Barren rock"), + tiles={"eterrain_rock.png"}, + groups={solid=1, rock=1, crumbly=2} +}) +minetest.register_alias("mapgen_stone", "eterrain:rock") +minetest.register_alias("rock", "eterrain:rock") +minetest.register_alias("stone", "eterrain:rock") + + +--------------------------------------------------- +-- eterrain:soil (mapgen_soil, soil) +minetest.register_node("eterrain:soil", { + description = S("Topsoil"), + tiles={{name="eterrain_soil.png", align_style="world", scale=16}}, + groups={dirt=1, fertile=2, crumbly=3} +}) +minetest.register_alias("mapgen_soil", "eterrain:soil") +minetest.register_alias("soil", "eterrain:soil") + +--------------------------------------------------- +-- topsoil +minetest.register_node("eterrain:topsoil", { + description = S("Topsoil"), + tiles={ + { + name="eterrain_topsoil_top.png", + align_style="world", + scale=16 + }, + "eterrain_soil.png", + { + name="eterrain_topsoil_side.png", + align_style="world", + scale=16 + } + }, + groups={dirt=1, fertile=2, crumbly=3} +}) +minetest.register_alias("dirt_with_grass", "eterrain:topsoil") +minetest.register_alias("topsoil", "eterrain:topsoil") +minetest.register_alias("topsoil_with_grass", "eterrain:topsoil") +minetest.register_alias("mapgen_topsoil", "eterrain:topsoil") + +--------------------------------------------------- +-- ocean water +minetest.register_node("eterrain:water_ocean", { + description = S("Water"), + paramtype = "light", + tiles = { + { + name = "eterrain_water_animated.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + } + }, + { + name = "eterrain_water.png", + backface_culling = true, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + } + } + }, + groups = { liquid=3, water=3 }, + drawtype = "liquid", + liquidtype = "source", + walkable = false, + pointable = false, + diggable = false, + is_ground_content = false, + buildable_to = true, + use_texture_alpha = "blend", + drowning = 1, + drop = "", + liquid_alternative_flowing = "eterrain:water_ocean_stream", + liquid_alternative_source = "eterrain:water_ocean", + post_effect_color = {a = 250, r = 3, g = 6, b = 17}, + liquid_viscosity = 2, + move_resistance = 2, + liquid_move_physics = true, + waving = 3 +}) +minetest.register_alias("mapgen_water_source", "eterrain:water_ocean") +minetest.register_alias("water", "eterrain:water_ocean") + +--------------------------------------------------- +-- ocean water stream +minetest.register_node("eterrain:water_ocean_stream", { + description = S("Flowing water"), + paramtype = "light", + tiles = {"eterrain_water.png"}, + special_tiles = { + { + name = "eterrain_water_animated.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + } + }, + { + name = "eterrain_water.png", + backface_culling = true, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + } + } + }, + groups = { liquid=3, water=3 }, + drawtype = "flowingliquid", + paramtype2 = "flowingliquid", + liquidtype = "flowing", + walkable = false, + pointable = false, + diggable = false, + is_ground_content = false, + buildable_to = true, + use_texture_alpha = "blend", + drowning = 1, + drop = "", + liquid_alternative_flowing = "eterrain:water_ocean_stream", + liquid_alternative_source = "eterrain:water_ocean", + post_effect_color = {a = 110, r = 3, g = 6, b = 17}, + liquid_viscosity = 2, + move_resistance = 2, + liquid_move_physics = false, + waving = 3 +}) +minetest.register_alias("mapgen_water_source_stream", "eterrain:water_ocean") +minetest.register_alias("ocean", "eterrain:water_ocean") + + + +--------------------------------------------------- +-- TODO:river water +minetest.register_alias("mapgen_river_water_source", "eterrain:water_ocean_stream") +-- TODO:river water stream +minetest.register_alias("mapgen_river_water_stream", "eterrain:water_ocean_stream") +-- TODO:saltwater +-- TODO:saltwater +-- TODO: create river water and change mapgen diff --git a/mods/eterrain/textures/eterrain_rock.png b/mods/eterrain/textures/eterrain_rock.png new file mode 100644 index 0000000..b83d445 Binary files /dev/null and b/mods/eterrain/textures/eterrain_rock.png differ diff --git a/mods/eterrain/textures/eterrain_soil.png b/mods/eterrain/textures/eterrain_soil.png new file mode 100644 index 0000000..fc13f26 Binary files /dev/null and b/mods/eterrain/textures/eterrain_soil.png differ diff --git a/mods/eterrain/textures/eterrain_topsoil_side.png b/mods/eterrain/textures/eterrain_topsoil_side.png new file mode 100644 index 0000000..f9c54ff Binary files /dev/null and b/mods/eterrain/textures/eterrain_topsoil_side.png differ diff --git a/mods/eterrain/textures/eterrain_topsoil_top.png b/mods/eterrain/textures/eterrain_topsoil_top.png new file mode 100644 index 0000000..e1ebe49 Binary files /dev/null and b/mods/eterrain/textures/eterrain_topsoil_top.png differ diff --git a/mods/eterrain/textures/eterrain_water.png b/mods/eterrain/textures/eterrain_water.png new file mode 100644 index 0000000..f537935 Binary files /dev/null and b/mods/eterrain/textures/eterrain_water.png differ diff --git a/mods/eterrain/textures/eterrain_water_animated.png b/mods/eterrain/textures/eterrain_water_animated.png new file mode 100644 index 0000000..12d56ca Binary files /dev/null and b/mods/eterrain/textures/eterrain_water_animated.png differ