Commit fbb7bb1f1d1619baf823ec98d34e2bf8f79cf398

Authored by dg
1 parent fc305cb0

tiles for the scintilalting cave


git-svn-id: http://svn.net-core.org/repos/t-engine4@2653 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -121,6 +121,45 @@ function _M:makeTrees(base, max)
121 121 return tbl
122 122 end
123 123
  124 +--- Generate sub entities to make nice crystals, same as trees but change tint
  125 +function _M:makeCrystals(base, max)
  126 + local function makeTree(nb, z)
  127 + local inb = 4 - nb
  128 + local r = rng.range(1, 100)
  129 + local g = rng.range(1, 100)
  130 + local b = rng.range(1, 100)
  131 + local maxcol = math.max(r, g, b)
  132 + r = r / maxcol
  133 + g = g / maxcol
  134 + b = b / maxcol
  135 + return engine.Entity.new{
  136 + z = z,
  137 + display_scale = rng.float(0.5 + inb / 6, 1.6),
  138 + display_x = rng.float(-1 / 3 * nb / 3, 1 / 3 * nb / 3),
  139 + display_y = rng.float(-1 / 3 * nb / 3, 1 / 3 * nb / 3),
  140 + display_on_seen = true,
  141 + display_on_remember = true,
  142 + tint_r = r,
  143 + tint_g = g,
  144 + tint_b = b,
  145 + image = (base or "terrain/crystal_alpha")..rng.range(1,max or 6)..".png",
  146 + }
  147 + end
  148 +
  149 + local v = rng.range(0, 100)
  150 + local tbl
  151 + if v < 33 then
  152 + tbl = { makeTree(3, 16), makeTree(3, 17), makeTree(3, 18), }
  153 + elseif v < 66 then
  154 + tbl = { makeTree(2, 16), makeTree(2, 17), }
  155 + else
  156 + tbl = { makeTree(1, 16), }
  157 + end
  158 + table.sort(tbl, function(a,b) return a.display_scale < b.display_scale end)
  159 + for i = 1, #tbl do tbl[i].z = 16 + i - 1 end
  160 + return tbl
  161 +end
  162 +
124 163 --- Generate sub entities to make nice shells
125 164 function _M:makeShells(base, max)
126 165 local function makeShell(nb, z)
... ...
... ... @@ -524,9 +524,11 @@ function _M:runCheck()
524 524 local grid = game.level.map(x, y, Map.TERRAIN)
525 525 if grid and grid.notice then noticed = "interesting terrain" end
526 526
527   - -- Objects are always interesting
528   - local obj = game.level.map:getObject(x, y, 1)
529   - if obj then noticed = "object seen" end
  527 + -- Objects are always interesting, only on curent spot
  528 + if x == self.x and y == self.y then
  529 + local obj = game.level.map:getObject(x, y, 1)
  530 + if obj then noticed = "object seen" end
  531 + end
