Page 1 of 1

Ambuscade bug fixes

Posted: Thu Jun 20, 2013 4:37 pm
by Hachem_Muche
Two bug fixes:
1. If you are stealthed and then cast Ambuscade, your shadow's stealth value is reduced by your stealth value. Fixed by moving the stealth calculation after removing the stealth talent.

2. If you cast Arcane Eye with the shadow. The icon stays on the map after you switch back to the main character. Fixed by explicitly removing the effect from the shadow when it dies or is uncontrolled. (Would be more general to remove all effects, but there is no silent option for Actor:removeAllEffects and so could be very spammy.)

Code: Select all

 game/modules/tome/data/talents/cunning/ambush.lua | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/game/modules/tome/data/talents/cunning/ambush.lua b/game/modules/tome/data/talents/cunning/ambush.lua
index 5145096..b2c5d05 100644
--- a/game/modules/tome/data/talents/cunning/ambush.lua
+++ b/game/modules/tome/data/talents/cunning/ambush.lua
@@ -142,7 +142,7 @@ newTalent{
 		m.life = util.bound(m.life, 0, m.max_life)
 		m.forceLevelup = function() end
 		m.die = nil
-		m.on_die = nil
+		m.on_die = function(self) self:removeEffect(self.EFF_ARCANE_EYE,true) end
 		m.on_acquire_target = nil
 		m.seen_by = nil
 		m.puuid = nil
@@ -152,12 +152,12 @@ newTalent{
 		m.exp_worth = 0
 		m.no_inventory_access = true
 		m.cant_teleport = true
-		m.stealth = t.getStealthPower(self, t)
 		m:unlearnTalent(m.T_AMBUSCADE,m:getTalentLevelRaw(m.T_AMBUSCADE))
 		m:unlearnTalent(m.T_PROJECTION,m:getTalentLevelRaw(m.T_PROJECTION)) -- no recurssive projections
 		m:unlearnTalent(m.T_STEALTH,m:getTalentLevelRaw(m.T_STEALTH))
 		m:unlearnTalent(m.T_HIDE_IN_PLAIN_SIGHT,m:getTalentLevelRaw(m.T_HIDE_IN_PLAIN_SIGHT))
 
+		m.stealth = t.getStealthPower(self, t)
 		self:removeEffect(self.EFF_SHADOW_VEIL) -- Remove shadow veil from creator
 		m.remove_from_party_on_death = true
 		m.resists[DamageType.LIGHT] = -100
@@ -182,7 +182,11 @@ newTalent{
 				end,
 				on_uncontrol = function(self)
 					self.summoner.ai = self.summoner.ambuscade_ai
-					game:onTickEnd(function() game.party:removeMember(self) self:disappear() end)
+					game:onTickEnd(function()
+							game.party:removeMember(self)
+							self:removeEffect(self.EFF_ARCANE_EYE, true)
+							self:disappear()
+						end)
 				end,
 			})
 		end