Chance to 'blah' on crit?

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
edge2054
Retired Ninja
Posts: 3756
Joined: Fri May 28, 2010 4:38 pm

Chance to 'blah' on crit?

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

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Chance to 'blah' on crit?

#2 Post 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
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

edge2054
Retired Ninja
Posts: 3756
Joined: Fri May 28, 2010 4:38 pm

Re: Chance to 'blah' on crit?

#3 Post 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.

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Chance to 'blah' on crit?

#4 Post 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)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply