Skip to content

Commit

Permalink
Split up control point score causes
Browse files Browse the repository at this point in the history
Signed-off-by: OhPointFive <[email protected]>
  • Loading branch information
OhPointFive committed Feb 3, 2025
1 parent 051e008 commit 710b8cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 9 additions & 3 deletions core/src/main/java/tc/oc/pgm/controlpoint/ControlPoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ protected void tickScore(Duration duration) {
float growth = this.getDefinition().getPointsGrowth();
float rate = (float) (initial * Math.pow(2, seconds / growth));
scoreMatchModule.incrementScore(
this.getControllingTeam(), rate * duration.toMillis() / 1000, ScoreCause.CONTROL_POINT);
this.getControllingTeam(),
rate * duration.toMillis() / 1000,
ScoreCause.CONTROL_POINT_TICK);
}
}
}
Expand Down Expand Up @@ -374,11 +376,15 @@ private void dominateAndFireEvents(
if (scoreMatchModule != null) {
if (oldControllingTeam != null) {
scoreMatchModule.incrementScore(
oldControllingTeam, getDefinition().getPointsOwner() * -1, ScoreCause.CONTROL_POINT);
oldControllingTeam,
getDefinition().getPointsOwner() * -1,
ScoreCause.CONTROL_POINT_OWNED);
}
if (this.controllingTeam != null) {
scoreMatchModule.incrementScore(
this.controllingTeam, getDefinition().getPointsOwner(), ScoreCause.CONTROL_POINT);
this.controllingTeam,
getDefinition().getPointsOwner(),
ScoreCause.CONTROL_POINT_LOST);
}
}
if (this.controllingTeam == null) {
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/java/tc/oc/pgm/score/ScoreCause.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package tc.oc.pgm.score;

public enum ScoreCause {
CONTROL_POINT,
CONTROL_POINT_TICK,
CONTROL_POINT_OWNED,
CONTROL_POINT_LOST,
DEATH,
FLAG_CAPTURE,
FLAG_TICK,
Expand Down

0 comments on commit 710b8cf

Please sign in to comment.