[1.5.3] Steamsaw TK adventurer bug

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] Steamsaw TK adventurer bug

#1 Post by jenx »

I have run several adventurers, and they all have the same bug - you take a TK talent and Butchery.

You equip three steamsaws. Eventually, you get a rare steamsaw and when you equip it, your attack plummets by about 70%. You then reequip a plain steamsaw (this is all in the main hand) and you attack goes up again.

So something in the rare (and perhaps randart code?) is miscalculating SS damage when you TK a third weapon.
MADNESS rocks

Micbran
Sher'Tul
Posts: 1154
Joined: Sun Jun 15, 2014 12:19 am
Location: Yeehaw, pardner

Re: [1.5.3] Steamsaw TK adventurer bug

#2 Post by Micbran »

If a steamsaw has shield egos, it'll plummet your damage.

(display only bug though)
A little bit of a starters guide written by yours truly here.

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

Re: [1.5.3] Steamsaw TK adventurer bug

#3 Post by jenx »

Micbran wrote:If a steamsaw has shield egos, it'll plummet your damage.

(display only bug though)
So the actual dmg isunaffected?
MADNESS rocks

Micbran
Sher'Tul
Posts: 1154
Joined: Sun Jun 15, 2014 12:19 am
Location: Yeehaw, pardner

Re: [1.5.3] Steamsaw TK adventurer bug

#4 Post by Micbran »

I believe so. You could easily test with a dummy (I guess).
A little bit of a starters guide written by yours truly here.

visage
Archmage
Posts: 345
Joined: Fri Jan 10, 2014 4:09 pm

Re: [1.5.3] Steamsaw TK adventurer bug

#5 Post by visage »

Related: the character sheet displays the block value of the telekinetically wielded saw, which implies that the block value is used... but it isn't.

silentsnack
Wayist
Posts: 23
Joined: Tue Feb 14, 2017 9:08 pm

Re: [1.5.3] Steamsaw TK adventurer bug

#6 Post by silentsnack »

visage wrote:Related: the character sheet displays the block value of the telekinetically wielded saw, which implies that the block value is used... but it isn't.
Addressed triple-saw blocking in one of my mods, because it hadn't occurred to me to report it as a bug. whoops.

mod/class/interface/Combat.lua

Code: Select all

function _M:hasShield()
	if self:attr("disarmed") then return nil end

	local shield1 = self:getInven("OFFHAND") and self:getInven("OFFHAND")[1]
	local shield2 = self:getInven("MAINHAND") and self:getInven("MAINHAND")[1]
	local shield3 = self:getInven("PSIONIC_FOCUS") and self:getInven("PSIONIC_FOCUS")[1]

	local combat1, combat2, combat3 = nil, nil, nil
	if shield1 then if shield1.shield_normal_combat then combat1 = shield1.combat else combat1 = shield1.special_combat end end
	if shield2 then if shield2.shield_normal_combat then combat2 = shield2.combat else combat2 = shield2.special_combat end end
	if shield3 then if shield3.shield_normal_combat then combat3 = shield3.combat else combat3 = shield3.special_combat end end

	if not combat1 then shield1 = nil end
	if not combat2 then shield2 = nil end
	if not combat3 then shield3 = nil end

	if not shield2 then shield2, shield3, combat2, combat3 = shield3, nil, combat3, nil end
	if not shield1 then shield1, shield2, shield3, combat1, combat2, combat3 = shield2, shield3, nil, combat2, combat3, nil end
	if not shield1 then return nil end
	return shield1, combat1, shield2, combat2, shield3, combat3
end

function _M:combatShieldBlock()
	local shield1, combat1, shield2, combat2, shield3, combat3 = self:hasShield()
	if not combat1 then return end

	local block = combat1.block or 0
	if combat2 then block = block + (combat2.block or 0) end
	if combat3 then block = block + (combat3.block or 0) end

	if self:attr("block_bonus") then block = block + self:attr("block_bonus") end
	return block
end
And I used a hook to inject this rather than overload data/talents/misc/objects.lua

Code: Select all

