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

moer corruptions

git-svn-id: http://svn.net-core.org/repos/t-engine4@1008 51575b47-30f0-44d4-a5cc-537603b46e54
parent 60d420e2
No related branches found
No related tags found
No related merge requests found
......@@ -92,6 +92,7 @@ function _M:init(t, no_default)
t.life_rating = t.life_rating or 10
t.mana_rating = t.mana_rating or 4
t.vim_rating = t.vim_rating or 4
t.stamina_rating = t.stamina_rating or 3
t.positive_negative_rating = t.positive_negative_rating or 3
......@@ -119,6 +120,7 @@ function _M:init(t, no_default)
t.stamina_regen = t.stamina_regen or 0.3 -- Stamina regens slower than mana
t.life_regen = t.life_regen or 0.25 -- Life regen real slow
t.equilibrium_regen = t.equilibrium_regen or 0 -- Equilibrium does not regen
t.vim_regen = t.vim_regen or 0 -- Vim does not regen
t.positive_regen = t.positive_regen or -0.2 -- Positive energy slowly decays
t.negative_regen = t.negative_regen or -0.2 -- Positive energy slowly decays
......@@ -525,10 +527,17 @@ function _M:onTakeHit(value, src)
game.logSeen(self, "The displacement shield teleports the damage to %s!", self.displacement_shield_target.name)
self.displacement_shield = self.displacement_shield - value
self.displacement_shield_target:takeHit(value, src)
self:removeEffect(self.EFF_BONE_SHIELD)
value = 0
end
end
if self:isTalentActive(self.T_BONE_SHIELD) then
local t = self:getTalentFromId(self.T_BONE_SHIELD)
t.absorb(self, t, self:isTalentActive(self.T_BONE_SHIELD))
value = 0
end
-- Mount takes some damage ?
local mount = self:hasMount()
if mount and mount.mount.share_damage then
......@@ -640,6 +649,7 @@ end
function _M:resetToFull()
self.life = self.max_life
self.mana = self.max_mana
self.vim = self.max_vim
self.stamina = self.max_stamina
self.equilibrium = 0
end
......@@ -690,6 +700,7 @@ function _M:levelup()
end
self.max_life = self.max_life + math.max(self:getRankLifeAdjust(rating), 1)
self:incMaxVim(self.vim_rating)
self:incMaxMana(self.mana_rating)
self:incMaxStamina(self.stamina_rating)
self:incMaxPositive(self.positive_negative_rating)
......
......@@ -113,7 +113,7 @@ newEntity{ base = "BASE_NPC_ORC_RAK_SHOR",
[Talents.T_BLOOD_GRASP]=5,
[Talents.T_CURSE_OF_VULNERABILITY]=5,
[Talents.T_BLIGHTZONE]=3,
-- [Talents.T_BONE_SHIELD]=5,
[Talents.T_BONE_SHIELD]=5,
[Talents.T_BLOOD_SPRAY]=4,
},
}
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
local ad = rng.range(0, 360)
local a = math.rad(ad)
local r = 18
return { generator = function()
return {
life = 20,
size = 4, sizev = 0, sizea = 0,
x = r * math.cos(a), xv = 0, xa = 0,
y = r * math.sin(a), yv = 0, ya = 0,
dir = 0, dirv = 0, dira = 0,
vel = 0, velv = 0, vela = 0,
r = rng.range(220, 255)/255, rv = 0, ra = 0,
g = rng.range(220, 255)/255, gv = 0, ga = 0,
b = rng.range(220, 255)/255, gv = 0, ga = 0,
a = rng.range(230, 225)/255, av = 0, aa = 0,
}
end, },
function(self)
self.ps:emit(1)
end,
1
......@@ -975,3 +975,45 @@ newTalent{
The resistances will decrease with Magic stat.]]):format(self:combatTalentSpellDamage(t, 10, 85))
end,
}
newTalent{
name = "Bone Shield",
type = {"corruption/other", 1},
points = 5,
mode = "sustained", no_sustain_autoreset = true,
cooldown = 60,
sustain_vim = 70,
tactical = {
DEFEND = 10,
},
absorb = function(self, t, p)
game.logPlayer(self, "Your bone shield absorbs the damage!")
self:removeParticles(table.remove(p.particles))
if #p.particles <= 0 then
local old = self.energy.value
self.energy.value = 100000
self:useTalent(t.id)
self.energy.value = old
end
end,
activate = function(self, t)
local nb = math.floor(self:getTalentLevel(t))
local ps = {}
for i = 1, nb do ps[#ps+1] = self:addParticles(Particles.new("bone_shield", 1)) end
game:playSoundNear(self, "talents/spell_generic2")
return {
particles = ps,
}
end,
deactivate = function(self, t, p)
for i, particle in ipairs(p.particles) do self:removeParticles(particle) end
return true
end,
info = function(self, t)
return ([[Bone shields start circling around you, they will each absorb fully one attack.
%d shield(s) will be generated.]]):
format(math.floor(self:getTalentLevel(t)))
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