First commit
9
README.txt
Normal file
@ -0,0 +1,9 @@
|
||||
driftgame 0.1.0 by paramat.
|
||||
A game for Minetest Engine 5.2.0 and later.
|
||||
See each mod for mod-specific credits and licenses.
|
||||
|
||||
Authors of media
|
||||
----------------
|
||||
paramat (CC BY-SA 3.0):
|
||||
header.png
|
||||
icon.png
|
3
game.conf
Normal file
@ -0,0 +1,3 @@
|
||||
name = Driftgame
|
||||
author = paramat
|
||||
disallowed_mapgens = v5, v6, v7, valleys, carpathian, fractal, singlenode
|
38
license.txt
Normal file
@ -0,0 +1,38 @@
|
||||
License of media (textures, schematics)
|
||||
---------------------------------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2020 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/
|
BIN
menu/header.png
Normal file
After Width: | Height: | Size: 131 B |
BIN
menu/icon.png
Normal file
After Width: | Height: | Size: 136 B |
0
minetest.conf
Normal file
5
mods/driftcar/README.txt
Normal file
@ -0,0 +1,5 @@
|
||||
driftgame mod: driftcar
|
||||
=======================
|
||||
|
||||
Source code by paramat (MIT).
|
||||
Media by paramat (CC BY-SA 3.0).
|
470
mods/driftcar/init.lua
Normal file
@ -0,0 +1,470 @@
|
||||
-- Parameters
|
||||
|
||||
local MAXGRIP = 7 -- Maximum linear and lateral acceleration, in nodes/s^2
|
||||
-- Halved on 'crumbly' nodes.
|
||||
local SZTORQ = 22 -- Car speed where motor torque drops to zero, in nodes/s
|
||||
local DRAG = 0.04 -- Air drag
|
||||
local ROLRES = 0.6 -- Rolling resistence TODO increase in crumbly
|
||||
local GRAV = 9.81 -- Acceleration of gravity, in nodes/s^2
|
||||
-- Turn parameters, in radians/s or radians/s^2
|
||||
local TINIT = 0.36 -- Initial turn speed on first control input
|
||||
local TACC = 0.12 -- Turn acceleration on control input
|
||||
local TMAX = 1.6 -- Maximum turn speed (Smart fortwo turning circle 7 nodes)
|
||||
local TDEC = 0.24 -- Turn deceleration on no control input
|
||||
|
||||
-- End of parameters
|
||||
|
||||
|
||||
-- Constants
|
||||
|
||||
local sztorqh = SZTORQ / 2
|
||||
|
||||
|
||||
-- Functions
|
||||
|
||||
local function get_sign(n)
|
||||
if n == 0 then
|
||||
return 0
|
||||
else
|
||||
return n / math.abs(n)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function get_vecmag(vec)
|
||||
return math.sqrt(vec.x ^ 2 + vec.z ^ 2)
|
||||
end
|
||||
|
||||
|
||||
local function get_theta(vec) -- returns 0 to PI * 2
|
||||
if vec.z == 0 then
|
||||
return 0
|
||||
end
|
||||
if vec.z < 0 then
|
||||
return math.atan(-vec.x / vec.z) + math.pi
|
||||
end
|
||||
if vec.x > 0 then
|
||||
return math.atan(-vec.x / vec.z) + math.pi * 2
|
||||
end
|
||||
return math.atan(-vec.x / vec.z)
|
||||
end
|
||||
|
||||
|
||||
local function get_veccomp(vecmag, theta, y)
|
||||
local x = -math.sin(theta) * vecmag
|
||||
local z = math.cos(theta) * vecmag
|
||||
return {x = x, y = y, z = z}
|
||||
end
|
||||
|
||||
|
||||
local function wrap_yaw(yaw) -- wrap to 0 to PI * 2
|
||||
local fmod = math.fmod(yaw, math.pi * 2)
|
||||
if fmod < 0 then
|
||||
return fmod + math.pi * 2
|
||||
end
|
||||
return fmod
|
||||
end
|
||||
|
||||
|
||||
local function angbet(theta1, theta2) -- theta1 relative to theta2, -PI to PI
|
||||
local ang = theta1 - theta2
|
||||
if ang < -math.pi then
|
||||
return ang + math.pi * 2
|
||||
end
|
||||
if ang > math.pi then
|
||||
return ang - math.pi * 2
|
||||
end
|
||||
return ang
|
||||
end
|
||||
|
||||
|
||||
local function add_smoke_particle(pos, player_name)
|
||||
minetest.add_particle({
|
||||
pos = pos,
|
||||
velocity = {x = 0, y = 0, z = 0},
|
||||
acceleration = {x = 0, y = 0, z = 0},
|
||||
expirationtime = 0.25,
|
||||
size = 2.8,
|
||||
collisiondetection = false,
|
||||
collision_removal = false,
|
||||
vertical = false,
|
||||
texture = "driftcar_smoke.png",
|
||||
playername = player_name,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
-- Entity
|
||||
|
||||
local car = {
|
||||
initial_properties = {
|
||||
physical = true,
|
||||
collide_with_objects = false,
|
||||
collisionbox = {-0.53, -0.75, -0.53, 0.53, 0.75, 0.53},
|
||||
visual = "wielditem",
|
||||
visual_size = {x = 1.667, y = 1.667}, -- Scale-up of nodebox is these * 1.5
|
||||
textures = {"driftcar:blue_nodebox"},
|
||||
stepheight = 0.6,
|
||||
},
|
||||
|
||||
-- Custom fields
|
||||
driver = nil,
|
||||
removed = false,
|
||||
rot = 0,
|
||||
}
|
||||
|
||||
minetest.register_entity("driftcar:driftcar", car)
|
||||
|
||||
|
||||
-- Entity functions
|
||||
|
||||
function car.on_rightclick(self, clicker)
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
local name = clicker:get_player_name()
|
||||
if self.driver and name == self.driver then
|
||||
-- Detach
|
||||
self.driver = nil
|
||||
clicker:set_detach()
|
||||
player_api.player_attached[name] = false
|
||||
player_api.set_animation(clicker, "stand" , 30)
|
||||
local pos = clicker:getpos()
|
||||
minetest.after(0.1, function()
|
||||
clicker:setpos(pos)
|
||||
end)
|
||||
elseif not self.driver then
|
||||
-- Attach
|
||||
local attach = clicker:get_attach()
|
||||
if attach and attach:get_luaentity() then
|
||||
local luaentity = attach:get_luaentity()
|
||||
if luaentity.driver then
|
||||
luaentity.driver = nil
|
||||
end
|
||||
clicker:set_detach()
|
||||
end
|
||||
self.driver = name
|
||||
clicker:set_attach(self.object, "",
|
||||
{x = 0, y = -3, z = 0}, {x = 0, y = 0, z = 0})
|
||||
player_api.player_attached[name] = true
|
||||
minetest.after(0.2, function()
|
||||
player_api.set_animation(clicker, "sit" , 30)
|
||||
end)
|
||||
clicker:set_look_horizontal(self.object:getyaw())
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function car.on_activate(self, staticdata, dtime_s)
|
||||
self.object:set_armor_groups({immortal = 1})
|
||||
end
|
||||
|
||||
|
||||
function car.on_punch(self, puncher)
|
||||
if not puncher or not puncher:is_player() or self.removed then
|
||||
return
|
||||
end
|
||||
|
||||
local name = puncher:get_player_name()
|
||||
if self.driver and name == self.driver then
|
||||
-- Detach
|
||||
self.driver = nil
|
||||
puncher:set_detach()
|
||||
player_api.player_attached[name] = false
|
||||
end
|
||||
if not self.driver then
|
||||
-- Move to inventory
|
||||
self.removed = true
|
||||
local inv = puncher:get_inventory()
|
||||
local leftover = inv:add_item("main", "driftcar:driftcar")
|
||||
if not leftover:is_empty() then
|
||||
minetest.add_item(self.object:getpos(), leftover)
|
||||
end
|
||||
minetest.after(0.1, function()
|
||||
self.object:remove()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function car.on_detach_child(self, child)
|
||||
self.driver = nil
|
||||
end
|
||||
|
||||
|
||||
local sound_cyc = 0
|
||||
|
||||
function car.on_step(self, dtime)
|
||||
local vel = self.object:getvelocity()
|
||||
local velmag = get_vecmag(vel)
|
||||
-- Early return for near-stationary vehicle with no driver
|
||||
if not self.driver and velmag < 0.01 and vel.y == 0 then
|
||||
self.object:setpos(self.object:getpos())
|
||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
||||
return
|
||||
end
|
||||
|
||||
-- Angle of yaw relative to velocity, -PI to PI
|
||||
local yawrtvel = angbet(
|
||||
wrap_yaw(self.object:getyaw()),
|
||||
get_theta(vel)
|
||||
)
|
||||
-- Velocity component linear to car
|
||||
local linvel = math.cos(yawrtvel) * velmag
|
||||
local abslinvel = math.abs(linvel)
|
||||
--print(abslinvel)
|
||||
-- Touch ground bool
|
||||
local under_pos = self.object:getpos()
|
||||
under_pos.y = under_pos.y - 0.8
|
||||
local node_under = minetest.get_node(under_pos)
|
||||
local nodedef_under = minetest.registered_nodes[node_under.name]
|
||||
local touch = nodedef_under.walkable
|
||||
-- Modify grip according to 'crumbly' group
|
||||
local grip = MAXGRIP
|
||||
if nodedef_under.groups.crumbly then
|
||||
grip = MAXGRIP / 2
|
||||
end
|
||||
|
||||
-- Torque acceleration applied linear to car
|
||||
local taccmag = 0
|
||||
|
||||
-- Controls
|
||||
if self.driver and touch then
|
||||
local driver_objref = minetest.get_player_by_name(self.driver)
|
||||
if driver_objref then
|
||||
local ctrl = driver_objref:get_player_control()
|
||||
if ctrl.up or ctrl.down then
|
||||
-- Torque multiplier applied above SZTORQ / 2 to replicate reduction of
|
||||
-- motor torque with rotation speed.
|
||||
local torm = 1
|
||||
if abslinvel > sztorqh then
|
||||
torm = (SZTORQ - abslinvel) / sztorqh
|
||||
end
|
||||
|
||||
if ctrl.up then
|
||||
taccmag = grip * torm
|
||||
elseif ctrl.down then
|
||||
taccmag = -grip * torm
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Early return for near-stationary vehicle with driver
|
||||
if taccmag == 0 and velmag < 0.01 and vel.y == 0 then
|
||||
self.object:setpos(self.object:getpos())
|
||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
||||
return
|
||||
end
|
||||
|
||||
-- Allows fast reduction of turn when no turn control
|
||||
local noturnctrl = true
|
||||
|
||||
if self.driver and touch then
|
||||
local driver_objref = minetest.get_player_by_name(self.driver)
|
||||
if driver_objref then
|
||||
local ctrl = driver_objref:get_player_control()
|
||||
if ctrl.left then
|
||||
if self.rot == 0 then
|
||||
self.rot = TINIT
|
||||
else
|
||||
self.rot = self.rot + TACC
|
||||
end
|
||||
noturnctrl = false
|
||||
elseif ctrl.right then
|
||||
if self.rot == 0 then
|
||||
self.rot = -TINIT
|
||||
else
|
||||
self.rot = self.rot - TACC
|
||||
end
|
||||
noturnctrl = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- If no turn control adjust turn towards zero
|
||||
local sr = get_sign(self.rot)
|
||||
if noturnctrl and touch then
|
||||
self.rot = self.rot - TDEC * sr
|
||||
if sr ~= get_sign(self.rot) then
|
||||
self.rot = 0
|
||||
end
|
||||
end
|
||||
-- Limit turn
|
||||
if math.abs(self.rot) > TMAX then
|
||||
self.rot = TMAX * get_sign(self.rot)
|
||||
end
|
||||
|
||||
-- Acceleration caused by 4 Forces
|
||||
|
||||
-- 1. Drag is proportional to velocity, assuming laminar flow
|
||||
local dragacc = vector.multiply(vel, -DRAG)
|
||||
|
||||
-- 2. Rolling resistence is constant
|
||||
local rraccmag = 0
|
||||
if touch then
|
||||
if linvel > 0 then
|
||||
rraccmag = -ROLRES
|
||||
elseif linvel < 0 then
|
||||
rraccmag = ROLRES
|
||||
end
|
||||
end
|
||||
--local rracc = get_veccomp(rraccmag, self.object:getyaw(), 0)
|
||||
|
||||
-- 3. Wheel torque acceleration
|
||||
--local tacc = get_veccomp(taccmag, self.object:getyaw(), 0)
|
||||
|
||||
-- Combine taccmag and rraccmag since same direction
|
||||
local trracc = get_veccomp(taccmag + rraccmag, self.object:getyaw(), 0)
|
||||
|
||||
-- 4. Tire lateral friction
|
||||
-- Velocity component lateral to car
|
||||
local tlfacc = {x = 0, y = 0, z = 0}
|
||||
if touch then
|
||||
local latvel = math.sin(yawrtvel) * velmag
|
||||
local tlfaccmag = math.min(math.max(latvel * 32, -grip), grip)
|
||||
tlfacc = get_veccomp(tlfaccmag, self.object:getyaw() + math.pi / 2, 0)
|
||||
|
||||
-- Tire smoke
|
||||
if self.driver and math.random() < -0.05 + math.abs(latvel) / 30 then
|
||||
local opos = self.object:getpos()
|
||||
opos.y = opos.y - 0.5
|
||||
local yaw = self.object:getyaw()
|
||||
local yaw1 = yaw + math.pi * 0.187
|
||||
local yaw2 = yaw + math.pi * 0.813
|
||||
|
||||
local srcomp1x = -1.127 * math.sin(yaw1)
|
||||
local srcomp1z = 1.127 * math.cos(yaw1)
|
||||
local srcomp2x = -1.127 * math.sin(yaw2)
|
||||
local srcomp2z = 1.127 * math.cos(yaw2)
|
||||
|
||||
add_smoke_particle({
|
||||
x = opos.x + srcomp1x,
|
||||
y = opos.y,
|
||||
z = opos.z + srcomp1z
|
||||
}, self.driver)
|
||||
add_smoke_particle({
|
||||
x = opos.x - srcomp1x,
|
||||
y = opos.y,
|
||||
z = opos.z - srcomp1z
|
||||
}, self.driver)
|
||||
add_smoke_particle({
|
||||
x = opos.x + srcomp2x,
|
||||
y = opos.y,
|
||||
z = opos.z + srcomp2z
|
||||
}, self.driver)
|
||||
add_smoke_particle({
|
||||
x = opos.x - srcomp2x,
|
||||
y = opos.y,
|
||||
z = opos.z - srcomp2z
|
||||
}, self.driver)
|
||||
end
|
||||
end
|
||||
|
||||
-- Add up accelerations
|
||||
local new_acc = {
|
||||
x = trracc.x + dragacc.x + tlfacc.x,
|
||||
y = trracc.y + dragacc.y + tlfacc.y - GRAV,
|
||||
z = trracc.z + dragacc.z + tlfacc.z,
|
||||
}
|
||||
|
||||
-- Turn multiplier
|
||||
local turm = 1
|
||||
-- Reduce turn below 4nps
|
||||
if velmag < 4 then
|
||||
turm = velmag / 4
|
||||
end
|
||||
-- Limit dtime to avoid too much turn
|
||||
dtime = math.min(dtime, 0.2)
|
||||
|
||||
-- Set position, velocity, acceleration and yaw
|
||||
self.object:setpos(self.object:getpos())
|
||||
self.object:setvelocity(self.object:getvelocity())
|
||||
self.object:setacceleration(new_acc)
|
||||
self.object:setyaw(wrap_yaw(self.object:getyaw() + self.rot * dtime * turm))
|
||||
end
|
||||
|
||||
|
||||
-- Craftitem
|
||||
|
||||
minetest.register_craftitem("driftcar:driftcar", {
|
||||
description = "Drift Car",
|
||||
inventory_image = "driftcar_new_front.png",
|
||||
wield_image = "driftcar_new_front.png",
|
||||
wield_scale = {x = 2, y = 2, z = 2},
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local under = pointed_thing.under
|
||||
local node = minetest.get_node(under)
|
||||
local udef = minetest.registered_nodes[node.name]
|
||||
|
||||
-- Run any on_rightclick function of pointed node instead
|
||||
if udef and udef.on_rightclick and
|
||||
not (placer and placer:is_player() and
|
||||
placer:get_player_control().sneak) then
|
||||
return udef.on_rightclick(under, node, placer, itemstack,
|
||||
pointed_thing) or itemstack
|
||||
end
|
||||
|
||||
if pointed_thing.type ~= "node" then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
pointed_thing.under.y = pointed_thing.under.y + 1.25
|
||||
local car = minetest.add_entity(pointed_thing.under,
|
||||
"driftcar:driftcar")
|
||||
if car then
|
||||
if placer then
|
||||
car:setyaw(placer:get_look_horizontal())
|
||||
end
|
||||
local player_name = placer and placer:get_player_name() or ""
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- Give to new player
|
||||
|
||||
minetest.register_on_newplayer(function(player)
|
||||
local inv = player:get_inventory()
|
||||
inv:add_item("main", "driftcar:driftcar")
|
||||
end)
|
||||
|
||||
|
||||
-- Nodeboxes
|
||||
|
||||
-- Smart Fortwo dim: L 2.695 W 1.663 H 1.555
|
||||
-- Size in pixels L 21.56 W 13.304 H 12.44
|
||||
-- Alter to L 20 W 12 H 12
|
||||
-- 20 = full cube of unscaled nodebox, 1 pixel = 0.05
|
||||
-- Required nodebox scale up 2.5, visual_size = 2.5 / 1.5 = 1.667
|
||||
|
||||
minetest.register_node("driftcar:blue_nodebox", {
|
||||
description = "Drift Car Blue Nodebox",
|
||||
tiles = { -- Top, base, right, left, front, back
|
||||
"driftcar_new_top.png",
|
||||
"driftcar_new_base.png",
|
||||
"driftcar_new_right.png",
|
||||
"driftcar_new_left.png",
|
||||
"driftcar_new_front.png",
|
||||
"driftcar_new_back.png",
|
||||
},
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-- wmin, hmin, lmin, wmax, hmax, lmax
|
||||
{-0.3, 0.05, -0.5, 0.3, 0.3, 0.4}, -- Upper
|
||||
{-0.3, -0.25, -0.5, 0.3, 0.05, 0.5}, -- Lower
|
||||
{-0.3, -0.3, -0.5, -0.2, -0.05, -0.25}, -- Wheels
|
||||
{ 0.2, -0.3, -0.5, 0.3, -0.05, -0.25},
|
||||
{-0.3, -0.3, 0.25, -0.2, -0.05, 0.5},
|
||||
{ 0.2, -0.3, 0.25, 0.3, -0.05, 0.5},
|
||||
},
|
||||
},
|
||||
})
|
61
mods/driftcar/license.txt
Normal file
@ -0,0 +1,61 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2018-2020 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) 2018-2020 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/
|
BIN
mods/driftcar/textures/driftcar_new_back.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
mods/driftcar/textures/driftcar_new_base.png
Normal file
After Width: | Height: | Size: 110 B |
BIN
mods/driftcar/textures/driftcar_new_front.png
Normal file
After Width: | Height: | Size: 148 B |
BIN
mods/driftcar/textures/driftcar_new_left.png
Normal file
After Width: | Height: | Size: 168 B |
BIN
mods/driftcar/textures/driftcar_new_right.png
Normal file
After Width: | Height: | Size: 160 B |
BIN
mods/driftcar/textures/driftcar_new_top.png
Normal file
After Width: | Height: | Size: 95 B |
BIN
mods/driftcar/textures/driftcar_smoke.png
Normal file
After Width: | Height: | Size: 96 B |
18
mods/gui/README.txt
Normal file
@ -0,0 +1,18 @@
|
||||
Minipeli mod: gui
|
||||
=================
|
||||
Derived by paramat from Minetest Game 'default' mod.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
Originally by celeron55, Perttu Ahola <celeron55@gmail.com> (LGPL 2.1)
|
||||
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
|
21
mods/gui/init.lua
Normal file
@ -0,0 +1,21 @@
|
||||
-- Set formspec prepend and hotbar textures
|
||||
|
||||
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)
|
||||
if 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
|
||||
-- Set the string to be added to every mainmenu formspec, used for theming
|
||||
player:set_formspec_prepend(formspec)
|
||||
|
||||
-- Set hotbar textures.
|
||||
-- To use, uncomment these 2 lines and add textures to the textures folder.
|
||||
--player:hud_set_hotbar_image("gui_hotbar.png")
|
||||
--player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
|
||||
end)
|
57
mods/gui/license.txt
Normal file
@ -0,0 +1,57 @@
|
||||
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
|
||||
|
||||
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
|
||||
Software Foundation; either version 2.1 of the License, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details:
|
||||
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
|
||||
License of media
|
||||
----------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2019 paramat
|
||||
Copyright (C) 2019 BlockMen
|
||||
|
||||
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/
|
BIN
mods/gui/textures/bubble.png
Normal file
After Width: | Height: | Size: 116 B |
BIN
mods/gui/textures/gui_formbg.png
Normal file
After Width: | Height: | Size: 971 B |
BIN
mods/gui/textures/gui_hb_bg.png
Normal file
After Width: | Height: | Size: 98 B |
BIN
mods/gui/textures/heart.png
Normal file
After Width: | Height: | Size: 112 B |
12
mods/hand/README.txt
Normal file
@ -0,0 +1,12 @@
|
||||
Minipeli mod: hand
|
||||
==================
|
||||
Derived by paramat from Minetest Game 'default' mod.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
Originally by celeron55, Perttu Ahola <celeron55@gmail.com> (LGPL 2.1)
|
||||
Various Minetest developers and contributors (LGPL 2.1)
|
||||
|
||||
Authors of media
|
||||
----------------
|
||||
All textures by paramat (CC BY-SA 3.0).
|
28
mods/hand/init.lua
Normal file
@ -0,0 +1,28 @@
|
||||
-- Register the hand tool
|
||||
|
||||
minetest.register_item(":", {
|
||||
type = "none",
|
||||
wield_image = "wieldhand.png",
|
||||
wield_scale = {x = 1, y = 1, z = 4},
|
||||
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,
|
||||
},
|
||||
},
|
||||
damage_groups = {fleshy = 1},
|
||||
}
|
||||
})
|
56
mods/hand/license.txt
Normal file
@ -0,0 +1,56 @@
|
||||
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
|
||||
|
||||
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
|
||||
Software Foundation; either version 2.1 of the License, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details:
|
||||
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
|
||||
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/
|
BIN
mods/hand/textures/wieldhand.png
Normal file
After Width: | Height: | Size: 109 B |
5
mods/light/README.txt
Normal file
@ -0,0 +1,5 @@
|
||||
Minipeli mod: light
|
||||
===================
|
||||
|
||||
Source code by paramat (MIT).
|
||||
Textures by paramat (CC BY-SA 3.0).
|
17
mods/light/init.lua
Normal file
@ -0,0 +1,17 @@
|
||||
-- Register light
|
||||
|
||||
minetest.register_node("light:light", {
|
||||
description = "Light",
|
||||
tiles = {"light_light.png"},
|
||||
paramtype = "light",
|
||||
light_source = 14,
|
||||
is_ground_content = false,
|
||||
groups = {dig_immediate = 2},
|
||||
})
|
||||
|
||||
-- Give to new player
|
||||
|
||||
minetest.register_on_newplayer(function(player)
|
||||
local inv = player:get_inventory()
|
||||
inv:add_item("main", "light:light 64")
|
||||
end)
|
61
mods/light/license.txt
Normal file
@ -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/
|
BIN
mods/light/textures/light_light.png
Normal file
After Width: | Height: | Size: 96 B |
8
mods/mapgen/README.txt
Normal file
@ -0,0 +1,8 @@
|
||||
driftgame mod: mapgen
|
||||
=====================
|
||||
|
||||
Source code by paramat (MIT).
|
||||
|
||||
Authors of media
|
||||
----------------
|
||||
All textures by paramat (CC BY-SA 3.0).
|
265
mods/mapgen/init.lua
Normal file
@ -0,0 +1,265 @@
|
||||
-- Register terrain nodes
|
||||
|
||||
minetest.register_node("mapgen:stone", {
|
||||
description = "Stone",
|
||||
tiles = {"mapgen_stone.png"},
|
||||
groups = {cracky = 3},
|
||||
})
|
||||
|
||||
minetest.register_node("mapgen:grass", {
|
||||
description = "Grass",
|
||||
tiles = {"mapgen_grass.png"},
|
||||
groups = {crumbly = 3},
|
||||
})
|
||||
|
||||
minetest.register_node("mapgen:dirt", {
|
||||
description = "Dirt",
|
||||
tiles = {"mapgen_dirt.png"},
|
||||
groups = {crumbly = 3},
|
||||
})
|
||||
|
||||
minetest.register_node("mapgen:sand", {
|
||||
description = "Sand",
|
||||
tiles = {"mapgen_sand.png"},
|
||||
groups = {crumbly = 3},
|
||||
})
|
||||
|
||||
|
||||
-- Register dungeon nodes
|
||||
|
||||
minetest.register_node("mapgen:stone_block", {
|
||||
description = "Stone Block",
|
||||
tiles = {"mapgen_stone_block.png"},
|
||||
is_ground_content = false,
|
||||
groups = {dig_immediate = 2},
|
||||
})
|
||||
|
||||
minetest.register_node("mapgen:stone_block_stair", {
|
||||
description = "Stone Block Stair",
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"mapgen_stone_block_divided.png",
|
||||
"mapgen_stone_block.png",
|
||||
"mapgen_stone_block_divided.png"
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
groups = {dig_immediate = 2},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
|
||||
{-0.5, 0.0, 0.0, 0.5, 0.5, 0.5},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
-- Register water nodes
|
||||
|
||||
minetest.register_node("mapgen:water_source", {
|
||||
description = "Water Source",
|
||||
drawtype = "liquid",
|
||||
tiles = {
|
||||
{
|
||||
name = "mapgen_water.png",
|
||||
backface_culling = false,
|
||||
},
|
||||
{
|
||||
name = "mapgen_water.png",
|
||||
backface_culling = true,
|
||||
},
|
||||
},
|
||||
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 = "mapgen:water_flowing",
|
||||
liquid_alternative_source = "mapgen:water_source",
|
||||
liquid_viscosity = 1,
|
||||
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
|
||||
})
|
||||
|
||||
minetest.register_node("mapgen:water_flowing", {
|
||||
description = "Flowing Water",
|
||||
drawtype = "flowingliquid",
|
||||
tiles = {"mapgen_water.png"},
|
||||
special_tiles = {
|
||||
{
|
||||
name = "mapgen_water.png",
|
||||
backface_culling = false,
|
||||
},
|
||||
{
|
||||
name = "mapgen_water.png",
|
||||
backface_culling = false,
|
||||
},
|
||||
},
|
||||
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 = "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},
|
||||
})
|
||||
|
||||
|
||||
-- Register magma nodes
|
||||
|
||||
minetest.register_node("mapgen:magma_source", {
|
||||
description = "Magma Source",
|
||||
drawtype = "liquid",
|
||||
tiles = {
|
||||
{
|
||||
name = "mapgen_magma.png",
|
||||
backface_culling = false,
|
||||
},
|
||||
{
|
||||
name = "mapgen_magma.png",
|
||||
backface_culling = true,
|
||||
},
|
||||
},
|
||||
paramtype = "light",
|
||||
light_source = 13,
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = false,
|
||||
drop = "",
|
||||
drowning = 1,
|
||||
liquidtype = "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:magma_flowing", {
|
||||
description = "Flowing Magma",
|
||||
drawtype = "flowingliquid",
|
||||
tiles = {"mapgen_magma.png"},
|
||||
special_tiles = {
|
||||
{
|
||||
name = "mapgen_magma.png",
|
||||
backface_culling = false,
|
||||
},
|
||||
{
|
||||
name = "mapgen_magma.png",
|
||||
backface_culling = false,
|
||||
},
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "flowingliquid",
|
||||
light_source = 13,
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = false,
|
||||
drop = "",
|
||||
drowning = 1,
|
||||
liquidtype = "flowing",
|
||||
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},
|
||||
groups = {not_in_creative_inventory = 1},
|
||||
})
|
||||
|
||||
|
||||
-- Register aliases for map generators
|
||||
|
||||
minetest.register_alias("mapgen_stone", "mapgen:stone")
|
||||
minetest.register_alias("mapgen_water_source", "mapgen:water_source")
|
||||
minetest.register_alias("mapgen_river_water_source", "mapgen:water_source")
|
||||
|
||||
|
||||
-- Register biomes
|
||||
|
||||
-- Grassland biome stack
|
||||
|
||||
-- Dry land from beach top to world top
|
||||
|
||||
minetest.register_biome({
|
||||
name = "grassland",
|
||||
node_top = "mapgen:grass",
|
||||
depth_top = 1,
|
||||
node_filler = "mapgen:dirt",
|
||||
depth_filler = 1,
|
||||
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",
|
||||
y_max = 31000,
|
||||
y_min = 4,
|
||||
heat_point = 50,
|
||||
humidity_point = 50,
|
||||
})
|
||||
|
||||
-- The sand of beaches and seabeds
|
||||
|
||||
minetest.register_biome({
|
||||
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",
|
||||
vertical_blend = 1,
|
||||
y_max = 3,
|
||||
y_min = -127,
|
||||
heat_point = 50,
|
||||
humidity_point = 50,
|
||||
})
|
||||
|
||||
-- Shallow underground
|
||||
|
||||
minetest.register_biome({
|
||||
name = "grassland_under",
|
||||
node_cave_liquid = "mapgen:water_source",
|
||||
node_dungeon = "mapgen:stone_block",
|
||||
node_dungeon_stair = "mapgen:stone_block_stair",
|
||||
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,
|
||||
})
|
61
mods/mapgen/license.txt
Normal file
@ -0,0 +1,61 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2020 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) 2020 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/
|
BIN
mods/mapgen/textures/mapgen_dirt.png
Normal file
After Width: | Height: | Size: 98 B |
BIN
mods/mapgen/textures/mapgen_grass.png
Normal file
After Width: | Height: | Size: 98 B |
BIN
mods/mapgen/textures/mapgen_magma.png
Normal file
After Width: | Height: | Size: 99 B |
BIN
mods/mapgen/textures/mapgen_river_water.png
Normal file
After Width: | Height: | Size: 99 B |
BIN
mods/mapgen/textures/mapgen_sand.png
Normal file
After Width: | Height: | Size: 99 B |
BIN
mods/mapgen/textures/mapgen_stone.png
Normal file
After Width: | Height: | Size: 83 B |
BIN
mods/mapgen/textures/mapgen_stone_block.png
Normal file
After Width: | Height: | Size: 96 B |
BIN
mods/mapgen/textures/mapgen_stone_block_divided.png
Normal file
After Width: | Height: | Size: 97 B |
BIN
mods/mapgen/textures/mapgen_water.png
Normal file
After Width: | Height: | Size: 99 B |
10
mods/media/README.txt
Normal file
@ -0,0 +1,10 @@
|
||||
Minipeli mod: media
|
||||
===================
|
||||
|
||||
Authors of media
|
||||
----------------
|
||||
All textures by paramat (CC BY-SA 3.0).
|
||||
|
||||
sonictechtonic (CC BY 3.0):
|
||||
https://www.freesound.org/people/sonictechtonic/sounds/241872/
|
||||
player_damage.ogg
|
1
mods/media/init.lua
Normal file
@ -0,0 +1 @@
|
||||
-- Necessary empty file
|
67
mods/media/license.txt
Normal file
@ -0,0 +1,67 @@
|
||||
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/
|
||||
|
||||
-----------------------
|
||||
|
||||
Attribution 3.0 Unported (CC BY 3.0)
|
||||
Copyright (C) 2014 sonictechtonic
|
||||
|
||||
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.
|
||||
|
||||
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/3.0/
|
BIN
mods/media/sounds/player_damage.ogg
Normal file
BIN
mods/media/textures/crack_anylength.png
Normal file
After Width: | Height: | Size: 117 B |
27
mods/player_api/README.txt
Normal file
@ -0,0 +1,27 @@
|
||||
Minipeli mod: player_api
|
||||
========================
|
||||
Derived by paramat from Minetest Game 'player_api' mod.
|
||||
|
||||
Provides an API to allow multiple mods to set player models and textures.
|
||||
Also sets the default model, texture, and player flags.
|
||||
This mod is only for content related to the Player API and the player object.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
Originally by celeron55, Perttu Ahola <celeron55@gmail.com> (LGPLv2.1+)
|
||||
Various Minetest developers and contributors (LGPLv2.1+)
|
||||
|
||||
Authors of media (textures, models and sounds)
|
||||
----------------------------------------------
|
||||
stujones11 (CC BY-SA 3.0):
|
||||
character.b3d
|
||||
character.blend -- Both derived from a model by MirceaKitsune (CC BY-SA 3.0)
|
||||
|
||||
An0n3m0us (CC BY-SA 3.0):
|
||||
character.b3d
|
||||
character.blend -- Player animation improvement
|
||||
|
||||
paramat (CC BY-SA 3.0):
|
||||
character.png
|
||||
player.png
|
||||
player_back.png
|
144
mods/player_api/api.lua
Normal file
@ -0,0 +1,144 @@
|
||||
-- Minetest 0.4 mod: player
|
||||
-- See README.txt for licensing and other information.
|
||||
|
||||
player_api = {}
|
||||
|
||||
-- Player animation blending
|
||||
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0
|
||||
local animation_blend = 0
|
||||
|
||||
player_api.registered_models = { }
|
||||
|
||||
-- Local for speed.
|
||||
local models = player_api.registered_models
|
||||
|
||||
function player_api.register_model(name, def)
|
||||
models[name] = def
|
||||
end
|
||||
|
||||
-- Player stats and animations
|
||||
local player_model = {}
|
||||
local player_textures = {}
|
||||
local player_anim = {}
|
||||
local player_sneak = {}
|
||||
player_api.player_attached = {}
|
||||
|
||||
function player_api.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 player_api.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},
|
||||
collisionbox = model.collisionbox or {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
|
||||
stepheight = model.stepheight or 0.6,
|
||||
eye_height = model.eye_height or 1.47,
|
||||
})
|
||||
player_api.set_animation(player, "stand")
|
||||
else
|
||||
player:set_properties({
|
||||
textures = {"player.png", "player_back.png"},
|
||||
visual = "upright_sprite",
|
||||
visual_size = {x = 1, y = 2},
|
||||
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.75, 0.3},
|
||||
stepheight = 0.6,
|
||||
eye_height = 1.625,
|
||||
})
|
||||
end
|
||||
player_model[name] = model_name
|
||||
end
|
||||
|
||||
function player_api.set_textures(player, textures)
|
||||
local name = player:get_player_name()
|
||||
local model = models[player_model[name]]
|
||||
local model_textures = model and model.textures or nil
|
||||
player_textures[name] = textures or model_textures
|
||||
player:set_properties({textures = textures or model_textures,})
|
||||
end
|
||||
|
||||
function player_api.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
|
||||
|
||||
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 = 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
|
||||
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 animation_speed_mod = model.animation_speed or 30
|
||||
|
||||
-- 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")
|
||||
-- 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 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 or controls.RMB then
|
||||
player_set_animation(player, "mine", animation_speed_mod)
|
||||
else
|
||||
player_set_animation(player, "stand", animation_speed_mod)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
34
mods/player_api/init.lua
Normal file
@ -0,0 +1,34 @@
|
||||
-- player/init.lua
|
||||
|
||||
dofile(minetest.get_modpath("player_api") .. "/api.lua")
|
||||
|
||||
-- Default player appearance
|
||||
player_api.register_model("character.b3d", {
|
||||
animation_speed = 30,
|
||||
textures = {"character.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},
|
||||
},
|
||||
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
|
||||
stepheight = 0.6,
|
||||
eye_height = 1.47,
|
||||
})
|
||||
|
||||
-- Update appearance when the player joins
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
player_api.player_attached[player:get_player_name()] = false
|
||||
player_api.set_model(player, "character.b3d")
|
||||
player:set_local_animation(
|
||||
{x = 0, y = 79},
|
||||
{x = 168, y = 187},
|
||||
{x = 189, y = 198},
|
||||
{x = 200, y = 219},
|
||||
30
|
||||
)
|
||||
end)
|
52
mods/player_api/license.txt
Normal file
@ -0,0 +1,52 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
GNU Lesser General Public License, version 2.1
|
||||
Copyright (C) 2011-2018 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
Copyright (C) 2011-2018 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 Software Foundation;
|
||||
either version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details:
|
||||
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
|
||||
Licenses of media (textures, models and sounds)
|
||||
-----------------------------------------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2018 stujones11
|
||||
Copyright (C) 2019 An0n3m0us
|
||||
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/
|
BIN
mods/player_api/models/character.b3d
Normal file
BIN
mods/player_api/models/character.blend
Normal file
BIN
mods/player_api/models/character.png
Normal file
After Width: | Height: | Size: 217 B |
BIN
mods/player_api/textures/player.png
Normal file
After Width: | Height: | Size: 160 B |
BIN
mods/player_api/textures/player_back.png
Normal file
After Width: | Height: | Size: 125 B |
6
mods/schematics/README.txt
Normal file
@ -0,0 +1,6 @@
|
||||
driftgame mod: schematics
|
||||
=========================
|
||||
|
||||
Derived from 'saveschems' mod by paramat and sofar.
|
||||
Source code by paramat and sofar (MIT).
|
||||
Schematics by paramat (CC BY-SA 3.0).
|
4
mods/schematics/init.lua
Normal file
@ -0,0 +1,4 @@
|
||||
local path = minetest.get_modpath("schematics")
|
||||
|
||||
-- Uncomment to create .mts files
|
||||
--dofile(path .. "/save.lua")
|
60
mods/schematics/license.txt
Normal file
@ -0,0 +1,60 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2020 paramat
|
||||
Copyright (C) 2020 sofar <sofar@foo-projects.org>
|
||||
|
||||
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
|
||||
|
||||
|
||||
Licenses of media
|
||||
-----------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2020 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
mods/schematics/mod.conf
Normal file
@ -0,0 +1 @@
|
||||
depends = trees
|
100
mods/schematics/save.lua
Normal file
@ -0,0 +1,100 @@
|
||||
-- Schematic file format version 4
|
||||
|
||||
-- Standard table format, structure appears inverted in each z slice.
|
||||
-- Z, Y and X are formatted in increasing order.
|
||||
|
||||
local mts_save = function(name, schematic)
|
||||
local s = minetest.serialize_schematic(schematic, "mts", {})
|
||||
local path = minetest.get_modpath("schematics") .. "/schematics"
|
||||
local filename = path .. "/" .. name .. ".mts"
|
||||
filename = filename:gsub("\"", "\\\""):gsub("\\", "\\\\")
|
||||
local file, err = io.open(filename, "wb")
|
||||
if err == nil then
|
||||
file:write(s)
|
||||
file:flush()
|
||||
file:close()
|
||||
end
|
||||
print("Wrote: " .. filename)
|
||||
end
|
||||
|
||||
local _ = {name = "air", prob = 0}
|
||||
|
||||
-- Mapgen small pine tree
|
||||
|
||||
local L = {name = "trees:pine_needles", prob = 255}
|
||||
local T = {name = "trees:pine_trunk", prob = 255, force_place = true}
|
||||
|
||||
mts_save("trees_pine_tree", {
|
||||
size = {x = 5, y = 12, z = 5},
|
||||
data = {
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, L, L, L, _,
|
||||
_, _, L, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
L, L, _, L, L,
|
||||
_, L, L, L, _,
|
||||
_, L, L, L, _,
|
||||
_, L, L, L, _,
|
||||
_, _, L, _, _,
|
||||
_, _, L, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
|
||||
_, _, T, _, _,
|
||||
_, _, T, _, _,
|
||||
_, _, T, _, _,
|
||||
_, _, T, _, _,
|
||||
L, _, T, _, L,
|
||||
L, L, T, L, L,
|
||||
_, L, T, L, _,
|
||||
_, L, T, L, _,
|
||||
_, L, L, L, _,
|
||||
_, L, L, L, _,
|
||||
_, _, L, _, _,
|
||||
_, _, L, _, _,
|
||||
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
L, L, _, L, L,
|
||||
_, L, L, L, _,
|
||||
_, L, L, L, _,
|
||||
_, L, L, L, _,
|
||||
_, _, L, _, _,
|
||||
_, _, L, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, L, L, L, _,
|
||||
_, _, L, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
_, _, _, _, _,
|
||||
},
|
||||
yslice_prob = {
|
||||
{ypos = 2, prob = 127},
|
||||
{ypos = 3, prob = 127},
|
||||
{ypos = 4, prob = 127},
|
||||
},
|
||||
})
|
8
mods/track/README.txt
Normal file
@ -0,0 +1,8 @@
|
||||
driftgame mod: track
|
||||
====================
|
||||
|
||||
Source code by paramat (MIT).
|
||||
|
||||
Authors of media
|
||||
----------------
|
||||
All textures by paramat (CC BY-SA 3.0).
|
121
mods/track/init.lua
Normal file
@ -0,0 +1,121 @@
|
||||
-- Parameters
|
||||
|
||||
local pathy = 8
|
||||
|
||||
local np_patha = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = {x = 1024, y = 1024, z = 1024},
|
||||
seed = 11711,
|
||||
octaves = 5,
|
||||
persist = 0.5
|
||||
}
|
||||
|
||||
|
||||
-- Nodes
|
||||
|
||||
minetest.register_node("track:road_black", {
|
||||
description = "Road Black",
|
||||
tiles = {"track_road_black.png"},
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 3},
|
||||
})
|
||||
|
||||
minetest.register_node("track:road_white", {
|
||||
description = "Road White",
|
||||
tiles = {"track_road_white.png"},
|
||||
paramtype = "light",
|
||||
light_source = 12,
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 3},
|
||||
})
|
||||
|
||||
|
||||
-- Constants
|
||||
|
||||
local c_roadblack = minetest.get_content_id("track:road_black")
|
||||
local c_roadwhite = minetest.get_content_id("track:road_white")
|
||||
|
||||
|
||||
-- Initialise noise object, noise table, voxelmanip table
|
||||
|
||||
local nobj_patha = nil
|
||||
local nvals_patha = {}
|
||||
local data = {}
|
||||
|
||||
|
||||
-- On generated function
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
if minp.y > pathy or maxp.y < pathy then
|
||||
return
|
||||
end
|
||||
|
||||
--local t1 = os.clock()
|
||||
|
||||
local x1 = maxp.x
|
||||
local y1 = maxp.y
|
||||
local z1 = maxp.z
|
||||
local x0 = minp.x
|
||||
local y0 = minp.y
|
||||
local z0 = minp.z
|
||||
|
||||
local sidelen = x1 - x0 + 1
|
||||
local emerlen = sidelen + 32
|
||||
local overlen = sidelen + 9
|
||||
local pmapdims = {x = overlen, y = overlen, z = 1}
|
||||
local pmapminp = {x = x0 - 5, y = z0 - 5}
|
||||
|
||||
nobj_patha = nobj_patha or minetest.get_perlin_map(np_patha, pmapdims)
|
||||
nobj_patha:get2dMap_flat(pmapminp, nvals_patha)
|
||||
|
||||
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
||||
local area = VoxelArea:new{MinEdge = emin, MaxEdge = emax}
|
||||
vm:get_data(data)
|
||||
|
||||
local ni = 1
|
||||
for z = z0 - 5, z1 + 4 do
|
||||
local n_xprepatha = false
|
||||
-- x0 - 5, z0 - 5 is to setup initial values of 'xprepath_', 'zprepath_'
|
||||
for x = x0 - 5, x1 + 4 do
|
||||
local n_patha = nvals_patha[ni]
|
||||
local n_zprepatha = nvals_patha[(ni - overlen)]
|
||||
|
||||
if x >= x0 - 4 and z >= z0 - 4 then
|
||||
if (n_patha >= 0 and n_xprepatha < 0) -- detect sign change of noise
|
||||
or (n_patha < 0 and n_xprepatha >= 0)
|
||||
or (n_patha >= 0 and n_zprepatha < 0)
|
||||
or (n_patha < 0 and n_zprepatha >= 0) then
|
||||
-- place path node brush
|
||||
for k = -4, 4 do
|
||||
local vi = area:index(x - 4, pathy, z + k)
|
||||
for i = -4, 4 do
|
||||
local radsq = (math.abs(i)) ^ 2 + (math.abs(k)) ^ 2
|
||||
if radsq <= 15 then
|
||||
data[vi] = c_roadblack
|
||||
elseif radsq <= 20 then
|
||||
local nodid = data[vi]
|
||||
if nodid ~= c_roadblack then
|
||||
data[vi] = c_roadwhite
|
||||
end
|
||||
end
|
||||
vi = vi + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
n_xprepatha = n_patha
|
||||
ni = ni + 1
|
||||
end
|
||||
end
|
||||
|
||||
vm:set_data(data)
|
||||
minetest.generate_decorations(vm)
|
||||
vm:set_lighting({day = 0, night = 0})
|
||||
vm:calc_lighting()
|
||||
vm:write_to_map(data)
|
||||
|
||||
--local chugent = math.ceil((os.clock() - t1) * 1000)
|
||||
--print ("[track] "..chugent.." ms")
|
||||
end)
|
61
mods/track/license.txt
Normal file
@ -0,0 +1,61 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2020 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) 2020 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/
|
BIN
mods/track/textures/track_road_black.png
Normal file
After Width: | Height: | Size: 83 B |
BIN
mods/track/textures/track_road_white.png
Normal file
After Width: | Height: | Size: 83 B |
8
mods/trees/README.txt
Normal file
@ -0,0 +1,8 @@
|
||||
driftgame mod: trees
|
||||
====================
|
||||
|
||||
Source code by paramat (MIT).
|
||||
Schematics by paramat (CC BY-SA 3.0).
|
||||
All textures by paramat (CC BY-SA 3.0) and derived from Minetest Game textures by
|
||||
paramat (CC BY-SA 3.0), except:
|
||||
trees_pine_needles.png is derived from a Minetest Game texture by Splizard (CC BY-SA 3.0).
|
41
mods/trees/init.lua
Normal file
@ -0,0 +1,41 @@
|
||||
-- Nodes
|
||||
|
||||
minetest.register_node("trees:pine_trunk", {
|
||||
description = "Pine Trunk",
|
||||
tiles = {
|
||||
"trees_pine_trunk_top.png",
|
||||
"trees_pine_trunk_top.png",
|
||||
"trees_pine_trunk_side.png",
|
||||
},
|
||||
groups = {choppy = 2},
|
||||
})
|
||||
|
||||
minetest.register_node("trees:pine_needles", {
|
||||
description = "Pine Needles",
|
||||
tiles = {"trees_pine_needles.png"},
|
||||
walkable = false,
|
||||
groups = {dig_immediate = 2},
|
||||
})
|
||||
|
||||
|
||||
-- Decoration.
|
||||
-- Placed by voxelmanip in 'track' mod, not by core mapgen, so use:
|
||||
-- mg_flags = caves,dungeons,light,nodecorations,biomes
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "schematic",
|
||||
place_on = {"mapgen:grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0.0,
|
||||
scale = 0.04,
|
||||
spread = {x = 256, y = 256, z = 256},
|
||||
seed = 2,
|
||||
octaves = 3,
|
||||
persist = 0.7
|
||||
},
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("trees").."/schematics/trees_pine_tree.mts",
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
62
mods/trees/license.txt
Normal file
@ -0,0 +1,62 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2020 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 (textures, schematics)
|
||||
---------------------------------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2020 paramat
|
||||
Copyright (C) 2020 Splizard
|
||||
|
||||
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/
|
BIN
mods/trees/schematics/trees_pine_tree.mts
Normal file
BIN
mods/trees/textures/trees_pine_needles.png
Normal file
After Width: | Height: | Size: 506 B |
BIN
mods/trees/textures/trees_pine_trunk_side.png
Normal file
After Width: | Height: | Size: 161 B |
BIN
mods/trees/textures/trees_pine_trunk_top.png
Normal file
After Width: | Height: | Size: 394 B |