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

combat

git-svn-id: http://svn.net-core.org/repos/t-engine4@200 51575b47-30f0-44d4-a5cc-537603b46e54
parent bbd6780c
No related branches found
No related tags found
No related merge requests found
......@@ -124,6 +124,8 @@ function _M:attackTargetWith(target, weapon, damtype, mult)
local hitted = false
if self:checkHit(atk, def) then
local dam = dam - math.max(0, armor - apr)
local damrange = self:combatDamageRange(weapon)
dam = rng.range(dam, dam * damrange)
local crit
dam = dam * mult
dam, crit = self:physicalCrit(dam, weapon)
......@@ -197,6 +199,12 @@ function _M:combatCrit(weapon)
return self.combat_physcrit + (self:getCun() - 10) * 0.3 + (weapon.physcrit or 1)
end
--- Gets the damage range
function _M:combatDamageRange(weapon)
weapon = weapon or self.combat
return (self.combat_damrange or 0) + (weapon.damrange or 1.3)
end
--- Gets the damage
function _M:combatDamage(weapon)
weapon = weapon or self.combat
......
......@@ -6,7 +6,7 @@ newEntity{
display = "\\", color=colors.SLATE,
encumber = 5,
rarity = 3,
combat = { talented = "mace", },
combat = { talented = "mace", damrange = 1.5 },
desc = [[Massive two-handed maul.]],
twohanded = true,
}
......@@ -6,7 +6,7 @@ newEntity{
display = "/", color=colors.SLATE,
encumber = 3,
rarity = 3,
combat = { talented = "sword", },
combat = { talented = "sword", damrange = 1.6 },
desc = [[Massive two-handed swords.]],
twohanded = true,
}
......
......@@ -5,7 +5,7 @@ newEntity{
display = "/", color=colors.WHITE,
encumber = 1,
rarity = 3,
combat = { talented = "knife", },
combat = { talented = "knife", damrange = 1.3 },
desc = [[Sharp, long, and deadly.]],
-- egos = "/data/general/objects/egos/swords.lua", egos_chance = resolvers.mbonus(40, 5),
}
......@@ -19,7 +19,7 @@ newEntity{ base = "BASE_KNIFE",
dam = resolvers.rngavg(4,6),
apr = 5,
physcrit = 4,
dammod = {dex=1},
dammod = {dex=0.45,str=0.45},
},
}
......@@ -32,7 +32,7 @@ newEntity{ base = "BASE_KNIFE",
dam = resolvers.rngavg(8,15),
apr = 6,
physcrit = 5,
dammod = {dex=1},
dammod = {dex=0.45,str=0.45},
},
}
......@@ -45,7 +45,7 @@ newEntity{ base = "BASE_KNIFE",
dam = resolvers.rngavg(18,25),
apr = 7,
physcrit = 6,
dammod = {dex=1},
dammod = {dex=0.45,str=0.45},
},
}
......@@ -58,7 +58,7 @@ newEntity{ base = "BASE_KNIFE",
dam = resolvers.rngavg(38,45),
apr = 9,
physcrit = 8,
dammod = {dex=1},
dammod = {dex=0.45,str=0.45},
},
}
......@@ -71,6 +71,6 @@ newEntity{ base = "BASE_KNIFE",
dam = resolvers.rngavg(48,55),
apr = 9,
physcrit = 10,
dammod = {dex=1},
dammod = {dex=0.45,str=0.45},
},
}
......@@ -5,7 +5,7 @@ newEntity{
display = "/", color=colors.SLATE,
encumber = 3,
rarity = 3,
combat = { talented = "sword", },
combat = { talented = "sword", damrange = 1.4},
desc = [[Sharp, long, and deadly.]],
-- egos = "/data/general/objects/egos/swords.lua", egos_chance = resolvers.mbonus(40, 5),
}
......
......@@ -12,5 +12,6 @@ newEntity{ base = "BASE_GREATMAUL",
apr = 7,
physcrit = 1.5,
dammod = {str=1.3},
damrange = 1.7,
},
}
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