#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.
format is as follows
HINT#combo hold(blah|myhand)^until(blah|mygraveyard)^until(blah|opponentshand)^restriction{type(creature|mybattlefield)~morethan~2}^cast(blah) targeting(blah|mygraveyard)^totalmananneeded({g}{g}{r}{u}{2})
the ai can be told to hold more then one card, until as many condiations as you want are met, until( is a TC and can basically be used in a fasion of saying "hold arbor elf until you have a lord of atlantas in play and a gaint growth in you hand"
once the condiations are met you can later tell it to cast(gaint growth) targeting(arbor elf[fresh]|mybattlefield)...
I also included the whole of the games restrictions system...
so you can get really really creative with this so far.
the next thing I will do is ability targeting and card favoring.
this is a method to set the order in which ai decides to play cards, you can for example tell ai to look for 2 instants, before trying to find a creature.
be sure to list all main types of the deck otherwise ai will pass on stuff
this is the current
const char* types[] = {"planeswalker","creature", "enchantment", "artifact", "sorcery", "instant"};
so be sure you include them if the decks need them.
other the above example would be coded
HINT:castpriority(instant,instant,creature,planeswalker,enchantment,artifact,sorcery)
as you can see this deck will now look for and play if possible, 2 instants before any of the other types.
this will really help with decks which rely on cards like dark ritual to produce mana to cast creature, simply by listing instant before creature. if the deck had dark rituals, in the above example, and it had them in hand, it would then cast dark ritual, dark ritual, then one of the remaining types. this is actually tested not just assumed.
which tells the ai not to use the targetible cards as attackers, this can be card names, and CD modes.
modified the way ai handles multikicker. it will not be casting 1/1 joragas anymore :D
made WParsedInt ignore "+" signs....
added a new affinity ability...autohand=affinity(creature[vampire]|mygraveyard) ....
this is essentially affinity for creatures in your grave.
added supkeyword to clone clone addtype(zombie)....it adds the type listed to the cards types on clone...
reparse PT bonus on resolve.
reworked bushido, it should now work correctly...aside from that it now excepts word variables...fumiko is now bushido(type:creature[attacking]:battlefield/type:creature[attacking]:battlefield)
added a keyword to access acontrolsteal..the keyword is "steal"
auto=ueot steal target(creature)
reworked persist to handle undying..added the new counter handling rules intruduced by wotc in ISD
added a vector cardsAbilities to mtgcardinstance...this keeps the abilities added to the game for a card to use stored where we can easly alter or remove them.
added an automatic increase to geteff return if the ability is a putinplay ability.
finished coding support for flip and double sided cards, though viewing the "other side" is still not possible yet.
the ability follows the mtg rules.
the ability syntax is flip(card name)...a card can flip into any other card by name...even flip into itself.
added a "canPay() call for Ninja cost...to prevent it from coming up in a menu unless you're in blockers....
added 3 new restriction types that work very similar to type(
thisturn(tc)~morethan~2
lastturn(tc)~lessthan~thisturn(tc)
compare(wordvarible)~equalto~compare(wordvarible)
these are pretty self explanitory.
moved "&&" ability parsing below "this(" allowing "this(" to grant abilities now which contain &&...enclave egologist bug is fixed by this.
fixed an issue with combatspirit link for some reason the way i was doing the bool was not always working.
took care of the todo for AProtectionFrom...you can now give a protection from(blah) in a instant or ueot ability.
added altho very limited right now a "targetedplayer" tc word. i hope to increase this with time.
as always my sidekick doc already has some cards coded for this and test will follow the addition of the cards.
-- This is a copy/paste and shouldn't have any impact on the logic. I just moved some functions from AIPlayer to AIPlayerBaka
- Added back the possibility to select a different Resource folder with file Res.txt
- Fix a crash when a token id does not exist
- Fixed a Bug where AI would not correctly assign blockers if the first attacker is super strong.
- Added a hack to prevent AI from an infinite loop while choosing a target. There are edge cases where the AI gets to choose the targets for a TargetChooser that doesn't belong to it. I couldn't dig too long for the root cause, so I added a "return 0" when the case happens. Should probably open a ticket
- Added a "Hint" System in AI decks, to help the AI with its strategy. This is not really usable yet, it only works with abilities (not cards to play), and I only added some basic code for counters and tokens. This can probably be extended, but let's wait until we see it working on that other game I'm working on, before rushing into adding hints to all AI decks...
- minor cleanup of AI Code