[b30] Rush vs. Invisibility

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

[b30] Rush vs. Invisibility

#1 Post by lukep »

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.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: [b30] Rush vs. Invisibility

#2 Post by lukep »

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.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: [b30] Rush vs. Invisibility

#3 Post by tiger_eye »

lukep 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
Mayhaps this was Pound, which affects actors within a radius of 2

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: [b30] Rush vs. Invisibility

#4 Post by lukep »

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.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

Rectifier
Archmage
Posts: 386
Joined: Mon Aug 29, 2011 8:06 am

Re: [b30] Rush vs. Invisibility

#5 Post by Rectifier »

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?

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: [b30] Rush vs. Invisibility

#6 Post by lukep »

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?
The AI cheats?
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: [b30] Rush vs. Invisibility

#7 Post by tiger_eye »

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:

Code: Select all

local x, y, target = self:getTarget(tg)
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 test

Code: Select all

if core.fov.distance(self.x, self.y, x, y) == 1 then
uses the wrong x, y. It should use target.x, target.y, as

Code: Select all

if core.fov.distance(self.x, self.y, target.x, target.y) == 1 then
Other talents will need to be fixed as well.

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: [b30] Rush vs. Invisibility

#8 Post by tiger_eye »

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

Post Reply