ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Thu Sep 24, 2020 7:22 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Feb 04, 2020 1:32 am 
Offline

Joined: Tue Feb 04, 2020 1:21 am
Posts: 3
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?


Top
 Profile  
 
PostPosted: Fri Feb 07, 2020 8:09 pm 
Offline

Joined: Tue Feb 04, 2020 1:21 am
Posts: 3
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.


Top
 Profile  
 
PostPosted: Fri Feb 07, 2020 11:20 pm 
Offline
Perspiring Physicist

Joined: Sun Sep 09, 2012 7:43 am
Posts: 6119
Its dangerous to go alone! Take this.
Code:
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},

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.

_________________
My feedback meter decays into coding. Give me feedback and I make mods.


Top
 Profile  
 
PostPosted: Tue Feb 11, 2020 5:37 am 
Offline

Joined: Tue Feb 04, 2020 1:21 am
Posts: 3
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group