Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loud_walking
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
loud_walking
Commits
df93cfe3
Commit
df93cfe3
authored
9 years ago
by
Duane Robertson
Browse files
Options
Downloads
Patches
Plain Diff
Add lava.
parent
0734ca73
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mapgen.lua
+25
-6
25 additions, 6 deletions
mapgen.lua
with
25 additions
and
6 deletions
mapgen.lua
+
25
−
6
View file @
df93cfe3
local
node
=
loud_walking
.
node
local
node
=
loud_walking
.
node
local
bevel
=
40
local
bevel
=
40
local
glass
=
"default:glass"
local
data
=
{}
local
data
=
{}
...
@@ -236,16 +237,18 @@ function loud_walking.generate(p_minp, p_maxp, seed)
...
@@ -236,16 +237,18 @@ function loud_walking.generate(p_minp, p_maxp, seed)
local
px
=
math.floor
((
minp
.
x
+
32
)
/
csize
.
x
)
local
px
=
math.floor
((
minp
.
x
+
32
)
/
csize
.
x
)
local
pz
=
math.floor
((
minp
.
z
+
32
)
/
csize
.
z
)
local
pz
=
math.floor
((
minp
.
z
+
32
)
/
csize
.
z
)
local
top
=
biomes
[
biome
].
node_top
or
"default:dirt_with_grass"
local
top
=
biomes
[
biome
].
node_top
or
"default:dirt_with_grass"
local
filler
=
biomes
[
biome
].
node_filler
or
"default:dirt"
local
node_
filler
=
biomes
[
biome
].
node_filler
or
"default:dirt"
local
depth_top
=
biomes
[
biome
].
depth_top
or
1
local
depth_top
=
biomes
[
biome
].
depth_top
or
1
local
depth_filler
=
biomes
[
biome
].
depth_filler
or
1
local
depth_filler
=
biomes
[
biome
].
depth_filler
or
1
local
node_stone
=
biomes
[
biome
].
node_stone
or
"default:stone"
local
node_stone
=
biomes
[
biome
].
node_stone
or
"default:stone"
local
ocean
=
string.find
(
biome
,
"ocean"
)
and
true
or
false
local
ocean
=
string.find
(
biome
,
"ocean"
)
and
true
or
false
local
swamp
=
string.find
(
biome
,
"swamp"
)
and
true
or
false
local
swamp
=
string.find
(
biome
,
"swamp"
)
and
true
or
false
local
beach
=
string.find
(
biome
,
"beach"
)
and
true
or
false
local
beach
=
string.find
(
biome
,
"beach"
)
and
true
or
false
local
dunes
=
string.find
(
biome
,
"dunes"
)
and
true
or
false
local
half
=
math.floor
(
csize
.
y
/
2
+
0
.
5
)
local
half
=
math.floor
(
csize
.
y
/
2
+
0
.
5
)
local
ground
=
half
local
ground
=
half
beach
=
beach
or
dunes
if
ocean
then
if
ocean
then
ground
=
ground
-
15
ground
=
ground
-
15
elseif
swamp
or
beach
then
elseif
swamp
or
beach
then
...
@@ -283,7 +286,7 @@ function loud_walking.generate(p_minp, p_maxp, seed)
...
@@ -283,7 +286,7 @@ function loud_walking.generate(p_minp, p_maxp, seed)
data
[
ivm
]
=
node
(
"loud_walking:scrith"
)
data
[
ivm
]
=
node
(
"loud_walking:scrith"
)
lightmap
[
ivm
]
=
0
lightmap
[
ivm
]
=
0
else
else
data
[
ivm
]
=
node
(
"default:
glass
"
)
data
[
ivm
]
=
node
(
glass
)
end
end
in_cave
=
false
in_cave
=
false
write
=
true
write
=
true
...
@@ -295,17 +298,24 @@ function loud_walking.generate(p_minp, p_maxp, seed)
...
@@ -295,17 +298,24 @@ function loud_walking.generate(p_minp, p_maxp, seed)
data
[
ivm
]
=
node
(
"loud_walking:scrith"
)
data
[
ivm
]
=
node
(
"loud_walking:scrith"
)
lightmap
[
ivm
]
=
0
lightmap
[
ivm
]
=
0
else
else
data
[
ivm
]
=
node
(
"default:
glass
"
)
data
[
ivm
]
=
node
(
glass
)
end
end
write
=
true
write
=
true
end
end
in_cave
=
false
in_cave
=
false
elseif
not
in_cave
and
dy
==
terr
+
ground
+
1
then
elseif
not
in_cave
and
dy
==
terr
+
ground
+
1
and
dy
>
half
then
local
deco
=
get_decoration
(
biome
)
local
deco
=
get_decoration
(
biome
)
if
deco
then
if
deco
then
data
[
ivm
]
=
node
(
deco
)
data
[
ivm
]
=
node
(
deco
)
end
end
write
=
true
write
=
true
elseif
not
in_cave
and
dy
==
terr
+
ground
+
1
then
-- ** water decorations **
--local deco = get_decoration(biome)
--if deco then
-- data[ivm] = node(deco)
--end
--write = true
elseif
(
ocean
or
swamp
or
beach
)
and
dy
>
terr
+
ground
and
dy
<=
half
then
elseif
(
ocean
or
swamp
or
beach
)
and
dy
>
terr
+
ground
and
dy
<=
half
then
data
[
ivm
]
=
node
(
"default:water_source"
)
data
[
ivm
]
=
node
(
"default:water_source"
)
in_cave
=
false
in_cave
=
false
...
@@ -314,8 +324,17 @@ function loud_walking.generate(p_minp, p_maxp, seed)
...
@@ -314,8 +324,17 @@ function loud_walking.generate(p_minp, p_maxp, seed)
in_cave
=
false
in_cave
=
false
elseif
cave
[
index3d
]
^
2
>
0
.
1
+
dy
/
half
then
elseif
cave
[
index3d
]
^
2
>
0
.
1
+
dy
/
half
then
if
terr
+
ground
>=
dy
and
not
in_cave
and
dy
>
terr
+
ground
-
10
then
if
terr
+
ground
>=
dy
and
not
in_cave
and
dy
>
terr
+
ground
-
10
then
data
[
ivm
]
=
node
(
biomes
[
biome
].
node_filler
)
data
[
ivm
]
=
node
(
node_filler
)
elseif
ocean
or
swamp
then
elseif
dy
==
1
then
local
sr
=
math.random
(
9
)
if
not
ocean
and
not
swamp
and
not
beach
and
sr
==
1
then
data
[
ivm
]
=
node
(
"default:lava_source"
)
elseif
sr
>
6
then
data
[
ivm
]
=
node
(
node_stone
)
elseif
ocean
or
swamp
or
beach
then
data
[
ivm
]
=
node
(
node_filler
)
end
elseif
ocean
or
swamp
or
beach
then
data
[
ivm
]
=
node
(
"default:water_source"
)
data
[
ivm
]
=
node
(
"default:water_source"
)
else
else
data
[
ivm
]
=
node
(
"air"
)
data
[
ivm
]
=
node
(
"air"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment