So I am trying to create an ego for a steamgun to shoot again on a critical hit. Cause I thinking of just doing a talent_on_hit, but I was thinking of more a critical type deal. How I imagined it was like you got a critical blow on the enemy, and they flinched giving you enough time to shoot them again.
So I went from
talent_on_hit = { [Talents.T_SHOOT] = {level=resolvers.genericlast(function(e) return e.material_level end), chance=15} }
to
special_on_crit = { [Talents.T_SHOOT] = {level=resolvers.genericlast(function(e) return e.material_level end), }
I am unsure if the second one works. I know the first one works because it is just an edit of another ego so it should work although I haven't tested it. Anybody can give me some pointers or a step in the right direction? Do I need to have some combat speed modifier as well?
Need some confirmation on special_on_crit effects
Moderator: Moderator
Re: Need some confirmation on special_on_crit effects
After some testing it would crash, only proving my self right at the time. The former worked, but I wanted to have the later work as well. So I spent more reading through the rest of the egos and artifact luas. It seems I might need to designate a the function to have combat functionality, who is casting, and the target designated. Though majority of the egos are with melee or casting spells on hit functionality. Would any else give some documentation for the special on crit function. Though I probably should just keep the former and have it stay simple.
Re: Need some confirmation on special_on_crit effects
Its dangerous to go alone! Take this.
This is untested and quickly put together, so it may contain typos.
The who.turn_procs stuff is there to stop it from triggering more than once per turn. A useful check when making something that can go recursive.
Code: Select all
special_on_crit = {desc="fire your guns a second time", fct=function(combat, who, target)
if who.turn_procs and not who.turn_procs.extra_shoot then
who:forceUseTalent(who.T_SHOOT, {ignore_cd=true, ignore_energy=true, force_target=target, force_level=1, ignore_ressources=true})
who.turn_procs.extra_shoot = true
end
end},
The who.turn_procs stuff is there to stop it from triggering more than once per turn. A useful check when making something that can go recursive.
My feedback meter decays into coding. Give me feedback and I make mods.
Re: Need some confirmation on special_on_crit effects
Thank you for the reply. I forgot about recursion checks. I read your code and tried to understand it to the best of my ability though its limited. Everything to me makes sense to a good degree.
Thank you for using your time to help me and personally do this small ego code! I will test it soon, and hopefully see how it turns out.
Thank you for using your time to help me and personally do this small ego code! I will test it soon, and hopefully see how it turns out.