mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-24 13:39:03 +07:00
Fixed #2277
This commit is contained in:
parent
81265500a5
commit
7d2b7197d6
@ -1615,7 +1615,7 @@ public class Blocks implements ContentList{
|
||||
Items.surgealloy, Bullets.fragSurge
|
||||
);
|
||||
xRand = 4f;
|
||||
reloadTime = 6f;
|
||||
reloadTime = 8f;
|
||||
range = 200f;
|
||||
size = 3;
|
||||
recoilAmount = 3f;
|
||||
|
@ -74,7 +74,7 @@ public class UnitTypes implements ContentList{
|
||||
hitsize = 9f;
|
||||
range = 10f;
|
||||
health = 500;
|
||||
armor = 3f;
|
||||
armor = 4f;
|
||||
|
||||
immunities.add(StatusEffects.burning);
|
||||
|
||||
@ -107,7 +107,7 @@ public class UnitTypes implements ContentList{
|
||||
rotateSpeed = 3f;
|
||||
targetAir = false;
|
||||
health = 790;
|
||||
armor = 8f;
|
||||
armor = 9f;
|
||||
|
||||
weapons.add(new Weapon("artillery"){{
|
||||
y = 1f;
|
||||
@ -478,7 +478,7 @@ public class UnitTypes implements ContentList{
|
||||
range = 140f;
|
||||
hitsize = 18f;
|
||||
lowAltitude = true;
|
||||
armor = 4f;
|
||||
armor = 6f;
|
||||
|
||||
engineOffset = 12f;
|
||||
engineSize = 3f;
|
||||
|
@ -249,6 +249,7 @@ public class Weathers implements ContentList{
|
||||
TextureRegion region;
|
||||
float yspeed = 1f, xspeed = 4f, size = 5f, padding = size, invDensity = 2000f;
|
||||
Color color = Color.valueOf("7457ce");
|
||||
Vec2 force = new Vec2(0.25f, 0.01f);
|
||||
Texture noise;
|
||||
|
||||
{
|
||||
@ -264,6 +265,14 @@ public class Weathers implements ContentList{
|
||||
noise.setFilter(TextureFilter.linear);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(WeatherState state){
|
||||
|
||||
for(Unit unit : Groups.unit){
|
||||
unit.impulse(force.x * state.intensity(), force.y * state.intensity());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose(){
|
||||
noise.dispose();
|
||||
|
@ -265,7 +265,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
}
|
||||
|
||||
public void rotation(int rotation){
|
||||
tile.rotation(rotation);
|
||||
if(tile != null) tile.rotation(rotation);
|
||||
}
|
||||
|
||||
public Floor floor(){
|
||||
|
@ -215,7 +215,7 @@ public class Block extends UnlockableContent{
|
||||
if(tile.build != null){
|
||||
tile.build.draw();
|
||||
}else{
|
||||
Draw.rect(region, tile.drawx(), tile.drawy(), rotate ? tile.rotation * 90 : 0);
|
||||
Draw.rect(region, tile.drawx(), tile.drawy());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package mindustry.world.blocks.units;
|
||||
|
||||
import arc.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.util.*;
|
||||
@ -41,7 +42,19 @@ public class Reconstructor extends UnitBlock{
|
||||
@Override
|
||||
public void setBars(){
|
||||
super.setBars();
|
||||
|
||||
bars.add("progress", (ReconstructorEntity entity) -> new Bar("bar.progress", Pal.ammo, entity::fraction));
|
||||
bars.add("units", (ReconstructorEntity e) ->
|
||||
new Bar(
|
||||
() -> e.unit() == null ? "[lightgray]" + Iconc.cancel :
|
||||
Core.bundle.format("bar.unitcap",
|
||||
Fonts.getUnicodeStr(e.unit().name),
|
||||
teamIndex.countType(e.team, e.unit()),
|
||||
Units.getCap(e.team)
|
||||
),
|
||||
() -> Pal.power,
|
||||
() -> e.unit() == null ? 0f : (float)teamIndex.countType(e.team, e.unit()) / Units.getCap(e.team)
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -145,6 +158,22 @@ public class Reconstructor extends UnitBlock{
|
||||
time += edelta() * speedScl * state.rules.unitBuildSpeedMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldConsume(){
|
||||
//do not consume when cap reached
|
||||
if(constructing()){
|
||||
return Units.canCreate(team, upgrade(payload.unit.type()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public UnitType unit(){
|
||||
if(payload == null) return null;
|
||||
|
||||
UnitType t = upgrade(payload.unit.type());
|
||||
return t != null && t.unlockedNow() ? t : null;
|
||||
}
|
||||
|
||||
public boolean constructing(){
|
||||
return payload != null && hasUpgrade(payload.unit.type());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user