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

Remove out of focus sleeping mode to rpevent the dreaded black screen bug

Increased exp curve
Health talent requires more CON
more alchemist


git-svn-id: http://svn.net-core.org/repos/t-engine4@889 51575b47-30f0-44d4-a5cc-537603b46e54
parent 1c59f919
No related branches found
No related tags found
No related merge requests found
Showing
with 428 additions and 56 deletions
......@@ -111,6 +111,9 @@ newBirthDescriptor{
["cunning/survival"]={false, -0.1},
},
talents = {
[ActorTalents.T_CREATE_ALCHEMIST_GEMS] = 1,
[ActorTalents.T_THROW_BOMB] = 1,
[ActorTalents.T_FIRE_INFUSION] = 1,
},
copy = {
max_life = 90,
......
-- 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 nb = 0
return { generator = function()
local radius = radius
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0, sradius / 2)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 10,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = a, dirv = 0, dira = 0,
vel = sradius / 2 / 10, velv = 0, vela = 0,
r = 0, rv = 0, ra = 0,
g = rng.range(80, 255)/255, gv = 0, ga = 0,
b = 0, bv = 0, ba = 0,
a = rng.range(25, 220)/255, av = 0, aa = 0,
}
end, },
function(self)
if nb < 5 then
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
end
end,
5*radius*266
-- 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 nb = 0
return { generator = function()
local radius = radius
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0, sradius / 2)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 10,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = a, dirv = 0, dira = 0,
vel = sradius / 2 / 10, velv = 0, vela = 0,
r = rng.range(200, 255)/255, rv = 0, ra = 0,
g = rng.range(120, 170)/255, gv = 0.005, ga = 0.0005,
b = rng.range(0, 10)/255, bv = 0, ba = 0,
a = rng.range(25, 220)/255, av = static and -0.034 or 0, aa = 0.005,
}
end, },
function(self)
if nb < 5 then
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
end
end,
5*radius*266
-- 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 nb = 0
return { generator = function()
local radius = radius
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0, sradius / 2)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 10,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = a, dirv = 0, dira = 0,
vel = sradius / 2 / 10, velv = 0, vela = 0,
r = 0, rv = 0, ra = 0,
g = rng.range(170, 210)/255, gv = 0, ga = 0,
b = rng.range(200, 255)/255, gv = 0, ga = 0,
a = rng.range(230, 225)/255, av = 0, aa = 0,
}
end, },
function(self)
if nb < 5 then
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
end
end,
5*radius*266
-- 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 nb = 0
return { generator = function()
local radius = radius
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(0, sradius / 2)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 10,
size = 3, sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = a, dirv = 0, dira = 0,
vel = sradius / 2 / 10, velv = 0, vela = 0,
r = rng.range(140, 200)/255, rv = 0, ra = 0,
g = rng.range(180, 220)/255, gv = 0, ga = 0,
b = rng.range(220, 240)/255, bv = 0, ba = 0,
a = rng.range(230, 255)/255, av = 0, aa = 0,
}
end, },
function(self)
if nb < 5 then
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
end
end,
5*radius*266
......@@ -17,6 +17,7 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
--[[
-- Make up the grids list
local gs = {}
......@@ -37,6 +38,7 @@ for i = -radius, radius do for j = -radius, radius do
lx, ly = l()
end
end end
]]
local nb = 0
return { generator = function()
......@@ -49,6 +51,7 @@ return { generator = function()
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
--[[
if gs[bx] and gs[bx][by] and rng.chance(2) then
-- print("block at angle", ad, radius, ":=>", gs[bx][by].radius)
radius = gs[bx][by].radius
......@@ -57,6 +60,7 @@ return { generator = function()
x = r * math.cos(a)
y = r * math.sin(a)
end
--]]
local static = rng.percent(40)
return {
......@@ -90,42 +94,3 @@ function(self)
end
end,
5*radius*266
--[[
local nb = 0
return { generator = function()
local ad = rng.range(0, 360)
local a = math.rad(ad)
local r = rng.range(2, sradius)
local boundx = r * math.cos(a)
local boundy = r * math.sin(a)
local x = math.floor(boundx / engine.Map.tile_w) + tx
local y = math.floor(boundy / engine.Map.tile_h) + ty
if not grids[x] or not grids[x][y] then return end
return {
trail = 1,
life = 12,
size = 3, sizev = 0.3, sizea = 0,
x = boundx, xv = 0, xa = 0,
y = boundy, yv = 0, ya = 0,
-- x = r * math.cos(a), xv = -0.1, xa = 0,
-- y = r * math.sin(a), yv = -0.1, ya = 0,
dir = a + 5 * math.rad(rng.range(10, 20)), dirv = math.rad(rng.range(10, 20)), dira = -math.rad(2),
vel = 1, velv = 0, vela = 0.1,
r = rng.range(200, 255)/255, rv = 0, ra = 0,
g = rng.range(120, 170)/255, gv = 0, ga = 0,
b = rng.range(0, 10)/255, bv = 0, ba = 0,
a = rng.range(25, 220)/255, av = 0, aa = 0,
}
end, },
function(self)
if nb < 2 then
self.ps:emit(800)
nb = nb + 1
end
end,
5000
]]
\ No newline at end of file
......@@ -19,6 +19,7 @@
local oldNewTalent = newTalent
newTalent = function(t)
assert(engine.interface.ActorTalents.talents_types_def[t.type[1]], "No talent category "..tostring(t.type[1]).." for talent "..t.name)
if engine.interface.ActorTalents.talents_types_def[t.type[1]].generic then t.generic = true end
return oldNewTalent(t)
end
......
......@@ -26,7 +26,7 @@ newTalent{
return math.ceil(5 + self:getDex(12))
end,
action = function(self, t)
local nb = rng.range(40, 80, 3)
local nb = rng.range(40, 80)
self:showEquipInven("Use which gem?", function(o) return o.type == "gem" end, function(o, inven, item)
local gem = game.zone:makeEntityByName(game.level, "object", "ALCHEMIST_" .. o.define_as)
......@@ -60,6 +60,19 @@ newTalent{
range = function(self, t)
return math.ceil(5 + self:getDex(12))
end,
computeDamage = function(self, t, ammo)
local inc_dam = 0
local damtype = DamageType.FIRE
local particle = "ball_fire"
if self:isTalentActive(self.T_ACID_INFUSION) then inc_dam = self:getTalentLevel(self.T_ACID_INFUSION) * 0.05; damtype = DamageType.ACID; particle = "ball_acid"
elseif self:isTalentActive(self.T_LIGHTNING_INFUSION) then inc_dam = self:getTalentLevel(self.T_LIGHTNING_INFUSION) * 0.05; damtype = DamageType.LIGHTNING; particle = "ball_lightning"
elseif self:isTalentActive(self.T_FROST_INFUSION) then inc_dam = self:getTalentLevel(self.T_FROST_INFUSION) * 0.05; damtype = DamageType.ICE; particle = "ball_ice"
else inc_dam = self:getTalentLevel(self.T_FIRE_INFUSION) * 0.05
end
local dam = self:combatTalentSpellDamage(t, 15, 150, (ammo.alchemist_power + self:combatSpellpower()) / 2)
dam = dam * (1 + inc_dam)
return dam, damtype, particle
end,
action = function(self, t)
local ammo = self:hasAlchemistWeapon()
if not ammo then
......@@ -75,18 +88,29 @@ newTalent{
ammo = self:removeObject(self:getInven("QUIVER"), 1)
if not ammo then return end
local inc_dam = 1 --+ self:getTalentLevel(t) * 0.05
local dam = self:combatTalentSpellDamage(t, 15, 150, ammo.alchemist_power)
dam = dam * inc_dam
local dam, damtype, particle = t.computeDamage(self, t, ammo)
local prot = self:getTalentLevelRaw(self.T_ALCHEMIST_PROTECTION) * 0.2
local grids = self:project(tg, x, y, function(tx, ty)
-- Protect yourself
local d = dam
if tx == self.x and ty == self.y then d = dam * (1 - prot) end
DamageType:get(damtype).projector(self, tx, ty, damtype, self:spellCrit(d))
end)
local _ _, x, y = self:canProject(tg, x, y)
game.level.map:particleEmitter(x, y, tg.radius, particle, {radius=tg.radius, grids=grids, tx=x, ty=y})
self:project(tg, x, y, DamageType.FIRE, self:spellCrit(dam), nil)
game:playSoundNear(self, "talents/arcane")
return true
end,
info = function(self, t)
local ammo = self:hasAlchemistWeapon()
local dam, damtype = 1, DamageType.FIRE
if ammo then dam, damtype = t.computeDamage(self, t, ammo) end
return ([[Imbue an alchemist gem with an explosive charge of mana and throw it.
The gem will explode for %0.2f damage (default damage type is fire, it can be altered by other talents).
The damage will improve with better gems and the range with your dexterity.]]):format(1)
The gem will explode for %0.2f %s damage.
The damage will improve with better gems and Magic stat and the range with your dexterity.]]):format(dam, DamageType:get(damtype).name)
end,
}
......@@ -94,7 +118,7 @@ newTalent{
name = "Explosion Expert",
type = {"spell/alchemy", 2},
require = spells_req2,
type = "passive",
mode = "passive",
points = 5,
info = function(self, t)
return ([[Your alchemist bombs now affect a radius of %d around them.]]):format(self:getTalentLevelRaw(t))
......@@ -105,8 +129,20 @@ newTalent{
name = "Alchemist Protection",
type = {"spell/alchemy", 3},
require = spells_req3,
type = "passive",
mode = "passive",
points = 5,
on_learn = function(self, t)
self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) + 3
self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) + 3
self.resists[DamageType.LIGHTNING] = (self.resists[DamageType.LIGHTNING] or 0) + 3
self.resists[DamageType.ACID] = (self.resists[DamageType.ACID] or 0) + 3
end,
on_unlearn = function(self, t)
self.resists[DamageType.FIRE] = self.resists[DamageType.FIRE] - 3
self.resists[DamageType.COLD] = self.resists[DamageType.COLD] - 3
self.resists[DamageType.LIGHTNING] = self.resists[DamageType.LIGHTNING] - 3
self.resists[DamageType.ACID] = self.resists[DamageType.ACID] - 3
end,
info = function(self, t)
return ([[Improves your resistance against your own bombs elemental damage by %d%% and against external one byt %d%%.]]):
format(self:getTalentLevelRaw(t) * 20, self:getTalentLevelRaw(t) * 3)
......
-- 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 function cancelInfusions(self)
local chants = {self.T_ACID_INFUSION, self.T_LIGHTNING_INFUSION, self.T_FROST_INFUSION}
for i, t in ipairs(chants) do
if self:isTalentActive(t) then
local old = self.energy.value
self.energy.value = 100000
self:useTalent(t)
self.energy.value = old
end
end
end
newTalent{
name = "Fire Infusion",
type = {"spell/infusion", 1},
mode = "passive",
require = spells_req1,
points = 5,
info = function(self, t)
return ([[When you throw your alchemist bombs you infuse them with explosive fire, increasing damage by %d%%.]]):format(self:getTalentLevel(t) * 5)
end,
}
newTalent{
name = "Acid Infusion",
type = {"spell/infusion", 2},
mode = "sustained",
require = spells_req2,
sustain_mana = 50,
points = 5,
cooldown = 30,
activate = function(self, t)
cancelInfusions(self)
game:playSoundNear(self, "talents/arcane")
return {
-- particle = self:addParticles(Particles.new("arcane_power", 1)),
}
end,
deactivate = function(self, t, p)
-- self:removeParticles(p.particle)
return true
end,
info = function(self, t)
return ([[When you throw your alchemist bombs you infuse them with explosive acid, increasing damage by %d%%.]]):format(self:getTalentLevel(t) * 5)
end,
}
newTalent{
name = "Lightning Infusion",
type = {"spell/infusion", 2},
mode = "sustained",
require = spells_req2,
sustain_mana = 50,
points = 5,
cooldown = 30,
activate = function(self, t)
cancelInfusions(self)
game:playSoundNear(self, "talents/arcane")
return {
-- particle = self:addParticles(Particles.new("arcane_power", 1)),
}
end,
deactivate = function(self, t, p)
-- self:removeParticles(p.particle)
return true
end,
info = function(self, t)
return ([[When you throw your alchemist bombs you infuse them with explosive acid, increasing damage by %d%%.]]):format(self:getTalentLevel(t) * 5)
end,
}
newTalent{
name = "Frost Infusion",
type = {"spell/infusion", 2},
mode = "sustained",
require = spells_req2,
sustain_mana = 50,
points = 5,
cooldown = 30,
activate = function(self, t)
cancelInfusions(self)
game:playSoundNear(self, "talents/arcane")
return {
-- particle = self:addParticles(Particles.new("arcane_power", 1)),
}
end,
deactivate = function(self, t, p)
-- self:removeParticles(p.particle)
return true
end,
info = function(self, t)
return ([[When you throw your alchemist bombs you infuse them with explosive acid, increasing damage by %d%%.]]):format(self:getTalentLevel(t) * 5)
end,
}
......@@ -76,3 +76,4 @@ load("/data/talents/spells/phantasm.lua")
load("/data/talents/spells/enhancement.lua")
load("/data/talents/spells/alchemy.lua")
load("/data/talents/spells/infusion.lua")
......@@ -31,7 +31,7 @@ newTalent{
action = function(self, t)
local duration = self:getTalentLevel(t) + 2
local radius = 3
local dam = self:combatTalentSpellDamage(t, 4, 70)
local dam = self:combatTalentSpellDamage(t, 4, 50)
local tg = {type="ball", range=self:getTalentRange(t), radius=radius}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
......@@ -50,7 +50,7 @@ newTalent{
end,
info = function(self, t)
return ([[Corrosive fumes rises from the ground doing %0.2f acid damage in a radius of 3 each turn for %d turns.
The damage and duration will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 4, 70), self:getTalentLevel(t) + 2)
The damage and duration will increase with the Magic stat]]):format(self:combatTalentSpellDamage(t, 4, 50), self:getTalentLevel(t) + 2)
end,
}
......
......@@ -46,7 +46,7 @@ newTalent{
type = {"technique/combat-training", 1},
mode = "passive",
points = 5,
require = { stat = { con=function(level) return 14 + level * 3 end }, },
require = { stat = { con=function(level) return 14 + level * 9 end }, },
on_learn = function(self, t)
self.max_life = self.max_life + 40
end,
......
......@@ -104,10 +104,10 @@ ActorLevel:defineMaxLevel(nil)
ActorLevel.exp_chart = function(level)
local exp = 10
local mult = 8
local min = 2
local min = 3
for i = 2, level do
exp = exp + level * mult
mult = util.bound(mult - 0.5, min, mult)
mult = util.bound(mult - 0.2, min, mult)
end
return math.ceil(exp)
end
......@@ -121,7 +121,8 @@ for i = 2, 50 do
print("level", i, "::", ActorLevel.exp_chart(i), "must kill", nb, "actors of same level; which is about ", znb, "zone levels")
end
print("total", tnb, "::", tznb)
]]
os.exit()
--]]
-- Factions
dofile("/data/factions.lua")
......
......@@ -628,7 +628,7 @@ int main(int argc, char *argv[])
switch(event.type)
{
case SDL_ACTIVEEVENT:
if ((event.active.state & SDL_APPACTIVE) || (event.active.state & SDL_APPINPUTFOCUS))
/* if ((event.active.state & SDL_APPACTIVE) || (event.active.state & SDL_APPINPUTFOCUS))
{
if (event.active.gain == 0)
isActive = FALSE;
......@@ -636,7 +636,7 @@ int main(int argc, char *argv[])
isActive = TRUE;
}
printf("SDL Activity %d\n", isActive);
break;
*/ break;
case SDL_VIDEORESIZE:
printf("resize %d x %d\n", event.resize.w, event.resize.h);
......
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