[1.6.4] Magnetism tree lacks definition of shield_combat

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
zczczc1680
Low Yeek
Posts: 8
Joined: Sun Dec 01, 2019 11:08 pm

[1.6.4] Magnetism tree lacks definition of shield_combat

#1 Post by zczczc1680 »

To perform a shield attack, the game usually do sth like this(example: Shield of Light)

Code: Select all

callbackOnMeleeAttack = function(self, t, target, hitted, crit, weapon, damtype, mult, dam)
		[b]local shield = self:hasShield()[/b]
		if hitted and not target.dead and shield and not self.turn_procs.shield_of_light then
			self.turn_procs.shield_of_light = true
			self:attackTargetWith(target, [b]shield.special_combat[/b], DamageType.LIGHT, t.getShieldDamage(self, t))
		end
	end,
That codes allready causes nil weapon type(actually the same bug) if a steamsaw is considered to be a shield(so we get wrong damage if we dual wield steamsaw and trigger Shield_of_Light shield attack).

or better like this (damage of Lightning_Web)

Code: Select all

newDamageType{
	name = "lightning web", type = "LIGHTNING_WEB",
	projector = function(src, x, y, type, dam, state)
		state = initState(state)
		useImplicitCrit(src, state)
		local target = game.level.map(x, y, Map.ACTOR)
		if target then
			if src:reactionToward(target) < 0 then
				[b]local shield, shield_combat = src:hasShield()[/b]
				if not shield then return nil end
				src:attackTargetWith(target,[b] shield_combat[/b], DamageType.LIGHTNING, dam.dam)
			else
				target:setEffect(target.EFF_LIGHTNING_WEB, 1, { src=src, power=dam.block } )
			end
		end
	end,
}

Unfortunately, the whole Magnetism talent tree except the example above lacks definition of shield_combat while using it as a parameter.
The following codes are a part of the definition of talent Magnetic Field

Code: Select all

	action = function(self, t)
		local tg = self:getTalentTarget(t)
		[b]if not self:hasShield() then return end[/b]
		self:project(tg, self.x, self.y, function(px, py)
			local target = game.level.map(px, py, Map.ACTOR)
			if not target then return end
			self:attackTargetWith(target, [b]shield_combat[/b], DamageType.LIGHTNING, t.getDamage(self,t))
			if target:canBe("knockback") then target:knockback(self.x, self.y, self:getTalentRadius(t)) end
		end)
Unlike previous examples, the variable shield_combat has not been defined.

To prove what I said, you can try play a adventurer character with a steamsaw(can be considered as a shield) in mainhand and with the tentacle talent. You will see that the attacks from Static Shock wont trigger tentacle attacks(but they do trigger other procs, and the same with attacks from Shield of Light), since there is an extra condition check for tentacle attacks:

Code: Select all

local attackTargetWith = _M.attackTargetWith
function _M:attackTargetWith(target, weapon, damtype, ...)
	local speed, hit, dam = attackTargetWith(self, target, weapon, damtype, ...)

	[b]if weapon[/b] and self:knowTalent(self.T_MUTATED_HAND) and not self:attr("tentacle_hand_prevent") and self:callTalent(self.T_MUTATED_HAND, "canTentacleCombat") and weapon.talented ~= "tentacles" then
It confirms that shield_combat = nil in attacks from Static Shock.

Steven Aus
Archmage
Posts: 366
Joined: Sat Dec 13, 2014 3:38 pm

Re: [1.6.4] Magnetism tree lacks definition of shield_combat

#2 Post by Steven Aus »

Yeah, definitely a bug.

Horken
Cornac
Posts: 35
Joined: Wed Aug 19, 2020 10:53 am

Re: [1.6.4] Magnetism tree lacks definition of shield_combat

#3 Post by Horken »

This bug is still present in 1.6.7, all Magnetism tree shield attacks do not attack with equipped shield

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: [1.6.4] Magnetism tree lacks definition of shield_combat

#4 Post by darkgod »

fixed for 1.7
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply