first commit
BIN
menu/header.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
menu/icon.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
1
minetest.conf
Normal file
@ -0,0 +1 @@
|
||||
mg_name = valleys
|
18
mod ideas.txt
Normal file
@ -0,0 +1,18 @@
|
||||
Rather than having multiple mods that are all adding similar things, it makes sense to have single mods that have all the different things added into them.
|
||||
|
||||
My idea for mods would be something along the lines of this.
|
||||
|
||||
Animals: all the animals, monsters, tamable and not.
|
||||
Armor: basically just 3d_armor, but changed to be more realistic
|
||||
Soils: different types of soils for the different biomes.
|
||||
Farming: This would mostly just be an API
|
||||
Furniture: Things to beautify your house with.
|
||||
Food: This would include raw and cooked foods, and the yeilds of plants
|
||||
Hunger: hunger, thirst, and illnesses should all work together.
|
||||
Machines: Most machines should go here, really anything that has a formspec.
|
||||
Mobs: just the mob api.
|
||||
Ores: all the minerals that can be found in the ground
|
||||
Plants: All plants, trees, shrubs, veggies, grasses, etc.
|
||||
Space: all the nodes needed for the spawn location building.
|
||||
Storage: Chests, bottles, cups, buckets, etc.
|
||||
Tools: All tools, weapons, etc.
|
24
mods/commands/init.lua
Normal file
@ -0,0 +1,24 @@
|
||||
--Privs
|
||||
|
||||
|
||||
--Commands
|
||||
minetest.register_chatcommand("msg", {
|
||||
params = "<name> <message>",
|
||||
description = "Send a private message",
|
||||
privs = {msg=true},
|
||||
func = function(name, param)
|
||||
local sendto, message = param:match("^(%S+)%s(.+)$")
|
||||
if not sendto then
|
||||
return false, "Invalid usage, see /help msg."
|
||||
end
|
||||
if not core.get_player_by_name(sendto) then
|
||||
return false, "The player " .. sendto
|
||||
.. " is not online."
|
||||
end
|
||||
core.log("action", "PM from " .. name .. " to " .. sendto
|
||||
.. ": " .. message)
|
||||
core.chat_send_player(sendto, "PM from " .. name .. ": "
|
||||
.. message)
|
||||
return true, "Message sent."
|
||||
end,
|
||||
})
|
12
mods/gamer/credits.txt
Normal file
@ -0,0 +1,12 @@
|
||||
Authors of source code
|
||||
----------------------
|
||||
Originally by celeron55, Perttu Ahola <celeron55@gmail.com> (LGPL 2.1)
|
||||
Various Minetest developers and contributors (LGPL 2.1)
|
||||
With a few tweaks by Nathan Salapat
|
||||
|
||||
-----Media-----
|
||||
MirceaKitsune (CC BY-SA 3.0):
|
||||
character.x
|
||||
|
||||
Jordach (CC BY-SA 3.0):
|
||||
character.png
|
196
mods/gamer/init.lua
Normal file
@ -0,0 +1,196 @@
|
||||
gamer = {}
|
||||
|
||||
-- GUI related stuff
|
||||
gamer.gui_bg = 'bgcolor[#080808BB;true]'
|
||||
gamer.gui_bg_img = 'background[5,5;1,1;gui_formbg.png;true]'
|
||||
gamer.gui_slots = 'listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]'
|
||||
|
||||
function gamer.get_hotbar_bg(x,y)
|
||||
local out = ''
|
||||
for i=0,7,1 do
|
||||
out = out ..'image['..x+i..','..y..';1,1;gui_hb_bg.png]'
|
||||
end
|
||||
return out
|
||||
end
|
||||
|
||||
gamer.gui_survival_form = 'size[8,8.5]'..
|
||||
gamer.gui_bg..
|
||||
gamer.gui_bg_img..
|
||||
gamer.gui_slots..
|
||||
'list[current_player;main;0,4.25;8,1;]'..
|
||||
'list[current_player;main;0,5.5;8,3;8]'..
|
||||
'list[current_player;craft;1.75,0.5;3,3;]'..
|
||||
'list[current_player;craftpreview;5.75,1.5;1,1;]'..
|
||||
'image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]'..
|
||||
'listring[current_player;main]'..
|
||||
'listring[current_player;craft]'..
|
||||
gamer.get_hotbar_bg(0,4.25)
|
||||
|
||||
minetest.register_item(':', {
|
||||
type = 'none',
|
||||
wield_image = 'wieldhand.png',
|
||||
wield_scale = {x=1,y=1,z=2.5},
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.9,
|
||||
max_drop_level = 0,
|
||||
groupcaps = {
|
||||
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
|
||||
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
|
||||
oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0},
|
||||
cracky = {times={[3]=0.40}, uses=0, maxlevel=1}
|
||||
},
|
||||
damage_groups = {fleshy=1},
|
||||
}
|
||||
})
|
||||
|
||||
gamer.registered_player_models = { }
|
||||
|
||||
-- Local for speed.
|
||||
local models = gamer.registered_player_models
|
||||
|
||||
function gamer.player_register_model(name, def)
|
||||
models[name] = def
|
||||
end
|
||||
|
||||
-- Default player appearance
|
||||
gamer.player_register_model('gamer_model.b3d', {
|
||||
animation_speed = 30,
|
||||
textures = {'gamer_skin.png', },
|
||||
animations = {
|
||||
-- Standard animations.
|
||||
stand = { x= 0, y= 79, },
|
||||
lay = { x=162, y=166, },
|
||||
walk = { x=168, y=187, },
|
||||
mine = { x=189, y=198, },
|
||||
walk_mine = { x=200, y=219, },
|
||||
sit = { x= 81, y=160, },
|
||||
},
|
||||
})
|
||||
|
||||
-- Player stats and animations
|
||||
local player_model = {}
|
||||
local player_textures = {}
|
||||
local player_anim = {}
|
||||
local player_sneak = {}
|
||||
gamer.player_attached = {}
|
||||
|
||||
function gamer.player_get_animation(player)
|
||||
local name = player:get_player_name()
|
||||
return {
|
||||
model = player_model[name],
|
||||
textures = player_textures[name],
|
||||
animation = player_anim[name],
|
||||
}
|
||||
end
|
||||
|
||||
-- Called when a player's appearance needs to be updated
|
||||
function gamer.player_set_model(player, model_name)
|
||||
local name = player:get_player_name()
|
||||
local model = models[model_name]
|
||||
if model then
|
||||
if player_model[name] == model_name then
|
||||
return
|
||||
end
|
||||
player:set_properties({
|
||||
mesh = model_name,
|
||||
textures = player_textures[name] or model.textures,
|
||||
visual = 'mesh',
|
||||
visual_size = model.visual_size or {x=1, y=1},
|
||||
})
|
||||
gamer.player_set_animation(player, 'stand')
|
||||
else
|
||||
player:set_properties({
|
||||
textures = { 'player.png', 'player_back.png', },
|
||||
visual = 'upright_sprite',
|
||||
})
|
||||
end
|
||||
player_model[name] = model_name
|
||||
end
|
||||
|
||||
function gamer.player_set_textures(player, textures)
|
||||
local name = player:get_player_name()
|
||||
player_textures[name] = textures
|
||||
player:set_properties({textures = textures,})
|
||||
end
|
||||
|
||||
function gamer.player_set_animation(player, anim_name, speed)
|
||||
local name = player:get_player_name()
|
||||
if player_anim[name] == anim_name then
|
||||
return
|
||||
end
|
||||
local model = player_model[name] and models[player_model[name]]
|
||||
if not (model and model.animations[anim_name]) then
|
||||
return
|
||||
end
|
||||
local anim = model.animations[anim_name]
|
||||
player_anim[name] = anim_name
|
||||
player:set_animation(anim, speed or model.animation_speed, animation_blend)
|
||||
end
|
||||
|
||||
-- Update appearance when the player joins
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
gamer.player_attached[player:get_player_name()] = false
|
||||
gamer.player_set_model(player, 'gamer_model.b3d')
|
||||
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
|
||||
|
||||
-- set GUI
|
||||
if not minetest.setting_getbool('creative_mode') then
|
||||
player:set_inventory_formspec(gamer.gui_survival_form)
|
||||
end
|
||||
player:hud_set_hotbar_image('gui_hotbar.png')
|
||||
player:hud_set_hotbar_selected_image('gui_hotbar_selected.png')
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
player_model[name] = nil
|
||||
player_anim[name] = nil
|
||||
player_textures[name] = nil
|
||||
end)
|
||||
|
||||
-- Localize for better performance.
|
||||
local player_set_animation = gamer.player_set_animation
|
||||
local player_attached = gamer.player_attached
|
||||
|
||||
-- Check each player and apply animations
|
||||
minetest.register_globalstep(function(dtime)
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
local model_name = player_model[name]
|
||||
local model = model_name and models[model_name]
|
||||
if model and not player_attached[name] then
|
||||
local controls = player:get_player_control()
|
||||
local walking = false
|
||||
local animation_speed_mod = model.animation_speed or 30
|
||||
|
||||
-- Determine if the player is walking
|
||||
if controls.up or controls.down or controls.left or controls.right then
|
||||
walking = true
|
||||
end
|
||||
|
||||
-- Determine if the player is sneaking, and reduce animation speed if so
|
||||
if controls.sneak then
|
||||
animation_speed_mod = animation_speed_mod / 2
|
||||
end
|
||||
|
||||
-- Apply animations based on what the player is doing
|
||||
if player:get_hp() == 0 then
|
||||
player_set_animation(player, 'lay')
|
||||
elseif walking then
|
||||
if player_sneak[name] ~= controls.sneak then
|
||||
player_anim[name] = nil
|
||||
player_sneak[name] = controls.sneak
|
||||
end
|
||||
if controls.LMB then
|
||||
player_set_animation(player, 'walk_mine', animation_speed_mod)
|
||||
else
|
||||
player_set_animation(player, 'walk', animation_speed_mod)
|
||||
end
|
||||
elseif controls.LMB then
|
||||
player_set_animation(player, 'mine')
|
||||
else
|
||||
player_set_animation(player, 'stand', animation_speed_mod)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
BIN
mods/gamer/models/gamer_model.b3d
Normal file
BIN
mods/gamer/textures/bubble.png
Normal file
After Width: | Height: | Size: 680 B |
BIN
mods/gamer/textures/crack_anylength.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
mods/gamer/textures/gamer_skin.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
mods/gamer/textures/heart.png
Normal file
After Width: | Height: | Size: 390 B |
BIN
mods/gamer/textures/wieldhand.png
Normal file
After Width: | Height: | Size: 458 B |
BIN
mods/ground/Ground.kra
Normal file
BIN
mods/ground/Ground.kra~
Normal file
2
mods/ground/init.lua
Normal file
@ -0,0 +1,2 @@
|
||||
dofile(minetest.get_modpath('ground')..'/nodes.lua')
|
||||
dofile(minetest.get_modpath('ground')..'/mapgen.lua')
|
54
mods/ground/mapgen.lua
Normal file
@ -0,0 +1,54 @@
|
||||
minetest.register_alias('mapgen_stone', 'ground:stone')
|
||||
minetest.register_alias('mapgen_dirt', 'ground:dirt')
|
||||
minetest.register_alias('mapgen_dirt_with_grass', 'ground:dirt_with_grass')
|
||||
minetest.register_alias('mapgen_sand', 'ground:sand')
|
||||
minetest.register_alias('mapgen_water_source', 'ground:water_source')
|
||||
minetest.register_alias('mapgen_river_water_source', 'ground:water_source')
|
||||
minetest.register_alias('mapgen_lava_source', 'default:lava_source')
|
||||
minetest.register_alias('mapgen_gravel', 'default:gravel')
|
||||
minetest.register_alias('mapgen_desert_stone', 'default:desert_stone')
|
||||
minetest.register_alias('mapgen_desert_sand', 'default:desert_sand')
|
||||
minetest.register_alias('mapgen_dirt_with_snow', 'default:dirt_with_snow')
|
||||
minetest.register_alias('mapgen_snowblock', 'default:snowblock')
|
||||
minetest.register_alias('mapgen_snow', 'default:snow')
|
||||
minetest.register_alias('mapgen_ice', 'default:ice')
|
||||
minetest.register_alias('mapgen_sandstone', 'default:sandstone')
|
||||
|
||||
-- Flora
|
||||
|
||||
minetest.register_alias('mapgen_tree', 'default:tree')
|
||||
minetest.register_alias('mapgen_leaves', 'default:leaves')
|
||||
minetest.register_alias('mapgen_apple', 'default:apple')
|
||||
minetest.register_alias('mapgen_jungletree', 'default:jungletree')
|
||||
minetest.register_alias('mapgen_jungleleaves', 'default:jungleleaves')
|
||||
minetest.register_alias('mapgen_junglegrass', 'default:junglegrass')
|
||||
minetest.register_alias('mapgen_pine_tree', 'default:pine_tree')
|
||||
minetest.register_alias('mapgen_pine_needles', 'default:pine_needles')
|
||||
|
||||
-- Dungeons
|
||||
|
||||
minetest.register_alias('mapgen_cobble', 'ground:cobble')
|
||||
minetest.register_alias('mapgen_stair_cobble', 'stairs:stair_cobble')
|
||||
minetest.register_alias('mapgen_mossycobble', 'default:mossycobble')
|
||||
minetest.register_alias('mapgen_sandstonebrick', 'default:sandstonebrick')
|
||||
minetest.register_alias('mapgen_stair_sandstonebrick', 'stairs:stair_sandstonebrick')
|
||||
|
||||
minetest.register_biome({
|
||||
name = 'grassland',
|
||||
--node_dust = '',
|
||||
node_top = 'ground:dirt_with_grass',
|
||||
depth_top = 1,
|
||||
node_filler = 'ground:dirt',
|
||||
depth_filler = 6,
|
||||
--node_stone = '',
|
||||
--node_water_top = '',
|
||||
--depth_water_top = ,
|
||||
--node_water = '',
|
||||
--node_river_water = '',
|
||||
node_riverbed = 'ground:sand',
|
||||
depth_riverbed = 2,
|
||||
y_min = 6,
|
||||
y_max = 15,
|
||||
heat_point = 50,
|
||||
humidity_point = 35,
|
||||
})
|
112
mods/ground/nodes.lua
Normal file
@ -0,0 +1,112 @@
|
||||
minetest.register_node('ground:stone', {
|
||||
description = 'Stone',
|
||||
tiles = {'ground_stone.png'},
|
||||
groups = {cracky=3, stone=1},
|
||||
drop = 'ground:cobble',
|
||||
})
|
||||
|
||||
minetest.register_node('ground:cobble', {
|
||||
description = 'Cobblestone',
|
||||
tiles = {'ground_cobble.png'},
|
||||
groups = {cracky=3, stone=1},
|
||||
})
|
||||
|
||||
minetest.register_node('ground:dirt', {
|
||||
description = 'Dirt',
|
||||
tiles = {'ground_dirt.png'},
|
||||
groups = {crumbly = 3},
|
||||
})
|
||||
|
||||
minetest.register_node('ground:dirt_with_grass', {
|
||||
description = 'Dirt with Grass',
|
||||
tiles = {'ground_grass.png', 'ground_dirt.png',
|
||||
{name = 'ground_dirt.png^ground_grass_overlay.png',
|
||||
tileable_vertical = false}},
|
||||
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
|
||||
drop = 'ground:dirt',
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node('ground:sand', {
|
||||
description = 'Sand',
|
||||
tiles = {'ground_sand.png'},
|
||||
groups = {crumbly = 3, falling_node = 1},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node('ground:water_source', {
|
||||
description = 'Water Source',
|
||||
drawtype = 'liquid',
|
||||
tiles = {
|
||||
{
|
||||
name = 'ground_water_source_animated.png',
|
||||
animation = {
|
||||
type = 'vertical_frames',
|
||||
aspect_w = 32,
|
||||
aspect_h = 32,
|
||||
length = 2.0,
|
||||
},
|
||||
},
|
||||
},
|
||||
alpha = 160,
|
||||
paramtype = 'light',
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = false,
|
||||
drop = '',
|
||||
drowning = 1,
|
||||
liquidtype = 'source',
|
||||
liquid_alternative_flowing = 'ground:water_flowing',
|
||||
liquid_alternative_source = 'ground:water_source',
|
||||
liquid_viscosity = 1,
|
||||
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
|
||||
groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
|
||||
})
|
||||
|
||||
minetest.register_node('ground:water_flowing', {
|
||||
description = 'Flowing Water',
|
||||
drawtype = 'flowingliquid',
|
||||
tiles = {'ground_water.png'},
|
||||
special_tiles = {
|
||||
{
|
||||
name = 'ground_water_source_animated.png',
|
||||
backface_culling = false,
|
||||
animation = {
|
||||
type = 'vertical_frames',
|
||||
aspect_w = 32,
|
||||
aspect_h = 32,
|
||||
length = 0.8,
|
||||
},
|
||||
},
|
||||
{
|
||||
name = 'ground_water_source_animated.png',
|
||||
backface_culling = true,
|
||||
animation = {
|
||||
type = 'vertical_frames',
|
||||
aspect_w = 32,
|
||||
aspect_h = 32,
|
||||
length = 0.8,
|
||||
},
|
||||
},
|
||||
},
|
||||
alpha = 160,
|
||||
paramtype = 'light',
|
||||
paramtype2 = 'flowingliquid',
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = false,
|
||||
drop = '',
|
||||
drowning = 1,
|
||||
liquidtype = 'flowing',
|
||||
liquid_alternative_flowing = 'ground:water_flowing',
|
||||
liquid_alternative_source = 'ground:water_source',
|
||||
liquid_viscosity = 1,
|
||||
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
|
||||
groups = {water = 3, liquid = 3, puts_out_fire = 1,
|
||||
not_in_creative_inventory = 1, cools_lava = 1},
|
||||
-- sounds = default.node_sound_water_defaults(),
|
||||
})
|
BIN
mods/ground/textures/default_water.png
Normal file
After Width: | Height: | Size: 257 B |
BIN
mods/ground/textures/default_water_flowing_animated.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
mods/ground/textures/ground_cobble.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
mods/ground/textures/ground_dirt.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
mods/ground/textures/ground_grass.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
mods/ground/textures/ground_grass_overlay.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
mods/ground/textures/ground_sand.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
mods/ground/textures/ground_stone.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
mods/ground/textures/ground_water_source_animated.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
3
mods/metals/init.lua
Normal file
@ -0,0 +1,3 @@
|
||||
dofile(minetest.get_modpath('metals')..'/nodes.lua')
|
||||
dofile(minetest.get_modpath('metals')..'/mapgen.lua')
|
||||
dofile(minetest.get_modpath('metals')..'/items.lua')
|
4
mods/metals/items.lua
Normal file
@ -0,0 +1,4 @@
|
||||
minetest.register_craftitem("metals:iron_lump", {
|
||||
description = "Iron Lump",
|
||||
inventory_image = "metals_iron_lump.png",
|
||||
})
|
21
mods/metals/mapgen.lua
Normal file
@ -0,0 +1,21 @@
|
||||
minetest.register_ore({
|
||||
ore_type = 'scatter',
|
||||
ore = 'metals:stone_with_iron',
|
||||
wherein = 'ground:stone',
|
||||
clust_scarcity = 8 * 8 * 8,
|
||||
clust_num_ores = 12,
|
||||
clust_size = 3,
|
||||
y_min = -31000,
|
||||
y_max = 0,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = 'scatter',
|
||||
ore = 'metals:stone_with_iron2',
|
||||
wherein = 'metals:stone_with_iron',
|
||||
clust_scarcity = 4 * 4 * 4,
|
||||
clust_num_ores = 12,
|
||||
clust_size = 3,
|
||||
y_min = -31000,
|
||||
y_max = -50,
|
||||
})
|
25
mods/metals/nodes.lua
Normal file
@ -0,0 +1,25 @@
|
||||
minetest.register_node('metals:stone_with_iron', {
|
||||
description = 'Stone with Iron',
|
||||
tiles = {'ground_stone.png^metals_iron_ore.png'},
|
||||
groups = {cracky=3, stone=1},
|
||||
drop = 'metals:iron_lump',
|
||||
-- sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node('metals:stone_with_iron2', {
|
||||
description = 'Stone with Iron',
|
||||
tiles = {'ground_stone.png^metals_iron_ore2.png'},
|
||||
groups = {cracky=3, stone=1},
|
||||
drop = {
|
||||
items = {
|
||||
{
|
||||
items = {'metals:iron_lump 3'},
|
||||
rarity = 6,
|
||||
},
|
||||
{
|
||||
items = {'metals:iron_lump 2'},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- sounds = default.node_sound_stone_defaults(),
|
||||
})
|
BIN
mods/metals/textures/metals_iron_lump.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
mods/metals/textures/metals_iron_ore.png
Normal file
After Width: | Height: | Size: 1019 B |
BIN
mods/metals/textures/metals_iron_ore2.png
Normal file
After Width: | Height: | Size: 1.4 KiB |