Commit 8764831ae8ae89c626c73742a2c54c5a83141894

Authored by Chris Davidson
1 parent 461877fd

Replace damage and healing on Vile Transplant with a vim cost per effect

Also updated the code to use the new cloneEffect.  I stress tested this a bit in various unscientific ways, seems to work well.
... ... @@ -171,6 +171,7 @@ newTalent{
171 171 target = function(self, t) return {type="hit", range=self:getTalentRange(t), talent=t} end,
172 172 getNb = function(self, t) return math.floor(self:combatTalentScale(t, 2, 4, "log")) end,
173 173 getDam = function(self, t) return self:combatTalentLimit(t, 2, 10, 5) end, --Limit < 10% life/effect
  174 + getVim = function(self, t) return 18 end,
174 175 action = function(self, t)
175 176 local tg = self:getTalentTarget(t)
176 177 local x, y = self:getTarget(tg)
... ... @@ -188,26 +189,17 @@ newTalent{
188 189 end
189 190 end
190 191
191   - local dam = t.getDam(self, t) * self.life / 100
192 192 while #list > 0 and nb > 0 do
193   - if self:checkHit(self:combatSpellpower(), target:combatSpellResist(), 0, 95, 5) then
194   - local eff_id = rng.tableRemove(list)
195   - local p = self.tmp[eff_id]
196   - local e = self.tempeffect_def[eff_id]
197   - local effectParam = self:copyEffect(eff_id)
198   - effectParam.__tmpparticles = nil
199   - if effectParam then
200   - effectParam.src = self
201   -
202   - target:setEffect(eff_id, p.dur, effectParam)
203   - self:removeEffect(eff_id)
204   - local dead, val = self:takeHit(dam, self, {source_talent=t})
205   - target:heal(val, self)
206   - game:delayedLogMessage(self, target, "vile_transplant"..e.desc, ("#CRIMSON##Source# transfers an effect (%s) to #Target#!"):format(e.desc))
207   - end
  193 + local eff_id = rng.tableRemove(list)
  194 + local e = self.tempeffect_def[eff_id]
  195 + self:cloneEffect(eff_id, target, {apply_power = self:combatSpellpower()})
  196 + if target:hasEffect(eff_id) then
  197 + self:removeEffect(eff_id)
  198 + game:delayedLogMessage(self, target, "vile_transplant"..e.desc, ("#CRIMSON##Source# transfers an effect (%s) to #Target#!"):format(e.desc))
  199 + self:incVim(-t.getVim(self, t)) -- Vim costs life if there isn't enough so no need to check total
208 200 end
209   - nb = nb - 1
210 201 end
  202 + nb = nb - 1
211 203 end)
212 204 local _ _, _, _, x, y = self:canProject(tg, x, y)
213 205 game.level.map:particleEmitter(x, y, tg.radius, "circle", {oversize=0.7, g=100, r=100, a=90, limit_life=8, appear=8, speed=2, img="blight_circle", radius=self:getTalentRadius(t)})
... ... @@ -215,9 +207,9 @@ newTalent{
215 207 return true
216 208 end,
217 209 info = function(self, t)
218   - return ([[You transfer up to %d physical or magical detrimental effects currently affecting you to a nearby creature by touching it.
219   - The transfer takes %0.1f%% of your remaining life for each effect transferred and heals the target for the same amount.
  210 + return ([[You transfer up to %d physical or magical detrimental effects currently affecting you to a nearby creature at a cost of %d vim per effect.
  211 + Specific effect immunities will not prevent the transfer.
220 212 The chance to transfer each effect increases with your Spellpower.]]):
221   - format(t.getNb(self, t), t.getDam(self, t))
  213 + format(t.getNb(self, t), t.getVim(self, t))
222 214 end,
223 215 }
... ...