Page 2 of 2

Re: generic code for aura?

PostPosted: 05 May 2010, 05:07
by DennisBergkamp
slapshot5 wrote:Well, this idea sure opened up a can of worms. The system works, but:

1) auras don't draw on Enchantments and Artifacts
1a) ok, that just requires some changes to GuiDisplayUtil.java

-artifacts
--what about Moxen?
--what about Equipment?

-enchantments
--no big deal, but!
--auras can also be the target of auras (think Feedback...)

So, if you have an artifact creature that is enchanted with an aura and equipped, and the equipment has an aura and the aura has an aura and the first aura has an aura...

This gets ugly in a hurry. The linking and effects all work from what I can tell, which is the important part, but the drawing goes south in a hurry.

Anyone familiar with this code want to take a crack? Someone good with recursion can probably do this in a few lines. :)

I'm inclined to just handle the basic cases for now.

-slapshot5
Oh boy, yeah... and this display code is some of the ugliest code currently in Forge (I'm partially responsible for that). But, I'll have a look at this one of these days.

Re: generic code for aura?

PostPosted: 26 May 2010, 10:09
by Chris H.
MageKing17 wrote:
Chris H. wrote:Hmm, I just put together a test deck with several Animate Artifact auras and several artifacts including an equipment. I animated the equip and the other artifacts OK, bu when I then tried to equip the animated equipment onto another animated artifact ... Forge became confused.

At one point the equip had two separate images. :wink:
Remember that rule 301.5c states, "An Equipment that's also a creature can't equip a creature."
`
I took a quick look into this problem. I added a few checks and the AI will no longer attempt to animate an equip and if an equip is animated the AI will no longer attempt to equip one of it's creatures with the animated equip.

So I have half of this problem resolved. I could also place similar checks into the code for the human ... but I thought that a simple hack placed into the resolve code for Animate Artifact could call the unEquip method.

The equip detaches and becomes animated. The previously equip-ed creature looses the equips abilities but the creature retains the equip picture. And the detail panel states that the creature is still equip-ed. I am afraid that I will I have to resort to the same hacks for the human that I placed in the code for the AI.