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

Divination/Identify now correctly works in a radius

Phantasmal Shield now does correct damage
Quicken Spell has all ranks useful


git-svn-id: http://svn.net-core.org/repos/t-engine4@997 51575b47-30f0-44d4-a5cc-537603b46e54
parent d8376909
No related branches found
No related tags found
No related merge requests found
......@@ -402,6 +402,11 @@ function _M:display()
self.player:playerFOV()
end
-- Level background
if self.level.data.background then
self.level.data.background(self.level)
end
-- Display using Framebuffer, sotaht we can use shaders and all
if self.fbo then
self.fbo:use(true)
......
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 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 General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
------------------------------------------------------------
-- For inside the sea
------------------------------------------------------------
newEntity{
define_as = "VOID",
name = "void",
display = ' ',
_noalpha = false,
}
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 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 General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
local dir = rng.range(0, 360)
local blur = blur or 0
local first = true
local life = (width + height) / 2
local sides
if dir >= 0 and dir < 90 then sides = {8,6}
elseif dir >= 90 and dir < 180 then sides = {8,4}
elseif dir >= 180 and dir < 270 then sides = {2,4}
else sides = {2,6}
end
dir = math.rad(dir)
return { generator = function()
local side = rng.table(sides)
local x, y
if side == 2 then x = rng.range(0, width) y = height
elseif side == 8 then x = rng.range(0, width) y = 0
elseif side == 6 then x = 0 y = rng.range(0, height)
else x = width y = rng.range(0, height)
end
local vel = rng.float(0.3, 2)
return {
life = life / vel,
size = rng.float(1, 8), sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = dir, dirv = blur, dira = 0,
vel = vel, velv = 0, vela = 0,
r = 1, rv = 0, ra = 0,
g = 1, gv = 0, ga = 0,
b = 1, bv = 0, ba = 0,
a = rng.float(0.5, 1), av = 0, aa = 0,
}
end, },
function(self)
self.ps:emit(1)
end,
1000
......@@ -76,13 +76,20 @@ newTalent{
end
if self:getTalentLevel(t) >= 4 then
local idx = 1
while true do
local o = game.level.map:getObject(self.x, self.y, idx)
if not o then break end
o:identify(true)
idx = idx + 1
local idfloor = function(x, y)
local idx = 1
while true do
local o = game.level.map:getObject(x, y, idx)
if not o then break end
o:identify(true)
idx = idx + 1
end
end
local rad = math.floor(0 + (self:getTalentLevel(t) - 4))
if rad == 0 then idfloor(self.x, self.y)
else self:project({type="ball", radius=rad}, self.x, self.y, idfloor)
end
game.logPlayer(who, "You identify everything around you.")
end
......
......@@ -100,7 +100,7 @@ newTalent{
},
activate = function(self, t)
game:playSoundNear(self, "talents/spell_generic")
local power = util.bound(self:getTalentLevel(t) / 15, 0.05, 0.3)
local power = util.bound(self:getTalentLevelRaw(t) / 15, 0.05, 0.3)
return {
cd = self:addTemporaryValue("spell_cooldown_reduction", power),
}
......@@ -111,7 +111,7 @@ newTalent{
end,
info = function(self, t)
return ([[Reduces the cooldown of all spells by %d%%.
The reduction increases with the Magic stat]]):format(util.bound(self:getTalentLevel(t) / 15, 0.05, 0.3) * 100)
The reduction increases with the Magic stat]]):format(util.bound(self:getTalentLevelRaw(t) / 15, 0.05, 0.3) * 100)
end,
}
......
......@@ -84,7 +84,7 @@ newTalent{
DEFEND = 10,
},
activate = function(self, t)
local power = self:combatTalentSpellDamage(t, 10, 170)
local power = self:combatTalentSpellDamage(t, 10, 50)
game:playSoundNear(self, "talents/heal")
return {
particle = self:addParticles(Particles.new("phantasm_shield", 1)),
......@@ -98,7 +98,7 @@ newTalent{
end,
info = function(self, t)
return ([[The caster surrounds themselves with a phantasmal shield. If hit in melee the shield will deal %d arcane damage to the attacker.
The damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 10, 170))
The damage will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 10, 50))
end,
}
......
......@@ -18,5 +18,4 @@
-- darkgod@te4.org
load("/data/general/grids/basic.lua")
load("/data/general/grids/forest.lua")
load("/data/general/grids/water.lua")
load("/data/general/grids/void.lua")
......@@ -31,8 +31,8 @@ return {
generator = {
map = {
class = "engine.generator.map.Forest",
floor = "GRASS",
wall = "TREE",
floor = "",
wall = "",
up = "UP",
down = "DOWN",
do_ponds = {
......@@ -64,4 +64,15 @@ return {
}, },
},
},
post_process = function(level)
local Map = require "engine.Map"
level.background_particle = require("engine.Particles").new("starfield", 1, {width=Map.viewport.width, height=Map.viewport.height})
end,
background = function(level)
local Map = require "engine.Map"
level.background_particle:update()
level.background_particle.ps:toScreen(Map.display_x, Map.display_y, true, 1)
end,
}
......@@ -233,6 +233,25 @@ static int program_set_uniform_texture(lua_State *L)
return 0;
}
static int program_use(lua_State *L)
{
GLuint *p = (GLuint*)auxiliar_checkclass(L, "gl{program}", 1);
bool active = lua_toboolean(L, 2);
if (active)
{
CHECKGL(glUseProgramObjectARB(*p));
GLfloat t = SDL_GetTicks();
CHECKGL(glUniform1fvARB(glGetUniformLocationARB(*p, "tick"), 1, &t));
}
else
{
CHECKGL(glUseProgramObjectARB(0));
}
return 0;
}
static int shader_is_active(lua_State *L)
{
lua_pushboolean(L, shaders_active);
......@@ -258,6 +277,7 @@ static const struct luaL_reg program_reg[] =
{"paramNumber3", program_set_uniform_number3},
{"paramNumber4", program_set_uniform_number4},
{"paramTexture", program_set_uniform_texture},
{"use", program_use},
{NULL, NULL},
};
......
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