[1.5.3] is out of phase calculating correctly?

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

[1.5.3] is out of phase calculating correctly?

#1 Post by jenx »

I am playing temporal warden on madness, level 19 (https://te4.org/characters/2460/tome/11 ... 294c04f34d)

I have phase door rune at value 30% and resistance currently at 0%. I have gear that grants 35% out of phase bonus. I don't have Thread Walk (yet).

If I use teleport talent, I get def +35, resist all +35% and detrimental effects duration reduction of 35%.

If I use phase door rune, I get def +50, resist all +40%, and detrimental effects reduction of 60%.

The phase door rune values make no sense to me. And the code suggests that the three values should be the same, if I read it correctly:

Code: Select all

newInscription{
	name = "Rune: Phase Door",
	type = {"inscriptions/runes", 1},
	points = 1,
	is_spell = true,
	is_teleport = true,
	tactical = { ESCAPE = 2 },
	action = function(self, t)
		local data = self:getInscriptionData(t.short_name)
		game.level.map:particleEmitter(self.x, self.y, 1, "teleport")
		self:teleportRandom(self.x, self.y, data.range + data.inc_stat)
		game.level.map:particleEmitter(self.x, self.y, 1, "teleport")
		self:setEffect(self.EFF_OUT_OF_PHASE, data.dur or 3, {
			defense=(data.power or data.range) + data.inc_stat * 3 + (self:attr("defense_on_teleport") or 0),
			resists=(data.power or data.range) + data.inc_stat * 3 + (self:attr("resist_all_on_teleport") or 0),
			effect_reduction=(data.power or data.range) + data.inc_stat * 3 + (self:attr("effect_reduction_on_teleport") or 0),
		})
		return true
	end,
	info = function(self, t)
		local data = self:getInscriptionData(t.short_name)
		local power = (data.power or data.range) + data.inc_stat * 3
		return ([[Activate the rune to teleport randomly in a range of %d.
		Afterwards you stay out of phase for %d turns. In this state all new negative status effects duration is reduced by %d%%, your defense is increased by %d and all your resistances by %d%%.]]):
		format(data.range + data.inc_stat, data.dur or 3, power, power, power)
	end,
	short_info = function(self, t)
		local data = self:getInscriptionData(t.short_name)
		local power = (data.power or data.range) + data.inc_stat * 3
		return ([[range %d; power %d; dur %d]]):format(data.range + data.inc_stat, power, data.dur or 3)
	end,
}
Can anyone explain why I get 50, 40, 60? Is this a bug?
MADNESS rocks

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [1.5.3] is out of phase calculating correctly?

#2 Post by jenx »

Ok, I"m now level 21 and it is even more peculiar. I've taken Thread Walk and this gives 6 to defence and 4% to resist all.

I now have gear that provides 65% for def, resist all and effect CD reduction.

If I use teleport talent, I get +71 def (= 65 + 6 :-)), 69% resist all (= 65 + 4 :-)) and 65% reduction of CDs. All good.

If I use my phase door rune, now at 29% bonus, I get 50, 40, 60 still. So these look like hard-wired limits, but I can't figure out where they are stored, and why limit them like this?

Finally, and this really is a bug in my view: if I do phase door and then teleport, the phase door figures remain, they are not overridden by the (better) teleport figures. But if I do teleport and then phase door, they ARE overridden by the (worse) phase door figures. So phase door figures dominate in both situations. Wouldn't it be better to upgrade to the highest figures, either PD or talent?
MADNESS rocks

St_ranger_er
Thalore
Posts: 172
Joined: Fri Jul 18, 2014 11:48 am

Re: [1.5.3] is out of phase calculating correctly?

#3 Post by St_ranger_er »

in data/timed_effects/magical.lua

Code: Select all

