taught Ai how to use levelup creatures, taught Ai how to use Equip, taught Ai how to use prevent the cleric ability.

this is by no means absolutely perfect, i like it tho, and makes for some real good times with level up deck built with equips. 

you will notice i added a level=number...to the level up creatures, this has no effect on players, this is just a small hint to the Ai as to when it should stop investing mana in that creature. the chances are a little over half that ai will want to level a creature, increased ever so slightly with each level up.

for equipment, the Ai will now want to equip its best Creature(determined by power+toughness+convertedcost+how many abilities it has) and will want to equip these "better" cards atleast 2 times before it is reduced. same system for prevent damage, it will want to save its "better creature" more then a 1/1 token.

for both tho i added slight bonuses...
to equip, there is a higher chance that the ai will want to target a white creature, with an extra bonus if the creature is a 1/1 and nontoken. this is to encourage Ai to equip in white weenie decks

in prevent, there is a slight bonus if the creature is a 1/1 and the blocker/blockee has a power of 1. 

currently prevent damage treated this way is not coded for direct damage spell, sorry ! but for combat you will notice ai taking a stand and fighting back hard.
This commit is contained in:
omegablast2002@yahoo.com
2010-10-23 22:34:07 +00:00
parent ba590395b1
commit a9e4c58af2
9 changed files with 108 additions and 20 deletions
+22
View File
@@ -457,6 +457,28 @@ MTGCardInstance * MTGCardInstance::getNextPartner(){
return NULL;
}
int MTGCardInstance::DangerRanking(){
int danger;
int result;
danger = 0;
result = 0;
result += power;
result += toughness;
result += getManaCost()->getConvertedCost();
for (int j = 0; j < Constants::NB_BASIC_ABILITIES; j++){
if(basicAbilities[j])
{
result += 1;
}
}
if(result > 1) danger += 1;
if(result > 2) danger += 1;
if(result > 4) danger += 1;
if(result > 6) danger += 1;
if(result > 10) danger += 1;
return danger;
}
int MTGCardInstance::setAttacker(int value){
Targetable * previousTarget = NULL;
Targetable * target = NULL;