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

Multiple fixes to the Cursed class

git-svn-id: http://svn.net-core.org/repos/t-engine4@1328 51575b47-30f0-44d4-a5cc-537603b46e54
parent 0be85415
No related branches found
No related tags found
No related merge requests found
......@@ -28,86 +28,47 @@ newTalent{
require = cursed_str_req1,
points = 5,
on_learn = function(self, t)
-- assume on only learning one point at a time (true when this was written)
local level = self:getTalentLevelRaw(t)
if level == 1 then
-- baseline
self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) - 25
self.combat_spellresist = self.combat_spellresist - 10
self.max_life = self.max_life + 15
elseif level == 2 then
self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) + 5
self.combat_spellresist = self.combat_spellresist + 2
self.max_life = self.max_life + 15
elseif level == 3 then
self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) + 5
self.combat_spellresist = self.combat_spellresist + 2
self.max_life = self.max_life + 15
elseif level == 4 then
self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) + 5
self.combat_spellresist = self.combat_spellresist + 2
self.max_life = self.max_life + 15
elseif level == 5 then
self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) + 5
self.combat_spellresist = self.combat_spellresist + 2
self.max_life = self.max_life + 15
end
return true
end,
on_unlearn = function(self, t)
-- assume on only learning one point at a time (true when this was written)
local level = self:getTalentLevelRaw(t)
if not level or level == 0 then
-- baseline
self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) + 25
self.combat_spellresist = self.combat_spellresist + 10
self.max_life = self.max_life - 15
elseif level == 1 then
self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) - 5
self.combat_spellresist = self.combat_spellresist - 2
self.max_life = self.max_life - 15
elseif level == 2 then
self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) - 5
self.combat_spellresist = self.combat_spellresist - 2
self.max_life = self.max_life - 15
elseif level == 3 then
self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) - 5
self.combat_spellresist = self.combat_spellresist - 2
self.max_life = self.max_life - 15
elseif level == 4 then
self.resists[DamageType.FIRE] = (self.resists[DamageType.FIRE] or 0) - 5
self.combat_spellresist = self.combat_spellresist - 2
self.max_life = self.max_life - 15
end
return true
end,
getHealPerKill = function(self, t)
return math.sqrt(self:getTalentLevel(t)) * 10
end,
getRegenRate = function(self, t)
return math.sqrt(self:getTalentLevel(t) * 2) * self.max_life * 0.004
end,
do_regenLife = function(self, t)
heal = math.sqrt(self:getTalentLevel(t) * 2) * self.max_life * 0.0027
if heal > 0 then
-- heal
local maxHeal = self.unnatural_body_heal or 0
if maxHeal > 0 then
local heal = math.min(t.getRegenRate(self, t), maxHeal)
self:heal(heal)
self.unnatural_body_heal = math.max(0, (self.unnatural_body_heal or 0) - heal)
end
-- update resists as well
local oldResist = self.unnatural_body_resist or 0
local newResist = -15 + (15 * getHateMultiplier(self, 0, 1))
self.resists.all = (self.resists.all or 0) - oldResist + newResist
self.unnatural_body_resist = newResist
end,
info = function(self, t)
heal = math.sqrt(self:getTalentLevel(t) * 2) * self.max_life * 0.0027
local level = self:getTalentLevelRaw(t)
if level == 1 then
return ([[The curse has twisted your body into an unnatural form.
(-25%% fire resistance, -10 spell save, +15 maximum life, +%0.1f life per turn).]]):format(heal)
elseif level == 2 then
return ([[The curse has twisted your body into an unnatural form.
(-20%% fire resistance, -8 spell save, +15 maximum life, +%0.1f life per turn).]]):format(heal)
elseif level == 3 then
return ([[The curse has twisted your body into an unnatural form.
(-15%% fire resistance, -6 spell save, +15 maximum life, +%0.1f life per turn).]]):format(heal)
elseif level == 4 then
return ([[The curse has twisted your body into an unnatural form.
(-10%% fire resistance, -4 spell save, +15 maximum life, +%0.1f life per turn).]]):format(heal)
else
return ([[The curse has twisted your body into an unnatural form.
(-5%% fire resistance, -2 spell save, +15 maximum life, +%0.1f life per turn).]]):format(heal)
on_kill = function(self, t, target)
if target and target.max_life then
heal = t.getHealPerKill(self, t) * 0.01 * target.max_life
if heal > 0 then
self.unnatural_body_heal = math.min(self.life, (self.unnatural_body_heal or 0) + heal)
end
end
end,
info = function(self, t)
local healPerKill = t.getHealPerKill(self, t)
local regenRate = t.getRegenRate(self, t)
return ([[Your body is now fed by your hatred. With each kill, you regenerate %d%% of your victim's life at a rate of %0.1f life per turn. As your hate fades your body weakens taking up to 15%% extra damage.]]):format(healPerKill, regenRate)
end,
}
--newTalent{
......@@ -158,17 +119,17 @@ newTalent{
require = cursed_str_req2,
points = 5,
on_learn = function(self, t)
self.fear_immune = self.stun_immune or 0 + 0.15
self.confusion_immune = self.stun_immune or 0 + 0.15
self.knockback_immune = self.knockback_immune or 0 + 0.15
self.stun_immune = self.stun_immune or 0 + 0.15
self:attr("fear_immune", 0.15)
self:attr("confusion_immune", 0.15)
self:attr("knockback_immune", 0.15)
self:attr("stun_immune", 0.15)
return true
end,
on_unlearn = function(self, t)
self.fear_immune = self.stun_immune or 0 + 0.15
self.confusion_immune = self.stun_immune or 0 + 0.15
self.knockback_immune = self.knockback_immune or 0 + 0.15
self.stun_immune = self.stun_immune or 0 + 0.15
self:attr("fear_immune", -0.15)
self:attr("confusion_immune", -0.15)
self:attr("knockback_immune", -0.15)
self:attr("stun_immune", -0.15)
return true
end,
info = function(self, t)
......@@ -184,13 +145,11 @@ newTalent{
points = 5,
cooldown = 400,
action = function(self, t)
local increase = 2 + self:getTalentLevel(t) * 0.9
self.hate = math.min(self.max_hate, self.hate + increase)
self:incHate(hate)
self:incHate(2 + self:getTalentLevel(t) * 0.9)
local damage = self.max_life * 0.25
self:project({type="hit"}, self.x, self.y, DamageType.BLIGHT, damage)
game.level.map:particleEmitter(self.x, self.y, 5, "fireflash", {radius=5, tx=self.x, ty=self.y})
self:takeHit(damage, self)
game.level.map:particleEmitter(self.x, self.y, 5, "fireflash", {radius=2, tx=self.x, ty=self.y})
game:playSoundNear(self, "talents/fireflash")
return true
end,
......
......@@ -35,7 +35,7 @@ newTalent{
local tg = {type="hit", range=self:getTalentRange(t), talent=t}
local x, y, target = self:getTarget(tg)
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > self:getTalentRange(t) then
game.logPlayer(self, "You are too far to from the target!")
return nil
......@@ -43,9 +43,9 @@ newTalent{
local radius = t.getRadius(self, t)
local duration = t.getDuration(self, t)
target:setEffect(target.EFF_RADIANT_FEAR, duration, { radius = radius, knockback = 1, source = self })
return true
end,
info = function(self, t)
......@@ -68,7 +68,7 @@ newTalent{
getPercent = function(self, t) return 15 + math.floor(self:getTalentLevel(t) * 10) end,
info = function(self, t)
local percent = t.getPercent(self, t)
return ([[The time you have spent suppressing the curse has taught you self control. The duration of most non-magical effects (physical, mental, poisons, diseases, hexes and curses) are reduced by %d%%.]]):format(percent)
return ([[The time you have spent supressing the curse has taught you self control. The duration of most non-magical effects are reduced by %d%%.]]):format(percent)
end,
}
......@@ -127,7 +127,7 @@ newTalent{
end,
on_unlearn = function(self, t)
end,
range = function(self, t) return 16 - math.floor(self:getTalentLevel(t) * 2) end,
range = function(self, t) return 18 - math.floor(self:getTalentLevel(t) * 2) end,
info = function(self, t)
local range = t.range(self, t)
return ([[You hide your terrible nature behind a pitiful figure. Those that see you from a distance of %d will ignore you.]]):format(range)
......
......@@ -56,7 +56,7 @@ newTalent{
-- attempt domination
if checkWillFailure(self, target, 15, 85, 1) then
local damMult = 1 + self:combatTalentWeaponDamage(t, 0.1, 0.4)
local damMult = 1 + self:combatTalentWeaponDamage(t, 0.1, 0.5)
target:setEffect(target.EFF_DOMINATED, 4, { dominatedSource = self, dominatedDamMult = damMult })
else
game.logSeen(target, "%s resists the domination!", target.name:capitalize())
......@@ -68,7 +68,7 @@ newTalent{
return true
end,
info = function(self, t)
local damMult = self:combatTalentWeaponDamage(t, 0.1, 0.4)
local damMult = self:combatTalentWeaponDamage(t, 0.1, 0.5)
return ([[Combine strength and will to overpower your opponent. A failed save versus will will add %d%% melee damage to your attacks for 4 turns.]]):format(damMult * 100)
end,
}
......
......@@ -73,8 +73,8 @@ newTalent{
-- all gloom effects are handled here
local tWeakness = self:getTalentFromId(self.T_WEAKNESS)
local tTorment = self:getTalentFromId(self.T_TORMENT)
local tAbsorbLife = self:getTalentFromId(self.T_ABSORB_LIFE)
local lifeAbsorbed = 0
local tLifeLeech = self:getTalentFromId(self.T_LIFE_LEECH)
local lifeLeeched = 0
local attackStrength = 0.3 + self:getTalentLevel(tGloom) * 0.12
local tormentHit = false
......@@ -162,13 +162,12 @@ newTalent{
end
end
-- Absorb Life
if tAbsorbLife and self:getTalentLevelRaw(tAbsorbLife) > 0 then
local fraction = self:getTalentLevel(tAbsorbLife) * 0.002
-- Life Leech
if tLifeLeech and self:getTalentLevelRaw(tLifeLeech) > 0 then
local fraction = self:getTalentLevel(tLifeLeech) * 0.002
local damage = math.min(target.max_life * fraction, self.max_life * fraction * 2)
local actualDamage = DamageType:get(DamageType.ABSORB_LIFE).projector(self, target.x, target.y, DamageType.ABSORB_LIFE, damage)
lifeAbsorbed = lifeAbsorbed + actualDamage
--game.logSeen(target, "#F53CBE#You absorb %.2f life from %s!", actualDamage, target.name:capitalize())
local actualDamage = DamageType:get(DamageType.LIFE_LEECH).projector(self, target.x, target.y, DamageType.LIFE_LEECH, damage)
lifeLeeched = lifeLeeched + actualDamage
end
end
end
......@@ -178,10 +177,10 @@ newTalent{
self.torment_turns = 20
end
-- absorb life
if lifeAbsorbed > 0 then
self:heal(lifeAbsorbed)
game.logPlayer(self, "#F53CBE#You absorb %0.1f life from your foes.", lifeAbsorbed)
-- life leech
if lifeLeeched > 0 then
self:heal(lifeLeeched)
game.logPlayer(self, "#F53CBE#You leech %0.1f life from your foes.", lifeLeeched)
end
end,
info = function(self, t)
......
......@@ -26,7 +26,7 @@ newTalent{
type = {"cursed/rampage", 1},
require = cursed_str_req1,
points = 5,
cooldown = 475,
cooldown = 150,
hate = 0.1,
action = function(self, t, hateLoss)
local hateLoss = 0
......@@ -65,8 +65,8 @@ newTalent{
return true
end,
getHateLoss = function(self, t) return 0.5 - 0.1 * self:getTalentLevelRaw(t) end,
getCritical = function(self, t) return 8 * self:getTalentLevel(t) end,
getHateLoss = function(self, t) return 0.25 - 0.05 * self:getTalentLevelRaw(t) end,
getCritical = function(self, t) return 10 + 8 * self:getTalentLevel(t) end,
onTakeHit = function(t, self, percentDamage)
if percentDamage < 10 then return false end
if self:hasEffect(self.EFF_RAMPAGE) then return false end
......@@ -84,7 +84,7 @@ newTalent{
local hateLoss = t.getHateLoss(self, t)
local critical = t.getCritical(self, t)
return ([[You enter into a terrible rampage for %d turns, destroying everything in your path. There is a small chance you will rampage when you take significant damage.
(%0.1f hate loss, +%d%% to %d%% hate-based critical chance)]]):format(duration, hateLoss, critical * 0.3, critical * 1.0)
(%0.1f hate loss per turn, +%d%% to %d%% hate-based critical chance)]]):format(duration, hateLoss, critical * 0.3, critical * 1.0)
end,
}
......@@ -99,7 +99,7 @@ newTalent{
on_unlearn = function(self, t)
end,
getDuration = function(self, t) return 5 + math.floor(2 * self:getTalentLevel(t)) end,
getDamage = function(self, t) return 10 + 10 * self:getTalentLevel(t) end,
getDamage = function(self, t) return 20 + 10 * self:getTalentLevel(t) end,
info = function(self, t)
local duration = t.getDuration(self, t)
local damage = t.getDamage(self, t)
......@@ -117,15 +117,13 @@ newTalent{
on_learn = function(self, t)
local tRampage = self:getTalentFromId(self.T_RAMPAGE)
tRampage.cooldown = tRampage.cooldown - 25
print("* cooldown:", tRampage.cooldown)
end,
on_unlearn = function(self, t)
local tRampage = self:getTalentFromId(self.T_RAMPAGE)
tRampage.cooldown = tRampage.cooldown + 25
print("* cooldown:", tRampage.cooldown)
end,
getCooldown = function(self, t) return 475 - math.floor(25 * self:getTalentLevelRaw(t)) end,
getSpeed = function(self, t) return 15 + 15 * self:getTalentLevel(t) end,
getCooldown = function(self, t) return 150 - math.floor(10 * self:getTalentLevelRaw(t)) end,
getSpeed = function(self, t) return 15 * self:getTalentLevel(t) end,
info = function(self, t)
local cooldown = t.getCooldown(self, t)
local speed = t.getSpeed(self, t)
......@@ -144,7 +142,7 @@ newTalent{
end,
on_unlearn = function(self, t)
end,
getAttack = function(self, t) return 10 + 10 * self:getTalentLevel(t) end,
getAttack = function(self, t) return 20 + 10 * self:getTalentLevel(t) end,
getEvasion = function(self, t) return 6 * self:getTalentLevel(t) end,
info = function(self, t)
local attack = t.getAttack(self, t)
......
......@@ -42,13 +42,13 @@ newTalent{
if not x or not y or not target then return nil end
if math.floor(core.fov.distance(self.x, self.y, x, y)) > 1 then return nil end
local multiplier = 1 + (0.15 + .2 * self:getTalentLevel(t)) * getHateMultiplier(self, 0, 1)
local multiplier = 1 + (0.17 + .23 * self:getTalentLevel(t)) * getHateMultiplier(self, 0, 1)
local hit = self:attackTarget(target, nil, multiplier, true)
return true
end,
info = function(self, t)
local multiplier = (0.15 + .2 * self:getTalentLevel(t))
local multiplier = (0.17 + .23 * self:getTalentLevel(t))
return ([[Slashes wildly at your target adding up to %d%% hate-based damage.]]):format(multiplier * 100)
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