If the AI has a weapon, and I have a weapon, and the AI has a crusader on the field ready to endow a weapon, whose does it endow? Which weapons have priority?
The algorithm for selecting a weapon to endow is actually quite complex. I'll post it here later.
Okay, it's not actually that complex. Note that it goes through all weapons, both permanent and creature.
First it gives each weapon a skillscore based on this formula:
If weapon skill is triggered (manually activated),
skillscore = AI quanta in skill element / (1 + skillcost).
Otherwise,
skillscore = 1.
Then it gives each weapon a score:
Score = weapon attack + skillscoreWeapon with the highest score will be targeted. In short, it takes both weapon damage and whether it can readily pay for the weapon's skill into account.
How does the AI use Catapults? I got it as an arena oracle card and I tried making a Flying Titan decks for lols, but when I tested it the AI wasn't using it, prefer to hack away with me turn by turn rather than finish the game with a quick throw.
First an estimate is made. If the AI has more than 20 creatures on the field, the estimate is 100. If the player has 20 or less creature, the estimate is 20. Then it gives each of its creatures a score:
Score = (estimate * current HP of creature) / (player HP + 1) + (number of turns creature is frozen for) + (poison counters on creature)*3 - (current attack of creature)/20And it only decides to use catapult if the maximum score found > random score, where:
Random score = ((random number between 0 and 1) + 0.1) / (number of cards in AI hand)Why does the AI withhold playing something (referring to permanents here) even though playing it would save handroom (preventing discarding) and act as a contingency?
Because it's not smart enough.
I've talked about the algorithm for playing shields and weapons before - generally a weapon or shield will be played if its cost is greater than the one currently equipped.
Sundial will only be played if player has Phase Shield or damage player is dealing > damage AI is dealing.
Flooding will only be played if the field is not already flooded and the player has 7 or more creatures (Zanz obviously forgot to change this - it should be 5).
Cloak will not be played if there is one on the AI's field with counters left on it.
Nightfall will not be played if there is Nightfall or Eclipse already on the field.
Eclipse will not be played if there is Eclipse already on the field.