Page 1 of 1

Making a damage type pierce through iceblock

Posted: Wed Jul 30, 2014 12:06 pm
by Razakai
I have a spell that's intended as dual use. If used on a non-frozen target, it applies a potent debuff. Against frozen targets, it gains a heavy damage multiplier. Unfortunately, that damage bonus is often wasted due to the iceblock absorb, so I'd like it to pierce through iceblocks. Is there a function to cause this to pierce? I imagine it'd involve unflagging and reflagging the iceblock status during the freeze damage, but not sure. Code below.

Code: Select all

newDamageType{
	name = "hungering cold", type = "HCOLD",
	projector = function(src, x, y, type, dam)
		local target = game.level.map(x, y, Map.ACTOR)
		if not target then return end
		tmp = tmp or {}
		if target and not tmp[target] then
			tmp[target] = true
			if target:hasEffect(target.EFF_FREEZE) then
				DamageType:get(DamageType.COLD).projector(src, x, y, DamageType.COLD, dam*2.5)
			else
				DamageType:get(DamageType.COLD).projector(src, x, y, DamageType.COLD, dam)
				if target:canBe("pin") then
					local t = src:getTalentFromId(src.T_HUNGERING_COLD)
					target:setEffect(target.EFF_HYPOTHERMIA, 6, {src=src, apply_power=src:combatSpellpower(), speed=t.getSlow(src,t)})
				else
					game.logSeen(target, "%s resists!", target.name:capitalize())
				end
			end
		end
	end,
}

Re: Making a damage type pierce through iceblock

Posted: Wed Jul 30, 2014 12:18 pm
by grayswandir
You want to temporarily set self.iceblock_pierce to 100.

Re: Making a damage type pierce through iceblock

Posted: Wed Jul 30, 2014 12:19 pm
by HousePet

Code: Select all

local pierce = self:addTemporaryValue("iceblock_pierce", 100)
DamageType:get(DamageType.COLD).projector(eff.src, self.x, self.y, DamageType.COLD, eff.power)
self:removeTemporaryValue("iceblock_pierce", pierce)

Re: Making a damage type pierce through iceblock

Posted: Wed Jul 30, 2014 1:10 pm
by Razakai
Working now, thanks guys.