Added support for sacrifice to UnlessCost
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
9 posts
• Page 1 of 1
Added support for sacrifice to UnlessCost
by ArsenalNut » 15 Jul 2012, 07:53
I added the ability to use sacrifice costs for an UnlessCost. I only converted Rathi Dragon to the new capability because I wanted to make sure everyone was ok with implementation. I changed how the input works for choosing the cards to sacrifice. Clicking a card once adds it to the sacrifice list. Clicking a card again removes it from the list. The selected cards are displayed in the prompt panel. Once the required number of cards are chosen, the OK button gets enabled. The cards are only sacrificed after the OK button is pressed so the user can change or cancel their choices without removing the cards permanently.
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Added support for sacrifice to UnlessCost
by friarsol » 15 Jul 2012, 12:37
This sounds good to me. Is it more intuitive to do left click to add to the list, right click to remove from the list? We already use this for Attacking and Blocking logics.ArsenalNut wrote:I added the ability to use sacrifice costs for an UnlessCost. I only converted Rathi Dragon to the new capability because I wanted to make sure everyone was ok with implementation. I changed how the input works for choosing the cards to sacrifice. Clicking a card once adds it to the sacrifice list. Clicking a card again removes it from the list. The selected cards are displayed in the prompt panel. Once the required number of cards are chosen, the OK button gets enabled. The cards are only sacrificed after the OK button is pressed so the user can change or cancel their choices without removing the cards permanently.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Added support for sacrifice to UnlessCost
by ArsenalNut » 15 Jul 2012, 14:26
To do the left click add, right click remove, I needed to add a new class that extends Input. I wanted to get feedback on the new input sequence to activate sacrifice before I added a new class. I can definitely implement it that way if that is the community's preference.friarsol wrote:This sounds good to me. Is it more intuitive to do left click to add to the list, right click to remove from the list? We already use this for Attacking and Blocking logics.ArsenalNut wrote:I added the ability to use sacrifice costs for an UnlessCost. I only converted Rathi Dragon to the new capability because I wanted to make sure everyone was ok with implementation. I changed how the input works for choosing the cards to sacrifice. Clicking a card once adds it to the sacrifice list. Clicking a card again removes it from the list. The selected cards are displayed in the prompt panel. Once the required number of cards are chosen, the OK button gets enabled. The cards are only sacrificed after the OK button is pressed so the user can change or cancel their choices without removing the cards permanently.
I also think it would make things more intuitive to a add visual clue indicating which cards are selected like a different colored highlight similar to the mouse over. I could not figure out where to begin to add such an effect. Any pointers?
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Added support for sacrifice to UnlessCost
by friarsol » 15 Jul 2012, 14:35
CardPanel.paintChildren() has the function that paints icons on top of images. We use this for Attacking/Blocking/Phasing etc. I had planned on using this (somehow) for "being currently used in cost payment" when I thought I might have time to handle it. I'm not sure what the best way would be, but we should be able to manage something?ArsenalNut wrote:I also think it would make things more intuitive to a add visual clue indicating which cards are selected like a different colored highlight similar to the mouse over. I could not figure out where to begin to add such an effect. Any pointers?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Added support for sacrifice to UnlessCost
by Sloth » 15 Jul 2012, 14:45
We already had an icon for this. Was it made by you marc?friarsol wrote:CardPanel.paintChildren() has the function that paints icons on top of images. We use this for Attacking/Blocking/Phasing etc. I had planned on using this (somehow) for "being currently used in cost payment" when I thought I might have time to handle it. I'm not sure what the best way would be, but we should be able to manage something?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Added support for sacrifice to UnlessCost
by moomarc » 15 Jul 2012, 18:01
Yip. Originally made when Sol was working on something similar over here (link might be wrong if you have a different sort order, but its near the start of the thread). I'd probably redesign now to match our other card state icons, but its something for now.Sloth wrote:We already had an icon for this. Was it made by you marc?friarsol wrote:CardPanel.paintChildren() has the function that paints icons on top of images. We use this for Attacking/Blocking/Phasing etc. I had planned on using this (somehow) for "being currently used in cost payment" when I thought I might have time to handle it. I'm not sure what the best way would be, but we should be able to manage something?
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Added support for sacrifice to UnlessCost
by ArsenalNut » 16 Jul 2012, 04:39
Updated the Unless sacrifice functionality. It is now using a right click to unselect a card. The selections are also highlighted with a magenta boundary and an icon is put on each selection. I am using the graveyard icon right now because I didn't have anything nicer (hint hint Moomarc
) I added the selection highlight to the border also, because the icons are hard to see for stacked cards.

So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Added support for sacrifice to UnlessCost
by moomarc » 16 Jul 2012, 05:30
Ooh, so you're trying to tell me that the old icon I linked to was too ugly!ArsenalNut wrote:Updated the Unless sacrifice functionality. It is now using a right click to unselect a card. The selections are also highlighted with a magenta boundary and an icon is put on each selection. I am using the graveyard icon right now because I didn't have anything nicer (hint hint Moomarc) I added the selection highlight to the border also, because the icons are hard to see for stacked cards.

-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Added support for sacrifice to UnlessCost
by moomarc » 16 Jul 2012, 08:26
Okay, the new icon is in the sprite and I've linked up the coords etc. I kept it generic so that it can be used for other cost types if they get expanded to use the same system.
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 28 guests