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

Fixes and tweaks to the Cursed class

git-svn-id: http://svn.net-core.org/repos/t-engine4@1568 51575b47-30f0-44d4-a5cc-537603b46e54
parent ab7a3842
No related branches found
No related tags found
No related merge requests found
...@@ -661,7 +661,7 @@ function _M:onTakeHit(value, src) ...@@ -661,7 +661,7 @@ function _M:onTakeHit(value, src)
if hateGain >= 0.1 then if hateGain >= 0.1 then
self.hate = math.min(self.max_hate, self.hate + hateGain) self.hate = math.min(self.max_hate, self.hate + hateGain)
if hateMessage then if hateMessage then
game.logSeen(self, hateMessage.." (+%0.1f hate)", hateGain) game.logPlayer(self, hateMessage.." (+%0.1f hate)", hateGain)
end end
end end
end end
...@@ -678,7 +678,7 @@ function _M:onTakeHit(value, src) ...@@ -678,7 +678,7 @@ function _M:onTakeHit(value, src)
if hateGain >= 0.1 then if hateGain >= 0.1 then
src.hate = math.min(src.max_hate, src.hate + hateGain) src.hate = math.min(src.max_hate, src.hate + hateGain)
if hateMessage then if hateMessage then
game.logSeen(src, hateMessage.." (+%0.1f hate)", hateGain) game.logPlayer(src, hateMessage.." (+%0.1f hate)", hateGain)
end end
end end
end end
...@@ -785,7 +785,7 @@ function _M:die(src) ...@@ -785,7 +785,7 @@ function _M:die(src)
src.hate = math.min(src.max_hate, src.hate + hateGain) src.hate = math.min(src.max_hate, src.hate + hateGain)
if hateMessage then if hateMessage then
game.logSeen(src, hateMessage.." (+%0.1f hate)", hateGain - src.hate_per_kill) game.logPlayer(src, hateMessage.." (+%0.1f hate)", hateGain - src.hate_per_kill)
end end
end end
......
...@@ -34,11 +34,14 @@ newTalent{ ...@@ -34,11 +34,14 @@ newTalent{
return true return true
end, end,
getHealPerKill = function(self, t) getHealPerKill = function(self, t)
return math.sqrt(self:getTalentLevel(t)) * 10 return math.sqrt(self:getTalentLevel(t)) * 15
end, end,
getRegenRate = function(self, t) getRegenRate = function(self, t)
return math.sqrt(self:getTalentLevel(t) * 2) * self.max_life * 0.008 return math.sqrt(self:getTalentLevel(t) * 2) * self.max_life * 0.008
end, end,
getResist = function(self, t)
return -18 + (self:getTalentLevel(t) * 3) + (18 * getHateMultiplier(self, 0, 1))
end,
do_regenLife = function(self, t) do_regenLife = function(self, t)
-- heal -- heal
local maxHeal = self.unnatural_body_heal or 0 local maxHeal = self.unnatural_body_heal or 0
...@@ -51,7 +54,7 @@ newTalent{ ...@@ -51,7 +54,7 @@ newTalent{
-- update resists as well -- update resists as well
local oldResist = self.unnatural_body_resist or 0 local oldResist = self.unnatural_body_resist or 0
local newResist = -15 + (15 * getHateMultiplier(self, 0, 1)) local newResist = t.getResist(self, t)
self.resists.all = (self.resists.all or 0) - oldResist + newResist self.resists.all = (self.resists.all or 0) - oldResist + newResist
self.unnatural_body_resist = newResist self.unnatural_body_resist = newResist
end, end,
...@@ -66,8 +69,8 @@ newTalent{ ...@@ -66,8 +69,8 @@ newTalent{
info = function(self, t) info = function(self, t)
local healPerKill = t.getHealPerKill(self, t) local healPerKill = t.getHealPerKill(self, t)
local regenRate = t.getRegenRate(self, t) local regenRate = t.getRegenRate(self, t)
local resist = -18 + (self:getTalentLevel(t) * 3)
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) 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 and grows the damage you sustain is adjusted by %d%% to %d%%.]]):format(healPerKill, regenRate, resist, resist + 18)
end, end,
} }
...@@ -113,11 +116,34 @@ newTalent{ ...@@ -113,11 +116,34 @@ newTalent{
--} --}
newTalent{ newTalent{
name = "Relentless", name = "Seethe",
type = {"cursed/cursed-form", 2}, type = {"cursed/cursed-form", 2},
mode = "passive", random_ego = "utility",
require = cursed_str_req2, require = cursed_str_req2,
points = 5, points = 5,
cooldown = 400,
action = function(self, t)
self:incHate(2 + self:getTalentLevel(t) * 0.9)
local damage = self.max_life * 0.25
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,
info = function(self, t)
local increase = 2 + self:getTalentLevel(t) * 0.9
local damage = self.max_life * 0.25
return ([[Focus your rage gaining %0.1f hate at the cost of %d life.]]):format(increase, damage)
end,
}
newTalent{
name = "Relentless",
type = {"cursed/cursed-form", 3},
mode = "passive",
require = cursed_str_req3,
points = 5,
on_learn = function(self, t) on_learn = function(self, t)
self:attr("fear_immune", 0.15) self:attr("fear_immune", 0.15)
self:attr("confusion_immune", 0.15) self:attr("confusion_immune", 0.15)
...@@ -137,29 +163,6 @@ newTalent{ ...@@ -137,29 +163,6 @@ newTalent{
end, end,
} }
newTalent{
name = "Seethe",
type = {"cursed/cursed-form", 3},
random_ego = "utility",
require = cursed_str_req3,
points = 5,
cooldown = 400,
action = function(self, t)
self:incHate(2 + self:getTalentLevel(t) * 0.9)
local damage = self.max_life * 0.25
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,
info = function(self, t)
local increase = 2 + self:getTalentLevel(t) * 0.9
local damage = self.max_life * 0.25
return ([[Focus your rage gaining %0.1f hate at the cost of %d life.]]):format(increase, damage)
end,
}
newTalent{ newTalent{
name = "Enrage", name = "Enrage",
type = {"cursed/cursed-form", 4}, type = {"cursed/cursed-form", 4},
......
...@@ -95,7 +95,7 @@ newTalent{ ...@@ -95,7 +95,7 @@ newTalent{
points = 5, points = 5,
random_ego = "attack", random_ego = "attack",
cooldown = 10, cooldown = 10,
hate = 0.1, hate = 0.3,
range = 10, range = 10,
requires_target = true, requires_target = true,
action = function(self, t) action = function(self, t)
...@@ -113,7 +113,7 @@ newTalent{ ...@@ -113,7 +113,7 @@ newTalent{
and not game.level.map.attrs(x, y, "no_teleport") then and not game.level.map.attrs(x, y, "no_teleport") then
self:move(x, y, true) self:move(x, y, true)
game:playSoundNear(self, "talents/teleport") game:playSoundNear(self, "talents/teleport")
local multiplier = self:combatTalentWeaponDamage(t, 0.9, 1.9) * getHateMultiplier(self, 0.3, 1.0) local multiplier = self:combatTalentWeaponDamage(t, 0.7, 1.9) * getHateMultiplier(self, 0.3, 1.0)
self:attackTarget(target, nil, multiplier, true) self:attackTarget(target, nil, multiplier, true)
return true return true
end end
...@@ -122,8 +122,8 @@ newTalent{ ...@@ -122,8 +122,8 @@ newTalent{
return true return true
end, end,
info = function(self, t) info = function(self, t)
local multiplier = self:combatTalentWeaponDamage(t, 1.1, 1.9) local multiplier = self:combatTalentWeaponDamage(t, 0.7, 1.9)
return ([[With blinding speed you suddenly appear next to a target up to %d spaces away and attack for %d%% to %d%% rage-based damage.]]):format(self:getTalentRange(t), multiplier * 30, multiplier * 100) return ([[With blinding speed you suddenly appear next to a target up to %d spaces away and attack for %d%% to %d%% hate-based damage.]]):format(self:getTalentRange(t), multiplier * 30, multiplier * 100)
end, end,
} }
......
...@@ -27,7 +27,7 @@ newTalent{ ...@@ -27,7 +27,7 @@ newTalent{
require = cursed_str_req1, require = cursed_str_req1,
points = 5, points = 5,
cooldown = 150, cooldown = 150,
hate = 0.1, hate = 0.5,
action = function(self, t, hateLoss) action = function(self, t, hateLoss)
local hateLoss = 0 local hateLoss = 0
local critical = 0 local critical = 0
...@@ -65,7 +65,7 @@ newTalent{ ...@@ -65,7 +65,7 @@ newTalent{
return true return true
end, end,
getHateLoss = function(self, t) return 0.25 - 0.05 * self:getTalentLevelRaw(t) end, getHateLoss = function(self, t) return 0.5 - 0.05 * self:getTalentLevelRaw(t) end,
getCritical = function(self, t) return 10 + 8 * self:getTalentLevel(t) end, getCritical = function(self, t) return 10 + 8 * self:getTalentLevel(t) end,
onTakeHit = function(t, self, percentDamage) onTakeHit = function(t, self, percentDamage)
if percentDamage < 10 then return false end if percentDamage < 10 then return false end
...@@ -84,7 +84,7 @@ newTalent{ ...@@ -84,7 +84,7 @@ newTalent{
local hateLoss = t.getHateLoss(self, t) local hateLoss = t.getHateLoss(self, t)
local critical = t.getCritical(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. 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 per turn, +%d%% to %d%% hate-based critical chance)]]):format(duration, hateLoss, critical * 0.3, critical * 1.0) (%0.2f hate loss per turn, +%d%% to %d%% hate-based critical chance)]]):format(duration, hateLoss, critical * 0.3, critical * 1.0)
end, end,
} }
...@@ -99,7 +99,7 @@ newTalent{ ...@@ -99,7 +99,7 @@ newTalent{
on_unlearn = function(self, t) on_unlearn = function(self, t)
end, end,
getDuration = function(self, t) return 5 + math.floor(2 * self:getTalentLevel(t)) end, getDuration = function(self, t) return 5 + math.floor(2 * self:getTalentLevel(t)) end,
getDamage = function(self, t) return 20 + 10 * self:getTalentLevel(t) end, getDamage = function(self, t) return 10 * self:getTalentLevel(t) end,
info = function(self, t) info = function(self, t)
local duration = t.getDuration(self, t) local duration = t.getDuration(self, t)
local damage = t.getDamage(self, t) local damage = t.getDamage(self, t)
...@@ -116,14 +116,14 @@ newTalent{ ...@@ -116,14 +116,14 @@ newTalent{
mode = "passive", mode = "passive",
on_learn = function(self, t) on_learn = function(self, t)
local tRampage = self:getTalentFromId(self.T_RAMPAGE) local tRampage = self:getTalentFromId(self.T_RAMPAGE)
tRampage.cooldown = tRampage.cooldown - 25 tRampage.cooldown = tRampage.cooldown - 10
end, end,
on_unlearn = function(self, t) on_unlearn = function(self, t)
local tRampage = self:getTalentFromId(self.T_RAMPAGE) local tRampage = self:getTalentFromId(self.T_RAMPAGE)
tRampage.cooldown = tRampage.cooldown + 25 tRampage.cooldown = tRampage.cooldown + 10
end, end,
getCooldown = function(self, t) return 150 - math.floor(10 * self:getTalentLevelRaw(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, getSpeed = function(self, t) return 10 * self:getTalentLevel(t) end,
info = function(self, t) info = function(self, t)
local cooldown = t.getCooldown(self, t) local cooldown = t.getCooldown(self, t)
local speed = t.getSpeed(self, t) local speed = t.getSpeed(self, t)
......
...@@ -60,7 +60,7 @@ newTalent{ ...@@ -60,7 +60,7 @@ newTalent{
points = 5, points = 5,
random_ego = "attack", random_ego = "attack",
cooldown = 15, cooldown = 15,
hate = 0.1, hate = 0.2,
action = function(self, t) action = function(self, t)
local weapon = self:hasAxeWeapon() local weapon = self:hasAxeWeapon()
if not weapon then if not weapon then
...@@ -94,7 +94,7 @@ newTalent{ ...@@ -94,7 +94,7 @@ newTalent{
end, end,
info = function(self, t) info = function(self, t)
local multiplier = self:combatTalentWeaponDamage(t, 0.2, 0.7) local multiplier = self:combatTalentWeaponDamage(t, 0.2, 0.7)
return ([[Assault nearby foes with 4 fast attacks for %d%% to %d%% rage-based damage each.]]):format(multiplier * 50, multiplier * 100) return ([[Assault nearby foes with 4 fast attacks for %d%% to %d%% hate-based damage each.]]):format(multiplier * 50, multiplier * 100)
end, end,
} }
...@@ -105,7 +105,7 @@ newTalent{ ...@@ -105,7 +105,7 @@ newTalent{
points = 5, points = 5,
random_ego = "attack", random_ego = "attack",
cooldown = 20, cooldown = 20,
hate = 0.1, hate = 0.5,
range = 4, range = 4,
requires_target = true, requires_target = true,
action = function(self, t) action = function(self, t)
...@@ -198,7 +198,7 @@ newTalent{ ...@@ -198,7 +198,7 @@ newTalent{
else else
size = "Small" size = "Small"
end end
return ([[Charge through your opponents, attacking anyone near your path for %d%% to %d%% rage-based damage. %s opponents may be knocked from your path.]]):format(multiplier * 30, multiplier * 100, size) return ([[Charge through your opponents, attacking anyone near your path for %d%% to %d%% hate-based damage. %s opponents may be knocked from your path.]]):format(multiplier * 30, multiplier * 100, size)
end, end,
} }
......
...@@ -1546,7 +1546,7 @@ newEffect{ ...@@ -1546,7 +1546,7 @@ newEffect{
on_timeout = function(self, eff) on_timeout = function(self, eff)
self:project({type="ball", radius=eff.radius, friendlyfire=false}, self.x, self.y, function(xx, yy) self:project({type="ball", radius=eff.radius, friendlyfire=false}, self.x, self.y, function(xx, yy)
local target = game.level.map(xx, yy, game.level.map.ACTOR) local target = game.level.map(xx, yy, game.level.map.ACTOR)
if target and target ~= self and target ~= eff.source and target:canBe("knockback") then if target and target ~= self and target ~= eff.source and target:canBe("knockback") and (target.never_move or 0) ~= 1 then
-- attempt to move target away from self -- attempt to move target away from self
local currentDistance = core.fov.distance(self.x, self.y, xx, yy) local currentDistance = core.fov.distance(self.x, self.y, xx, yy)
local bestDistance, bestX, bestY local bestDistance, bestX, bestY
......
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