Skip to content

Commit

Permalink
implements skin property (score points for 5key and 9key , draw flag …
Browse files Browse the repository at this point in the history
…for result)
  • Loading branch information
exch-bms2 committed May 9, 2017
1 parent f834fa0 commit 0e46886
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 4 deletions.
16 changes: 16 additions & 0 deletions src/bms/player/beatoraja/IRScoreData.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package bms.player.beatoraja;

import bms.model.Mode;

/**
* スコアデータ
* LR2のスコアデータを元に拡張している
Expand Down Expand Up @@ -91,6 +93,16 @@ public class IRScoreData {
private int state;

private String scorehash = "";

private final Mode playmode;

public IRScoreData() {
this(Mode.BEAT_7K);
}

public IRScoreData(Mode playmode) {
this.playmode = playmode;
}

public long getDate() {
return date;
Expand Down Expand Up @@ -302,4 +314,8 @@ public int getDevice() {
public void setDevice(int device) {
this.device = device;
}

public Mode getPlaymode() {
return playmode;
}
}
27 changes: 25 additions & 2 deletions src/bms/player/beatoraja/ScoreDataProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,31 @@ public void update(IRScoreData score) {
public void update(IRScoreData score, int notes) {
final int exscore = score != null ? score.getExscore() : 0;
final int totalnotes = score != null ? score.getNotes() : 0;
nowpoint = score != null ? (int)((long)150000 * score.getJudgeCount(0) + 100000 * score.getJudgeCount(1) + 20000 * score.getJudgeCount(2))
/ score.getNotes() + (int)((long)50000 * score.getCombo() / score.getNotes()) : 0;
if(score != null) {
switch (score.getPlaymode()) {
case BEAT_5K:
case BEAT_10K:
nowpoint = (int)((long)100000 * score.getJudgeCount(0) + 100000 * score.getJudgeCount(1) + 50000 * score.getJudgeCount(2))
/ score.getNotes();
break;
case BEAT_7K:
case BEAT_14K:
nowpoint = (int)((long)150000 * score.getJudgeCount(0) + 100000 * score.getJudgeCount(1) + 20000 * score.getJudgeCount(2))
/ score.getNotes() + (int)((long)50000 * score.getCombo() / score.getNotes());
break;
case POPN_5K:
case POPN_9K:
nowpoint = (int)((long)100000 * score.getJudgeCount(0) + 70000 * score.getJudgeCount(1) + 40000 * score.getJudgeCount(2))
/ score.getNotes();
break;
default:
nowpoint = (int)((long)1000000 * score.getJudgeCount(0) + 700000 * score.getJudgeCount(1) + 400000 * score.getJudgeCount(2))
/ score.getNotes();
break;
}
} else {
nowpoint = 0;
}
nowscore = exscore;
rate = totalnotes == 0 ? 1.0f : ((float)exscore) / (totalnotes * 2);
rateInt = (int)(rate * 100);
Expand Down
2 changes: 1 addition & 1 deletion src/bms/player/beatoraja/play/BMSPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public void render() {
judge.init(model, resource);
notes = 0;
starttimeoffset = (property.starttime > 1000 ? property.starttime - 1000 : 0) * 100 / property.freq;
playtime = (property.endtime + 1000) * 100 / property.freq;
playtime = (property.endtime + 1000) * 100 / property.freq + TIME_MARGIN;
bga.prepare(this);
state = STATE_READY;
timer[TIMER_READY] = now;
Expand Down
2 changes: 1 addition & 1 deletion src/bms/player/beatoraja/play/JudgeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void init(BMSModel model, PlayerResource resource) {
judge = new int[20];
judgenow = new int[((PlaySkin) main.getSkin()).getJudgeregion()];
judgecombo = new int[((PlaySkin) main.getSkin()).getJudgeregion()];
score = new IRScoreData();
score = new IRScoreData(model.getMode());
score.setNotes(model.getTotalNotes());
score.setSha256(model.getSHA256());

Expand Down
8 changes: 8 additions & 0 deletions src/bms/player/beatoraja/result/GradeResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,20 @@ public boolean getBooleanValue(int id) {
return score.getClear() == GrooveGauge.CLEARTYPE_FAILED;
case OPTION_UPDATE_SCORE:
return score.getExscore() > oldexscore;
case OPTION_DRAW_SCORE:
return score.getExscore() == oldexscore;
case OPTION_UPDATE_MAXCOMBO:
return score.getCombo() > oldcombo;
case OPTION_DRAW_MAXCOMBO:
return score.getCombo() == oldcombo;
case OPTION_UPDATE_MISSCOUNT:
return score.getMinbp() < oldmisscount;
case OPTION_DRAW_MISSCOUNT:
return score.getMinbp() == oldmisscount;
case OPTION_UPDATE_SCORERANK:
return getScoreDataProperty().getNowRate() > getScoreDataProperty().getBestScoreRate();
case OPTION_DRAW_SCORERANK:
return getScoreDataProperty().getNowRate() == getScoreDataProperty().getBestScoreRate();
case OPTION_NO_REPLAYDATA:
return !getMainController().getPlayDataAccessor().existsReplayData(resource.getCourseBMSModels(),
resource.getConfig().getLnmode(), 0,resource.getConstraint());
Expand Down
8 changes: 8 additions & 0 deletions src/bms/player/beatoraja/result/MusicResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,20 @@ public boolean getBooleanValue(int id) {
|| (cscore != null && cscore.getClear() == GrooveGauge.CLEARTYPE_FAILED);
case OPTION_UPDATE_SCORE:
return score.getExscore() > oldexscore;
case OPTION_DRAW_SCORE:
return score.getExscore() == oldexscore;
case OPTION_UPDATE_MAXCOMBO:
return score.getCombo() > oldcombo;
case OPTION_DRAW_MAXCOMBO:
return score.getCombo() == oldcombo;
case OPTION_UPDATE_MISSCOUNT:
return score.getMinbp() < oldmisscount;
case OPTION_DRAW_MISSCOUNT:
return score.getMinbp() == oldmisscount;
case OPTION_UPDATE_SCORERANK:
return getScoreDataProperty().getNowRate() > getScoreDataProperty().getBestScoreRate();
case OPTION_DRAW_SCORERANK:
return getScoreDataProperty().getNowRate() == getScoreDataProperty().getBestScoreRate();
case OPTION_NO_REPLAYDATA:
return !getMainController().getPlayDataAccessor().existsReplayData(resource.getBMSModel(),
resource.getConfig().getLnmode(), 0);
Expand Down
4 changes: 4 additions & 0 deletions src/bms/player/beatoraja/skin/SkinProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,15 @@ public class SkinProperty {
public static final int OPTION_BEST_F_1P = 327;

public static final int OPTION_UPDATE_SCORE = 330;
public static final int OPTION_DRAW_SCORE = 1330;
public static final int OPTION_UPDATE_MAXCOMBO = 331;
public static final int OPTION_DRAW_MAXCOMBO = 1331;
public static final int OPTION_UPDATE_MISSCOUNT = 332;
public static final int OPTION_DRAW_MISSCOUNT = 1332;
public static final int OPTION_UPDATE_TRIAL = 333;
public static final int OPTION_UPDATE_IRRANK = 334;
public static final int OPTION_UPDATE_SCORERANK = 335;
public static final int OPTION_DRAW_SCORERANK = 1335;

public static final int OPTION_NOW_AAA_1P = 340;
public static final int OPTION_NOW_AA_1P = 341;
Expand Down

0 comments on commit 0e46886

Please sign in to comment.