Skip to content

Commit

Permalink
fix: CoC and illegal move to dragon tile
Browse files Browse the repository at this point in the history
  • Loading branch information
farin committed Mar 26, 2023
1 parent d68feeb commit bdae7b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

## upcoming 5.12
* rules: fairy on acrobats, all meeples in pyramid are awarded
* rules: Wagon is now not allowed to move onto castle (empty castle is considered completed)
* rules: move from CoC can't move to dragon tile
* fix: second Phantom action is not available when Abbey And Mayor expansion is enabled
* fix: Barn can be undeployed with Festival tile
* fix: Wagon is now not allowed to move onto castle (empty castle is considered completed)

## 5.11.1
*2023-03-16*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
import com.jcloisterzone.action.MeepleAction;
import com.jcloisterzone.board.Location;
import com.jcloisterzone.board.Position;
import com.jcloisterzone.board.Tile;
import com.jcloisterzone.board.pointer.FeaturePointer;
import com.jcloisterzone.feature.*;
import com.jcloisterzone.figure.Follower;
import com.jcloisterzone.game.Capability;
import com.jcloisterzone.game.capability.CountCapability;
import com.jcloisterzone.game.state.ActionsState;
import com.jcloisterzone.game.state.GameState;
import com.jcloisterzone.game.state.PlacedTile;
import com.jcloisterzone.io.message.DeployMeepleMessage;
import com.jcloisterzone.io.message.PassMessage;
import com.jcloisterzone.random.RandomGenerator;
Expand Down Expand Up @@ -55,7 +58,13 @@ protected StepResult processPlayer(GameState state, Player player) {
Set<FeaturePointer> options = state.getFeatures(getFeatureTypeForLocation(quarter))
.filter(filter::apply)
.flatMap(Feature::getPlaces)
.toSet();
.toSet()
.filter(tp -> {
for (Capability<?> cap : state.getCapabilities().toSeq()) {
if (!cap.isMeepleDeploymentAllowed(state, tp.getPosition())) return false;
}
return true;
});

if (options.isEmpty()) {
return List.empty();
Expand Down

0 comments on commit bdae7b8

Please sign in to comment.