Page 1 of 1

Removing meaningless crit messages from alchemist bombs

Posted: Wed Dec 01, 2010 12:55 am
by yufra
The critical change is recomputed on every tile for alchemist bombs, and this can lead to misleading "spell looks more powerful" messages when you crit on an empty tile. This code rearrangement of explosives.lua should eliminate those, only attempting the spellCrit if there is an actor in the tile.

Code: Select all

			if ammo.alchemist_bomb.splash then
				DamageType:get(DamageType[ammo.alchemist_bomb.splash.type]).projector(self, tx, ty, DamageType[ammo.alchemist_bomb.splash.type], ammo.alchemist_bomb.splash.dam)
			end
			local target = game.level.map(tx, ty, Map.ACTOR)
			if not target then return end
			dam_done = dam_done + DamageType:get(damtype).projector(self, tx, ty, damtype, self:spellCrit(d), tmp)
			if ammo.alchemist_bomb.stun and rng.percent(ammo.alchemist_bomb.stun.chance) and target:checkHit(self:combatSpellpower(), target:combatPhysicalResist(), 0, 95, 5) and target:canBe("stun") then
				target:setEffect(target.EFF_STUNNED, ammo.alchemist_bomb.stun.dur, {})
			end
			if ammo.alchemist_bomb.daze and rng.percent(ammo.alchemist_bomb.daze.chance) and target:checkHit(self:combatSpellpower(), target:combatPhysicalResist(), 0, 95, 5) and target:canBe("stun") then
				target:setEffect(target.EFF_DAZED, ammo.alchemist_bomb.daze.dur, {})
			end

Re: Removing meaningless crit messages from alchemist bombs

Posted: Fri Dec 03, 2010 12:01 am
by darkgod
fixed