Guest User

Master of Terror

a guest
Sep 18th, 2014
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.99 KB | None | 0 0
  1. newTalent{
  2. name = "Master of Terror", shortname = "MASTER_TERROR",
  3.     type = {"cursed/horror", 1},
  4.     points = 5,
  5.     mode = "passive",
  6.     require = cursed_will_req1,
  7.     on_learn = function(self, t)
  8.         local lev = self:getTalentLevelRaw(t)
  9.         if lev == 1 then
  10.             self:learnTalent(self.T_INSTILL_FEAR), true, nil, {no_unlearn=true})
  11.         elseif lev == 2 then
  12.             self:learnTalent(self.T_INSTILL_FEAR), true, nil, {no_unlearn=true})
  13.         elseif lev == 3 then
  14.             self:learnTalent(self.T_INSTILL_FEAR), true, nil, {no_unlearn=true})
  15.         elseif lev == 4 then
  16.             self:learnTalent(self.T_INSTILL_FEAR), true, nil, {no_unlearn=true})
  17.         elseif lev == 5 then
  18.             self:learnTalent(self.T_INSTILL_FEAR), true, nil, {no_unlearn=true})
  19.         end
  20.     end,
  21.     on_unlearn = function(self, t)
  22.         local lev = self:getTalentLevelRaw(t)
  23.         if lev == 0 then
  24.             self:unlearnTalent(self.T_INSTILL FEAR)
  25.         elseif lev == 1 then
  26.             self:unlearnTalent(self.T_INSTILL FEAR)
  27.         elseif lev == 2 then
  28.             self:unlearnTalent(self.T_INSTILL_FEAR)
  29.         elseif lev == 3 then
  30.             self:unlearnTalent(self.T_INSTILL_FEAR)
  31.         elseif lev == 4 then
  32.             self:unlearnTalent(self.T_INSTILL_FEAR)
  33.         end
  34.     end,
  35.    
  36.     action = function(self, t)
  37.    
  38.     local shadow_count = 0
  39.         if target:hasEffect(target.EFF_PARANOID) then shadow_count = shadow_count + 1
  40.         if target:hasEffect(target.EFF_DISPAIR) then shadow_count = shadow_count + 1
  41.         if target:hasEffect(target.EFF_TERRIFIED) then shadow_count = shadow_count + 1
  42.         if target:hasEffect(target.EFF_DISTRESSED) then shadow_count = shadow_count + 1
  43.         if target:hasEffect(target.EFF_HAUNTED) then shadow_count = shadow_count + 1
  44.         if target:hasEffect(target.EFF_TORMENTED) then shadow_count = shadow_count + 1
  45.        
  46.         end
  47.     end,
  48.    
  49.     local tgts = {}
  50.         local grids = core.fov.circle_grids(self.x, self.y, 10, true)
  51.         for x, yy in pairs(grids) do for y, _ in pairs(grids[x]) do
  52.             local a = game.level.map(x, y, Map.ACTOR)
  53.             if a and self:reactionToward(a) < 0 then
  54.                 tgts[#tgts+1] = a
  55.             end
  56.         end end
  57.        
  58.         local tg = {type="bolt", range=10, talent=t, display={particle="agony"}, friendlyblock=false}
  59.         for i = 1, #tgts do
  60.             if #tgts <= 0 then break end
  61.             local a, id = rng.table(tgts)
  62.             table.remove(tgts, id)
  63.  
  64.            
  65.             for i = 1, 1 do
  66.             local x, y = nil
  67.             local x, y = util.findFreeGrid(a.x, a.y, 4, true, {[engine.Map.ACTOR]=true})
  68.             local NPC = require "mod.class.NPC"
  69.             local shadowlevel = self.level
  70.             local m = NPC.new{
  71.                 type = "undead", subtype = "shadow",
  72.                 name = "ethereal shadow",
  73.                 desc = [[]],
  74.                 display = 'b', color=colors.BLACK,
  75.                 autolevel = "none",
  76.                 ai = "summoned", ai_real = "dumb_talented_simple", ai_state = { talent_in=5, },
  77.                 stats = {str=0, dex=0, con=0, cun=0, wil=0, mag=0},
  78.                 level_range = {shadowlevel, shadowlevel}, exp_worth = 0,
  79.  
  80.                 max_life = self.max_life*0.15,
  81.                 life_rating = self.max_life*0.05,
  82.                 infravision = 10,
  83.  
  84.                 combat_armor = 2, combat_def = 4,
  85.                 combat = { dam=1 * 3 + rng.avg(12,25), atk=10, apr=10, dammod={str=0.8} },
  86.  
  87.  
  88.                 never_anger = true,
  89.                 summoner = self,
  90.                 summoner_gain_exp=true,
  91.                 summon_time = 4,
  92.                
  93.                
  94.                 ai_target = {actor=target}
  95.             }
  96.             m.remove_from_party_on_death = true
  97.             if x and y then
  98.                 game.zone:addEntity(game.level, m, "actor", x, y)
  99.                 m:setTarget(a)
  100.                 a:setTarget(m)
  101.                 if game.party:hasMember(self) then
  102.                     game.party:addMember(m, {
  103.                     control="no",
  104.                     type="ethereal shadow",
  105.                     title="Ethereal Shadow",
  106.                     })
  107.                 end
  108.             end
  109.             end
  110.            
  111.             game:playSoundNear(self, "talents/fire")
  112.         end
  113.         return true
  114.     end,
  115.    
  116. info = function(self, t)
  117.         return ([[You know the most basic trick of horror: Jump scares. Summon 1 Shadow around each feared enemy, 1 for each fear effecting them. These shadows taunt nearby enemies into lashing out at them.
  118.         These shadows have no special abilities, deal minimal to no damage, and last 4 turns. As they are not 'true' shadows, they do not work with Shadow Alliance.
  119.         Additionally, you gain Instill Fear at this talent's level.]]):
  120.     end,
  121. }
Advertisement
Add Comment
Please, Sign In to add comment