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

more ID

Lethalithy talent


git-svn-id: http://svn.net-core.org/repos/t-engine4@264 51575b47-30f0-44d4-a5cc-537603b46e54
parent 6a6f3960
No related branches found
No related tags found
No related merge requests found
Showing
with 62 additions and 16 deletions
......@@ -63,7 +63,12 @@ function _M:descAttribute(attr)
tms[#tms+1] = ("%0.2f %s"):format(i, name)
end
return table.concat(tms, ",")
elseif attr == "STATBONUS" then
local stat, i = next(self.wielder.inc_stats)
return i > 0 and "+"..i or tostring(i)
elseif attr == "COMBAT" then
local c = self.combat
return c.dam.."-"..(c.dam*(c.damrange or 1.1)).." dam, "..(c.apr or 0).." apr"
end
end
......@@ -78,6 +83,13 @@ function _M:getName()
name = name:gsub("~", ""):gsub("&", "a"):gsub("#([^#]+)#", function(attr)
return self:descAttribute(attr)
end)
if self.add_name and self:isIdentified() then
name = name .. self.add_name:gsub("#([^#]+)#", function(attr)
return self:descAttribute(attr)
end)
end
return name
end
......
......@@ -256,7 +256,10 @@ function _M:playerUseItem()
return o:canUseObject()
end,
function(o, item)
local ret = o:use(self)
local ret, no_id = o:use(self)
if not no_id then
o:identify(true)
end
if ret and ret == "destroy" then
if o.multicharge and o.multicharge > 1 then
o.multicharge = o.multicharge - 1
......
......@@ -203,7 +203,11 @@ end
--- Gets the crit rate
function _M:combatCrit(weapon)
weapon = weapon or self.combat
return self.combat_physcrit + (self:getCun() - 10) * 0.3 + (weapon.physcrit or 1)
local addcrit = 0
if weapon.talented and weapon.talented == "knife" and self:knowTalent(Talents.T_LETHALITY) then
addcrit = 1 + self:getTalentLevel(Talents.T_LETHALITY) * 1.3
end
return self.combat_physcrit + (self:getCun() - 10) * 0.3 + (weapon.physcrit or 1) + addcrit
end
--- Gets the damage range
......@@ -215,9 +219,14 @@ end
--- Gets the damage
function _M:combatDamage(weapon)
weapon = weapon or self.combat
local sub_con_to_str = false
if weapon.talented and weapon.talented == "knife" and self:knowTalent(Talents.T_LETHALITY) then sub_con_to_str = true end
local add = 0
if weapon.dammod then
for stat, mod in pairs(weapon.dammod) do
if sub_con_to_str and stat == "str" then stat = "cun" end
add = add + (self:getStat(stat) - 10) * mod
end
end
......
......@@ -16,7 +16,7 @@ newBirthDescriptor{
copy = {
max_life = 120,
life_rating = 10,
equipment = resolvers.equip{
equipment = resolvers.equip{ id=true,
{type="weapon", subtype="longsword", name="iron longsword"},
{type="armor", subtype="shield", name="iron shield"},
{type="armor", subtype="massive", name="iron massive armor"}
......@@ -63,7 +63,7 @@ newBirthDescriptor{
copy = {
max_life = 100,
life_rating = 9,
equipment = resolvers.equip{
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"}
......@@ -110,7 +110,7 @@ newBirthDescriptor{
copy = {
max_life = 80,
life_rating = 7,
equipment = resolvers.equip{
equipment = resolvers.equip{ id=true,
{type="weapon", subtype="staff", name="elm staff"},
{type="armor", subtype="cloth", name="robe"}
},
......
......@@ -8,10 +8,10 @@ newBirthDescriptor{
body = { INVEN = 1000, MAINHAND=1, OFFHAND=1, BODY=1 },
copy = {
resolvers.equip{
resolvers.equip{ id=true,
{type="lite", subtype="lite", name="brass lantern"},
},
resolvers.inventory{
resolvers.inventory{ id=true,
{type="potion", subtype="potion", name="potion of lesser healing"},
{type="potion", subtype="potion", name="potion of lesser healing"},
{type="potion", subtype="potion", name="potion of lesser healing"},
......
......@@ -3,6 +3,7 @@ newEntity{
slot = "MAINHAND",
slot_forbid = "OFFHAND",
type = "weapon", subtype="greatmaul",
add_name = " (#COMBAT#)",
display = "\\", color=colors.SLATE,
encumber = 5,
rarity = 3,
......
......@@ -3,6 +3,7 @@ newEntity{
slot = "MAINHAND",
slot_forbid = "OFFHAND",
type = "weapon", subtype="greatsword",
add_name = " (#COMBAT#)",
display = "/", color=colors.SLATE,
encumber = 3,
rarity = 3,
......
......@@ -2,7 +2,7 @@ local Stats = require "engine.interface.ActorStats"
local DamageType = require "engine.DamageType"
newEntity{
name = " of cunning",
name = " of cunning (#STATBONUS#)",
level_range = {1, 50},
rarity = 6,
cost = 4,
......@@ -11,7 +11,7 @@ newEntity{
},
}
newEntity{
name = " of willpower",
name = " of willpower (#STATBONUS#)",
level_range = {1, 50},
rarity = 6,
cost = 4,
......
......@@ -132,7 +132,7 @@ newEntity{
}
newEntity{
name = " of strength",
name = " of strength (#STATBONUS#)",
level_range = {1, 50},
rarity = 6,
cost = 4,
......@@ -141,7 +141,7 @@ newEntity{
},
}
newEntity{
name = " of dexterity",
name = " of dexterity (#STATBONUS#)",
level_range = {1, 50},
rarity = 6,
cost = 4,
......@@ -150,7 +150,7 @@ newEntity{
},
}
newEntity{
name = " of magic",
name = " of magic (#STATBONUS#)",
level_range = {1, 50},
rarity = 6,
cost = 4,
......@@ -159,7 +159,7 @@ newEntity{
},
}
newEntity{
name = " of constitution",
name = " of constitution (#STATBONUS#)",
level_range = {1, 50},
rarity = 6,
cost = 4,
......
......@@ -2,6 +2,7 @@ newEntity{
define_as = "BASE_KNIFE",
slot = "MAINHAND", offslot = "OFFHAND",
type = "weapon", subtype="dagger",
add_name = " (#COMBAT#)",
display = "/", color=colors.WHITE,
encumber = 1,
rarity = 3,
......
......@@ -2,6 +2,7 @@ newEntity{
define_as = "BASE_STAFF",
slot = "MAINHAND",
type = "weapon", subtype="staff",
add_name = " (#COMBAT#)",
display = "\\", color=colors.LIGHT_RED,
encumber = 5,
rarity = 3,
......
......@@ -2,6 +2,7 @@ newEntity{
define_as = "BASE_LONGSWORD",
slot = "MAINHAND",
type = "weapon", subtype="longsword",
add_name = " (#COMBAT#)",
display = "/", color=colors.SLATE,
encumber = 3,
rarity = 3,
......
newTalent{
name = "Lethality",
type = {"cunning/dirty", 1},
mode = "passive",
points = 5,
require = { stat = { cun=20 }, },
info = function(self, t)
return ([[You have learned to find and hit the weak spots. Your strikes have %0.2f%% more chances to be critical hits.
Also when using knives you now use your cunning score instead of your strength for bonus damage.]]):format(1 + self:getTalentLevel(t) * 1.3)
end,
}
......@@ -27,9 +27,9 @@ return {
},
object = {
class = "engine.generator.object.Random",
-- nb_object = {4, 6},
filters = { {type="potion" }, {type="potion" }, {type="potion" }, {type="scroll" }, {}, {} },
nb_object = {400, 600},
nb_object = {4, 6},
filters = { {type="potion" }, {type="scroll" }, {}, {} },
-- nb_object = {400, 600},
-- filters = { {type="jewelry", subtype="amulet" }, },
},
},
......
......@@ -20,6 +20,8 @@ function resolvers.calc.equip(t, e)
-- Do not drop it unless it is an ego or better
if not o.egoed and not o.unique then o.no_drop = true end
o:added()
if t[1].id then o:identify(t[1].id) end
end
end
-- Delete the origin field
......@@ -45,6 +47,8 @@ function resolvers.calc.inventory(t, e)
print("Zone made us an inventory according to filter!", o:getName())
e:addObject(e.INVEN_INVEN, o)
o:added()
if t[1].id then o:identify(t[1].id) end
end
end
e:sortInven()
......@@ -75,6 +79,8 @@ function resolvers.calc.drops(t, e)
print("Zone made us an drop according to filter!", o:getName())
e:addObject(e.INVEN_INVEN, o)
o:added()
if t.id then o:identify(t.id) end
end
end
-- Delete the origin field
......
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