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

Archery now correctly uses attack bonus from ammo

git-svn-id: http://svn.net-core.org/repos/t-engine4@2476 51575b47-30f0-44d4-a5cc-537603b46e54
parent b3220747
No related branches found
No related tags found
No related merge requests found
......@@ -121,7 +121,7 @@ local function archery_projectile(tx, ty, tg, self)
local mult = tg.archery.mult or 1
-- Does the blow connect? yes .. complex :/
local atk, def = self:combatAttack(weapon), target:combatDefenseRanged()
local atk, def = self:combatAttack(weapon, ammo), target:combatDefenseRanged()
local dam, apr, armor = self:combatDamage(ammo), self:combatAPR(ammo), target:combatArmor()
print("[ATTACK ARCHERY] to ", target.name, " :: ", dam, apr, armor, "::", mult)
if not self:canSee(target) then atk = atk / 3 end
......
......@@ -417,32 +417,31 @@ function _M:combatArmor()
end
--- Gets the attack
function _M:combatAttack(weapon)
function _M:combatAttackBase(weapon, ammo)
weapon = weapon or self.combat or {}
return self.combat_atk + self:getTalentLevel(Talents.T_WEAPON_COMBAT) * 5 + (weapon.atk or 0) + (ammo and ammo.atk or 0) + (self:getLck() - 50) * 0.4
end
function _M:combatAttack(weapon, ammo)
local stats
if self.use_psi_combat then stats = (self:getWil(50) - 5) + (self:getCun(50) - 5)
else stats = (self:getStr(50) - 5) + (self:getDex(50) - 5)
end
return self.combat_atk + self:getTalentLevel(Talents.T_WEAPON_COMBAT) * 5 + (weapon.atk or 0) + stats + (self:getLck() - 50) * 0.4
return self:combatAttackBase(weapon, ammo) + stats
end
--- Gets the attack using only strength
function _M:combatAttackStr(weapon)
weapon = weapon or self.combat or {}
return self.combat_atk + self:getTalentLevel(Talents.T_WEAPON_COMBAT) * 5 + (weapon.atk or 0) + (self:getStr(100) - 10) + (self:getLck() - 50) * 0.4
function _M:combatAttackStr(weapon, ammo)
return self:combatAttackBase(weapon, ammo) + (self:getStr(100) - 10)
end
--- Gets the attack using only dexterity
function _M:combatAttackDex(weapon)
weapon = weapon or self.combat or {}
return self.combat_atk + self:getTalentLevel(Talents.T_WEAPON_COMBAT) * 5 + (weapon.atk or 0) + (self:getDex(100) - 10) + (self:getLck() - 50) * 0.4
function _M:combatAttackDex(weapon, ammo)
return self:combatAttackBase(weapon, ammo) + (self:getDex(100) - 10)
end
--- Gets the attack using only magic
function _M:combatAttackDex(weapon)
weapon = weapon or self.combat or {}
return self.combat_atk + self:getTalentLevel(Talents.T_WEAPON_COMBAT) * 5 + (weapon.atk or 0) + (self:getMag(100) - 10) + (self:getLck() - 50) * 0.4
function _M:combatAttackMag(weapon, ammo)
return self:combatAttackBase(weapon, ammo) + (self:getMag(100) - 10)
end
--- Gets the armor penetration
......
......@@ -431,7 +431,7 @@ newEntity{ base = "BASE_NPC_HORROR",
newEntity{ base = "BASE_NPC_HORROR",
subtype = "temporal",
name = "temporal devourer", color=colors.CRIMSON,
desc = "A headless round creature with stubly legs and arms. It's body seems to be all teeth.",
desc = "A headless round creature with stubtly legs and arms. Its body seems to be all teeth.",
level_range = {10, nil}, exp_worth = 1,
rarity = 1,
rank = 2,
......
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