I have two questions related to setting up stack exp abilities on the battlefield.
First question: What's the best approach to add a SE ability on the battlefield?
This code does work, it gives Bersker ability to all the creatures on the battlefield. The slot for the new ability is obtained by EA:F which I belive is safe enough. However, I found a problem with my code just now.
With each battle replay, I get one extra Bersker ability on stacks. I udnerstand this is because on battle replay the stack info is stored and used in the next battle. To resolve this, I can set a flag for battle replay and prevent excute my EA like this:
This works well. Although I wonder if there is any better approach to add an EA ability to a stack.
Second Question: Is there a way to prevent EA receiver from resetting BM values?
Just check my code above. I tried to add 200 defense to all the stack with BM:D. It failed unfortunately, becoz any EA received on a stack reset the stack's stats to its origianl (value from MA). If I put my BM:D after the execution of EA, the 200 defense would be correctly added. This makes me worried about mod compatiblity. It looks like we need to regulate the timing of using EA, otherwise it is fairy easy to break BM set by another author. Although I also don't get the point EA has to reset stats, is this really necessary for it to work? For my example, my EA only adds a new ability, it does not make sense that it also has to do with creature stats, right?