It is currently 02 May 2024, 05:35
   
Text Size

generic code for aura?

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: generic code for aura?

Postby DennisBergkamp » 05 May 2010, 05:07

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.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: generic code for aura?

Postby Chris H. » 26 May 2010, 10:09

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.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 53 guests


Who is online

In total there are 53 users online :: 0 registered, 0 hidden and 53 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 53 guests

Login Form