newEffect{
	name = "OUT_OF_PHASE", image = "talents/phase_door.png",
	desc = "Out of Phase",
	long_desc = function(self, eff) return ("The target is out of phase with reality, increasing defense by %d, resist all by %d%%, and reducing the duration of detrimental timed effects by %d%%."):
	format(eff.defense or 0, eff.resists or 0, eff.effect_reduction or 0) end,
	type = "magical",
	subtype = { teleport=true },
	status = "beneficial",
	parameters = { power=10 },
	on_gain = function(self, err) return "#Target# is out of phase.", "+Phased" end,
	on_lose = function(self, err) return "#Target# is no longer out of phase.", "-Phased" end,
	activate = function(self, eff)
		eff.defid = self:addTemporaryValue("combat_def", eff.defense)
		eff.resid= self:addTemporaryValue("resists", {all=eff.resists})
		eff.durid = self:addTemporaryValue("reduce_detrimental_status_effects_time", eff.effect_reduction)
		eff.particle = self:addParticles(Particles.new("phantasm_shield", 1))
	end,
	on_merge = function(self, old_eff, new_eff)
		old_eff.defense = math.min(50, math.max(old_eff.defense, new_eff.defense)) or 0
		old_eff.resists = math.min(40, math.max(old_eff.resists, new_eff.resists)) or 0
		old_eff.effect_reduction = math.min(60, math.max(old_eff.effect_reduction, new_eff.effect_reduction)) or 0

		self:removeTemporaryValue("combat_def", old_eff.defid)
		self:removeTemporaryValue("resists", old_eff.resid)
		self:removeTemporaryValue("reduce_detrimental_status_effects_time", old_eff.durid)

		old_eff.defid = self:addTemporaryValue("combat_def", old_eff.defense)
		old_eff.resid= self:addTemporaryValue("resists", {all=old_eff.resists})
		old_eff.durid = self:addTemporaryValue("reduce_detrimental_status_effects_time", old_eff.effect_reduction)
		old_eff.dur = math.max(old_eff.dur, new_eff.dur)
		return old_eff
	end,
	deactivate = function(self, eff)
		self:removeTemporaryValue("combat_def", eff.defid)
		self:removeTemporaryValue("resists", eff.resid)
		self:removeTemporaryValue("reduce_detrimental_status_effects_time", eff.durid)
		self:removeParticles(eff.particle)
	end,
}
so, yeah those values (50/40/60) hardcoded in on_merge function

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [1.5.3] is out of phase calculating correctly?

#4 Post by jenx »

hmm, yet another oddity and inconsistency.

the talents Dimensional Step and Worm Hole and Thread Walk provide the higher values (now over 70% from EQ) but the talent Blink Blade uses the Phase Door numbers and so is capped at the 50/40/60 limits.

Surely Blink Blade should function for Out of Phase like Dim Step and Wormhole and Thread Walk?
MADNESS rocks

St_ranger_er
Thalore
Posts: 172
Joined: Fri Jul 18, 2014 11:48 am

Re: [1.5.3] is out of phase calculating correctly?

#5 Post by St_ranger_er »

Surely Blink Blade should function for Out of Phase like Dim Step and Wormhole and Thread Walk?
As i can see
Teleport to the target and attack with your melee weapons for 70%, 83%, 92%, 101%, 108% damage. Then teleport next to a second random enemy, attacking for 70%, 83%, 92%, 101%, 108% damage.

Blink Blade can hit the same target multiple times.
therefore it applied out_of_phase multiple times(after each teleport), and on second apply, it run as on_merge instead activate, and capped at 50/40/60. But it's my assumption, i doesn't check the code itself.

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: [1.5.3] is out of phase calculating correctly?

#6 Post by jenx »

St_ranger_er wrote:
Surely Blink Blade should function for Out of Phase like Dim Step and Wormhole and Thread Walk?
As i can see
Teleport to the target and attack with your melee weapons for 70%, 83%, 92%, 101%, 108% damage. Then teleport next to a second random enemy, attacking for 70%, 83%, 92%, 101%, 108% damage.

Blink Blade can hit the same target multiple times.
therefore it applied out_of_phase multiple times(after each teleport), and on second apply, it run as on_merge instead activate, and capped at 50/40/60. But it's my assumption, i doesn't check the code itself.
Ok, I see what you mean. So when on_merge runs, it should first check to see if the previous value was higher.

Darkgod - can this be fixed please?
MADNESS rocks

Post Reply