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

Flare talent does not use two turns

git-svn-id: http://svn.net-core.org/repos/t-engine4@2299 51575b47-30f0-44d4-a5cc-537603b46e54
parent e1483afa
No related branches found
No related tags found
No related merge requests found
Showing with 600 additions and 177 deletions
......@@ -458,7 +458,6 @@ newEntity{ base = "BASE_LEATHER_BOOT",
use_power = { name = "boost speed", power = 50,
use = function(self, who)
who:setEffect(who.EFF_SPEED, 8, {power=0.20 + who:getCun() / 80})
game.logSeen(who, "%s speeds up!", who.name:capitalize())
end
},
}
......
-- ToME - Tales of Maj'Eyal
-- 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
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 r = rng.range(1, ray.size - 32)
local ra = a + (rng.chance(2) and math.rad(-90) or math.rad(90))
local rr = rng.float(2, engine.Map.tile_w * 0.60)
local vel = rng.float(1.2, 6)
return {
life = 32 / vel,
size = rng.float(4, 10), sizev = -0.1, sizea = 0,
x = r * math.cos(a) + rr * math.cos(ra), xv = 0, xa = 0,
y = r * math.sin(a) + rr * math.sin(ra), yv = 0, ya = 0,
dir = ray.dir, dirv = 0, dira = 0,
vel = vel, velv = -0.1, vela = 0.01,
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)
self.nb = (self.nb or 0) + 1
if self.nb < 6 then
self.ps:emit(9*tiles)
end
end,
32*9*tiles,
"particle_cloud"
......@@ -108,7 +108,7 @@ The penalty for disobedience shall be flogging. Intolerance will not be tolerate
newLore{
id = "last-hope-toknor-statue",
category = "last hope",
name = "All Hail King Toknor the Brace!",
name = "All Hail King Toknor the Brave!",
lore = [[Born the 23th Allure, Year of Pyre 682
Died the 2th Summertide, Year of Ascendancy 108
......
......@@ -18,208 +18,121 @@
-- darkgod@te4.org
newTalent{
name = "Knockback", short_name = "GOLEM_KNOCKBACK",
type = {"golem/fighting", 1},
require = techs_req1,
name = "Golem Power2",
type = {"spell/advanced-golemancy", 1},
mode = "passive",
require = spells_req_high1,
points = 5,
cooldown = 10,
range = 10,
stamina = 5,
requires_target = true,
getDamage = function(self, t) return self:combatTalentWeaponDamage(t, 0.8, 1.6) end,
action = function(self, t)
if self:attr("never_move") then game.logPlayer(self, "Your golem can not do that currently.") return end
local tg = {type="hit", range=self:getTalentRange(t)}
local olds = game.target.source_actor
game.target.source_actor = self
local x, y, target = self:getTarget(tg)
game.target.source_actor = olds
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then return nil end
if self.ai_target then self.ai_target.target = target end
local l = line.new(self.x, self.y, x, y)
local lx, ly = l()
local tx, ty = self.x, self.y
lx, ly = l()
while lx and ly do
if game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
lx, ly = l()
end
self:move(tx, ty, true)
-- Attack ?
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return true end
local hit = self:attackTarget(target, nil, t.getDamage(self, t), true)
-- Try to knockback !
if hit then
if target:checkHit(self:combatAttackStr(), target:combatPhysicalResist(), 0, 95, 5 - self:getTalentLevel(t) / 2) and target:canBe("knockback") then
target:knockback(self.x, self.y, 3)
else
game.logSeen(target, "%s resists the knockback!", target.name:capitalize())
end
end
return true
on_learn = function(self, t)
self.alchemy_golem:learnTalent(Talents.T_WEAPON_COMBAT, true)
self.alchemy_golem:learnTalent(Talents.T_WEAPONS_MASTERY, true)
end,
on_unlearn = function(self, t)
self.alchemy_golem:unlearnTalent(Talents.T_WEAPON_COMBAT, true)
self.alchemy_golem:unlearnTalent(Talents.T_WEAPONS_MASTERY, true)
end,
info = function(self, t)
local damage = t.getDamage(self, t)
return ([[Your golem rushes to the target, knocking it back and doing %d%% damage.
Knockback chance will increase with talent level.]]):format(100 * damage)
local attack = self:getTalentFromId(Talents.T_WEAPON_COMBAT).getAttack(self, t)
local damage = self:getTalentFromId(Talents.T_WEAPONS_MASTERY).getDamage(self, t)
return ([[Improves your golem proficiency with weapons. Increasing its attack by %d and damage by %d%%.]]):
format(attack, 100 * damage)
end,
}
newTalent{
name = "Taunt", short_name = "GOLEM_TAUNT",
type = {"golem/fighting", 2},
require = techs_req2,
name = "Golem Resilience2",
type = {"spell/advanced-golemancy", 2},
mode = "passive",
require = spells_req_high2,
points = 5,
cooldown = function(self, t)
return 20 - self:getTalentLevelRaw(t) * 2
on_learn = function(self, t)
self.alchemy_golem:learnTalent(Talents.T_HEALTH, true)
self.alchemy_golem:learnTalent(Talents.T_HEAVY_ARMOUR_TRAINING, true)
self.alchemy_golem:learnTalent(Talents.T_MASSIVE_ARMOUR_TRAINING, true)
end,
range = 10,
stamina = 5,
requires_target = true,
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t)}
local olds = game.target.source_actor
game.target.source_actor = self
local x, y, target = self:getTarget(tg)
game.target.source_actor = olds
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then return nil end
if self.ai_target then self.ai_target.target = target end
target:setTarget(self)
game.logSeen(self, "%s provokes %s to attack it.", self.name:capitalize(), target.name)
return true
on_unlearn = function(self, t)
self.alchemy_golem:unlearnTalent(Talents.T_HEALTH, true)
self.alchemy_golem:unlearnTalent(Talents.T_HEAVY_ARMOUR_TRAINING, true)
self.alchemy_golem:unlearnTalent(Talents.T_MASSIVE_ARMOUR_TRAINING, true)
end,
info = function(self, t)
return ([[Orders your golem to taunt a target, forcing it to attack the golem.]]):format()
local health = self:getTalentFromId(Talents.T_HEALTH).getHealth(self, t)
local heavyarmor = self:getTalentFromId(Talents.T_HEAVY_ARMOUR_TRAINING).getArmor(self, t)
local massivearmor = self:getTalentFromId(Talents.T_MASSIVE_ARMOUR_TRAINING).getArmor(self, t)
return ([[Improves your golem armour training and health. Increases armor by %d when wearing heavy armor or by %d when wearing massive armor also increases health by %d.]]):
format(heavyarmor, massivearmor, health)
end,
}
newTalent{
name = "Crush", short_name = "GOLEM_CRUSH",
type = {"golem/fighting", 3},
require = techs_req3,
name = "Invoke Golem2",
type = {"spell/advanced-golemancy",3},
require = spells_req3,
points = 5,
cooldown = 10,
range = 10,
stamina = 5,
requires_target = true,
getDamage = function(self, t) return self:combatTalentWeaponDamage(t, 0.8, 1.6) end,
getPinDuration = function(self, t) return 2 + self:getTalentLevel(t) end,
mana = 10,
cooldown = 20,
no_npc_use = true,
getPower = function(self, t) return self:combatTalentSpellDamage(t, 15, 50) end,
action = function(self, t)
if self:attr("never_move") then game.logPlayer(self, "Your golem can not do that currently.") return end
local tg = {type="hit", range=self:getTalentRange(t)}
local olds = game.target.source_actor
game.target.source_actor = self
local x, y, target = self:getTarget(tg)
game.target.source_actor = olds
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then return nil end
if self.ai_target then self.ai_target.target = target end
local l = line.new(self.x, self.y, x, y)
local lx, ly = l()
local tx, ty = self.x, self.y
lx, ly = l()
while lx and ly do
if game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
lx, ly = l()
local mover, golem = getGolem(self)
if not golem then
game.logPlayer(self, "Your golem is currently inactive.")
return
end
self:move(tx, ty, true)
-- Attack ?
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return true end
local hit = self:attackTarget(target, nil, t.getDamage(self, t), true)
-- Try to knockback !
if hit then
if target:checkHit(self:combatAttackStr(), target:combatPhysicalResist(), 0, 95, 10 - self:getTalentLevel(t) / 2) and target:canBe("stun") then
target:setEffect(target.EFF_PINNED, t.getPinDuration(self, t), {})
else
game.logSeen(target, "%s resists the crushing!", target.name:capitalize())
end
-- Find space
local x, y = util.findFreeGrid(self.x, self.y, 5, true, {[Map.ACTOR]=true})
if not x then
game.logPlayer(self, "Not enough space to invoke!")
return
end
golem:setEffect(golem.EFF_MIGHTY_BLOWS, 5, {power=t.getPower(self, t)})
if golem == mover then
golem:move(x, y, true)
end
game:playSoundNear(self, "talents/arcane")
return true
end,
info = function(self, t)
local damage = t.getDamage(self, t)
local duration = t.getPinDuration(self, t)
return ([[Your golem rushes to the target, crushing it to the ground for %d turns and doing %d%% damage.
Pinning chance will increase with talent level.]]):
format(duration, 100 * damage)
power=t.getPower(self, t)
return ([[You invoke your golem to your side, granting it a temporary melee power increase of %d for 5 turns.]]):
format(power)
end,
}
newTalent{
name = "Pound", short_name = "GOLEM_POUND",
type = {"golem/fighting", 4},
require = techs_req4,
name = "Mount Golem2",
type = {"spell/advanced-golemancy",4},
require = spells_req_high4,
points = 5,
cooldown = 15,
range = 10,
stamina = 5,
requires_target = true,
getGolemDamage = function(self, t)
return self:combatTalentWeaponDamage(t, 0.4, 1.1)
end,
getDazeDuration = function(self, t) return 2 + self:getTalentLevel(t) end,
mana = 40,
cooldown = 60,
no_npc_use = true,
getDuration = function(self, t) return 5 + math.ceil(self:getTalentLevel(t) * 4) end,
action = function(self, t)
if self:attr("never_move") then game.logPlayer(self, "Your golem can not do that currently.") return end
local tg = {type="ball", radius=2, friendlyfire=false, range=self:getTalentRange(t)}
local olds = game.target.source_actor
game.target.source_actor = self
local x, y, target = self:getTarget(tg)
game.target.source_actor = olds
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then return nil end
local l = line.new(self.x, self.y, x, y)
local lx, ly = l()
local tx, ty = self.x, self.y
lx, ly = l()
while lx and ly do
if game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
lx, ly = l()
local mover, golem = getGolem(self)
if not golem then
game.logPlayer(self, "Your golem is currently inactive.")
return
end
if math.floor(core.fov.distance(self.x, self.y, golem.x, golem.y)) > 1 then
game.logPlayer(self, "You are too far away from your golem.")
return
end
if self.ai_target then self.ai_target.target = target end
-- Attack & daze
self:project({type="ball", radius=2, friendlyfire=false}, tx, ty, function(xx, yy)
if xx == self.x and yy == self.y then return end
local target = game.level.map(xx, yy, Map.ACTOR)
if target and self:attackTarget(target, nil, t.getGolemDamage(self, t), true) then
if target:checkHit(self:combatAttackStr(), target:combatPhysicalResist(), 0, 95, 10 - self:getTalentLevel(t) / 2) and target:canBe("stun") then
target:setEffect(target.EFF_DAZED, t.getDazeDuration(self, t), {})
else
game.logSeen(target, "%s resists the dazing blow!", target.name:capitalize())
end
end
end)
-- Create the mount item
local mount = game.zone:makeEntityByName(game.level, "object", "ALCHEMIST_GOLEM_MOUNT")
if not mount then return end
mount.mount.actor = golem
self:setEffect(self.EFF_GOLEM_MOUNT, t.getDuration(self, t), {mount=mount})
return true
end,
info = function(self, t)
local duration = t.getDazeDuration(self, t)
local damage = t.getGolemDamage(self, t)
return ([[Your golem rushes to the target, pounding the area of radius 2, dazing all foes for %d turns and doing %d%% damage.
Daze chance increases with talent level.]]):
format(duration, 100 * damage)
local duration = t.getDuration(self, t)
return ([[Mount inside your golem, directly controlling it for %d turns also golem absorb 75%% of the damage taken.]]):
format(duration)
end,
}
-- ToME - Tales of Maj'Eyal
-- 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
------------------------------------------------------------------
-- Melee
------------------------------------------------------------------
newTalent{
name = "Knockback", short_name = "GOLEM_KNOCKBACK",
type = {"golem/fighting", 1},
require = techs_req1,
points = 5,
cooldown = 10,
range = 10,
stamina = 5,
requires_target = true,
getDamage = function(self, t) return self:combatTalentWeaponDamage(t, 0.8, 1.6) end,
action = function(self, t)
if self:attr("never_move") then game.logPlayer(self, "Your golem can not do that currently.") return end
local tg = {type="hit", range=self:getTalentRange(t)}
local olds = game.target.source_actor
game.target.source_actor = self
local x, y, target = self:getTarget(tg)
game.target.source_actor = olds
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then return nil end
if self.ai_target then self.ai_target.target = target end
local l = line.new(self.x, self.y, x, y)
local lx, ly = l()
local tx, ty = self.x, self.y
lx, ly = l()
while lx and ly do
if game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
lx, ly = l()
end
self:move(tx, ty, true)
-- Attack ?
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return true end
local hit = self:attackTarget(target, nil, t.getDamage(self, t), true)
-- Try to knockback !
if hit then
if target:checkHit(self:combatAttackStr(), target:combatPhysicalResist(), 0, 95, 5 - self:getTalentLevel(t) / 2) and target:canBe("knockback") then
target:knockback(self.x, self.y, 3)
else
game.logSeen(target, "%s resists the knockback!", target.name:capitalize())
end
end
return true
end,
info = function(self, t)
local damage = t.getDamage(self, t)
return ([[Your golem rushes to the target, knocking it back and doing %d%% damage.
Knockback chance will increase with talent level.]]):format(100 * damage)
end,
}
newTalent{
name = "Taunt", short_name = "GOLEM_TAUNT",
type = {"golem/fighting", 2},
require = techs_req2,
points = 5,
cooldown = function(self, t)
return 20 - self:getTalentLevelRaw(t) * 2
end,
range = 10,
stamina = 5,
requires_target = true,
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t)}
local olds = game.target.source_actor
game.target.source_actor = self
local x, y, target = self:getTarget(tg)
game.target.source_actor = olds
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then return nil end
if self.ai_target then self.ai_target.target = target end
target:setTarget(self)
game.logSeen(self, "%s provokes %s to attack it.", self.name:capitalize(), target.name)
return true
end,
info = function(self, t)
return ([[Orders your golem to taunt a target, forcing it to attack the golem.]]):format()
end,
}
newTalent{
name = "Crush", short_name = "GOLEM_CRUSH",
type = {"golem/fighting", 3},
require = techs_req3,
points = 5,
cooldown = 10,
range = 10,
stamina = 5,
requires_target = true,
getDamage = function(self, t) return self:combatTalentWeaponDamage(t, 0.8, 1.6) end,
getPinDuration = function(self, t) return 2 + self:getTalentLevel(t) end,
action = function(self, t)
if self:attr("never_move") then game.logPlayer(self, "Your golem can not do that currently.") return end
local tg = {type="hit", range=self:getTalentRange(t)}
local olds = game.target.source_actor
game.target.source_actor = self
local x, y, target = self:getTarget(tg)
game.target.source_actor = olds
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then return nil end
if self.ai_target then self.ai_target.target = target end
local l = line.new(self.x, self.y, x, y)
local lx, ly = l()
local tx, ty = self.x, self.y
lx, ly = l()
while lx and ly do
if game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
lx, ly = l()
end
self:move(tx, ty, true)
-- Attack ?
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return true end
local hit = self:attackTarget(target, nil, t.getDamage(self, t), true)
-- Try to knockback !
if hit then
if target:checkHit(self:combatAttackStr(), target:combatPhysicalResist(), 0, 95, 10 - self:getTalentLevel(t) / 2) and target:canBe("stun") then
target:setEffect(target.EFF_PINNED, t.getPinDuration(self, t), {})
else
game.logSeen(target, "%s resists the crushing!", target.name:capitalize())
end
end
return true
end,
info = function(self, t)
local damage = t.getDamage(self, t)
local duration = t.getPinDuration(self, t)
return ([[Your golem rushes to the target, crushing it to the ground for %d turns and doing %d%% damage.
Pinning chance will increase with talent level.]]):
format(duration, 100 * damage)
end,
}
newTalent{
name = "Pound", short_name = "GOLEM_POUND",
type = {"golem/fighting", 4},
require = techs_req4,
points = 5,
cooldown = 15,
range = 10,
stamina = 5,
requires_target = true,
getGolemDamage = function(self, t)
return self:combatTalentWeaponDamage(t, 0.4, 1.1)
end,
getDazeDuration = function(self, t) return 2 + self:getTalentLevel(t) end,
action = function(self, t)
if self:attr("never_move") then game.logPlayer(self, "Your golem can not do that currently.") return end
local tg = {type="ball", radius=2, friendlyfire=false, range=self:getTalentRange(t)}
local olds = game.target.source_actor
game.target.source_actor = self
local x, y, target = self:getTarget(tg)
game.target.source_actor = olds
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then return nil end
local l = line.new(self.x, self.y, x, y)
local lx, ly = l()
local tx, ty = self.x, self.y
lx, ly = l()
while lx and ly do
if game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
lx, ly = l()
end
if self.ai_target then self.ai_target.target = target end
-- Attack & daze
self:project({type="ball", radius=2, friendlyfire=false}, tx, ty, function(xx, yy)
if xx == self.x and yy == self.y then return end
local target = game.level.map(xx, yy, Map.ACTOR)
if target and self:attackTarget(target, nil, t.getGolemDamage(self, t), true) then
if target:checkHit(self:combatAttackStr(), target:combatPhysicalResist(), 0, 95, 10 - self:getTalentLevel(t) / 2) and target:canBe("stun") then
target:setEffect(target.EFF_DAZED, t.getDazeDuration(self, t), {})
else
game.logSeen(target, "%s resists the dazing blow!", target.name:capitalize())
end
end
end)
return true
end,
info = function(self, t)
local duration = t.getDazeDuration(self, t)
local damage = t.getGolemDamage(self, t)
return ([[Your golem rushes to the target, pounding the area of radius 2, dazing all foes for %d turns and doing %d%% damage.
Daze chance increases with talent level.]]):
format(duration, 100 * damage)
end,
}
------------------------------------------------------------------
-- Arcane
------------------------------------------------------------------
newTalent{
name = "Eye Beam", short_name = "GOLEM_BEAM",
type = {"golem/arcane", 1},
require = spells_req1,
points = 5,
cooldown = 10,
range = 10,
mana = 10,
requires_target = true,
getDamage = function(self, t) return self:combatTalentSpellDamage(t, 25, 200) end,
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
-- Always project the beam as far as possible
local current_angle = math.atan2((y - self.y), (x - self.x)) + math.pi
local target_x = self.x - math.floor(0.5 + (tg.range * math.cos(current_angle)))
local target_y = self.y - math.floor(0.5 + (tg.range * math.sin(current_angle)))
local l = line.new(self.x, self.y, target_x, target_y)
local lx, ly = l()
target_x, target_y = lx, ly
-- Check for terrain and friendly actors
while lx and ly do
local actor = game.level.map(lx, ly, engine.Map.ACTOR)
if actor and (self:reactionToward(actor) >= 0) then
break
elseif game.level.map:checkEntity(lx, ly, engine.Map.TERRAIN, "block_move") then
target_x, target_y = lx, ly
break
end
target_x, target_y = lx, ly
lx, ly = l()
end
x, y = target_x, target_y
local typ = rng.range(1, 3)
if typ == 1 then
self:project(tg, x, y, DamageType.FIRE, self:spellCrit(t.getDamage(self, t)))
local _ _, x, y = self:canProject(tg, x, y)
game.level.map:particleEmitter(self.x, self.y, tg.radius, "flamebeam", {tx=x-self.x, ty=y-self.y})
elseif typ == 2 then
self:project(tg, x, y, DamageType.LIGHTNING, rng.avg(dam / 3, dam, 3))
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)), "lightning", {tx=x-self.x, ty=y-self.y})
else
self:project(tg, x, y, DamageType.COLD, self:spellCrit(t.getDamage(self, t)))
local _ _, x, y = self:canProject(tg, x, y)
game.level.map:particleEmitter(self.x, self.y, tg.radius, "icebeam", {tx=x-self.x, ty=y-self.y})
end
game:playSoundNear(self, "talents/spell_generic")
return true
end,
info = function(self, t)
local damage = t.getDamage(self, t)
return ([[Fire a beam from your eyes doing %0.2f fire damage, %0.2f cold damage or %0.2f lightning damage.
The damage will increase with the Magic stat]]):
format(damDesc(self, DamageType.FIRE, damage), damDesc(self, DamageType.COLD, damage), damDesc(self, DamageType.LIGHTNING, damage))
end,
}
newTalent{
name = "Molten Skin", short_name = "GOLEM_MOLTEN_SKIN",
type = {"golem/arcane", 2},
require = spells_req2,
points = 5,
cooldown = function(self, t)
return 20 - self:getTalentLevelRaw(t) * 2
end,
range = 10,
mana = 5,
requires_target = true,
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t)}
local olds = game.target.source_actor
game.target.source_actor = self
local x, y, target = self:getTarget(tg)
game.target.source_actor = olds
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then return nil end
if self.ai_target then self.ai_target.target = target end
target:setTarget(self)
game.logSeen(self, "%s provokes %s to attack it.", self.name:capitalize(), target.name)
return true
end,
info = function(self, t)
return ([[Orders your golem to taunt a target, forcing it to attack the golem.]]):format()
end,
}
newTalent{
name = "", short_name = "GOLEM_CRUSH2",
type = {"golem/arcane", 3},
require = spells_req3,
points = 5,
cooldown = 10,
range = 10,
mana = 5,
requires_target = true,
getDamage = function(self, t) return self:combatTalentWeaponDamage(t, 0.8, 1.6) end,
getPinDuration = function(self, t) return 2 + self:getTalentLevel(t) end,
action = function(self, t)
if self:attr("never_move") then game.logPlayer(self, "Your golem can not do that currently.") return end
local tg = {type="hit", range=self:getTalentRange(t)}
local olds = game.target.source_actor
game.target.source_actor = self
local x, y, target = self:getTarget(tg)
game.target.source_actor = olds
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then return nil end
if self.ai_target then self.ai_target.target = target end
local l = line.new(self.x, self.y, x, y)
local lx, ly = l()
local tx, ty = self.x, self.y
lx, ly = l()
while lx and ly do
if game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
lx, ly = l()
end
self:move(tx, ty, true)
-- Attack ?
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return true end
local hit = self:attackTarget(target, nil, t.getDamage(self, t), true)
-- Try to knockback !
if hit then
if target:checkHit(self:combatAttackStr(), target:combatPhysicalResist(), 0, 95, 10 - self:getTalentLevel(t) / 2) and target:canBe("stun") then
target:setEffect(target.EFF_PINNED, t.getPinDuration(self, t), {})
else
game.logSeen(target, "%s resists the crushing!", target.name:capitalize())
end
end
return true
end,
info = function(self, t)
local damage = t.getDamage(self, t)
local duration = t.getPinDuration(self, t)
return ([[Your golem rushes to the target, crushing it to the ground for %d turns and doing %d%% damage.
Pinning chance will increase with talent level.]]):
format(duration, 100 * damage)
end,
}
newTalent{
name = "Pound", short_name = "GOLEM_POUND2",
type = {"golem/arcane", 4},
require = spells_req4,
points = 5,
cooldown = 15,
range = 10,
mana = 5,
requires_target = true,
getGolemDamage = function(self, t)
return self:combatTalentWeaponDamage(t, 0.4, 1.1)
end,
getDazeDuration = function(self, t) return 2 + self:getTalentLevel(t) end,
action = function(self, t)
if self:attr("never_move") then game.logPlayer(self, "Your golem can not do that currently.") return end
local tg = {type="ball", radius=2, friendlyfire=false, range=self:getTalentRange(t)}
local olds = game.target.source_actor
game.target.source_actor = self
local x, y, target = self:getTarget(tg)
game.target.source_actor = olds
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then return nil end
local l = line.new(self.x, self.y, x, y)
local lx, ly = l()
local tx, ty = self.x, self.y
lx, ly = l()
while lx and ly do
if game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
lx, ly = l()
end
if self.ai_target then self.ai_target.target = target end
-- Attack & daze
self:project({type="ball", radius=2, friendlyfire=false}, tx, ty, function(xx, yy)
if xx == self.x and yy == self.y then return end
local target = game.level.map(xx, yy, Map.ACTOR)
if target and self:attackTarget(target, nil, t.getGolemDamage(self, t), true) then
if target:checkHit(self:combatAttackStr(), target:combatPhysicalResist(), 0, 95, 10 - self:getTalentLevel(t) / 2) and target:canBe("stun") then
target:setEffect(target.EFF_DAZED, t.getDazeDuration(self, t), {})
else
game.logSeen(target, "%s resists the dazing blow!", target.name:capitalize())
end
end
end)
return true
end,
info = function(self, t)
local duration = t.getDazeDuration(self, t)
local damage = t.getGolemDamage(self, t)
return ([[Your golem rushes to the target, pounding the area of radius 2, dazing all foes for %d turns and doing %d%% damage.
Daze chance increases with talent level.]]):
format(duration, 100 * damage)
end,
}
......@@ -56,6 +56,7 @@ local function makeGolem()
talents_types = {
["golem/fighting"] = true,
["golem/arcane"] = true,
},
inscription_restrictions = { ["inscriptions/runes"] = true, },
......@@ -218,7 +219,7 @@ newTalent{
name = "Golem Power",
type = {"spell/golemancy", 1},
mode = "passive",
require = spells_req_high1,
require = spells_req1,
points = 5,
on_learn = function(self, t)
self.alchemy_golem:learnTalent(Talents.T_WEAPON_COMBAT, true)
......@@ -240,7 +241,7 @@ newTalent{
name = "Golem Resilience",
type = {"spell/golemancy", 2},
mode = "passive",
require = spells_req_high2,
require = spells_req2,
points = 5,
on_learn = function(self, t)
self.alchemy_golem:learnTalent(Talents.T_HEALTH, true)
......@@ -302,7 +303,7 @@ newTalent{
newTalent{
name = "Mount Golem",
type = {"spell/golemancy",4},
require = spells_req_high4,
require = spells_req4,
points = 5,
mana = 40,
cooldown = 60,
......
......@@ -50,6 +50,7 @@ newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/st
newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/stone-alchemy", name = "stone alchemy", generic = true, description = "Alchemical control over stone and gems." }
newTalentType{ allow_random=true, no_silence=true, is_spell=true, type="spell/staff-combat", name = "staff combat", generic = true, description = "Harness the power of magical staves." }
newTalentType{ type="golem/fighting", name = "fighting", description = "Golem melee capacity." }
newTalentType{ type="golem/arcane", name = "arcane", description = "Golem arcane capacity." }
-- Generic requires for spells based on talent level
spells_req1 = {
......@@ -117,3 +118,4 @@ load("/data/talents/spells/advanced-golemancy.lua")
load("/data/talents/spells/staff-combat.lua")
load("/data/talents/spells/fire-alchemy.lua")
load("/data/talents/spells/stone-alchemy.lua")
load("/data/talents/spells/golem.lua")
......@@ -164,6 +164,7 @@ newTalent{
newTalent{
name = "Flare",
type = {"technique/archery-utility", 1},
no_energy = "fake",
points = 5,
cooldown = 15,
stamina = 15,
......@@ -252,7 +253,7 @@ newTalent{
info = function(self, t)
return ([[You fire a pinning shot, doing %d%% damage and pinning your target to the ground for %d turns.
Pinning chance increase with your Dexterity stat.]])
:format(self:combatTalentWeaponDamage(t, 1, 1.4) * 100,
:format(self:combatTalentWeaponDamage(t, 1, 1.4) * 100,
2 + self:getTalentLevelRaw(t))
end,
}
......@@ -285,7 +286,7 @@ newTalent{
info = function(self, t)
return ([[You fire multiple shots at the area, doing %d%% damage and stunning your targets for %d turns.
Stun chance increase with your Dexterity stat.]])
:format(self:combatTalentWeaponDamage(t, 0.5, 1.5) * 100,
:format(self:combatTalentWeaponDamage(t, 0.5, 1.5) * 100,
2 + self:getTalentLevelRaw(t))
end,
}
......@@ -33,7 +33,7 @@ newEntity{
can_pass = {pass_tree=1},
does_block_move = true,
block_sight = true,
dig = "GRASS",
dig = "BURNT_GROUND1",
}
end
......
......@@ -22,7 +22,7 @@ local Talents = require("engine.interface.ActorTalents")
newEntity{ base = "BASE_NPC_HORROR", define_as="WEIRDLING_BEAST",
name = "Weirdling Beast", color=colors.VIOLET,
desc = "A roughly humanoid creature, with tentacles-like appendices in the place of arms and legs. You gasp in horror as you notice it has no head. Putrid warts form quickly on its skin and explode as quickly.",
desc = "A roughly humanoid creature, with tentacles-like appendages in the place of arms and legs. You gasp in horror as you notice it has no head. Putrid warts form quickly on its skin and explode as quickly.",
level_range = {19, nil}, exp_worth = 3,
rank = 3.5,
autolevel = "warriormage",
......
......@@ -261,7 +261,7 @@ end
--- Random bonus based on level
resolvers.current_level = 1
function resolvers.mbonusl(max, add, pricefct)
function resolvers.mbonus(max, add, pricefct)
return {__resolver="mbonus", max, add, pricefct}
end
function resolvers.calc.mbonus(t, e)
......
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