Compare commits
5 Commits
641f258215
...
06d57ec050
Author | SHA1 | Date |
---|---|---|
paramat | 06d57ec050 | |
paramat | 1d3ff7f94e | |
paramat | d0f23254ac | |
paramat | ef2784fd5a | |
paramat | ea15138827 |
107
README.txt
|
@ -1,5 +1,5 @@
|
|||
minipeli 0.2.2 by paramat.
|
||||
A game for Minetest Engine 5.1.0 and later.
|
||||
minipeli 0.2.7 by paramat.
|
||||
A game for Minetest Engine 5.2.0 and later.
|
||||
|
||||
|
||||
Authors of media
|
||||
|
@ -7,29 +7,31 @@ Authors of media
|
|||
paramat (CC BY-SA 3.0):
|
||||
header.png
|
||||
icon.png
|
||||
screenshot.png
|
||||
|
||||
|
||||
About Minipeli
|
||||
--------------
|
||||
'Peli' is the Finnish word for 'game'.
|
||||
|
||||
This game is intended to be an example of minimal requirements for a Minetest Engine game, to help others create their own games.
|
||||
This also suggests a good mod structure, as opposed to the problematic structure of the game called 'Minetest Game', which has most content in one large mod called 'default'. It is better to split the content into many smaller mods.
|
||||
This game is intended to be one example of minimal requirements for a Minetest Engine game, while still supporting all non-Mapgen V6 mapgens and providing a minimal number of biomes with appropriate vertical variation.
|
||||
The intention is to help others and myself create completely new games.
|
||||
|
||||
This also suggests a good mod structure, as opposed to the problematic structure of Minetest Game, which has most content in one large mod. It is better to divide content into several mods that correspond to the distinct elements of the game.
|
||||
|
||||
Because creating animated meshes is difficult, the player model from Minetest Game is used, it seems suitable for many games.
|
||||
The player API of Minetest Game is very useful and quite fundamental, so the 'player_api' mod from Minetest Game is included, but with new player textures.
|
||||
|
||||
The 'light' mod is only provided to illuminate caves and dungeons during testing.
|
||||
|
||||
if the 'creative' mod from Minetest Game is used with Minipeli, the dependencies in the 'creative' mod mod.conf file must be edited to: 'depends = hand, sfinv'.
|
||||
|
||||
|
||||
Why Mapgen v6 is not supported
|
||||
Why Mapgen V6 is not supported
|
||||
------------------------------
|
||||
|
||||
In the 'game.conf' file, mapgen v6 is set as a disallowed mapgen.
|
||||
Mapgen v6 is very different to all the other mapgens, it has hardcoded biomes and does not use the Biome API. Due to this it makes game code more complex and more difficult to maintain, the mapgen also misses many features.
|
||||
I recommended that games do not support Mapgen v6 for these reasons.
|
||||
Mapgen V6 is very different to all the other mapgens, it has hardcoded biomes and does not use the Biome API. Due to this it makes game code far more complex and more difficult to maintain, the mapgen also misses many features.
|
||||
I recommended that games do not support Mapgen V6 for these reasons.
|
||||
This document is written assuming Mapgen V6 is not supported.
|
||||
|
||||
|
||||
The mods and their functions
|
||||
|
@ -43,14 +45,20 @@ Sets suitable animations according to control inputs and player health.
|
|||
|
||||
'gui'
|
||||
Contains formspec and HUD related stuff:
|
||||
Formspec background, hotbar background, bubble and heart textures.
|
||||
Formspec background, bubble and heart textures.
|
||||
Sets the formspec prepend.
|
||||
Sets custom hotbar textures if code un-commented and textures added.
|
||||
|
||||
'hand'
|
||||
Contains the hand tool related stuff:
|
||||
Contains the hand related stuff:
|
||||
The wieldhand texture.
|
||||
Registers the hand tool.
|
||||
Registers the hand.
|
||||
|
||||
'creative_mode'
|
||||
Activates in creative mode.
|
||||
A simple creative mod without a creative inventory.
|
||||
Overrides the hand registration for special digging capabilities.
|
||||
Enables placing unlimited nodes without removing from inventory.
|
||||
Prevents dug nodes being added to inventory if already present.
|
||||
|
||||
'media'
|
||||
Contains textures and sounds that have no suitable location anywhere else:
|
||||
|
@ -59,15 +67,53 @@ The 'player_damage' sound.
|
|||
|
||||
'mapgen'
|
||||
Contains the mapgen related stuff:
|
||||
Terrain, liquid and dungeon nodes, their textures and sounds.
|
||||
Mapgen aliases to tell the C++ mapgens which nodes to use.
|
||||
Biome registrations.
|
||||
Terrain, water, cave liquid and dungeon nodes, their textures and sounds.
|
||||
Mapgen aliases to tell the engine mapgens which nodes to use.
|
||||
Biome registrations for one vertical stack of biomes.
|
||||
|
||||
'light'
|
||||
Only included to provide illumination for testing.
|
||||
Gives 64 lights to a new player.
|
||||
|
||||
|
||||
Mapgen aliases
|
||||
--------------
|
||||
|
||||
Since MT 5.0.0, dungeon nodes and cave liquids are defined in biome definitions, so now only 3 mapgen aliases need to be registered: stone, water, river water.
|
||||
|
||||
|
||||
Biomes
|
||||
------
|
||||
|
||||
This game registers a single 'biome stack': A set of vertically stacked biomes all with the same heat and humidity points.
|
||||
A more developed game would usually add extra biome stacks at differing heat and humidity points.
|
||||
|
||||
The 'grassland' biome stack in this game consists of:
|
||||
|
||||
"grassland":
|
||||
Dry land of dirt with a grass surface layer.
|
||||
Extends from beach top up to world top.
|
||||
Any flooded caves contain water.
|
||||
|
||||
"grassland_sea":
|
||||
With the sand of beaches, lakebeds and seabeds.
|
||||
Extends from beach top down to y = -127 to contain most sea depths.
|
||||
Sand may occasionally appear in caves due to how mapgen works.
|
||||
Any flooded caves contain water.
|
||||
|
||||
"grassland_under":
|
||||
Meaning 'underground'.
|
||||
Stone only, below most sea depths.
|
||||
Extends from y = -128 down to y = -1023.
|
||||
Any flooded caves contain water.
|
||||
|
||||
"grassland_deep":
|
||||
Meaning 'deep underground'.
|
||||
Stone only.
|
||||
Extends from y = -1024 down to world base.
|
||||
The depth where magma appears, any flooded caves can contain water or magma.
|
||||
|
||||
|
||||
How this game was created
|
||||
-------------------------
|
||||
|
||||
|
@ -81,30 +127,37 @@ Delete unnecessary mod.conf file.
|
|||
Minetest Game mods used heavily modified:
|
||||
|
||||
'default' mod:
|
||||
Becomes 'gui', 'hand' and 'media' mods.
|
||||
The minipeli 'gui', 'hand' and 'media' mods are derived from it.
|
||||
'creative' mod:
|
||||
The minipeli 'creative_mode' mod is derived from it.
|
||||
|
||||
|
||||
'default' mod is split into 3 mods:
|
||||
|
||||
'gui' mod contains:
|
||||
Textures:
|
||||
gui_formbg
|
||||
gui_hb_bg
|
||||
bubble
|
||||
heart
|
||||
gui_formbg.png
|
||||
bubble.png
|
||||
heart.png
|
||||
init.lua:
|
||||
minetest.register_on_joinplayer to set the formspec prepend. The custom hotbar texture code is commented-out. Also use a temporary fix for minetest.get_player_information occasionally being 'nil'.
|
||||
minetest.register_on_joinplayer to set the formspec prepend.
|
||||
|
||||
'hand' mod contains:
|
||||
Textures:
|
||||
wieldhand.png
|
||||
init.lua:
|
||||
minetest.register_item to register the hand tool.
|
||||
minetest.register_item to register the hand.
|
||||
|
||||
'media' mod contains:
|
||||
Textures:
|
||||
crack_anylength
|
||||
crack_anylength.png
|
||||
Sounds:
|
||||
player_damage
|
||||
player_damage.ogg
|
||||
init.lua:
|
||||
Required but empty.
|
||||
|
||||
'creative_mode' mod contains:
|
||||
init.lua:
|
||||
minetest.override_item() to override the hand.
|
||||
minetest.register_on_placenode() for placing unlimited nodes without removing from inventory.
|
||||
Redefinition of minetest.handle_node_drops() to prevent dug nodes being added to inventory if already present.
|
||||
Creative inventory and per-player creative mode are not included for simplicity.
|
||||
Players can use chat command '/giveme' to obtain nodes they want to place, and can drop an inventory itemstack to clear space in inventory.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
name = Minipeli
|
||||
author = paramat
|
||||
disallowed_mapgens = v6
|
||||
description = This purpose of this game is to be an example of minimal requirements for a Minetest game, to help content creators create new games.
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
Minipeli mod: creative_mode
|
||||
===========================
|
||||
Derived by paramat from Minetest Game 'creative' mod.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
Originally by Perttu Ahola (celeron55) <celeron55@gmail.com> (MIT)
|
||||
Various Minetest developers and contributors (MIT)
|
|
@ -0,0 +1,51 @@
|
|||
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
|
||||
|
||||
if creative_mode_cache then
|
||||
-- Override the hand for special capabilities
|
||||
local digtime = 42
|
||||
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256}
|
||||
|
||||
minetest.override_item("", {
|
||||
range = 8,
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.5,
|
||||
max_drop_level = 3,
|
||||
groupcaps = {
|
||||
crumbly = caps,
|
||||
cracky = caps,
|
||||
snappy = caps,
|
||||
choppy = caps,
|
||||
oddly_breakable_by_hand = caps,
|
||||
dig_immediate =
|
||||
{times = {[2] = digtime, [3] = 0}, uses = 0, maxlevel = 256},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
-- When placing a node, do not remove from inventory
|
||||
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
|
||||
if placer and placer:is_player() then
|
||||
return true
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
-- When digging a node, do not add to inventory if already present
|
||||
|
||||
local old_handle_node_drops = minetest.handle_node_drops
|
||||
|
||||
function minetest.handle_node_drops(pos, drops, digger)
|
||||
if not digger or not digger:is_player() or not creative_mode_cache then
|
||||
return old_handle_node_drops(pos, drops, digger)
|
||||
end
|
||||
|
||||
local inv = digger:get_inventory()
|
||||
if inv then
|
||||
for _, item in ipairs(drops) do
|
||||
if not inv:contains_item("main", item, true) then
|
||||
inv:add_item("main", item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,25 @@
|
|||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2012-2020 Perttu Ahola (celeron55) <celeron55@gmail.com>
|
||||
Copyright (C) 2012-2020 Various Minetest developers and contributors
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
|
@ -0,0 +1 @@
|
|||
depends = hand
|
|
@ -1,6 +1,5 @@
|
|||
Minipeli mod: gui
|
||||
=================
|
||||
See license.txt for license information.
|
||||
Derived by paramat from Minetest Game 'default' mod.
|
||||
|
||||
Authors of source code
|
||||
|
@ -10,10 +9,4 @@ Various Minetest developers and contributors (LGPL 2.1)
|
|||
|
||||
Authors of media
|
||||
----------------
|
||||
BlockMen (CC BY-SA 3.0):
|
||||
gui_formbg.png
|
||||
gui_hb_bg.png
|
||||
|
||||
Paramat (CC BY-SA 3.0):
|
||||
bubble.png
|
||||
heart.png
|
||||
All textures by paramat (CC BY-SA 3.0)
|
||||
|
|
|
@ -1,20 +1,10 @@
|
|||
-- Formspec prepend
|
||||
-- Set formspec prepended string, used for theming
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local formspec = [[
|
||||
bgcolor[#080808BB;true]
|
||||
listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] ]]
|
||||
local name = player:get_player_name()
|
||||
local info = minetest.get_player_information(name)
|
||||
-- 'info and' is a temporary workaround for an engine bug
|
||||
if info and info.formspec_version > 1 then
|
||||
formspec = formspec .. "background9[5,5;1,1;gui_formbg.png;true;10]"
|
||||
else
|
||||
formspec = formspec .. "background[5,5;1,1;gui_formbg.png;true]"
|
||||
end
|
||||
listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]
|
||||
background[5,5;1,1;gui_formbg.png;true]
|
||||
]]
|
||||
player:set_formspec_prepend(formspec)
|
||||
|
||||
-- Set hotbar textures
|
||||
--player:hud_set_hotbar_image("gui_hotbar.png")
|
||||
--player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
|
||||
end)
|
||||
|
|
|
@ -2,8 +2,8 @@ License of source code
|
|||
----------------------
|
||||
|
||||
GNU Lesser General Public License, version 2.1
|
||||
Copyright (C) 2019 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
Copyright (C) 2019 Various Minetest developers and contributors
|
||||
Copyright (C) 2011-2020 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
Copyright (C) 2011-2020 Various Minetest developers and contributors
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License as published by the Free
|
||||
|
@ -21,8 +21,7 @@ License of media
|
|||
----------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2019 paramat
|
||||
Copyright (C) 2019 BlockMen
|
||||
Copyright (C) 2020 paramat
|
||||
|
||||
You are free to:
|
||||
Share — copy and redistribute the material in any medium or format.
|
||||
|
|
Before Width: | Height: | Size: 971 B After Width: | Height: | Size: 83 B |
Before Width: | Height: | Size: 98 B |
|
@ -1,6 +1,5 @@
|
|||
Minipeli mod: hand
|
||||
==================
|
||||
See license.txt for license information.
|
||||
Derived by paramat from Minetest Game 'default' mod.
|
||||
|
||||
Authors of source code
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
-- The hand tool
|
||||
-- Register the hand tool
|
||||
|
||||
minetest.register_item(":", {
|
||||
type = "none",
|
||||
|
|
Before Width: | Height: | Size: 109 B After Width: | Height: | Size: 109 B |
|
@ -0,0 +1,5 @@
|
|||
Minipeli mod: light
|
||||
===================
|
||||
|
||||
Source code by paramat (MIT).
|
||||
Textures by paramat (CC BY-SA 3.0).
|
|
@ -1,4 +1,4 @@
|
|||
-- Light
|
||||
-- Register light
|
||||
|
||||
minetest.register_node("light:light", {
|
||||
description = "Light",
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2019 paramat
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
||||
|
||||
|
||||
License of media
|
||||
----------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2019 paramat
|
||||
|
||||
You are free to:
|
||||
|
||||
Share — copy and redistribute the material in any medium or format
|
||||
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
||||
|
||||
The licensor cannot revoke these freedoms as long as you follow the license terms.
|
||||
|
||||
Under the following terms:
|
||||
|
||||
Attribution — You must give appropriate credit, provide a link to the license, and
|
||||
indicate if changes were made. You may do so in any reasonable manner, but not in any way
|
||||
that suggests the licensor endorses you or your use.
|
||||
|
||||
ShareAlike — If you remix, transform, or build upon the material, you must distribute
|
||||
your contributions under the same license as the original.
|
||||
|
||||
No additional restrictions — You may not apply legal terms or technological measures that
|
||||
legally restrict others from doing anything the license permits.
|
||||
|
||||
Notices:
|
||||
|
||||
You do not have to comply with the license for elements of the material in the public
|
||||
domain or where your use is permitted by an applicable exception or limitation.
|
||||
No warranties are given. The license may not give you all of the permissions necessary
|
||||
for your intended use. For example, other rights such as publicity, privacy, or moral
|
||||
rights may limit how you use the material.
|
||||
|
||||
For more details:
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
|
@ -1,10 +1,13 @@
|
|||
Minipeli mod: mapgen
|
||||
====================
|
||||
See license.txt for license information.
|
||||
|
||||
Source code by paramat (MIT).
|
||||
|
||||
Authors of media
|
||||
----------------
|
||||
All textures by paramat (CC BY-SA 3.0).
|
||||
|
||||
All sounds from Minetest Game:
|
||||
All sounds from Minetest Game 'default' mod:
|
||||
|
||||
Mito551 (sounds) (CC BY-SA 3.0):
|
||||
dig_cracky.ogg
|
||||
|
|
|
@ -26,7 +26,7 @@ local water_sounds = {
|
|||
}
|
||||
|
||||
|
||||
-- Terrain nodes
|
||||
-- Register terrain nodes
|
||||
|
||||
minetest.register_node("mapgen:stone", {
|
||||
description = "Stone",
|
||||
|
@ -57,7 +57,7 @@ minetest.register_node("mapgen:sand", {
|
|||
})
|
||||
|
||||
|
||||
-- Dungeon nodes
|
||||
-- Register dungeon nodes
|
||||
|
||||
minetest.register_node("mapgen:stone_block", {
|
||||
description = "Stone Block",
|
||||
|
@ -90,7 +90,7 @@ minetest.register_node("mapgen:stone_block_stair", {
|
|||
})
|
||||
|
||||
|
||||
-- Water
|
||||
-- Register water nodes
|
||||
|
||||
minetest.register_node("mapgen:water_source", {
|
||||
description = "Water Source",
|
||||
|
@ -119,6 +119,7 @@ minetest.register_node("mapgen:water_source", {
|
|||
liquid_alternative_source = "mapgen:water_source",
|
||||
liquid_viscosity = 1,
|
||||
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
|
||||
groups = {water = 1},
|
||||
sounds = water_sounds,
|
||||
})
|
||||
|
||||
|
@ -151,12 +152,12 @@ minetest.register_node("mapgen:water_flowing", {
|
|||
liquid_alternative_source = "mapgen:water_source",
|
||||
liquid_viscosity = 1,
|
||||
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
|
||||
groups = {not_in_creative_inventory = 1},
|
||||
groups = {water = 1},
|
||||
sounds = water_sounds,
|
||||
})
|
||||
|
||||
|
||||
-- River water
|
||||
-- Register river water nodes
|
||||
|
||||
-- This is an alternative water node required by mapgens with sloping rivers.
|
||||
-- It has 'liquid_renewable = false' and a short 'liquid_range' to avoid
|
||||
|
@ -191,6 +192,7 @@ minetest.register_node("mapgen:river_water_source", {
|
|||
liquid_renewable = false,
|
||||
liquid_range = 2,
|
||||
post_effect_color = {a = 103, r = 30, g = 76, b = 90},
|
||||
groups = {water = 1},
|
||||
sounds = water_sounds,
|
||||
})
|
||||
|
||||
|
@ -225,23 +227,23 @@ minetest.register_node("mapgen:river_water_flowing", {
|
|||
liquid_renewable = false,
|
||||
liquid_range = 2,
|
||||
post_effect_color = {a = 103, r = 30, g = 76, b = 90},
|
||||
groups = {not_in_creative_inventory = 1},
|
||||
groups = {water = 1},
|
||||
sounds = water_sounds,
|
||||
})
|
||||
|
||||
|
||||
-- Lava
|
||||
-- Register magma nodes
|
||||
|
||||
minetest.register_node("mapgen:lava_source", {
|
||||
description = "Lava Source",
|
||||
minetest.register_node("mapgen:magma_source", {
|
||||
description = "Magma Source",
|
||||
drawtype = "liquid",
|
||||
tiles = {
|
||||
{
|
||||
name = "mapgen_lava.png",
|
||||
name = "mapgen_magma.png",
|
||||
backface_culling = false,
|
||||
},
|
||||
{
|
||||
name = "mapgen_lava.png",
|
||||
name = "mapgen_magma.png",
|
||||
backface_culling = true,
|
||||
},
|
||||
},
|
||||
|
@ -255,25 +257,25 @@ minetest.register_node("mapgen:lava_source", {
|
|||
drop = "",
|
||||
drowning = 1,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "mapgen:lava_flowing",
|
||||
liquid_alternative_source = "mapgen:lava_source",
|
||||
liquid_alternative_flowing = "mapgen:magma_flowing",
|
||||
liquid_alternative_source = "mapgen:magma_source",
|
||||
liquid_viscosity = 7,
|
||||
liquid_renewable = false,
|
||||
damage_per_second = 4 * 2,
|
||||
post_effect_color = {a = 191, r = 255, g = 64, b = 0},
|
||||
})
|
||||
|
||||
minetest.register_node("mapgen:lava_flowing", {
|
||||
description = "Flowing Lava",
|
||||
minetest.register_node("mapgen:magma_flowing", {
|
||||
description = "Flowing Magma",
|
||||
drawtype = "flowingliquid",
|
||||
tiles = {"mapgen_lava.png"},
|
||||
tiles = {"mapgen_magma.png"},
|
||||
special_tiles = {
|
||||
{
|
||||
name = "mapgen_lava.png",
|
||||
name = "mapgen_magma.png",
|
||||
backface_culling = false,
|
||||
},
|
||||
{
|
||||
name = "mapgen_lava.png",
|
||||
name = "mapgen_magma.png",
|
||||
backface_culling = false,
|
||||
},
|
||||
},
|
||||
|
@ -288,8 +290,8 @@ minetest.register_node("mapgen:lava_flowing", {
|
|||
drop = "",
|
||||
drowning = 1,
|
||||
liquidtype = "flowing",
|
||||
liquid_alternative_flowing = "mapgen:lava_flowing",
|
||||
liquid_alternative_source = "mapgen:lava_source",
|
||||
liquid_alternative_flowing = "mapgen:magma_flowing",
|
||||
liquid_alternative_source = "mapgen:magma_source",
|
||||
liquid_viscosity = 7,
|
||||
liquid_renewable = false,
|
||||
damage_per_second = 4 * 2,
|
||||
|
@ -298,16 +300,25 @@ minetest.register_node("mapgen:lava_flowing", {
|
|||
})
|
||||
|
||||
|
||||
-- Aliases for map generators
|
||||
-- Register aliases for map generators.
|
||||
-- Tells engine mapgens which nodes to use for 'base terrain': the terrain
|
||||
-- generated by an engine mapgen before biome nodes are applied.
|
||||
|
||||
minetest.register_alias("mapgen_stone", "mapgen:stone")
|
||||
minetest.register_alias("mapgen_water_source", "mapgen:water_source")
|
||||
minetest.register_alias("mapgen_river_water_source", "mapgen:river_water_source")
|
||||
|
||||
|
||||
-- Biomes
|
||||
-- Register biomes
|
||||
|
||||
-- Grassland
|
||||
-- Grassland biome stack
|
||||
|
||||
-- A 'biome stack' is a vertical stack of biomes all having the same heat and
|
||||
-- humidity points, and therefore all having the same horizontal distribution.
|
||||
-- In minipeli only one biome stack is registered, more will probably be
|
||||
-- desired for a developed game.
|
||||
|
||||
-- Dry land from beach top to world top
|
||||
|
||||
minetest.register_biome({
|
||||
name = "grassland",
|
||||
|
@ -326,30 +337,47 @@ minetest.register_biome({
|
|||
humidity_point = 50,
|
||||
})
|
||||
|
||||
-- The sand of beaches and seabeds
|
||||
|
||||
minetest.register_biome({
|
||||
name = "grassland_shore",
|
||||
name = "grassland_sea",
|
||||
node_top = "mapgen:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "mapgen:sand",
|
||||
depth_filler = 2,
|
||||
node_riverbed = "mapgen:sand",
|
||||
depth_riverbed = 2,
|
||||
node_cave_liquid = "mapgen:water_source",
|
||||
node_dungeon = "mapgen:stone_block",
|
||||
node_dungeon_stair = "mapgen:stone_block_stair",
|
||||
depth_riverbed = 2,
|
||||
vertical_blend = 1,
|
||||
y_max = 3,
|
||||
y_min = -255,
|
||||
y_min = -127,
|
||||
heat_point = 50,
|
||||
humidity_point = 50,
|
||||
})
|
||||
|
||||
-- Shallow underground
|
||||
|
||||
minetest.register_biome({
|
||||
name = "grassland_under",
|
||||
node_cave_liquid = {"mapgen:water_source", "mapgen:lava_source"},
|
||||
node_cave_liquid = "mapgen:water_source",
|
||||
node_dungeon = "mapgen:stone_block",
|
||||
node_dungeon_stair = "mapgen:stone_block_stair",
|
||||
y_max = -256,
|
||||
y_max = -128,
|
||||
y_min = -1023,
|
||||
heat_point = 50,
|
||||
humidity_point = 50,
|
||||
})
|
||||
|
||||
-- Deep underground where magma first appears
|
||||
|
||||
minetest.register_biome({
|
||||
name = "grassland_deep",
|
||||
node_cave_liquid = {"mapgen:water_source", "mapgen:magma_source"},
|
||||
node_dungeon = "mapgen:stone_block",
|
||||
node_dungeon_stair = "mapgen:stone_block_stair",
|
||||
y_max = -1024,
|
||||
y_min = -31000,
|
||||
heat_point = 50,
|
||||
humidity_point = 50,
|
||||
|
|
Before Width: | Height: | Size: 99 B After Width: | Height: | Size: 99 B |
|
@ -1,7 +1,5 @@
|
|||
Minipeli mod: media
|
||||
===================
|
||||
See license.txt for license information.
|
||||
Derived by paramat from Minetest Game 'default' mod.
|
||||
|
||||
Authors of media
|
||||
----------------
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
Minipeli mod: player_api
|
||||
========================
|
||||
See license.txt for license information.
|
||||
Derived by paramat from Minetest Game 'player_api' mod.
|
||||
|
||||
Provides an API to allow multiple mods to set player models and textures.
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
-- Minetest 0.4 mod: player
|
||||
-- See README.txt for licensing and other information.
|
||||
|
||||
player_api = {}
|
||||
|
||||
-- Player animation blending
|
||||
|
@ -96,6 +93,15 @@ end)
|
|||
local player_set_animation = player_api.set_animation
|
||||
local player_attached = player_api.player_attached
|
||||
|
||||
-- Prevent knockback for attached players
|
||||
local old_calculate_knockback = minetest.calculate_knockback
|
||||
function minetest.calculate_knockback(player, ...)
|
||||
if player_attached[player:get_player_name()] then
|
||||
return 0
|
||||
end
|
||||
return old_calculate_knockback(player, ...)
|
||||
end
|
||||
|
||||
-- Check each player and apply animations
|
||||
minetest.register_globalstep(function(dtime)
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
|
@ -104,14 +110,8 @@ minetest.register_globalstep(function(dtime)
|
|||
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
|
||||
|
@ -120,18 +120,19 @@ minetest.register_globalstep(function(dtime)
|
|||
-- Apply animations based on what the player is doing
|
||||
if player:get_hp() == 0 then
|
||||
player_set_animation(player, "lay")
|
||||
elseif walking then
|
||||
-- Determine if the player is walking
|
||||
elseif controls.up or controls.down or controls.left or controls.right then
|
||||
if player_sneak[name] ~= controls.sneak then
|
||||
player_anim[name] = nil
|
||||
player_sneak[name] = controls.sneak
|
||||
end
|
||||
if controls.LMB then
|
||||
if controls.LMB or controls.RMB 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")
|
||||
elseif controls.LMB or controls.RMB then
|
||||
player_set_animation(player, "mine", animation_speed_mod)
|
||||
else
|
||||
player_set_animation(player, "stand", animation_speed_mod)
|
||||
end
|
||||
|
|
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 163 B After Width: | Height: | Size: 160 B |
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 125 B |
After Width: | Height: | Size: 276 B |