Skip to content
Snippets Groups Projects
Commit 621e69e7 authored by dg's avatar dg
Browse files

yay

git-svn-id: http://svn.net-core.org/repos/t-engine4@5572 51575b47-30f0-44d4-a5cc-537603b46e54
parent d0fb3beb
No related branches found
No related tags found
No related merge requests found
......@@ -1526,6 +1526,18 @@ function _M:onTakeHit(value, src)
return 0
end
if self:attr("phase_shift") and not self.turn_procs.phase_shift then
self.turn_procs.phase_shift = true
local nx, ny = util.findFreeGrid(self.x, self.y, 1, true, {[Map.ACTOR]=true})
if nx then
local ox, oy = self.x, self.y
self:move(nx, ny, true)
game.level.map:particleEmitter(ox, oy, math.max(math.abs(nx-ox), math.abs(ny-oy)), "lightning", {tx=nx-ox, ty=ny-oy})
return 0
end
end
if self:attr("retribution") then
-- Absorb damage into the retribution
if value / 2 <= self.retribution_absorb then
......@@ -4123,6 +4135,9 @@ function _M:on_set_temporary_effect(eff_id, e, p)
self:attr("mental_negative_status_effect_immune", -1)
if not self:attr("mental_negative_status_effect_immune") then self:removeEffect(self.EFF_CLEAR_MIND) end
end
if e.status == "detrimental" and e.type == "physical" and self:attr("physical_negative_status_effect_immune") and not e.subtype["cross tier"] then
p.dur = 0
end
if self:attr("status_effect_immune") then
p.dur = 0
end
......
......@@ -1246,6 +1246,8 @@ function _M:physicalCrit(dam, weapon, target, atk, def, add_chance, crit_power_a
crit = true
if self:knowTalent(self.T_EYE_OF_THE_TIGER) then self:triggerTalent(self.T_EYE_OF_THE_TIGER, nil, "physical") end
self.turn_procs.is_crit = "physical"
end
return dam, crit
end
......@@ -1289,6 +1291,8 @@ function _M:spellCrit(dam, add_chance, crit_power_add)
end
if self:knowTalent(self.T_EYE_OF_THE_TIGER) then self:triggerTalent(self.T_EYE_OF_THE_TIGER, nil, "spell") end
self.turn_procs.is_crit = "spell"
end
return dam, crit
end
......@@ -1315,6 +1319,7 @@ function _M:mindCrit(dam, add_chance, crit_power_add)
if self:attr("equilibrium_on_crit") then self:incEquilibrium(self:attr("equilibrium_on_crit")) end
if self:knowTalent(self.T_EYE_OF_THE_TIGER) then self:triggerTalent(self.T_EYE_OF_THE_TIGER, nil, "mind") end
self.turn_procs.is_crit = "mind"
end
return dam, crit
end
......
......@@ -382,6 +382,15 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr)
end
end
if src.turn_procs and src.turn_procs.is_crit then
if src.knowTalent and src:knowTalent(src.T_ELEMENTAL_SURGE) then
src:triggerTalent(src.T_ELEMENTAL_SURGE, nil, target, type, dam)
end
src.turn_procs.is_crit = nil
end
return dam
end
return 0
......
......@@ -51,7 +51,7 @@ newTalent{
end
if self:getTalentLevel(t) >= 4 then
tg.selffire= false
self:project(tg, self.x, self.y, DamageType.LIGHT, t.getDamage(self, t))
self:project(tg, self.x, self.y, DamageType.LIGHT, self:spellCrit(t.getDamage(self, t)))
end
game:playSoundNear(self, "talents/heal")
return true
......
......@@ -148,6 +148,7 @@ uberTalent{
uberTalent{
name = "Elemental Surge",
mode = "passive",
cooldown = 12,
require = { special={desc="Dealt over 50000 arcane, fire, cold, lightning, light or nature damage", fct=function(self) return
self.damage_log and (
(self.damage_log[DamageType.ARCANE] and self.damage_log[DamageType.ARCANE] >= 50000) or
......@@ -159,21 +160,29 @@ uberTalent{
)
end} },
trigger = function(self, t, target, damtype, dam)
if dam < 150 then return end
if damtype == DamageType.ARCANE and rng.percent(15) then
if dam < 300 then return end
local ok = false
if damtype == DamageType.ARCANE and rng.percent(30) then ok=true self:setEffect(self.EFF_ELEMENTAL_SURGE_ARCANE, 5, {})
elseif damtype == DamageType.FIRE and rng.percent(15) then ok=true self:removeEffectsFilter{type="magical", status="detrimental"} self:removeEffectsFilter{type="physical", status="detrimental"}
elseif damtype == DamageType.COLD and rng.percent(30) then ok=true self:setEffect(self.EFF_ELEMENTAL_SURGE_COLD, 5, {})
elseif damtype == DamageType.LIGHTNING and rng.percent(20) then ok=true self:setEffect(self.EFF_ELEMENTAL_SURGE_LIGHTNING, 5, {})
elseif damtype == DamageType.LIGHT and rng.percent(30) then if not self:hasEffect(self.EFF_DAMAGE_SHIELD) then ok=true self:setEffect(self.EFF_DAMAGE_SHIELD, 5, {power=200}) end
elseif damtype == DamageType.NATURE and rng.percent(30) then ok=true self:setEffect(self.EFF_ELEMENTAL_SURGE_NATURE, 5, {})
end
if ok then self:startTalentCooldown(t) end
end,
info = function(self, t)
return ([[Surround yourself with an elemental aura, when you deal a critical hit with an element you have a chance to trigger a special effect.
Arcane damage has 15%% chances to .
Fire damage has 15%% chances to cleanse a physical or magical detrimental effect on you.
Cold damage has 15%% chances to turn your skin into ice for 5 turns, reflecting projectiles and dealing %d ice damage to attackers.
Lightning damage has 15%% chances to become pure lightning for 3 turns, any damage will teleport you to an adjacent tile and ignore the damage (can only happen once per turn).
Light damage has 15%% chances to .
Nature damage has 15%% chances to harden your skin, preventing the application of any physical detrimental effects for 5 turns.
This only triggers for hits over 150 damage.
Values increase with Cunning.]])
:format(self:getCun() / 2.5, self:getCun() / 2, self:getCun() / 2.5, self:getCun() / 2)
Arcane damage has 30%% chances to increase spellcasting speed by 20%% for 5 turns.
Fire damage has 15%% chances to cleanse all physical or magical detrimental effect on you.
Cold damage has 30%% chances to turn your skin into ice for 5 turns, reducing physical damage taken by 30%% and dealing 100 ice damage to attackers.
Lightning damage has 20%% chances to become pure lightning for 3 turns, any damage will teleport you to an adjacent tile and ignore the damage (can only happen once per turn).
Light damage has 30%% chances to create a barrier around you absorbing 200 damage for 5 turns.
Nature damage has 30%% chances to harden your skin, preventing the application of any physical detrimental effects for 5 turns.
This only triggers for hits over 300 damage.]])
:format()
end,
}
......
......@@ -1887,3 +1887,44 @@ newEffect{
end
end,
}
newEffect{
name = "ELEMENTAL_SURGE_ARCANE", image = "talents/elemental_surge.png",
desc = "Elemental Surge: Arcane",
long_desc = function(self, eff) return ("Spellcasting speed increased by 20%") end,
type = "magical",
subtype = { arcane=true },
status = "beneficial",
parameters = { },
activate = function(self, eff)
self:effectTemporaryValue(eff, "combat_spellspeed", 0.2)
end,
}
newEffect{
name = "ELEMENTAL_SURGE_COLD", image = "talents/elemental_surge.png",
desc = "Elemental Surge: Cold",
long_desc = function(self, eff) return ("Physical damage reduced by 30% and deals 100 ice damage when hit in melee.") end,
type = "magical",
subtype = { arcane=true },
status = "beneficial",
parameters = { },
activate = function(self, eff)
self:effectTemporaryValue(eff, "resists", {[DamageType.PHYSICAL]=30})
self:effectTemporaryValue(eff, "on_melee_hit", {[DamageType.ICE]=100})
end,
}
newEffect{
name = "ELEMENTAL_SURGE_LIGHTNING", image = "talents/elemental_surge.png",
desc = "Elemental Surge: Lightning",
long_desc = function(self, eff) return ("When hit you turn into pure lightning and reappear near where you where, ignoring the blow.") end,
type = "magical",
subtype = { arcane=true },
status = "beneficial",
parameters = { },
activate = function(self, eff)
self:effectTemporaryValue(eff, "phase_shift", 1)
end,
}
......@@ -1905,3 +1905,16 @@ newEffect{
end
end,
}
newEffect{
name = "ELEMENTAL_SURGE_NATURE", image = "talents/elemental_surge.png",
desc = "Elemental Surge: Nature",
long_desc = function(self, eff) return ("Immune to physical effects.") end,
type = "physical",
subtype = { status=true },
status = "beneficial",
parameters = { },
activate = function(self, eff)
self:effectTemporaryValue(eff, "physical_negative_status_effect_immune", 1)
end,
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment