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

Fixed description of Tormented effect

Fixed description of Panicked effect
Fixed moving the player in panicked effect
Added support for fear resistance to Fears/Panic
Reduced damage of Slaughter/Reckless Charge


git-svn-id: http://svn.net-core.org/repos/t-engine4@4827 51575b47-30f0-44d4-a5cc-537603b46e54
parent 20b750ba
No related branches found
No related tags found
No related merge requests found
......@@ -232,8 +232,12 @@ newTalent{
function(px, py)
local actor = game.level.map(px, py, engine.Map.ACTOR)
if actor and self:reactionToward(actor) < 0 and actor ~= self then
if actor:checkHit(self:combatMindpower(), actor:combatMentalResist(), 0, 95) then
if not actor:canBe("fear") then
game.logSeen(actor, "#F53CBE#%s ignores the panic!", actor.name:capitalize())
elseif actor:checkHit(self:combatMindpower(), actor:combatMentalResist(), 0, 95) then
actor:setEffect(actor.EFF_PANICKED, duration, {source=self,range=10,chance=chance})
else
game.logSeen(actor, "#F53CBE#%s resists the panic!", actor.name:capitalize())
end
end
end,
......
......@@ -133,13 +133,14 @@ newTalent{
require = cursed_str_req3,
points = 5,
random_ego = "attack",
cooldown = 20,
hate = 8,
cooldown = 15,
hate = 5,
range = function(self, t) return 3 + self:getTalentLevelRaw(t) end,
tactical = { CLOSEIN = 2 },
requires_target = true,
getDamageMultiplier = function(self, t, hate)
return self:combatTalentIntervalDamage(t, "str", 0.8, 1.7, 0.4) * getHateMultiplier(self, 0.5, 1, false, hate)
return 0.7 * getHateMultiplier(self, 0.5, 1, false, hate)
--return self:combatTalentIntervalDamage(t, "str", 0.8, 1.7, 0.4) * getHateMultiplier(self, 0.5, 1, false, hate)
end,
getMaxAttackCount = function(self, t)
return 1 + self:getTalentLevelRaw(t)
......
......@@ -1041,7 +1041,7 @@ newEffect{
newEffect{
name = "TORMENTED", image = "effects/tormented.png",
desc = "Tormented",
long_desc = function(self, eff) return ("The target's mind is being tormented, causing %d apparitions to manifest and attack the target, inflicting %d mind damage each before disappearing."):format(eff.tormentorCount, eff.tormentorDamage) end,
long_desc = function(self, eff) return ("The target's mind is being tormented, causing %d apparitions to manifest and attack the target, inflicting %d mind damage each before disappearing."):format(eff.count, eff.damage) end,
type = "mental",
subtype = { fear=true },
status = "detrimental",
......@@ -1124,9 +1124,9 @@ newEffect{
}
newEffect{
name = "PANICKED", image = "talents/panicked.png",
name = "PANICKED", image = "talents/panic.png",
desc = "Panicked",
long_desc = function(self, eff) return ("The target has been panicked by %s, causing them to have a %d%% chance of fleeing in terror instead of acting."):format(eff.chance) end,
long_desc = function(self, eff) return ("The target has been panicked by %s, causing them to have a %d%% chance of fleeing in terror instead of acting."):format(eff.source.name, eff.chance) end,
type = "mental",
subtype = { fear=true },
status = "detrimental",
......@@ -1141,26 +1141,40 @@ newEffect{
end,
do_act = function(self, eff)
if not self:enoughEnergy() then return nil end
if eff.source.dead then return nil end
if eff.source.dead then return true end
local distance = core.fov.distance(self.x, self.y, eff.source.x, eff.source.y)
if distance <= eff.range then
-- in range
if not self:attr("never_move") and rng.percent(eff.chance) then
local source = eff.source
local moveX, moveY = self.x + self.x - source.x, self.y + self.y - source.y
if not self:moveDirection(moveX, moveY, true) then
if old_x ~= self.x or old_y ~= self.y then
if not self.did_energy then
self:useEnergy()
local sourceX, sourceY = eff.source.x, eff.source.y
local bestX, bestY
local bestDistance = 0
local start = rng.range(0, 8)
for i = start, start + 8 do
local x = self.x + (i % 3) - 1
local y = self.y + math.floor((i % 9) / 3) - 1
if x ~= self.x or y ~= self.y then
local distance = core.fov.distance(x, y, sourceX, sourceY)
if distance > bestDistance
and game.level.map:isBound(x, y)
and not game.level.map:checkAllEntities(x, y, "block_move", self)
and not game.level.map(x, y, Map.ACTOR) then
bestDistance = distance
bestX = x
bestY = y
end
end
end
if bestX then
self:move(bestX, bestY, false)
game.logPlayer(self, "#F53CBE#You panic and flee from %s.", eff.source.name)
else
game.logSeen(self, "#F53CBE#%s panics and tries to move away from %s.", self.name:capitalize(), eff.source.name)
if not self.did_energy then
self:useEnergy()
end
game.logSeen(self, "#F53CBE#%s panics and tries to flee from %s.", self.name:capitalize(), eff.source.name)
self:useEnergy(game.energy_to_act * self:combatMovementSpeed(bestX, bestY))
end
end
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