AI not playing cards in the Upkeep phase
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
2 posts
• Page 1 of 1
AI not playing cards in the Upkeep phase
by Sloth » 29 Sep 2011, 20:08
Slapshot scripted Mirror Universe but noticed the AI won't use it. I was curious and checked the AI code and found the reason is that the Upkeep phase is not used by the AI at all:
Is there any reason for excluding this phase?
- | Open
- Code: Select all
public final void stackResponse() {
// if top of stack is empty
SpellAbility[] sas = null;
if (AllZone.getStack().size() == 0) {
sas = getOtherPhases();
boolean pass = (sas.length == 0)
|| AllZone.getPhase().is(Constant.Phase.Upkeep, AllZone.getComputerPlayer())
|| AllZone.getPhase().is(Constant.Phase.Draw, AllZone.getComputerPlayer())
|| AllZone.getPhase().is(Constant.Phase.End_Of_Turn, AllZone.getComputerPlayer());
if (!pass) { // Each AF should check the phase individually
pass = ComputerUtil.playCards(sas);
}
if (pass) {
AllZone.getPhase().passPriority();
}
return;
}
Is there any reason for excluding this phase?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: AI not playing cards in the Upkeep phase
by friarsol » 29 Sep 2011, 20:27
Not really. It was primarily to reduce the amount of times the AI would try to activate abilities, especially ones it shouldn't be activating. I think the Upkeep should be fine to remove, especially for cases when the only time the AI can activate something is during that Phase.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 61 guests