[svn] Earth's Eye and Meditation esp

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
aardvark
Wyrmic
Posts: 200
Joined: Wed Aug 22, 2012 12:16 am

[svn] Earth's Eye and Meditation esp

#1 Post by aardvark »

Mediation is supposed to let you see enemies in a small radius when Earth's Eyes is known. However, the radius is much larger than it's supposed to be. The problem seems to come from line 143 of Actor.lua (from _M:init()):

Code: Select all

	t.esp_range = t.esp_range or 10
A quick check on the Lua console shows esp_range to be 13 when it's supposed to be 3. Because the default range is 10, Meditation's esp_range is added to that. Changing the default range to 0 would break several artifacts which grant esp, though. I'm not sure what a good solution would be since there are several kinds of esp, but they all seem to share the one common range variable.

Edit: Perhaps instead of setting the esp.type to 1 to enable it and checking a separate range variable, the esp.type could be set to its effective range. The variable esp_range could be done away with altogether. Of course, artifacts and egos would all have to be properly fixed to work with the new method.

aardvark
Wyrmic
Posts: 200
Joined: Wed Aug 22, 2012 12:16 am

Re: [svn] Earth's Eye and Meditation esp

#2 Post by aardvark »

I wrote a fix for the bug. It's a bit ugly, but it does work. Description typo fix included for free.

Code: Select all

diff -ruX ../../../diffx.txt /games/t-engine4-windows-1.0.0svn/game/modules/tome/class/Player.lua ./class/Player.lua
--- /games/t-engine4-windows-1.0.0svn/game/modules/tome/class/Player.lua	2012-09-18 14:24:18.359375000 -0700
+++ ./class/Player.lua	2012-09-18 21:08:26.500000000 -0700
@@ -360,6 +360,14 @@
 		self:computeFOV(self.esp_range or 10, "block_esp", function(x, y) game.level.map:applyESP(x, y, 0.6) end, true, true, true)
 	end
 
+	-- Compute Meditation w/Earth's Eyes ESP FOV separately, using cache
+	if (self.esp_eyes_range and self.esp_eyes_range > 0) then
+		local esp_all = self.esp_all
+		self.esp_all = 1
+		self:computeFOV(self.esp_eyes_range, "block_esp", function(x, y) game.level.map:applyESP(x, y, 0.6) end, true, true, true)
+		self.esp_all = esp_all
+	end
+
 	-- Handle Sense spell, a simple FOV, using cache. Note that this means some terrain features can be made to block sensing
 	if self:attr("detect_range") then
 		self:computeFOV(self:attr("detect_range"), "block_sense", function(x, y)
diff -ruX ../../../diffx.txt /games/t-engine4-windows-1.0.0svn/game/modules/tome/data/talents/gifts/call.lua ./data/talents/gifts/call.lua
--- /games/t-engine4-windows-1.0.0svn/game/modules/tome/data/talents/gifts/call.lua	2012-09-18 15:14:46.968750000 -0700
+++ ./data/talents/gifts/call.lua	2012-09-18 21:08:28.406250000 -0700
@@ -43,8 +43,7 @@
 		
 		if self:knowTalent(self.T_EARTH_S_EYES) then
 			local te = self:getTalentFromId(self.T_EARTH_S_EYES)
-			self:talentTemporaryValue(ret, "esp_all", 1)
-			self:talentTemporaryValue(ret, "esp_range", te.radius_esp(self, te))
+			self:talentTemporaryValue(ret, "esp_eyes_range", te.radius_esp(self, te))
 		end
 
 		game:playSoundNear(self, "talents/heal")
@@ -124,7 +123,7 @@
 		local radius = self:getTalentRadius(t)
 		local radius_esp = t.radius_esp(self, t)
 		return ([[Using your connection to Nature you can see your surrounding area in a radius of %d.
-		Also while meditating you are able to detect the presence of creatures around your in a radius %d.]]):
+		Also while meditating you are able to detect the presence of creatures around you in a radius %d.]]):
 		format(radius, radius_esp)
 	end,
 }
Unless the very high range is intended behavior...
Attachments
gifts-patch.txt
Meditation + Earth's Eyes patch
(2.17 KiB) Downloaded 192 times

Post Reply