Page 1 of 1

Chance to 'blah' on crit?

Posted: Fri Sep 24, 2010 10:25 pm
by edge2054
Anyone know if this can be done without adding directly to the crit functions?

Something like this in the talent? (which didn't work).

Code: Select all

if crit then
            if target:checkHit(src:combatSpellpower(), target:combatPhysicalResist(), 0, 95, 15) and target:canBe("stun") then
                target:setEffect(target.EFF_STUNNED, 4, {})
            else
                game.logSeen(target, "%s resists the stun!", target.name:capitalize())
            end
        end


I've considered something like this in the crit functions but it could turn into a lot to add to Combat. (Some of the Druid ideas depend heavily on this sort of function).

Code: Select all

if crit and self:knowTalent(self.T_CRIT_FOO) then

Re: Chance to 'blah' on crit?

Posted: Sun Sep 26, 2010 9:53 pm
by darkgod
For the melee weapon damage we can make attackTargetWith return a new parameter that tells if it was a crit in addition to whether it hitted

Re: Chance to 'blah' on crit?

Posted: Sun Sep 26, 2010 11:23 pm
by edge2054
Yeah, I was thinking more for spells though.

Like for druids in particular, because we had discussed expanding on crits using cunning as a priority stat, I was thinking stuff like...

Call Lightning - Radius 3 lightning aoe, daze on crit.
Murder of Crows - AoE damage over time effect that can blind on crit.

And then some buffs off spirits giving x effect after a crit.

More specifically I started playing around with the idea for one of the chronomancer spells, graviton wake, basically a cone that would do knockback on crit.

I suppose we can still do something like "if crit and self:knowTalent(self.T_CRIT_FOO) then" for a few effects though. Maybe passive druid talents that make crits more dangerous or some temporary effects, maybe spirits could set a temporary effect and then we could add some lines in spell crit to check to see if that effect was active.

Re: Chance to 'blah' on crit?

Posted: Mon Sep 27, 2010 8:44 am
by darkgod
Well spell crits are determined on cast not on hit.
However you can still do it, instead of project()'ing a damage type you can project a function:

Code: Select all

		self:project(tg, x, y, function(tx, ty)
			local target = game.level.map(tx, ty, engine.Map.ACTOR)
			if not target then return end
			DamageType:get(damtype).projector(self, tx, ty, damtype, self:spellCrit(self:combatTalentSpellDamage(t, 25, 290)))
		end)
And thus you can do something like this:

Code: Select all

		self:project(tg, x, y, function(tx, ty)
			local target = game.level.map(tx, ty, engine.Map.ACTOR)
			if not target then return end
			local dam = self:combatTalentSpellDamage(t, 25, 290)
			local crit
			dam, crit = self:spellCrit(dam)
			DamageType:get(damtype).projector(self, tx, ty, damtype, dam)

			if crit then .. whatever ... end
		end)