engine.interface.ActorTalents.talents_def.T_BLOCK.getProperties = function(self, t)
	local shield1, combat1, shield2, combat2, shield3, combat3 = self:hasShield()
	if not shield1 then return nil end
	local p = {
		sp = (combat1 and combat1.spellplated or false) or (combat2 and combat2.spellplated or false) or (combat3 and combat3.spellplated or false),
		ref = (combat1 and combat1.reflective or false) or (combat2 and combat2.reflective or false) or (combat3 and combat3.reflective or false),
		br = (combat1 and combat1.bloodruned or false) or (combat2 and combat2.bloodruned or false) or (combat3 and combat3.bloodruned or false),
	}
	return p
end

engine.interface.ActorTalents.talents_def.T_BLOCK.getBlockedTypes = function(self, t)
	local shield1, combat1, shield2, combat2, shield3, combat3 = self:hasShield()
	local bt = {[DamageType.PHYSICAL]=true}
	if not shield1 then return bt, "error!" end
	
	if not shield3 and self:getInven("PSIONIC_FOCUS") and self:getInven("PSIONIC_FOCUS")[1] and self:getInven("PSIONIC_FOCUS")[1].type == "armor" then shield3 = self:getInven("PSIONIC_FOCUS")[1] end

	if not self:attr("spectral_shield") then
		if shield1.wielder.resists then for res, v in pairs(shield1.wielder.resists) do if v > 0 then bt[res] = true end end end
		if shield1.wielder.on_melee_hit then for res, v in pairs(shield1.wielder.on_melee_hit) do if v > 0 then bt[res] = true end end end
		if shield2 and shield2.wielder.resists then for res, v in pairs(shield2.wielder.resists) do if v > 0 then bt[res] = true end end end
		if shield2 and shield2.wielder.on_melee_hit then for res, v in pairs(shield2.wielder.on_melee_hit) do if v > 0 then bt[res] = true end end end
		if shield3 and shield3.wielder.resists then for res, v in pairs(shield3.wielder.resists) do if v > 0 then bt[res] = true end end end
		if shield3 and shield3.wielder.on_melee_hit then for res, v in pairs(shield3.wielder.on_melee_hit) do if v > 0 then bt[res] = true end end end
	else
		bt[DamageType.FIRE] = true
		bt[DamageType.LIGHTNING] = true
		bt[DamageType.COLD] = true
		bt[DamageType.ACID] = true
		bt[DamageType.NATURE] = true
		bt[DamageType.BLIGHT] = true
		bt[DamageType.LIGHT] = true
		bt[DamageType.DARKNESS] = true
		bt[DamageType.ARCANE] = true
		bt[DamageType.MIND] = true
		bt[DamageType.TEMPORAL] = true
	end

	bt.all = nil

	local list = table.keys(bt)
	local n = #list
	if n < 1 then return bt, "(error 2)" end
	local e_string = ""
	if n == 1 then
		e_string = DamageType.dam_def[next(bt)].name
	else
		for i = 1, #list do if DamageType.dam_def[list[i]] then
			list[i] = DamageType.dam_def[list[i]].name
		end end
		e_string = table.concatNice(list, ", ", " and ")
	end
	return bt, e_string
end
edit: whoops, left a line out somehow
Last edited by silentsnack on Thu Jul 20, 2017 1:27 am, edited 1 time in total.

Snarvid
Spiderkin
Posts: 592
Joined: Mon Mar 28, 2011 12:42 pm

Re: [1.5.3] Steamsaw TK adventurer bug

#7 Post by Snarvid »

Any chance it could be a side effect of shield talents interacting weirdly with steamsaws? Are there particular arrangements of other talents you tend to take with TK steamsaw wielders?

silentsnack
Wayist
Posts: 23
Joined: Tue Feb 14, 2017 9:08 pm

Re: [1.5.3] Steamsaw TK adventurer bug

#8 Post by silentsnack »

Snarvid wrote:Any chance it could be a side effect of shield talents interacting weirdly with steamsaws? Are there particular arrangements of other talents you tend to take with TK steamsaw wielders?
I have no idea about the damage aside from Beyond the Flesh making weapons use your WIL instead of STR.

If you're talking about blocking, shield talents and the game's internal shield mechanics currently ignore your psi-focus slot entirely, so as far as that goes the only thing a TK steamsaw contributes is the Block talent-on-wield, which still requires another saw/shield and only uses the block&resist values of the shield/saw in your hand(s).

Post Reply