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

multilevel talents, masteries, knifes, more talents, ...

git-svn-id: http://svn.net-core.org/repos/t-engine4@182 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5220bc7e
No related branches found
No related tags found
No related merge requests found
Showing
with 364 additions and 119 deletions
......@@ -119,14 +119,18 @@ function _M:drawHBorder(s, x, y, h)
end
end
function _M:drawSelectionList(s, x, y, hskip, list, sel, prop)
for i, v in ipairs(list) do
function _M:drawSelectionList(s, x, y, hskip, list, sel, prop, scroll, max)
scroll = scroll or 1
max = max or 99999
for i = scroll, math.min(#list, scroll + max - 1) do
v = list[i]
if prop then v = tostring(v[prop])
else v = tostring(v) end
if sel == i then
s:drawColorString(self.font, v, x, y + (i-1) * hskip, 0, 255, 255)
s:drawColorString(self.font, v, x, y + (i-scroll) * hskip, 0, 255, 255)
else
s:drawColorString(self.font, v, x, y + (i-1) * hskip)
s:drawColorString(self.font, v, x, y + (i-scroll) * hskip)
end
end
end
......@@ -10,7 +10,10 @@ function _M:init(actor)
self:generateList()
self.talentsel = 1
self.sel = 1
self.scroll = 1
self.max = math.floor((self.ih - 5) / self.font_h) - 1
self:keyCommands{
_1 = function() self:defineHotkey(1) end,
_2 = function() self:defineHotkey(2) end,
......@@ -25,20 +28,20 @@ function _M:init(actor)
_RIGHTPAREN = function() self:defineHotkey(11) end,
_EQUALS = function() self:defineHotkey(12) end,
_UP = function() self.talentsel = util.boundWrap(self.talentsel - 1, 1, #self.list) end,
_DOWN = function() self.talentsel = util.boundWrap(self.talentsel + 1, 1, #self.list) end,
_UP = function() self.sel = util.boundWrap(self.sel - 1, 1, #self.list) self.scroll = util.scroll(self.sel, self.scroll, self.max) self.changed = true end,
_DOWN = function() self.sel = util.boundWrap(self.sel + 1, 1, #self.list) self.scroll = util.scroll(self.sel, self.scroll, self.max) self.changed = true end,
_RETURN = function() self:use() end,
_ESCAPE = function() game:unregisterDialog(self) end,
__TEXTINPUT = function(c)
if c:find("^[a-z]$") then
self.talentsel = util.bound(1 + string.byte(c) - string.byte('a'), 1, #self.list)
self.sel = util.bound(1 + string.byte(c) - string.byte('a'), 1, #self.list)
self:use()
end
end,
}
self:mouseZones{
{ x=2, y=5, w=350, h=self.font_h*#self.list, fct=function(button, x, y, xrel, yrel, tx, ty)
self.talentsel = 1 + math.floor(ty / self.font_h)
self.sel = self.scroll + math.floor(ty / self.font_h)
if button == "left" then self:use()
elseif button == "right" then
end
......@@ -47,14 +50,14 @@ function _M:init(actor)
end
function _M:defineHotkey(id)
self.actor.hotkey[id] = self.list[self.talentsel].talent
self:simplePopup("Hotkey "..id.." assigned", self.actor:getTalentFromId(self.list[self.talentsel].talent).name:capitalize().." assigned to hotkey "..id)
self.actor.hotkey[id] = self.list[self.sel].talent
self:simplePopup("Hotkey "..id.." assigned", self.actor:getTalentFromId(self.list[self.sel].talent).name:capitalize().." assigned to hotkey "..id)
self.actor.changed = true
end
function _M:use()
game:unregisterDialog(self)
self.actor:useTalent(self.list[self.talentsel].talent)
self.actor:useTalent(self.list[self.sel].talent)
end
function _M:generateList()
......@@ -83,7 +86,8 @@ Mouse: #00FF00#Left click#FFFFFF# to use.
]]):splitLines(self.iw / 2 - 10, self.font)
local lines = {}
lines = self.actor:getTalentFromId(self.list[self.talentsel].talent).info(self.actor):splitLines(self.iw / 2 - 10, self.font)
local t = self.actor:getTalentFromId(self.list[self.sel].talent)
lines = t.info(self.actor, t):splitLines(self.iw / 2 - 10, self.font)
local h = 2
for i = 1, #talentshelp do
s:drawColorString(self.font, talentshelp[i], self.iw / 2 + 5, h)
......@@ -98,5 +102,5 @@ Mouse: #00FF00#Left click#FFFFFF# to use.
end
-- Talents
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.talentsel, "name")
self:drawSelectionList(s, 2, 5, self.font_h, self.list, self.sel, "name", self.scroll, self.max)
end
......@@ -57,15 +57,22 @@ end
--- Adds an object to an inventory
-- @return false if the object could not be added
function _M:addObject(inven, o)
function _M:addObject(inven_id, o)
local inven
if type(inven_id) == "number" then
inven = self.inven[inven_id]
else
inven = inven_id
end
-- No room ?
if #self.inven[inven] >= self.inven[inven].max then return false end
if #inven >= inven.max then return false end
-- Ok add it
table.insert(self.inven[inven], o)
table.insert(inven, o)
-- Do whatever is needed when wearing this object
if self.inven[inven].worn then self:onWear(o) end
if inven.worn then self:onWear(o) end
return true
end
......@@ -205,6 +212,9 @@ function _M:wearObject(o, replace, vocal)
if self:addObject(inven, o) then
if vocal then game.logSeen(self, "%s wears: %s.", self.name:capitalize(), o:getName()) end
return true
elseif o.offslot and self:getInven(o.offslot) and #(self:getInven(o.offslot)) < self:getInven(o.offslot).max then
-- Warning: assume there is now space
self:addObject(self:getInven(o.offslot), o)
elseif replace then
local ro = self:removeObject(inven, 1)
-- Warning: assume there is now space
......
......@@ -53,7 +53,7 @@ function _M:newTalent(t)
end
-- Remove line stat with tabs to be cleaner ..
local info = t.info
t.info = function(self) return info(self):gsub("\n\t+", "\n") end
t.info = function(self, t) return info(self, t):gsub("\n\t+", "\n") end
table.insert(self.talents_def, t)
t.id = #self.talents_def
......@@ -68,6 +68,7 @@ end
function _M:init(t)
self.talents = t.talents or {}
self.talents_types = t.talents_types or {}
self.talents_types_mastery = {}
self.talents_cd = {}
self.sustain_talents = {}
end
......@@ -84,6 +85,7 @@ function _M:useTalent(id)
end
if not self:preUseTalent(ab) then return end
local co = coroutine.create(function()
print("USING", ab, ab.name)
local ret = ab.action(self, ab)
if not self:postUseTalent(ab, ret) then return end
......@@ -181,19 +183,21 @@ function _M:learnTalent(t_id, force)
if not ok and err then return nil, err end
end
-- Auto assign to hotkey
if t.mode ~= "passive" and self.hotkey then
for i = 1, 12 do
if not self.hotkey[i] then
self.hotkey[i] = t_id
break
if not self.talents[t_id] then
-- Auto assign to hotkey
if t.mode ~= "passive" and self.hotkey then
for i = 1, 12 do
if not self.hotkey[i] then
self.hotkey[i] = t_id
break
end
end
end
end
if t.on_learn then t.on_learn(self, t) end
self.talents[t_id] = true
self.talents[t_id] = (self.talents[t_id] or 0) + 1
self.changed = true
return true
end
......@@ -204,15 +208,18 @@ end
function _M:unlearnTalent(t_id)
local t = _M.talents_def[t_id]
if self.hotkey then
for i, known_t_id in pairs(self.hotkey) do
if known_t_id == t_id then self.hotkey[i] = nil end
if self.talents[t_id] and self.talents[t_id] == 1 then
if self.hotkey then
for i, known_t_id in pairs(self.hotkey) do
if known_t_id == t_id then self.hotkey[i] = nil end
end
end
end
if t.on_unlearn then t.on_unlearn(self, t) end
self.talents[t_id] = nil
self.talents[t_id] = self.talents[t_id] - 1
if self.talents[t_id] == 0 then self.talents[t_id] = nil end
self.changed = true
return true
end
......@@ -292,6 +299,32 @@ function _M:knowTalent(id)
return self.talents[id] and true or false
end
--- Talent level, 0 if not known
function _M:getTalentLevelRaw(id)
if type(id) == "table" then id = id.id end
return self.talents[id] or 0
end
--- Talent level, 0 if not known
-- Includes mastery
function _M:getTalentLevel(id)
local t
if type(id) == "table" then
print("GET LEVEL", id, id.name)
t, id = id, id.id
else
t = _M.talents_def[id]
end
print("ma", self.talents[id], self.talents_types_mastery[t.type[1]], t.type[1])
return (self.talents[id] or 0) * (self.talents_types_mastery[t.type[1]] or 1)
end
--- Return talent definition from id
function _M:getTalentTypeMastery(tt)
return self.talents_types_mastery[tt] or 1
end
--- Return talent definition from id
function _M:getTalentFromId(id)
return _M.talents_def[id]
......
......@@ -229,6 +229,11 @@ function util.bound(i, min, max)
elseif i > max then i = max end
return i
end
function util.scroll(sel, scroll, max)
if sel > scroll + max - 1 then scroll = sel - max + 1 end
if sel < scroll then scroll = sel end
return scroll
end
function core.fov.circle_grids(x, y, radius, block)
local grids = {}
......
......@@ -202,12 +202,12 @@ function _M:preUseTalent(ab, silent)
if not self:enoughEnergy() then print("fail energy") return false end
if ab.mode == "sustained" then
if ab.sustain_mana and self.max_mana < ab.sustain_mana then
game.logPlayer(self, "You do not have enough mana to cast %s.", ab.name)
if ab.sustain_mana and self.max_mana < ab.sustain_mana and not self:isTalentActive(ab.id) then
game.logPlayer(self, "You do not have enough mana to activate %s.", ab.name)
return false
end
if ab.sustain_stamina and self.max_stamina < ab.sustain_stamina then
game.logPlayer(self, "You do not have enough stamina to use %s.", ab.name)
if ab.sustain_stamina and self.max_stamina < ab.sustain_stamina and not self:isTalentActive(ab.id) then
game.logPlayer(self, "You do not have enough stamina to activate %s.", ab.name)
return false
end
else
......
......@@ -22,7 +22,7 @@ function _M:display()
local talents = {}
for i = 1, 12 do
if a.hotkey[i] then
talents[#talents+1] = a.hotkey[i]
talents[#talents+1] = {a.hotkey[i], i}
end
end
......@@ -32,7 +32,9 @@ function _M:display()
local x = 0
local y = 0
for i, tid in ipairs(talents) do
for ii, ts in ipairs(talents) do
local tid = ts[1]
local i = ts[2]
local t = a:getTalentFromId(tid)
local s
if a:isTalentCoolingDown(t) then
......
......@@ -52,10 +52,15 @@ function _M:attackTarget(target, damtype, mult, noenergy)
end
end
-- All wpeaons in off hands
-- Offhand atatcks are with a damage penality, taht can be reduced by talents
if self:getInven(self.INVEN_OFFHAND) then
local offmult = (mult or 1) / 2
if self:knowTalent(Talents.T_DUAL_WEAPON_TRAINING) then
offmult = (mult or 1) / (2 - (self:getTalentLevel(Talents.T_DUAL_WEAPON_TRAINING) / 6))
end
for i, o in ipairs(self:getInven(self.INVEN_OFFHAND)) do
if o.combat then
local s = self:attackTargetWith(target, o.combat, damtype, mult)
local s = self:attackTargetWith(target, o.combat, damtype, offmult)
speed = math.max(speed or 0, s)
end
end
......@@ -118,26 +123,17 @@ function _M:attackTargetWith(target, weapon, damtype, mult)
end
local weapon_talents = {
sword = { Talents.T_SWORD_APPRENTICE, Talents.T_SWORD_MASTER, Talents.T_SWORD_GRAND_MASTER },
axe = { Talents.T_AXE_APPRENTICE, Talents.T_AXE_MASTER, Talents.T_AXE_GRAND_MASTER },
mace = { Talents.T_MACE_APPRENTICE, Talents.T_MACE_MASTER, Talents.T_MACE_GRAND_MASTER },
knife = { Talents.T_KNIFE_APPRENTICE, Talents.T_KNIFE_MASTER, Talents.T_KNIFE_GRAND_MASTER },
sword = Talents.T_SWORD_MASTERY,
axe = Talents.T_AXE_MASTERY,
mace = Talents.T_MACE_MASTERY,
knife = Talents.T_KNIFE_MASTERY,
}
--- Checks weapon training
function _M:combatCheckTraining(weapon)
if not weapon.talented then return 0 end
local max = 0
for i, tid in ipairs(weapon_talents[weapon.talented] or {}) do
print("Try", i, tid)
if not self:knowTalent(tid) then
break
end
max = i
end
print("Talented with", weapon.talented, "at", max, "using", #weapon_talents[weapon.talented])
return max
if not weapon_talents[weapon.talented] then return 0 end
return self:getTalentLevel(weapon_talents[weapon.talented])
end
--- Gets the defense
......
......@@ -14,6 +14,8 @@ newBirthDescriptor{
},
talents = { ActorTalents.T_STAMINA_POOL, },
copy = {
max_life = 120,
life_rating = 10,
equipment = resolvers.equip{
{type="weapon", subtype="longsword", name="iron longsword"},
{type="armor", subtype="shield", name="iron shield"},
......@@ -32,6 +34,47 @@ newBirthDescriptor{
talents_types = {
["physical/shield"]=true,
["physical/2hweapon"]=true,
["physical/combat-training"]=true,
["physical/weapon-training"]=true,
},
}
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, },
copy = {
max_life = 100,
life_rating = 9,
equipment = resolvers.equip{
{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=3, con=1, cun=2, },
talents_types = {
["physical/dualweapon"]=true,
["physical/combat-training"]=true,
["physical/weapon-training"]=true,
......@@ -54,6 +97,8 @@ newBirthDescriptor{
},
talents = { ActorTalents.T_MANA_POOL, },
copy = {
max_life = 80,
life_rating = 7,
equipment = resolvers.equip{
{type="weapon", subtype="staff", name="elm staff"},
{type="armor", subtype="cloth", name="robe"}
......
......@@ -40,7 +40,7 @@ newEntity{ base = "BASE_NPC_MOLD",
max_life = resolvers.rngavg(1,1),
combat = { dam=5, atk=15, apr=10 },
talents = resolvers.talents{ Talents.T_SPORE_BLIND },
talents = resolvers.talents{ [Talents.T_SPORE_BLIND]=1 },
}
newEntity{ base = "BASE_NPC_MOLD",
......@@ -50,5 +50,5 @@ newEntity{ base = "BASE_NPC_MOLD",
rarity = 4,
max_life = resolvers.rngavg(5,9),
combat = { dam=5, atk=15, apr=10 },
talents = resolvers.talents{ Talents.T_SPORE_POISON },
talents = resolvers.talents{ [Talents.T_SPORE_POISON]=1 },
}
......@@ -44,7 +44,7 @@ newEntity{ base = "BASE_NPC_SKELETON",
max_mana = resolvers.rngavg(40,50),
combat_armor = 3, combat_def = 1,
stats = { str=10, dex=12, cun=14, mag=14, con=10 },
talents = resolvers.talents{ Talents.T_MANA_POOL, Talents.T_FLAME, Talents.T_MANATHRUST },
talents = resolvers.talents{ [Talents.T_MANA_POOL]=1, [Talents.T_FLAME]=2, [Talents.T_MANATHRUST]=3 },
equipment = resolvers.equip{ {type="weapon", subtype="staff"} },
......
......@@ -21,7 +21,7 @@ newEntity{ base = "BASE_NPC_VERMIN",
max_life = resolvers.rngavg(5,9),
combat = { dam=5, atk=15, apr=10 },
talents = resolvers.talents{ Talents.T_CRAWL_POISON },
talents = resolvers.talents{ [Talents.T_CRAWL_POISON]=1 },
}
newEntity{ base = "BASE_NPC_VERMIN",
......@@ -31,5 +31,5 @@ newEntity{ base = "BASE_NPC_VERMIN",
max_life = resolvers.rngavg(5,9),
combat = { dam=5, atk=15, apr=10 },
talents = resolvers.talents{ Talents.T_CRAWL_ACID },
talents = resolvers.talents{ [Talents.T_CRAWL_ACID]=2 },
}
newEntity{
define_as = "BASE_KNIFE",
slot = "MAINHAND", offslot = "OFFHAND",
type = "weapon", subtype="dagger",
display = "/", color=colors.WHITE,
encumber = 1,
rarity = 3,
combat = { talented = "knife", },
desc = [[Sharp, long, and deadly.]],
-- egos = "/data/general/objects/egos/swords.lua", egos_chance = resolvers.mbonus(40, 5),
}
newEntity{ base = "BASE_KNIFE",
name = "iron dagger",
level_range = {1, 10},
require = { stat = { dex=11 }, },
cost = 5,
combat = {
dam = resolvers.rngavg(4,6),
apr = 5,
physcrit = 4,
dammod = {dex=1},
},
}
newEntity{ base = "BASE_KNIFE",
name = "steel dagger",
level_range = {10, 20},
require = { stat = { dex=16 }, },
cost = 10,
combat = {
dam = resolvers.rngavg(8,15),
apr = 6,
physcrit = 5,
dammod = {dex=1},
},
}
newEntity{ base = "BASE_KNIFE",
name = "dwarven-steel dagger",
level_range = {20, 30},
require = { stat = { dex=24 }, },
cost = 15,
combat = {
dam = resolvers.rngavg(18,25),
apr = 7,
physcrit = 6,
dammod = {dex=1},
},
}
newEntity{ base = "BASE_KNIFE",
name = "galvorn dagger",
level_range = {30, 40},
require = { stat = { dex=35 }, },
cost = 25,
combat = {
dam = resolvers.rngavg(38,45),
apr = 9,
physcrit = 8,
dammod = {dex=1},
},
}
newEntity{ base = "BASE_KNIFE",
name = "mithril dagger",
level_range = {40, 50},
require = { stat = { dex=48 }, },
cost = 35,
combat = {
dam = resolvers.rngavg(48,55),
apr = 9,
physcrit = 10,
dammod = {dex=1},
},
}
......@@ -11,7 +11,7 @@ newEntity{
newEntity{ base = "BASE_LIGHT_ARMOR",
name = "rough leather armour",
level_range = {1, 10},
require = { stat = { str=12 }, },
require = { stat = { str=10 }, },
cost = 10,
wielder = {
combat_def = 1,
......
......@@ -8,6 +8,7 @@ load("/data/general/objects/jewelry.lua")
load("/data/general/objects/staves.lua")
load("/data/general/objects/swords.lua")
load("/data/general/objects/2hswords.lua")
load("/data/general/objects/knifes.lua")
--load("/data/general/objects/maces.lua")
--load("/data/general/objects/axes.lua")
......
......@@ -41,13 +41,14 @@ newTalent{
short_name = "CRAWL_POISON",
name = "Poisonous Crawl",
type = {"physical/other", 1},
points = 5,
message = "@Source@ crawls poison onto @target@.",
cooldown = 5,
range = 1,
action = function(self, t)
local x, y, target = self:getTarget()
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
self:attackTarget(target, DamageType.POISON, 2, true)
self:attackTarget(target, DamageType.POISON, 2 + self:getTalentLevel(t), true)
return true
end,
info = function(self)
......@@ -58,6 +59,7 @@ newTalent{
newTalent{
short_name = "CRAWL_ACID",
name = "Acidic Crawl",
points = 5,
type = {"physical/other", 1},
message = "@Source@ crawls acid onto @target@.",
cooldown = 2,
......@@ -65,7 +67,7 @@ newTalent{
action = function(self, t)
local x, y, target = self:getTarget()
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
self:attackTarget(target, DamageType.POISON, 1.5, true)
self:attackTarget(target, DamageType.ACID, 1 + self:getTalentLevel(t) / 3, true)
return true
end,
info = function(self)
......@@ -77,6 +79,7 @@ newTalent{
short_name = "SPORE_BLIND",
name = "Blinding Spores",
type = {"physical/other", 1},
points = 5,
message = "@Source@ releases blinding spores at @target@.",
cooldown = 2,
range = 1,
......@@ -85,7 +88,7 @@ newTalent{
local x, y, target = self:getTarget(t)
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, DamageType.BLIND, 1, true)
self:attackTarget(target, DamageType.BLIND, 0.8 + self:getTalentLevel(t) / 10, true)
return true
end,
info = function(self)
......@@ -97,13 +100,14 @@ newTalent{
short_name = "SPORE_POISON",
name = "Poisonous Spores",
type = {"physical/other", 1},
points = 5,
message = "@Source@ releases poisonous spores at @target@.",
cooldown = 2,
range = 1,
action = function(self, t)
local x, y, target = self:getTarget()
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
self:attackTarget(target, DamageType.POISON, 1.5, true)
self:attackTarget(target, DamageType.POISON, 2 + self:getTalentLevel(t), true)
return true
end,
info = function(self)
......
......@@ -3,11 +3,12 @@
------------------------------------------------------------
-- Slime Powers!
------------------------------------------------------------
newTalentType{ type="physical/slime", name = "slime powers", description = "Through dedicated consumption of slime mold juice you have gained an affinity with them." }
newTalentType{ type="slime/slime", name = "slime powers", description = "Through dedicated consumption of slime mold juice you have gained an affinity with them." }
newTalent{
name = "Poisonous Spores",
type = {"physical/slime", 1},
type = {"slime/slime", 1},
points = 5,
message = "@Source@ releases poisonous spores at @target@.",
cooldown = 10,
range = 1,
......@@ -16,7 +17,7 @@ newTalent{
local x, y, target = self:getTarget(t)
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, DamageType.POISON, 1.5, true)
self:attackTarget(target, DamageType.POISON, 1.5 + self:getTalentLevel(t) / 5, true)
return true
end,
info = function(self)
......
newTalent{
name = "Stunning Blow",
type = {"physical/2hweapon", 1},
points = 5,
cooldown = 6,
stamina = 8,
require = { stat = { str=12 }, },
......@@ -19,8 +20,8 @@ newTalent{
-- Try to stun !
if hit then
if target:checkHit(self:combatAttackStr(weapon.combat), target:combatPhysicalResist(), 0, 95, 5) and target:canBe("stun") then
target:setEffect(target.EFF_STUNNED, 2 + self:getStr(4), {})
if target:checkHit(self:combatAttackStr(weapon.combat), target:combatPhysicalResist(), 0, 95, 10 - self:getTalentLevel(t)) and target:canBe("stun") then
target:setEffect(target.EFF_STUNNED, 2 + self:getTalentLevel(t), {})
else
game.logSeen(target, "%s resists the stunning blow!", target.name:capitalize())
end
......@@ -36,6 +37,7 @@ newTalent{
newTalent{
name = "Death Blow",
type = {"physical/2hweapon", 2},
points = 5,
cooldown = 30,
stamina = 15,
require = { stat = { str=22 }, },
......@@ -52,14 +54,14 @@ newTalent{
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
local inc = self.stamina / 2
if self:knowTalent(Talents.T_MIGHTY_BLOWS) then
if self:getTalentLevel(t) >= 4 then
self.combat_dam = self.combat_dam + inc
end
self.combat_physcrit = self.combat_physcrit + 100
local speed, hit = self:attackTargetWith(target, weapon.combat, nil, 1)
local speed, hit = self:attackTargetWith(target, weapon.combat, nil, 1 + self:getTalentLevel(t) / 10)
if self:knowTalent(Talents.T_MIGHTY_BLOWS) then
if self:getTalentLevel(t) >= 4 then
self.combat_dam = self.combat_dam - inc
self.stamina = 0
end
......@@ -67,7 +69,7 @@ newTalent{
-- Try to insta-kill
if hit then
if target:checkHit(self:combatAttackStr(weapon.combat), target:combatPhysicalResist(), 0, 95, 5) and target:canBe("instadeath") and target.life > 0 and target.life < target.max_life * 0.2 then
if target:checkHit(self:combatAttackStr(weapon.combat), target:combatPhysicalResist(), 0, 95, 10 - self:getTalentLevel(t)) and target:canBe("instadeath") and target.life > 0 and target.life < target.max_life * 0.2 then
-- KILL IT !
game.logSeen(target, "%s feels the pain of the death blow!", target.name:capitalize())
target:takeHit(100000, self)
......@@ -86,6 +88,7 @@ newTalent{
newTalent{
name = "Death Danse",
type = {"physical/2hweapon", 3},
points = 5,
cooldown = 10,
stamina = 30,
require = { stat = { str=30 }, },
......@@ -100,7 +103,7 @@ newTalent{
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:attackTargetWith(target, weapon.combat, nil, 1)
self:attackTargetWith(target, weapon.combat, nil, 1 + self:getTalentLevel(t) / 8)
end
end end
......@@ -115,6 +118,7 @@ newTalent{
name = "Berserker",
type = {"physical/2hweapon", 3},
mode = "sustained",
points = 5,
cooldown = 30,
sustain_stamina = 100,
require = { stat = { str=20 }, },
......@@ -126,8 +130,8 @@ newTalent{
end
return {
atk = self:addTemporaryValue("combat_dam", 5 + self:getStr(20)),
dam = self:addTemporaryValue("combat_atk", 5 + self:getDex(20)),
atk = self:addTemporaryValue("combat_dam", 5 + self:getStr(4) * self:getTalentLevel(t)),
dam = self:addTemporaryValue("combat_atk", 5 + self:getDex(4) * self:getTalentLevel(t)),
def = self:addTemporaryValue("combat_def", -5),
armor = self:addTemporaryValue("combat_armor", -5),
}
......@@ -143,13 +147,3 @@ newTalent{
return ([[Enters a protective battle stance, increasing attack and damage at the cost of defense and armor.]])
end,
}
newTalent{
name = "Mighty Blows",
type = {"physical/2hweapon", 4},
mode = "passive",
require = { stat = { str=40 }, talent = { Talents.T_DEATH_BLOW } },
info = function(self)
return ([[You put all your strength into your Death Blows, increasing attack and consuming all remaining stamina to increase damage.]])
end,
}
......@@ -22,46 +22,15 @@ newTalent{
name = "Health",
type = {"physical/combat-training", 1},
mode = "passive",
points = 5,
require = { stat = { con=14 }, },
on_learn = function(self, t)
self.max_life = self.max_life + 50
self.max_life = self.max_life + 40
end,
on_unlearn = function(self, t)
self.max_life = self.max_life - 50
self.max_life = self.max_life - 40
end,
info = function(self)
return [[Increases your maximun life by 50]]
end,
}
newTalent{
name = "Greater Health",
type = {"physical/combat-training", 2},
mode = "passive",
require = { stat = { con=24 }, talent = { Talents.T_HEALTH }, },
on_learn = function(self, t)
self.max_life = self.max_life + 70
end,
on_unlearn = function(self, t)
self.max_life = self.max_life - 70
end,
info = function(self)
return [[Increases your maximun life by 70]]
end,
}
newTalent{
name = "Supreme Health",
type = {"physical/combat-training", 3},
mode = "passive",
require = { stat = { con=34 }, talent = { Talents.T_GREATER_HEALTH }, },
on_learn = function(self, t)
self.max_life = self.max_life + 90
end,
on_unlearn = function(self, t)
self.max_life = self.max_life - 90
end,
info = function(self)
return [[Increases your maximun life by 90]]
return [[Increases your maximun life by 40 per talent level]]
end,
}
newTalent{
name = "Dual Weapon Training",
type = {"physical/dualweapon", 1},
mode = "passive",
points = 5,
require = { stat = { dex=14 } },
info = function(self)
return ([[Reduces the damage penality of the off-hand weapon]])
end,
}
newTalent{
name = "Flurry",
type = {"physical/dualweapon", 1},
points = 5,
cooldown = 12,
stamina = 15,
require = { stat = { dex=12 }, },
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!")
return nil
end
local t = {type="hit", range=self:getTalentRange(t)}
local x, y, target = self:getTarget(t)
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, 0.8 + self:getTalentLevel(t) / 10, true)
self:attackTarget(target, nil, 0.8 + self:getTalentLevel(t) / 10, true)
self:attackTarget(target, nil, 0.8 + self:getTalentLevel(t) / 10, true)
return true
end,
info = function(self)
return ([[Lashes out a flurry of blows, hiting your target three times with each weapons.]])
end,
}
newTalent{
name = "Whirlwind",
type = {"physical/dualweapon", 3},
points = 5,
cooldown = 8,
stamina = 30,
require = { stat = { dex=24 }, },
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!")
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 + self:getTalentLevel(t) / 10, true)
end
end end
return true
end,
info = function(self)
return ([[Spin around, damaging all targets around with both weapons.]])
end,
}
newTalent{
name = "Momentum",
type = {"physical/dualweapon", 3},
mode = "sustained",
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!")
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)
return true
end,
info = function(self)
return ([[Greatly increases attack speed, but drains stamina quickly.]])
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