[b30] Rush vs. Invisibility
Moderator: Moderator
[b30] Rush vs. Invisibility
Enemies that use rush on the player while the player is invisible (or, presumably stealthed, using Pity, or the enemy is blinded) allows the enemy to attack the player even if the enemy travels to the wrong tile.
Re: [b30] Rush vs. Invisibility
Bump, still present in b34. With high level Pity, Atamathon rushed at a tree next to my Doomed, and hit me for 124 damage despite the fact that he didn't get near to me.
Re: [b30] Rush vs. Invisibility
Mayhaps this was Pound, which affects actors within a radius of 2lukep wrote:Atamathon rushed at a tree next to my Doomed, and hit me for 124 damage despite the fact that he didn't get near to me
Re: [b30] Rush vs. Invisibility
First example (b30) was in the Ambush, so it was rush. Atamathon said he "rushes out" if I remember right, so I don't think so. Also, I think that he missed by more than 2.
Re: [b30] Rush vs. Invisibility
Correct me if I'm wrong, but should he have even been able to rush to begin with when his 'target' is in another destination?
Re: [b30] Rush vs. Invisibility
The AI cheats?Rectifier wrote:Correct me if I'm wrong, but should he have even been able to rush to begin with when his 'target' is in another destination?
Re: [b30] Rush vs. Invisibility
Bwahaha!! What a funny bug. Good catch, lukep, the AI does cheat in regard to this... but it's not intentional. Most talents get the x, y position via a call to "getTarget(tg)", including Rush:If the player is the target and is invisible, then x and y may not be the x and y of the target, so the adjacency testuses the wrong x, y. It should use target.x, target.y, asOther talents will need to be fixed as well.
Code: Select all
local x, y, target = self:getTarget(tg)
Code: Select all
if core.fov.distance(self.x, self.y, x, y) == 1 then
Code: Select all
if core.fov.distance(self.x, self.y, target.x, target.y) == 1 then
Re: [b30] Rush vs. Invisibility
Probably the best way to fix this is to make sure the target is at coordinates tx, ty as returned by "local tx, ty, target = self:getTarget(tg)". Otherwise, 50-100 talents would need updated to work properly in the case that tx != target.x and ty != target.y. So, the following completely untested change should do the trick (the target returned for AI isn't the player; it's the actor at tx, ty):
Code: Select all
Index: game/engines/default/engine/interface/ActorAI.lua
===================================================================
--- game/engines/default/engine/interface/ActorAI.lua (revision 4496)
+++ game/engines/default/engine/interface/ActorAI.lua (working copy)
@@ -138,7 +138,8 @@
--- Returns the current target
function _M:getTarget(typ)
local tx, ty = self:aiSeeTargetPos(self.ai_target.actor)
- return tx, ty, self.ai_target.actor
+ local target = game.level.map(tx, ty, Map.ACTOR)
+ return tx, ty, target
end
--- Sets the current target