38 float x = hyper.
getEntity().getLocation().x;
39 float y = hyper.
getEntity().getLocation().y;
42 float w = hyper.
getTiles().length * size;
43 float h = hyper.
getTiles()[0].length * size;
48 float tx = x + cell.i * size + size/2f;
49 float ty = y + cell.j * size + size/2f;
51 angle = Misc.getAngleInDegrees(
new Vector2f(tx, ty),
fleet.getLocation());
53 Vector2f v =
fleet.getVelocity();
54 float angle2 = Misc.getAngleInDegrees(v);
55 float speed = v.length();
56 if (speed < 10) angle2 =
fleet.getFacing();
59 float mult = 0.5f + 0.4f * speed / bestAngleAt;
60 if (mult < 0.5f) mult = 0.5f;
61 if (mult > 0.9f) mult = 0.9f;
63 angle += Misc.getClosestTurnDirection(
angle, angle2) * Misc.getAngleDiff(
angle, angle2) * mult;
70 Vector2f boost = Misc.getUnitVectorAtDegreeAngle(
angle);
74 mult *= Math.pow(Math.min(1f,
elapsed / 0.25f), 2f);
75 if (mult < 0) mult = 0;
76 if (mult > 1) mult = 1;
79 Vector2f v =
fleet.getVelocity();
82 fleet.setVelocity(v.x + boost.x, v.y + boost.y);
85 float angleHeading = Misc.getAngleInDegrees(v);
86 if (v.length() < 10) angleHeading =
fleet.getFacing();
88 boost = Misc.getUnitVectorAtDegreeAngle(angleHeading);
90 if (boost.length() >= 1) {
94 float sizeNormal = 5f + 20f * intensity;
95 String modId =
"boost " + cell.i + cell.j * 100;
96 Color glowColor =
new Color(100, 100, 255, 75);
97 for (FleetMemberViewAPI view :
fleet.getViews()) {
98 view.getWindEffectDirX().shift(modId, boost.x * sizeNormal, durIn, durOut, 1f);
99 view.getWindEffectDirY().shift(modId, boost.y * sizeNormal, durIn, durOut, 1f);
100 view.getWindEffectColor().shift(modId, glowColor, durIn, durOut, intensity);