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

Fix Beckoned

git-svn-id: http://svn.net-core.org/repos/t-engine4@4678 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2fa0e9d3
No related branches found
No related tags found
No related merge requests found
......@@ -962,7 +962,7 @@ newDamageType{
local realdam = DamageType:get(DamageType.NATURE).projector(src, x, y, DamageType.NATURE, dam / 6)
local target = game.level.map(x, y, Map.ACTOR)
if target and target:canBe("poison") then
target:setEffect(target.EFF_POISONED, 5, {src=src, power=dam / 6, apply_power=src:combatAttack()})
target:setEffect(target.EFF_POISONED, 5, {src=src, power=dam / 6, apply_power=src.combatAttack and src:combatAttack() or 0})
end
return realdam
end,
......
......@@ -43,8 +43,8 @@ local strandIndex = 1
return { generator = function()
local size = 4
local colorChoice = rng.percent(50)
local strand = strands[strandIndex]
local strand = strands[strandIndex+1]
strandIndex = (strandIndex + 1) % strandCount
return {
......@@ -67,4 +67,4 @@ function(self)
end
nb = nb + 1
end,
strandCount * 30
\ No newline at end of file
strandCount * 30
......@@ -56,19 +56,19 @@ newTalent{
game.logPlayer(self, "You are having trouble focusing on your prey!")
return false
end
local duration = t.getDuration(self, t)
self:setEffect(self.EFF_STALKER, duration, { target=target, bonus = 1 })
target:setEffect(self.EFF_STALKED, duration, { source=self })
game.level.map:particleEmitter(target.x, target.y, 1, "stalked_start")
return true
end,
on_targetDied = function(self, t, target)
self:removeEffect(self.EFF_STALKER)
target:removeEffect(self.EFF_STALKED)
-- prevent stalk targeting this turn
local stalk = self:isTalentActive(self.T_STALK)
if stalk then
......@@ -118,13 +118,13 @@ newTalent{
local x, y, target = self:getTarget(tg)
if not x or not y or not target then return nil end
if core.fov.distance(self.x, self.y, x, y) > range then return nil end
local duration = t.getDuration(self, t)
local chance = t.getChance(self, t)
local spellpowerChange = t.getSpellpowerChange(self, t)
local mindpowerChange = t.getMindpowerChange(self, t)
target:setEffect(target.EFF_BECKONED, duration, { source=self, range=range, chance=chance, spellpowerChange=spellpowerChange, mindpowerChange=mindpowerChange })
return true
end,
info = function(self, t)
......@@ -170,9 +170,9 @@ newTalent{
local effStalker = self:hasEffect(self.EFF_STALKER)
local target = effStalker.target
if not target or target.dead then return nil end
target:setEffect(target.EFF_HARASSED, duration, { source=self, damageChange=targetDamageChange })
for i = 1, 2 do
if not target.dead and self:attackTarget(target, nil, damageMultipler, true) then
-- remove effects
......@@ -181,14 +181,14 @@ newTalent{
local t = target:getTalentFromId(tid)
if not target.talents_cd[tid] and t.mode == "activated" and not t.innate then tids[#tids+1] = t end
end
local t = rng.tableRemove(tids)
if not t then break end
target.talents_cd[t.id] = rng.range(3, 5)
game.logSeen(target, "%s's %s is disrupted!", target.name:capitalize(), t.name)
end
end
return true
end,
info = function(self, t)
......@@ -229,14 +229,14 @@ newTalent{
local tCleave = self:getTalentFromId(self.T_CLEAVE)
self.talents_cd[self.T_CLEAVE] = tCleave.cooldown
end
if self:isTalentActive(self.T_REPEL) then
self:useTalent(self.T_REPEL)
elseif self:knowTalent(self.T_REPEL) then
local tRepel = self:getTalentFromId(self.T_REPEL)
self.talents_cd[self.T_REPEL] = tRepel.cooldown
end
local movementSpeedChange = t.getMovementSpeedChange(self, t)
return {
moveId = self:addTemporaryValue("movement_speed", movementSpeedChange),
......@@ -246,7 +246,7 @@ newTalent{
deactivate = function(self, t, p)
if p.moveId then self:removeTemporaryValue("movement_speed", p.moveId) end
if p.luckId then self:removeTemporaryValue("inc_stats", p.luckId) end
return true
end,
info = function(self, t)
......
......@@ -423,21 +423,6 @@ newEffect{
local source = eff.source
local moveX, moveY = source.x, source.y -- move in general direction by default
if not self:hasLOS(source.x, source.y) then
-- move using dmap if available
--local c = source:distanceMap(self.x, self.y)
--if c then
-- local dir = 5
-- for i = 1, 9 do
-- local sx, sy = util.coordAddDir(self.x, self.y, i)
-- local cd = source:distanceMap(sx, sy)
-- if cd and cd > c and self:canMove(sx, sy) then c = cd; dir = i end
-- end
-- if i ~= 5 then
-- moveX, moveY = util.coordAddDir(self.x, self.y, dir)
-- end
--end
-- move a-star (far more useful than dmap)
local a = Astar.new(game.level.map, self)
local path = a:calc(self.x, self.y, source.x, source.y)
if path then
......@@ -448,7 +433,10 @@ newEffect{
if moveX and moveY then
local old_move_others, old_x, old_y = self.move_others, self.x, self.y
self.move_others = true
self:moveDirection(moveX, moveY, true)
local old = rawget(self, "aiCanPass")
self.aiCanPass = mod.class.NPC.aiCanPass
mod.class.NPC.moveDirection(self, moveX, moveY, true)
self.aiCanPass = old
self.move_others = old_move_others
if old_x ~= self.x or old_y ~= self.y then
if not self.did_energy then
......
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