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

sun paladins

git-svn-id: http://svn.net-core.org/repos/t-engine4@704 51575b47-30f0-44d4-a5cc-537603b46e54
parent d369c3c3
No related branches found
No related tags found
No related merge requests found
Showing with 186 additions and 74 deletions
......@@ -29,6 +29,11 @@ newBirthDescriptor{
Arda = "allow",
["Spydrë"] = function() return profile.mod.allow_build.world_spydre and "allow" or "never" end,
},
subclass =
{
-- Nobdoy can be a sun paladin but humans & elves
['Sun Paladin'] = "never",
},
},
talents = {},
experience = 1.0,
......
......@@ -36,6 +36,10 @@ newBirthDescriptor{
Avari = "allow",
__ALL__ = "never",
},
subclass =
{
['Sun Paladin'] = "allow",
},
},
talents = {
-- [ActorTalents.T_IMPROVED_MANA_I]=1,
......
......@@ -36,6 +36,10 @@ newBirthDescriptor{
Beorning = "allow",
__ALL__ = "never",
},
subclass =
{
['Sun Paladin'] = "allow",
},
},
talents = {},
experience = 1.0,
......
......@@ -67,6 +67,10 @@ setDefaultProjector(function(src, x, y, type, dam)
game.flyers:add(sx, sy, 30, (rng.range(0,2)-1) * 0.5, -3, tostring(-math.ceil(dam)), {255,0,0})
end
end
if src:attr("martyrdom") then
DamageType.defaultProjector(target, src.x, src.y, type, dam * src.martyrdom / 100)
end
return dam
end
return 0
......
-- 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 Talents = require("engine.interface.ActorTalents")
newEntity{
define_as = "BASE_NPC_HUMAN_TOWN",
type = "humanoid", subtype = "human",
display = "p", color=colors.WHITE,
faction = "sunwall",
combat = { dam=resolvers.rngavg(1,2), atk=2, apr=0, dammod={str=0.4} },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, QUIVER=1 },
resolvers.drops{chance=20, nb=1, {} },
life_rating = 10,
rank = 2,
size_category = 3,
open_door = true,
autolevel = "warrior",
ai = "dumb_talented_simple", ai_state = { talent_in=3, },
energy = { mod=1 },
stats = { str=12, dex=8, mag=6, con=10 },
}
newEntity{ base = "BASE_NPC_HUMAN_TOWN",
name = "human guard", color=colors.LIGHT_UMBER,
desc = [[A stern looking guard, he will not let you disturb the town.]],
level_range = {1, 50}, exp_worth = 1,
rarity = 4,
max_life = resolvers.rngavg(70,80),
resolvers.equip{
{type="weapon", subtype="longsword", autoreq=true},
{type="armor", subtype="shield", autoreq=true},
},
combat_armor = 2, combat_def = 0,
resolvers.talents{ [Talents.T_RUSH]=1, [Talents.T_PERFECT_STRIKE]=1, },
}
newEntity{ base = "BASE_NPC_HUMAN_TOWN",
name = "human archer", color=colors.UMBER,
desc = [[A stern looking guard, he will not let you disturb the town.]],
level_range = {1, 50}, exp_worth = 1,
rarity = 7,
max_life = resolvers.rngavg(50,60),
resolvers.talents{ [Talents.T_SHOOT]=1, },
ai_state = { talent_in=2, },
autolevel = "archer",
resolvers.equip{ {type="weapon", subtype="longbow", autoreq=true}, {type="ammo", subtype="arrow", autoreq=true} },
}
......@@ -43,8 +43,10 @@ newTalent{
activate = function(self, t)
cancelChants(self)
local power = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.12)
local dam = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07)
game:playSoundNear(self, "talents/spell_generic2")
local ret = {
onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.LIGHT]=dam}),
phys = self:addTemporaryValue("combat_physresist", power),
spell = self:addTemporaryValue("combat_spellresist", power),
particle = self:addParticles(Particles.new("golden_shield", 1))
......@@ -53,14 +55,16 @@ newTalent{
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("on_melee_hit", p.onhit)
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.
In addition it surrounds you with a shield of light, damaging anythnig that attacks you for %0.2f light damage.
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))
The resistance and damage will increase with the Magic stat]]):format(5 + self:getTalentLevel(t) * self:combatSpellpower(0.12), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07))
end,
}
......@@ -78,8 +82,10 @@ newTalent{
activate = function(self, t)
cancelChants(self)
local power = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.08)
local dam = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07)
game:playSoundNear(self, "talents/spell_generic2")
local ret = {
onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.LIGHT]=dam}),
phys = self:addTemporaryValue("resists", {[DamageType.PHYSICAL] = power}),
particle = self:addParticles(Particles.new("golden_shield", 1))
}
......@@ -87,13 +93,15 @@ newTalent{
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("on_melee_hit", p.onhit)
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.
In addition it surrounds you with a shield of light, damaging anythnig that attacks you for %0.2f light damage.
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))
The resistance and damage will increase with the Magic stat]]):format(5 + self:getTalentLevel(t) * self:combatSpellpower(0.08), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07))
end,
}
......@@ -111,8 +119,10 @@ newTalent{
activate = function(self, t)
cancelChants(self)
local power = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.08)
local dam = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07)
game:playSoundNear(self, "talents/spell_generic2")
local ret = {
onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.LIGHT]=dam}),
res = self:addTemporaryValue("resists", {
[DamageType.FIRE] = power,
[DamageType.LIGHTNING] = power,
......@@ -125,13 +135,15 @@ newTalent{
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("on_melee_hit", p.onhit)
self:removeTemporaryValue("resists", p.res)
return true
end,
info = function(self, t)
return ([[Chant the glory of the sun, granting you %d%% elemental resistances.
In addition it surrounds you with a shield of light, damaging anythnig that attacks you for %0.2f light damage.
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))
The resistance and damage will increase with the Magic stat]]):format(5 + self:getTalentLevel(t) * self:combatSpellpower(0.08), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07))
end,
}
......@@ -149,8 +161,10 @@ newTalent{
activate = function(self, t)
cancelChants(self)
local power = 10 + self:getTalentLevel(t) * self:combatSpellpower(0.10)
local dam = 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07)
game:playSoundNear(self, "talents/spell_generic2")
local ret = {
onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.LIGHT]=dam}),
phys = self:addTemporaryValue("inc_damage", {[DamageType.LIGHT] = power}),
particle = self:addParticles(Particles.new("golden_shield", 1))
}
......@@ -158,12 +172,14 @@ newTalent{
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("on_melee_hit", p.onhit)
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.
In addition it surrounds you with a shield of light, damaging anythnig that attacks you for %0.2f 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))
The damage will increase with the Magic stat]]):format(10 + self:getTalentLevel(t) * self:combatSpellpower(0.10), 5 + self:getTalentLevel(t) * self:combatSpellpower(0.07))
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
newTalent{
name = "Weapon of Light",
type = {"divine/combat", 1},
require = divi_req1,
points = 5,
cooldown = 30,
tactical = {
BUFF = 10,
},
range = 20,
activate = function(self, t)
local dam = 7 + self:getTalentLevel(t) * self:combatSpellpower(0.092)
game:playSoundNear(self, "talents/spell_generic2")
local ret = {
onhit = self:addTemporaryValue("melee_project", {[DamageType.LIGHT]=dam}),
}
return ret
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("melee_project", p.onhit)
return true
end,
info = function(self, t)
return ([[Infuse your weapon of the power of the Sun, doing %0.2f light damage with each hit.
The damage will increase with the Magic stat]]):format(8 + self:combatSpellpower(0.092) * self:getTalentLevel(t))
end,
}
newTalent{
name = "Martyrdom",
type = {"divine/combat", 2},
require = divi_req2,
points = 5,
cooldown = 22,
tactical = {
ATTACK = 10,
},
range = 6,
reflectable = true,
action = function(self, t)
local tg = {type="bolt", range=self:getTalentRange(t), talent=t}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
local _ _, x, y = self:canProject(tg, x, y)
game:playSoundNear(self, "talents/spell_generic")
local target = game.level.map(x, y, Map.ACTOR)
if target then
target:setEffect(self.EFF_MARTYRDOM, 10, {power=8 * self:getTalentLevelRaw(t)})
end
return true
end,
info = function(self, t)
return ([[
The damage percent will increase with the Magic stat]]):
format(
4 + self:combatSpellpower(0.1) * self:getTalentLevel(t)
)
end,
}
newTalent{
name = "Wave of Power",
type = {"divine/combat",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 = "Rune of Peace",
type = {"divine/combat", 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}
local grids = self:project(tg, self.x, self.y, DamageType.LIGHT, self:spellCrit(10 + self:combatSpellpower(0.17) * self:getTalentLevel(t)))
game.level.map:particleEmitter(self.x, self.y, tg.radius, "sunburst", {radius=tg.radius, grids=grids, tx=self.x, ty=self.y})
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,
}
......@@ -48,3 +48,4 @@ divi_req5 = {
load("/data/talents/divine/chants.lua")
load("/data/talents/divine/sun.lua")
load("/data/talents/divine/combat.lua")
......@@ -704,3 +704,19 @@ newEffect{
self:removeTemporaryValue("combat_dam", eff.tmpid)
end,
}
newEffect{
name = "MARTYRDOM",
desc = "Martyrdom",
type = "magical",
status = "detrimental",
parameters = { power=10 },
on_gain = function(self, err) return "#Target# is a martyr.", "+Martyr" end,
on_lose = function(self, err) return "#Target# is no more influenced by martyrdom.", "-Martyr" end,
activate = function(self, eff)
eff.tmpid = self:addTemporaryValue("martyrdom", eff.power)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("martyrdom", eff.tmpid)
end,
}
......@@ -17,4 +17,4 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
load("/data/general/npcs/human-town.lua")
load("/data/general/npcs/sunwall-town.lua")
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