diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index ea4a17869c8c84a51afb678a84cbad7dfef55b80..f287c39ac3efb24ed29a6faf552e9c26c4bd20aa 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -2819,15 +2819,6 @@ function _M:onTakeHit(value, src, death_note) end end - if self:attr("unstoppable") then - if value > self.life - 1 then - game:delayedLogDamage(src, self, 0, ("#RED#(%d refused)#LAST#"):format(value - (self.life - 1)), false) - value = self.life - 1 - if self.life <= 1 then value = 0 end - game:delayedLogMessage(self, nil, "unstoppable", "#RED##Source# is unstoppable!") - end - end - if value >= self.life then local tal = self:isTalentActive(self.T_SECOND_LIFE) if tal then @@ -2998,6 +2989,16 @@ function _M:onTakeHit(value, src, death_note) t.trigger(self, t, value) end + -- Needs to be done last, will break if any damage is taken between doing this and updating the actor's life + if self:attr("unstoppable") then + if value > self.life - 1 then + game:delayedLogDamage(src, self, 0, ("#RED#(%d refused)#LAST#"):format(value - (self.life - 1)), false) + value = self.life - 1 + if self.life <= 1 then value = 0 end + game:delayedLogMessage(self, nil, "unstoppable", "#RED##Source# is unstoppable!") + end + end + return value end @@ -7218,7 +7219,7 @@ function _M:hasLOS(x, y, what, range, source_x, source_y) break end last_x, last_y = lx, ly - if game.level.map:checkAllEntities(lx, ly, what) then break end + if game.level.map:checkAllEntities(lx, ly, what, self) then break end lx, ly, is_corner_blocked = l:step() end diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua index ad435e4346d1ccbba63fe1742786e8557d07944b..bd24bd8291b66db3ce4ebef9d0e1b07d1aa45693 100644 --- a/game/modules/tome/class/Object.lua +++ b/game/modules/tome/class/Object.lua @@ -638,7 +638,7 @@ function _M:descAccuracyBonus(desc, weapon, use_actor) elseif kind == "mace" then desc:add("Accuracy bonus: ", {"color","LIGHT_GREEN"}, showpct(0.2, m), {"color","LAST"}, " base dam (max 20%)", true) elseif kind == "staff" then - desc:add("Accuracy bonus: ", {"color","LIGHT_GREEN"}, showpct(2.5, m), {"color","LAST"}, " proc dam (max 200%)", true) + desc:add("Accuracy bonus: ", {"color","LIGHT_GREEN"}, showpct(2.0, m), {"color","LAST"}, " proc dam (max 200%)", true) elseif kind == "knife" then desc:add("Accuracy bonus: ", {"color","LIGHT_GREEN"}, showpct(0.5, m), {"color","LAST"}, " APR (max 50%)", true) end diff --git a/game/modules/tome/class/interface/Archery.lua b/game/modules/tome/class/interface/Archery.lua index c3b317cff26c9139d4b99bf94dce674c84615b7e..7e243c52b6c76774a8423297c80ef87378b6d2bc 100644 --- a/game/modules/tome/class/interface/Archery.lua +++ b/game/modules/tome/class/interface/Archery.lua @@ -377,7 +377,7 @@ local function archery_projectile(tx, ty, tg, self, tmp) print("[ATTACK ARCHERY] after mult", dam) if self:isAccuracyEffect(ammo, "mace") then - local bonus = 1 + self:getAccuracyEffect(ammo, atk, def, 0.001, 0.1) + local bonus = 1 + self:getAccuracyEffect(ammo, atk, def, 0.002, 0.2) print("[ATTACK] mace accuracy bonus", atk, def, "=", bonus) dam = dam * bonus end diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index 1954672c28cf6f8313e87628e7faa0afeb33f653..d52c766c00f427ff6a776ee6d91db1097653989a 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -1957,7 +1957,7 @@ function _M:physicalCrit(dam, weapon, target, atk, def, add_chance, crit_power_a end if self:isAccuracyEffect(weapon, "sword") then - local bonus = self:getAccuracyEffect(weapon, atk, def, 0.004, 0.5) -- +50% crit power at 100 accuracy + local bonus = self:getAccuracyEffect(weapon, atk, def, 0.004, 0.4) -- +40% crit power at 100 accuracy print("[PHYS CRIT %] sword accuracy bonus", atk, def, "=", bonus) crit_power_add = crit_power_add + bonus end diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index c4da73e4066935aa3af514be5e9c08f5d0014556..81a408035c5d51335c6ca02da2c6c796a5080d90 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -2753,12 +2753,12 @@ newDamageType{ state = initState(state) useImplicitCrit(src, state) if _G.type(dam) == "number" then dam = {dam=dam} end - DamageType:get(DamageType.BLIGHT).projector(src, x, y, DamageType.BLIGHT, dam.dam, state) local target = game.level.map(x, y, Map.ACTOR) if target and target:canBe("disease") and rng.percent(dam.disease_chance or 20) then local eff = rng.table{{target.EFF_ROTTING_DISEASE, "con"}, {target.EFF_DECREPITUDE_DISEASE, "dex"}, {target.EFF_WEAKNESS_DISEASE, "str"}} target:setEffect(eff[1], dam.dur or 5, { src = src, [eff[2]] = dam.disease_power or 5, dam = dam.disease_dam or (dam.dam / 5) }) end + DamageType:get(DamageType.BLIGHT).projector(src, x, y, DamageType.BLIGHT, dam.dam, state) end, } diff --git a/game/modules/tome/data/talents/corruptions/blight.lua b/game/modules/tome/data/talents/corruptions/blight.lua index b469a69da7e4cf9f62f78d85096837174e9f9ad4..60c42245659830b6056ea90a4983a11cfe70048f 100644 --- a/game/modules/tome/data/talents/corruptions/blight.lua +++ b/game/modules/tome/data/talents/corruptions/blight.lua @@ -59,7 +59,7 @@ newTalent{ tactical = { ATTACKAREA = {BLIGHT = 1}, DISABLE = 2 }, requires_target = true, target = function(self, t) - return {type="ball", radius=self:getTalentRadius(t), range=self:getTalentRange(t), talent=t} + return {type="ball", radius=self:getTalentRadius(t), range=self:getTalentRange(t), selffire=false, talent=t} end, getRemoveCount = function(self, t) return math.floor(self:combatTalentScale(t, 1, 5, "log")) end, -- Oh for the love of god no, fix me action = function(self, t) diff --git a/game/modules/tome/data/talents/corruptions/shadowflame.lua b/game/modules/tome/data/talents/corruptions/shadowflame.lua index 1a5cb7aaa0d13f6c0d897c0dfcaa7b68c2f4d560..b62b59c7542361206567a2d3c16675d9fa499913 100644 --- a/game/modules/tome/data/talents/corruptions/shadowflame.lua +++ b/game/modules/tome/data/talents/corruptions/shadowflame.lua @@ -187,7 +187,7 @@ newTalent{ if target == self then return end if target:attr("negative_status_effect_immune") or target:attr("status_effect_immune") then return nil end - if not self:canBe("planechange") or target.summon_time or target.summon then + if not self:canBe("planechange") or target.summon_time or target.summoner then game.logPlayer(self, "The spell fizzles...") return end diff --git a/game/modules/tome/data/talents/corruptions/torment.lua b/game/modules/tome/data/talents/corruptions/torment.lua index cefbb9600a25182b0685ba49055a57dff49d6258..a17d55e4965c49d3d253864f95105a80fe5e85cc 100644 --- a/game/modules/tome/data/talents/corruptions/torment.lua +++ b/game/modules/tome/data/talents/corruptions/torment.lua @@ -136,13 +136,13 @@ newTalent{ callbackPriorities={callbackOnHit = -1}, -- Before Bone Shield but after Rot callbackOnHit = function(self, t, cb) local eff = self:hasEffect(self.EFF_BLOOD_GRASP) - local life = self.max_life + (eff and eff.life or 0) + local max_life = self.max_life - (eff and eff.life or 0) local l, c = t.getPower(self, t) - if cb.value >= self.max_life * l / 100 then + if cb.value >= max_life * l / 100 then local alt = {} for tid, cd in pairs(self.talents_cd) do - if rng.percent(c) then alt[tid] = true end + if rng.percent(c) and not self:getTalentFromId(tid).fixed_cooldown then alt[tid] = true end end for tid, cd in pairs(alt) do self:alterTalentCoolingdown(tid, -1) diff --git a/game/modules/tome/data/talents/cursed/advanced-shadowmancy.lua b/game/modules/tome/data/talents/cursed/advanced-shadowmancy.lua index b3ee46333fb11040da077458ab4f93e254fb3daa..962fca45e7bd5a78a5733efbf73e0b3d1160ed4e 100644 --- a/game/modules/tome/data/talents/cursed/advanced-shadowmancy.lua +++ b/game/modules/tome/data/talents/cursed/advanced-shadowmancy.lua @@ -17,6 +17,15 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org +function shadowWarriorMult(self) + if self:knowTalent(self.T_SHADOW_WARRIORS) then + t = self:getTalentFromId(self.T_SHADOW_WARRIORS) + return 1 + t.getIncDamage(self, t) / 100 + else + return 1 + end +end + newTalent{ name = "Merge", type = {"cursed/advanced-shadowmancy", 1}, @@ -30,7 +39,7 @@ newTalent{ getReduction = function(self, t) return self:combatTalentScale(t, 10, 40) end, on_pre_use = function(self, t) return game.level and self:callTalent(self.T_CALL_SHADOWS, "nbShadowsUp") > 0 end, action = function(self, t) - local tg = {type="hit", range=self:getTalentRange(t), talent=t, first_target="friend"} + local tg = {type="hit", range=self:getTalentRange(t), talent=t, first_target="friend", pass_terrain=self:knowTalent(self.T_SHADOW_SENSES)} local x, y, target = self:getTargetLimited(tg) if x and y and target and target.summoner and target.summoner == self and target.is_doomed_shadow then local tg2 = {type="hit", range=self:getTalentRange(t), start_x=x, start_y=y, source_actor=target, pass_terrain=true} @@ -67,7 +76,7 @@ newTalent{ getDamage = function(self, t) return self:combatTalentMindDamage(t, 0, 280) end, on_pre_use = function(self, t) return game.level and self:callTalent(self.T_CALL_SHADOWS, "nbShadowsUp") > 0 end, action = function(self, t) - local tg = {type="hit", range=self:getTalentRange(t), talent=t, first_target="friend"} + local tg = {type="hit", range=self:getTalentRange(t), talent=t, first_target="friend", pass_terrain=self:knowTalent(self.T_SHADOW_SENSES)} local x, y, target = self:getTargetLimited(tg) if x and y and target and target.x == x and target.y == y and target.is_doomed_shadow and target.summoner and target.summoner == self then local tg2 = {type="hit", range=self:getTalentRange(t), start_x=x, start_y=y, source_actor=target, friendlyblock=false, pass_terrain=true,} @@ -101,7 +110,7 @@ newTalent{ return ([[Target a nearby shadow, and force it to slam into a nearby enemy, dealing %0.1f Physical damage. Your shadow will then set them as their target, and they will target your shadow. Damage increases with your Mindpower.]]): - format(damDesc(self, DamageType.PHYSICAL, t.getDamage(self, t))) + format(t.getDamage(self, t) * shadowWarriorMult(self)) end, } @@ -159,6 +168,7 @@ newTalent{ local _ _, x, y = self:canProject(tg, x, y) -- Rushing time. + local dam = self:mindCrit(t.getDamage(self, t)) for i = 1, #shadows do if #shadows <= 0 then break end local a, id = rng.table(shadows) @@ -170,7 +180,6 @@ newTalent{ game.level.map:particleEmitter(a.x, a.y, math.max(math.abs(x-a.x), math.abs(y-a.y)), "earth_beam", {tx=x-a.x, ty=y-a.y}) game.level.map:particleEmitter(a.x, a.y, math.max(math.abs(x-a.x), math.abs(y-a.y)), "shadow_beam", {tx=x-a.x, ty=y-a.y}) - local dam = self:mindCrit(t.getDamage(self, t)) a:project(tg, x, y, DamageType.PHYSICAL, dam) a:move(sx, sy, true) @@ -186,7 +195,7 @@ newTalent{ return ([[Command all Shadows within sight to tele-dash to a target location, damaging any enemies they pass through for %0.1f Physical damage. For the purpose of this talent, you force your shadows through any walls in their way. Damage increases with your Mindpower.]]): - format(damDesc(self, DamageType.PHYSICAL, t.getDamage(self, t))) + format(t.getDamage(self, t) * shadowWarriorMult(self)) end, } @@ -222,7 +231,7 @@ newTalent{ return end - local damage = self:mindCrit(t.getDamage(self, t)) + local damage = t.getDamage(self, t) local first = true local failed = false @@ -234,10 +243,13 @@ newTalent{ local x, y = self:getTarget(tg) local _ _, x, y = a:canProject(tg, x, y) if x and y then + if first == true then + damage = self:mindCrit(damage) + first = false + end a:project(tg, x, y, DamageType.MIND, {dist=10, dam=damage}) game.level.map:particleEmitter(x, y, 1, "mind") game:playSoundNear(a, "talents/cloud") - if first == true then first = false end elseif first == true then first = false failed = true @@ -251,6 +263,6 @@ newTalent{ return ([[Share your hatred with all shadows within sight range, gaining temporary full control. You then fire a blast of pure hatred from all affected shadows, dealing %0.1f Mind damage per blast. You cannot cancel this talent once the first bolt is cast. Damage increases with your Mindpower.]]): - format(damDesc(self, DamageType.MIND, t.getDamage(self, t))) + format(t.getDamage(self, t) * shadowWarriorMult(self)) end, } \ No newline at end of file diff --git a/game/modules/tome/data/talents/cursed/force-of-will.lua b/game/modules/tome/data/talents/cursed/force-of-will.lua index 9aacb47453fe11fa4c384486958f9c509c5758fe..cae982201ef78862ea0f93c6be6630ea3e86dc71 100644 --- a/game/modules/tome/data/talents/cursed/force-of-will.lua +++ b/game/modules/tome/data/talents/cursed/force-of-will.lua @@ -39,9 +39,16 @@ newTalent{ -- knockback: distance to knockback -- knockbackDamage: when knockback strikes something, both parties take damage - percent of damage * remaining knockback -- power: used to determine the initial radius of particles - forceHit = function(self, t, target, sourceX, sourceY, damage, knockback, knockbackDamage, power, max, tmp) - tmp = tmp or {} - if tmp[target] then return end + forceHit = function(self, t, target, sourceX, sourceY, damage, knockback, knockbackDamage, power, max) + + -- give direct hit a direction? + if sourceX == target.x and sourceY == target.y then + local newDirection = rng.table(util.adjacentDirs()) + local dx, dy = util.dirToCoord(newDirection, sourceX, sourceY) + sourceX = sourceX + dx + sourceY = sourceY + dy + end + -- apply initial damage if damage > 0 then damage = self:mindCrit(damage) @@ -51,14 +58,6 @@ newTalent{ -- knockback? if not target.dead and knockback and knockback > 0 and target:canBe("knockback") and (target.never_move or 0) < 1 then - -- give direct hit a direction? - if sourceX == target.x and sourceY == target.y then - local newDirection = rng.table(util.adjacentDirs()) - local dx, dy = util.dirToCoord(newDirection, sourceX, sourceY) - sourceX = sourceX + dx - sourceY = sourceY + dy - end - local block_actor = function(_, bx, by) return game.level.map:checkEntity(bx, by, Map.TERRAIN, "block_move", target) end local lineFunction = core.fov.line(sourceX, sourceY, target.x, target.y, block_actor, true) local finalX, finalY = target.x, target.y @@ -89,7 +88,7 @@ newTalent{ if nextTarget then -- start a new force hit with the knockback damage and current knockback if max > 0 then - t.forceHit(self, t, nextTarget, sourceX, sourceY, blockDamage, knockback, knockbackDamage, power / 2, max - 1, tmp) + t.forceHit(self, t, nextTarget, sourceX, sourceY, blockDamage, knockback, knockbackDamage, power / 2, max - 1) end end @@ -270,24 +269,26 @@ newTalent{ local blastX, blastY = self:getTarget(tg) if not self:canProject(tg, blastX, blastY) then return nil end - local tmp = {} - local grids = self:project(tg, blastX, blastY, - function(x, y, target, self) - -- your will ignores friendly targets (except for knockback hits) - local target = game.level.map(x, y, Map.ACTOR) - if target and self:reactionToward(target) < 0 then - local distance = core.fov.distance(blastX, blastY, x, y) - local power = (1 - (distance / radius)) - local localDamage = damage * power - local dazeDuration = t.getDazeDuration(self, t) + local list = {} + self:project(tg, blastX, blastY, function(x, y, target, self) + -- your will ignores friendly targets (except for knockback hits) + local target = game.level.map(x, y, Map.ACTOR) + if target and self:reactionToward(target) < 0 then + local distance = core.fov.distance(blastX, blastY, x, y) + local power = 1 - 0.5 * (distance / radius) + list[#list + 1] = {target = target, power = power, damage = damage * power, knockback = math.max(0, knockback - distance)} + end + end) - self:callTalent(self.T_WILLFUL_STRIKE, "forceHit", target, blastX, blastY, damage, math.max(0, knockback - distance), 7, power, 10, tmp) - if target:canBe("stun") then - target:setEffect(target.EFF_DAZED, dazeDuration, {src=self}) - end - end - end, - nil, nil) + if #list == 0 then return end + local dazeDuration = t.getDazeDuration(self, t) + for i = 1, #list do + local hit = list[i] + self:callTalent(self.T_WILLFUL_STRIKE, "forceHit", hit.target, blastX, blastY, hit.damage, hit.knockback, 7, hit.power, 10) + if hit.target:canBe("stun") then + hit.target:setEffect(hit.target.EFF_DAZED, dazeDuration, {src=self}) + end + end local _ _, _, _, x, y = self:canProject(tg, blastX, blastY) game.level.map:particleEmitter(x, y, tg.radius, "force_blast", {radius=tg.radius}) @@ -317,7 +318,7 @@ newTalent{ hate = 18, cooldown = 30, tactical = { ATTACKAREA = { PHYSICAL = 2 } }, - range = 4, + range = 5, getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 6, 10)) end, getDamage = function(self, t) return self:combatTalentMindDamage(t, 0, 140) @@ -341,7 +342,7 @@ newTalent{ local secondchance = t.getSecondHitChance(self, t) self:setEffect(self.EFF_UNSEEN_FORCE, t.getDuration(self, t), { damage = t.getDamage(self, t), knockback = t.getKnockback(self, t), - hits = 1 + math.floor(secondchance / 100), extrahit = secondchance % 100, + hits = 1 + math.floor(secondchance / 100), extrahit = secondchance % 100, range = self:getTalentRange(t) }) return true end, @@ -356,8 +357,8 @@ newTalent{ local secondHitChance = t.getSecondHitChance(self, t) local hits = 1 + math.floor(secondHitChance/100) local chance = secondHitChance - math.floor(secondHitChance/100)*100 - return ([[Your fury becomes an unseen force that randomly lashes out at foes around you. For %d turns you strike %d (%d%% chance for %d) nearby target(s) within range 5 doing %d damage and %d knockback. The number of extra strikes increases at higher talent levels. + return ([[Your fury becomes an unseen force that randomly lashes out at foes around you. For %d turns you strike %d (%d%% chance for %d) nearby target(s) within range %d doing %d damage and %d knockback. The number of extra strikes increases at higher talent levels. In addition, your ability to channel force with this talent increases all critical damage by %d%% (currently: %d%%) - Damage increases with your Mindpower.]]):format(duration, hits, chance, hits+1, damDesc(self, DamageType.PHYSICAL, damage), knockback, t.critpower(self, t), self.combat_critical_power or 0) + Damage increases with your Mindpower.]]):format(duration, hits, chance, hits+1, self:getTalentRange(t), damDesc(self, DamageType.PHYSICAL, damage), knockback, t.critpower(self, t), self.combat_critical_power or 0) end, } diff --git a/game/modules/tome/data/talents/cursed/one-with-shadows.lua b/game/modules/tome/data/talents/cursed/one-with-shadows.lua index 902fbb2795c9309cd5821dfdeff4b62d9d039597..5e93316f0f3ea5ba3ae56fca2302786c85d807e6 100644 --- a/game/modules/tome/data/talents/cursed/one-with-shadows.lua +++ b/game/modules/tome/data/talents/cursed/one-with-shadows.lua @@ -104,7 +104,7 @@ newTalent{ getNb = function(self, t) return math.floor(self:combatTalentScale(t, 1, 3, 1)) end, on_pre_use = function(self, t) return self:callTalent(self.T_CALL_SHADOWS, "nbShadowsUp") > 0 end, action = function(self, t) --closest friend will be a shadow almost all the time - local tg = {type="hit", nolock=true, first_target="friend", range=self:getTalentRadius(t)} + local tg = {type="hit", nolock=true, pass_terrain = true, first_target="friend", range=self:getTalentRadius(t)} local x, y, target = self:getTarget(tg) if not x or not y or not target then return nil end if core.fov.distance(self.x, self.y, target.x, target.y) > self:getTalentRadius(t) then return nil end diff --git a/game/modules/tome/data/talents/psionic/dream-smith.lua b/game/modules/tome/data/talents/psionic/dream-smith.lua index 664818a9f164f1f9ce95ec3083cc3e0cb716f5a7..64976eb5fd67982cb6e4a87ffdeff64a3652a9aa 100644 --- a/game/modules/tome/data/talents/psionic/dream-smith.lua +++ b/game/modules/tome/data/talents/psionic/dream-smith.lua @@ -129,7 +129,7 @@ newTalent{ requires_target = true, proj_speed = 10, target = function(self, t) - return {type="beam", range=self:getTalentRange(t), selffire=false, talent=t, display={display='', particle="arrow", particle_args={tile="shockbolt/object/dream_hammer"}, trail="firetrail"}} + return {type="beam", range=self:getTalentRange(t), selffire=false, talent=t, nolock=true, display={display='', particle="arrow", particle_args={tile="shockbolt/object/dream_hammer"}, trail="firetrail"}} end, getDamage = function(self, t) return self:combatTalentWeaponDamage(t, 1, 1.5) end, getAttack = function(self, t) return self:getTalentLevel(t) * 10 end, -- Used for the talent display @@ -192,7 +192,7 @@ newTalent{ tactical = { ATTACK = { [hammer_tactical] = 1 }, DISABLE = { stun = 2 } }, getWeaponDamage = function(self, t) return self:combatTalentWeaponDamage(t, 1, 1.5) end, getDamage = function(self, t) return 30 end, - getPercentInc = function(self, t) return math.sqrt(self:getTalentLevel(t) / 5) / 2 end, + getPercentInc = function(self, t) return math.sqrt(self:getTalentLevel(t) / 5) / 1.5 end, getStun = function(self, t) return math.floor(self:combatTalentScale(t, 3, 7)) end, target = function(self, t) return {type="hit", range=self:getTalentRange(t)} end, range = 1, diff --git a/game/modules/tome/data/talents/psionic/slumber.lua b/game/modules/tome/data/talents/psionic/slumber.lua index 49cc7cce8b277f316d802d9da545fba64b56b30d..74ca372a31a47f25359ecc79cb9c1905ef6a9ac7 100644 --- a/game/modules/tome/data/talents/psionic/slumber.lua +++ b/game/modules/tome/data/talents/psionic/slumber.lua @@ -153,7 +153,7 @@ newTalent{ if target == self then return end if target:attr("negative_status_effect_immune") or target:attr("status_effect_immune") then return nil end - if not self:canBe("planechange") or target.summon_time or target.summon then + if not self:canBe("planechange") or target.summon_time or target.summoner then game.logPlayer(self, "The spell fizzles...") return end diff --git a/game/modules/tome/data/talents/spells/animus.lua b/game/modules/tome/data/talents/spells/animus.lua index 5d1ddef888f6de2c6ec230724de0356c781fce4b..37d9dec395d0d17968fe1a12c4442e945099a715 100644 --- a/game/modules/tome/data/talents/spells/animus.lua +++ b/game/modules/tome/data/talents/spells/animus.lua @@ -111,7 +111,10 @@ newTalent{ local dam = self:spellCrit(t.getDamage(self, t)) local olddie = rawget(m, "die") m.die = function() end + local oldclone = m.clone_on_hit + m.clone_on_hit = nil DamageType:get(DamageType.DARKNESS).projector(self, px, py, DamageType.DARKNESS, dam) + m.clone_on_hit = oldclone m.die = olddie game.level.map:particleEmitter(px, py, 1, "dark") if 100 * m.life / m.max_life <= t.getMaxLife(self, t) and self:checkHit(self:combatSpellpower(), m:combatSpellResist()) and m:canBe("instakill") and m.rank <= 3.2 and not m:attr("undead") and not m.summoner and not m.summon_time then @@ -133,6 +136,7 @@ newTalent{ m.no_breath = 1 m.unused_talents = 0 m.unused_generics = 0 + m.unused_prodigies = 0 m.unused_talents_types = 0 m.silent_levelup = true m.clone_on_hit = nil diff --git a/game/modules/tome/data/talents/techniques/archery.lua b/game/modules/tome/data/talents/techniques/archery.lua index 1bbfe897046c050888cac2cb8a0ae05bf6a8a719..cec234fe91feaf44796bc8ba143129f2e6387901 100644 --- a/game/modules/tome/data/talents/techniques/archery.lua +++ b/game/modules/tome/data/talents/techniques/archery.lua @@ -112,16 +112,14 @@ newTalent{ local mult = bombardment.damage_multiplier(self, bombardment) -- Do targeting. - local old_target_forced = game.target.forced local tg = {type = "bolt", range = archery_range(self), talent = t} local x, y, target = self:getTarget(tg) if not x or not y then return end - game.target.forced = {x, y, target} -- Fire all shots local count = 0 for i = 1, shots do - local targets = self:archeryAcquireTargets(nil, {no_energy=true, one_shot=true, type="sling"}) + local targets = self:archeryAcquireTargets(nil, {no_energy=true, one_shot=true, type="sling", x=x, y=y}) if not targets then break end count = i @@ -131,7 +129,6 @@ newTalent{ local speed = self:combatSpeed(weapon or pf_weapon) self:useEnergy(game.energy_to_act * (speed or 1)) end - game.target.forced = old_target_forced return count > 0 end, @@ -385,13 +382,11 @@ newTalent{ table.shuffle(targets) -- Fire each shot individually. - local old_target_forced = game.target.forced local shot_params_base = {mult = t.getDamage(self, t), phasing = true} local fired = nil -- If we've fired at least one shot. for i = 1, #targets do local target = targets[i] - game.target.forced = {target.x, target.y, target} - local targets = self:archeryAcquireTargets({type = "hit", speed = 200}, {one_shot=true, no_energy = fired}) + local targets = self:archeryAcquireTargets({type = "hit", speed = 200}, {one_shot=true, no_energy = fired, x = target.x, y = target.y}) if targets then local params = table.clone(shot_params_base) local target = targets.dual and targets.main[1] or targets[1] @@ -404,7 +399,6 @@ newTalent{ end end - game.target.forced = old_target_forced return fired end, info = function(self, t) @@ -550,13 +544,11 @@ newTalent{ table.shuffle(targets) -- Fire each shot individually. - local old_target_forced = game.target.forced local shot_params_base = {mult = dam/2, phasing = true} local fired = nil -- If we've fired at least one shot. for i = 1, #targets do local target = targets[i] - game.target.forced = {target.x, target.y, target} - local targets = self:archeryAcquireTargets({type = "hit", speed = 200}, {one_shot=true, infinite=true, no_energy = true}) + local targets = self:archeryAcquireTargets({type = "hit", speed = 200}, {one_shot=true, infinite=true, no_energy = true, x = target.x, y = target.y}) if targets then local params = table.clone(shot_params_base) local target = targets.dual and targets.main[1] or targets[1] @@ -575,7 +567,6 @@ newTalent{ if self:knowTalent(self.T_BULLSEYE) then self:callTalent(self.T_BULLSEYE, "proc") end end end - game.target.forced = old_target_forced return true end, info = function(self, t) diff --git a/game/modules/tome/data/talents/techniques/skirmisher-slings.lua b/game/modules/tome/data/talents/techniques/skirmisher-slings.lua index be939028d1be7888b1887b632564c58d9effcc35..812c5ee876dcc77dfa1923a640a4fdd8b02ac131 100644 --- a/game/modules/tome/data/talents/techniques/skirmisher-slings.lua +++ b/game/modules/tome/data/talents/techniques/skirmisher-slings.lua @@ -146,14 +146,12 @@ newTalent { table.shuffle(targets) -- Fire each shot individually. - local old_target_forced = game.target.forced local limit_shots = t.limit_shots(self, t) local shot_params_base = {mult = t.damage_multiplier(self, t), phasing = true} local fired = nil -- If we've fired at least one shot. for i = 1, math.min(limit_shots, #targets) do local target = targets[i] - game.target.forced = {target.x, target.y, target} - local targets = self:archeryAcquireTargets({type = "hit", speed = 200}, {one_shot=true, no_energy = fired}) + local targets = self:archeryAcquireTargets({type = "hit", speed = 200}, {one_shot=true, no_energy = fired, x = target.x, y = target.y}) if targets then local params = table.clone(shot_params_base) local target = targets.dual and targets.main[1] or targets[1] @@ -166,7 +164,6 @@ newTalent { end end - game.target.forced = old_target_forced return fired end, info = function(self, t) diff --git a/game/modules/tome/data/talents/uber/cun.lua b/game/modules/tome/data/talents/uber/cun.lua index 0e989c29b49ce6fa9658fe6913e8e4fd9c57bda1..379207c6a99acd5439da60c7142212ac0d4145c4 100644 --- a/game/modules/tome/data/talents/uber/cun.lua +++ b/game/modules/tome/data/talents/uber/cun.lua @@ -100,7 +100,7 @@ uberTalent{ getDarkness = function(self, t) return self:combatStatScale("cun", 1, 30, 0.75) end, getAcid = function(self, t) return self:combatStatScale("cun", 10, 100, 0.75) end, getTemporal = function(self, t) return self:combatStatScale("cun", 1, 40, 0.75) end, - getMind = function(self, t) return self:combatStatScale("cun", 1, 40, 0.75) end, + getMind = function(self, t) return util.bound(self:combatStatScale("cun", 1, 40, 0.75), 0, 50) end, range = 10, radius = 3, dts = {TEMPORAL=true, BLIGHT=true, ACID=true, DARKNESS=true, MIND=true, PHYSICAL=true}, @@ -169,7 +169,7 @@ uberTalent{ elseif damtype == DamageType.MIND and not self:hasProc("endless_woes_mind") then self:setProc("endless_woes_mind", true, 10) game.logSeen(self, "You unleash a confusing blast of #YELLOW#mental#LAST# energy!", self.name:capitalize()) - t.doProject(self, t, damtype, {id="EFF_CONFUSED", dur=5, params={power=50}, canbe="confusion"}, "starfall") + t.doProject(self, t, damtype, {id="EFF_CONFUSED", dur=5, params={power=t.getMind(self, t)}, canbe="confusion"}, "starfall") elseif damtype == DamageType.PHYSICAL and not self:hasProc("endless_woes_physical") then self:setProc("endless_woes_physical", true, 10) game.logSeen(self, "You unleash a crippling blast of earthen energy!", self.name:capitalize()) diff --git a/game/modules/tome/data/timed_effects/mental.lua b/game/modules/tome/data/timed_effects/mental.lua index bd833141dd1d128a486cd8a4caa8050a4c19fddb..91bcb24d93514815e8012e09c650f704ce5fcdba 100644 --- a/game/modules/tome/data/timed_effects/mental.lua +++ b/game/modules/tome/data/timed_effects/mental.lua @@ -969,7 +969,7 @@ newEffect{ on_timeout = function(self, eff) local tInstillFear = self:getTalentFromId(self.T_INSTILL_FEAR) -- if tInstillFear.hasEffect(eff.src, tInstillFear, self) then - if core.fov.distance(self.x, self.y, eff.src.x, eff.src.y) <= eff.range and self:hasLOS(eff.src.x, eff.src.y) then + if core.fov.distance(self.x, self.y, eff.src.x, eff.src.y) <= eff.range and eff.src:hasLOS(self.x, self.y) then eff.turns_left = eff.turns_left - 1 end if eff.turns_left <= 0 then @@ -2927,8 +2927,8 @@ newEffect{ image="talents/unseen_force.png", long_desc = function(self, eff) local hits = (eff.extrahit > 0 and "from "..eff.hits.." to "..(eff.hits + 1)) or ""..eff.hits - return ("An unseen force strikes %s targets in a range of 5 around this creature ".. - "every turn, doing %d damage and knocking them back for %d tiles."):format(hits, eff.damage, eff.knockback) end, + return ("An unseen force strikes %s targets in a range of %d around this creature ".. + "every turn, doing %d damage and knocking them back for %d tiles."):format(hits, eff.range, eff.damage, eff.knockback) end, type = "mental", subtype = {psionic=true}, status = "beneficial", @@ -2942,8 +2942,7 @@ newEffect{ end, on_timeout = function(self, eff) local targets = {} - local tmp = {} - local grids = core.fov.circle_grids(self.x, self.y, 5, true) + local grids = core.fov.circle_grids(self.x, self.y, eff.range, true) for x, yy in pairs(grids) do for y, _ in pairs(grids[x]) do local a = game.level.map(x, y, Map.ACTOR) @@ -2961,7 +2960,7 @@ newEffect{ -- Randomly take targets local sample = rng.tableSample(targets, hitCount) for _, target in ipairs(sample) do - t.forceHit(self, t, target, target.x, target.y, eff.damage, eff.knockback, 7, 0.6, 10, tmp) + t.forceHit(self, t, target, target.x, target.y, eff.damage, eff.knockback, 7, 0.6, 10) end end end,