Page 1 of 1

APNAP

PostPosted: 15 Jul 2014, 10:02
by ShawnieBoy
Active Player, Non-Active Player.

For effects which affect all players at the 'same time', we're generally using a for loop for all players:

Code: Select all
for (final MagicPlayer player : game.getPlayers())
This loop will always start with the non-AI player (As found out with the log messages) - However coding everything long-hand to occur in the correct order would take up space and be quite cumbersome.

Would creating a MagicFor/MagicLoop be feasible? Some of the loops can get quite deep, and themselves hold loops of their own.

Although actually - maybe just changing the game.getPlayers() to order the fetched players in APNAP order. (Always miss the obvious, lol)

Re: APNAP

PostPosted: 15 Jul 2014, 13:14
by melvin
Modifying an existing method may break existing code that expects the order to be player then AI. A new method, say game.getAPNAP(), will be clearer.

Re: APNAP

PostPosted: 15 Jul 2014, 13:26
by ShawnieBoy
Yes, very good point. I'll have a look at an APNAP method. (I also just like saying APNAP :D)

Re: APNAP

PostPosted: 15 Jul 2014, 14:39
by ShawnieBoy
Have something added, but now confusing myself with the application of multiple choices across players...

Pox for example

Each player in APNAP order performs all actions
or
Each player performs each action in APNAP order?

Haven't found anything concrete, but is it "Each player loses a third of his or her life, then [each player] discards a third..." etc or Player 1 does everything, then Player 2?

As we don't have simultaneous discard/sacrifice etc, and that APNAP applies to choices. I'd say the former, even though it's not really how it works in the real world.

Re: APNAP

PostPosted: 15 Jul 2014, 17:08
by jerichopumpkin
ShawnieBoy wrote:Have something added, but now confusing myself with the application of multiple choices across players...

Pox for example

Each player in APNAP order performs all actions
or
Each player performs each action in APNAP order?

Haven't found anything concrete, but is it "Each player loses a third of his or her life, then [each player] discards a third..." etc or Player 1 does everything, then Player 2?

As we don't have simultaneous discard/sacrifice etc, and that APNAP applies to choices. I'd say the former, even though it's not really how it works in the real world.
I think that "Each player loses a third of his or her life, then [each player] discards a third..." would be the right answer, but I'm not totally sure. In any case, I don't think choosing either way would impact the game, since nothing can happen (except for triggers, but they would be resolved only once Pox is resolved) during the resolution of the effect... So just go for the easiest to implement ;)

Re: APNAP

PostPosted: 15 Jul 2014, 17:22
by ShawnieBoy
jerichopumpkin wrote:I think that "Each player loses a third of his or her life, then [each player] discards a third..." would be the right answer, but I'm not totally sure. In any case, I don't think choosing either way would impact the game, since nothing can happen (except for triggers, but they would be resolved only once Pox is resolved) during the resolution of the effect... So just go for the easiest to implement ;)
Well, the only thing that can happen between them, is the possible choice of what to sacrifice.

If it's the first option, the active player chooses which creatures to sacrifice first, then the opponent chooses. The same for lands. So the inactive player has the advantage of knowing what the active player is going to sacrifice.

This information can also give the active player an advantage when multiple choice actions are involved.

Take an example where the active player has made his or her creature sacrifice choices, then the opponent does. The opponent has chosen not to sacrifice a creature with a landwalk ability. The active player can then use that information to choose to sacrifice lands of that type to nullify the landwalk ability. This is before anything leaves the battlefield.

This isn't possible if the active player makes all choices first, then the opponent. But I don't know which is correct #-o

edited for clarity

Re: APNAP

PostPosted: 15 Jul 2014, 20:06
by ShawnieBoy
Sorted - each event occurs separately during resolution. So the process for Pox would be:

AP = Active player
NAP = Non-Active player

AP + NAP: Lose 1/3 life.
AP: Chooses a 1/3 of hand to discard (Hidden information if hand is hidden).
NAP: Chooses a 1/3 of hand to discard (Hidden information if hand is hidden).
AP + NAP: Discards chosen cards.
AP: Chooses a 1/3 of creatures to sacrifice (Public information as creatures are visible)
NAP: Chooses a 1/3 of creatures to sacrifice (Public information as creatures are visible)
AP + NAP: Sacrifice chosen creatures.
AP: Chooses a 1/3 of lands to sacrifice (Public information as lands are visible)
NAP: Chooses a 1/3 of lands to sacrifice (Public information as lands are visible)
AP + NAP: Sacrifice chosen lands.

Triggered abilities would be added to the stack in APNAP order when they trigger, but won't resolve until all the actions have completed.