Implement commissions

This commit is contained in:
Melledy
2025-11-12 03:25:23 -08:00
parent d4a7aa0320
commit be4a006c66
19 changed files with 526 additions and 40 deletions

View File

@@ -3,6 +3,7 @@ package emu.nebula.game.instance;
import java.util.List;
import emu.nebula.game.inventory.ItemParamMap;
import emu.nebula.game.inventory.ItemRewardParam;
import emu.nebula.game.player.Player;
public interface InstanceData {
@@ -15,9 +16,9 @@ public interface InstanceData {
// Handle reward generation
public List<InstanceRewardParam> getFirstRewards();
public List<ItemRewardParam> getFirstRewards();
public default List<InstanceRewardParam> getFirstRewards(int rewardType) {
public default List<ItemRewardParam> getFirstRewards(int rewardType) {
return getFirstRewards();
}
@@ -25,9 +26,9 @@ public interface InstanceData {
return this.generateRewards(this.getFirstRewards());
}
public List<InstanceRewardParam> getRewards();
public List<ItemRewardParam> getRewards();
public default List<InstanceRewardParam> getRewards(int rewardType) {
public default List<ItemRewardParam> getRewards(int rewardType) {
return getRewards();
}
@@ -35,7 +36,7 @@ public interface InstanceData {
return this.generateRewards(this.getRewards());
}
public default ItemParamMap generateRewards(List<InstanceRewardParam> params) {
public default ItemParamMap generateRewards(List<ItemRewardParam> params) {
var map = new ItemParamMap();
for (var param : params) {

View File

@@ -1,25 +0,0 @@
package emu.nebula.game.instance;
import emu.nebula.util.Utils;
import lombok.Getter;
@Getter
public class InstanceRewardParam {
public int id;
public int min;
public int max;
public InstanceRewardParam(int id, int min, int max) {
this.id = id;
this.min = min;
this.max = max;
}
public int getRandomCount() {
if (this.min == this.max) {
return this.min;
}
return Utils.randomRange(this.min, this.max);
}
}