ID:220967
 
(See the best response by Flame Sage.)
Well i 'know' how to do this, but i don't know if my ways are the best ones to handle this. What i've done is this:

Way 1:
Battle/proc/CheckAbility(Pokemon/Pokemon1) {
if(Pokemon1.Ability == AbilityNum("Air Lock")) {
//Do effect there...
}
// Do this for each ability in the world.
}


^ Same code goes for moves.

Way 2:
Attack
Tackle
name = "Tackle";
// Etc, etc.
Use(Pokemon/Ally, Pokemon/Enemy) {
//Do the attack stuff here...
}
Tail_Whip
name = "Tail Whip";
// Etc, etc.
Use(Pokemon/Ally, Pokemon/Enemy) {
//Do the attack stuff here...
}


But i feel that both ways (First one 90% lol) arent' the best one to handle this type of things, even since moves and abilities have priority (I mean some of them occour when match starts, others after a turn ends, other when enemy attacks, etc, etc).

What would be the "best and comprehensive" way to do this type of stuff?

Thanks.
Honestly, I've always done it the second way, much more OOP oriented.
Also, I'd probably pass a third parameter to the Use(), the battle datum that's currently in use (if you implore such a thing)
Well was just a demostration lol. I'll see how it goes and causes any problems though. Still the issue is the Ability Priority...
Best response
Priority?
I thought the Pokemon games were based off of speed calculations?
Abilities work in other way. I mean, some Abilities are used at the Battle Start (Such as Drizzle) others in end of turn (Speed Boost) and others at when Pokémon is sent out (Tera Volt...).
I would probably store them each in different lists, then just execute whatever is in that list.