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

New class: Tempest (not unlockable yet)

git-svn-id: http://svn.net-core.org/repos/t-engine4@1492 51575b47-30f0-44d4-a5cc-537603b46e54
parent afd35d88
No related branches found
No related tags found
No related merge requests found
......@@ -104,7 +104,7 @@ function _M:display()
local o = a:findInAllInventories(ts[1], {no_add_name=true, force_id=true, no_count=true})
local cnt = 0
if o then cnt = o:getNumber() end
txt = ("%s (%d)"):format(o:getName{no_count=true}, cnt)
txt = ("%s (%d)"):format(o and o:getName{no_count=true} or ts[1], cnt)
if cnt == 0 then
color = {128,128,128}
end
......
......@@ -32,7 +32,7 @@ function _M:restInit(turns, what, past, on_end)
past = past,
on_end = on_end,
cnt = 1,
dialog = Dialog:simplePopup(what:capitalize().."...", "You are "..what..", press any key to stop.", function()
dialog = Dialog:simplePopup(what:capitalize().."...", "You are "..what..", press Enter to stop.", function()
self:restStop()
end),
}
......
......@@ -260,7 +260,12 @@ newBirthDescriptor{
type = "subclass",
name = "Tempest",
desc = {
"Bzzzzt!",
"A Tempest is an archmage specialized in lightning magic.",
"They gain access to the special Storm talents whose main purpose is to make electrocute everything in sight.",
"They can even learn to pierce through lightning resistance and immunity.",
"Most archmagi lack basic skills that others take for granted (like general fighting sense), but they make up for it by their raw magical power.",
"Archmagi know all schools of magic but the more intricate (Temporal and Meta) from the start. They however usually refuse to have anything to do with Necromancy.",
"All archmagi have been trained in the secret town of Angolwen and posses a unique spell to teleport to it directly.",
"Their most important stats are: Magic and Willpower",
"#GOLD#Stats modifiers:",
"#LIGHT_BLUE# * +0 Strength, +0 Dexterity, +0 Constitution",
......
......@@ -420,11 +420,16 @@ newDamageType{
newDamageType{
name = "lightning daze", type = "LIGHTNING_DAZE",
projector = function(src, x, y, type, dam)
DamageType:get(DamageType.LIGHTNING).projector(src, x, y, DamageType.LIGHTNING, dam)
if _G.type(dam) == "number" then dam = {dam=dam, daze=25} end
DamageType:get(DamageType.LIGHTNING).projector(src, x, y, DamageType.LIGHTNING, dam.dam)
local target = game.level.map(x, y, Map.ACTOR)
if target and rng.percent(25) then
if target and rng.percent(dam.daze) then
if target:checkHit(src:combatSpellpower(), target:combatSpellResist(), 0, 95, 15) and target:canBe("stun") then
target:setEffect(target.EFF_DAZED, 3, {src=src})
if src:isTalentActive(src.T_HURRICANE) then
local t = src:getTalentFromId(src.T_HURRICANE)
t.do_hurricane(src, t, target)
end
else
game.logSeen(target, "%s resists!", target.name:capitalize())
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
return { generator = function()
local ad = rng.range(0, 360)
local a = math.rad(ad)
local dir = math.rad(ad)
local r = rng.range(8, 12)
return {
life = 7, trail = 1,
size = 3, sizev = -0.05, sizea = 0,
x = r * math.cos(a), xv = 0, xa = 0,
y = r * math.sin(a), yv = 0, ya = 0,
dir = dir, dirv = 0.1, dira = 0,
vel = 1, velv = 0.3, vela = 0.05,
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)
self.ps:emit(4)
end,
80
......@@ -23,24 +23,41 @@ newTalent{
require = spells_req1,
points = 5,
mana = 12,
cooldown = 3,
cooldown = 8,
tactical = {
ATTACK = 10,
ATTACKAREA = 10,
DEFEND = 4,
},
range = 20,
reflectable = true,
direct_hit = true,
range = function(self, t) return math.floor(2 + self:getTalentLevel(t) * 0.7) end,
action = function(self, t)
local tg = {type="ball", range=0, radius=self:getTalentRange(t), friendlyfire=false, talent=t}
local dam = self:spellCrit(self:combatTalentSpellDamage(t, 28, 170))
self:project(tg, self.x, self.y, DamageType.LIGHTNING_DAZE, rng.avg(dam / 3, dam, 3))
local x, y = self.x, self.y
-- Lightning ball gets a special treatment to make it look neat
local sradius = (tg.radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local nb_forks = 16
local angle_diff = 360 / nb_forks
for i = 0, nb_forks - 1 do
local a = math.rad(rng.range(0+i*angle_diff,angle_diff+i*angle_diff))
local tx = x + math.floor(math.cos(a) * tg.radius)
local ty = y + math.floor(math.sin(a) * tg.radius)
game.level.map:particleEmitter(x, y, tg.radius, "lightning", {radius=tg.radius, grids=grids, tx=tx-x, ty=ty-y, nb_particles=25, life=8})
end
game:playSoundNear(self, "talents/lightning")
return true
end,
info = function(self, t)
return ([[Conjures up a bolt of fire, setting the target ablaze and doing %0.2f fire damage over 3 turns.
The damage will increase with the Magic stat]]):format(damDesc(self, DamageType.LIGHTNING, self:combatTalentSpellDamage(t, 25, 290)))
local dam = damDesc(self, DamageType.LIGHTNING, self:combatTalentSpellDamage(t, 28, 170))
return ([[A lightning emanates from you in a circual wave, doing %0.2f to %0.2f lightning damage and possibly dazing them.
The damage will increase with the Magic stat]]):format(dam / 3, dam)
end,
}
newTalent{
name = "???1",
name = "Shock",
type = {"spell/storm",2},
require = spells_req2,
points = 5,
......@@ -52,34 +69,53 @@ newTalent{
range = 20,
reflectable = true,
action = function(self, t)
game:playSoundNear(self, "talents/lightning")
local tg = {type="bolt", range=self:getTalentRange(t), talent=t, display={particle="bolt_lightning", trail="lightningtrail"}}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
local dam = self:combatTalentSpellDamage(t, 25, 200)
self:projectile(tg, x, y, DamageType.LIGHTNING_DAZE, {daze=100, dam=self:spellCrit(rng.avg(dam / 3, dam, 3))}, {type="lightning_explosion"})
game:playSoundNear(self, "talents/fire")
return true
end,
info = function(self, t)
return ([[Conjures up a bolt of fire, setting the target ablaze and doing %0.2f fire damage over 3 turns.
The damage will increase with the Magic stat]]):format(damDesc(self, DamageType.LIGHTNING, self:combatTalentSpellDamage(t, 25, 290)))
return ([[Conjures up a bolt of lightning, doing %0.2f lightning damage and dazing the target.
The damage will increase with the Magic stat]]):format(damDesc(self, DamageType.LIGHTNING, self:combatTalentSpellDamage(t, 25, 200)))
end,
}
newTalent{
name = "???2",
name = "Hurricane",
type = {"spell/storm",3},
require = spells_req3,
points = 5,
mana = 12,
cooldown = 3,
mode = "sustained",
sustain_mana = 100,
cooldown = 30,
tactical = {
ATTACK = 10,
ATTACKAREA = 10,
},
range = 20,
reflectable = true,
action = function(self, t)
game:playSoundNear(self, "talents/lightning")
direct_hit = true,
do_hurricane = function(self, t, target)
if not rng.percent(30 + self:getTalentLevel(t) * 5) then return end
local rad = 2
if self:getTalentLevel(t) >= 3 then rad = 3 end
target:setEffect(target.EFF_HURRICANE, 10, {src=self, dam=self:combatTalentSpellDamage(t, 25, 150), radius=rad})
game:playSoundNear(self, "talents/thunderstorm")
end,
activate = function(self, t)
return {}
end,
deactivate = function(self, t, p)
return true
end,
info = function(self, t)
return ([[Conjures up a bolt of fire, setting the target ablaze and doing %0.2f fire damage over 3 turns.
The damage will increase with the Magic stat]]):format(damDesc(self, DamageType.LIGHTNING, self:combatTalentSpellDamage(t, 25, 290)))
local dam = damDesc(self, DamageType.LIGHTNING, self:combatTalentSpellDamage(t, 25, 150))
return ([[Each time one of your lightning spell dazes a target it has %d%% chances to creates a chain reaction that summons a mighty Hurricane around the target.
Each turn all creatures around it will take %0.2f to %0.2f lightning damage.
Only 2 hurricanes can exist at the same time.
The damage will increase with the Magic stat]]):format(30 + self:getTalentLevel(t) * 5, dam / 3, dam)
end,
}
......@@ -88,19 +124,25 @@ newTalent{
type = {"spell/storm",4},
require = spells_req4,
points = 5,
mana = 12,
cooldown = 3,
tactical = {
ATTACK = 10,
},
range = 20,
reflectable = true,
action = function(self, t)
game:playSoundNear(self, "talents/lightning")
mode = "sustained",
sustain_mana = 80,
cooldown = 30,
activate = function(self, t)
game:playSoundNear(self, "talents/thunderstorm")
return {
dam = self:addTemporaryValue("inc_damage", {[DamageType.LIGHTNING] = self:getTalentLevelRaw(t) * 2}),
resist = self:addTemporaryValue("resists_pen", {[DamageType.LIGHTNING] = self:getTalentLevelRaw(t) * 10}),
particle = self:addParticles(Particles.new("tempest", 1)),
}
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("inc_damage", p.dam)
self:removeTemporaryValue("resists_pen", p.resist)
return true
end,
info = function(self, t)
return ([[Conjures up a bolt of fire, setting the target ablaze and doing %0.2f fire damage over 3 turns.
The damage will increase with the Magic stat]]):format(damDesc(self, DamageType.LIGHTNING, self:combatTalentSpellDamage(t, 25, 290)))
return ([[Surround yourself with a Tempest, increasing all your lightning damage by %d%% and ignoring %d%% lightning resistance of your targets.]])
:format(self:getTalentLevelRaw(t) * 2, self:getTalentLevelRaw(t) * 10)
end,
}
......@@ -1626,10 +1626,38 @@ newEffect{
self._mo:invalidate()
game.level.map:updateMap(self.x, self.y)
end
eff.life_regen = self:removeTemporaryValue("life_regen", eff.life_regen)
eff.mana_regen = self:removeTemporaryValue("mana_regen", eff.mana_regen)
eff.never_move = self:removeTemporaryValue("never_move", eff.never_move)
eff.silence = self:removeTemporaryValue("silence", eff.silence)
self:removeTemporaryValue("life_regen", eff.life_regen)
self:removeTemporaryValue("mana_regen", eff.mana_regen)
self:removeTemporaryValue("never_move", eff.never_move)
self:removeTemporaryValue("silence", eff.silence)
self.combat = eff.combat
end,
}
newEffect{
name = "HURRICANE",
desc = "Hurricane",
type = "magical",
status = "detrimental",
parameters = { dam=10, radius=2 },
on_gain = function(self, err) return "#Target# is caught inside a Hurricane.", "+Hurricane" end,
on_lose = function(self, err) return "The Hurricane arround #Target# dissipates.", "-Hurricane" end,
on_timeout = function(self, eff)
local tg = {type="ball", range=0, radius=eff.radius, friendlyfire=false}
local dam = eff.dam
eff.src:project(tg, self.x, self.y, DamageType.LIGHTNING, rng.avg(dam / 3, dam, 3))
local x, y = self.x, self.y
-- Lightning ball gets a special treatment to make it look neat
local sradius = (tg.radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local nb_forks = 16
local angle_diff = 360 / nb_forks
for i = 0, nb_forks - 1 do
local a = math.rad(rng.range(0+i*angle_diff,angle_diff+i*angle_diff))
local tx = x + math.floor(math.cos(a) * tg.radius)
local ty = y + math.floor(math.sin(a) * tg.radius)
game.level.map:particleEmitter(x, y, tg.radius, "lightning", {radius=tg.radius, grids=grids, tx=tx-x, ty=ty-y, nb_particles=25, life=8})
end
game:playSoundNear(self, "talents/lightning")
end,
}
No preview for this file type
No preview for this file type
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