forked from SteamWar/SteamWar
Add configurable particle slot model
Introduce parameters, particle types, designs and entries that build the existing particle elements, store each of the 7 particle slots in its own UserConfig key, and let LobbyPlayer select a slot next to the old enum particles. Slots 4-5 need a team, 6-7 the server team.
This commit is contained in:
@@ -28,6 +28,7 @@ public class Circle extends DelegatingParticleElement {
|
||||
|
||||
private double distance;
|
||||
private double speed;
|
||||
private double phase;
|
||||
|
||||
public Circle(ParticleElement particleElement) {
|
||||
super(particleElement);
|
||||
@@ -41,6 +42,11 @@ public class Circle extends DelegatingParticleElement {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public Circle(ParticleElement particleElement, double distance, double speed, double phaseDegrees) {
|
||||
this(particleElement, distance, speed);
|
||||
this.phase = Math.toRadians(phaseDegrees);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_CIRCLE";
|
||||
@@ -51,7 +57,7 @@ public class Circle extends DelegatingParticleElement {
|
||||
Location location = particleTickData.getLocation();
|
||||
|
||||
Vector vector = new Vector(distance, 0, 0);
|
||||
vector.rotateAroundY((particleTickData.getDeg() * speed) % 360);
|
||||
vector.rotateAroundY((particleTickData.getDeg() * speed) % 360 + phase);
|
||||
ParticleTickData nParticleTickData = particleTickData.withLocation(location.clone().add(vector));
|
||||
particleElement.tick(nParticleTickData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user