Shield arc rename
This commit is contained in:
@@ -2509,11 +2509,10 @@ public class UnitTypes{
|
|||||||
outlineColor = Pal.darkOutline;
|
outlineColor = Pal.darkOutline;
|
||||||
envDisabled = Env.space;
|
envDisabled = Env.space;
|
||||||
|
|
||||||
//new ForceFieldAbility(60f, 0.3f, 400f, 60f * 6);
|
abilities.add(new ShieldArcAbility(){{
|
||||||
abilities.add(new ShieldSectorAbility(){{
|
|
||||||
region = "bulwark-shield";
|
region = "bulwark-shield";
|
||||||
radius = 34f;
|
radius = 34f;
|
||||||
sectorAngle = 85f;
|
angle = 82f;
|
||||||
regen = 0.4f;
|
regen = 0.4f;
|
||||||
cooldown = 60f * 8f;
|
cooldown = 60f * 8f;
|
||||||
max = 1500f;
|
max = 1500f;
|
||||||
@@ -2521,7 +2520,7 @@ public class UnitTypes{
|
|||||||
width = 6f;
|
width = 6f;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
rotateSpeed = 2.2f;
|
rotateSpeed = 2.1f;
|
||||||
|
|
||||||
legCount = 4;
|
legCount = 4;
|
||||||
legLength = 15f;
|
legLength = 15f;
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class EnergyFieldAbility extends Ability{
|
|||||||
|
|
||||||
for(int i = 0; i < sectors; i++){
|
for(int i = 0; i < sectors; i++){
|
||||||
float rot = unit.rotation + i * 360f/sectors - Time.time * rotateSpeed;
|
float rot = unit.rotation + i * 360f/sectors - Time.time * rotateSpeed;
|
||||||
Lines.swirl(rx, ry, orbRadius + 3f, sectorRad, rot);
|
Lines.arc(rx, ry, orbRadius + 3f, sectorRad, rot);
|
||||||
}
|
}
|
||||||
|
|
||||||
Lines.stroke(Lines.getStroke() * curStroke);
|
Lines.stroke(Lines.getStroke() * curStroke);
|
||||||
@@ -78,7 +78,7 @@ public class EnergyFieldAbility extends Ability{
|
|||||||
if(curStroke > 0){
|
if(curStroke > 0){
|
||||||
for(int i = 0; i < sectors; i++){
|
for(int i = 0; i < sectors; i++){
|
||||||
float rot = unit.rotation + i * 360f/sectors + Time.time * rotateSpeed;
|
float rot = unit.rotation + i * 360f/sectors + Time.time * rotateSpeed;
|
||||||
Lines.swirl(rx, ry, range, sectorRad, rot);
|
Lines.arc(rx, ry, range, sectorRad, rot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,15 +14,15 @@ import mindustry.graphics.*;
|
|||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
|
||||||
public class ShieldSectorAbility extends Ability{
|
public class ShieldArcAbility extends Ability{
|
||||||
private static Unit paramUnit;
|
private static Unit paramUnit;
|
||||||
private static ShieldSectorAbility paramField;
|
private static ShieldArcAbility paramField;
|
||||||
private static Vec2 paramPos = new Vec2();
|
private static Vec2 paramPos = new Vec2();
|
||||||
private static final Cons<Bullet> shieldConsumer = b -> {
|
private static final Cons<Bullet> shieldConsumer = b -> {
|
||||||
if(b.team != paramUnit.team && b.type.absorbable && paramField.data > 0 &&
|
if(b.team != paramUnit.team && b.type.absorbable && paramField.data > 0 &&
|
||||||
!paramPos.within(b, paramField.radius + paramField.width/2f) &&
|
!paramPos.within(b, paramField.radius + paramField.width/2f) &&
|
||||||
Tmp.v1.set(b).add(b.vel).within(paramPos, paramField.radius + paramField.width/2f) &&
|
Tmp.v1.set(b).add(b.vel).within(paramPos, paramField.radius + paramField.width/2f) &&
|
||||||
Angles.within(paramPos.angleTo(b), paramUnit.rotation + paramField.angleOffset, paramField.sectorAngle / 2f)){
|
Angles.within(paramPos.angleTo(b), paramUnit.rotation + paramField.angleOffset, paramField.angle / 2f)){
|
||||||
|
|
||||||
b.absorb();
|
b.absorb();
|
||||||
Fx.absorb.at(b);
|
Fx.absorb.at(b);
|
||||||
@@ -47,8 +47,8 @@ public class ShieldSectorAbility extends Ability{
|
|||||||
public float max = 200f;
|
public float max = 200f;
|
||||||
/** Cooldown after the shield is broken, in ticks. */
|
/** Cooldown after the shield is broken, in ticks. */
|
||||||
public float cooldown = 60f * 5;
|
public float cooldown = 60f * 5;
|
||||||
/** Angle of shield sector. */
|
/** Angle of shield arc. */
|
||||||
public float sectorAngle = 80f;
|
public float angle = 80f;
|
||||||
/** Offset parameters for shield. */
|
/** Offset parameters for shield. */
|
||||||
public float angleOffset = 0f, x = 0f, y = 0f;
|
public float angleOffset = 0f, x = 0f, y = 0f;
|
||||||
/** If true, only activates when shooting. */
|
/** If true, only activates when shooting. */
|
||||||
@@ -56,8 +56,8 @@ public class ShieldSectorAbility extends Ability{
|
|||||||
/** Width of shield line. */
|
/** Width of shield line. */
|
||||||
public float width = 6f;
|
public float width = 6f;
|
||||||
|
|
||||||
/** Whether to draw the sector line. */
|
/** Whether to draw the arc line. */
|
||||||
public boolean drawSector = true;
|
public boolean drawArc = true;
|
||||||
/** If not null, will be drawn on top. */
|
/** If not null, will be drawn on top. */
|
||||||
public @Nullable String region;
|
public @Nullable String region;
|
||||||
/** If true, sprite position will be influenced by x/y. */
|
/** If true, sprite position will be influenced by x/y. */
|
||||||
@@ -109,9 +109,9 @@ public class ShieldSectorAbility extends Ability{
|
|||||||
Draw.yscl = 1f;
|
Draw.yscl = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(drawSector){
|
if(drawArc){
|
||||||
Lines.stroke(width * widthScale);
|
Lines.stroke(width * widthScale);
|
||||||
Lines.swirl(pos.x, pos.y, radius, sectorAngle / 360f, unit.rotation + angleOffset - sectorAngle / 2f);
|
Lines.arc(pos.x, pos.y, radius, angle / 360f, unit.rotation + angleOffset - angle / 2f);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
//TODO
|
//TODO
|
||||||
@@ -24,4 +24,4 @@ android.useAndroidX=true
|
|||||||
#used for slow jitpack builds; TODO see if this actually works
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
archash=390397fbb9
|
archash=ff834fe5c9
|
||||||
|
|||||||
Reference in New Issue
Block a user