Merge pull request #4879 from spjspj/master

Add planechase to new tournament window as well.
This commit is contained in:
spjspj 2018-05-02 18:31:59 +10:00 committed by GitHub
commit 4b4d7989cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 7 deletions

View file

@ -98,6 +98,7 @@ public class TournamentOptions implements Serializable {
public void setPlaneChase(boolean planeChase) {
this.planeChase = planeChase;
this.matchOptions.setPlaneChase(planeChase);
}
public int getNumberRounds() {

View file

@ -2499,7 +2499,7 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public PlanarDieRoll rollPlanarDie(Game game, ArrayList<UUID> appliedEffects) {
return rollPlanarDie(game, appliedEffects, 1, 1);
return rollPlanarDie(game, appliedEffects, 2, 2);
}
/**
@ -2514,15 +2514,15 @@ public abstract class PlayerImpl implements Player, Serializable {
*/
@Override
public PlanarDieRoll rollPlanarDie(Game game, ArrayList<UUID> appliedEffects, int numberChaosSides, int numberPlanarSides) {
int result = RandomUtil.nextInt(6) + 1;
int result = RandomUtil.nextInt(9) + 1;
PlanarDieRoll roll = PlanarDieRoll.NIL_ROLL;
if (numberChaosSides + numberPlanarSides > 6) {
numberChaosSides = 1;
numberPlanarSides = 1;
if (numberChaosSides + numberPlanarSides > 9) {
numberChaosSides = 2;
numberPlanarSides = 2;
}
if (result <= numberChaosSides) {
roll = PlanarDieRoll.CHAOS_ROLL;
} else if (result > 6 - numberPlanarSides) {
} else if (result > 9 - numberPlanarSides) {
roll = PlanarDieRoll.PLANAR_ROLL;
}
if (!game.isSimulation()) {