Making a damage type pierce through iceblock

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Razakai
Uruivellas
Posts: 889
Joined: Tue May 14, 2013 3:45 pm

Making a damage type pierce through iceblock

#1 Post 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,
}

grayswandir
Uruivellas
Posts: 708
Joined: Wed Apr 30, 2008 5:55 pm

Re: Making a damage type pierce through iceblock

#2 Post by grayswandir »

You want to temporarily set self.iceblock_pierce to 100.
Addons: Arcane Blade Tweaks, Fallen Race, Monk Class, Weapons Pack
Currently working on Elementals. It's a big project, so any help would be appreciated. :)

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Making a damage type pierce through iceblock

#3 Post 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)
My feedback meter decays into coding. Give me feedback and I make mods.

Razakai
Uruivellas
Posts: 889
Joined: Tue May 14, 2013 3:45 pm

Re: Making a damage type pierce through iceblock

#4 Post by Razakai »

Working now, thanks guys.

Post Reply