[1.1.5] Doomed: Unseen Force still broken

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

[1.1.5] Doomed: Unseen Force still broken

#1 Post by jotwebe »

Force of Will/Unseen Force still has negative values at talent levels below 4, at least for me.

(See also my report for 1.0.6d:)

Since Hachem_Muche couldn't replicate it, it's probably something OS specific. From looking at the lua, it's getSecondHitChance that's returning negative values.

Cursed/Force of will lines 311-319

Code: Select all

getSecondHitChance = function(self, t) return self:combatTalentScale(self:getTalentLevel(t)-4, 15, 35) end,
	action = function(self, t)
		game.logSeen(self, "An unseen force begins to swirl around %s!", self.name)
		local duration = t.getDuration(self, t)
		local particles = self:addParticles(Particles.new("force_area", 1, { radius = self:getTalentRange(t) }))

		self.unseenForce = { duration = duration, particles = particles }
		return true
	end,
I'm not sure if it's combatTalentScale that combatTalentScale returns a negative number, but it looks like math.floor is assumed to return zero so that hitCount will be 1. Having a hard time finding documentation, but I think all it does with negative numbers is return next smaller integer.

lines 332-338

Code: Select all

if #targets > 0 then
			local damage = t.getDamage(self, t)
			local knockback = t.getKnockback(self, t)

			local xtrahits = t.getSecondHitChance(self,t)/100
			local hitCount = 1 + math.floor(xtrahits)
			if rng.percent(xtrahits - math.floor(xtrahits)*100) then hitCount = hitCount + 1 end
Also I think I'm only seeing one hit per round, even with talent level 6.5 and supposedly a 24% chance per turn for an extra strike. I guess this comes from xtrahits and hitCount being crazy negative numbers in line 337, and then line 338 adding it back, while xtrahits messes with the if condition so at least it's reliably one hit per round.

Now, if somebody else has trouble reproducing it, I'm on 64-bit linux, and maybe combatTalentScale works differently from windows or 32-bit where negative numbers are involved.
Ghoul never existed, this never happened!

Massimiliano Marangio
Sher'Tul
Posts: 1120
Joined: Mon Sep 30, 2002 9:52 pm
Location: Germany

Re: [1.1.5] Doomed: Unseen Force still broken

#2 Post by Massimiliano Marangio »

In self:combatTalentScale the talent level parameter is taken to the power of 0.5, i.e., the square root of a negative number is calculated if the actual talent level is less than 4.

I don't think that this is intended and suggest to add a test similar to the original version (see below) that returns 0 if the talent level is less than 4.

Code: Select all

getSecondHitChance = function(self, t)
  local level = self:getTalentLevel(t)
  if level < 4 then return 0 end
  return 5 + (level - 4) * 10 -- should be replaced by the scaled version
end,
Another way to fix this is to add a check in combatTalentScale that prevents negative talent levels (like in the case for power =="log").

Post Reply