Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 0 0
  1. newTalent{
  2.     name = "Mimic",
  3.     type = {"cursed/predator", 4},
  4.     mode = "passive",
  5.     require = cursed_lev_req4,
  6.     points = 5,
  7.     no_npc_use = true,
  8.     getPower = function(self, t) return self:combatTalentScale(t, 5, 20) end,
  9.     getCount = function(self, t) return math.min(3, math.floor(self:getTalentLevelRaw(t) / 2 + 1)) end,
  10.     callbackOnChangeLevel = function(self, t)
  11.         if self:hasEffect(self.EFF_PREDATOR) then self:removeEffect(self.EFF_PREDATOR) end
  12.         if not game.level.data.prey then
  13.             local enemy = {}
  14.             for _, e in pairs(game.level.entities) do
  15.                 if e.rank >= 3.2 and self:reactionToward(e) < 0 then
  16.                     enemy[#enemy+1] = {e=e, rank=e.rank, type=e.type}
  17.                 end
  18.             end
  19.             if #enemy > 0 then table.sort(enemy, "rank") else return end
  20.             game.level.data.prey = {}
  21.             for i = 1, t.getCount(self, t) do
  22.                 if #enemy > 0 then
  23.                     game.level.data.prey[i] = enemy[#enemy].e
  24.                     table.remove(enemy)
  25.                 end
  26.             end
  27.         end
  28.         local power = t.getPower(self, t)
  29.         local prey1, prey2, prey3 = game.level.data.prey[1], game.level.data.prey[2], game.level.data.prey[3]
  30.         self:setEffect(self.EFF_PREDATOR, 1, {count=count, power=power, prey1=prey1, prey2=prey2, prey3=prey3})
  31.     end,
  32.     info = function(self, t)
  33.         return([[Focus your predation on the most worthy prey. Upon entering a level for the first time, %d worthy foes are marked as your prey. You gain vision of them, wherever they are. Additionally, you gain damage and damage resistance against their types. Increase all damage you deal and all damage you receive by %d%%.]]):format(t.getCount(self, t), t.getPower(self, t))
  34.     end,
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement