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

Cursed fixes

git-svn-id: http://svn.net-core.org/repos/t-engine4@1385 51575b47-30f0-44d4-a5cc-537603b46e54
parent d32c671f
No related branches found
No related tags found
No related merge requests found
......@@ -660,6 +660,48 @@ function _M:onTakeHit(value, src)
game.logSeen(self, "%s is split in two!", self.name:capitalize())
end
end
-- Adds hate
if self:knowTalent(self.T_HATE_POOL) then
local hateGain = 0
local hateMessage
if value / self.max_life >= 0.15 then
-- you take a big hit..adds 0.2 + 0.2 for each 5% over 15%
hateGain = hateGain + 0.2 + (((value / self.max_life) - 0.15) * 10 * 0.5)
hateMessage = "#F53CBE#You fight through the pain!"
end
if value / self.max_life >= 0.05 and (self.life - value) / self.max_life < 0.25 then
-- you take a hit with low health
hateGain = hateGain + 0.4
hateMessage = "#F53CBE#Your rage grows even as your life fades!"
end
if hateGain >= 0.1 then
self.hate = math.min(self.max_hate, self.hate + hateGain)
if hateMessage then
game.logSeen(self, hateMessage.." (+%0.1f hate)", hateGain)
end
end
end
if src and src.knowTalent and src:knowTalent(src.T_HATE_POOL) then
local hateGain = 0
local hateMessage
if value / src.max_life > 0.33 then
-- you deliver a big hit
hateGain = hateGain + 0.4
hateMessage = "#F53CBE#Your powerful attack feeds your madness!"
end
if hateGain >= 0.1 then
src.hate = math.min(src.max_hate, src.hate + hateGain)
if hateMessage then
game.logSeen(src, hateMessage.." (+%0.1f hate)", hateGain)
end
end
end
-- Bloodlust!
if src and src.knowTalent and src:knowTalent(src.T_BLOODLUST) then
......@@ -721,6 +763,39 @@ function _M:die(src)
src.blood_frenzy = src.blood_frenzy + src:getTalentLevel(src.T_BLOOD_FRENZY) * 2
end
-- Adds hate
if src and src:knowTalent(self.T_HATE_POOL) then
local hateGain = src.hate_per_kill
local hateMessage
if self.level - 2 > src.level then
-- level bonus
hateGain = hateGain + (self.level - 2 - src.level) * 0.2
hateMessage = "#F53CBE#You have taken the life of an experienced foe!"
end
if self.rank == 3 then
-- elite bonus
hateGain = hateGain * 2
hateMessage = "#F53CBE#An elite foe has fallen to your hate!"
elseif self.rank >= 4 then
-- boss bonus
hateGain = hateGain * 4
hateMessage = "#F53CBE#Your hate has conquered a great adversary!"
end
hateGain = math.min(hateGain, 10)
src.hate = math.min(src.max_hate, src.hate + hateGain)
if hateMessage then
game.logSeen(src, hateMessage.." (+%0.1f hate)", hateGain - src.hate_per_kill)
end
end
if src and src.knowTalent and src:knowTalent(src.T_UNNATURAL_BODY) then
local t = src:getTalentFromId(src.T_UNNATURAL_BODY)
t.on_kill(src, t, self)
end
if src and src.knowTalent and src:knowTalent(src.T_CRUEL_VIGOR) then
local t = src:getTalentFromId(src.T_CRUEL_VIGOR)
t.on_kill(src, t)
......@@ -736,11 +811,6 @@ function _M:die(src)
p.kills = p.kills + 1
end
-- Adds hate
if src and src.max_hate and src.max_hate > 0 then
src.hate = math.min(src.max_hate, src.hate + src.hate_per_kill)
end
-- Increase vim
if src and src.attr and src:attr("vim_on_death") and not self:attr("undead") then src:incVim(src:attr("vim_on_death")) end
......
......@@ -18,7 +18,7 @@
-- darkgod@te4.org
local function getHateMultiplier(self, min, max)
return (min + ((max - min) * self.hate / 10))
return (min + ((max - min) * math.min(self.hate, 10) / 10))
end
newTalent{
......@@ -37,7 +37,7 @@ newTalent{
return math.sqrt(self:getTalentLevel(t)) * 10
end,
getRegenRate = function(self, t)
return math.sqrt(self:getTalentLevel(t) * 2) * self.max_life * 0.004
return math.sqrt(self:getTalentLevel(t) * 2) * self.max_life * 0.008
end,
do_regenLife = function(self, t)
-- heal
......
......@@ -18,7 +18,7 @@
-- darkgod@te4.org
local function getHateMultiplier(self, min, max)
return (min + ((max - min) * self.hate / 10))
return (min + ((max - min) * math.min(self.hate, 10) / 10))
end
newTalent{
......
......@@ -18,7 +18,7 @@
-- darkgod@te4.org
local function getHateMultiplier(self, min, max)
return (min + ((max - min) * self.hate / 10))
return (min + ((max - min) * math.min(self.hate, 10) / 10))
end
local function checkWillFailure(self, target, minChance, maxChance, attackStrength)
......
......@@ -18,7 +18,7 @@
-- darkgod@te4.org
local function getHateMultiplier(self, min, max)
return (min + ((max - min) * self.hate / 10))
return (min + ((max - min) * math.min(self.hate, 10) / 10))
end
local function getWillDamage(self, t, base, max)
......@@ -154,7 +154,8 @@ newTalent{
local attackStrength = 0.3 + self:getTalentLevel(tTorment) * 0.12
if checkWillFailure(self, target, 30, 95, attackStrength) then
local tg = {type="hit", friendlyfire=false, talent=tTorment}
local grids = self:project(tg, target.x, target.y, DamageType.BLIGHT, 30 + self:getWil() * 0.4 * self:getTalentLevel(tTorment), {type="slime"})
local damage = (30 + self:getWil() * 0.4 * self:getTalentLevel(tTorment)) * getHateMultiplier(self, 0.5, 1.5)
local grids = self:project(tg, target.x, target.y, DamageType.DARKNESS, damage, {type="slime"})
--game:playSoundNear(self, "talents/spell_generic")
doTorment = false
else
......@@ -215,10 +216,10 @@ newTalent{
require = cursed_wil_req3,
points = 5,
info = function(self, t)
local baseDamage = damDesc(self, DamageType.BLIGHT, 30 + self:getWil() * 0.4 * self:getTalentLevel(t))
local baseDamage = 30 + self:getWil() * 0.4 * self:getTalentLevel(t)
local attackStrength = 0.3 + self:getTalentLevel(t) * 0.12
local effectiveness = getWillFailureEffectiveness(self, 30, 95, attackStrength)
return ([[Your rage builds within you for 20 turns, then unleashes itself for %d to %d hate-based blight damage on the first one to enter your gloom. (%d effectiveness)]]):format(baseDamage * .5, baseDamage * 1.5, effectiveness)
return ([[Your rage builds within you for 20 turns, then unleashes itself for %d to %d hate-based darkness damage on the first one to enter your gloom. (%d effectiveness)]]):format(baseDamage * .5, baseDamage * 1.5, effectiveness)
end,
}
......
......@@ -18,7 +18,7 @@
-- darkgod@te4.org
local function getHateMultiplier(self, min, max)
return (min + ((max - min) * self.hate / 10))
return (min + ((max - min) * math.min(self.hate, 10) / 10))
end
newTalent{
......
......@@ -18,7 +18,7 @@
-- darkgod@te4.org
local function getHateMultiplier(self, min, max)
return (min + ((max - min) * self.hate / 10))
return (min + ((max - min) * math.min(self.hate, 10) / 10))
end
newTalent{
......@@ -123,7 +123,7 @@ newTalent{
local lineFunction = line.new(self.x, self.y, targetX, targetY)
local nextX, nextY = lineFunction()
local currentX, currentY = self.x, self.y
local blocked = false
while nextX and nextY do
local blockingTarget = game.level.map(nextX, nextY, Map.ACTOR)
if blockingTarget and self:reactionToward(blockingTarget) < 0 then
......@@ -135,7 +135,8 @@ newTalent{
elseif level >= 3 then
maxSize = 3
end
local blocked = true
if blockingTarget.size_category <= maxSize then
if blockingTarget:checkHit(self:combatAttackStr(), blockingTarget:combatPhysicalResist(), 0, 95, 15) and blockingTarget:canBe("knockback") then
-- determine where to move the target (any adjacent square that isn't next to the attacker)
......@@ -147,11 +148,17 @@ newTalent{
and game.level.map:isBound(x, y)
and not game.level.map:checkAllEntities(x, y, "block_move", self) then
blockingTarget:move(x, y, true)
game.logSeen(self, "%s knocks back %s!", self.name:capitalize(), blockingTarget.name)
blocked = false
break
end
end
end
end
if blocked then
game.logSeen(self, "%s blocks %s!", blockingTarget.name:capitalize(), self.name)
end
end
-- check that we can move
......
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