Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
New MTG Cards and Decks (2010, 2012, 2013, 2014, 2015, Magic Duels)
2014




Making a card undrawable
Moderator: CCGHQ Admins
9 posts
• Page 1 of 1
Making a card undrawable
by Dargenom » 10 Feb 2016, 23:04
Is there some snippet of code you can add to a card to make it so you can't draw it in your starting hand or at all? Thanks in advance! 

Re: Making a card undrawable
by Xander9009 » 10 Feb 2016, 23:30
Why?
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Making a card undrawable
by Dargenom » 10 Feb 2016, 23:41
Been working on a custom story mode of sorts ever since I realized you could have a deck start out at any life total. For the boss I was thinking the AI would start with lands already in play, so I put leyline-esque effects on a few lands that trigger from anywhere. But then if said lands were drawn in the starting hand they're suddenly at less than 7 cards right off the bat.
Re: Making a card undrawable
by Xander9009 » 10 Feb 2016, 23:43
There's no good way to prevent the player from drawing a card. Code can't run until the mulligan is complete, and by then the card will have already been drawn or not. However, it might be possible to make specific setups like how some vanilla encounters work. I'm not certain. RiiakShiNal might know. I'd look into any of the decks in the game that you play against (or as, in the case of the tutorial) and see if they have any useful info.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Making a card undrawable
by Dargenom » 10 Feb 2016, 23:50
Ah, fair enough. Time to do some digging then. Thanks for the help!
Re: Making a card undrawable
by RiiakShiNal » 11 Feb 2016, 02:47
You can't make a card undrawable, but there is still something you can do. You said that you put leyline effects on the card(s), well before you have them enter the battlefield you can check their current zone and if that zone is ZONE_HAND then force that player to draw a card to replace the leyline-like card. It makes sure that any card (other than a true leyline) that is put on the battlefield doesn't cause the player to start with fewer cards in hand than normal.
That is the easiest (and probably the best) solution. There are other more complex solutions to do what you are asking, but I can't really say they are better.
Creating saved encounters really isn't an option at this point because no-one has analyzed the saved game files and there could be additional checks. Also creating a new campaign (to host any created encounters) could cause issues with the existing campaigns since there aren't any free campaign slots.
That is the easiest (and probably the best) solution. There are other more complex solutions to do what you are asking, but I can't really say they are better.
Creating saved encounters really isn't an option at this point because no-one has analyzed the saved game files and there could be additional checks. Also creating a new campaign (to host any created encounters) could cause issues with the existing campaigns since there aren't any free campaign slots.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Making a card undrawable
by Xander9009 » 11 Feb 2016, 03:24
While it would require having his campaign be a standalone that is plainly said to be incompatible with the official one, but couldn't he basically just replace the campaign decks and personalities with his own? He'd have a set number of decks to create, which might limit it a bit, unfortunately, but better than nothing, perhaps. (I mean replace the deck lists and images and stuff with identically named files.) Just a thought.RiiakShiNal wrote:You can't make a card undrawable, but there is still something you can do. You said that you put leyline effects on the card(s), well before you have them enter the battlefield you can check their current zone and if that zone is ZONE_HAND then force that player to draw a card to replace the leyline-like card. It makes sure that any card (other than a true leyline) that is put on the battlefield doesn't cause the player to start with fewer cards in hand than normal.
That is the easiest (and probably the best) solution. There are other more complex solutions to do what you are asking, but I can't really say they are better.
Creating saved encounters really isn't an option at this point because no-one has analyzed the saved game files and there could be additional checks. Also creating a new campaign (to host any created encounters) could cause issues with the existing campaigns since there aren't any free campaign slots.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Making a card undrawable
by RiiakShiNal » 11 Feb 2016, 11:32
He could replace the official campaign, but even then we don't yet understand how the encounter saves are set up so the idea of having a "save" where the AI starts with certain cards already on the battlefield is still out unless someone examines the saves and figures out how they work.Xander9009 wrote:While it would require having his campaign be a standalone that is plainly said to be incompatible with the official one, but couldn't he basically just replace the campaign decks and personalities with his own? He'd have a set number of decks to create, which might limit it a bit, unfortunately, but better than nothing, perhaps. (I mean replace the deck lists and images and stuff with identically named files.) Just a thought.
The best idea is still to have the cards automatically put themselves on the battlefield and if they were in hand replace themselves by forcing the player to draw a card. Now there are a few ways to go about that.
- Simple check before placing itself on battlefield (in RTA) to see if it was in hand and have player draw a card if it was.
- Have the card check to see how many cards are in hand at the beginning of resolution, then at end of resolution force player to draw cards until it matches how many cards were in hand at the beginning.
- If you want to always ensure 7 cards in hand for the player using the deck then at end of resolution draw cards until 7 are in hand.
- Write a special manager which will set up the "saved" game by manipulating all cards in deck, hand, graveyard, etc... on turn 0 (or 1, I can't remember which the game uses for first turn off hand) then either terminates itself or turns itself off.
For simple solutions option 1 is probably best, if you want total control then option 4 will give the best control for the least coding (though there can still be a lot of code for checking different scenarios such as FFA[2, 3, or 4 players], 2HG, etc...).
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Making a card undrawable
by Dargenom » 12 Feb 2016, 19:59
Making it draw you a card to replace it from the hand is a good idea, can't believe I didn't think of that myself. Shouldn't be that hard to piece together from other card code either. Thanks for the help guys. ^^
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 22 guests