Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newTalent{
- short_name = "X_SPIKES",
- name = "Carbon Spikes",
- --taken from the carbon spikes talent
- type = {"race/Chrono_Xorn", 1},
- image = "talents/carbon_spikes.png",
- --no_sustain_autoreset = true,
- points = 5,
- mode = "sustained",
- sustain_paradox = 20,
- cooldown = 12,
- tactical = { BUFF =2, DEFEND = 2 },
- getDamageOnMeleeHit = function(self, t) return self:combatTalentSpellDamage(t, 1, 150, getParadoxSpellpower(self, t)) end,
- getArmor = function(self, t) return math.ceil(self:combatTalentSpellDamage(t, 20, 50, getParadoxSpellpower(self, t))) end,
- callbackOnActBase = function(self, t)
- local maxspikes = t.getArmor(self, t)
- if self.carbon_armor < maxspikes then
- self.carbon_armor = self.carbon_armor + 1
- end
- end,
- do_carbonLoss = function(self, t)
- if self.carbon_armor >= 1 then
- self.carbon_armor = self.carbon_armor - 1
- else
- -- Deactivate without loosing energy
- self:forceUseTalent(self.T_CARBON_SPIKES, {ignore_energy=true})
- end
- end,
- activate = function(self, t)
- local power = t.getArmor(self, t)
- self.carbon_armor = power
- game:playSoundNear(self, "talents/spell_generic")
- return {
- armor = self:addTemporaryValue("carbon_spikes", power),
- onhit = self:addTemporaryValue("on_melee_hit", {[DamageType.BLEED]=t.getDamageOnMeleeHit(self, t)}),
- }
- end,
- deactivate = function(self, t, p)
- self:removeTemporaryValue("carbon_spikes", p.armor)
- self:removeTemporaryValue("on_melee_hit", p.onhit)
- self.carbon_armor = nil
- return true
- end,
- info = function(self, t)
- local damage = t.getDamageOnMeleeHit(self, t)
- local armor = t.getArmor(self, t)
- 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.
- If the armor increase from the spell ever falls below 1, the sustain will deactivate and the effect will end.
- The armor and bleed damage will increase with your Spellpower.]]):
- format(armor, damDesc(self, DamageType.PHYSICAL, damage))
- end,
- }
Advertisement
Add Comment
Please, Sign In to add comment