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 defence = new SimpleStatBoost(DEFENCE, true, perc(percD, deltaB));
|
||||
BoostedStatBoost calc = new BoostedStatBoost(null, false, perc(percSD, -deltaR));
|
||||
changes.setStatChanges(Stream.concat(
|
||||
changes.setStatChanges(Stream.of(
|
||||
Stream.of(hitpoints.effect(client)),
|
||||
Stream.concat(
|
||||
Stream.of(defence.effect(client)),
|
||||
Stream.of(saradominBrewStats)
|
||||
.filter(stat -> 1 < stat.getValue(client))
|
||||
@@ -67,12 +66,13 @@ public class SaradominBrew implements Effect
|
||||
{
|
||||
calc.setStat(stat);
|
||||
return calc.effect(client);
|
||||
})
|
||||
)
|
||||
).toArray(StatChange[]::new));
|
||||
}))
|
||||
.reduce(Stream::concat)
|
||||
.orElseGet(Stream::empty)
|
||||
.toArray(StatChange[]::new));
|
||||
changes.setPositivity(Stream.of(changes.getStatChanges())
|
||||
.map(sc -> sc.getPositivity())
|
||||
.map(StatChange::getPositivity)
|
||||
.max(Comparator.naturalOrder()).get());
|
||||
return changes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user