Fixed #2277
This commit is contained in:
@@ -1615,7 +1615,7 @@ public class Blocks implements ContentList{
|
|||||||
Items.surgealloy, Bullets.fragSurge
|
Items.surgealloy, Bullets.fragSurge
|
||||||
);
|
);
|
||||||
xRand = 4f;
|
xRand = 4f;
|
||||||
reloadTime = 6f;
|
reloadTime = 8f;
|
||||||
range = 200f;
|
range = 200f;
|
||||||
size = 3;
|
size = 3;
|
||||||
recoilAmount = 3f;
|
recoilAmount = 3f;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class UnitTypes implements ContentList{
|
|||||||
hitsize = 9f;
|
hitsize = 9f;
|
||||||
range = 10f;
|
range = 10f;
|
||||||
health = 500;
|
health = 500;
|
||||||
armor = 3f;
|
armor = 4f;
|
||||||
|
|
||||||
immunities.add(StatusEffects.burning);
|
immunities.add(StatusEffects.burning);
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public class UnitTypes implements ContentList{
|
|||||||
rotateSpeed = 3f;
|
rotateSpeed = 3f;
|
||||||
targetAir = false;
|
targetAir = false;
|
||||||
health = 790;
|
health = 790;
|
||||||
armor = 8f;
|
armor = 9f;
|
||||||
|
|
||||||
weapons.add(new Weapon("artillery"){{
|
weapons.add(new Weapon("artillery"){{
|
||||||
y = 1f;
|
y = 1f;
|
||||||
@@ -478,7 +478,7 @@ public class UnitTypes implements ContentList{
|
|||||||
range = 140f;
|
range = 140f;
|
||||||
hitsize = 18f;
|
hitsize = 18f;
|
||||||
lowAltitude = true;
|
lowAltitude = true;
|
||||||
armor = 4f;
|
armor = 6f;
|
||||||
|
|
||||||
engineOffset = 12f;
|
engineOffset = 12f;
|
||||||
engineSize = 3f;
|
engineSize = 3f;
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ public class Weathers implements ContentList{
|
|||||||
TextureRegion region;
|
TextureRegion region;
|
||||||
float yspeed = 1f, xspeed = 4f, size = 5f, padding = size, invDensity = 2000f;
|
float yspeed = 1f, xspeed = 4f, size = 5f, padding = size, invDensity = 2000f;
|
||||||
Color color = Color.valueOf("7457ce");
|
Color color = Color.valueOf("7457ce");
|
||||||
|
Vec2 force = new Vec2(0.25f, 0.01f);
|
||||||
Texture noise;
|
Texture noise;
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -264,6 +265,14 @@ public class Weathers implements ContentList{
|
|||||||
noise.setFilter(TextureFilter.linear);
|
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
|
@Override
|
||||||
public void dispose(){
|
public void dispose(){
|
||||||
noise.dispose();
|
noise.dispose();
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void rotation(int rotation){
|
public void rotation(int rotation){
|
||||||
tile.rotation(rotation);
|
if(tile != null) tile.rotation(rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Floor floor(){
|
public Floor floor(){
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ public class Block extends UnlockableContent{
|
|||||||
if(tile.build != null){
|
if(tile.build != null){
|
||||||
tile.build.draw();
|
tile.build.draw();
|
||||||
}else{
|
}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;
|
package mindustry.world.blocks.units;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
@@ -41,7 +42,19 @@ public class Reconstructor extends UnitBlock{
|
|||||||
@Override
|
@Override
|
||||||
public void setBars(){
|
public void setBars(){
|
||||||
super.setBars();
|
super.setBars();
|
||||||
|
|
||||||
bars.add("progress", (ReconstructorEntity entity) -> new Bar("bar.progress", Pal.ammo, entity::fraction));
|
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
|
@Override
|
||||||
@@ -145,6 +158,22 @@ public class Reconstructor extends UnitBlock{
|
|||||||
time += edelta() * speedScl * state.rules.unitBuildSpeedMultiplier;
|
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(){
|
public boolean constructing(){
|
||||||
return payload != null && hasUpgrade(payload.unit.type());
|
return payload != null && hasUpgrade(payload.unit.type());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user