Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken 2024-02-24 12:31:16 -05:00
commit 755c369496
3 changed files with 48 additions and 21 deletions

View File

@ -2,7 +2,6 @@ uniform sampler2D u_texture;
uniform float u_time;
uniform float u_progress;
uniform vec4 u_color;
uniform vec2 u_uv;
uniform vec2 u_uv2;
uniform vec2 u_texsize;
@ -14,8 +13,7 @@ void main(){
vec2 coords = (v_texCoords - u_uv) / (u_uv2 - u_uv);
vec2 v = vec2(1.0/u_texsize.x, 1.0/u_texsize.y);
vec4 c = texture2D(u_texture, v_texCoords);
vec4 c = texture2D(u_texture, v_texCoords);
c.a *= u_progress;
c.a *= step(abs(sin(coords.y*3.0 + u_time)), 0.9);

View File

@ -12,10 +12,20 @@ import mindustry.world.meta.*;
public class ArmorPlateAbility extends Ability{
public TextureRegion plateRegion;
public Color color = Color.valueOf("d1efff");
public TextureRegion shineRegion;
public String plateSuffix = "-armor";
public String shineSuffix = "-shine";
/** Color of the shine. If null, uses team color. */
public @Nullable Color color = null;
public float shineSpeed = 1f;
public float z = -1;
/** Whether to draw the plate region. */
public boolean drawPlate = true;
/** Whether to draw the shine over the plate region. */
public boolean drawShine = true;
public float healthMultiplier = 0.2f;
public float z = Layer.effect;
protected float warmup;
@ -34,24 +44,39 @@ public class ArmorPlateAbility extends Ability{
@Override
public void draw(Unit unit){
if(!drawPlate && !drawShine) return;
if(warmup > 0.001f){
if(plateRegion == null){
plateRegion = Core.atlas.find(unit.type.name + "-armor", unit.type.region);
plateRegion = Core.atlas.find(unit.type.name + plateSuffix, unit.type.region);
shineRegion = Core.atlas.find(unit.type.name + shineSuffix, plateRegion);
}
Draw.draw(z <= 0 ? Draw.z() : z, () -> {
Shaders.armor.region = plateRegion;
Shaders.armor.progress = warmup;
Shaders.armor.time = -Time.time / 20f;
float pz = Draw.z();
if(z > 0) Draw.z(z);
Draw.rect(Shaders.armor.region, unit.x, unit.y, unit.rotation - 90f);
Draw.color(color);
Draw.shader(Shaders.armor);
Draw.rect(Shaders.armor.region, unit.x, unit.y, unit.rotation - 90f);
Draw.shader();
if(drawPlate){
Draw.alpha(warmup);
Draw.rect(plateRegion, unit.x, unit.y, unit.rotation - 90f);
Draw.alpha(1f);
}
Draw.reset();
});
if(drawShine){
Draw.draw(Draw.z(), () -> {
Shaders.armor.region = shineRegion;
Shaders.armor.progress = warmup;
Shaders.armor.time = -Time.time / 20f * shineSpeed;
Draw.color(color == null ? unit.team.color : color);
Draw.shader(Shaders.armor);
Draw.rect(shineRegion, unit.x, unit.y, unit.rotation - 90f);
Draw.shader();
Draw.reset();
});
}
Draw.z(pz);
}
}
}

View File

@ -133,7 +133,7 @@
},
{
"name": "Eradication Mindustry",
"address": ["140.238.246.78:7000", "140.238.246.78:7001", "140.238.246.78:7002", "140.238.246.78:7003", "140.238.246.78:7004", "130.61.22.183:7000", "130.61.22.183:7001", "130.61.22.183:7002", "130.61.22.183:7003", "130.61.22.183:7004", "77.99.254.211:7000", "77.99.254.211:7001", "77.99.254.211:7002", "141.148.196.135:7000", "130.61.220.99:7000", "130.61.220.99:7001"]
"address": ["140.238.246.78:7000", "140.238.246.78:7001", "140.238.246.78:7002", "140.238.246.78:7003", "140.238.246.78:7004", "130.61.22.183:7000", "130.61.22.183:7001", "130.61.22.183:7002", "130.61.22.183:7003", "130.61.22.183:7004", "77.100.100.249:7000", "77.100.100.249:7001", "77.100.100.249:7002", "141.148.196.135:7000", "130.61.220.99:7000", "130.61.220.99:7001"]
},
{
"name": "Conservatory",
@ -254,7 +254,7 @@
},
{
"name": "Atomic",
"address": ["atomic-de.ddns.net:35199", "atomic-de.ddns.net:35176", "atomic-de.ddns.net:35845", "atomic-de.ddns.net:35313"]
"address": ["atomic-uk.ddns.net:25595", "atomic-uk.ddns.net:25587", "atomic-uk.ddns.net:25584", "atomic-uk.ddns.net:25590"]
},
{
"name": "SkyPlex",
@ -281,7 +281,11 @@
"address": ["194.247.42.11:27792", "194.247.42.11:27977", "194.247.42.61:27989", "194.247.42.181:28514"]
},
{
"name": "hubVn",
"address": ["de-free-01.hosts.optikservers.com:32362"]
"name": "Sever.VN",
"address": ["srv24.godlike.club:26189"]
},
{
"name": "Crimson Star",
"address": ["185.103.101.121:25528", "81.94.159.193"]
}
]