Page 1 of 1

Spells cast() Function

Posted: Wed Aug 13, 2008 7:21 am
by Scatman
There are certain spells that have pre-requisites before they are executed, like spells that require you to be behind your target, in stealth before you can begin casting, or even both.
The cast() function is executed after the casting time is over right? So spells with these pre-reqs won't even let the casting time begin before checking that the player's current state satisfies those pre-reqs.
Is there a function that I'm not aware of that is run before casting time begins or can this be done in the cast() function?

Posted: Wed Aug 13, 2008 2:41 pm
by LethalEncounter
I can add a function that would be called before the spell is cast that will return true or false depending on whether the spell should be cast. What would you like the function name to be?

Posted: Wed Aug 13, 2008 3:50 pm
by Scatman
Hmm I am not very clever when it comes to naming functions :). Pre() or before() hehe I dunno :P you or someone else might want to decide.
Thanks LE! That'll make stealth attacks and back attacks much better!

Posted: Wed Aug 13, 2008 5:23 pm
by John Adams
Maybe a "CheckPreReqs()" kinda thing. I'm sure there could be tons of uses for this, like checking available power/hp/conc before you even get to Cast. Not that it matters, though.
Plus, customization, of course.

Posted: Wed Aug 13, 2008 5:45 pm
by Scatman
Actually it does matter. On live, it will do a test to make sure you are behind/flanking/have enough power/arent dead/etc before the casting time begins AND after the casting time finishes. Trust me, I know :( damn flanking and stealth spells :P

Posted: Wed Aug 13, 2008 6:37 pm
by John Adams
John Adams wrote:like checking available power/hp/conc before you even get to Cast. Not that it matters, though.
This was the context, not what you said. Your requirements are valid.

Posted: Wed Aug 13, 2008 9:37 pm
by Scatman
Oops :) I am gullible what can I say!