Skip to content
Snippets Groups Projects
Commit 261e0e07 authored by DarkGod's avatar DarkGod
Browse files

Gesture of Pain doubles the damage bonus from mindstars and if dual wielding...

Gesture of Pain doubles the damage bonus from mindstars and if dual wielding mindstars will proc their on hit effects
parent 6eefcf30
No related branches found
No related tags found
No related merge requests found
......@@ -610,6 +610,40 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam)
end
]]
hitted = self:attackTargetHitProcs(target, weapon, dam, apr, armor, damtype, mult, atk, def, hitted, crit, evaded, repelled, old_target_life)
-- Visual feedback
if hitted then game.level.map:particleEmitter(target.x, target.y, 1, "melee_attack", {color=target.blood_color}) end
if Map.tiles and Map.tiles.use_images then if self.x and target.x then if target.x < self.x then self:MOflipX(self:isTileFlipped()) elseif target.x > self.x then self:MOflipX(not self:isTileFlipped()) end end end
self.turn_procs.weapon_type = nil
--Life Steal
if weapon and weapon.lifesteal then
self:attr("lifesteal", -weapon.lifesteal)
self:attr("silent_heal", -1)
end
if self.__attacktargetwith_recursing or (weapon and weapon.attack_recurse) then
if self.__attacktargetwith_recursing then
self.__attacktargetwith_recursing = self.__attacktargetwith_recursing - 1
else
self.__attacktargetwith_recursing = weapon.attack_recurse - 1
end
if self.__attacktargetwith_recursing > 0 then
local _, newhitted, newdam = self:attackTargetWith(target, weapon, damtype, mult, force_dam)
hitted = newhitted or hitted
dam = math.max(dam, newdam)
else
self.__attacktargetwith_recursing = nil
end
end
return self:combatSpeed(weapon), hitted, dam
end
function _M:attackTargetHitProcs(target, weapon, dam, apr, armor, damtype, mult, atk, def, hitted, crit, evaded, repelled, old_target_life)
if self:isAccuracyEffect(weapon, "staff") then
local bonus = 1 + self:getAccuracyEffect(weapon, atk, def, 0.025, 2)
print("[ATTACK] staff accuracy bonus", atk, def, "=", bonus)
......@@ -1055,36 +1089,9 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam)
local hd = {"Combat:attackTargetWith", hitted=hitted, crit=crit, target=target, weapon=weapon, damtype=damtype, mult=mult, dam=dam}
if self:triggerHook(hd) then hitted = hd.hitted end
-- Visual feedback
if hitted then game.level.map:particleEmitter(target.x, target.y, 1, "melee_attack", {color=target.blood_color}) end
if Map.tiles and Map.tiles.use_images then if self.x and target.x then if target.x < self.x then self:MOflipX(self:isTileFlipped()) elseif target.x > self.x then self:MOflipX(not self:isTileFlipped()) end end end
self.turn_procs.weapon_type = nil
self.__global_accuracy_damage_bonus = nil
--Life Steal
if weapon and weapon.lifesteal then
self:attr("lifesteal", -weapon.lifesteal)
self:attr("silent_heal", -1)
end
if self.__attacktargetwith_recursing or (weapon and weapon.attack_recurse) then
if self.__attacktargetwith_recursing then
self.__attacktargetwith_recursing = self.__attacktargetwith_recursing - 1
else
self.__attacktargetwith_recursing = weapon.attack_recurse - 1
end
if self.__attacktargetwith_recursing > 0 then
local _, newhitted, newdam = self:attackTargetWith(target, weapon, damtype, mult, force_dam)
hitted = newhitted or hitted
dam = math.max(dam, newdam)
else
self.__attacktargetwith_recursing = nil
end
end
return self:combatSpeed(weapon), hitted, dam
return hitted
end
_M.weapon_talents = {
......
......@@ -55,11 +55,11 @@ newTalent{
local bonus = 0
if self:getInven("MAINHAND") then
local weapon = self:getInven("MAINHAND")[1]
if weapon and weapon.subtype == "mindstar" then bonus = bonus + (weapon.combat.dam or 1) end
if weapon and weapon.subtype == "mindstar" then bonus = bonus + (weapon.combat.dam or 1) * 2 end
end
if self:getInven("OFFHAND") then
local weapon = self:getInven("OFFHAND")[1]
if weapon and weapon.subtype == "mindstar" then bonus = bonus + (weapon.combat.dam or 1) end
if weapon and weapon.subtype == "mindstar" then bonus = bonus + (weapon.combat.dam or 1) * 2 end
end
return bonus
end,
......@@ -91,13 +91,15 @@ newTalent{
local baseDamage = t.getBaseDamage(self, t)
local bonusDamage = t.getBonusDamage(self, t)
local bonusCritical = t.getBonusCritical(self, t)
local old_target_life = target.life
if target:hasEffect(target.EFF_DISMAYED) then
bonusCritical = 100
end
local damage = 0
if self:checkHit(mindpower, target:combatMentalResist()) then
local damage = self:mindCrit(baseDamage * rng.float(0.5, 1) + bonusDamage, bonusCritical)
damage = self:mindCrit(baseDamage * rng.float(0.5, 1) + bonusDamage, bonusCritical)
self:project({type="hit", x=target.x,y=target.y}, target.x, target.y, DamageType.MIND, { dam=damage,alwaysHit=true,crossTierChance=25 })
game:playSoundNear(self, "actions/melee_hit_squish")
hit = true
......@@ -128,6 +130,30 @@ newTalent{
local resistAllChange = tGestureOfMalice.getResistAllChange(self, tGestureOfMalice)
target:setEffect(target.EFF_MALIGNED, tGestureOfMalice.getDuration(self, tGestureOfMalice), { resistAllChange=resistAllChange })
end
local mind1, mind2 = self:hasDualWeapon("mindstar")
if mind1 and mind2 then
self:attackTargetHitProcs(
target,
mind1.combat,
damage, 0, 0, -- dam, apr, armor,
DamageType.MIND, -- damtype,
1, -- mult,
mindpower, target:combatMentalResist(), -- atk, def,
true, self.turn_procs.is_crit == "mind", false, false, -- hitted, crit, evaded, repelled,
old_target_life
)
self:attackTargetHitProcs(
target,
mind2.combat,
damage, 0, 0, -- dam, apr, armor,
DamageType.MIND, -- damtype,
1, -- mult,
mindpower, target:combatMentalResist(), -- atk, def,
true, self.turn_procs.is_crit == "mind", false, false, -- hitted, crit, evaded, repelled,
old_target_life
)
end
game.level.map:particleEmitter(target.x, target.y, 1, "melee_attack", {color=colors.VIOLET})
end
......@@ -146,8 +172,11 @@ newTalent{
local bonusDamage = t.getBonusDamage(self, t)
local bonusCritical = t.getBonusCritical(self, t)
return ([[Use a gesture of pain in place of a normal attack to assault the minds of your enemies, inflicting between %0.1f and %0.1f mind damage. If the attack succeeds, there is a %d%% chance to stun your opponent for 3 turns.
This strike replaces your melee physical and checks your Mindpower against your opponent's Mental Save, and is thus not affected by your Accuracy or the enemy's Defense. It also does not trigger any physical on-hit effects. However, the base damage and the critical chance of any Mindstars equipped are added in when this attack is performed.
This talent requires two free or mindstar-equipped hands and has a 25%% chance to inflict cross tier effects which can be critical hits. The damage will increase with your Mindpower. Mindstars bonuses from damage and physical criticals: (+%d damage, +%d critical chance)]]):format(damDesc(self, DamageType.MIND, baseDamage * 0.5), damDesc(self, DamageType.MIND, baseDamage), stunChance, bonusDamage, bonusCritical)
This strike replaces your melee physical and checks your Mindpower against your opponent's Mental Save, and is thus not affected by your Accuracy or the enemy's Defense. It also does not trigger any physical on-hit effects. However, the base damage (doubled) and the critical chance of any Mindstars equipped are added in when this attack is performed.
This talent requires two free or mindstar-equipped hands and has a 25%% chance to inflict cross tier effects which can be critical hits. The damage will increase with your Mindpower.
If attacking with two mindstars the attack will trigger their proc effects, if any.
Mindstars bonuses from damage and physical criticals: (+%d damage, +%d critical chance)]])
:format(damDesc(self, DamageType.MIND, baseDamage * 0.5), damDesc(self, DamageType.MIND, baseDamage), stunChance, bonusDamage, bonusCritical)
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