Guest User

spikesnilcompare

a guest
May 19th, 2015
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.18 KB | None | 0 0
  1.  
  2. newTalent{
  3.     short_name = "X_SPIKES",
  4.     name = "Carbon Spikes",
  5.     --taken from the carbon spikes talent
  6.     type = {"race/Chrono_Xorn", 1},
  7.     image = "talents/carbon_spikes.png",
  8.     --no_sustain_autoreset = true,
  9.     points = 5,
  10.     mode = "sustained",
  11.     sustain_paradox = 20,
  12.     cooldown = 12,
  13.     tactical = { BUFF =2, DEFEND = 2 },
  14.     getDamageOnMeleeHit = function(self, t) return self:combatTalentSpellDamage(t, 1, 150, getParadoxSpellpower(self, t)) end,
  15.     getArmor = function(self, t) return math.ceil(self:combatTalentSpellDamage(t, 20, 50, getParadoxSpellpower(self, t))) end,
  16.     callbackOnActBase = function(self, t)
  17.         local maxspikes = t.getArmor(self, t)
  18.         if self.carbon_armor < maxspikes then
  19.             self.carbon_armor = self.carbon_armor + 1
  20.         end
  21.     end,
  22.     do_carbonLoss = function(self, t)
  23.         if self.carbon_armor >= 1 then
  24.             self.carbon_armor = self.carbon_armor - 1
  25.         else
  26.             -- Deactivate without loosing energy
  27.             self:forceUseTalent(self.T_CARBON_SPIKES, {ignore_energy=true})
  28.         end
  29.     end,
  30.     activate = function(self, t)
  31.         local power = t.getArmor(self, t)
  32.         self.carbon_armor = power
  33.         game:playSoundNear(self, "talents/spell_generic")
  34.         return {
  35.             armor = self:addTemporaryValue("carbon_spikes", power),
  36.             onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.BLEED]=t.getDamageOnMeleeHit(self, t)}),           
  37.         }
  38.     end,
  39.     deactivate = function(self, t, p)
  40.         self:removeTemporaryValue("carbon_spikes", p.armor)
  41.         self:removeTemporaryValue("on_melee_hit", p.onhit)
  42.         self.carbon_armor = nil
  43.         return true
  44.     end,
  45.     info = function(self, t)
  46.         local damage = t.getDamageOnMeleeHit(self, t)
  47.         local armor = t.getArmor(self, t)
  48.         return ([[Fragile spikes of carbon protrude from your flesh, clothing, and armor, increasing your armor rating by %d and inflicting %0.2f bleed damage over six turns on attackers.   Each time you're struck, the armor increase will be reduced by 1.  Each turn the spell will regenerate 1 armor up to its starting value.
  49.         If the armor increase from the spell ever falls below 1, the sustain will deactivate and the effect will end.
  50.         The armor and bleed damage will increase with your Spellpower.]]):
  51.         format(armor, damDesc(self, DamageType.PHYSICAL, damage))
  52.     end,
  53. }
Advertisement
Add Comment
Please, Sign In to add comment