mirror of
https://github.com/a-bad-dev/simple-shooter-game.git
synced 2026-06-08 20:12:11 +00:00
* Dehardcode maps (currently not working) maps need work and proper configs * Fix bugs i'm terrible at lua * Add proper maps and configs * Fix some bugs the game at least loads now, though it crashes when you run /start <a map> * Fix more bugs The map starts now though you don't get teleported to it. * Teleport the player to the map spawn on start * Fix lots of bugs It mostly works now * Add butterflies mod * Another bugfix * Add fireflies mod * Add vessels mod (dependency for fireflies) * Add a sprint mod * Add a spawnpoint no more falling into the void * Update TODO.txt * Fix the barriers being offset by 2 Also add more dependency mods
171 lines
3.4 KiB
Lua
171 lines
3.4 KiB
Lua
-- farming/init.lua
|
|
|
|
-- Load support for MT game translation.
|
|
local S = minetest.get_translator("farming")
|
|
|
|
-- Global farming namespace
|
|
|
|
farming = {}
|
|
farming.path = minetest.get_modpath("farming")
|
|
farming.get_translator = S
|
|
|
|
-- Load files
|
|
|
|
dofile(farming.path .. "/api.lua")
|
|
dofile(farming.path .. "/nodes.lua")
|
|
dofile(farming.path .. "/hoes.lua")
|
|
|
|
|
|
-- Wheat
|
|
|
|
farming.register_plant("farming:wheat", {
|
|
description = S("Wheat Seed"),
|
|
harvest_description = S("Wheat"),
|
|
paramtype2 = "meshoptions",
|
|
inventory_image = "farming_wheat_seed.png",
|
|
steps = 8,
|
|
minlight = 13,
|
|
maxlight = default.LIGHT_MAX,
|
|
fertility = {"grassland"},
|
|
groups = {food_wheat = 1, flammable = 4},
|
|
place_param2 = 3,
|
|
})
|
|
|
|
minetest.register_craftitem("farming:flour", {
|
|
description = S("Flour"),
|
|
inventory_image = "farming_flour.png",
|
|
groups = {food_flour = 1, flammable = 1},
|
|
})
|
|
|
|
minetest.register_craftitem("farming:bread", {
|
|
description = S("Bread"),
|
|
inventory_image = "farming_bread.png",
|
|
on_use = minetest.item_eat(5),
|
|
groups = {food_bread = 1, flammable = 2},
|
|
})
|
|
|
|
minetest.register_craft({
|
|
type = "shapeless",
|
|
output = "farming:flour",
|
|
recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"}
|
|
})
|
|
|
|
minetest.register_craft({
|
|
type = "cooking",
|
|
cooktime = 15,
|
|
output = "farming:bread",
|
|
recipe = "farming:flour"
|
|
})
|
|
|
|
|
|
-- Cotton
|
|
|
|
farming.register_plant("farming:cotton", {
|
|
description = S("Cotton Seed"),
|
|
harvest_description = S("Cotton"),
|
|
inventory_image = "farming_cotton_seed.png",
|
|
steps = 8,
|
|
minlight = 13,
|
|
maxlight = default.LIGHT_MAX,
|
|
fertility = {"grassland", "desert"},
|
|
groups = {flammable = 4},
|
|
})
|
|
|
|
minetest.register_decoration({
|
|
name = "farming:cotton_wild",
|
|
deco_type = "simple",
|
|
place_on = {"default:dry_dirt_with_dry_grass"},
|
|
sidelen = 16,
|
|
noise_params = {
|
|
offset = -0.1,
|
|
scale = 0.1,
|
|
spread = {x = 50, y = 50, z = 50},
|
|
seed = 4242,
|
|
octaves = 3,
|
|
persist = 0.7
|
|
},
|
|
biomes = {"savanna"},
|
|
y_max = 31000,
|
|
y_min = 1,
|
|
decoration = "farming:cotton_wild",
|
|
})
|
|
|
|
minetest.register_craftitem("farming:string", {
|
|
description = S("String"),
|
|
inventory_image = "farming_string.png",
|
|
groups = {flammable = 2},
|
|
})
|
|
|
|
minetest.register_craft({
|
|
output = "wool:white",
|
|
recipe = {
|
|
{"farming:cotton", "farming:cotton"},
|
|
{"farming:cotton", "farming:cotton"},
|
|
}
|
|
})
|
|
|
|
minetest.register_craft({
|
|
output = "farming:string 2",
|
|
recipe = {
|
|
{"farming:cotton"},
|
|
{"farming:cotton"},
|
|
}
|
|
})
|
|
|
|
|
|
-- Straw
|
|
|
|
minetest.register_craft({
|
|
output = "farming:straw 3",
|
|
recipe = {
|
|
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
|
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
|
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
|
}
|
|
})
|
|
|
|
minetest.register_craft({
|
|
output = "farming:wheat 3",
|
|
recipe = {
|
|
{"farming:straw"},
|
|
}
|
|
})
|
|
|
|
|
|
-- Fuels
|
|
|
|
minetest.register_craft({
|
|
type = "fuel",
|
|
recipe = "farming:wheat",
|
|
burntime = 1,
|
|
})
|
|
|
|
minetest.register_craft({
|
|
type = "fuel",
|
|
recipe = "farming:cotton",
|
|
burntime = 1,
|
|
})
|
|
|
|
minetest.register_craft({
|
|
type = "fuel",
|
|
recipe = "farming:string",
|
|
burntime = 1,
|
|
})
|
|
|
|
minetest.register_craft({
|
|
type = "fuel",
|
|
recipe = "farming:hoe_wood",
|
|
burntime = 5,
|
|
})
|
|
|
|
|
|
-- Register farming items as dungeon loot
|
|
|
|
if minetest.global_exists("dungeon_loot") then
|
|
dungeon_loot.register({
|
|
{name = "farming:string", chance = 0.5, count = {1, 8}},
|
|
{name = "farming:wheat", chance = 0.5, count = {2, 5}},
|
|
{name = "farming:seed_cotton", chance = 0.4, count = {1, 4},
|
|
types = {"normal"}},
|
|
})
|
|
end
|