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

Fixed blindness on NPCs

Siding with the Assassin Lord also teaches you the Flash Bang Trap, if you know trapping


git-svn-id: http://svn.net-core.org/repos/t-engine4@6603 51575b47-30f0-44d4-a5cc-537603b46e54
parent ebea8f21
No related branches found
No related tags found
No related merge requests found
......@@ -482,5 +482,5 @@ function _M:aiSeeTargetPos(target)
if self.rank > 3 and target.canMove and not target:canMove(self.x, self.y, true) then
return util.bound(tx, 0, game.level.map.w - 1), util.bound(ty, 0, game.level.map.h - 1)
end
return ActorAI.aiSeeTargetPos(target)
return ActorAI.aiSeeTargetPos(self, target)
end
......@@ -30,6 +30,12 @@ local function evil(npc, player)
p:setTalentTypeMastery("cunning/poisons", 1.3)
end
end
if p:knowTalent(p.T_TRAP_MASTERY) then
p:learnTalent(p.T_FLASH_BANG_TRAP, 1, nil, {no_unlearn=true})
game.log("#LIGHT_GREEN#Before you leave the Lord teaches you how to create flash bang traps!")
end
game:changeLevel(1, "wilderness")
game.log("As you depart the assassin lord says: 'And do not forget, I own you now.'")
end
......
......@@ -437,7 +437,7 @@ newTalent{
end,
info = function(self, t)
return ([[Lay a tricky trap that maims the arms of creatures passing by with acid doing %0.2f damage and disarming them for %d turns.]]):
format(damDesc(self, DamageType.ACID, 30 + self:getCun() * self:getTalentLevel(self.T_TRAP_MASTERY)), 2 + math.ceil(self:getTalentLevel(self.T_TRAP_MASTERY) / 2))
format(damDesc(self, DamageType.ACID, 60 + self:getCun() * 0.9 * self:getTalentLevel(self.T_TRAP_MASTERY)), 2 + math.ceil(self:getTalentLevel(self.T_TRAP_MASTERY) / 2))
end,
}
......@@ -519,6 +519,7 @@ newTalent{
triggered = function(self, x, y, who)
self:project({type="ball", x=x,y=y, radius=2}, x, y, function(px, py)
local who = game.level.map(px, py, engine.Map.ACTOR)
if who == self.summoner then return end
if who and who:canBe("blind") then
who:setEffect(who.EFF_BLINDED, self.dur, {apply_power=self.check_hit})
elseif who and who:canBe("stun") then
......
......@@ -90,6 +90,13 @@ function _M:use(item)
else
game.player:useTalent(d.talent.id)
end
elseif act == "debug-inspect" then
local DebugConsole = require"engine.DebugConsole"
local d = DebugConsole.new()
game:registerDialog(d)
DebugConsole.line = "=__uids["..item.actor.uid.."]"
DebugConsole.line_pos = #DebugConsole.line
d.changed = true
end
end
......@@ -120,6 +127,7 @@ function _M:generateList()
if a and not self.on_player and game.party:canControl(a, false) then list[#list+1] = {name="Control", action="control", color=colors.simple(colors.TEAL), actor=a} end
if a and not self.on_player and game.party:canOrder(a, false) then list[#list+1] = {name="Give order", action="order", color=colors.simple(colors.TEAL), actor=a} end
if a and not self.on_player and config.settings.cheat then list[#list+1] = {name="Target player", action="target-player", color=colors.simple(colors.RED), actor=a} end
if a and config.settings.cheat then list[#list+1] = {name="Lua inspect", action="debug-inspect", color=colors.simple(colors.LIGHT_BLUE), actor=a} end
if self.on_player then list[#list+1] = {name="Rest a while", action="rest", color=colors.simple(colors.ANTIQUE_WHITE)} end
if self.on_player then list[#list+1] = {name="Auto-explore", action="autoexplore", color=colors.simple(colors.ANTIQUE_WHITE)} end
if self.on_player then list[#list+1] = {name="Inventory", action="inventory", color=colors.simple(colors.ANTIQUE_WHITE)} 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