Added missing final modifiers.
This commit is contained in:
@@ -121,8 +121,8 @@ public final class GroupedGeneralDropItem implements IDropItem
|
||||
*/
|
||||
public final List<GeneralDropItem> extractMe()
|
||||
{
|
||||
List<GeneralDropItem> items = new ArrayList<>();
|
||||
for (final GeneralDropItem item : getItems())
|
||||
final List<GeneralDropItem> items = new ArrayList<>();
|
||||
for (GeneralDropItem item : getItems())
|
||||
{
|
||||
// precise and killer strategies of the group
|
||||
items.add(new GeneralDropItem(item.getItemId(), item.getMin(), item.getMax(), (item.getChance() * getChance()) / 100, item.getAmountStrategy(), item.getChanceStrategy(), getPreciseStrategy(), getKillerChanceModifierStrategy(), item.getDropCalculationStrategy()));
|
||||
@@ -142,9 +142,9 @@ public final class GroupedGeneralDropItem implements IDropItem
|
||||
sumchance += (item.getChance() * getChance()) / 100;
|
||||
}
|
||||
final double sumchance1 = sumchance;
|
||||
GroupedGeneralDropItem group = new GroupedGeneralDropItem(sumchance1, getDropCalculationStrategy(), IKillerChanceModifierStrategy.NO_RULES, getPreciseStrategy());
|
||||
List<GeneralDropItem> items = new ArrayList<>();
|
||||
for (final GeneralDropItem item : getItems())
|
||||
final GroupedGeneralDropItem group = new GroupedGeneralDropItem(sumchance1, getDropCalculationStrategy(), IKillerChanceModifierStrategy.NO_RULES, getPreciseStrategy());
|
||||
final List<GeneralDropItem> items = new ArrayList<>();
|
||||
for (GeneralDropItem item : getItems())
|
||||
{
|
||||
// modify only the chance, leave all other rules intact
|
||||
items.add(new GeneralDropItem(item.getItemId(), item.getMin(), item.getMax(), (item.getChance() * getChance()) / sumchance1, item.getAmountStrategy(), item.getChanceStrategy(), item.getPreciseStrategy(), item.getKillerChanceModifierStrategy(), item.getDropCalculationStrategy()));
|
||||
@@ -216,8 +216,8 @@ public final class GroupedGeneralDropItem implements IDropItem
|
||||
{
|
||||
sumchance += (item.getChance(victim, killer) * getChance() * chanceModifier) / 100;
|
||||
}
|
||||
GroupedGeneralDropItem group = new GroupedGeneralDropItem(sumchance, getDropCalculationStrategy(), IKillerChanceModifierStrategy.NO_RULES, getPreciseStrategy()); // to discard further deep blue calculations
|
||||
List<GeneralDropItem> items = new ArrayList<>();
|
||||
final GroupedGeneralDropItem group = new GroupedGeneralDropItem(sumchance, getDropCalculationStrategy(), IKillerChanceModifierStrategy.NO_RULES, getPreciseStrategy()); // to discard further deep blue calculations
|
||||
final List<GeneralDropItem> items = new ArrayList<>();
|
||||
for (GeneralDropItem item : getItems())
|
||||
{
|
||||
// the item is made almost "static"
|
||||
|
@@ -42,7 +42,7 @@ public interface IAmountMultiplierStrategy
|
||||
{
|
||||
multiplier *= item.getItemId() != Inventory.ADENA_ID ? Config.L2JMOD_CHAMPION_REWARDS_AMOUNT : Config.L2JMOD_CHAMPION_ADENAS_REWARDS_AMOUNT;
|
||||
}
|
||||
Float dropAmountMultiplier = Config.RATE_DROP_AMOUNT_MULTIPLIER.get(item.getItemId());
|
||||
final Float dropAmountMultiplier = Config.RATE_DROP_AMOUNT_MULTIPLIER.get(item.getItemId());
|
||||
if (dropAmountMultiplier != null)
|
||||
{
|
||||
multiplier *= dropAmountMultiplier;
|
||||
|
@@ -57,7 +57,7 @@ public interface IChanceMultiplierStrategy
|
||||
{
|
||||
multiplier *= item.getItemId() != Inventory.ADENA_ID ? Config.L2JMOD_CHAMPION_REWARDS_CHANCE : Config.L2JMOD_CHAMPION_ADENAS_REWARDS_CHANCE;
|
||||
}
|
||||
Float dropChanceMultiplier = Config.RATE_DROP_CHANCE_MULTIPLIER.get(item.getItemId());
|
||||
final Float dropChanceMultiplier = Config.RATE_DROP_CHANCE_MULTIPLIER.get(item.getItemId());
|
||||
if (dropChanceMultiplier != null)
|
||||
{
|
||||
multiplier *= dropChanceMultiplier;
|
||||
|
@@ -33,7 +33,7 @@ public interface IDropCalculationStrategy
|
||||
{
|
||||
public static final IDropCalculationStrategy DEFAULT_STRATEGY = (item, victim, killer) ->
|
||||
{
|
||||
double chance = item.getChance(victim, killer);
|
||||
final double chance = item.getChance(victim, killer);
|
||||
if (chance > (Rnd.nextDouble() * 100))
|
||||
{
|
||||
int amountMultiply = 1;
|
||||
|
@@ -58,7 +58,7 @@ public interface IGroupedItemDropCalculationStrategy
|
||||
return getSingleItem(dropItem).calculateDrops(victim, killer);
|
||||
}
|
||||
|
||||
GroupedGeneralDropItem normalized = dropItem.normalizeMe(victim, killer);
|
||||
final GroupedGeneralDropItem normalized = dropItem.normalizeMe(victim, killer);
|
||||
if (normalized.getChance() > (Rnd.nextDouble() * 100))
|
||||
{
|
||||
final double random = (Rnd.nextDouble() * 100);
|
||||
@@ -92,7 +92,7 @@ public interface IGroupedItemDropCalculationStrategy
|
||||
*/
|
||||
public static final IGroupedItemDropCalculationStrategy DISBAND_GROUP = (item, victim, killer) ->
|
||||
{
|
||||
List<ItemHolder> dropped = new ArrayList<>();
|
||||
final List<ItemHolder> dropped = new ArrayList<>();
|
||||
for (IDropItem dropItem : item.extractMe())
|
||||
{
|
||||
dropped.addAll(dropItem.calculateDrops(victim, killer));
|
||||
@@ -110,16 +110,16 @@ public interface IGroupedItemDropCalculationStrategy
|
||||
// if item hasn't precise calculation there's no change from DEFAULT_STRATEGY
|
||||
return DEFAULT_STRATEGY.calculateDrops(item, victim, victim);
|
||||
}
|
||||
GroupedGeneralDropItem newItem = new GroupedGeneralDropItem(item.getChance(), DEFAULT_STRATEGY, item.getKillerChanceModifierStrategy(), IPreciseDeterminationStrategy.NEVER);
|
||||
final GroupedGeneralDropItem newItem = new GroupedGeneralDropItem(item.getChance(), DEFAULT_STRATEGY, item.getKillerChanceModifierStrategy(), IPreciseDeterminationStrategy.NEVER);
|
||||
newItem.setItems(item.getItems());
|
||||
GroupedGeneralDropItem normalized = newItem.normalizeMe(victim, killer);
|
||||
final GroupedGeneralDropItem normalized = newItem.normalizeMe(victim, killer);
|
||||
// Let's determine the number of rolls.
|
||||
int rolls = (int) (normalized.getChance() / 100);
|
||||
if ((Rnd.nextDouble() * 100) < (normalized.getChance() % 100))
|
||||
{
|
||||
rolls++;
|
||||
}
|
||||
List<ItemHolder> dropped = new ArrayList<>(rolls);
|
||||
final List<ItemHolder> dropped = new ArrayList<>(rolls);
|
||||
for (int i = 0; i < rolls; i++)
|
||||
{
|
||||
// As further normalizing on already normalized drop group does nothing, we can just pass the calculation to DEFAULT_STRATEGY with precise calculation disabled as we handle it.
|
||||
|
@@ -32,7 +32,7 @@ public interface IKillerChanceModifierStrategy extends INonGroupedKillerChanceMo
|
||||
{
|
||||
public static final IKillerChanceModifierStrategy DEFAULT_STRATEGY = (item, victim, killer) ->
|
||||
{
|
||||
int levelDifference = victim.getLevel() - killer.getLevel();
|
||||
final int levelDifference = victim.getLevel() - killer.getLevel();
|
||||
if ((victim.isRaid()) && Config.DEEPBLUE_DROP_RULES_RAID)
|
||||
{
|
||||
// FIXME: Config?
|
||||
@@ -49,7 +49,7 @@ public interface IKillerChanceModifierStrategy extends INonGroupedKillerChanceMo
|
||||
{
|
||||
if (((!(victim.isRaid())) && Config.DEEPBLUE_DROP_RULES) || ((victim.isRaid()) && Config.DEEPBLUE_DROP_RULES_RAID))
|
||||
{
|
||||
int levelDifference = victim.getLevel() - killer.getLevel();
|
||||
final int levelDifference = victim.getLevel() - killer.getLevel();
|
||||
if (item.getItemId() == Inventory.ADENA_ID)
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user