commit 72dc6d009b1bb043f98033ee9a2898c594832843 Author: NathanSalapat Date: Tue Apr 18 08:52:46 2017 -0500 first commit diff --git a/game.conf b/game.conf new file mode 100644 index 0000000..e05e229 --- /dev/null +++ b/game.conf @@ -0,0 +1 @@ +name = new subgame diff --git a/menu/header.png b/menu/header.png new file mode 100644 index 0000000..03f869f Binary files /dev/null and b/menu/header.png differ diff --git a/menu/icon.png b/menu/icon.png new file mode 100644 index 0000000..80ece18 Binary files /dev/null and b/menu/icon.png differ diff --git a/minetest.conf b/minetest.conf new file mode 100644 index 0000000..916a2ca --- /dev/null +++ b/minetest.conf @@ -0,0 +1 @@ +mg_name = valleys diff --git a/mod ideas.txt b/mod ideas.txt new file mode 100644 index 0000000..8388fe0 --- /dev/null +++ b/mod ideas.txt @@ -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. diff --git a/mods/commands/init.lua b/mods/commands/init.lua new file mode 100644 index 0000000..a8a3312 --- /dev/null +++ b/mods/commands/init.lua @@ -0,0 +1,24 @@ +--Privs + + +--Commands +minetest.register_chatcommand("msg", { + params = " ", + 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, +}) diff --git a/mods/gamer/credits.txt b/mods/gamer/credits.txt new file mode 100644 index 0000000..e59ae25 --- /dev/null +++ b/mods/gamer/credits.txt @@ -0,0 +1,12 @@ +Authors of source code +---------------------- +Originally by celeron55, Perttu Ahola (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 diff --git a/mods/gamer/init.lua b/mods/gamer/init.lua new file mode 100644 index 0000000..8ff7bf9 --- /dev/null +++ b/mods/gamer/init.lua @@ -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) diff --git a/mods/gamer/models/gamer_model.b3d b/mods/gamer/models/gamer_model.b3d new file mode 100644 index 0000000..9ab4543 Binary files /dev/null and b/mods/gamer/models/gamer_model.b3d differ diff --git a/mods/gamer/textures/bubble.png b/mods/gamer/textures/bubble.png new file mode 100644 index 0000000..50630ae Binary files /dev/null and b/mods/gamer/textures/bubble.png differ diff --git a/mods/gamer/textures/crack_anylength.png b/mods/gamer/textures/crack_anylength.png new file mode 100644 index 0000000..494d949 Binary files /dev/null and b/mods/gamer/textures/crack_anylength.png differ diff --git a/mods/gamer/textures/gamer_skin.png b/mods/gamer/textures/gamer_skin.png new file mode 100644 index 0000000..0502178 Binary files /dev/null and b/mods/gamer/textures/gamer_skin.png differ diff --git a/mods/gamer/textures/heart.png b/mods/gamer/textures/heart.png new file mode 100644 index 0000000..8257552 Binary files /dev/null and b/mods/gamer/textures/heart.png differ diff --git a/mods/gamer/textures/wieldhand.png b/mods/gamer/textures/wieldhand.png new file mode 100644 index 0000000..11f28a4 Binary files /dev/null and b/mods/gamer/textures/wieldhand.png differ diff --git a/mods/ground/Ground.kra b/mods/ground/Ground.kra new file mode 100644 index 0000000..160e551 Binary files /dev/null and b/mods/ground/Ground.kra differ diff --git a/mods/ground/Ground.kra~ b/mods/ground/Ground.kra~ new file mode 100644 index 0000000..5a73c9b Binary files /dev/null and b/mods/ground/Ground.kra~ differ diff --git a/mods/ground/init.lua b/mods/ground/init.lua new file mode 100644 index 0000000..80e29c1 --- /dev/null +++ b/mods/ground/init.lua @@ -0,0 +1,2 @@ +dofile(minetest.get_modpath('ground')..'/nodes.lua') +dofile(minetest.get_modpath('ground')..'/mapgen.lua') diff --git a/mods/ground/mapgen.lua b/mods/ground/mapgen.lua new file mode 100644 index 0000000..5a8f29a --- /dev/null +++ b/mods/ground/mapgen.lua @@ -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, + }) diff --git a/mods/ground/nodes.lua b/mods/ground/nodes.lua new file mode 100644 index 0000000..2b3afea --- /dev/null +++ b/mods/ground/nodes.lua @@ -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(), +}) diff --git a/mods/ground/textures/default_water.png b/mods/ground/textures/default_water.png new file mode 100644 index 0000000..00500e9 Binary files /dev/null and b/mods/ground/textures/default_water.png differ diff --git a/mods/ground/textures/default_water_flowing_animated.png b/mods/ground/textures/default_water_flowing_animated.png new file mode 100644 index 0000000..070d797 Binary files /dev/null and b/mods/ground/textures/default_water_flowing_animated.png differ diff --git a/mods/ground/textures/ground_cobble.png b/mods/ground/textures/ground_cobble.png new file mode 100644 index 0000000..2967018 Binary files /dev/null and b/mods/ground/textures/ground_cobble.png differ diff --git a/mods/ground/textures/ground_dirt.png b/mods/ground/textures/ground_dirt.png new file mode 100644 index 0000000..2d7b0c8 Binary files /dev/null and b/mods/ground/textures/ground_dirt.png differ diff --git a/mods/ground/textures/ground_grass.png b/mods/ground/textures/ground_grass.png new file mode 100644 index 0000000..2f77017 Binary files /dev/null and b/mods/ground/textures/ground_grass.png differ diff --git a/mods/ground/textures/ground_grass_overlay.png b/mods/ground/textures/ground_grass_overlay.png new file mode 100644 index 0000000..f373e41 Binary files /dev/null and b/mods/ground/textures/ground_grass_overlay.png differ diff --git a/mods/ground/textures/ground_sand.png b/mods/ground/textures/ground_sand.png new file mode 100644 index 0000000..6b4d8d3 Binary files /dev/null and b/mods/ground/textures/ground_sand.png differ diff --git a/mods/ground/textures/ground_stone.png b/mods/ground/textures/ground_stone.png new file mode 100644 index 0000000..2789159 Binary files /dev/null and b/mods/ground/textures/ground_stone.png differ diff --git a/mods/ground/textures/ground_water_source_animated.png b/mods/ground/textures/ground_water_source_animated.png new file mode 100644 index 0000000..b194f8f Binary files /dev/null and b/mods/ground/textures/ground_water_source_animated.png differ diff --git a/mods/metals/init.lua b/mods/metals/init.lua new file mode 100644 index 0000000..c331c08 --- /dev/null +++ b/mods/metals/init.lua @@ -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') diff --git a/mods/metals/items.lua b/mods/metals/items.lua new file mode 100644 index 0000000..8d9e423 --- /dev/null +++ b/mods/metals/items.lua @@ -0,0 +1,4 @@ +minetest.register_craftitem("metals:iron_lump", { + description = "Iron Lump", + inventory_image = "metals_iron_lump.png", +}) diff --git a/mods/metals/mapgen.lua b/mods/metals/mapgen.lua new file mode 100644 index 0000000..2b15adc --- /dev/null +++ b/mods/metals/mapgen.lua @@ -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, +}) diff --git a/mods/metals/nodes.lua b/mods/metals/nodes.lua new file mode 100644 index 0000000..3e8d505 --- /dev/null +++ b/mods/metals/nodes.lua @@ -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(), +}) diff --git a/mods/metals/textures/metals_iron_lump.png b/mods/metals/textures/metals_iron_lump.png new file mode 100644 index 0000000..e7b19b1 Binary files /dev/null and b/mods/metals/textures/metals_iron_lump.png differ diff --git a/mods/metals/textures/metals_iron_ore.png b/mods/metals/textures/metals_iron_ore.png new file mode 100644 index 0000000..70679bb Binary files /dev/null and b/mods/metals/textures/metals_iron_ore.png differ diff --git a/mods/metals/textures/metals_iron_ore2.png b/mods/metals/textures/metals_iron_ore2.png new file mode 100644 index 0000000..40266e2 Binary files /dev/null and b/mods/metals/textures/metals_iron_ore2.png differ