Files
wagic/projects/mtg/include/AIHints.h
omegablast2002@yahoo.com 9ffe7349e2 added a hint that allows you to override how ai views a cards effects.
#HINT:good(icy prison)
ai will act as though the effects of this card are now good, choosing to cast it on it's own creatures.

#HINT:bad(ancestral recall)
ai will now use this card targeting the opponent. 
good in cases where you are trying to mill the opponent

the effects in wagic have gotten so complex that ai simply has no idea what some cards should target. this helps in most of the cases.
2013-04-10 02:38:52 +00:00

70 lines
2.1 KiB
C++

#ifndef _AIHINTS_H_
#define _AIHINTS_H_
#include <string>
#include <vector>
using std::string;
using std::vector;
#include "AIPlayerBaka.h"
#include "AllAbilities.h"
class ManaCost;
class MTGAbility;
class AIHint
{
public:
string mCondition;
string mAction;
string mCombatAttackTip;
string mCombatBlockTip;
string mCombatAlwaysBlockTip;
string mCombatAlwaysAttackTip;
string mCardEffGood;
string mCardEffBad;
vector<string>castOrder;
vector<string>combos;
//for preformance we disect the combo on first run.
vector<string>partOfCombo;
vector<string>hold;
vector<string>until;
vector<string>restrict;
vector<string>casting;
map<string,string>cardTargets;
string manaNeeded;
int mSourceId;
AIHint(string line);
};
class AIHints
{
protected:
AIPlayerBaka * mPlayer;
vector<AIHint *> hints;
AIHint * getByCondition (string condition);
AIAction * findAbilityRecursive(AIHint * hint, ManaCost * potentialMana);
vector<MTGAbility *> findAbilities(AIHint * hint);
RankingContainer findActions(AIHint * hint);
string constraintsNotFulfilled(AIAction * a, AIHint * hint, ManaCost * potentialMana);
bool findSource(int sourceId);
bool abilityMatches(MTGAbility * a, AIHint * hint);
public:
AIHints (AIPlayerBaka * player);
AIAction * suggestAbility(ManaCost * potentialMana);
bool HintSaysDontAttack(GameObserver* observer,MTGCardInstance * card = NULL);
bool HintSaysAlwaysAttack(GameObserver* observer,MTGCardInstance * card = NULL);
bool HintSaysDontBlock(GameObserver* observer,MTGCardInstance * card = NULL);
bool HintSaysAlwaysBlock(GameObserver* observer,MTGCardInstance * card = NULL);
bool AIHints::HintSaysCardIsGood(GameObserver* observer,MTGCardInstance * card);
bool AIHints::HintSaysCardIsBad(GameObserver* observer,MTGCardInstance * card);
bool HintSaysItsForCombo(GameObserver* observer,MTGCardInstance * card = NULL);
bool canWeCombo(GameObserver* observer,MTGCardInstance * card = NULL,AIPlayerBaka * Ai = NULL);
vector<string> mCastOrder();
void add(string line);
~AIHints();
};
#endif