Page 1 of 1

[b25] Blood Spray always causes disease

Posted: Thu May 12, 2011 4:07 am
by jotwebe
According to it's spell description, Blood Spray (Corruption/Blood 1) causes diseases with a certain chance. In the talent code, a disease chance is set up.

spells/blood.lua line 37-47

Code: Select all

action = function(self, t)
		local tg = self:getTalentTarget(t)
		local x, y = self:getTarget(tg)
		if not x or not y then return nil end
		self:project(tg, x, y, DamageType.CORRUPTED_BLOOD, {
			dam = self:spellCrit(self:combatTalentSpellDamage(t, 10, 190)),
			disease_chance = 20 + self:getTalentLevel(t) * 10,
			disease_dam = self:spellCrit(self:combatTalentSpellDamage(t, 10, 220)) / 6,
			disease_power = self:combatTalentSpellDamage(t, 10, 20),
			dur = 6,
		})
But checking in the damage types:

lines 1006-1018:

Code: Select all

-- Corrupted blood, blight damage + potential diseases
newDamageType{
	name = "corrupted blood", type = "CORRUPTED_BLOOD",
	projector = function(src, x, y, type, dam)
		if _G.type(dam) == "number" then dam = {dam=dam} end
		DamageType:get(DamageType.BLIGHT).projector(src, x, y, DamageType.BLIGHT, dam.dam)
		local target = game.level.map(x, y, Map.ACTOR)
		if target and target:canBe("disease") then
			local eff = rng.table{{target.EFF_ROTTING_DISEASE, "con"}, {target.EFF_DECREPITUDE_DISEASE, "dex"}, {target.EFF_WEAKNESS_DISEASE, "str"}}
			target:setEffect(eff[1], dam.dur or 5, { src = src, [eff[2]] = dam.disease_power or 5, dam = dam.disease_dam or (dam.dam / 5) })
		end
	end,
}
it only checks for disease resistance (line 1013: "if target and target:canBe("disease") then"). That's where a the disease chance ought to be checked, I think, but how to do exactly that I'll leave to someone who knows lua. :wink:

Re: [b25] Blood Spray always causes disease

Posted: Fri May 13, 2011 10:52 pm
by darkgod
fixed