diff --git a/core/src/com/monjaro/gamejam/main/Game.java b/core/src/com/monjaro/gamejam/main/Game.java index 0a928e4..9edda8f 100644 --- a/core/src/com/monjaro/gamejam/main/Game.java +++ b/core/src/com/monjaro/gamejam/main/Game.java @@ -8,10 +8,7 @@ import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.utils.ScreenUtils; import com.monjaro.gamejam.SegmentUI; -import com.monjaro.gamejam.segment.DualSegment; -import com.monjaro.gamejam.segment.KinSegment; -import com.monjaro.gamejam.segment.OlympicSegment; -import com.monjaro.gamejam.segment.Segment; +import com.monjaro.gamejam.segment.*; import java.util.ArrayList; import java.util.List; @@ -41,7 +38,7 @@ public class Game extends ApplicationAdapter { segUi = new SegmentUI(); ui = new UI(this, 50, 280); - round = new Round(List.of(new OlympicSegment(1), new OlympicSegment(3), new KinSegment(3), new DualSegment(false)), List.of(new ParityDecay(true)), 5); + round = new Round(List.of(new OlympicSegment(1), new OlympicSegment(3), new KinSegment(3), new DualSegment(false)), List.of(new TallDecay()), 5); Face.setBlankFaceSprite(new Texture("blank_die_face.png")); Face.setPipSprite(new Texture("pip.png")); diff --git a/core/src/com/monjaro/gamejam/segment/TallDecay.java b/core/src/com/monjaro/gamejam/segment/TallDecay.java new file mode 100644 index 0000000..33e62f8 --- /dev/null +++ b/core/src/com/monjaro/gamejam/segment/TallDecay.java @@ -0,0 +1,32 @@ +package com.monjaro.gamejam.segment; + +import com.monjaro.gamejam.main.Decay; +import com.monjaro.gamejam.main.Die; + +import java.util.ArrayList; +import java.util.List; + +public class TallDecay extends Decay { + + public TallDecay() { + description = "All used dice with HIGHEST value decay."; + } + + @Override + public List getDecayed(List dice) { + int highestValue = -1; + List targets = new ArrayList<>(); + + for (Die die : dice) { + if (die.isFaceBlank()) continue; + + if (die.getFaceValue() < highestValue) continue; + + targets.add(die); + highestValue = die.getFaceValue(); + } + + return targets; + } + +}