Dennis Re: the GUI....can you simply add a shadowed layer with the label of the card showing? That way on mouse over you can display the enchantment/aura on the sidebar.
Concerning the lignify bug, I think part of the problem is that you are using the actual cards rather than copies of the cards. If something changes in the copy that doesnt effect the real thing but it does affect what is in play. And when you reset the Copy you can do so from the Original without worrying about it being incorrect. This is what I was talking about before with the difference between cards and permanents.
You play Card
X --->Permanent
X which is a copy of Card
X is created and put into play...(Card
X is in limbo because you aren't actually ever using it except to get information from it (it is read only)) Permanent
X gets pumped by whatever cards are in play, loses said pumping as apropriate, etc... then you can attach/unattach enchantments and equipments to said permanent because you dont have to worry about wrecking it. When some thing causes Permanent
X to leave play the Card
X it represents does the leaving instead and Permanent
X is just erased. Sort of unhooking it from the system.
A typical permanent might look as follows datawise:
Parent Card:
Merfolk LooterType: Merfolk
Subtype: (whatever subtype is on the card, I forget lol)
CMC: 2
MC: 1U
BaseP: 1
BaseT: 1
Abilitys: (loot)
With a
Glorious Anthem in play it also has the following data:
PermBuff: +1P, +1T.
TotalP: 2
TotalT: 2
With a
Lignify:
Attached Card:
LignifyTypeChangedTo: Treefolk
BasePChangedTo: 0
BaseTChangedTo: 4
AbilityChangedTo: null
TotalP: 1
TotalT: 5
(If that makes any sense) I realize that implementing concept to actual code isn't necessarily as easy as composing a post in english but the logic should be similar.
This is kind of the way it works already, except, we don't make a copy of the card. But it wouldn't really matter in this case. Let me try to explain, this is the code of
Lignify:
- Code: Select all
public void resolve()
{
Card c = getTargetCard();
if(AllZone.GameAction.isCardInPlay(c))
{
c.setBaseAttack(0);
c.setBaseDefense(4);
c.setType(new ArrayList());
c.addType("Creature");
c.addType("Treefolk");
c.setIntrinsicKeyword(new ArrayList());
c.clearSpellAbility();
}
}//resolve()
Basically it sets the base power to 0, base toughness to 4, then it clears all existing types and set it to "Creature Treefolk" and also removes all (intrinsic) keywords (it will lose flying, lifelink etc. unless it's receiving this from an outside source). Then at the end, it clears all spellAbilities (through the c.clearSpellAbility() line), this means say,
Captain Sisay won't be able to fetch legendary creatures anymore, or
Merfolk Looter won't be able to gain flying until end of turn anymore. Almost all of these abilities are defined in CardFactory.java.
HOWEVER, the
Merfolk Looter "loot" ability, or
Winnower Patrol "Kinship" are treated very differently, since they're in essence triggered abilities. These abilities are defined in GameActionUtil.java, and they basically put an ability on the stack (at a specific point in time and under certain conditions) whenever a card with that name is found. So basically, it will put the Kinship ability on the stack for
Winnower Patrol during the upkeep of the player that controls one, or it will put the "Loot" ability on the stack for
Merfolk Looter whenever it finds a card with that name that just dealt combat damage to the other player.
Bottom-line is, these abilities are very separate from the actual card, the only thing that "connects" them is the actual card name. Therefore, if
Lignify would change the name of the card as it hits play, these abilities will not trigger anymore, and this bug would be "fixed". I say "fixed" because this is a hacky solution.
Anyway, I hope this makes sense

The GUI is a tricky story, the card layout on the various player zones are managed by some layout manager (I think it's a Grid Layout?), and I know more complicated layouts are possible in java, but I have no idea how. I'll look around for some tutorials that might shed some light on this matter.