Advertisement
Guest User

frenemy

a guest
Apr 29th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.88 KB | None | 0 0
  1. newTalent{
  2.     short_name = "NEMESIS_X",
  3.     name = "Nemesis Clone",
  4.     type = {"race/Chrono_Xorn", 1},
  5.     points = 5,
  6.     paradox = function (self, t) return getParadoxCost(self, t, 0) end,
  7.     cooldown = 0,
  8.     tactical = { ATTACK = 1, DISABLE = 2 },
  9.     range = 10,
  10.     requires_target = true,
  11.     no_npc_use = true,
  12.     getDuration = function(self, t) return math.floor(self:combatTalentLimit(t, 50, 50, 50)) end, -- Limit <50
  13.     getModifier = function(self, t) return rng.range(t.getDuration(self,t)*2, t.getDuration(self, t)*4) end,
  14.     action = function (self, t)
  15.         local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
  16.         local tx, ty = self:getTarget(tg)
  17.         if not tx or not ty then return nil end
  18.         local _ _, tx, ty = self:canProject(tg, tx, ty)
  19.         if not tx or not ty then return nil end
  20.  
  21.         local x, y = util.findFreeGrid(tx, ty, 2, true, {[Map.ACTOR]=true})
  22.         if not x then
  23.             game.logPlayer(self, "Not enough space to summon!")
  24.             return
  25.         end
  26.  
  27.         local sex = game.player.female and "she" or "he"
  28.         local m = require("mod.class.NPC").new(self:cloneFull{
  29.             no_drops = true, keep_inven_on_death = false,
  30.             faction = enemies,
  31.             summoner = self, summoner_gain_exp = false,
  32.             exp_worth = 1,
  33.             summon_time = t.getDuration(self, t),
  34.             ai_target = {actor=nil},
  35.             ai = "summoned", ai_real = "tactical",
  36.             ai_tactic = resolvers.tactic("ranged"), ai_state = { talent_in=1, --[[ally_compassion=-100]]},
  37.             desc = [[The real you... or so ]]..sex..[[ says.]]
  38.         })
  39.         m:removeAllMOs()
  40.         m.make_escort = nil
  41.         m.on_added_to_level = nil
  42.  
  43.         m.energy.value = 0
  44.         m.player = nil
  45.         m.puuid = nil
  46.         m.max_life = m.max_life
  47.         m.life = util.bound(m.life, 0, m.max_life)
  48.         m.forceLevelup = function() end
  49.         m.die = nil
  50.         m.on_die = nil
  51.         m.on_acquire_target = nil
  52.         m.seen_by = nil
  53.         m.can_talk = nil
  54.         m.on_takehit = nil
  55.         m.no_inventory_access = true
  56.         m.clone_on_hit = nil
  57.         m.remove_from_party_on_death = nil
  58.  
  59.         -- Remove some talents
  60.         local tids = {}
  61.         for tid, _ in pairs(m.talents) do
  62.             local t = m:getTalentFromId(tid)
  63.             if t.no_npc_use then tids[#tids+1] = t end
  64.         end
  65.         for i, t in ipairs(tids) do
  66.             m.talents[t.id] = nil
  67.         end
  68.  
  69.         game.zone:addEntity(game.level, m, "actor", x, y)
  70.         game.level.map:particleEmitter(x, y, 1, "temporal_teleport")
  71.         game:playSoundNear(self, "talents/teleport")
  72.  
  73.         --self:setEffect(self.EFF_IMMINENT_PARADOX_CLONE, t.getDuration(self, t) + t.getModifier(self, t), {})
  74.         return true
  75.     end,
  76.     info = function(self, t)
  77.         local duration = t.getDuration(self, t)
  78.         return ([[You summon your future self to fight alongside you for %d turns.  At some point in the future, you'll be pulled into the past to fight alongside your past self after the initial effect ends.
  79.         This spell splits the timeline.  Attempting to use another spell that also splits the timeline while this effect is active will be unsuccessful.]]):format(duration)
  80.     end,
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement