Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features
This commit is contained in:
@@ -216,7 +216,7 @@ host.invalid = [scarlet]Не удаётся подключиться к хост
|
||||
servers.local = Локальные серверы
|
||||
servers.remote = Удалённые серверы
|
||||
servers.global = Серверы сообщества
|
||||
|
||||
servers.local.steam = Открытые игры и локальные серверы
|
||||
servers.disclaimer = Серверы сообщества [accent]не[] принадлежат разработчику и [accent]не[] контролируются им.\n\nСерверы могут содержать пользовательский контент, который не подходит для всех возрастов.
|
||||
servers.showhidden = Отображать скрытые серверы
|
||||
server.shown = Отображается
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ShieldRegenFieldAbility extends Ability{
|
||||
|
||||
Units.nearby(unit.team, unit.x, unit.y, range, other -> {
|
||||
if(other.shield < max){
|
||||
other.shield = Math.max(other.shield + amount, max);
|
||||
other.shield = Math.min(other.shield + amount, max);
|
||||
other.shieldAlpha = 1f; //TODO may not be necessary
|
||||
applyEffect.at(unit.x, unit.y, 0f, unit.team.color, parentizeEffects ? other : null);
|
||||
applied = true;
|
||||
|
||||
@@ -199,7 +199,7 @@ public class BulletType extends Content implements Cloneable{
|
||||
|
||||
/** Returns maximum distance the bullet this bullet type has can travel. */
|
||||
public float range(){
|
||||
return Math.max(speed * lifetime * (1f - drag), maxRange);
|
||||
return Mathf.zero(drag) ? speed * lifetime : Math.max(speed * (1f - Mathf.pow(1f - drag, lifetime)) / drag, maxRange);
|
||||
}
|
||||
|
||||
/** @return continuous damage in damage/sec, or -1 if not continuous. */
|
||||
|
||||
@@ -45,11 +45,6 @@ public class LiquidBulletType extends BulletType{
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float range(){
|
||||
return speed * lifetime / 2f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Bullet b){
|
||||
super.update(b);
|
||||
|
||||
@@ -55,6 +55,16 @@ public class Saves{
|
||||
}
|
||||
}
|
||||
|
||||
//clear saves from build <130 that had the new naval sectors.
|
||||
saves.removeAll(s -> {
|
||||
if(s.getSector() != null && (s.getSector().id == 108 || s.getSector().id == 216) && s.meta.build <= 130 && s.meta.build > 0){
|
||||
s.getSector().clearInfo();
|
||||
s.file.delete();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
lastSectorSave = saves.find(s -> s.isSector() && s.getName().equals(Core.settings.getString("last-sector-save", "<none>")));
|
||||
|
||||
//automatically assign sector save slots
|
||||
@@ -289,7 +299,7 @@ public class Saves{
|
||||
return meta.mods;
|
||||
}
|
||||
|
||||
public Sector getSector(){
|
||||
public @Nullable Sector getSector(){
|
||||
return meta == null || meta.rules == null ? null : meta.rules.sector;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ public class MinimapRenderer{
|
||||
|
||||
Draw.mixcol(unit.team().color, 1f);
|
||||
float scale = Scl.scl(1f) / 2f * scaling * 32f;
|
||||
var region = unit.type.fullIcon;
|
||||
var region = unit.icon();
|
||||
Draw.rect(region, x + rx, y + ry, scale, scale * (float)region.height / region.width, unit.rotation() - 90);
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
|
||||
//remove item for every controlling unit
|
||||
player.unit().eachGroup(unit -> {
|
||||
Call.takeItems(build, item, unit.maxAccepted(item), unit);
|
||||
Call.takeItems(build, item, Math.min(unit.maxAccepted(item), amount), unit);
|
||||
|
||||
if(unit == player.unit()){
|
||||
Events.fire(new WithdrawEvent(build, player, item, amount));
|
||||
|
||||
@@ -95,6 +95,12 @@ public class TypeIO{
|
||||
}else if(object instanceof BuildingBox b){
|
||||
write.b(12);
|
||||
write.i(b.pos);
|
||||
}else if(object instanceof boolean[] b){
|
||||
write.b(16);
|
||||
write.i(b.length);
|
||||
for(boolean bool : b){
|
||||
write.bool(bool);
|
||||
}
|
||||
}else{
|
||||
throw new IllegalArgumentException("Unknown object type: " + object.getClass());
|
||||
}
|
||||
@@ -126,6 +132,7 @@ public class TypeIO{
|
||||
case 13: return LAccess.all[read.s()];
|
||||
case 14: int blen = read.i(); byte[] bytes = new byte[blen]; read.b(bytes); return bytes;
|
||||
case 15: return UnitCommand.all[read.b()];
|
||||
case 16: int boollen = read.i(); boolean[] bools = new boolean[boollen]; for(int i = 0; i < boollen; i ++) bools[i] = read.bool(); return bools;
|
||||
default: throw new IllegalArgumentException("Unknown object type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ public class Turret extends ReloadTurret{
|
||||
public boolean targetAir = true;
|
||||
public boolean targetGround = true;
|
||||
public boolean targetHealing = false;
|
||||
public boolean playerControllable = true;
|
||||
|
||||
//charging
|
||||
public float chargeTime = -1f;
|
||||
@@ -157,6 +158,11 @@ public class Turret extends ReloadTurret{
|
||||
unit.tile(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canControl(){
|
||||
return playerControllable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void control(LAccess type, double p1, double p2, double p3, double p4){
|
||||
if(type == LAccess.shoot && (unit == null || !unit.isPlayer())){
|
||||
|
||||
Reference in New Issue
Block a user