Erwan
- AI:increased percentage of chance to play an "unknown" Card - removed delay before displaying big card ingame - added 2 new AI Decks - Fixed a bug with afflict (see tests/afflict.txt)
This commit is contained in:
67
projects/mtg/bin/Res/ai/baka/deck14.txt
Normal file
67
projects/mtg/bin/Res/ai/baka/deck14.txt
Normal file
@@ -0,0 +1,67 @@
|
||||
#Blue Deck, with Persusasion
|
||||
#28 Islands
|
||||
176428
|
||||
176428
|
||||
176428
|
||||
176428
|
||||
176428
|
||||
176428
|
||||
176428
|
||||
158237
|
||||
158237
|
||||
158237
|
||||
158237
|
||||
158237
|
||||
158237
|
||||
158237
|
||||
157875
|
||||
157875
|
||||
157875
|
||||
157875
|
||||
157875
|
||||
157875
|
||||
157875
|
||||
157883
|
||||
157883
|
||||
157883
|
||||
157883
|
||||
157883
|
||||
157883
|
||||
157883
|
||||
#4persusasion
|
||||
129900
|
||||
129900
|
||||
129900
|
||||
129900
|
||||
#4Boomerang
|
||||
129494
|
||||
129494
|
||||
129494
|
||||
129494
|
||||
#2Lord of Atlantis
|
||||
1206
|
||||
1206
|
||||
#2Merfolk
|
||||
1210
|
||||
1210
|
||||
#4Gravelgill
|
||||
141935
|
||||
141935
|
||||
141935
|
||||
141935
|
||||
#4Unsummon
|
||||
136218
|
||||
136218
|
||||
136218
|
||||
136218
|
||||
#4Counsel of the Soratami
|
||||
134757
|
||||
134757
|
||||
134757
|
||||
134757
|
||||
#2Air Elemental
|
||||
129459
|
||||
129459
|
||||
#2 Mahamoti djinn
|
||||
129633
|
||||
129633
|
||||
69
projects/mtg/bin/Res/ai/baka/deck15.txt
Normal file
69
projects/mtg/bin/Res/ai/baka/deck15.txt
Normal file
@@ -0,0 +1,69 @@
|
||||
#Black Deck, Rats
|
||||
#26 Swamps
|
||||
157886
|
||||
157886
|
||||
157886
|
||||
157886
|
||||
157886
|
||||
157871
|
||||
157871
|
||||
157871
|
||||
157871
|
||||
157871
|
||||
157871
|
||||
157871
|
||||
158239
|
||||
158239
|
||||
158239
|
||||
158239
|
||||
158239
|
||||
158239
|
||||
158239
|
||||
157889
|
||||
157889
|
||||
157889
|
||||
157889
|
||||
157889
|
||||
157889
|
||||
157889
|
||||
#4plague rats
|
||||
1173
|
||||
1173
|
||||
1173
|
||||
1173
|
||||
#4plague beetle
|
||||
129678
|
||||
129678
|
||||
129678
|
||||
129678
|
||||
#12 relentless rats
|
||||
135236
|
||||
135236
|
||||
135236
|
||||
135236
|
||||
135236
|
||||
135236
|
||||
135236
|
||||
135236
|
||||
135236
|
||||
135236
|
||||
135236
|
||||
135236
|
||||
#4Oona's Gatewarden
|
||||
141975
|
||||
141975
|
||||
141975
|
||||
141975
|
||||
#4Fear
|
||||
129544
|
||||
129544
|
||||
129544
|
||||
129544
|
||||
#Ascendant Evincar
|
||||
106525
|
||||
106525
|
||||
#4rain of tears
|
||||
135220
|
||||
135220
|
||||
135220
|
||||
135220
|
||||
@@ -1204,7 +1204,7 @@ subtype=Aura
|
||||
[card]
|
||||
text=Relentless Rats gets +1/+1 for each other creature in play named Relentless Rats. A deck can have any number of cards named Relentless Rats.
|
||||
id=135236
|
||||
auto=champion(name:Relentless Rats)
|
||||
auto=foreach(name:Relentless Rats)
|
||||
name=Relentless Rats
|
||||
rarity=U
|
||||
color=Black
|
||||
|
||||
@@ -1581,7 +1581,7 @@ subtype=Plains Mountain
|
||||
text=Plague Rats's power and toughness are each equal to the number of creatures named Plague Rats in play.
|
||||
id=1173
|
||||
name=Plague Rats
|
||||
auto=champion(name:Plague Rats)
|
||||
auto=foreach(name:Plague Rats)
|
||||
rarity=C
|
||||
color=Black
|
||||
type=Creature
|
||||
|
||||
@@ -11,6 +11,7 @@ generic/wither.txt
|
||||
########################
|
||||
#Specific Cards
|
||||
########################
|
||||
afflict.txt
|
||||
anarchy.txt
|
||||
animate_dead.txt
|
||||
animate_dead2.txt
|
||||
|
||||
37
projects/mtg/bin/Res/test/afflict.txt
Normal file
37
projects/mtg/bin/Res/test/afflict.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
#Make sure afflict does -1/-1 and makes you draw a card
|
||||
[INIT]
|
||||
FIRSTMAIN
|
||||
[PLAYER1]
|
||||
hand:135206
|
||||
inplay:2455
|
||||
library:129580
|
||||
manapool:{B}{2}
|
||||
[PLAYER2]
|
||||
inplay:129586
|
||||
[DO]
|
||||
135206
|
||||
129586
|
||||
next
|
||||
#combat begin
|
||||
next
|
||||
#attackers
|
||||
2455
|
||||
next
|
||||
#blockers
|
||||
129586
|
||||
next
|
||||
#damage
|
||||
next
|
||||
#combat end
|
||||
[ASSERT]
|
||||
COMBATEND
|
||||
[PLAYER1]
|
||||
hand:129580
|
||||
graveyard:135206
|
||||
inplay:2455
|
||||
manapool:{0}
|
||||
life:20
|
||||
[PLAYER2]
|
||||
graveyard:129586
|
||||
life:20
|
||||
[END]
|
||||
@@ -229,11 +229,11 @@ int AIPlayer::chooseAttackers(){
|
||||
int opponentCreatures = getCreaturesInfo(opponent(), INFO_NBCREATURES);
|
||||
int myForce = getCreaturesInfo(this,INFO_CREATURESPOWER,-1,1);
|
||||
int myCreatures = getCreaturesInfo(this, INFO_NBCREATURES, -1,1);
|
||||
bool attack = (myCreatures > opponentCreatures || myForce > opponentForce || myForce > 2*opponent()->life);
|
||||
bool attack = ((myCreatures > opponentCreatures) || (myForce > opponentForce) || (myForce > 2*opponent()->life));
|
||||
if (attack){
|
||||
CardDescriptor cd;
|
||||
cd.init();
|
||||
cd.setType("Creature");
|
||||
cd.setType("creature");
|
||||
MTGCardInstance * card = NULL;
|
||||
while((card = cd.nextmatch(game->inPlay, card))){
|
||||
GameObserver::GetInstance()->cardClick(card);
|
||||
@@ -433,7 +433,7 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * potentialMana, const c
|
||||
if (shouldPlay == BAKA_EFFECT_GOOD){
|
||||
shouldPlayPercentage = 90;
|
||||
}else if(BAKA_EFFECT_DONTKNOW == shouldPlay){
|
||||
shouldPlayPercentage = 70;
|
||||
shouldPlayPercentage = 80;
|
||||
}
|
||||
if (rand() % 100 > shouldPlayPercentage) continue;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,12 @@ void DeckStats::save(const char * filename){
|
||||
|
||||
void DeckStats::saveStats(Player *player, Player *opponent, GameObserver * game){
|
||||
int victory = 1;
|
||||
if (game->gameOver == player) victory = 0;
|
||||
if (!game->gameOver){
|
||||
if (player->life == opponent->life) return;
|
||||
if (player->life < opponent->life) victory = 0;
|
||||
}else if (game->gameOver == player) {
|
||||
victory = 0;
|
||||
}
|
||||
load(player);
|
||||
map<string,DeckStat *>::iterator it = stats.find(opponent->deckFile);
|
||||
if (it == stats.end()){
|
||||
|
||||
@@ -154,13 +154,13 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
}
|
||||
}
|
||||
|
||||
//Champion. Very basic, needs to be improved !
|
||||
found = s.find("champion(name:");
|
||||
//foreach. Very basic, needs to be improved !
|
||||
found = s.find("foreach(name:");
|
||||
if (found != string::npos){
|
||||
if (dryMode) return BAKA_EFFECT_GOOD;
|
||||
unsigned int end = s.find(")", found+14);
|
||||
unsigned int end = s.find(")", found+13);
|
||||
if (end != string::npos){
|
||||
string type = s.substr(found+14,end-found-14).c_str();
|
||||
string type = s.substr(found+13,end-found-13).c_str();
|
||||
game->addObserver(NEW APlagueRats(id,card,type.c_str()));
|
||||
result++;
|
||||
continue;
|
||||
@@ -365,7 +365,8 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
found = s.find("/");
|
||||
if (found != string::npos){
|
||||
unsigned int start = s.find(":");
|
||||
if (start == string::npos) start = found-2;
|
||||
if (start == string::npos) start = s.find(" ");
|
||||
if (start == string::npos) start = -1;
|
||||
int power = atoi(s.substr(start+1,size-found).c_str());
|
||||
unsigned int end = s.find(" ",start);
|
||||
int toughness;
|
||||
|
||||
@@ -234,13 +234,13 @@ int MTGAllCards::readConfLine(std::ifstream &file, int set_id){
|
||||
if (s[s.size()-1] == '\r') s.erase(s.size()-1); //Handle DOS files
|
||||
switch(conf_read_mode) {
|
||||
case 0:
|
||||
if (s.find("[card]") != string::npos){
|
||||
if (s[0] == '['){
|
||||
collection[total_cards] = NEW MTGCard(mCache,set_id);
|
||||
conf_read_mode = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (s.find("[/card]") != string::npos){
|
||||
if (s[0] == '[' && s[1] == '/'){
|
||||
conf_read_mode = 0;
|
||||
total_cards++;
|
||||
}else{
|
||||
|
||||
@@ -358,7 +358,7 @@ void MTGGuiPlay::Render(){
|
||||
|
||||
if (mCount && mObjects[mCurr] != NULL){
|
||||
mObjects[mCurr]->Render();
|
||||
if (hasFocus && mCurr >= offset && showBigCards && last_user_move > BIG_CARD_RENDER_TIME){
|
||||
if (hasFocus && mCurr >= offset && showBigCards){
|
||||
((CardGui *)mObjects[mCurr])->RenderBig(-1,-1,showBigCards-1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user