item stats: Clean up saradomin brew code
This commit is contained in:
@@ -57,9 +57,8 @@ public class SaradominBrew implements Effect
|
|||||||
SimpleStatBoost hitpoints = new SimpleStatBoost(HITPOINTS, true, perc(percH, deltaB));
|
SimpleStatBoost hitpoints = new SimpleStatBoost(HITPOINTS, true, perc(percH, deltaB));
|
||||||
SimpleStatBoost defence = new SimpleStatBoost(DEFENCE, true, perc(percD, deltaB));
|
SimpleStatBoost defence = new SimpleStatBoost(DEFENCE, true, perc(percD, deltaB));
|
||||||
BoostedStatBoost calc = new BoostedStatBoost(null, false, perc(percSD, -deltaR));
|
BoostedStatBoost calc = new BoostedStatBoost(null, false, perc(percSD, -deltaR));
|
||||||
changes.setStatChanges(Stream.concat(
|
changes.setStatChanges(Stream.of(
|
||||||
Stream.of(hitpoints.effect(client)),
|
Stream.of(hitpoints.effect(client)),
|
||||||
Stream.concat(
|
|
||||||
Stream.of(defence.effect(client)),
|
Stream.of(defence.effect(client)),
|
||||||
Stream.of(saradominBrewStats)
|
Stream.of(saradominBrewStats)
|
||||||
.filter(stat -> 1 < stat.getValue(client))
|
.filter(stat -> 1 < stat.getValue(client))
|
||||||
@@ -67,11 +66,12 @@ public class SaradominBrew implements Effect
|
|||||||
{
|
{
|
||||||
calc.setStat(stat);
|
calc.setStat(stat);
|
||||||
return calc.effect(client);
|
return calc.effect(client);
|
||||||
})
|
}))
|
||||||
)
|
.reduce(Stream::concat)
|
||||||
).toArray(StatChange[]::new));
|
.orElseGet(Stream::empty)
|
||||||
|
.toArray(StatChange[]::new));
|
||||||
changes.setPositivity(Stream.of(changes.getStatChanges())
|
changes.setPositivity(Stream.of(changes.getStatChanges())
|
||||||
.map(sc -> sc.getPositivity())
|
.map(StatChange::getPositivity)
|
||||||
.max(Comparator.naturalOrder()).get());
|
.max(Comparator.naturalOrder()).get());
|
||||||
return changes;
|
return changes;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user