Page 1 of 1

[1.0] Found bug permanently reducing accuracy, with code fix

Posted: Mon Jan 21, 2013 3:44 pm
by Hirumakai
Scounrel's Strategies is currently bugged. It reduces accuracy, but then never removes the accuracy debuff due to a typo in the removal line:

eff.atkid = self:addTemporaryValue("combat_atk", -eff.atk)

self:removeTemporaryValue("combat_atk", eff.atk)

It should be atkid, not atk.

The correct code for the entire effect should be:

Code: Select all

newEffect{
	name = "DISABLE", image = "talents/cripple.png",
	desc = "Disable",
	long_desc = function(self, eff) return ("The target is disabled, reducing movement speed by %d%% and physical power by %d."):format(eff.speed * 100, eff.atk) end,
	type = "physical",
	subtype = { wound=true },
	status = "detrimental",
	parameters = { speed=0.15, atk=10 },
	on_gain = function(self, err) return "#Target# is disabled.", "+Disabled" end,
	on_lose = function(self, err) return "#Target# is not disabled anymore.", "-Disabled" end,
	activate = function(self, eff)
		eff.speedid = self:addTemporaryValue("movement_speed", -eff.speed)
		eff.atkid = self:addTemporaryValue("combat_atk", -eff.atk)
	end,
	deactivate = function(self, eff)
		self:removeTemporaryValue("movement_speed", eff.speedid)
		self:removeTemporaryValue("combat_atk", eff.atkid)
	end,
}