replaced tabs with 4 spaces.
This commit is contained in:
@@ -15,10 +15,10 @@ typedef enum
|
|||||||
GAME_TYPE_MOMIR,
|
GAME_TYPE_MOMIR,
|
||||||
GAME_TYPE_RANDOM1,
|
GAME_TYPE_RANDOM1,
|
||||||
GAME_TYPE_RANDOM2,
|
GAME_TYPE_RANDOM2,
|
||||||
GAME_TYPE_RANDOM3,
|
GAME_TYPE_RANDOM3,
|
||||||
GAME_TYPE_RANDOM5,
|
GAME_TYPE_RANDOM5,
|
||||||
GAME_TYPE_HORDE,
|
GAME_TYPE_HORDE,
|
||||||
GAME_TYPE_SET_LIMITED,
|
GAME_TYPE_SET_LIMITED,
|
||||||
GAME_TYPE_STORY,
|
GAME_TYPE_STORY,
|
||||||
GAME_TYPE_DEMO,
|
GAME_TYPE_DEMO,
|
||||||
GAME_TYPE_STONEHEWER,
|
GAME_TYPE_STONEHEWER,
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ protected:
|
|||||||
Player * loadPlayerMomir(GameObserver* observer, int isAI);
|
Player * loadPlayerMomir(GameObserver* observer, int isAI);
|
||||||
Player * loadPlayerRandom(GameObserver* observer, int isAI, int mode);
|
Player * loadPlayerRandom(GameObserver* observer, int isAI, int mode);
|
||||||
Player * loadPlayerRandomThree(GameObserver* observer, int isAI);
|
Player * loadPlayerRandomThree(GameObserver* observer, int isAI);
|
||||||
Player * loadPlayerRandomFive(GameObserver* observer, int isAI);
|
Player * loadPlayerRandomFive(GameObserver* observer, int isAI);
|
||||||
Player * loadPlayerHorde(GameObserver* observer, int isAI);
|
Player * loadPlayerHorde(GameObserver* observer, int isAI);
|
||||||
Player * loadRandomSetLimited(GameObserver* observer, int isAI);
|
Player * loadRandomSetLimited(GameObserver* observer, int isAI);
|
||||||
Player * initPlayer(GameObserver *observer, int playerId);
|
Player * initPlayer(GameObserver *observer, int playerId);
|
||||||
MTGDeck * buildDeck(int playerId);
|
MTGDeck * buildDeck(int playerId);
|
||||||
GameType strToGameMode(string s);
|
GameType strToGameMode(string s);
|
||||||
|
|||||||
@@ -31,5 +31,3 @@ Author: Michael Nguyen
|
|||||||
#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases/download/" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME
|
#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases/download/" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,15 +46,15 @@ int OrderedAIAction::getEfficiency(AADamager * aad)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(p && target)
|
if(p && target)
|
||||||
if(p == target->controller())
|
if(p == target->controller())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (dTarget && aad && (aad->getDamage() == dTarget->toughness))
|
if (dTarget && aad && (aad->getDamage() == dTarget->toughness))
|
||||||
return 100;
|
return 100;
|
||||||
else if (dTarget && aad && (aad->getDamage() > dTarget->toughness))
|
else if (dTarget && aad && (aad->getDamage() > dTarget->toughness))
|
||||||
return 10 * (10 - (aad->getDamage() - dTarget->toughness)); //less eff the more dmg above toughness
|
return 10 * (10 - (aad->getDamage() - dTarget->toughness)); //less eff the more dmg above toughness
|
||||||
else
|
else
|
||||||
return 10;
|
return 10;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -131,7 +131,7 @@ int OrderedAIAction::getEfficiency()
|
|||||||
{
|
{
|
||||||
efficiency = 95;
|
efficiency = 95;
|
||||||
}
|
}
|
||||||
//TODO If the card is the target of a damage spell
|
//TODO If the card is the target of a damage spell
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MTGAbility::STANDARD_PREVENT:
|
case MTGAbility::STANDARD_PREVENT:
|
||||||
@@ -273,7 +273,7 @@ int OrderedAIAction::getEfficiency()
|
|||||||
}
|
}
|
||||||
case MTGAbility::STANDARD_PUMP:
|
case MTGAbility::STANDARD_PUMP:
|
||||||
{
|
{
|
||||||
efficiency = 0;
|
efficiency = 0;
|
||||||
if(!coreAbilityCardTarget)
|
if(!coreAbilityCardTarget)
|
||||||
break;
|
break;
|
||||||
if(!target && !dynamic_cast<ALord*> (a) && (((MTGCardInstance *)a->source)->hasSubtype(Subtypes::TYPE_AURA) || ((MTGCardInstance *)a->source)->hasSubtype(Subtypes::TYPE_EQUIPMENT)))
|
if(!target && !dynamic_cast<ALord*> (a) && (((MTGCardInstance *)a->source)->hasSubtype(Subtypes::TYPE_AURA) || ((MTGCardInstance *)a->source)->hasSubtype(Subtypes::TYPE_EQUIPMENT)))
|
||||||
@@ -282,10 +282,10 @@ int OrderedAIAction::getEfficiency()
|
|||||||
coreAbilityCardTarget = a->source->target; //TODO use intermediate value?
|
coreAbilityCardTarget = a->source->target; //TODO use intermediate value?
|
||||||
target = a->source;
|
target = a->source;
|
||||||
}
|
}
|
||||||
else //if(how to know cards like Basking Rootwalla that pump themselves)
|
else //if(how to know cards like Basking Rootwalla that pump themselves)
|
||||||
{
|
{
|
||||||
target = a->source;
|
target = a->source;
|
||||||
}
|
}
|
||||||
if (!target && !dynamic_cast<ALord*> (a))
|
if (!target && !dynamic_cast<ALord*> (a))
|
||||||
break;
|
break;
|
||||||
if(dynamic_cast<ALord*> (a) && !target)
|
if(dynamic_cast<ALord*> (a) && !target)
|
||||||
@@ -297,9 +297,9 @@ int OrderedAIAction::getEfficiency()
|
|||||||
int suggestion = af.abilityEfficiency(a, p, MODE_ABILITY);
|
int suggestion = af.abilityEfficiency(a, p, MODE_ABILITY);
|
||||||
//i do not set a starting eff. on this ability, this allows Ai to sometimes randomly do it as it normally does.
|
//i do not set a starting eff. on this ability, this allows Ai to sometimes randomly do it as it normally does.
|
||||||
int currentPhase = g->getCurrentGamePhase();
|
int currentPhase = g->getCurrentGamePhase();
|
||||||
if ((currentPhase == MTG_PHASE_COMBATBLOCKERS) || (currentPhase == MTG_PHASE_COMBATATTACKERS))
|
if ((currentPhase == MTG_PHASE_COMBATBLOCKERS) || (currentPhase == MTG_PHASE_COMBATATTACKERS))
|
||||||
{
|
{
|
||||||
if (suggestion == BAKA_EFFECT_GOOD && target->controller() == p)
|
if (suggestion == BAKA_EFFECT_GOOD && target->controller() == p)
|
||||||
{
|
{
|
||||||
if(coreAbilityCardTarget->defenser || coreAbilityCardTarget->blockers.size())
|
if(coreAbilityCardTarget->defenser || coreAbilityCardTarget->blockers.size())
|
||||||
{
|
{
|
||||||
@@ -332,41 +332,41 @@ int OrderedAIAction::getEfficiency()
|
|||||||
{
|
{
|
||||||
if(!coreAbilityCardTarget)
|
if(!coreAbilityCardTarget)
|
||||||
break;
|
break;
|
||||||
// It used to skip most effects, with no other condition efficiency is -1
|
// It used to skip most effects, with no other condition efficiency is -1
|
||||||
// Becomes is generally good so setting a value, but don't want to spam it
|
// Becomes is generally good so setting a value, but don't want to spam it
|
||||||
if (coreAbilityCardTarget && !coreAbilityCardTarget->isLand())
|
if (coreAbilityCardTarget && !coreAbilityCardTarget->isLand())
|
||||||
{
|
{
|
||||||
// Bonus if almost no cards in hand
|
// Bonus if almost no cards in hand
|
||||||
if (p->game->hand->nb_cards <= 1)
|
if (p->game->hand->nb_cards <= 1)
|
||||||
{
|
{
|
||||||
efficiency = 50;
|
efficiency = 50;
|
||||||
}
|
}
|
||||||
else efficiency = 30;
|
else efficiency = 30;
|
||||||
}
|
}
|
||||||
//nothing huge here, just ensuring that Ai makes his noncreature becomers into creatures during first main, so it can actually use them in combat.
|
//nothing huge here, just ensuring that Ai makes his noncreature becomers into creatures during first main, so it can actually use them in combat.
|
||||||
if (coreAbilityCardTarget && !coreAbilityCardTarget->isCreature() && !coreAbilityCardTarget->isTapped() && currentPhase == MTG_PHASE_FIRSTMAIN)
|
if (coreAbilityCardTarget && !coreAbilityCardTarget->isCreature() && !coreAbilityCardTarget->isTapped() && currentPhase == MTG_PHASE_FIRSTMAIN)
|
||||||
{
|
{
|
||||||
efficiency = 50;
|
efficiency = 50;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MTGAbility::MANA_PRODUCER://only way to hit this condition is nested manaabilities, ai skips manaproducers by defualt when finding an ability to use.
|
case MTGAbility::MANA_PRODUCER://only way to hit this condition is nested manaabilities, ai skips manaproducers by defualt when finding an ability to use.
|
||||||
{
|
{
|
||||||
AManaProducer * manamaker = dynamic_cast<AManaProducer*>(a);
|
AManaProducer * manamaker = dynamic_cast<AManaProducer*>(a);
|
||||||
GenericActivatedAbility * GAA = dynamic_cast<GenericActivatedAbility*>(ability);
|
GenericActivatedAbility * GAA = dynamic_cast<GenericActivatedAbility*>(ability);
|
||||||
if(GAA)
|
if(GAA)
|
||||||
{
|
{
|
||||||
AForeach * forMana = dynamic_cast<AForeach*>(GAA->ability);
|
AForeach * forMana = dynamic_cast<AForeach*>(GAA->ability);
|
||||||
if (manamaker && forMana)
|
if (manamaker && forMana)
|
||||||
{
|
{
|
||||||
int outPut = forMana->checkActivation();
|
int outPut = forMana->checkActivation();
|
||||||
if (ability->getCost() && outPut > int(ability->getCost()->getConvertedCost() +1) && currentPhase == MTG_PHASE_FIRSTMAIN && ability->source->controller()->game->hand->nb_cards > 1)
|
if (ability->getCost() && outPut > int(ability->getCost()->getConvertedCost() +1) && currentPhase == MTG_PHASE_FIRSTMAIN && ability->source->controller()->game->hand->nb_cards > 1)
|
||||||
efficiency = 60;//might be a bit random, but better than never using them.
|
efficiency = 60;//might be a bit random, but better than never using them.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
efficiency = 0;
|
efficiency = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MTGAbility::STANDARDABILITYGRANT:
|
case MTGAbility::STANDARDABILITYGRANT:
|
||||||
{
|
{
|
||||||
@@ -446,7 +446,7 @@ int OrderedAIAction::getEfficiency()
|
|||||||
case MTGAbility::LIFER:
|
case MTGAbility::LIFER:
|
||||||
{
|
{
|
||||||
//use life abilities whenever possible. Well yes, but actually no
|
//use life abilities whenever possible. Well yes, but actually no
|
||||||
//limits mana and in case of Zuran Orb it just sacrifices all lands
|
//limits mana and in case of Zuran Orb it just sacrifices all lands
|
||||||
AALifer * alife = (AALifer *) a;
|
AALifer * alife = (AALifer *) a;
|
||||||
Targetable * _t = alife->getTarget();
|
Targetable * _t = alife->getTarget();
|
||||||
|
|
||||||
@@ -587,10 +587,10 @@ int OrderedAIAction::getEfficiency()
|
|||||||
if (z == p->game->hand)
|
if (z == p->game->hand)
|
||||||
efficiency = 10 + (owner->getRandomGenerator()->random() % 10);//random chance to bounce their own card;
|
efficiency = 10 + (owner->getRandomGenerator()->random() % 10);//random chance to bounce their own card;
|
||||||
}
|
}
|
||||||
// We don't want to return cards in play to own hand, save rare combos
|
// We don't want to return cards in play to own hand, save rare combos
|
||||||
else if(target->currentZone == p->game->inPlay)
|
else if(target->currentZone == p->game->inPlay)
|
||||||
{
|
{
|
||||||
if (z == p->game->hand || z == p->game->library)
|
if (z == p->game->hand || z == p->game->library)
|
||||||
efficiency = (owner->getRandomGenerator()->random() % 10);//random chance to bounce their own card;
|
efficiency = (owner->getRandomGenerator()->random() % 10);//random chance to bounce their own card;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -600,10 +600,10 @@ int OrderedAIAction::getEfficiency()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// We don't want to return the ability source cards that are in play to own hand, save rare combos
|
// We don't want to return the ability source cards that are in play to own hand, save rare combos
|
||||||
// cards like Blinking Spirit used to be auto lose for AI
|
// cards like Blinking Spirit used to be auto lose for AI
|
||||||
if(z == p->game->hand || z == p->game->library)
|
if(z == p->game->hand || z == p->game->library)
|
||||||
efficiency = 1;
|
efficiency = 1;
|
||||||
else efficiency = 50;
|
else efficiency = 50;
|
||||||
//may abilities target the source until thier nested ability is activated, so 50% chance to use this
|
//may abilities target the source until thier nested ability is activated, so 50% chance to use this
|
||||||
//mover, until we can come up with something more elegent....
|
//mover, until we can come up with something more elegent....
|
||||||
@@ -682,11 +682,11 @@ int OrderedAIAction::getEfficiency()
|
|||||||
for(unsigned int i = 0; i < ec->costs.size();i++)
|
for(unsigned int i = 0; i < ec->costs.size();i++)
|
||||||
{
|
{
|
||||||
ExtraCost * tapper = dynamic_cast<TapCost*>(ec->costs[i]);
|
ExtraCost * tapper = dynamic_cast<TapCost*>(ec->costs[i]);
|
||||||
ExtraCost * sacrifice = dynamic_cast<SacrificeCost*>(ec->costs[i]);
|
ExtraCost * sacrifice = dynamic_cast<SacrificeCost*>(ec->costs[i]);
|
||||||
if(tapper)
|
if(tapper)
|
||||||
continue;
|
continue;
|
||||||
else if(sacrifice)
|
else if(sacrifice)
|
||||||
efficiency = efficiency / 3;
|
efficiency = efficiency / 3;
|
||||||
else
|
else
|
||||||
efficiency = efficiency / 2;
|
efficiency = efficiency / 2;
|
||||||
}
|
}
|
||||||
@@ -706,20 +706,20 @@ int OrderedAIAction::getEfficiency()
|
|||||||
efficiency += 55;
|
efficiency += 55;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ability->source)
|
if (ability->source)
|
||||||
{
|
{
|
||||||
if(ability->source->hasType(Subtypes::TYPE_PLANESWALKER))
|
if(ability->source->hasType(Subtypes::TYPE_PLANESWALKER))
|
||||||
efficiency += 40;
|
efficiency += 40;
|
||||||
else if(ability->source->hasType(Subtypes::TYPE_LAND))
|
else if(ability->source->hasType(Subtypes::TYPE_LAND))
|
||||||
{ // probably a shockland, don't pay life if hand is empty
|
{ // probably a shockland, don't pay life if hand is empty
|
||||||
if (p->life<=2)
|
if (p->life<=2)
|
||||||
// check that's not a manland(like Celestial Colonnade)
|
// check that's not a manland(like Celestial Colonnade)
|
||||||
if(efficiency < 50)
|
if(efficiency < 50)
|
||||||
efficiency = 0;
|
efficiency = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SAFE_DELETE(transAbility);
|
SAFE_DELETE(transAbility);
|
||||||
return efficiency;
|
return efficiency;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2374,9 +2374,9 @@ int AIPlayerBaka::chooseTarget(TargetChooser * _tc, Player * forceTarget,MTGCard
|
|||||||
cardEffect = af.abilityEfficiency(withoutGuessing,this,MODE_TARGET,tc,NULL);
|
cardEffect = af.abilityEfficiency(withoutGuessing,this,MODE_TARGET,tc,NULL);
|
||||||
delete withoutGuessing;
|
delete withoutGuessing;
|
||||||
}
|
}
|
||||||
// Don't really like it but green mana producing auras targeting the player is one of the most reported bugs
|
// Don't really like it but green mana producing auras targeting the player is one of the most reported bugs
|
||||||
if(cardEffect == BAKA_EFFECT_DONTKNOW && tc->source->hasSubtype(Subtypes::TYPE_AURA) && tc->source->hasColor(Constants::MTG_COLOR_GREEN))
|
if(cardEffect == BAKA_EFFECT_DONTKNOW && tc->source->hasSubtype(Subtypes::TYPE_AURA) && tc->source->hasColor(Constants::MTG_COLOR_GREEN))
|
||||||
cardEffect = BAKA_EFFECT_GOOD;
|
cardEffect = BAKA_EFFECT_GOOD;
|
||||||
|
|
||||||
if (cardEffect != BAKA_EFFECT_GOOD)
|
if (cardEffect != BAKA_EFFECT_GOOD)
|
||||||
{
|
{
|
||||||
@@ -2560,7 +2560,7 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty
|
|||||||
{
|
{
|
||||||
nextCardToPlay = comboCards.back();
|
nextCardToPlay = comboCards.back();
|
||||||
gotPayments.clear();
|
gotPayments.clear();
|
||||||
if((!pMana->canAfford(nextCardToPlay->getManaCost()) || nextCardToPlay->getManaCost()->getKicker() || nextCardToPlay->getManaCost()->getBestow()))
|
if((!pMana->canAfford(nextCardToPlay->getManaCost()) || nextCardToPlay->getManaCost()->getKicker() || nextCardToPlay->getManaCost()->getBestow()))
|
||||||
gotPayments = canPayMana(nextCardToPlay,nextCardToPlay->getManaCost());
|
gotPayments = canPayMana(nextCardToPlay,nextCardToPlay->getManaCost());
|
||||||
DebugTrace("ai is doing a combo:" << nextCardToPlay->getName());
|
DebugTrace("ai is doing a combo:" << nextCardToPlay->getName());
|
||||||
comboCards.pop_back();
|
comboCards.pop_back();
|
||||||
@@ -2574,175 +2574,175 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty
|
|||||||
card = NULL;
|
card = NULL;
|
||||||
gotPayments = vector<MTGAbility*>();
|
gotPayments = vector<MTGAbility*>();
|
||||||
//canplayfromgraveyard
|
//canplayfromgraveyard
|
||||||
while ((card = cd.nextmatch(game->graveyard, card)))
|
while ((card = cd.nextmatch(game->graveyard, card)))
|
||||||
{
|
{
|
||||||
bool hasFlashback = false;
|
bool hasFlashback = false;
|
||||||
|
|
||||||
if(card->getManaCost())
|
if(card->getManaCost())
|
||||||
if(card->getManaCost()->getFlashback())
|
if(card->getManaCost()->getFlashback())
|
||||||
hasFlashback = true;
|
hasFlashback = true;
|
||||||
|
|
||||||
if( card->has(Constants::CANPLAYFROMGRAVEYARD) || card->has(Constants::TEMPFLASHBACK) || hasFlashback )
|
if( card->has(Constants::CANPLAYFROMGRAVEYARD) || card->has(Constants::TEMPFLASHBACK) || hasFlashback )
|
||||||
{
|
{
|
||||||
if (!CanHandleCost(card->getManaCost(),card))
|
if (!CanHandleCost(card->getManaCost(),card))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (hasFlashback && !CanHandleCost(card->getManaCost()->getFlashback(),card))
|
if (hasFlashback && !CanHandleCost(card->getManaCost()->getFlashback(),card))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Case were manacost is equal to flashback cost, if they are different the AI hangs
|
// Case were manacost is equal to flashback cost, if they are different the AI hangs
|
||||||
if (hasFlashback && (card->getManaCost() != card->getManaCost()->getFlashback()) )
|
if (hasFlashback && (card->getManaCost() != card->getManaCost()->getFlashback()) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (card->hasType(Subtypes::TYPE_LAND))
|
if (card->hasType(Subtypes::TYPE_LAND))
|
||||||
{
|
{
|
||||||
if (game->playRestrictions->canPutIntoZone(card, game->inPlay) == PlayRestriction::CANT_PLAY)
|
if (game->playRestrictions->canPutIntoZone(card, game->inPlay) == PlayRestriction::CANT_PLAY)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (game->playRestrictions->canPutIntoZone(card, game->stack) == PlayRestriction::CANT_PLAY)
|
if (game->playRestrictions->canPutIntoZone(card, game->stack) == PlayRestriction::CANT_PLAY)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (card->hasType(Subtypes::TYPE_LEGENDARY) && game->inPlay->findByName(card->name))
|
if (card->hasType(Subtypes::TYPE_LEGENDARY) && game->inPlay->findByName(card->name))
|
||||||
continue;
|
continue;
|
||||||
//glimmervoid alias to avoid ai stalling the game as the hint combo is stuck
|
//glimmervoid alias to avoid ai stalling the game as the hint combo is stuck
|
||||||
//next card to play was galvanic blast but on activate combo it clashes with glimmervoid...
|
//next card to play was galvanic blast but on activate combo it clashes with glimmervoid...
|
||||||
if ((card->alias == 48132) && (card->controller()->game->inPlay->countByType("artifact") < 1))
|
if ((card->alias == 48132) && (card->controller()->game->inPlay->countByType("artifact") < 1))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (card->has(Constants::TREASON) && observer->getCurrentGamePhase() != MTG_PHASE_FIRSTMAIN)
|
if (card->has(Constants::TREASON) && observer->getCurrentGamePhase() != MTG_PHASE_FIRSTMAIN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (card->hasType(Subtypes::TYPE_PLANESWALKER) && card->types.size() > 0 && game->inPlay->hasTypeSpecificInt(Subtypes::TYPE_PLANESWALKER,card->types[1]))
|
if (card->hasType(Subtypes::TYPE_PLANESWALKER) && card->types.size() > 0 && game->inPlay->hasTypeSpecificInt(Subtypes::TYPE_PLANESWALKER,card->types[1]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(hints && hints->HintSaysItsForCombo(observer,card))
|
if(hints && hints->HintSaysItsForCombo(observer,card))
|
||||||
{
|
{
|
||||||
if(hints->canWeCombo(observer,card,this))
|
if(hints->canWeCombo(observer,card,this))
|
||||||
{
|
{
|
||||||
AbilityFactory af(observer);
|
AbilityFactory af(observer);
|
||||||
int canPlay = af.parseCastRestrictions(card,card->controller(),card->getRestrictions());
|
int canPlay = af.parseCastRestrictions(card,card->controller(),card->getRestrictions());
|
||||||
if(!canPlay)
|
if(!canPlay)
|
||||||
continue;
|
continue;
|
||||||
nextCardToPlay = card;
|
nextCardToPlay = card;
|
||||||
gotPayments.clear();
|
gotPayments.clear();
|
||||||
if((!pMana->canAfford(nextCardToPlay->getManaCost()) || nextCardToPlay->getManaCost()->getKicker()))
|
if((!pMana->canAfford(nextCardToPlay->getManaCost()) || nextCardToPlay->getManaCost()->getKicker()))
|
||||||
gotPayments = canPayMana(nextCardToPlay,nextCardToPlay->getManaCost());
|
gotPayments = canPayMana(nextCardToPlay,nextCardToPlay->getManaCost());
|
||||||
return activateCombo();
|
return activateCombo();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nextCardToPlay = NULL;
|
nextCardToPlay = NULL;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int currentCost = card->getManaCost()->getConvertedCost();
|
int currentCost = card->getManaCost()->getConvertedCost();
|
||||||
int hasX = card->getManaCost()->hasX();
|
int hasX = card->getManaCost()->hasX();
|
||||||
gotPayments.clear();
|
gotPayments.clear();
|
||||||
if((!pMana->canAfford(card->getManaCost()) || card->getManaCost()->getKicker()))
|
if((!pMana->canAfford(card->getManaCost()) || card->getManaCost()->getKicker()))
|
||||||
gotPayments = canPayMana(card,card->getManaCost());
|
gotPayments = canPayMana(card,card->getManaCost());
|
||||||
//for preformence reason we only look for specific mana if the payment couldn't be made with pmana.
|
//for preformence reason we only look for specific mana if the payment couldn't be made with pmana.
|
||||||
if ((currentCost > maxCost || hasX) && (gotPayments.size() || pMana->canAfford(card->getManaCost())))
|
if ((currentCost > maxCost || hasX) && (gotPayments.size() || pMana->canAfford(card->getManaCost())))
|
||||||
{
|
{
|
||||||
TargetChooserFactory tcf(observer);
|
TargetChooserFactory tcf(observer);
|
||||||
TargetChooser * tc = tcf.createTargetChooser(card);
|
TargetChooser * tc = tcf.createTargetChooser(card);
|
||||||
int shouldPlayPercentage = 0;
|
int shouldPlayPercentage = 0;
|
||||||
if (tc)
|
if (tc)
|
||||||
{
|
{
|
||||||
int hasTarget = chooseTarget(tc,NULL,NULL,true);
|
int hasTarget = chooseTarget(tc,NULL,NULL,true);
|
||||||
if(
|
if(
|
||||||
(tc->maxtargets > hasTarget && tc->maxtargets > 1 && !tc->targetMin && tc->maxtargets != TargetChooser::UNLITMITED_TARGETS) ||//target=<3>creature
|
(tc->maxtargets > hasTarget && tc->maxtargets > 1 && !tc->targetMin && tc->maxtargets != TargetChooser::UNLITMITED_TARGETS) ||//target=<3>creature
|
||||||
(tc->maxtargets == TargetChooser::UNLITMITED_TARGETS && hasTarget < 1)//target=creatures
|
(tc->maxtargets == TargetChooser::UNLITMITED_TARGETS && hasTarget < 1)//target=creatures
|
||||||
)
|
)
|
||||||
hasTarget = 0;
|
hasTarget = 0;
|
||||||
if (!hasTarget)//single target covered here.
|
if (!hasTarget)//single target covered here.
|
||||||
{
|
{
|
||||||
SAFE_DELETE(tc);
|
SAFE_DELETE(tc);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
shouldPlayPercentage = 90;
|
shouldPlayPercentage = 90;
|
||||||
if(tc->targetMin && hasTarget < tc->maxtargets)
|
if(tc->targetMin && hasTarget < tc->maxtargets)
|
||||||
shouldPlayPercentage = 0;
|
shouldPlayPercentage = 0;
|
||||||
if(tc->maxtargets > 1 && tc->maxtargets != TargetChooser::UNLITMITED_TARGETS && hasTarget <= tc->maxtargets)
|
if(tc->maxtargets > 1 && tc->maxtargets != TargetChooser::UNLITMITED_TARGETS && hasTarget <= tc->maxtargets)
|
||||||
{
|
{
|
||||||
int maxA = hasTarget-tc->maxtargets;
|
int maxA = hasTarget-tc->maxtargets;
|
||||||
shouldPlayPercentage += (10*maxA);//reduce the chances of playing multitarget if we are not above max targets.
|
shouldPlayPercentage += (10*maxA);//reduce the chances of playing multitarget if we are not above max targets.
|
||||||
}
|
}
|
||||||
if(tc->maxtargets == TargetChooser::UNLITMITED_TARGETS)
|
if(tc->maxtargets == TargetChooser::UNLITMITED_TARGETS)
|
||||||
{
|
{
|
||||||
shouldPlayPercentage = 40 + (10*hasTarget);
|
shouldPlayPercentage = 40 + (10*hasTarget);
|
||||||
int totalCost = pMana->getConvertedCost()-currentCost;
|
int totalCost = pMana->getConvertedCost()-currentCost;
|
||||||
int totalTargets = hasTarget+hasTarget;
|
int totalTargets = hasTarget+hasTarget;
|
||||||
if(hasX && totalCost <= totalTargets)// {x} spell with unlimited targeting tend to divide damage, we want atleast 1 damage per target before casting.
|
if(hasX && totalCost <= totalTargets)// {x} spell with unlimited targeting tend to divide damage, we want atleast 1 damage per target before casting.
|
||||||
{
|
{
|
||||||
shouldPlayPercentage = 0;
|
shouldPlayPercentage = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SAFE_DELETE(tc);
|
SAFE_DELETE(tc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Refactor to not check effect of lands since it always returned BAKA_EFFECT_DONTKNOW
|
// Refactor to not check effect of lands since it always returned BAKA_EFFECT_DONTKNOW
|
||||||
// If it is a land, play it
|
// If it is a land, play it
|
||||||
if (card->isLand())
|
if (card->isLand())
|
||||||
{
|
{
|
||||||
shouldPlayPercentage = 90;
|
shouldPlayPercentage = 90;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int shouldPlay = effectBadOrGood(card);
|
int shouldPlay = effectBadOrGood(card);
|
||||||
if (shouldPlay == BAKA_EFFECT_GOOD) {
|
if (shouldPlay == BAKA_EFFECT_GOOD) {
|
||||||
shouldPlayPercentage = 90;
|
shouldPlayPercentage = 90;
|
||||||
}
|
}
|
||||||
else if (BAKA_EFFECT_DONTKNOW == shouldPlay) {
|
else if (BAKA_EFFECT_DONTKNOW == shouldPlay) {
|
||||||
//previously shouldPlayPercentage = 80;, I found this a little to high
|
//previously shouldPlayPercentage = 80;, I found this a little to high
|
||||||
//for cards which AI had no idea how to use.
|
//for cards which AI had no idea how to use.
|
||||||
shouldPlayPercentage = 60;
|
shouldPlayPercentage = 60;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// shouldPlay == baka_effect_bad giving it a 10 for odd ball lottery chance.
|
// shouldPlay == baka_effect_bad giving it a 10 for odd ball lottery chance.
|
||||||
shouldPlayPercentage = 10;
|
shouldPlayPercentage = 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Reduce the chances of playing a spell with X cost if available mana is low
|
//Reduce the chances of playing a spell with X cost if available mana is low
|
||||||
if (hasX)
|
if (hasX)
|
||||||
{
|
{
|
||||||
int xDiff = pMana->getConvertedCost() - currentCost;
|
int xDiff = pMana->getConvertedCost() - currentCost;
|
||||||
if (xDiff < 0)
|
if (xDiff < 0)
|
||||||
xDiff = 0;
|
xDiff = 0;
|
||||||
shouldPlayPercentage = shouldPlayPercentage - static_cast<int> ((shouldPlayPercentage * 1.9f) / (1 + xDiff));
|
shouldPlayPercentage = shouldPlayPercentage - static_cast<int> ((shouldPlayPercentage * 1.9f) / (1 + xDiff));
|
||||||
}
|
}
|
||||||
if(card->getManaCost() && card->getManaCost()->getKicker() && card->getManaCost()->getKicker()->isMulti)
|
if(card->getManaCost() && card->getManaCost()->getKicker() && card->getManaCost()->getKicker()->isMulti)
|
||||||
{
|
{
|
||||||
shouldPlayPercentage = 10* size_t(gotPayments.size())/int(1+(card->getManaCost()->getConvertedCost()+card->getManaCost()->getKicker()->getConvertedCost()));
|
shouldPlayPercentage = 10* size_t(gotPayments.size())/int(1+(card->getManaCost()->getConvertedCost()+card->getManaCost()->getKicker()->getConvertedCost()));
|
||||||
if(shouldPlayPercentage <= 10)
|
if(shouldPlayPercentage <= 10)
|
||||||
shouldPlayPercentage = shouldPlayPercentage/3;
|
shouldPlayPercentage = shouldPlayPercentage/3;
|
||||||
}
|
}
|
||||||
DebugTrace("Should I play from grave " << (card ? card->name : "Nothing" ) << "?" << endl
|
DebugTrace("Should I play from grave " << (card ? card->name : "Nothing" ) << "?" << endl
|
||||||
<<"shouldPlayPercentage = "<< shouldPlayPercentage);
|
<<"shouldPlayPercentage = "<< shouldPlayPercentage);
|
||||||
if(card->getRestrictions().size())
|
if(card->getRestrictions().size())
|
||||||
{
|
{
|
||||||
AbilityFactory af(observer);
|
AbilityFactory af(observer);
|
||||||
int canPlay = af.parseCastRestrictions(card,card->controller(),card->getRestrictions());
|
int canPlay = af.parseCastRestrictions(card,card->controller(),card->getRestrictions());
|
||||||
if(!canPlay)
|
if(!canPlay)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int randomChance = randomGenerator.random();
|
int randomChance = randomGenerator.random();
|
||||||
int chance = randomChance % 100;
|
int chance = randomChance % 100;
|
||||||
if (chance > shouldPlayPercentage)
|
if (chance > shouldPlayPercentage)
|
||||||
continue;
|
continue;
|
||||||
if(shouldPlayPercentage <= 10)
|
if(shouldPlayPercentage <= 10)
|
||||||
{
|
{
|
||||||
DebugTrace("shouldPlayPercentage was less than 10 this was a lottery roll on RNG");
|
DebugTrace("shouldPlayPercentage was less than 10 this was a lottery roll on RNG");
|
||||||
}
|
}
|
||||||
nextCardToPlay = card;
|
nextCardToPlay = card;
|
||||||
maxCost = currentCost;
|
maxCost = currentCost;
|
||||||
if (hasX)
|
if (hasX)
|
||||||
maxCost = pMana->getConvertedCost();
|
maxCost = pMana->getConvertedCost();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//canplayfromexile
|
//canplayfromexile
|
||||||
while ((card = cd.nextmatch(game->exile, card))&& card->has(Constants::CANPLAYFROMEXILE))
|
while ((card = cd.nextmatch(game->exile, card))&& card->has(Constants::CANPLAYFROMEXILE))
|
||||||
@@ -2841,26 +2841,26 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Refactor to not check effect of lands since it always returned BAKA_EFFECT_DONTKNOW
|
// Refactor to not check effect of lands since it always returned BAKA_EFFECT_DONTKNOW
|
||||||
// If it is a land, play it
|
// If it is a land, play it
|
||||||
if (card->isLand())
|
if (card->isLand())
|
||||||
{
|
{
|
||||||
shouldPlayPercentage = 90;
|
shouldPlayPercentage = 90;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int shouldPlay = effectBadOrGood(card);
|
int shouldPlay = effectBadOrGood(card);
|
||||||
if (shouldPlay == BAKA_EFFECT_GOOD) {
|
if (shouldPlay == BAKA_EFFECT_GOOD) {
|
||||||
shouldPlayPercentage = 90;
|
shouldPlayPercentage = 90;
|
||||||
}
|
}
|
||||||
else if (BAKA_EFFECT_DONTKNOW == shouldPlay) {
|
else if (BAKA_EFFECT_DONTKNOW == shouldPlay) {
|
||||||
//previously shouldPlayPercentage = 80;, I found this a little to high
|
//previously shouldPlayPercentage = 80;, I found this a little to high
|
||||||
//for cards which AI had no idea how to use.
|
//for cards which AI had no idea how to use.
|
||||||
shouldPlayPercentage = 60;
|
shouldPlayPercentage = 60;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// shouldPlay == baka_effect_bad giving it a 10 for odd ball lottery chance.
|
// shouldPlay == baka_effect_bad giving it a 10 for odd ball lottery chance.
|
||||||
shouldPlayPercentage = 10;
|
shouldPlayPercentage = 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Reduce the chances of playing a spell with X cost if available mana is low
|
//Reduce the chances of playing a spell with X cost if available mana is low
|
||||||
if (hasX)
|
if (hasX)
|
||||||
@@ -2925,7 +2925,7 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty
|
|||||||
if (card->has(Constants::TREASON) && observer->getCurrentGamePhase() != MTG_PHASE_FIRSTMAIN)
|
if (card->has(Constants::TREASON) && observer->getCurrentGamePhase() != MTG_PHASE_FIRSTMAIN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//PLaneswalkers are now legendary so this is redundant
|
//PLaneswalkers are now legendary so this is redundant
|
||||||
//if (card->hasType(Subtypes::TYPE_PLANESWALKER) && card->types.size() > 0 && game->inPlay->hasTypeSpecificInt(Subtypes::TYPE_PLANESWALKER,card->types[1]))
|
//if (card->hasType(Subtypes::TYPE_PLANESWALKER) && card->types.size() > 0 && game->inPlay->hasTypeSpecificInt(Subtypes::TYPE_PLANESWALKER,card->types[1]))
|
||||||
//continue;
|
//continue;
|
||||||
|
|
||||||
@@ -2995,27 +2995,27 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Refactor to not check effect of lands since it always returned BAKA_EFFECT_DONTKNOW
|
// Refactor to not check effect of lands since it always returned BAKA_EFFECT_DONTKNOW
|
||||||
// If it is a land, play it
|
// If it is a land, play it
|
||||||
if (card->isLand())
|
if (card->isLand())
|
||||||
{
|
{
|
||||||
shouldPlayPercentage = 90;
|
shouldPlayPercentage = 90;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int shouldPlay = effectBadOrGood(card);
|
int shouldPlay = effectBadOrGood(card);
|
||||||
if (shouldPlay == BAKA_EFFECT_GOOD) {
|
if (shouldPlay == BAKA_EFFECT_GOOD) {
|
||||||
shouldPlayPercentage = 90;
|
shouldPlayPercentage = 90;
|
||||||
}
|
}
|
||||||
else if (BAKA_EFFECT_DONTKNOW == shouldPlay) {
|
else if (BAKA_EFFECT_DONTKNOW == shouldPlay) {
|
||||||
//previously shouldPlayPercentage = 80;, I found this a little to high
|
//previously shouldPlayPercentage = 80;, I found this a little to high
|
||||||
//for cards which AI had no idea how to use.
|
//for cards which AI had no idea how to use.
|
||||||
shouldPlayPercentage = 60;
|
shouldPlayPercentage = 60;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// shouldPlay == baka_effect_bad giving it a 10 for odd ball lottery chance.
|
// shouldPlay == baka_effect_bad giving it a 10 for odd ball lottery chance.
|
||||||
shouldPlayPercentage = 10;
|
shouldPlayPercentage = 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Reduce the chances of playing a spell with X cost if available mana is low
|
//Reduce the chances of playing a spell with X cost if available mana is low
|
||||||
if (hasX)
|
if (hasX)
|
||||||
@@ -3458,16 +3458,16 @@ int AIPlayerBaka::getCreaturesInfo(Player * player, int neededInfo, int untapMod
|
|||||||
|
|
||||||
int AIPlayerBaka::chooseAttackers()
|
int AIPlayerBaka::chooseAttackers()
|
||||||
{
|
{
|
||||||
int myCreatures = getCreaturesInfo(this, INFO_NBCREATURES, -1, 1);
|
int myCreatures = getCreaturesInfo(this, INFO_NBCREATURES, -1, 1);
|
||||||
if (myCreatures < 1)
|
if (myCreatures < 1)
|
||||||
return 0;
|
return 0;
|
||||||
//Attack with all creatures
|
//Attack with all creatures
|
||||||
//How much damage can the other player do during his next Attack ?
|
//How much damage can the other player do during his next Attack ?
|
||||||
int opponentForce = getCreaturesInfo(opponent(), INFO_CREATURESPOWER);
|
int opponentForce = getCreaturesInfo(opponent(), INFO_CREATURESPOWER);
|
||||||
int opponentCreatures = getCreaturesInfo(opponent(), INFO_NBCREATURES);
|
int opponentCreatures = getCreaturesInfo(opponent(), INFO_NBCREATURES);
|
||||||
int myForce = getCreaturesInfo(this, INFO_CREATURESPOWER, -1, 1);
|
int myForce = getCreaturesInfo(this, INFO_CREATURESPOWER, -1, 1);
|
||||||
if(opponent()->life < 5)
|
if(opponent()->life < 5)
|
||||||
agressivity += 31;
|
agressivity += 31;
|
||||||
|
|
||||||
bool attack = ((myCreatures > opponentCreatures) || (myForce > opponentForce) || (myForce > 2 * opponent()->life));
|
bool attack = ((myCreatures > opponentCreatures) || (myForce > opponentForce) || (myForce > 2 * opponent()->life));
|
||||||
if (agressivity > 80 && !attack && life > opponentForce)
|
if (agressivity > 80 && !attack && life > opponentForce)
|
||||||
@@ -3485,7 +3485,7 @@ int AIPlayerBaka::chooseAttackers()
|
|||||||
MTGCardInstance * card = NULL;
|
MTGCardInstance * card = NULL;
|
||||||
while ((card = cd.nextmatch(game->inPlay, card)))
|
while ((card = cd.nextmatch(game->inPlay, card)))
|
||||||
{
|
{
|
||||||
if ((hints && hints->HintSaysAlwaysAttack(observer, card)) || card->has(Constants::UNBLOCKABLE))
|
if ((hints && hints->HintSaysAlwaysAttack(observer, card)) || card->has(Constants::UNBLOCKABLE))
|
||||||
{
|
{
|
||||||
if (!card->isAttacker())
|
if (!card->isAttacker())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -417,11 +417,11 @@ ManaCost* CardPrimitive::getManaCost()
|
|||||||
|
|
||||||
bool CardPrimitive::hasType(int _type)
|
bool CardPrimitive::hasType(int _type)
|
||||||
{
|
{
|
||||||
if (types.size() > 400) {return false;} // Null pointer?
|
if (types.size() > 400) {return false;} // Null pointer?
|
||||||
for (size_t i = 0; i < types.size(); i++)
|
for (size_t i = 0; i < types.size(); i++)
|
||||||
if (types[i] == _type)
|
if (types[i] == _type)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CardPrimitive::hasSubtype(int _subtype)
|
bool CardPrimitive::hasSubtype(int _subtype)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ DeckEditorMenu::DeckEditorMenu(int id, JGuiListener* listener, int fontId, const
|
|||||||
#if defined PSP
|
#if defined PSP
|
||||||
titleX = (SCREEN_WIDTH_F/2.f) + 10;
|
titleX = (SCREEN_WIDTH_F/2.f) + 10;
|
||||||
#else
|
#else
|
||||||
titleX = (SCREEN_WIDTH_F/2.f);
|
titleX = (SCREEN_WIDTH_F/2.f);
|
||||||
#endif
|
#endif
|
||||||
titleY = 13;
|
titleY = 13;
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ void DeckEditorMenu::Render()
|
|||||||
#if defined PSP
|
#if defined PSP
|
||||||
mainFont->DrawString(deckTitle.c_str(), (SCREEN_WIDTH_F / 2)-modt+10, (statsHeight / 2)+4, JGETEXT_CENTER);
|
mainFont->DrawString(deckTitle.c_str(), (SCREEN_WIDTH_F / 2)-modt+10, (statsHeight / 2)+4, JGETEXT_CENTER);
|
||||||
#else
|
#else
|
||||||
mainFont->DrawString(deckTitle.c_str(), (SCREEN_WIDTH_F / 2)-modt, (statsHeight / 2)+4, JGETEXT_CENTER);
|
mainFont->DrawString(deckTitle.c_str(), (SCREEN_WIDTH_F / 2)-modt, (statsHeight / 2)+4, JGETEXT_CENTER);
|
||||||
#endif
|
#endif
|
||||||
mainFont->SetColor(currentColor);
|
mainFont->SetColor(currentColor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,9 +104,9 @@ JGuiController(JGE::GetInstance(), id, listener), fontId(fontId), mShowDetailsSc
|
|||||||
float boxStartX = detailedInfoBoxX - stringWidth / 2 + 20;
|
float boxStartX = detailedInfoBoxX - stringWidth / 2 + 20;
|
||||||
//dismiss button?
|
//dismiss button?
|
||||||
#if defined PSP
|
#if defined PSP
|
||||||
dismissButton = NEW InteractiveButton( this, DeckMenuConst::kDetailedInfoButtonId, Fonts::MAIN_FONT, detailedInfoString, boxStartX+25, detailedInfoBoxY-10.0f, JGE_BTN_CANCEL);
|
dismissButton = NEW InteractiveButton( this, DeckMenuConst::kDetailedInfoButtonId, Fonts::MAIN_FONT, detailedInfoString, boxStartX+25, detailedInfoBoxY-10.0f, JGE_BTN_CANCEL);
|
||||||
#else
|
#else
|
||||||
dismissButton = NEW InteractiveButton( this, DeckMenuConst::kDetailedInfoButtonId, Fonts::MAIN_FONT, detailedInfoString, boxStartX+30, detailedInfoBoxY+4.5f, JGE_BTN_CANCEL);
|
dismissButton = NEW InteractiveButton( this, DeckMenuConst::kDetailedInfoButtonId, Fonts::MAIN_FONT, detailedInfoString, boxStartX+30, detailedInfoBoxY+4.5f, JGE_BTN_CANCEL);
|
||||||
#endif
|
#endif
|
||||||
JGuiController::Add(dismissButton, true);
|
JGuiController::Add(dismissButton, true);
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail, bool griddeckv
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText;
|
int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText;
|
||||||
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
|
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
|
||||||
CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true);
|
CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ void GameApp::Create()
|
|||||||
WResourceManager::Instance()->RetrieveTexture("backdropframe.png", RETRIEVE_MANAGE);
|
WResourceManager::Instance()->RetrieveTexture("backdropframe.png", RETRIEVE_MANAGE);
|
||||||
#else
|
#else
|
||||||
WResourceManager::Instance()->RetrieveTexture("pspbackdrop.jpg", RETRIEVE_MANAGE);
|
WResourceManager::Instance()->RetrieveTexture("pspbackdrop.jpg", RETRIEVE_MANAGE);
|
||||||
WResourceManager::Instance()->RetrieveTexture("pspbackdropframe.png", RETRIEVE_MANAGE);
|
WResourceManager::Instance()->RetrieveTexture("pspbackdropframe.png", RETRIEVE_MANAGE);
|
||||||
#endif
|
#endif
|
||||||
WResourceManager::Instance()->RetrieveTexture("handback.png", RETRIEVE_MANAGE);
|
WResourceManager::Instance()->RetrieveTexture("handback.png", RETRIEVE_MANAGE);
|
||||||
WResourceManager::Instance()->RetrieveTexture("shadows.png", RETRIEVE_MANAGE);
|
WResourceManager::Instance()->RetrieveTexture("shadows.png", RETRIEVE_MANAGE);
|
||||||
|
|||||||
@@ -770,9 +770,9 @@ void GameStateDuel::Update(float dt)
|
|||||||
musictrack = "ai_baka_music_momir.mp3";
|
musictrack = "ai_baka_music_momir.mp3";
|
||||||
else if (mParent->gameType == GAME_TYPE_RANDOM1 || mParent->gameType == GAME_TYPE_RANDOM2) musictrack
|
else if (mParent->gameType == GAME_TYPE_RANDOM1 || mParent->gameType == GAME_TYPE_RANDOM2) musictrack
|
||||||
= "ai_baka_music_random.mp3";
|
= "ai_baka_music_random.mp3";
|
||||||
else if (mParent->gameType == GAME_TYPE_RANDOM3 || mParent->gameType == GAME_TYPE_RANDOM5) musictrack
|
else if (mParent->gameType == GAME_TYPE_RANDOM3 || mParent->gameType == GAME_TYPE_RANDOM5) musictrack
|
||||||
= "ai_baka_music_random.mp3";
|
= "ai_baka_music_random.mp3";
|
||||||
else if (mParent->gameType == GAME_TYPE_HORDE || mParent->gameType == GAME_TYPE_SET_LIMITED) musictrack
|
else if (mParent->gameType == GAME_TYPE_HORDE || mParent->gameType == GAME_TYPE_SET_LIMITED) musictrack
|
||||||
= "ai_baka_music_momir.mp3";
|
= "ai_baka_music_momir.mp3";
|
||||||
if (!MusicExist(musictrack))
|
if (!MusicExist(musictrack))
|
||||||
musictrack = "ai_baka_music.mp3";
|
musictrack = "ai_baka_music.mp3";
|
||||||
|
|||||||
@@ -1835,8 +1835,8 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
tc->targetter = NULL;
|
tc->targetter = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (tc->targetter)
|
if (tc->targetter)
|
||||||
tc->targetter->bypassTC = false;
|
tc->targetter->bypassTC = false;
|
||||||
sWithoutTc = splitTarget[0];
|
sWithoutTc = splitTarget[0];
|
||||||
sWithoutTc.append(splitTarget[2]);
|
sWithoutTc.append(splitTarget[2]);
|
||||||
}
|
}
|
||||||
@@ -3513,7 +3513,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
|
|
||||||
//produce additional mana when a mana is engaged
|
//produce additional mana when a mana is engaged
|
||||||
if (s.find("producecolor:") != string::npos)
|
if (s.find("producecolor:") != string::npos)
|
||||||
{
|
{
|
||||||
return NEW AEngagedManaAbility(observer, id, card,s.substr(13));
|
return NEW AEngagedManaAbility(observer, id, card,s.substr(13));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4102,7 +4102,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
MTGAbility * a = NEW AAProliferate(observer, id, card, target);
|
MTGAbility * a = NEW AAProliferate(observer, id, card, target);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
a->canBeInterrupted = false;
|
a->canBeInterrupted = false;
|
||||||
((AAProliferate*)a)->allcounters = true;
|
((AAProliferate*)a)->allcounters = true;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
//proliferate all counters
|
//proliferate all counters
|
||||||
@@ -4547,10 +4547,10 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode, Targ
|
|||||||
return BAKA_EFFECT_BAD;
|
return BAKA_EFFECT_BAD;
|
||||||
if (dynamic_cast<AManaProducer *> (a))
|
if (dynamic_cast<AManaProducer *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<AARemoveAllCounter *> (a))
|
if (dynamic_cast<AARemoveAllCounter *> (a))
|
||||||
return BAKA_EFFECT_BAD;
|
return BAKA_EFFECT_BAD;
|
||||||
if (dynamic_cast<AAProliferate *> (a))
|
if (dynamic_cast<AAProliferate *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
|
|
||||||
// Equipment that gets immediately attached. Todo: check the abilities associated with Equip, to make sure they're good (for now it seems to be the majority of the cases)?
|
// Equipment that gets immediately attached. Todo: check the abilities associated with Equip, to make sure they're good (for now it seems to be the majority of the cases)?
|
||||||
if (dynamic_cast<AEquip *> (a))
|
if (dynamic_cast<AEquip *> (a))
|
||||||
@@ -4574,12 +4574,12 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode, Targ
|
|||||||
if (AAMover * aam = dynamic_cast<AAMover *>(a))
|
if (AAMover * aam = dynamic_cast<AAMover *>(a))
|
||||||
{
|
{
|
||||||
MTGGameZone * z = aam->destinationZone(target);
|
MTGGameZone * z = aam->destinationZone(target);
|
||||||
if ((tc && tc->targetsZone(p->game->library)) || (tc && tc->targetsZone(p->game->graveyard)) || (tc && tc->targetsZone(p->game->hand)))
|
if ((tc && tc->targetsZone(p->game->library)) || (tc && tc->targetsZone(p->game->graveyard)) || (tc && tc->targetsZone(p->game->hand)))
|
||||||
{
|
{
|
||||||
if (z == p->game->hand || z == p->game->inPlay)
|
if (z == p->game->hand || z == p->game->inPlay)
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
}
|
}
|
||||||
return BAKA_EFFECT_BAD; //TODO
|
return BAKA_EFFECT_BAD; //TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dynamic_cast<AACopier *> (a))
|
if (dynamic_cast<AACopier *> (a))
|
||||||
@@ -4604,33 +4604,33 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode, Targ
|
|||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<ABushidoAbility *> (a))
|
if (dynamic_cast<ABushidoAbility *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<AACascade *> (a))
|
if (dynamic_cast<AACascade *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<AACastCard *> (a))
|
if (dynamic_cast<AACastCard *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<AAFlip *> (a))
|
if (dynamic_cast<AAFlip *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<AAImprint *> (a))
|
if (dynamic_cast<AAImprint *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<ABestow *> (a))
|
if (dynamic_cast<ABestow *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<AExert *> (a))
|
if (dynamic_cast<AExert *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<ALoseAbilities *> (a))
|
if (dynamic_cast<ALoseAbilities *> (a))
|
||||||
return BAKA_EFFECT_BAD;
|
return BAKA_EFFECT_BAD;
|
||||||
if (dynamic_cast<AModularAbility *> (a))
|
if (dynamic_cast<AModularAbility *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<APaired *> (a))
|
if (dynamic_cast<APaired *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<AProduceMana *> (a))
|
if (dynamic_cast<AProduceMana *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<AACloner *> (a))
|
if (dynamic_cast<AACloner *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<AAModTurn *> (a))
|
if (dynamic_cast<AAModTurn *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<ATransformer *> (a))
|
if (dynamic_cast<ATransformer *> (a))
|
||||||
return BAKA_EFFECT_GOOD;
|
return BAKA_EFFECT_GOOD;
|
||||||
if (dynamic_cast<AADamager *> (a))
|
if (dynamic_cast<AADamager *> (a))
|
||||||
return BAKA_EFFECT_BAD;
|
return BAKA_EFFECT_BAD;
|
||||||
|
|
||||||
if (PTInstant * abi = dynamic_cast<PTInstant *>(a))
|
if (PTInstant * abi = dynamic_cast<PTInstant *>(a))
|
||||||
@@ -4663,8 +4663,8 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode, Targ
|
|||||||
badAbilities[(int)Constants::NOLIFEGAINOPPONENT] = true;
|
badAbilities[(int)Constants::NOLIFEGAINOPPONENT] = true;
|
||||||
badAbilities[(int)Constants::MUSTBLOCK] = true;
|
badAbilities[(int)Constants::MUSTBLOCK] = true;
|
||||||
badAbilities[(int)Constants::FLYERSONLY] = true;
|
badAbilities[(int)Constants::FLYERSONLY] = true;
|
||||||
badAbilities[(int)Constants::TREASON] = true;
|
badAbilities[(int)Constants::TREASON] = true;
|
||||||
badAbilities[(int)Constants::SHACKLER] = true;
|
badAbilities[(int)Constants::SHACKLER] = true;
|
||||||
|
|
||||||
if (AInstantBasicAbilityModifierUntilEOT * abi = dynamic_cast<AInstantBasicAbilityModifierUntilEOT *>(a))
|
if (AInstantBasicAbilityModifierUntilEOT * abi = dynamic_cast<AInstantBasicAbilityModifierUntilEOT *>(a))
|
||||||
{
|
{
|
||||||
@@ -4731,7 +4731,7 @@ int AbilityFactory::getAbilities(vector<MTGAbility *> * v, Spell * spell, MTGCar
|
|||||||
card->exileEffects = true;
|
card->exileEffects = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (dest == zones->library)
|
if (dest == zones->library)
|
||||||
{
|
{
|
||||||
magicText = card->magicTexts["library"];
|
magicText = card->magicTexts["library"];
|
||||||
break;
|
break;
|
||||||
@@ -4925,11 +4925,11 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
catch(exception) {
|
catch(exception) {
|
||||||
DebugTrace("MAGIC TEST ERROR: Parser returned NULL");
|
DebugTrace("MAGIC TEST ERROR: Parser returned NULL");
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbilityFactory::addAbilities(int _id, Spell * spell)
|
void AbilityFactory::addAbilities(int _id, Spell * spell)
|
||||||
|
|||||||
@@ -1353,8 +1353,8 @@ int MTGCardInstance::DangerRanking()
|
|||||||
result += 1;
|
result += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Even at 60(danger=3) the AI is hasty to play removal on a simple creature
|
// Even at 60(danger=3) the AI is hasty to play removal on a simple creature
|
||||||
// a vanilla 2 mana, 2/2 used to be eff = 60
|
// a vanilla 2 mana, 2/2 used to be eff = 60
|
||||||
if (result > 2)
|
if (result > 2)
|
||||||
danger += 1;
|
danger += 1;
|
||||||
if (result > 4)
|
if (result > 4)
|
||||||
|
|||||||
@@ -1291,7 +1291,7 @@ void MTGDeck::printDetailedDeckText(std::ofstream& file )
|
|||||||
}
|
}
|
||||||
ss_creatures << numberOfCreatures;
|
ss_creatures << numberOfCreatures;
|
||||||
ss_spells << numberOfSpells;
|
ss_spells << numberOfSpells;
|
||||||
ss_lands << numberOfLands;
|
ss_lands << numberOfLands;
|
||||||
|
|
||||||
file << getCardBlockText( "Creatures x" + ss_creatures.str(), creatures.str() ) ;
|
file << getCardBlockText( "Creatures x" + ss_creatures.str(), creatures.str() ) ;
|
||||||
file << getCardBlockText( "Spells x" + ss_spells.str(), spells.str() ) ;
|
file << getCardBlockText( "Spells x" + ss_spells.str(), spells.str() ) ;
|
||||||
|
|||||||
@@ -505,16 +505,16 @@ int MTGPutInPlayRule::reactToClick(MTGCardInstance * card)
|
|||||||
}
|
}
|
||||||
delete withKickerCost;
|
delete withKickerCost;
|
||||||
}
|
}
|
||||||
if (card->getManaCost()->getBestow())
|
if (card->getManaCost()->getBestow())
|
||||||
{
|
{
|
||||||
ManaCost * withBestowCost= NEW ManaCost(card->getManaCost());
|
ManaCost * withBestowCost= NEW ManaCost(card->getManaCost());
|
||||||
withBestowCost->add(withBestowCost->getBestow());
|
withBestowCost->add(withBestowCost->getBestow());
|
||||||
|
|
||||||
DebugTrace("AltCost BESTOW " << withBestowCost);
|
DebugTrace("AltCost BESTOW " << withBestowCost);
|
||||||
if (previousManaPool->canAfford(withBestowCost))
|
if (previousManaPool->canAfford(withBestowCost))
|
||||||
{
|
{
|
||||||
player->getManaPool()->pay(card->getManaCost()->getBestow());
|
player->getManaPool()->pay(card->getManaCost()->getBestow());
|
||||||
payResult = ManaCost::MANA_PAID_WITH_BESTOW;
|
payResult = ManaCost::MANA_PAID_WITH_BESTOW;
|
||||||
}
|
}
|
||||||
delete withBestowCost;
|
delete withBestowCost;
|
||||||
}
|
}
|
||||||
@@ -667,16 +667,16 @@ int MTGKickerRule::reactToClick(MTGCardInstance * card)
|
|||||||
}
|
}
|
||||||
delete withKickerCost;
|
delete withKickerCost;
|
||||||
}
|
}
|
||||||
// Handles bestow,also has to go in isExtraPaymentSet
|
// Handles bestow,also has to go in isExtraPaymentSet
|
||||||
if (card->getManaCost()->getBestow())
|
if (card->getManaCost()->getBestow())
|
||||||
{
|
{
|
||||||
ManaCost * withBestowCost= NEW ManaCost(card->getManaCost());
|
ManaCost * withBestowCost= NEW ManaCost(card->getManaCost());
|
||||||
withBestowCost->add(withBestowCost->getBestow());
|
withBestowCost->add(withBestowCost->getBestow());
|
||||||
|
|
||||||
if (previousManaPool->canAfford(withBestowCost))
|
if (previousManaPool->canAfford(withBestowCost))
|
||||||
{
|
{
|
||||||
player->getManaPool()->pay(card->getManaCost()->getBestow());
|
player->getManaPool()->pay(card->getManaCost()->getBestow());
|
||||||
payResult = ManaCost::MANA_PAID_WITH_BESTOW;
|
payResult = ManaCost::MANA_PAID_WITH_BESTOW;
|
||||||
}
|
}
|
||||||
delete withBestowCost;
|
delete withBestowCost;
|
||||||
}
|
}
|
||||||
@@ -3513,7 +3513,7 @@ PermanentAbility(observer, _id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int MTGNewPlaneswalker::receiveEvent(WEvent * e)
|
int MTGNewPlaneswalker::receiveEvent(WEvent * e)
|
||||||
{
|
{
|
||||||
if(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer())
|
if(game->getCurrentTargetChooser() || game->mLayers->actionLayer()->isWaitingForAnswer())
|
||||||
return 0;
|
return 0;
|
||||||
if (WEventZoneChange* ev1 = dynamic_cast<WEventZoneChange*>(e))
|
if (WEventZoneChange* ev1 = dynamic_cast<WEventZoneChange*>(e))
|
||||||
@@ -3591,7 +3591,7 @@ int MTGNewPlaneswalker::CheckPW(MTGCardInstance * card)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
void MTGNewPlaneswalker::MovePW(MTGCardInstance * card)
|
void MTGNewPlaneswalker::MovePW(MTGCardInstance * card)
|
||||||
{
|
{
|
||||||
game->LPWeffect = true;
|
game->LPWeffect = true;
|
||||||
vector<MTGAbility*>selection;
|
vector<MTGAbility*>selection;
|
||||||
MTGCardInstance * myClone = NEW MTGCardInstance(card, card->controller()->game);
|
MTGCardInstance * myClone = NEW MTGCardInstance(card, card->controller()->game);
|
||||||
@@ -3709,7 +3709,7 @@ ListMaintainerAbility(observer, _id)
|
|||||||
|
|
||||||
int MTGPlaneWalkerRule::canBeInList(MTGCardInstance * card)
|
int MTGPlaneWalkerRule::canBeInList(MTGCardInstance * card)
|
||||||
{
|
{
|
||||||
if(card->isPhased)
|
if(card->isPhased)
|
||||||
return 0;
|
return 0;
|
||||||
if (card->hasType(Subtypes::TYPE_LEGENDARY) && card->controller()->game->inPlay->hasCard(card))
|
if (card->hasType(Subtypes::TYPE_LEGENDARY) && card->controller()->game->inPlay->hasCard(card))
|
||||||
{
|
{
|
||||||
@@ -3723,7 +3723,7 @@ int MTGPlaneWalkerRule::canBeInList(MTGCardInstance * card)
|
|||||||
|
|
||||||
int MTGPlaneWalkerRule::added(MTGCardInstance * card)
|
int MTGPlaneWalkerRule::added(MTGCardInstance * card)
|
||||||
{
|
{
|
||||||
map<MTGCardInstance *, bool>::iterator it;
|
map<MTGCardInstance *, bool>::iterator it;
|
||||||
int destroy = 0;
|
int destroy = 0;
|
||||||
vector<MTGCardInstance*>oldCards;
|
vector<MTGCardInstance*>oldCards;
|
||||||
for (it = cards.begin(); it != cards.end(); it++)
|
for (it = cards.begin(); it != cards.end(); it++)
|
||||||
|
|||||||
@@ -579,8 +579,8 @@ int ManaCost::hasAnotherCost()
|
|||||||
if(kicker)
|
if(kicker)
|
||||||
result = 1;
|
result = 1;
|
||||||
//kicker is the only one ai knows for now, later hasAnotherCost() can be used to determine other cost types.
|
//kicker is the only one ai knows for now, later hasAnotherCost() can be used to determine other cost types.
|
||||||
if(Retrace || BuyBack || alternative || FlashBack || morph || suspend || Bestow)
|
if(Retrace || BuyBack || alternative || FlashBack || morph || suspend || Bestow)
|
||||||
result = 1;
|
result = 1;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,10 +168,10 @@ void Rules::addExtraRules(GameObserver* g)
|
|||||||
difficultyRating = 0;
|
difficultyRating = 0;
|
||||||
else if(g->mRules->gamemode == GAME_TYPE_RANDOM1 || g->mRules->gamemode == GAME_TYPE_RANDOM2)
|
else if(g->mRules->gamemode == GAME_TYPE_RANDOM1 || g->mRules->gamemode == GAME_TYPE_RANDOM2)
|
||||||
difficultyRating = 0;
|
difficultyRating = 0;
|
||||||
else if(g->mRules->gamemode == GAME_TYPE_RANDOM3 || g->mRules->gamemode == GAME_TYPE_RANDOM5)
|
else if(g->mRules->gamemode == GAME_TYPE_RANDOM3 || g->mRules->gamemode == GAME_TYPE_RANDOM5)
|
||||||
difficultyRating = 0;
|
difficultyRating = 0;
|
||||||
else if(g->mRules->gamemode == GAME_TYPE_HORDE || g->mRules->gamemode == GAME_TYPE_SET_LIMITED)
|
else if(g->mRules->gamemode == GAME_TYPE_HORDE || g->mRules->gamemode == GAME_TYPE_SET_LIMITED)
|
||||||
difficultyRating = 0;
|
difficultyRating = 0;
|
||||||
else if (g->mRules->gamemode == GAME_TYPE_STORY)
|
else if (g->mRules->gamemode == GAME_TYPE_STORY)
|
||||||
difficultyRating = 0;
|
difficultyRating = 0;
|
||||||
else if (a->aType == MTGAbility::STANDARD_DRAW)
|
else if (a->aType == MTGAbility::STANDARD_DRAW)
|
||||||
@@ -200,8 +200,8 @@ void Rules::addExtraRules(GameObserver* g)
|
|||||||
a->resolve();
|
a->resolve();
|
||||||
else if(g->mRules->gamemode == GAME_TYPE_RANDOM1 || g->mRules->gamemode == GAME_TYPE_RANDOM2)
|
else if(g->mRules->gamemode == GAME_TYPE_RANDOM1 || g->mRules->gamemode == GAME_TYPE_RANDOM2)
|
||||||
a->resolve();
|
a->resolve();
|
||||||
else if(g->mRules->gamemode == GAME_TYPE_RANDOM3 || g->mRules->gamemode == GAME_TYPE_RANDOM5)
|
else if(g->mRules->gamemode == GAME_TYPE_RANDOM3 || g->mRules->gamemode == GAME_TYPE_RANDOM5)
|
||||||
a->resolve();
|
a->resolve();
|
||||||
else if (g->mRules->gamemode == GAME_TYPE_STORY)
|
else if (g->mRules->gamemode == GAME_TYPE_STORY)
|
||||||
a->resolve();
|
a->resolve();
|
||||||
else//stupid protections to keep this out of momir and other game modes.
|
else//stupid protections to keep this out of momir and other game modes.
|
||||||
@@ -313,35 +313,35 @@ Player * Rules::loadPlayerRandom(GameObserver* observer, int isAI, int mode)
|
|||||||
|
|
||||||
Player * Rules::loadRandomSetLimited(GameObserver* observer, int isAI)
|
Player * Rules::loadRandomSetLimited(GameObserver* observer, int isAI)
|
||||||
{
|
{
|
||||||
//Random sets
|
//Random sets
|
||||||
int setId[] = { observer->getRandomGenerator()->random() % setlist.size(), observer->getRandomGenerator()->random() % setlist.size() };
|
int setId[] = { observer->getRandomGenerator()->random() % setlist.size(), observer->getRandomGenerator()->random() % setlist.size() };
|
||||||
int nbSet = sizeof(setId)/sizeof(setId[0]);
|
int nbSet = sizeof(setId)/sizeof(setId[0]);
|
||||||
|
|
||||||
int color1 = 1 + observer->getRandomGenerator()->random() % 5;
|
int color1 = 1 + observer->getRandomGenerator()->random() % 5;
|
||||||
int color2 = 1 + observer->getRandomGenerator()->random() % 5;
|
int color2 = 1 + observer->getRandomGenerator()->random() % 5;
|
||||||
int colors[] = { color1, color2 };
|
int colors[] = { color1, color2 };
|
||||||
int nbcolors = 2;
|
int nbcolors = 2;
|
||||||
string lands[] = { "", "forest", "island", "mountain", "swamp", "plains" };
|
string lands[] = { "", "forest", "island", "mountain", "swamp", "plains" };
|
||||||
|
|
||||||
MTGDeck * tempDeck = NEW MTGDeck(MTGCollection());
|
MTGDeck * tempDeck = NEW MTGDeck(MTGCollection());
|
||||||
// Try to add basic lands from that set
|
// Try to add basic lands from that set
|
||||||
tempDeck->addRandomCards(8, setId, nbSet, -1, lands[color1].c_str());
|
tempDeck->addRandomCards(8, setId, nbSet, -1, lands[color1].c_str());
|
||||||
tempDeck->addRandomCards(8, setId, nbSet, -1, lands[color2].c_str());
|
tempDeck->addRandomCards(8, setId, nbSet, -1, lands[color2].c_str());
|
||||||
tempDeck->addRandomCards(2, setId, nbSet, -1, "land");
|
tempDeck->addRandomCards(2, setId, nbSet, -1, "land");
|
||||||
// If lands < 18 add from any set
|
// If lands < 18 add from any set
|
||||||
int missingLands = 18 - tempDeck->totalCards();
|
int missingLands = 18 - tempDeck->totalCards();
|
||||||
if (missingLands > 0)
|
if (missingLands > 0)
|
||||||
{
|
{
|
||||||
tempDeck->addRandomCards(missingLands/2, 0, 0, -1, lands[color1].c_str());
|
tempDeck->addRandomCards(missingLands/2, 0, 0, -1, lands[color1].c_str());
|
||||||
tempDeck->addRandomCards(missingLands/2, 0, 0, -1, lands[color2].c_str());
|
tempDeck->addRandomCards(missingLands/2, 0, 0, -1, lands[color2].c_str());
|
||||||
}
|
}
|
||||||
// Lone artifact and creatures.
|
// Lone artifact and creatures.
|
||||||
tempDeck->addRandomCards(1, setId, nbSet, -1, "artifact");
|
tempDeck->addRandomCards(1, setId, nbSet, -1, "artifact");
|
||||||
tempDeck->addRandomCards(12, setId, nbSet, -1, "creature", colors, nbcolors);
|
tempDeck->addRandomCards(12, setId, nbSet, -1, "creature", colors, nbcolors);
|
||||||
// Want the deck to be 40 cards, take any card from the set in the colors
|
// Want the deck to be 40 cards, take any card from the set in the colors
|
||||||
int missingCards = 40 - tempDeck->totalCards();
|
int missingCards = 40 - tempDeck->totalCards();
|
||||||
if (missingCards > 0)
|
if (missingCards > 0)
|
||||||
tempDeck->addRandomCards(missingCards, setId, nbSet, -1, "", colors, nbcolors);
|
tempDeck->addRandomCards(missingCards, setId, nbSet, -1, "", colors, nbcolors);
|
||||||
|
|
||||||
string deckFile = "random";
|
string deckFile = "random";
|
||||||
string deckFileSmall = "random";
|
string deckFileSmall = "random";
|
||||||
@@ -359,7 +359,7 @@ Player * Rules::loadPlayerRandomThree(GameObserver* observer, int isAI)
|
|||||||
{
|
{
|
||||||
int color1 = 1 + observer->getRandomGenerator()->random() % 5;
|
int color1 = 1 + observer->getRandomGenerator()->random() % 5;
|
||||||
int color2 = 1 + observer->getRandomGenerator()->random() % 5;
|
int color2 = 1 + observer->getRandomGenerator()->random() % 5;
|
||||||
int color3 = 1 + observer->getRandomGenerator()->random() % 5;
|
int color3 = 1 + observer->getRandomGenerator()->random() % 5;
|
||||||
int color0 = Constants::MTG_COLOR_ARTIFACT;
|
int color0 = Constants::MTG_COLOR_ARTIFACT;
|
||||||
|
|
||||||
int colors[] = { color1, color2, color3, color0 };
|
int colors[] = { color1, color2, color3, color0 };
|
||||||
@@ -370,21 +370,21 @@ Player * Rules::loadPlayerRandomThree(GameObserver* observer, int isAI)
|
|||||||
MTGDeck * tempDeck = NEW MTGDeck(MTGCollection());
|
MTGDeck * tempDeck = NEW MTGDeck(MTGCollection());
|
||||||
tempDeck->addRandomCards(1, 0, 0, -1, lands[color1].c_str());
|
tempDeck->addRandomCards(1, 0, 0, -1, lands[color1].c_str());
|
||||||
tempDeck->addRandomCards(1, 0, 0, -1, lands[color2].c_str());
|
tempDeck->addRandomCards(1, 0, 0, -1, lands[color2].c_str());
|
||||||
tempDeck->addRandomCards(1, 0, 0, -1, lands[color3].c_str());
|
tempDeck->addRandomCards(1, 0, 0, -1, lands[color3].c_str());
|
||||||
tempDeck->addRandomCards(6, 0, 0, 'R', lands[color1].c_str());
|
tempDeck->addRandomCards(6, 0, 0, 'R', lands[color1].c_str());
|
||||||
tempDeck->addRandomCards(6, 0, 0, 'R', lands[color2].c_str());
|
tempDeck->addRandomCards(6, 0, 0, 'R', lands[color2].c_str());
|
||||||
tempDeck->addRandomCards(6, 0, 0, 'R', lands[color3].c_str());
|
tempDeck->addRandomCards(6, 0, 0, 'R', lands[color3].c_str());
|
||||||
tempDeck->addRandomCards(3, 0, 0, -1, "land");
|
tempDeck->addRandomCards(3, 0, 0, -1, "land");
|
||||||
tempDeck->addRandomCards(1, 0, 0, 'U', "land");
|
tempDeck->addRandomCards(1, 0, 0, 'U', "land");
|
||||||
tempDeck->addRandomCards(1, 0, 0, 'R', "land");
|
tempDeck->addRandomCards(1, 0, 0, 'R', "land");
|
||||||
tempDeck->addRandomCards(18, 0, 0, -1, "creature", colors, nbcolors);
|
tempDeck->addRandomCards(18, 0, 0, -1, "creature", colors, nbcolors);
|
||||||
tempDeck->addRandomCards(1, 0, 0, 'R', "creature", colors, nbcolors);
|
tempDeck->addRandomCards(1, 0, 0, 'R', "creature", colors, nbcolors);
|
||||||
tempDeck->addRandomCards(1, 0, 0, 'M', "creature", colors, nbcolors);
|
tempDeck->addRandomCards(1, 0, 0, 'M', "creature", colors, nbcolors);
|
||||||
tempDeck->addRandomCards(3, 0, 0, -1, "sorcery", colors, nbcolors);
|
tempDeck->addRandomCards(3, 0, 0, -1, "sorcery", colors, nbcolors);
|
||||||
tempDeck->addRandomCards(3, 0, 0, -1, "enchantment", colors, nbcolors);
|
tempDeck->addRandomCards(3, 0, 0, -1, "enchantment", colors, nbcolors);
|
||||||
tempDeck->addRandomCards(3, 0, 0, -1, "instant", colors, nbcolors);
|
tempDeck->addRandomCards(3, 0, 0, -1, "instant", colors, nbcolors);
|
||||||
tempDeck->addRandomCards(4, 0, 0, -1, "artifact", colors, nbcolors);
|
tempDeck->addRandomCards(4, 0, 0, -1, "artifact", colors, nbcolors);
|
||||||
tempDeck->addRandomCards(1, 0, 0, -1, "planeswalker", colors, nbcolors);
|
tempDeck->addRandomCards(1, 0, 0, -1, "planeswalker", colors, nbcolors);
|
||||||
|
|
||||||
string deckFile = "random";
|
string deckFile = "random";
|
||||||
string deckFileSmall = "random";
|
string deckFileSmall = "random";
|
||||||
@@ -403,9 +403,9 @@ Player * Rules::loadPlayerRandomFive(GameObserver* observer, int isAI)
|
|||||||
MTGDeck * tempDeck = NEW MTGDeck(MTGCollection());
|
MTGDeck * tempDeck = NEW MTGDeck(MTGCollection());
|
||||||
|
|
||||||
tempDeck->addRandomCards(20, 0, 0, -1, "land");
|
tempDeck->addRandomCards(20, 0, 0, -1, "land");
|
||||||
tempDeck->addRandomCards(20, 0, 0, -1, "creature");
|
tempDeck->addRandomCards(20, 0, 0, -1, "creature");
|
||||||
tempDeck->addRandomCards(20, 0, 0, -1, "");
|
tempDeck->addRandomCards(20, 0, 0, -1, "");
|
||||||
|
|
||||||
string deckFile = "random";
|
string deckFile = "random";
|
||||||
string deckFileSmall = "random";
|
string deckFileSmall = "random";
|
||||||
|
|
||||||
@@ -419,59 +419,59 @@ Player * Rules::loadPlayerRandomFive(GameObserver* observer, int isAI)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Player * Rules::loadPlayerHorde(GameObserver* observer, int isAI)
|
Player * Rules::loadPlayerHorde(GameObserver* observer, int isAI)
|
||||||
{
|
{
|
||||||
int nbColors = 1;
|
int nbColors = 1;
|
||||||
string randomTribe = "";
|
string randomTribe = "";
|
||||||
int tribeColor[] = { observer->getRandomGenerator()->random() % 6 };
|
int tribeColor[] = { observer->getRandomGenerator()->random() % 6 };
|
||||||
|
|
||||||
string lands[] = { "land", "forest", "island", "mountain", "swamp", "plains" };
|
string lands[] = { "land", "forest", "island", "mountain", "swamp", "plains" };
|
||||||
|
|
||||||
const char* const multicolorTribes[] = { "Ally", "Eldrazi", "Elemental", "Golem", "Hound", "Human", "Knight",
|
const char* const multicolorTribes[] = { "Ally", "Eldrazi", "Elemental", "Golem", "Hound", "Human", "Knight",
|
||||||
"Myr", "Samurai", "Shaman", "Shapeshifter", "Sliver", "Soldier", "Spellshaper", "Spirit", "Warrior", "Wizard" };
|
"Myr", "Samurai", "Shaman", "Shapeshifter", "Sliver", "Soldier", "Spellshaper", "Spirit", "Warrior", "Wizard" };
|
||||||
const char* const whiteTribes[] = { "Angel", "Bird", "Cat", "cleric", "Griffin", "Kithkin", "Knight", "Soldier", "Spirit", "Wizard" };
|
const char* const whiteTribes[] = { "Angel", "Bird", "Cat", "cleric", "Griffin", "Kithkin", "Knight", "Soldier", "Spirit", "Wizard" };
|
||||||
const char* const blueTribes[] = { "Artificer", "Bird", "Drake", "Faerie", "Illusion", "Merfolk", "Spirit", "Vedalken", "Wizard", "Zombie" };
|
const char* const blueTribes[] = { "Artificer", "Bird", "Drake", "Faerie", "Illusion", "Merfolk", "Spirit", "Vedalken", "Wizard", "Zombie" };
|
||||||
const char* const blackTribes[] = { "Cleric", "Demon", "Faerie", "Horror", "Pirate", "Rat", "Rogue", "Shade", "Skeleton", "Vampire", "Wizard", "Zombie" };
|
const char* const blackTribes[] = { "Cleric", "Demon", "Faerie", "Horror", "Pirate", "Rat", "Rogue", "Shade", "Skeleton", "Vampire", "Wizard", "Zombie" };
|
||||||
const char* const redTribes[] = { "Barbarian", "Berserker"," Cat", "Devil", "Dragon", "Goblin", "Minotaur", "Ogre", "Werewolf", "Wizard" };
|
const char* const redTribes[] = { "Barbarian", "Berserker"," Cat", "Devil", "Dragon", "Goblin", "Minotaur", "Ogre", "Werewolf", "Wizard" };
|
||||||
const char* const greenTribes[] = { "Beast", "Cat", "Centaur", "Dinosaur", "Druid", "Elf", "Fungus", "Snake", "Spider", "Treefolk", "Werewolf", "Wizard" };
|
const char* const greenTribes[] = { "Beast", "Cat", "Centaur", "Dinosaur", "Druid", "Elf", "Fungus", "Snake", "Spider", "Treefolk", "Werewolf", "Wizard" };
|
||||||
|
|
||||||
int multicolorTribesSize = sizeof(multicolorTribes)/sizeof(multicolorTribes[0]);
|
int multicolorTribesSize = sizeof(multicolorTribes)/sizeof(multicolorTribes[0]);
|
||||||
int whiteTribesSize = sizeof(whiteTribes)/sizeof(whiteTribes[0]);
|
int whiteTribesSize = sizeof(whiteTribes)/sizeof(whiteTribes[0]);
|
||||||
int blueTribesSize = sizeof(blueTribes)/sizeof(blueTribes[0]);
|
int blueTribesSize = sizeof(blueTribes)/sizeof(blueTribes[0]);
|
||||||
int blackTribesSize = sizeof(blackTribes)/sizeof(blackTribes[0]);
|
int blackTribesSize = sizeof(blackTribes)/sizeof(blackTribes[0]);
|
||||||
int redTribesSize = sizeof(redTribes)/sizeof(redTribes[0]);
|
int redTribesSize = sizeof(redTribes)/sizeof(redTribes[0]);
|
||||||
int greenTribesSize = sizeof(greenTribes)/sizeof(greenTribes[0]);
|
int greenTribesSize = sizeof(greenTribes)/sizeof(greenTribes[0]);
|
||||||
|
|
||||||
switch (tribeColor[0])
|
switch (tribeColor[0])
|
||||||
{
|
{
|
||||||
case Constants::MTG_COLOR_ARTIFACT :
|
case Constants::MTG_COLOR_ARTIFACT :
|
||||||
randomTribe = multicolorTribes[observer->getRandomGenerator()->random() % multicolorTribesSize];
|
randomTribe = multicolorTribes[observer->getRandomGenerator()->random() % multicolorTribesSize];
|
||||||
nbColors = 0;
|
nbColors = 0;
|
||||||
break;
|
break;
|
||||||
case Constants::MTG_COLOR_WHITE :
|
case Constants::MTG_COLOR_WHITE :
|
||||||
randomTribe = whiteTribes[observer->getRandomGenerator()->random() % whiteTribesSize];
|
randomTribe = whiteTribes[observer->getRandomGenerator()->random() % whiteTribesSize];
|
||||||
break;
|
break;
|
||||||
case Constants::MTG_COLOR_BLUE :
|
case Constants::MTG_COLOR_BLUE :
|
||||||
randomTribe = blueTribes[observer->getRandomGenerator()->random() % blueTribesSize];
|
randomTribe = blueTribes[observer->getRandomGenerator()->random() % blueTribesSize];
|
||||||
break;
|
break;
|
||||||
case Constants::MTG_COLOR_BLACK :
|
case Constants::MTG_COLOR_BLACK :
|
||||||
randomTribe = blackTribes[observer->getRandomGenerator()->random() % blackTribesSize];
|
randomTribe = blackTribes[observer->getRandomGenerator()->random() % blackTribesSize];
|
||||||
break;
|
break;
|
||||||
case Constants::MTG_COLOR_RED :
|
case Constants::MTG_COLOR_RED :
|
||||||
randomTribe = redTribes[observer->getRandomGenerator()->random() % redTribesSize];
|
randomTribe = redTribes[observer->getRandomGenerator()->random() % redTribesSize];
|
||||||
break;
|
break;
|
||||||
case Constants::MTG_COLOR_GREEN :
|
case Constants::MTG_COLOR_GREEN :
|
||||||
randomTribe = greenTribes[observer->getRandomGenerator()->random() % greenTribesSize];
|
randomTribe = greenTribes[observer->getRandomGenerator()->random() % greenTribesSize];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
MTGDeck * tempDeck = NEW MTGDeck(MTGCollection());
|
MTGDeck * tempDeck = NEW MTGDeck(MTGCollection());
|
||||||
tempDeck->addRandomCards(16, 0, 0, -1, lands[tribeColor[0]].c_str());
|
tempDeck->addRandomCards(16, 0, 0, -1, lands[tribeColor[0]].c_str());
|
||||||
tempDeck->addRandomCards(4, 0, 0, 'R', lands[tribeColor[0]].c_str());
|
tempDeck->addRandomCards(4, 0, 0, 'R', lands[tribeColor[0]].c_str());
|
||||||
tempDeck->addRandomCards(4, 0, 0, -1, "land");
|
tempDeck->addRandomCards(4, 0, 0, -1, "land");
|
||||||
tempDeck->addRandomCards(21, 0, 0, -1, randomTribe);
|
tempDeck->addRandomCards(21, 0, 0, -1, randomTribe);
|
||||||
tempDeck->addRandomCards(5, 0, 0, -1, "enchantment", tribeColor, nbColors);
|
tempDeck->addRandomCards(5, 0, 0, -1, "enchantment", tribeColor, nbColors);
|
||||||
tempDeck->addRandomCards(5, 0, 0, -1, "instant", tribeColor, nbColors);
|
tempDeck->addRandomCards(5, 0, 0, -1, "instant", tribeColor, nbColors);
|
||||||
tempDeck->addRandomCards(5, 0, 0, -1, "sorcery", tribeColor, nbColors);
|
tempDeck->addRandomCards(5, 0, 0, -1, "sorcery", tribeColor, nbColors);
|
||||||
|
|
||||||
string deckFile = "random";
|
string deckFile = "random";
|
||||||
string deckFileSmall = "random";
|
string deckFileSmall = "random";
|
||||||
@@ -502,14 +502,14 @@ Player * Rules::initPlayer(GameObserver *g, int playerId)
|
|||||||
return loadPlayerRandom(g, isAI, GAME_TYPE_RANDOM1);
|
return loadPlayerRandom(g, isAI, GAME_TYPE_RANDOM1);
|
||||||
case GAME_TYPE_RANDOM2:
|
case GAME_TYPE_RANDOM2:
|
||||||
return loadPlayerRandom(g, isAI, GAME_TYPE_RANDOM2);
|
return loadPlayerRandom(g, isAI, GAME_TYPE_RANDOM2);
|
||||||
case GAME_TYPE_RANDOM3:
|
case GAME_TYPE_RANDOM3:
|
||||||
return loadPlayerRandomThree(g, isAI);
|
return loadPlayerRandomThree(g, isAI);
|
||||||
case GAME_TYPE_RANDOM5:
|
case GAME_TYPE_RANDOM5:
|
||||||
return loadPlayerRandomFive(g, isAI);
|
return loadPlayerRandomFive(g, isAI);
|
||||||
case GAME_TYPE_HORDE:
|
case GAME_TYPE_HORDE:
|
||||||
return loadPlayerHorde(g, isAI);
|
return loadPlayerHorde(g, isAI);
|
||||||
case GAME_TYPE_SET_LIMITED:
|
case GAME_TYPE_SET_LIMITED:
|
||||||
return loadRandomSetLimited(g, isAI);
|
return loadRandomSetLimited(g, isAI);
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -815,10 +815,10 @@ GameType Rules::strToGameMode(string s)
|
|||||||
if (s.compare("momir") == 0) return GAME_TYPE_MOMIR;
|
if (s.compare("momir") == 0) return GAME_TYPE_MOMIR;
|
||||||
if (s.compare("random1") == 0) return GAME_TYPE_RANDOM1;
|
if (s.compare("random1") == 0) return GAME_TYPE_RANDOM1;
|
||||||
if (s.compare("random2") == 0) return GAME_TYPE_RANDOM2;
|
if (s.compare("random2") == 0) return GAME_TYPE_RANDOM2;
|
||||||
if (s.compare("random3") == 0) return GAME_TYPE_RANDOM3;
|
if (s.compare("random3") == 0) return GAME_TYPE_RANDOM3;
|
||||||
if (s.compare("random5") == 0) return GAME_TYPE_RANDOM5;
|
if (s.compare("random5") == 0) return GAME_TYPE_RANDOM5;
|
||||||
if (s.compare("horde") == 0) return GAME_TYPE_HORDE;
|
if (s.compare("horde") == 0) return GAME_TYPE_HORDE;
|
||||||
if (s.compare("set_limited") == 0) return GAME_TYPE_SET_LIMITED;
|
if (s.compare("set_limited") == 0) return GAME_TYPE_SET_LIMITED;
|
||||||
if (s.compare("story") == 0) return GAME_TYPE_STORY;
|
if (s.compare("story") == 0) return GAME_TYPE_STORY;
|
||||||
if (s.compare("stonehewer") == 0) return GAME_TYPE_STONEHEWER;
|
if (s.compare("stonehewer") == 0) return GAME_TYPE_STONEHEWER;
|
||||||
if (s.compare("hermit") == 0) return GAME_TYPE_HERMIT;
|
if (s.compare("hermit") == 0) return GAME_TYPE_HERMIT;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const KeyRep& translateKey(LocalKeySym key)
|
|||||||
#elif defined (SDL_CONFIG)
|
#elif defined (SDL_CONFIG)
|
||||||
str = (char*)SDL_GetKeyName(key);
|
str = (char*)SDL_GetKeyName(key);
|
||||||
#elif defined (QT_CONFIG)
|
#elif defined (QT_CONFIG)
|
||||||
str = (char*)QKeySequence(key).toString().toUtf8().constData();
|
str = (char*)QKeySequence(key).toString().toUtf8().constData();
|
||||||
#endif
|
#endif
|
||||||
if (!str)
|
if (!str)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user