Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newTalent{
- name = "Blood Shield", short_name = "DEMON_SEED_BLOOD_SHIELD",
- type = {"corruption/demon-seeds",1},
- points = 5,
- mode = "sustained",
- drain_vim = 2,
- cooldown = 10,
- tactical = { BUFF = 10, },
- no_energy = true,
- getPercent = function(self, t) return self:combatTalentScale(t, 100, 220) end,
- on_pre_use = function(self, t, silent) if not self:hasShield() then if not silent then game.logPlayer(self, "You require a weapon and a shield to use this talent.") end return false end return true end,
- callbackOnRest = function(self, t) -- Make sure we've actually started resting/running before disabling the sustain
- if self.resting.cnt and self.resting.cnt <= 0 then return end
- self:forceUseTalent(t.id, {ignore_cooldown=true, ignore_energy=true})
- end,
- callbackOnRun = function(self, t)
- if self.running.cnt and self.running.cnt <= 0 then return end
- self:forceUseTalent(t.id, {ignore_cooldown=true, ignore_energy=true})
- end,
- callbackOnMeleeHit = function(self, t, src, dam)
- if not src.x then return end
- local block = self:combatShieldBlock()
- if not block then return end
- DamageType:get(DamageType.SHADOWFLAME).projector(src, src.x, src.y, DamageType.SHADOWFLAME, block * 0.35 * t.getPercent(self, t) / 100)
- end,
- activate = function(self, t)
- local block = self:combatShieldBlock()
- if not block then return end
- local ret = {}
- self:talentTemporaryValue(ret, "flat_damage_armor", {all=block * 0.15})
- local h2x, h2y = self:attachementSpot("hand2", true) if h2x then ret.particle = self:addParticles(Particles.new("blood_shield", 1, {x=h2x, y=h2y-0.1})) end
- return ret
- end,
- deactivate = function(self, t, p)
- self:removeParticles(p.particle)
- return true
- end,
- info = function(self, t)
- return ([[By channeling doom forces in your shield you constantly apply 15%% of its block value as a flat damage reduction against all damage.
- Whenever you are hit in melee your shield retaliates automatically for %d%% of its block value as fire and darkness damage.]]):
- format(0.35 * t.getPercent(self, t))
- end,
- }
- ---
- newTalent{
- name = "Last Stand",
- type = {"technique/shield-defense", 4},
- require = techs_req4,
- mode = "sustained",
- points = 5,
- cooldown = 8,
- sustain_stamina = 30,
- tactical = { DEFEND = 3 },
- callbackOnRest = function(self, t) -- Make sure we've actually started resting/running before disabling the sustain
- if self.resting.cnt and self.resting.cnt <= 0 then return end
- self:forceUseTalent(t.id, {ignore_cooldown=true, ignore_energy=true})
- end,
- callbackOnRun = function(self, t)
- if self.running.cnt and self.running.cnt <= 0 then return end
- self:forceUseTalent(t.id, {ignore_cooldown=true, ignore_energy=true})
- end,
- no_npc_use = true,
- no_energy = true,
- on_pre_use = function(self, t, silent) if not self:hasShield() then if not silent then game.logPlayer(self, "You require a weapon and a shield to use this talent.") end return false end return true end,
- lifebonus = function(self,t, base_life) -- Scale bonus with max life
- return self:combatTalentStatDamage(t, "con", 30, 500) + (base_life or self.max_life) * self:combatTalentLimit(t, 1, 0.02, 0.10) -- Limit <100% of base life
- end,
- getDefense = function(self, t) return self:combatTalentStatDamage(t, "dex", 6, 20) end,
- getArmor = function(self, t) return self:combatTalentStatDamage(t, "dex", 6, 20) end,
- activate = function(self, t)
- local shield = self:hasShield()
- if not shield then
- game.logPlayer(self, "You cannot use Last Stand without a shield!")
- return nil
- end
- local hp = t.lifebonus(self,t)
- local ret = {
- base_life = self.max_life,
- max_life = self:addTemporaryValue("max_life", hp),
- def = self:addTemporaryValue("combat_def", t.getDefense(self, t)),
- armor = self:addTemporaryValue("combat_armor", t.getArmor(self, t)),
- nomove = self:addTemporaryValue("never_move", 1),
- dieat = self:addTemporaryValue("die_at", -hp),
- extra_life = self:addTemporaryValue("life", hp), -- Avoid healing effects
- }
- return ret
- end,
- deactivate = function(self, t, p)
- self:removeTemporaryValue("combat_def", p.def)
- self:removeTemporaryValue("combat_armor", p.armor)
- self:removeTemporaryValue("max_life", p.max_life)
- self:removeTemporaryValue("never_move", p.nomove)
- self:removeTemporaryValue("die_at", p.dieat)
- self:removeTemporaryValue("life", p.extra_life)
- return true
- end,
- info = function(self, t)
- local hp = self:isTalentActive(self.T_LAST_STAND)
- if hp then
- hp = t.lifebonus(self, t, hp.base_life)
- else
- hp = t.lifebonus(self,t)
- end
- return ([[You brace yourself for the final stand, increasing Defense and Armor by %d, maximum and current life by %d, but making you unable to move.
- Your stand lets you concentrate on every blow, allowing you to avoid death from normally fatal wounds. You can only die when reaching -%d life.
- The increase in Defense and Armor is based on your Dexterity, and the increase in life is based on your Constitution and normal maximum life.]]):
- format(t.getDefense(self, t), hp, hp)
- end,
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement