Improve treasure map water depiction

This commit is contained in:
Nils Dagsson Moskopp 2022-05-17 20:31:14 +02:00
parent 70e3c534e4
commit 0882a48751
Signed by untrusted user who does not match committer: erlehmann
GPG Key ID: A3BC671C35191080
1 changed files with 13 additions and 10 deletions

View File

@ -79,8 +79,11 @@ maps.create_map = function(pos, player_name)
local colormap = { local colormap = {
{ 195, 175, 140 }, -- background { 195, 175, 140 }, -- background
{ 60, 35, 16 }, -- dark line { 60, 35, 16 }, -- dark line
{ 135, 90, 40 }, -- liquid dark
{ 210, 170, 130 }, -- liquid light { 210, 170, 130 }, -- liquid light
{ 135, 90, 40 }, -- liquid dark
{ 150, 105, 55 }, -- more liquid
{ 165, 120, 70 }, -- more liquid
{ 150, 105, 55 }, -- more liquid
} }
for x = 1,size,1 do for x = 1,size,1 do
for z = 1,size,1 do for z = 1,size,1 do
@ -104,26 +107,26 @@ maps.create_map = function(pos, player_name)
-- draw coastline -- draw coastline
for x = 1,size,1 do for x = 1,size,1 do
for z = 1,size,1 do for z = 1,size,1 do
if ( if pixels[z][x][1] >= 2 then
pixels[z][x][1] == 2 or pixels[z][x] = { 2 + ( z % 2 ) } -- stripes
pixels[z][x][1] == 3 if pixels[z][x][1] == 3 then
) then pixels[z][x] = { 3 + ( ( math.floor( x / 7 ) + math.floor( 1.3 * z * z ) ) % 4 ) }
pixels[z][x] = { 2 + z % 2 } -- stripes end
if z > 1 and pixels[z-1][x][1] < 2 then if z > 1 and pixels[z-1][x][1] < 2 then
pixels[z-1][x] = { 1 } pixels[z-1][x] = { 1 }
pixels[z][x] = { 2 } pixels[z][x] = { 3 }
end end
if z < size and pixels[z+1][x][1] < 2 then if z < size and pixels[z+1][x][1] < 2 then
pixels[z+1][x] = { 1 } pixels[z+1][x] = { 1 }
pixels[z][x] = { 2 } pixels[z][x] = { 3 }
end end
if x > 1 and pixels[z][x-1][1] < 2 then if x > 1 and pixels[z][x-1][1] < 2 then
pixels[z][x-1] = { 1 } pixels[z][x-1] = { 1 }
pixels[z][x] = { 2 } pixels[z][x] = { 3 }
end end
if x < size and pixels[z][x+1][1] < 2 then if x < size and pixels[z][x+1][1] < 2 then
pixels[z][x+1] = { 1 } pixels[z][x+1] = { 1 }
pixels[z][x] = { 2 } pixels[z][x] = { 3 }
end end
end end
end end