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

dual wield

git-svn-id: http://svn.net-core.org/repos/t-engine4@292 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5f7aabf6
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@ local sides =
[8] = {left=7, right=9},
[9] = {left=8, right=6},
}
local turn =
{
[1] = {left=3, right=7},
......
......@@ -218,7 +218,31 @@ coord_to_dir = {
},
}
dir_sides =
{
[1] = {left=2, right=4},
[2] = {left=3, right=1},
[3] = {left=6, right=2},
[4] = {left=1, right=7},
[6] = {left=9, right=3},
[7] = {left=4, right=8},
[8] = {left=7, right=9},
[9] = {left=8, right=6},
}
util = {}
function util.getDir(x1, y1, x2, y2)
local xd, yd = x1 - x2, y1 - y2
if xd ~= 0 then xd = xd / math.abs(xd) end
if yd ~= 0 then yd = yd / math.abs(yd) end
return coord_to_dir[xd][yd], xd, yd
end
function util.coordAddDir(x, y, dir)
return x + dir_to_coord[dir][1], y + dir_to_coord[dir][2]
end
function util.boundWrap(i, min, max)
if i < min then i = max
elseif i > max then i = min end
......
......@@ -481,6 +481,7 @@ end
--- Can the target be applied some effects
-- @param what a string describing what is being tried
function _M:canBe(what)
if what == "cut" and self:attr("cut_immune") then return false end
if what == "blind" and self:attr("blind_immune") then return false end
if what == "stun" and self:attr("stun_immune") then return false end
if what == "knockback" and self:attr("knockback_immune") then return false end
......
......@@ -170,7 +170,11 @@ end
--- Gets the defense
function _M:combatDefense()
return self.combat_def + (self:getDex() - 10) * 0.35
local add = 0
if self:hasDualWeapon() and self:knowTalent(self.T_DUAL_WEAPON_DEFENSE) then
add = add + 4 + (self:getTalentLevel(self.T_DUAL_WEAPON_DEFENSE) * self:getDex()) / 12
end
return self.combat_def + (self:getDex() - 10) * 0.35 + add
end
--- Gets the armor
......@@ -306,6 +310,7 @@ end
--- Check if the actor has a two handed weapon
function _M:hasTwoHandedWeapon()
if not self:getInven("MAINHAND") then return end
local weapon = self:getInven("MAINHAND")[1]
if not weapon or not weapon.twohanded then
return nil
......@@ -315,9 +320,21 @@ end
--- Check if the actor has a shield
function _M:hasShield()
if not self:getInven("MAINHAND") or not self:getInven("OFFHAND") then return end
local shield = self:getInven("OFFHAND")[1]
if not shield or not shield.special_combat then
return nil
end
return shield
end
\ No newline at end of file
end
--- Check if the actor dual wields
function _M:hasDualWeapon()
if not self:getInven("MAINHAND") or not self:getInven("OFFHAND") then return end
local weapon = self:getInven("MAINHAND")[1]
local offweapon = self:getInven("OFFHAND")[1]
if not weapon or not offweapon or not weapon.combat or not offweapon.combat then
return nil
end
return weapon, offweapon
end
newBirthDescriptor{
type = "class",
name = "Warrior",
desc = {
"Simple fighters, they hack away with their trusty weapon.",
},
descriptor_choices =
{
subclass =
{
__ALL__ = "never",
Fighter = "allow",
Berserker = "allow",
},
},
talents = { [ActorTalents.T_STAMINA_POOL]=1, },
copy = {
max_life = 120,
life_rating = 10,
},
}
newBirthDescriptor{
type = "subclass",
name = "Fighter",
desc = {
"A warrior specializing in weapon and shield combat.",
},
stats = { str=3, con=2, dex=1, },
talents_types = {
["technique/shield-offense"]={true, 0.3},
["technique/shield-defense"]={true, 0.3},
["technique/2hweapon-offense"]={true, 0},
["technique/2hweapon-cripple"]={true, 0},
["technique/combat-training"]={true, 0.2},
["technique/weapon-training"]={true, 0.2},
},
talents = {
[ActorTalents.T_SHIELD_PUMMEL] = 1,
[ActorTalents.T_WEAPON_COMBAT] = 1,
[ActorTalents.T_HEAVY_ARMOUR_TRAINING] = 1,
},
copy = {
equipment = resolvers.equip{ id=true,
{type="weapon", subtype="longsword", name="iron longsword"},
{type="armor", subtype="shield", name="iron shield"},
{type="armor", subtype="heavy", name="iron mail armour"}
},
},
}
newBirthDescriptor{
type = "subclass",
name = "Berserker",
desc = {
"A warrior specializing in two handed weapon combat",
},
stats = { str=3, con=2, dex=1, },
talents_types = {
["technique/shield-offense"]={true, 0},
["technique/shield-defense"]={true, 0},
["technique/2hweapon-offense"]={true, 0.3},
["technique/2hweapon-cripple"]={true, 0.3},
["technique/combat-training"]={true, 0.2},
["technique/weapon-training"]={true, 0.2},
},
talents = {
[ActorTalents.T_BERSERKER] = 1,
[ActorTalents.T_WEAPON_COMBAT] = 1,
[ActorTalents.T_HEAVY_ARMOUR_TRAINING] = 1,
},
copy = {
equipment = resolvers.equip{ id=true,
{type="weapon", subtype="greatsword", name="iron greatsword"},
{type="armor", subtype="heavy", name="iron mail armour"}
},
},
}
newBirthDescriptor{
type = "class",
name = "Rogue",
desc = {
"Rogues are masters of tricks, they can steal from shops and monsters",
"and lure monsters into deadly traps.",
},
descriptor_choices =
{
subclass =
{
__ALL__ = "never",
Rogue = "allow",
},
},
talents = { [ActorTalents.T_STAMINA_POOL]=1, },
copy = {
max_life = 100,
life_rating = 9,
equipment = resolvers.equip{ id=true,
{type="weapon", subtype="dagger", name="iron dagger"},
{type="weapon", subtype="dagger", name="iron dagger"},
{type="armor", subtype="light", name="rough leather armour"}
},
},
}
newBirthDescriptor{
type = "subclass",
name = "Rogue",
desc = {
"Rogues are masters of tricks, they can steal from shops and monsters",
"and lure monsters into deadly traps.",
},
stats = { dex=2, str=1, cun=3, },
talents_types = {
["technique/dualweapon"]={true, 0.3},
["technique/combat-training"]={true, 0},
["technique/weapon-training"]={true, 0},
["cunning/stealth"]={true, 0.3},
["cunning/traps"]={true, 0.3},
["cunning/dirty"]={true, 0.3},
},
talents = {
[ActorTalents.T_STEALTH] = 1,
[ActorTalents.T_WEAPON_COMBAT] = 1,
[ActorTalents.T_KNIFE_MASTERY] = 1,
},
}
newBirthDescriptor{
type = "class",
name = "Mage",
desc = {
"The basic spellcaster with lots of different skills",
},
descriptor_choices =
{
subclass =
{
__ALL__ = "never",
Mage = "allow",
},
},
talents = { [ActorTalents.T_MANA_POOL]=1, },
copy = {
max_life = 80,
life_rating = 7,
resolvers.equip{ id=true,
{type="weapon", subtype="staff", name="elm staff"},
{type="armor", subtype="cloth", name="robe"}
},
resolvers.inventory{ id=true,
{type="potion", subtype="potion", name="potion of lesser mana"},
{type="potion", subtype="potion", name="potion of lesser mana"},
},
resolvers.generic(function(e)
e.hotkey[10] = {"inventory", "potion of lesser mana"}
end),
},
}
newBirthDescriptor{
type = "subclass",
name = "Mage",
desc = {
"Simple fighters, they hack away with their trusty weapon.",
},
stats = { mag=3, wil=2, cun=1, },
talents_types = {
["spell/arcane"]={true, 0.3},
["spell/fire"]={true, 0.3},
["spell/earth"]={true, 0.3},
["spell/water"]={true, 0.3},
["spell/air"]={true, 0.3},
["spell/phantasm"]={true, 0.3},
["spell/temporal"]={true, 0.3},
["spell/meta"]={true, 0.3},
["spell/divination"]={true, 0.3},
["spell/conveyance"]={true, 0.3},
["spell/nature"]={true, 0.3},
["spell/necromancy"]={true, 0.3},
},
talents = {
[ActorTalents.T_MANATHRUST] = 1,
[ActorTalents.T_FLAME] = 1,
[ActorTalents.T_FREEZE] = 1,
},
}
......@@ -22,9 +22,16 @@ newBirthDescriptor{
},
}
-- Races
load("/data/birth/races/human.lua")
load("/data/birth/races/elf.lua")
load("/data/birth/races/hobbit.lua")
load("/data/birth/races/dwarf.lua")
-- Sexes
load("/data/birth/sexes.lua")
load("/data/birth/classes.lua")
-- Classes
load("/data/birth/warrior.lua")
load("/data/birth/rogue.lua")
load("/data/birth/mage.lua")
newTalent{
name = "Dual Weapon Training",
type = {"technique/dualweapon", 1},
type = {"technique/dualweapon-training", 1},
mode = "passive",
points = 5,
require = { stat = { dex=14 } },
require = techs_dex_req1,
info = function(self, t)
return ([[Increases the damage of the off-hand weapon to %d%%.]]):format(100 / (2 - self:getTalentLevel(t) / 6))
end,
}
newTalent{
name = "Flurry",
type = {"technique/dualweapon", 1},
name = "Dual Weapon Defense",
type = {"technique/dualweapon-training", 2},
mode = "passive",
points = 5,
require = techs_dex_req2,
info = function(self, t)
return ([[You have learned to block incomming blows with your weapons increasing your defense by %d.]]):format(4 + (self:getTalentLevel(t) * self:getDex()) / 12)
end,
}
newTalent{
name = "Precision",
type = {"technique/dualweapon-training", 3},
mode = "sustained",
points = 5,
require = techs_dex_req3,
cooldown = 30,
sustain_stamina = 50,
activate = function(self, t)
local weapon, offweapon = self:hasDualWeapon()
if not weapon then
game.logPlayer(self, "You cannot use Precision without dual wielding!")
return nil
end
return {
apr = self:addTemporaryValue("combat_apr", 4 + (self:getTalentLevel(t) * self:getDex()) / 20),
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("combat_apr", p.apr)
return true
end,
info = function(self, t)
return ([[You have learned to hit the right spot, increasing your armor penetration by %d.]]):format(4 + (self:getTalentLevel(t) * self:getDex()) / 20)
end,
}
newTalent{
name = "Momentum",
type = {"technique/dualweapon-training", 4},
mode = "sustained",
points = 5,
cooldown = 30,
sustain_stamina = 50,
require = techs_dex_req4,
activate = function(self, t)
local weapon, offweapon = self:hasDualWeapon()
if not weapon then
game.logPlayer(self, "You cannot use Momentum without dual wielding!")
return nil
end
return {
combat_physspeed = self:addTemporaryValue("combat_physspeed", -0.1 - self:getTalentLevel(t) / 14),
stamina_regen = self:addTemporaryValue("stamina_regen", -6),
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("combat_physspeed", p.combat_physspeed)
self:removeTemporaryValue("stamina_regen", p.stamina_regen)
return true
end,
info = function(self, t)
return ([[Increases attack speed by %0.2f, but drains stamina quickly.]]):format(-0.1 - self:getTalentLevel(t) / 14)
end,
}
------------------------------------------------------
-- Attacks
------------------------------------------------------
newTalent{
name = "Dual Strike",
type = {"technique/dualweapon-attack", 1},
points = 5,
cooldown = 12,
stamina = 15,
require = { stat = { dex=12 }, },
require = techs_dex_req1,
action = function(self, t)
local weapon = self:getInven("MAINHAND")[1]
local offweapon = self:getInven("OFFHAND")[1]
if not weapon or not offweapon or not weapon.combat or not offweapon.combat then
game.logPlayer(self, "You cannot use Flurry without dual wielding!")
local weapon, offweapon = self:hasDualWeapon()
if not weapon then
game.logPlayer(self, "You cannot use Dual Strike without dual wielding!")
return nil
end
......@@ -28,9 +99,21 @@ newTalent{
local x, y, target = self:getTarget(tg)
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)) > 1 then return nil end
self:attackTarget(target, nil, 1.8 + self:getTalentLevel(t) / 10, true)
self:attackTarget(target, nil, 1.8 + self:getTalentLevel(t) / 10, true)
self:attackTarget(target, nil, 1.8 + self:getTalentLevel(t) / 10, true)
-- First attack with offhand
local speed, hit = self:attackTargetWith(target, offweapon.combat, nil, 1.8 + self:getTalentLevel(t) / 10)
-- Second attack with mainhand
if hit then
if target:checkHit(self:combatAttackDex(weapon.combat), target:combatPhysicalResist(), 0, 95, 5 - self:getTalentLevel(t) / 2) and target:canBe("stun") then
target:setEffect(target.EFF_STUNNED, 2 + self:getTalentLevel(t), {})
else
game.logSeen(target, "%s resists the stunning strike!", target.name:capitalize())
end
-- Attack after the stun, to benefit from backstabs
self:attackTargetWith(target, weapon.combat, nil, 1.8 + self:getTalentLevel(t) / 10)
end
return true
end,
......@@ -40,94 +123,108 @@ newTalent{
}
newTalent{
name = "Whirlwind",
type = {"technique/dualweapon", 3},
name = "Flurry",
type = {"technique/dualweapon-attack", 2},
points = 5,
cooldown = 8,
stamina = 30,
require = { stat = { dex=24 }, },
cooldown = 12,
stamina = 15,
require = techs_dex_req2,
action = function(self, t)
local weapon = self:getInven("MAINHAND")[1]
local offweapon = self:getInven("OFFHAND")[1]
if not weapon or not offweapon or not weapon.combat or not offweapon.combat then
game.logPlayer(self, "You cannot use Whirlwind without dual wielding!")
local weapon, offweapon = self:hasDualWeapon()
if not weapon then
game.logPlayer(self, "You cannot use Flurry without dual wielding!")
return nil
end
for i = -1, 1 do for j = -1, 1 do
local x, y = self.x + i, self.y + j
if (self.x ~= x or self.y ~= y) and game.level.map:isBound(x, y) and game.level.map(x, y, Map.ACTOR) then
local target = game.level.map(x, y, Map.ACTOR)
self:attackTarget(target, nil, 1.4 + self:getTalentLevel(t) / 10, true)
end
end end
local tg = {type="hit", range=self:getTalentRange(t)}
local x, y, target = self:getTarget(tg)
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)) > 1 then return nil end
self:attackTarget(target, nil, 1.8 + self:getTalentLevel(t) / 10, true)
self:attackTarget(target, nil, 1.8 + self:getTalentLevel(t) / 10, true)
self:attackTarget(target, nil, 1.8 + self:getTalentLevel(t) / 10, true)
return true
end,
info = function(self, t)
return ([[Spin around, damaging all targets around with both weapons for %d%%.]]):format(100 * (1.4 + self:getTalentLevel(t) / 10))
return ([[Lashes out a flurry of blows, hiting your target three times with each weapons for %d%% damage.]]):format(100 * (1.8 + self:getTalentLevel(t) / 10))
end,
}
newTalent{
name = "Momentum",
type = {"technique/dualweapon", 3},
mode = "sustained",
name = "Sweep",
type = {"technique/dualweapon-attack", 3},
points = 5,
cooldown = 30,
sustain_stamina = 50,
require = { stat = { dex=20 }, },
activate = function(self, t)
local weapon = self:getInven("MAINHAND")[1]
local offweapon = self:getInven("OFFHAND")[1]
if not weapon or not offweapon or not weapon.combat or not offweapon.combat then
game.logPlayer(self, "You cannot use Flurry without dual wielding!")
cooldown = 8,
stamina = 30,
require = techs_dex_req3,
action = function(self, t)
local weapon, offweapon = self:hasDualWeapon()
if not weapon then
game.logPlayer(self, "You cannot use Sweep without dual wielding!")
return nil
end
return {
combat_physspeed = self:addTemporaryValue("combat_physspeed", -0.1 - self:getTalentLevel(t) / 10),
stamina_regen = self:addTemporaryValue("stamina_regen", -5),
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("combat_physspeed", p.combat_physspeed)
self:removeTemporaryValue("stamina_regen", p.stamina_regen)
local tg = {type="hit", range=self:getTalentRange(t)}
local x, y, target = self:getTarget(tg)
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)) > 1 then return nil end
local dir = util.getDir(x, y, self.x, self.y)
local lx, ly = util.coordAddDir(self.x, self.y, dir_sides[dir].left)
local rx, ry = util.coordAddDir(self.x, self.y, dir_sides[dir].right)
local lt, rt = game.level.map(lx, ly, Map.ACTOR), game.level.map(rx, ry, Map.ACTOR)
local hit
hit = self:attackTarget(target, nil, 1.2 + self:getTalentLevel(t) / 10, true)
if hit and target:canBe("cut") then target:setEffect(target.EFF_CUT, 3 + self:getTalentLevel(t), {power=self:getDex() * 0.5, src=self}) end
if lt then
hit = self:attackTarget(lt, nil, 1.2 + self:getTalentLevel(t) / 10, true)
if hit and lt:canBe("cut") then lt:setEffect(lt.EFF_CUT, 3 + self:getTalentLevel(t), {power=self:getDex() * 0.5, src=self}) end
end
if rt then
hit = self:attackTarget(rt, nil, 1.2 + self:getTalentLevel(t) / 10, true)
if hit and rt:canBe("cut") then rt:setEffect(rt.EFF_CUT, 3 + self:getTalentLevel(t), {power=self:getDex() * 0.5, src=self}) end
end
print(x,y,target)
print(lx,ly,lt)
print(rx,ry,rt)
return true
end,
info = function(self, t)
return ([[Increases attack speed by %0.2f, but drains stamina quickly.]]):format(-0.1 - self:getTalentLevel(t) / 10)
return ([[Attack your foes in a frontal arc doing %d%% weapon damage and making your targets bleed for %d each turn for %d turns.]]):
format(100 * (1.4 + self:getTalentLevel(t) / 10), self:getDex() * 0.5, 3 + self:getTalentLevel(t))
end,
}
newTalent{
name = "Momentum",
type = {"technique/dualweapon", 3},
mode = "sustained",
name = "Whirlwind",
type = {"technique/dualweapon-attack", 4},
points = 5,
cooldown = 30,
sustain_stamina = 50,
require = { stat = { dex=20 }, },
activate = function(self, t)
local weapon = self:getInven("MAINHAND")[1]
local offweapon = self:getInven("OFFHAND")[1]
if not weapon or not offweapon or not weapon.combat or not offweapon.combat then
game.logPlayer(self, "You cannot use Flurry without dual wielding!")
cooldown = 8,
stamina = 30,
require = techs_dex_req4,
action = function(self, t)
local weapon, offweapon = self:hasDualWeapon()
if not weapon then
game.logPlayer(self, "You cannot use Whirlwind without dual wielding!")
return nil
end
return {
combat_physspeed = self:addTemporaryValue("combat_physspeed", -0.1 - self:getTalentLevel(t) / 10),
stamina_regen = self:addTemporaryValue("stamina_regen", -5),
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("combat_physspeed", p.combat_physspeed)
self:removeTemporaryValue("stamina_regen", p.stamina_regen)
for i = -1, 1 do for j = -1, 1 do
local x, y = self.x + i, self.y + j
if (self.x ~= x or self.y ~= y) and game.level.map:isBound(x, y) and game.level.map(x, y, Map.ACTOR) then
local target = game.level.map(x, y, Map.ACTOR)
self:attackTarget(target, nil, 1.4 + self:getTalentLevel(t) / 10, true)
end
end end
return true
end,
info = function(self, t)
return ([[Greatly increases attack speed, but drains stamina quickly.]])
return ([[Spin around, damaging all targets around with both weapons for %d%%.]]):format(100 * (1.4 + self:getTalentLevel(t) / 10))
end,
}
......@@ -3,7 +3,8 @@ newTalentType{ type="technique/2hweapon-offense", name = "two handed weapons", d
newTalentType{ type="technique/2hweapon-cripple", name = "two handed weapons", description = "Specialized two handed techniques." }
newTalentType{ type="technique/shield-offense", name = "weapon and shields", description = "Specialized weapon and shield techniques." }
newTalentType{ type="technique/shield-defense", name = "weapon and shields", description = "Specialized weapon and shield techniques." }
newTalentType{ type="technique/dualweapon", name = "dual wielding", description = "Specialized dual wielding techniques." }
newTalentType{ type="technique/dualweapon-training", name = "dual wielding", description = "Specialized dual wielding techniques." }
newTalentType{ type="technique/dualweapon-attack", name = "dual wielding", description = "Specialized dual wielding techniques." }
newTalentType{ type="technique/weapon-training", name = "weapon-training", description = "Grants bonuses to the different weapon types." }
newTalentType{ type="technique/combat-training", name = "combat-training", description = "Teaches to use various armors and improves health." }
......@@ -31,23 +32,23 @@ techs_req5 = {
-- Generic requires for techs_dex based on talent level
techs_dex_req1 = {
stat = { str=function(level) return 12 + (level-1) * 2 end },
stat = { dex=function(level) return 12 + (level-1) * 2 end },
level = function(level) return 0 + (level-1) end,
}
techs_dex_req2 = {
stat = { str=function(level) return 20 + (level-1) * 2 end },
stat = { dex=function(level) return 20 + (level-1) * 2 end },
level = function(level) return 4 + (level-1) end,
}
techs_dex_req3 = {
stat = { str=function(level) return 28 + (level-1) * 2 end },
stat = { dex=function(level) return 28 + (level-1) * 2 end },
level = function(level) return 8 + (level-1) end,
}
techs_dex_req4 = {
stat = { str=function(level) return 36 + (level-1) * 2 end },
stat = { dex=function(level) return 36 + (level-1) * 2 end },
level = function(level) return 12 + (level-1) end,
}
techs_dex_req5 = {
stat = { str=function(level) return 44 + (level-1) * 2 end },
stat = { dex=function(level) return 44 + (level-1) * 2 end },
level = function(level) return 16 + (level-1) end,
}
......
......@@ -21,7 +21,7 @@ newTalent{
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)) > 1 then return nil end
self:attackTargetWith(target, shield.special_combat, nil, 1.5 + self:getTalentLevel(t) / 5)
local speed, hit = self:attackTargetWith(target, shield.special_combat, nil, 1.3 + self:getTalentLevel(t) / 5)
local speed, hit = self:attackTargetWith(target, shield.special_combat, nil, 1.3 + (self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE) / 2) / 5)
-- Try to stun !
if hit then
......@@ -36,7 +36,7 @@ newTalent{
end,
info = function(self, t)
return ([[Hits the target with two shield strikes, stunning it and doing %d%% shield damage.
The damage multiplier increases with your strength.]]):format(100 * (1.3 + self:getTalentLevel(t) / 5))
The damage multiplier increases with your strength.]]):format(100 * (1.3 + (self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE) / 2) / 5))
end,
}
......@@ -73,9 +73,9 @@ newTalent{
-- First attack with weapon
self:attackTarget(target, nil, 1.5 + self:getTalentLevel(t) / 10, true)
-- Second attack with shield
self:attackTargetWith(target, shield.special_combat, nil, 1.5 + self:getTalentLevel(t) / 10)
self:attackTargetWith(target, shield.special_combat, nil, 1.5 + (self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE) / 2) / 10)
-- Third attack with shield
local speed, hit = self:attackTargetWith(target, shield.special_combat, nil, 1.5 + self:getTalentLevel(t) / 10)
local speed, hit = self:attackTargetWith(target, shield.special_combat, nil, 1.5 + (self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE)) / 10)
-- Try to stun !
if hit then
......@@ -90,7 +90,7 @@ newTalent{
end,
info = function(self, t)
return ([[Hits the target with your weapon and two shield strikes doing %d%% damage, trying to overpower your target.
If the last attack hits, the target is knocked back.]]):format(100 * (1.5 + self:getTalentLevel(t) / 10))
If the last attack hits, the target is knocked back.]]):format(100 * (1.5 + (self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE) / 2) / 10))
end,
}
......@@ -114,7 +114,7 @@ newTalent{
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
-- First attack with shield
local speed, hit = self:attackTargetWith(target, shield.special_combat, nil, 1.8 + self:getTalentLevel(t) / 10)
local speed, hit = self:attackTargetWith(target, shield.special_combat, nil, 1.8 + (self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE) / 2) / 10)
-- Second & third attack with weapon
if hit then
......@@ -128,7 +128,7 @@ newTalent{
end,
info = function(self, t)
return ([[Hits the target with shield doing %d%% damage. If it hits you follow up with 2 weapon strikes which are automatic crits.]]):
format(100 * (1.8 + self:getTalentLevel(t) / 10))
format(100 * (1.8 + (self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE) / 2) / 10))
end,
}
......@@ -159,8 +159,8 @@ newTalent{
return {
atk = self:addTemporaryValue("combat_dam", -10),
dam = self:addTemporaryValue("combat_atk", -10),
def = self:addTemporaryValue("combat_def", 5 + self:getDex(4) * self:getTalentLevel(t)),
armor = self:addTemporaryValue("combat_armor", 5 + self:getCun(4) * self:getTalentLevel(t)),
def = self:addTemporaryValue("combat_def", 5 + self:getDex(4) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE) * 2),
armor = self:addTemporaryValue("combat_armor", 5 + self:getCun(4) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE)),
stun = stun,
knock = knock
}
......@@ -176,7 +176,10 @@ newTalent{
end,
info = function(self, t)
return ([[Enters a protective battle stance, increasing defense by %d and armor by %d at the cost of 10 attack and 10 damage.
At level 5 it also makes you immnue to stuns and knockbacks.]]):format(5 + self:getDex(4) * self:getTalentLevel(t), 5 + self:getCun(4) * self:getTalentLevel(t))
At level 5 it also makes you immnue to stuns and knockbacks.]]):format(
5 + self:getDex(4) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE),
5 + self:getCun(4) * self:getTalentLevel(t) + self:getTalentLevel(self.T_SHIELD_EXPERTISE)
)
end,
}
......@@ -219,8 +222,16 @@ newTalent{
require = techs_req3,
mode = "passive",
points = 5,
on_learn = function(self, t)
self.combat_physresist = self.combat_physresist + 4
self.combat_spellresist = self.combat_spellresist + 2
end,
on_unlearn = function(self, t)
self.combat_physresist = self.combat_physresist + 4
self.combat_spellresist = self.combat_spellresist + 2
end,
info = function(self, t)
return ([[.]]):format()
return ([[Improves your damage with shield attacks and increases your spell and physical resistance.]]):format()
end,
}
......
......@@ -9,7 +9,7 @@ newEffect{
on_gain = function(self, err) return "#Target# starts to bleed.", "+Bleeds" end,
on_lose = function(self, err) return "#Target# stops bleeding.", "-Bleeds" end,
on_timeout = function(self, eff)
self:takeHit(eff.power, self)
DamageType:get(DamageType.PHYSICAL).projector(eff.src or self, self.x, self.y, DamageType.PHYSICAL, eff.power)
end,
}
......
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