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:
@@ -491,6 +491,7 @@ public:
|
||||
string name;
|
||||
AACounter(int id, MTGCardInstance * source, MTGCardInstance * target, const char * _name, int power, int toughness, int nb, ManaCost * cost = NULL, int doTap = 0) : ActivatedAbility(id, source, cost, 0, doTap), nb(nb), power(power), toughness(toughness), name(_name) {
|
||||
this->target = target;
|
||||
if(name.find("Level")) aType = MTGAbility::STANDARD_LEVELUP;
|
||||
}
|
||||
|
||||
|
||||
@@ -1693,7 +1694,7 @@ class AEquip:public TargetAbility{
|
||||
public:
|
||||
vector<MTGAbility *> currentAbilities;
|
||||
AEquip(int _id, MTGCardInstance * _source, ManaCost * _cost=NULL, int doTap=0, int restrictions = ActivatedAbility::AS_SORCERY):TargetAbility(_id,_source,NULL,_cost,restrictions,doTap){
|
||||
|
||||
aType = MTGAbility::STANDARD_EQUIP;
|
||||
}
|
||||
|
||||
int unequip(){
|
||||
@@ -2784,7 +2785,7 @@ class AADamagePrevent:public ActivatedAbilityTP{
|
||||
public:
|
||||
int preventing;
|
||||
AADamagePrevent(int _id, MTGCardInstance * _source, Targetable * _target,int preventing, ManaCost * _cost=NULL, int doTap = 0, int who = TargetChooser::UNSET):ActivatedAbilityTP(_id,_source,_target,_cost,doTap,who),preventing(preventing){
|
||||
//aType = MTGAbility::STANDARD_PREVENT;
|
||||
aType = MTGAbility::STANDARD_PREVENT;
|
||||
}
|
||||
|
||||
int resolve(){
|
||||
|
||||
@@ -90,7 +90,9 @@ class MTGAbility: public ActionElement{
|
||||
FLASHBACK_COST = 10,
|
||||
RETRACE_COST = 11,
|
||||
MTG_COMBATTRIGGERS_RULE = 12,
|
||||
//STANDARD_PREVENT = 13,
|
||||
STANDARD_PREVENT = 13,
|
||||
STANDARD_EQUIP = 14,
|
||||
STANDARD_LEVELUP = 15,
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ class MTGCard {
|
||||
int init();
|
||||
|
||||
public:
|
||||
|
||||
int LevelUp;
|
||||
int setId;
|
||||
CardPrimitive * data;
|
||||
|
||||
@@ -36,11 +36,13 @@ class MTGCard {
|
||||
|
||||
void setMTGId(int id);
|
||||
void setRarity(char _rarity);
|
||||
void setLevelcap(int _levelupcap);
|
||||
//void setImageName( char * value);
|
||||
void setPrimitive(CardPrimitive * cp);
|
||||
|
||||
int getMTGId() const;
|
||||
int getId() const;
|
||||
int getLevelcap() const;
|
||||
char getRarity() const;
|
||||
char * getImageName();
|
||||
};
|
||||
|
||||
@@ -85,6 +85,8 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable {
|
||||
int removeType(string value, int removeAll = 0);
|
||||
int removeType(int value, int removeAll = 0);
|
||||
|
||||
//dangerranking is a hint to Ai which creatures are the ones it should be targetting for effects.
|
||||
int DangerRanking();
|
||||
//Combat
|
||||
bool blocked; //Blocked this turn or not?
|
||||
MTGCardInstance * defenser;
|
||||
|
||||
Reference in New Issue
Block a user