forked from SteamWar/SteamWar
Give the rebuildable reward designs unique touches
Rewards whose look the basic designs can build now carry a touch the builder cannot make: bursts on jumping, landing or sneaking, footprints, a line to nearby players with the same reward, a December extra, aimed enchanting glyphs, a heartbeat, a jump-beat wing or an orbiting shape. BodyMotion tracks the jump, land and sneak events the touches react to.
This commit is contained in:
@@ -32,6 +32,8 @@ public class FixedDesign extends ParticleDesign {
|
||||
private final int points;
|
||||
private final Consumer<ParameterValues> defaults;
|
||||
private final Supplier<ParticleElement> shape;
|
||||
private Supplier<ParticleElement> touch;
|
||||
private int touchPoints;
|
||||
|
||||
public FixedDesign(String id, Material icon, String nameKey, ParticleRequirement requirement, int points, Consumer<ParameterValues> defaults, Supplier<ParticleElement> shape) {
|
||||
super(id, icon, nameKey, DesignVisibility.REWARD, requirement);
|
||||
@@ -45,9 +47,21 @@ public class FixedDesign extends ParticleDesign {
|
||||
return shape.get();
|
||||
}
|
||||
|
||||
// Adds the reward's unique touch; its points count towards the slot budget
|
||||
public FixedDesign withTouch(int touchPoints, Supplier<ParticleElement> touch) {
|
||||
this.touchPoints = touchPoints;
|
||||
this.touch = touch;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleElement touch() {
|
||||
return touch == null ? null : touch.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int points(ParameterValues values) {
|
||||
return points;
|
||||
return points + touchPoints;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user