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

start additing Sun Paladin talents & class

git-svn-id: http://svn.net-core.org/repos/t-engine4@693 51575b47-30f0-44d4-a5cc-537603b46e54
parent 3194e8df
No related branches found
No related tags found
No related merge requests found
Showing
with 581 additions and 1 deletion
......@@ -675,7 +675,7 @@ function _M:displayEffects()
-- Dont bother with obviously out of screen stuff
if e.x + e.radius >= self.mx and e.x - e.radius < self.mx + self.viewport.mwidth and e.y + e.radius >= self.my and e.y - e.radius < self.my + self.viewport.mheight then
local grids
local s = self.tilesSurface:get(e.overlay.display, e.overlay.color_r, e.overlay.color_g, e.overlay.color_b, e.overlay.color_br, e.overlay.color_bg, e.overlay.color_bb, e.overlay.image, 120)
local s = self.tilesSurface:get(e.overlay.display, e.overlay.color_r, e.overlay.color_g, e.overlay.color_b, e.overlay.color_br, e.overlay.color_bg, e.overlay.color_bb, e.overlay.image, e.overlay.alpha)
-- Handle balls
if e.dir == 5 then
......
......@@ -324,6 +324,7 @@ function util.getval(val, ...)
end
function core.fov.circle_grids(x, y, radius, block)
if radius == 0 then return {[x]={[y]=true}} end
local grids = {}
core.fov.calc_circle(x, y, radius, function(_, lx, ly)
if not grids[lx] then grids[lx] = {} end
......@@ -340,6 +341,7 @@ function core.fov.circle_grids(x, y, radius, block)
end
function core.fov.beam_grids(x, y, radius, dir, angle, block)
if radius == 0 then return {[x]={[y]=true}} end
local grids = {}
core.fov.calc_beam(x, y, radius, dir, angle, function(_, lx, ly)
if not grids[lx] then grids[lx] = {} end
......
-- 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
newBirthDescriptor{
type = "class",
name = "Divine",
desc = {
"Divine.",
},
descriptor_choices =
{
subclass =
{
__ALL__ = "never",
['Sun Paladin'] = function() return profile.mod.allow_build.divine_sun_paladin and "allow" or "never" end,
},
},
copy = {
-- All mages are of angolwen faction
faction = "sunwall",
},
}
newBirthDescriptor{
type = "subclass",
name = "Sun Paladin",
desc = {
"Wohhha",
"Their most important stats are: Magic and Willpower",
},
stats = { mag=2, str=2, dex=2, },
talents_types = {
["divine/sun"]={true, 0.3},
["divine/chants"]={true, 0.3},
["divine/glyphs"]={true, 0.3},
["divine/combat"]={true, 0.3},
["divine/light"]={true, 0.3},
},
talents = {
},
copy = {
max_life = 110,
life_rating = 12,
resolvers.equip{ id=true,
{type="weapon", subtype="mace", name="iron mace", autoreq=true},
{type="armor", subtype="massive", name="iron plate armour", autoreq=true}
},
},
}
......@@ -128,3 +128,4 @@ load("/data/birth/classes/archer.lua")
load("/data/birth/classes/rogue.lua")
load("/data/birth/classes/mage.lua")
load("/data/birth/classes/wilder.lua")
load("/data/birth/classes/divine.lua")
......@@ -37,6 +37,10 @@ newBirthDescriptor{
Vampire = function() return profile.mod.allow_build.undead_vampire and "allow" or "never" end,
Wight = function() return profile.mod.allow_build.undead_wight and "allow" or "never" end,
},
class =
{
Divine = "never",
},
},
copy = {
faction = "players",
......
......@@ -47,6 +47,7 @@ newBirthDescriptor{
{
__ALL__ = "allow",
Mage = function() return profile.mod.allow_build.mage and "allow" or "never" end,
Divine = function() return profile.mod.allow_build.divine and "allow" or "never" end,
Wilder = function() return (
profile.mod.allow_build.wilder_summoner or
profile.mod.allow_build.wilder_wyrmic
......
-- 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
return { generator = function()
local ad = rng.range(0, 360)
local a = math.rad(ad)
local dir = math.rad(ad + 90)
local r = rng.range(12, 20)
local dirv = math.rad(1)
return {
trail = 1,
life = 10,
size = 4, sizev = -0.1, sizea = 0,
x = r * math.cos(a), xv = -0.1, xa = 0,
y = r * math.sin(a), yv = -0.1, ya = 0,
dir = dir, dirv = dirv, dira = 0,
vel = 1, velv = 0, vela = 0,
r = rng.range(220, 255)/255, rv = 0, ra = 0,
g = rng.range(200, 230)/255, gv = 0, ga = 0,
b = 0, bv = 0, ba = 0,
a = rng.range(25, 220)/255, av = 0, aa = 0,
}
end, },
function(self)
self.ps:emit(10)
end,
100
-- 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
return { generator = function()
local ad = rng.range(0, 360)
local a = math.rad(ad)
local dir = math.rad(ad + 180)
local r = rng.range(12, 20)
return {
trail = 1,
life = 10,
size = 4, sizev = 0.08, sizea = 0,
x = r * math.cos(a), xv = 0, xa = 0,
y = r * math.sin(a), yv = 0, ya = 0,
dir = dir, dirv = math.rad(3), dira = math.rad(3) / 3,
vel = 1.4, velv = 0, vela = 0,
r = rng.range(220, 255)/255, rv = 0, ra = 0,
g = rng.range(200, 230)/255, gv = 0, ga = 0,
b = 0, bv = 0, ba = 0,
a = rng.range(25, 220)/255, av = 0, aa = 0,
}
end, },
function(self)
self.nb = (self.nb or 0) + 1
if self.nb < 4 then
self.ps:emit(20)
end
end,
800
-- 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
-- Make the ray
local ray = {}
local tiles = math.ceil(math.sqrt(tx*tx+ty*ty))
local tx = tx * engine.Map.tile_w
local ty = ty * engine.Map.tile_h
local breakdir = math.rad(rng.range(-8, 8))
ray.dir = math.atan2(ty, tx)
ray.size = math.sqrt(tx*tx+ty*ty)
-- Populate the beam based on the forks
return { generator = function()
local a = ray.dir
local rad = rng.range(-3,3)
local ra = math.rad(rad)
local r = rng.range(1, ray.size)
return {
life = 8,
size = 4, sizev = -0.2, sizea = 0,
x = r * math.cos(a) + 2 * math.cos(ra), xv = 0, xa = 0,
y = r * math.sin(a) + 2 * math.sin(ra), yv = 0, ya = 0,
dir = rng.percent(50) and ray.dir + math.rad(90) or ray.dir - math.rad(90), dirv = 0, dira = 0,
vel = rng.percent(80) and 1 or 0, velv = 0, vela = 0,
r = rng.range(220, 255)/255, rv = 0, ra = 0,
g = rng.range(200, 230)/255, gv = -0.04, ga = 0,
b = 0, bv = 0, ba = 0,
a = rng.range(25, 220)/255, av = 0, aa = 0,
}
end, },
function(self)
self.nb = (self.nb or 0) + 1
if self.nb < 4 then
self.ps:emit(100*tiles)
end
end,
8*100*tiles
......@@ -22,5 +22,6 @@ load("/data/talents/techniques/techniques.lua")
load("/data/talents/cunning/cunning.lua")
load("/data/talents/spells/spells.lua")
load("/data/talents/gifts/gifts.lua")
load("/data/talents/divine/divine.lua")
load("/data/talents/corruptions/corruptions.lua")
load("/data/talents/undeads/undeads.lua")
-- 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 cancelChants(self)
local chants = {self.T_CHANT_OF_FORTITUDE, self.T_CHANT_OF_FORTRESS, self.T_CHANT_OF_RESISTANCE, self.T_CHANT_OF_LIGHT}
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 = "Chant of Fortitude",
type = {"divine/chants", 1},
mode = "sustained",
require = divi_req1,
points = 5,
cooldown = 30,
tactical = {
BUFF = 10,
},
range = 20,
activate = function(self, t)
cancelChants(self)
local power = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.12)
game:playSoundNear(self, "talents/spell_generic2")
local ret = {
phys = self:addTemporaryValue("combat_physresist", power),
spell = self:addTemporaryValue("combat_spellresist", power),
particle = self:addParticles(Particles.new("golden_shield", 1))
}
return ret
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("combat_physresist", p.phys)
self:removeTemporaryValue("combat_spellresist", p.spell)
return true
end,
info = function(self, t)
return ([[Chant the glory of the sun, granting you %d physical and spell resistance.
You may only have one Chant active at once.
The resistance will increase with the Magic stat]]):format(5 + self:getTalentLevel(t) * self:combatSpellpower(0.12))
end,
}
newTalent{
name = "Chant of Fortress",
type = {"divine/chants", 2},
mode = "sustained",
require = divi_req2,
points = 5,
cooldown = 30,
tactical = {
BUFF = 10,
},
range = 20,
activate = function(self, t)
cancelChants(self)
local power = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.08)
game:playSoundNear(self, "talents/spell_generic2")
local ret = {
phys = self:addTemporaryValue("resists", {[DamageType.PHYSICAL] = power}),
particle = self:addParticles(Particles.new("golden_shield", 1))
}
return ret
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("resists", p.phys)
return true
end,
info = function(self, t)
return ([[Chant the glory of the sun, granting you %d%% physical damage resistance.
You may only have one Chant active at once.
The resistance will increase with the Magic stat]]):format(5 + self:getTalentLevel(t) * self:combatSpellpower(0.08))
end,
}
newTalent{
name = "Chant of Resistance",
type = {"divine/chants",3},
mode = "sustained",
require = divi_req3,
points = 5,
cooldown = 30,
tactical = {
BUFF = 10,
},
range = 20,
activate = function(self, t)
cancelChants(self)
local power = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.08)
game:playSoundNear(self, "talents/spell_generic2")
local ret = {
res = self:addTemporaryValue("resists", {
[DamageType.FIRE] = power,
[DamageType.LIGHTNING] = power,
[DamageType.ACID] = power,
[DamageType.COLD] = power,
}),
particle = self:addParticles(Particles.new("golden_shield", 1))
}
return ret
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("resists", p.res)
return true
end,
info = function(self, t)
return ([[Chant the glory of the sun, granting you %d%% elemental resistances.
You may only have one Chant active at once.
The resistance will increase with the Magic stat]]):format(5 + self:getTalentLevel(t) * self:combatSpellpower(0.08))
end,
}
newTalent{
name = "Chant of Light",
type = {"divine/chants", 4},
mode = "sustained",
require = divi_req4,
points = 5,
cooldown = 30,
tactical = {
BUFF = 10,
},
range = 20,
activate = function(self, t)
cancelChants(self)
local power = 10 + self:getTalentLevel(t) * self:combatSpellpower(0.10)
game:playSoundNear(self, "talents/spell_generic2")
local ret = {
phys = self:addTemporaryValue("inc_damage", {[DamageType.LIGHT] = power}),
particle = self:addParticles(Particles.new("golden_shield", 1))
}
return ret
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("inc_damage", p.phys)
return true
end,
info = function(self, t)
return ([[Chant the glory of the sun, granting you %d%% more light damage.
You may only have one Chant active at once.
The damage will increase with the Magic stat]]):format(10 + self:getTalentLevel(t) * self:combatSpellpower(0.10))
end,
}
-- 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
-- Corruptions
newTalentType{ type="divine/chants", name = "chants", description = "Chant the glory of the sun." }
newTalentType{ type="divine/light", name = "light", description = "Invoke the power of light to heal and mend." }
newTalentType{ type="divine/combat", name = "combat", description = "Your devotion allows you to combat your foes with indomitable determination." }
newTalentType{ type="divine/sun", name = "sun", description = "Summon the power of the Sun to burn your foes." }
newTalentType{ type="divine/glyphs", name = "glyphs", description = "Bind the holy powers into glyphs to trap your foes." }
-- Generic requires for corruptions based on talent level
divi_req1 = {
stat = { mag=function(level) return 12 + (level-1) * 2 end },
level = function(level) return 0 + (level-1) end,
}
divi_req2 = {
stat = { mag=function(level) return 20 + (level-1) * 2 end },
level = function(level) return 4 + (level-1) end,
}
divi_req3 = {
stat = { mag=function(level) return 28 + (level-1) * 2 end },
level = function(level) return 8 + (level-1) end,
}
divi_req4 = {
stat = { mag=function(level) return 36 + (level-1) * 2 end },
level = function(level) return 12 + (level-1) end,
}
divi_req5 = {
stat = { mag=function(level) return 44 + (level-1) * 2 end },
level = function(level) return 16 + (level-1) end,
}
load("/data/talents/divine/chants.lua")
load("/data/talents/divine/sun.lua")
-- 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
newTalent{
name = "Searing Light",
type = {"divine/sun", 1},
require = divi_req1,
points = 5,
cooldown = 9,
tactical = {
ATTACK = 10,
},
range = 10,
reflectable = true,
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t), talent=t}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:project(tg, x, y, DamageType.LIGHT, self:spellCrit(6 + self:combatSpellpower(0.3) * self:getTalentLevel(t)), {type="light"})
local _ _, x, y = self:canProject(tg, x, y)
-- Add a lasting map effect
game.level.map:addEffect(self,
x, y, 4,
DamageType.LIGHT, 6 + self:combatSpellpower(0.2) * self:getTalentLevel(t),
0,
5, nil,
engine.Entity.new{alpha=30, display='', color_br=255, color_bg=215, color_bb=0},
nil, self:spellFriendlyFire()
)
game:playSoundNear(self, "talents/flame")
return true
end,
info = function(self, t)
return ([[Calls the power of the Sun into a searing light doing %0.2f damage and leaving a spot on the ground for 4 turns doing %0.2f damage.
The damage will increase with the Magic stat]]):format(6 + self:combatSpellpower(0.3) * self:getTalentLevel(t), 6 + self:combatSpellpower(0.2) * self:getTalentLevel(t))
end,
}
newTalent{
name = "Sun Flare",
type = {"divine/sun", 2},
require = divi_req2,
points = 5,
cooldown = 22,
tactical = {
ATTACK = 10,
},
range = 6,
action = function(self, t)
local tg = {type="ball", range=0, friendlyfire=true, radius=5 + self:getTalentLevel(t), talent=t}
tg.friendlyfire = false
self:project(tg, self.x, self.y, DamageType.BLIND, 3 + self:getTalentLevel(t))
self:project(tg, self.x, self.y, DamageType.LITE, 1)
if self:getTalentLevel(t) then
self:project(tg, self.x, self.y, DamageType.LIGHT, 4 + self:combatSpellpower(0.1) * self:getTalentLevel(t))
end
game:playSoundNear(self, "talents/flame")
return true
end,
info = function(self, t)
return ([[Invokes a sun flare, blinding your foes and lighting up your immediate area.
At level 3 it will start dealing %0.2f light damage.
The damage will increase with the Magic stat]]):
format(
4 + self:combatSpellpower(0.1) * self:getTalentLevel(t)
)
end,
}
newTalent{
name = "Firebeam",
type = {"divine/sun",3},
require = divi_req3,
points = 5,
cooldown = 10,
tactical = {
ATTACK = 10,
},
range = 10,
action = function(self, t)
local tg = {type="beam", range=self:getTalentRange(t), talent=t}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:project(tg, x, y, DamageType.FIRE, self:spellCrit(10 + self:combatSpellpower(0.2) * self:getTalentLevel(t)))
local _ _, x, y = self:canProject(tg, x, y)
game.level.map:particleEmitter(self.x, self.y, math.max(math.abs(x-self.x), math.abs(y-self.y)), "light_beam", {tx=x-self.x, ty=y-self.y})
game:playSoundNear(self, "talents/flame")
return true
end,
info = function(self, t)
return ([[Fire a beam of sun flames at your foes, burning all those in line for %0.2f light damage.
The damage will increase with the Magic stat]]):
format(10 + self:combatSpellpower(0.2) * self:getTalentLevel(t))
end,
}
newTalent{
name = "Sunburst",
type = {"divine/sun", 4},
require = divi_req4,
points = 5,
cooldown = 35,
tactical = {
ATTACKAREA = 10,
},
range = 3,
action = function(self, t)
local tg = {type="ball", range=0, radius=3, friendlyfire=false, talent=t}
self:project(tg, self.x, self.y, DamageType.LIGHT, self:spellCrit(10 + self:combatSpellpower(0.17) * self:getTalentLevel(t)), {type="light"})
game:playSoundNear(self, "talents/fireflash")
return true
end,
info = function(self, t)
return ([[Conjures a furious burst of sunlight, dealing %0.2f light damage to all those around you in a radius of 3.
The damage will increase with the Magic stat]]):format(self:getTalentLevel(t), 10 + self:combatSpellpower(0.17) * self:getTalentLevel(t))
end,
}
No preview for this file type
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