Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newTalent{
- short_name = "X_SWALLOW",
- name = "Earth Swallow",
- --adapted from Swallow talent
- type = {"race/Xorn_Infusions", 1},
- image = "talents/swallow.png",
- require = gifts_req1,
- points = 4,
- equilibrium = 5,
- cooldown = function(self, t) return math.ceil(self:combatTalentLimit(t, 4, 10, 7)) end,
- range = 1,
- no_message = true,
- tactical = { ATTACK = { weapon = 1 }, EQUILIBRIUM = 0.5},
- requires_target = true,
- no_npc_use = true,
- is_melee = true,
- target = function(self, t) return {type="hit", range=self:getTalentRange(t)} end,
- maxSwallow = function(self, t, target) return -- Limit < 50%
- self:combatLimit(self:getTalentLevel(t)*(self.size_category or 3)/(target.size_category or 3), 50, 13, 1, 25, 5)
- end,
- getPassiveCrit = function(self, t) return self:combatTalentScale(t, 2, 10, 0.5) end,
- on_learn = function(self, t) self.resists[DamageType.PHYSICAL] = (self.resists[DamageType.PHYSICAL] or 0) + 0.5 end,
- on_unlearn = function(self, t) self.resists[DamageType.PHYSICAL] = (self.resists[DamageType.PHYSICAL] or 0) - 0.5 end,
- passives = function(self, t, p)
- self:talentTemporaryValue(p, "combat_physcrit", t.getPassiveCrit(self, t))
- self:talentTemporaryValue(p, "combat_mindcrit", t.getPassiveCrit(self, t))
- end,
- action = function(self, t)
- local tg = self:getTalentTarget(t)
- local x, y, target = self:getTarget(tg)
- if not target or not self:canProject(tg, x, y) then return nil end
- self:logCombat(target, "#Source# tries to swallow #Target#!")
- local hit = self:attackTarget(target, DamageType.NATURE, self:combatTalentWeaponDamage(t, 1.6, 2.5), true)
- if not hit then return true end
- if (target.life * 100 / target.max_life > t.maxSwallow(self, t, target)) and not target.dead then
- return true
- end
- if (target:checkHit(self:combatPhysicalpower(), target:combatPhysicalResist(), 0, 95, 15) or target.dead) and (target:canBe("instakill") or target.life * 100 / target.max_life <= 5) then
- if not target.dead then target:die(self) end
- world:gainAchievement("EAT_BOSSES", self, target)
- self:incEquilibrium(-target.level - 5)
- self:attr("allow_on_heal", 1)
- self:heal(target.level * 2 + 5, target)
- if core.shader.active(4) then
- self:addParticles(Particles.new("shader_shield_temp", 1, {toback=true ,size_factor=1.5, y=-0.3, img="healgreen", life=25}, {type="healing", time_factor=2000, beamsCount=20, noup=2.0}))
- self:addParticles(Particles.new("shader_shield_temp", 1, {toback=false,size_factor=1.5, y=-0.3, img="healgreen", life=25}, {type="healing", time_factor=2000, beamsCount=20, noup=1.0}))
- end
- self:attr("allow_on_heal", -1)
- else
- game.logSeen(target, "%s resists!", target.name:capitalize())
- end
- return true
- end,
- info = function(self, t)
- return ([[Fuse with the surrounding earth elements and attack the target for %d%% Nature weapon damage.
- If the attack brings your target below %d%% life or kills it, you can try to swallow it, killing it automatically and regaining life and equilibrium depending on its level.
- The chance to swallow depends on your talent level and the relative size of the target.
- Levels in Swallow additionally raises your Physical and Mental critical rate by %d%%, passively.
- Each point also increases your physical resistance by 0.5%%.]]):
- format(100 * self:combatTalentWeaponDamage(t, 1.6, 2.5), t.maxSwallow(self, t, self), t.getPassiveCrit(self, t))
- end,
- }
Advertisement
Add Comment
Please, Sign In to add comment