530 532
531 533 -- Traps are always interesting if known
532 534 local trap = game.level.map(x, y, Map.TRAP)
... ...
... ... @@ -19,6 +19,7 @@
19 19
20 20 newEntity{
21 21 define_as = "UNDERGROUND_FLOOR",
  22 + type = "floor", subtype = "underground",
22 23 name = "floor", image = "terrain/underground_floor.png",
23 24 display = '.', color=colors.LIGHT_UMBER, back_color=colors.UMBER,
24 25 grow = "UNDERGROUND_TREE",
... ... @@ -27,6 +28,7 @@ newEntity{
27 28 for i = 1, 20 do
28 29 newEntity{
29 30 define_as = "UNDERGROUND_TREE"..(i > 1 and i or ""),
  31 + type = "wall", subtype = "underground",
30 32 name = "underground thick vegetation",
31 33 image = "terrain/underground_floor.png",
32 34 add_displays = class:makeTrees("terrain/underground_tree_alpha", 7),
... ... @@ -39,8 +41,25 @@ newEntity{
39 41 }
40 42 end
41 43
  44 +for i = 1, 20 do
  45 +newEntity{
  46 + define_as = "CRYSTAL_WALL"..(i > 1 and i or ""),
  47 + type = "wall", subtype = "underground",
  48 + name = "crystals",
  49 + image = "terrain/underground_floor.png",
  50 + add_displays = class:makeCrystals("terrain/crystal_alpha"),
  51 + display = '#', color=colors.LIGHT_BLUE, back_color=colors.UMBER,
  52 + always_remember = true,
  53 + can_pass = {pass_wall=1},
  54 + does_block_move = true,
  55 + block_sight = true,
  56 + dig = "UNDERGROUND_FLOOR",
  57 +}
  58 +end
  59 +
42 60 newEntity{
43 61 define_as = "UNDERGROUND_LADDER_DOWN",
  62 + type = "floor", subtype = "underground",
44 63 name = "ladder to the next level", image = "terrain/underground_floor.png", add_displays = {class.new{image="terrain/ladder_down.png"}},
45 64 display = '>', color_r=255, color_g=255, color_b=0,
46 65 notice = true,
... ... @@ -49,6 +68,7 @@ newEntity{
49 68 }
50 69 newEntity{
51 70 define_as = "UNDERGROUND_LADDER_UP",
  71 + type = "floor", subtype = "underground",
52 72 name = "ladder to the previous level", image = "terrain/underground_floor.png", add_displays = {class.new{image="terrain/ladder_up.png"}},
53 73 display = '<', color_r=255, color_g=255, color_b=0,
54 74 notice = true,
... ... @@ -57,6 +77,7 @@ newEntity{
57 77 }
58 78 newEntity{
59 79 define_as = "UNDERGROUND_LADDER_UP_WILDERNESS",
  80 + type = "floor", subtype = "underground",
60 81 name = "ladder to worldmap", image = "terrain/underground_floor.png", add_displays = {class.new{image="terrain/ladder_up_wild.png"}},
61 82 display = '<', color_r=255, color_g=255, color_b=0,
62 83 notice = true,
... ...
... ... @@ -2,7 +2,7 @@ local Talents = require("engine.interface.ActorTalents")
2 2
3 3 newEntity{
4 4 define_as = "BASE_NPC_CRYSTAL",
5   - type = "immovable", subtype = "crystal",
  5 + type = "immovable", subtype = "crystal", image = "npc/crystal_npc.png",
6 6 display = "%", color=colors.WHITE,
7 7 blood_color = colors.GREY,
8 8 desc = "A shining crystal formation charged with magical energies.",
... ... @@ -38,7 +38,7 @@ newEntity{
38 38
39 39 newEntity{ name = "wisp",
40 40 type = "elemental", subtype = "light",
41   - display = "*", color=colors.YELLOW,
  41 + display = "*", color=colors.YELLOW, tint=colors.YELLOW,
42 42 desc = [[A floating orb of magical energy. It shines with a radiant light. They explode upon contact.]],
43 43 combat = { dam=10, atk=5, apr=10, physspeed=1 },
44 44 blood_color = colors.YELLOW,
... ... @@ -71,7 +71,7 @@ newEntity{ name = "wisp",
71 71 }
72 72
73 73 newEntity{ base = "BASE_NPC_CRYSTAL",
74   - name = "red crystal", color=colors.RED,
  74 + name = "red crystal", color=colors.RED, tint=colors.RED,
75 75 desc = "A formation of red crystal. It emits bright red, scorching light.",
76 76 level_range = {1, nil}, exp_worth = 1,
77 77 rarity = 1,
... ... @@ -82,7 +82,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
82 82 }
83 83
84 84 newEntity{ base = "BASE_NPC_CRYSTAL",
85   - name = "white crystal", color=colors.WHITE,
  85 + name = "white crystal", color=colors.WHITE, tint=colors.WHITE,
86 86 desc = "A formation of white crystal. It emits bright white, chilling light.",
87 87 level_range = {1, nil}, exp_worth = 1,
88 88 rarity = 1,
... ... @@ -93,7 +93,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
93 93 }
94 94
95 95 newEntity{ base = "BASE_NPC_CRYSTAL",
96   - name = "black crystal", color=colors.BLACK,
  96 + name = "black crystal", color=colors.BLACK, tint=colors.BLACK,
97 97 desc = "A formation of black crystal. It absorbs all light around it.",
98 98 level_range = {3, nil}, exp_worth = 1,
99 99 rarity = 2,
... ... @@ -104,7 +104,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
104 104 }
105 105
106 106 newEntity{ base = "BASE_NPC_CRYSTAL",
107   - name = "crimson crystal", color=colors.DARK_RED,
  107 + name = "crimson crystal", color=colors.DARK_RED, tint=colors.DARK_RED,
108 108 desc = "A formation of crimson crystal. It emits a crimson light reminiscent of blood.",
109 109 level_range = {3, nil}, exp_worth = 1,
110 110 rarity = 3,
... ... @@ -115,7 +115,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
115 115 }
116 116
117 117 newEntity{ base = "BASE_NPC_CRYSTAL",
118   - name = "blue crystal", color=colors.BLUE,
  118 + name = "blue crystal", color=colors.BLUE, tint=colors.BLUE,
119 119 desc = "A formation of blue crystal. Its light shines like the ocean's waves.",
120 120 level_range = {3, nil}, exp_worth = 1,
121 121 rarity = 4,
... ... @@ -126,7 +126,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
126 126 }
127 127
128 128 newEntity{ base = "BASE_NPC_CRYSTAL",
129   - name = "multi-hued crystal", color=colors.VIOLET,
  129 + name = "multi-hued crystal", color=colors.VIOLET, tint=colors.VIOLET,
130 130 shader = "quad_hue",
131 131 desc = "A formation of multi-hued crystal. It shines with all the colors of the rainbow.",
132 132 level_range = {10, nil}, exp_worth = 1,
... ... @@ -141,7 +141,7 @@ newEntity{ base = "BASE_NPC_CRYSTAL",
141 141 }
142 142
143 143 newEntity{ base = "BASE_NPC_CRYSTAL",
144   - name = "shimmering crystal", color=colors.GREEN,
  144 + name = "shimmering crystal", color=colors.GREEN, tint=colors.GREEN,
145 145 shader = "quad_hue",
146 146 desc = "A formation of shimmering crystal. Orbs of light circle around it.",
147 147 level_range = {10, nil}, exp_worth = 1,
... ...
... ... @@ -30,7 +30,7 @@ local Talents = require("engine.interface.ActorTalents")
30 30 newEntity{ base="BASE_NPC_CRYSTAL", define_as = "SPELLBLAZE_CRYSTAL",
31 31 allow_infinite_dungeon = true,
32 32 unique = true,
33   - name = "Spellblaze Crystal",
  33 + name = "Spellblaze Crystal", tint=colors.PURPLE,
34 34 color=colors.VIOLET,
35 35 desc = [[A formation of purple crystal. It seems strangely aware.]],
36 36 level_range = {7, nil}, exp_worth = 2,
... ...
... ... @@ -35,7 +35,7 @@ return {
35 35 zoom = 14,
36 36 min_floor = 700,
37 37 floor = "UNDERGROUND_FLOOR",
38   - 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",},
  38 + 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",},
39 39 up = "UNDERGROUND_LADDER_UP",
40 40 down = "UNDERGROUND_LADDER_DOWN",
41 41 door = "UNDERGROUND_FLOOR",
... ... @@ -65,11 +65,16 @@ return {
65 65 },
66 66
67 67 foreground = function(level, dx, dx, nb_keyframes)
  68 +do return end
68 69 local tick = core.game.getTime()
69 70 local sr, sg, sb
70   - sr = (1 + math.sin(tick / 2000)) / 2 * 0.4 + 0.8
71   - sg = (1 + math.sin(tick / 2700)) / 2 * 0.4 + 0.7
72   - sb = (1 + math.sin(tick / 3200)) / 2 * 0.4 + 0.7
  71 + sr = 2 + math.sin(tick / 2000)
  72 + sg = 2 + math.sin(tick / 2700)
  73 + sb = 2 + math.sin(tick / 3200)
  74 + local max = math.max(sr, sg, sb)
  75 + sr = sr / max
  76 + sg = sg / max
  77 + sb = sb / max
73 78 level.map:setShown(sr, sg, sb, 1)
74 79 level.map:setObscure(sr * 0.6, sg * 0.6, sb * 0.6, 1)
75 80 end,
... ...