Sound Voltex Grade implemeentation complete (#3)

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 3 years ago
parent a0c92e7b38
commit ea48c681b4
  1. 2
      ArcadeReader.java
  2. 26
      readers/SoundVoltexReader.java
  3. BIN
      result.png
  4. 2
      sigPlace.java
  5. BIN
      sub.png

@ -59,6 +59,6 @@ public class ArcadeReader {
*
*/
public static void retrieveData(Path img) {
new ITGReader().interpretBoxes(img);
new SoundVoltexReader().interpretBoxes(img);
}
}

@ -20,6 +20,8 @@ public class SoundVoltexReader extends Reader{
final static int REGION_PADDING = 32;
List<Box> extraRegions = new ArrayList<>();
static int lastJump=0;
boolean effectiveRate=false;
boolean failed=false;
public SoundVoltexReader(){
addRegion(new Box(385,1006,454,29)); //title[0]
addRegion(new Box(476,1075,242,57),NUMBER); //bigscore[1]
@ -337,6 +339,12 @@ public class SoundVoltexReader extends Reader{
sig_data[counter++]=val;
currentHeight+=readRegions.get(i).h+REGION_PADDING;
}
//912,1204
Color col = new Color(originalImg.getRGB(912,1204),true);
ColorRange range = new ColorRange(90,110,225,245,250,255);
if (range.colorInRange(col)) {
effectiveRate=true;
}
Path output = Paths.get("result.png");
ImageIO.write(cutImg,"png",output.toFile());
String dataString = readAllBoxes(output);
@ -414,10 +422,13 @@ public class SoundVoltexReader extends Reader{
score=convertToInt(new String[]{Integer.toString(score),Integer.toString(score2)});
}break;
case 3:{
other+="ex:"+Integer.toString(convertToInt("EX SCORE",splitter))+",";
other+="{ex:"+Integer.toString(convertToInt("EX SCORE",splitter))+",";
}break;
case 4:{
pct=convertToDouble(splitter);//We're lucky excessive and effective rate have the same number of characters...
if (effectiveRate&&pct<70) {
failed=true;
}
}break;
case 5:{
notes[0]=convertToInt("ERROR",splitter);
@ -470,6 +481,19 @@ public class SoundVoltexReader extends Reader{
case 21:{
difficulty=convertToInt("EXH",splitter);
}break;
case 22:{
other+="failed:"+failed+"}";
if (score>=9900000) {rank=0;/*S*/} else
if (score>=9800000) {rank=1;/*AAA+*/} else
if (score>=9700000) {rank=2;/*AAA*/} else
if (score>=9500000) {rank=3;/*AA+*/} else
if (score>=9300000) {rank=4;/*AA*/} else
if (score>=9000000) {rank=5;/*A+*/} else
if (score>=8700000) {rank=6;/*A*/} else
if (score>=8000000) {rank=7;/*B*/} else
if (score>=7000000) {rank=8;/*C*/} else
{rank=9;/*D*/}
}break;
}
}
System.out.println(this);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

@ -116,7 +116,7 @@ public class sigPlace {
// TODO Auto-generated catch block
e.printStackTrace();
}*/
ArcadeReader.retrieveData(Paths.get("itg15.png"));
ArcadeReader.retrieveData(Paths.get("sdvx4.png"));
/* Path secretFile = Paths.get(".clientsecret");
List<String> data;
try {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Loading…
Cancel
Save