Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
5abd65c7b4
5 changed files with 40 additions and 4 deletions
|
@ -68,7 +68,7 @@ public class Game extends ApplicationAdapter {
|
|||
|
||||
if (input.isKeyJustPressed(Input.Keys.R) && round.getRerolls() > 0) { //reroll dice that aren't locked
|
||||
reroll();
|
||||
round.reduceRerolls(0);
|
||||
round.reduceRerolls(1);
|
||||
}
|
||||
|
||||
if (input.isKeyPressed(Input.Keys.SHIFT_LEFT)) {
|
||||
|
@ -78,11 +78,13 @@ public class Game extends ApplicationAdapter {
|
|||
if (input.isKeyJustPressed(keyCode)) {
|
||||
Segment segment = round.getSegments().get(i);
|
||||
|
||||
if (segment.isDestroyedBy(getSelectedDice())) { //if can be destroyed with selected
|
||||
if (!segment.isDestroyed() && segment.isDestroyedBy(getSelectedDice())) { //if can be destroyed with selected
|
||||
segment.destroy();
|
||||
|
||||
round.getDecays().forEach(d -> d.getDecayed(getSelectedDice()).forEach(Die::decay)); //apply all decay rules
|
||||
dice.forEach(d -> d.setSelected(false));
|
||||
// reroll();
|
||||
|
||||
dice.forEach(d -> d.setSelected(false)); //unselect all dice
|
||||
reroll(); //reroll
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,4 +55,14 @@ public class DualSegment extends Segment {
|
|||
&& (!firstTrio || countCounts.getOrDefault(3, 0) >= 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpriteColumn() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpriteRow() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,4 +36,14 @@ public class KinSegment extends Segment { //multiple dice of the same value
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpriteColumn() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpriteRow() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,4 +47,14 @@ public class OlympicSegment extends Segment {
|
|||
return best >= length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpriteColumn() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpriteRow() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -39,4 +39,8 @@ public abstract class Segment {
|
|||
return destroyed;
|
||||
}
|
||||
|
||||
public abstract int getSpriteColumn();
|
||||
|
||||
public abstract int getSpriteRow();
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue