diff --git a/game/engine/interface/ActorProject.lua b/game/engine/interface/ActorProject.lua index b4f237636ce9b549ad57274eecc8f0d2ea7befd6..e927f057c9c25397482cb4994fa9f4c25c5eb455 100644 --- a/game/engine/interface/ActorProject.lua +++ b/game/engine/interface/ActorProject.lua @@ -94,6 +94,7 @@ function _M:project(t, x, y, damtype, dam, particles) end -- Now project on each grid, one type + local tmp = {} if type(damtype) == "function" then local stop = false for px, ys in pairs(grids) do @@ -113,13 +114,13 @@ function _M:project(t, x, y, damtype, dam, particles) -- Friendly fire ? if px == self.x and py == self.y then if t.friendlyfire then - DamageType:get(damtype).projector(self, px, py, damtype, dam) + DamageType:get(damtype).projector(self, px, py, damtype, dam, tmp) if particles then game.level.map:particleEmitter(px, py, 1, particles.type) end end else - DamageType:get(damtype).projector(self, px, py, damtype, dam) + DamageType:get(damtype).projector(self, px, py, damtype, dam, tmp) if particles then game.level.map:particleEmitter(px, py, 1, particles.type) end diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index 38d6a493dd6634cb1b780c4dac18d3e412b86427..2e616733cd158ec67322547e52512415ba27566b 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -303,10 +303,11 @@ newDamageType{ -- Physical damage + repulsion; checks for spell power against physical resistance newDamageType{ name = "spellknockback", type = "SPELLKNOCKBACK", - projector = function(src, x, y, type, dam) - DamageType:get(DamageType.PHYSICAL).projector(src, x, y, DamageType.PHYSICAL, dam) + projector = function(src, x, y, type, dam, tmp) local target = game.level.map(x, y, Map.ACTOR) - if target then + if target and not tmp[target] then + tmp[target] = true + DamageType:get(DamageType.PHYSICAL).projector(src, x, y, DamageType.PHYSICAL, dam) if target:checkHit(src:combatSpellpower(), target:combatPhysicalResist(), 0, 95, 15) and target:canBe("knockback") then target:knockback(src.x, src.y, 3) game.logSeen(target, "%s is knocked back!", target.name:capitalize()) @@ -320,10 +321,11 @@ newDamageType{ -- Physical damage + repulsion; checks for spell power against physical resistance newDamageType{ name = "physknockback", type = "PHYSKNOCKBACK", - projector = function(src, x, y, type, dam) - DamageType:get(DamageType.PHYSICAL).projector(src, x, y, DamageType.PHYSICAL, dam.dam) + projector = function(src, x, y, type, dam, tmp) local target = game.level.map(x, y, Map.ACTOR) - if target then + if target and not tmp[target] then + tmp[target] = true + DamageType:get(DamageType.PHYSICAL).projector(src, x, y, DamageType.PHYSICAL, dam.dam) if target:checkHit(src:combatAttackStr(), target:combatPhysicalResist(), 0, 95, 15) and target:canBe("knockback") then target:knockback(src.x, src.y, dam.dist) game.logSeen(target, "%s is knocked back!", target.name:capitalize())