- Removed some none working cards from mtg.txt
- Added the "unofficial" grade 
- Added a system to give a grade to an entire file, avoids reading the file any further if not necessary
- Added Zeth's addons to the primitives folder, with a grade of "Unofficial"
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-07-25 06:29:33 +00:00
parent 35e5b64dfd
commit c1073c83e6
5 changed files with 6802 additions and 33 deletions

View File

@@ -8444,12 +8444,6 @@ power=2
toughness=2
[/card]
[card]
name=Cloudstone Curio
text=Whenever a nonartifact permanent enters the battlefield under your control, you may return another permanent you control that shares a card type with it to its owner's hand.
mana={1}
type=Artifact
[/card]
[card]
name=Clutch of the Undercity
target=*
auto=moveto(ownerhand)
@@ -50644,21 +50638,6 @@ type=Artifact
subtype=Equipment
[/card]
[card]
name=Vorosh the Hunter
#The comma needed to be stripped from the name to make the card work.
#Reintroducing it requires an update to PLC/_cards.dat as well.
#Please don't correct the card name by adding a "," because then the first auto line won't work anymore and even won't work when you add an "," there, too! (0.10.1)
abilities=flying
auto=aslongas(vorosh the hunter[attacking]|mybattlefield) lord(vorosh the hunter[attacking;-cloud]) {2}{G}:counter(1/1,6)
auto=@damaged(player) from(this):cloud
text=Flying -- Whenever Vorosh, the Hunter deals combat damage to a player, you may pay {2}{G}. If you do, put six +1/+1 counters on Vorosh.
mana={3}{G}{U}{B}
type=Legendary Creature
subtype=Dragon
power=6
toughness=6
[/card]
[card]
name=Votary of the Conclave
auto={2}{G}:regenerate
text={2}{G}: Regenerate Votary of the Conclave.

File diff suppressed because it is too large Load Diff

View File

@@ -142,9 +142,10 @@ class Constants
GRADE_SUPPORTED = 0,
GRADE_BORDERLINE = 1,
GRADE_CRAPPY = 2,
GRADE_UNSUPPORTED = 3,
GRADE_DANGEROUS = 4,
GRADE_UNOFFICIAL = 2,
GRADE_CRAPPY = 3,
GRADE_UNSUPPORTED = 4,
GRADE_DANGEROUS = 5,
};
static char MTGColorChars[];

View File

@@ -724,9 +724,10 @@ OptionMaxGrade OptionMaxGrade::mDef;
OptionMaxGrade::OptionMaxGrade(){
mDef.values.push_back(EnumDefinition::assoc(Constants::GRADE_SUPPORTED, "1: 100% Supported"));
mDef.values.push_back(EnumDefinition::assoc(Constants::GRADE_BORDERLINE, "0: Borderline (99% OK)"));
mDef.values.push_back(EnumDefinition::assoc(Constants::GRADE_CRAPPY, "-1: Crappy (bugs)"));
mDef.values.push_back(EnumDefinition::assoc(Constants::GRADE_UNSUPPORTED, "-2: Unsupported"));
mDef.values.push_back(EnumDefinition::assoc(Constants::GRADE_DANGEROUS, "-3: Dangerous (risk of crash)"));
mDef.values.push_back(EnumDefinition::assoc(Constants::GRADE_UNOFFICIAL, "-1: Unofficial (unverified cards)"));
mDef.values.push_back(EnumDefinition::assoc(Constants::GRADE_CRAPPY, "-2: Crappy (bugs)"));
mDef.values.push_back(EnumDefinition::assoc(Constants::GRADE_UNSUPPORTED, "-3: Unsupported"));
mDef.values.push_back(EnumDefinition::assoc(Constants::GRADE_DANGEROUS, "-4: Dangerous (risk of crash)"));
};
OptionClosedHand OptionClosedHand::mDef;

View File

@@ -22,11 +22,12 @@ using std::string;
static inline int getGrade(int v) {
switch (v) {
case 'S': case 's': return Constants::GRADE_SUPPORTED;
case 'B': case 'b': return Constants::GRADE_BORDERLINE;
case 'C': case 'c': return Constants::GRADE_CRAPPY;
case 'U': case 'u': return Constants::GRADE_UNSUPPORTED;
case 'D': case 'd': return Constants::GRADE_DANGEROUS;
case 'P': case 'p': return Constants::GRADE_SUPPORTED;
case 'R': case 'r': return Constants::GRADE_BORDERLINE;
case 'O': case 'o': return Constants::GRADE_UNOFFICIAL;
case 'A': case 'a': return Constants::GRADE_CRAPPY;
case 'S': case 's': return Constants::GRADE_UNSUPPORTED;
case 'N': case 'n': return Constants::GRADE_DANGEROUS;
}
return 0;
}
@@ -96,7 +97,7 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
break;
case 'g': //grade
currentGrade = getGrade(val[0]);
if (s.size() - i - 1 > 2) currentGrade = getGrade(val[2]);
break;
case 'k': //kicker
if (!primitive) primitive = NEW CardPrimitive();
@@ -233,6 +234,16 @@ int MTGAllCards::load(const char * config_file, const char * set_name,int autolo
if (s[0] == '['){
currentGrade = Constants::GRADE_SUPPORTED; // Default value
conf_read_mode = ('m' == s[1]) ? MTGAllCards::READ_METADATA : MTGAllCards::READ_CARD; // M for metadata.
} else {
//Global grade for file, to avoid reading the entire file if unnnecessary
if (s[0]=='g' && s.size() > 8) {
int fileGrade = getGrade(s[8]);
int maxGrade = options[Options::MAX_GRADE].number;
if (!maxGrade) maxGrade = Constants::GRADE_BORDERLINE; //Default setting for grade is borderline?
if (fileGrade > maxGrade) {
return total_cards;
}
}
}
continue;
case MTGAllCards::READ_METADATA: