Note: Still a work in progress. Currently complete up to "action".
newTalent{
name = "Manathrust",
type = {"spell/arcane", 2},
require = spells_req2,
points = 5,
random_ego = "attack",
mana = 10,
cooldown = 3,
tactical = { ATTACK = { ARCANE = 2 } },
range = 10,
direct_hit = function(self, t)
if self:getTalentLevel(t) >= 3 then
return true
else
return false
end
end,
direct_hit = function(self, t) if self:getTalentLevel(t) >= 3 then return true else return false end end,
reflectable = true,
proj_speed = 20,
requires_target = true,
target = function(self, t)
local tg = {type="bolt" "hit" "beam" "ball" "cone", range=self:getTalentRange(t), talent=t, radius=1, selffire=true, friendlyfire=true, block_path=???, block_radius=???}
if self:getTalentLevel(t) >= 3 then tg.type = "beam" end
return tg
end,
getDamage = function(self, t) return self:combatTalentSpellDamage(t, 20, 230, nil) end,
action = function(self, t)
local tg = self:getTalentTarget(t)
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:project(tg, x, y, DamageType.ARCANE, self:spellCrit(t.getDamage(self, t)), nil)
local _ _, x, y = self:canProject(tg, x, y)
if tg.type == "beam" then
game.level.map:particleEmitter(self.x, self.y, math.max(math.abs(x-self.x), math.abs(y-self.y)), "mana_beam", {tx=x-self.x, ty=y-self.y})
else
game.level.map:particleEmitter(x, y, 1, "manathrust")
end
game:playSoundNear(self, "talents/arcane")
return true
end,
info = function(self, t)
local damage = t.getDamage(self, t)
return ([[Conjures up mana into a powerful bolt doing %0.2f arcane damage.
At level 3 it becomes a beam.
The damage will increase with your Spellpower.]]):
format(damDesc(self, DamageType.ARCANE, damage))
end,
}
Talent comments
Detailed breakdown of some examples of ToME 4's talent code.
Saturday, 3 March 2012
Manathrust
Sunday, 26 February 2012
Arcane Power
newTalent{
name = "Arcane Power",
short_name = "ARCANE_POWER",
image = "talents/arcane_power.png",
type = {"spell/arcane", 1},
mode = "sustained",
require = spells_req1,
sustain_mana = 50,
points = 5,
cooldown = 30,
tactical = { BUFF = 2 },
spellpower_increase = { 5, 9, 13, 16, 18 },
getSpellpowerIncrease = function(self, t)
local v = t.spellpower_increase[self:getTalentLevelRaw(t)]
if v then return v else return 18 + (self:getTalentLevelRaw(t) - 5) * 2 end
end,
activate = function(self, t)
game:playSoundNear(self, "talents/arcane")
game:playSound (self, "talents/arcane")
return {
power = self:addTemporaryValue("combat_spellpower", t.getSpellpowerIncrease(self, t)),
particle = self:addParticles(Particles.new("arcane_power", 1)),
}
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("combat_spellpower", p.power)
return true
end,
info = function(self, t)
local spellpowerinc = t.getSpellpowerIncrease(self, t)
return ([[Your mastery of magic allows you to enter a deep concentration state, increasing your spellpower by %d.]]):
format(spellpowerinc)
end,
}
Subscribe to:
Comments (Atom)