Skip to content
Snippets Groups Projects
Commit fbb7bb1f authored by dg's avatar dg
Browse files

tiles for the scintilalting cave

git-svn-id: http://svn.net-core.org/repos/t-engine4@2653 51575b47-30f0-44d4-a5cc-537603b46e54
parent fc305cb0
No related branches found
No related tags found
No related merge requests found
Showing
with 84 additions and 17 deletions
......@@ -121,6 +121,45 @@ function _M:makeTrees(base, max)
return tbl
end
--- Generate sub entities to make nice crystals, same as trees but change tint
function _M:makeCrystals(base, max)
local function makeTree(nb, z)
local inb = 4 - nb
local r = rng.range(1, 100)
local g = rng.range(1, 100)
local b = rng.range(1, 100)
local maxcol = math.max(r, g, b)
r = r / maxcol
g = g / maxcol
b = b / maxcol
return engine.Entity.new{
z = z,
display_scale = rng.float(0.5 + inb / 6, 1.6),
display_x = rng.float(-1 / 3 * nb / 3, 1 / 3 * nb / 3),
display_y = rng.float(-1 / 3 * nb / 3, 1 / 3 * nb / 3),
display_on_seen = true,
display_on_remember = true,
tint_r = r,
tint_g = g,
tint_b = b,
image = (base or "terrain/crystal_alpha")..rng.range(1,max or 6)..".png",
}
end
local v = rng.range(0, 100)
local tbl
if v < 33 then
tbl = { makeTree(3, 16), makeTree(3, 17), makeTree(3, 18), }
elseif v < 66 then
tbl = { makeTree(2, 16), makeTree(2, 17), }
else
tbl = { makeTree(1, 16), }
end
table.sort(tbl, function(a,b) return a.display_scale < b.display_scale end)
for i = 1, #tbl do tbl[i].z = 16 + i - 1 end
return tbl
end
--- Generate sub entities to make nice shells
function _M:makeShells(base, max)
local function makeShell(nb, z)
......
......@@ -524,9 +524,11 @@ function _M:runCheck()
local grid = game.level.map(x, y, Map.TERRAIN)
if grid and grid.notice then noticed = "interesting terrain" end
-- Objects are always interesting
local obj = game.level.map:getObject(x, y, 1)
if obj then noticed = "object seen" end
-- Objects are always interesting, only on curent spot
if x == self.x and y == self.y then
local obj = game.level.map:getObject(x, y, 1)
if obj then noticed = "object seen" end
end
-- Traps are always interesting if known
local trap = game.level.map(x, y, Map.TRAP)
......
......@@ -19,6 +19,7 @@
newEntity{
define_as = "UNDERGROUND_FLOOR",
type = "floor", subtype = "underground",
name = "floor", image = "terrain/underground_floor.png",
display = '.', color=colors.LIGHT_UMBER, back_color=colors.UMBER,
grow = "UNDERGROUND_TREE",
......@@ -27,6 +28,7 @@ newEntity{
for i = 1, 20 do
newEntity{
define_as = "UNDERGROUND_TREE"..(i > 1 and i or ""),
type = "wall", subtype = "underground",
name = "underground thick vegetation",
image = "terrain/underground_floor.png",
add_displays = class:makeTrees("terrain/underground_tree_alpha", 7),
......@@ -39,8 +41,25 @@ newEntity{
}
end
for i = 1, 20 do
newEntity{
define_as = "CRYSTAL_WALL"..(i > 1 and i or ""),
type = "wall", subtype = "underground",
name = "crystals",
image = "terrain/underground_floor.png",
add_displays = class:makeCrystals("terrain/crystal_alpha"),
display = '#', color=colors.LIGHT_BLUE, back_color=colors.UMBER,
always_remember = true,
can_pass = {pass_wall=1},
does_block_move = true,
block_sight = true,
dig = "UNDERGROUND_FLOOR",
}
end
newEntity{
define_as = "UNDERGROUND_LADDER_DOWN",
type = "floor", subtype = "underground",
name = "ladder to the next level", image = "terrain/underground_floor.png", add_displays = {class.new{image="terrain/ladder_down.png"}},
display = '>', color_r=255, color_g=255, color_b=0,
notice = true,
......@@ -49,6 +68,7 @@ newEntity{
}
newEntity{
define_as = "UNDERGROUND_LADDER_UP",
type = "floor", subtype = "underground",
name = "ladder to the previous level", image = "terrain/underground_floor.png", add_displays = {class.new{image="terrain/ladder_up.png"}},
display = '<', color_r=255, color_g=255, color_b=0,
notice = true,
......@@ -57,6 +77,7 @@ newEntity{
}
newEntity{
define_as = "UNDERGROUND_LADDER_UP_WILDERNESS",
type = "floor", subtype = "underground",
name = "ladder to worldmap", image = "terrain/underground_floor.png", add_displays = {class.new{image="terrain/ladder_up_wild.png"}},
display = '<', color_r=255, color_g=255, color_b=0,
notice = true,
......
......@@ -2,7 +2,7 @@ local Talents = require("engine.interface.ActorTalents")
newEntity{
define_as = "BASE_NPC_CRYSTAL",
type = "immovable", subtype = "crystal",
type = "immovable", subtype = "crystal", image = "npc/crystal_npc.png",
display = "%", color=colors.WHITE,
blood_color = colors.GREY,
desc = "A shining crystal formation charged with magical energies.",
......@@ -38,7 +38,7 @@ newEntity{
newEntity{ name = "wisp",
type = "elemental", subtype = "light",
display = "*", color=colors.YELLOW,
display = "*", color=colors.YELLOW, tint=colors.YELLOW,
desc = [[A floating orb of magical energy. It shines with a radiant light. They explode upon contact.]],
combat = { dam=10, atk=5, apr=10, physspeed=1 },
blood_color = colors.YELLOW,
......@@ -71,7 +71,7 @@ newEntity{ name = "wisp",
}
newEntity{ base = "BASE_NPC_CRYSTAL",
name = "red crystal", color=colors.RED,
name = "red crystal", color=colors.RED, tint=colors.RED,
desc = "A formation of red crystal. It emits bright red, scorching light.",
level_range = {1, nil}, exp_worth = 1,
rarity = 1,
......@@ -82,7 +82,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
}
newEntity{ base = "BASE_NPC_CRYSTAL",
name = "white crystal", color=colors.WHITE,
name = "white crystal", color=colors.WHITE, tint=colors.WHITE,
desc = "A formation of white crystal. It emits bright white, chilling light.",
level_range = {1, nil}, exp_worth = 1,
rarity = 1,
......@@ -93,7 +93,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
}
newEntity{ base = "BASE_NPC_CRYSTAL",
name = "black crystal", color=colors.BLACK,
name = "black crystal", color=colors.BLACK, tint=colors.BLACK,
desc = "A formation of black crystal. It absorbs all light around it.",
level_range = {3, nil}, exp_worth = 1,
rarity = 2,
......@@ -104,7 +104,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
}
newEntity{ base = "BASE_NPC_CRYSTAL",
name = "crimson crystal", color=colors.DARK_RED,
name = "crimson crystal", color=colors.DARK_RED, tint=colors.DARK_RED,
desc = "A formation of crimson crystal. It emits a crimson light reminiscent of blood.",
level_range = {3, nil}, exp_worth = 1,
rarity = 3,
......@@ -115,7 +115,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
}
newEntity{ base = "BASE_NPC_CRYSTAL",
name = "blue crystal", color=colors.BLUE,
name = "blue crystal", color=colors.BLUE, tint=colors.BLUE,
desc = "A formation of blue crystal. Its light shines like the ocean's waves.",
level_range = {3, nil}, exp_worth = 1,
rarity = 4,
......@@ -126,7 +126,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
}
newEntity{ base = "BASE_NPC_CRYSTAL",
name = "multi-hued crystal", color=colors.VIOLET,
name = "multi-hued crystal", color=colors.VIOLET, tint=colors.VIOLET,
shader = "quad_hue",
desc = "A formation of multi-hued crystal. It shines with all the colors of the rainbow.",
level_range = {10, nil}, exp_worth = 1,
......@@ -141,7 +141,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
}
newEntity{ base = "BASE_NPC_CRYSTAL",
name = "shimmering crystal", color=colors.GREEN,
name = "shimmering crystal", color=colors.GREEN, tint=colors.GREEN,
shader = "quad_hue",
desc = "A formation of shimmering crystal. Orbs of light circle around it.",
level_range = {10, nil}, exp_worth = 1,
......
game/modules/tome/data/gfx/shockbolt/npc/crystal_npc.png

8.89 KiB

game/modules/tome/data/gfx/shockbolt/terrain/crystal_alpha1.png

5.25 KiB

game/modules/tome/data/gfx/shockbolt/terrain/crystal_alpha2.png

3.33 KiB

game/modules/tome/data/gfx/shockbolt/terrain/crystal_alpha3.png

3.5 KiB

game/modules/tome/data/gfx/shockbolt/terrain/crystal_alpha4.png

6.57 KiB

game/modules/tome/data/gfx/shockbolt/terrain/crystal_alpha5.png

4.24 KiB

game/modules/tome/data/gfx/shockbolt/terrain/crystal_alpha6.png

6.87 KiB

......@@ -30,7 +30,7 @@ local Talents = require("engine.interface.ActorTalents")
newEntity{ base="BASE_NPC_CRYSTAL", define_as = "SPELLBLAZE_CRYSTAL",
allow_infinite_dungeon = true,
unique = true,
name = "Spellblaze Crystal",
name = "Spellblaze Crystal", tint=colors.PURPLE,
color=colors.VIOLET,
desc = [[A formation of purple crystal. It seems strangely aware.]],
level_range = {7, nil}, exp_worth = 2,
......
......@@ -35,7 +35,7 @@ return {
zoom = 14,
min_floor = 700,
floor = "UNDERGROUND_FLOOR",
wall = {"UNDERGROUND_TREE","UNDERGROUND_TREE2","UNDERGROUND_TREE3","UNDERGROUND_TREE4","UNDERGROUND_TREE5","UNDERGROUND_TREE6","UNDERGROUND_TREE7","UNDERGROUND_TREE8","UNDERGROUND_TREE9","UNDERGROUND_TREE10","UNDERGROUND_TREE11","UNDERGROUND_TREE12","UNDERGROUND_TREE13","UNDERGROUND_TREE14","UNDERGROUND_TREE15","UNDERGROUND_TREE16","UNDERGROUND_TREE17","UNDERGROUND_TREE18","UNDERGROUND_TREE19","UNDERGROUND_TREE20",},
wall = {"CRYSTAL_WALL","CRYSTAL_WALL2","CRYSTAL_WALL3","CRYSTAL_WALL4","CRYSTAL_WALL5","CRYSTAL_WALL6","CRYSTAL_WALL7","CRYSTAL_WALL8","CRYSTAL_WALL9","CRYSTAL_WALL10","CRYSTAL_WALL11","CRYSTAL_WALL12","CRYSTAL_WALL13","CRYSTAL_WALL14","CRYSTAL_WALL15","CRYSTAL_WALL16","CRYSTAL_WALL17","CRYSTAL_WALL18","CRYSTAL_WALL19","CRYSTAL_WALL20",},
up = "UNDERGROUND_LADDER_UP",
down = "UNDERGROUND_LADDER_DOWN",
door = "UNDERGROUND_FLOOR",
......@@ -65,11 +65,16 @@ return {
},
foreground = function(level, dx, dx, nb_keyframes)
do return end
local tick = core.game.getTime()
local sr, sg, sb
sr = (1 + math.sin(tick / 2000)) / 2 * 0.4 + 0.8
sg = (1 + math.sin(tick / 2700)) / 2 * 0.4 + 0.7
sb = (1 + math.sin(tick / 3200)) / 2 * 0.4 + 0.7
sr = 2 + math.sin(tick / 2000)
sg = 2 + math.sin(tick / 2700)
sb = 2 + math.sin(tick / 3200)
local max = math.max(sr, sg, sb)
sr = sr / max
sg = sg / max
sb = sb / max
level.map:setShown(sr, sg, sb, 1)
level.map:setObscure(sr * 0.6, sg * 0.6, sb * 0.6, 1)
end,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment