Bugfixes
This commit is contained in:
@@ -730,7 +730,6 @@ setting.fullscreen.name = Fullscreen
|
|||||||
setting.borderlesswindow.name = Borderless Window[lightgray] (restart may be required)
|
setting.borderlesswindow.name = Borderless Window[lightgray] (restart may be required)
|
||||||
setting.fps.name = Show FPS & Ping
|
setting.fps.name = Show FPS & Ping
|
||||||
setting.smoothcamera.name = Smooth Camera
|
setting.smoothcamera.name = Smooth Camera
|
||||||
setting.blockselectkeys.name = Show Block Select Keys
|
|
||||||
setting.vsync.name = VSync
|
setting.vsync.name = VSync
|
||||||
setting.pixelate.name = Pixelate
|
setting.pixelate.name = Pixelate
|
||||||
setting.minimap.name = Show Minimap
|
setting.minimap.name = Show Minimap
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class Vars implements Loadable{
|
|||||||
/** duration of time between turns in ticks */
|
/** duration of time between turns in ticks */
|
||||||
public static final float turnDuration = 2 * Time.toMinutes;
|
public static final float turnDuration = 2 * Time.toMinutes;
|
||||||
/** chance of an invasion per turn, 1 = 100% */
|
/** chance of an invasion per turn, 1 = 100% */
|
||||||
public static final float baseInvasionChance = 1f / 15f;
|
public static final float baseInvasionChance = 1f / 25f;
|
||||||
/** how many turns have to pass before invasions start */
|
/** how many turns have to pass before invasions start */
|
||||||
public static final int invasionGracePeriod = 20;
|
public static final int invasionGracePeriod = 20;
|
||||||
/** min armor fraction damage; e.g. 0.05 = at least 5% damage */
|
/** min armor fraction damage; e.g. 0.05 = at least 5% damage */
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ import mindustry.maps.*;
|
|||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.type.Weather.*;
|
import mindustry.type.Weather.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
import mindustry.world.blocks.*;
|
|
||||||
import mindustry.world.blocks.ConstructBlock.*;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@@ -40,32 +38,7 @@ public class Logic implements ApplicationListener{
|
|||||||
//skip null entities or un-rebuildables, for obvious reasons; also skip client since they can't modify these requests
|
//skip null entities or un-rebuildables, for obvious reasons; also skip client since they can't modify these requests
|
||||||
if(tile.build == null || !tile.block().rebuildable || net.client()) return;
|
if(tile.build == null || !tile.block().rebuildable || net.client()) return;
|
||||||
|
|
||||||
if(block instanceof ConstructBlock){
|
tile.build.addPlan(true);
|
||||||
|
|
||||||
ConstructBuild entity = tile.bc();
|
|
||||||
|
|
||||||
//update block to reflect the fact that something was being constructed
|
|
||||||
if(entity.cblock != null && entity.cblock.synthetic()){
|
|
||||||
block = entity.cblock;
|
|
||||||
}else{
|
|
||||||
//otherwise this was a deconstruction that was interrupted, don't want to rebuild that
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TeamData data = state.teams.get(tile.team());
|
|
||||||
|
|
||||||
//remove existing blocks that have been placed here.
|
|
||||||
//painful O(n) iteration + copy
|
|
||||||
for(int i = 0; i < data.blocks.size; i++){
|
|
||||||
BlockPlan b = data.blocks.get(i);
|
|
||||||
if(b.x == tile.x && b.y == tile.y){
|
|
||||||
data.blocks.removeIndex(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data.blocks.addFirst(new BlockPlan(tile.x, tile.y, (short)tile.build.rotation, block.id, tile.build.config()));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Events.on(BlockBuildEndEvent.class, event -> {
|
Events.on(BlockBuildEndEvent.class, event -> {
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void build(){
|
public void build(){
|
||||||
float size = 60f;
|
float size = 58f;
|
||||||
|
|
||||||
clearChildren();
|
clearChildren();
|
||||||
table(cont -> {
|
table(cont -> {
|
||||||
@@ -559,10 +559,11 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
mid.row();
|
mid.row();
|
||||||
|
|
||||||
mid.table(t -> {
|
if(!mobile){
|
||||||
t.button("@editor.center", Icon.move, Styles.cleart, () -> view.center()).growX().margin(9f);
|
mid.table(t -> {
|
||||||
}).growX().top();
|
t.button("@editor.center", Icon.move, Styles.cleart, () -> view.center()).growX().margin(9f);
|
||||||
|
}).growX().top();
|
||||||
|
}
|
||||||
}).margin(0).left().growY();
|
}).margin(0).left().growY();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,11 @@ public class LaserBulletType extends BulletType{
|
|||||||
this(1f);
|
this(1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float estimateDPS(){
|
||||||
|
return super.estimateDPS() * 2f;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
super.init();
|
super.init();
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ public class LiquidBulletType extends BulletType{
|
|||||||
if(liquid != null){
|
if(liquid != null){
|
||||||
this.liquid = liquid;
|
this.liquid = liquid;
|
||||||
this.status = liquid.effect;
|
this.status = liquid.effect;
|
||||||
|
lightColor = liquid.lightColor;
|
||||||
|
lightOpacity = liquid.lightColor.a;
|
||||||
}
|
}
|
||||||
|
|
||||||
ammoMultiplier = 1f;
|
ammoMultiplier = 1f;
|
||||||
|
|||||||
@@ -21,12 +21,14 @@ import mindustry.ctype.*;
|
|||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
|
import mindustry.game.Teams.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.logic.*;
|
import mindustry.logic.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
import mindustry.world.blocks.ConstructBlock.*;
|
||||||
import mindustry.world.blocks.environment.*;
|
import mindustry.world.blocks.environment.*;
|
||||||
import mindustry.world.blocks.payloads.*;
|
import mindustry.world.blocks.payloads.*;
|
||||||
import mindustry.world.blocks.power.*;
|
import mindustry.world.blocks.power.*;
|
||||||
@@ -191,6 +193,36 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
//endregion
|
//endregion
|
||||||
//region utility methods
|
//region utility methods
|
||||||
|
|
||||||
|
public void addPlan(boolean checkPrevious){
|
||||||
|
if(!block.rebuildable) return;
|
||||||
|
|
||||||
|
if(self() instanceof ConstructBuild entity){
|
||||||
|
//update block to reflect the fact that something was being constructed
|
||||||
|
if(entity.cblock != null && entity.cblock.synthetic()){
|
||||||
|
block = entity.cblock;
|
||||||
|
}else{
|
||||||
|
//otherwise this was a deconstruction that was interrupted, don't want to rebuild that
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TeamData data = state.teams.get(team);
|
||||||
|
|
||||||
|
if(checkPrevious){
|
||||||
|
//remove existing blocks that have been placed here.
|
||||||
|
//painful O(n) iteration + copy
|
||||||
|
for(int i = 0; i < data.blocks.size; i++){
|
||||||
|
BlockPlan b = data.blocks.get(i);
|
||||||
|
if(b.x == tile.x && b.y == tile.y){
|
||||||
|
data.blocks.removeIndex(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data.blocks.addFirst(new BlockPlan(tile.x, tile.y, (short)rotation, block.id, config()));
|
||||||
|
}
|
||||||
|
|
||||||
/** Configure with the current, local player. */
|
/** Configure with the current, local player. */
|
||||||
public void configure(Object value){
|
public void configure(Object value){
|
||||||
//save last used config
|
//save last used config
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public class SectorInfo{
|
|||||||
entity.items.clear();
|
entity.items.clear();
|
||||||
entity.items.add(items);
|
entity.items.add(items);
|
||||||
//ensure capacity.
|
//ensure capacity.
|
||||||
entity.items.each((i, a) -> entity.items.set(i, Math.min(a, entity.block.itemCapacity)));
|
entity.items.each((i, a) -> entity.items.set(i, Math.min(a, entity.storageCapacity)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO write items.
|
//TODO write items.
|
||||||
|
|||||||
@@ -194,8 +194,8 @@ public class Universe{
|
|||||||
|
|
||||||
//queue random invasions
|
//queue random invasions
|
||||||
if(!sector.isAttacked() && turn > invasionGracePeriod){
|
if(!sector.isAttacked() && turn > invasionGracePeriod){
|
||||||
//TODO use factors like difficulty for better invasion chance
|
//invasion chance depends on # of nearby bases
|
||||||
if(sector.near().contains(Sector::hasEnemyBase) && Mathf.chance(baseInvasionChance)){
|
if(Mathf.chance(baseInvasionChance * sector.near().count(Sector::hasEnemyBase))){
|
||||||
int waveMax = Math.max(sector.info.winWave, sector.isBeingPlayed() ? state.wave : 0) + Mathf.random(2, 5) * 5;
|
int waveMax = Math.max(sector.info.winWave, sector.isBeingPlayed() ? state.wave : 0) + Mathf.random(2, 5) * 5;
|
||||||
|
|
||||||
//assign invasion-related things
|
//assign invasion-related things
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ public class SectorDamage{
|
|||||||
int radius = 3;
|
int radius = 3;
|
||||||
|
|
||||||
//only penetrate a certain % by health, not by distance
|
//only penetrate a certain % by health, not by distance
|
||||||
float totalHealth = path.sumf(t -> {
|
float totalHealth = damage >= 1f ? 1f : path.sumf(t -> {
|
||||||
float s = 0;
|
float s = 0;
|
||||||
for(int dx = -radius; dx <= radius; dx++){
|
for(int dx = -radius; dx <= radius; dx++){
|
||||||
for(int dy = -radius; dy <= radius; dy++){
|
for(int dy = -radius; dy <= radius; dy++){
|
||||||
@@ -345,7 +345,7 @@ public class SectorDamage{
|
|||||||
float healthCount = 0;
|
float healthCount = 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
for(int i = 0; i < path.size && healthCount < targetHealth; i++){
|
for(int i = 0; i < path.size && (healthCount < targetHealth || damage >= 1f); i++){
|
||||||
Tile t = path.get(i);
|
Tile t = path.get(i);
|
||||||
|
|
||||||
for(int dx = -radius; dx <= radius; dx++){
|
for(int dx = -radius; dx <= radius; dx++){
|
||||||
@@ -365,7 +365,7 @@ public class SectorDamage{
|
|||||||
|
|
||||||
removal.add(other.build);
|
removal.add(other.build);
|
||||||
|
|
||||||
if(healthCount >= targetHealth){
|
if(healthCount >= targetHealth && damage < 0.999f){
|
||||||
break out;
|
break out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -376,6 +376,7 @@ public class SectorDamage{
|
|||||||
|
|
||||||
for(Building r : removal){
|
for(Building r : removal){
|
||||||
if(r.tile.build == r){
|
if(r.tile.build == r){
|
||||||
|
r.addPlan(false);
|
||||||
r.tile.remove();
|
r.tile.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -424,6 +425,7 @@ public class SectorDamage{
|
|||||||
Effect.rubble(other.build.x, other.build.y, other.block().size);
|
Effect.rubble(other.build.x, other.build.y, other.block().size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
other.build.addPlan(false);
|
||||||
other.remove();
|
other.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -339,9 +339,6 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
graphics.checkPref("smoothcamera", true);
|
graphics.checkPref("smoothcamera", true);
|
||||||
graphics.checkPref("position", false);
|
graphics.checkPref("position", false);
|
||||||
graphics.checkPref("fps", false);
|
graphics.checkPref("fps", false);
|
||||||
if(!mobile){
|
|
||||||
graphics.checkPref("blockselectkeys", true);
|
|
||||||
}
|
|
||||||
graphics.checkPref("playerindicators", true);
|
graphics.checkPref("playerindicators", true);
|
||||||
graphics.checkPref("indicators", true);
|
graphics.checkPref("indicators", true);
|
||||||
graphics.checkPref("animatedwater", true);
|
graphics.checkPref("animatedwater", true);
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ public class PlacementFragment extends Fragment{
|
|||||||
|
|
||||||
topTable.table(header -> {
|
topTable.table(header -> {
|
||||||
String keyCombo = "";
|
String keyCombo = "";
|
||||||
if(!mobile && Core.settings.getBool("blockselectkeys")){
|
if(!mobile){
|
||||||
Seq<Block> blocks = getByCategory(currentCategory);
|
Seq<Block> blocks = getByCategory(currentCategory);
|
||||||
for(int i = 0; i < blocks.size; i++){
|
for(int i = 0; i < blocks.size; i++){
|
||||||
if(blocks.get(i) == displayBlock && (i + 1) / 10 - 1 < blockSelect.length){
|
if(blocks.get(i) == displayBlock && (i + 1) / 10 - 1 < blockSelect.length){
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ public class CoreBlock extends StorageBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void itemTaken(Item item){
|
public void itemTaken(Item item){
|
||||||
if(state.isCampaign()){
|
if(state.isCampaign() && team == state.rules.defaultTeam){
|
||||||
//update item taken amount
|
//update item taken amount
|
||||||
state.secinfo.handleCoreItem(item, -1);
|
state.secinfo.handleCoreItem(item, -1);
|
||||||
}
|
}
|
||||||
@@ -342,7 +342,9 @@ public class CoreBlock extends StorageBlock{
|
|||||||
@Override
|
@Override
|
||||||
public void handleItem(Building source, Item item){
|
public void handleItem(Building source, Item item){
|
||||||
if(net.server() || !net.active()){
|
if(net.server() || !net.active()){
|
||||||
state.secinfo.handleCoreItem(item, 1);
|
if(team == state.rules.defaultTeam){
|
||||||
|
state.secinfo.handleCoreItem(item, 1);
|
||||||
|
}
|
||||||
|
|
||||||
if(items.get(item) >= getMaximumAccepted(item)){
|
if(items.get(item) >= getMaximumAccepted(item)){
|
||||||
//create item incineration effect at random intervals
|
//create item incineration effect at random intervals
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ public class StorageBlock extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void handleItem(Building source, Item item){
|
public void handleItem(Building source, Item item){
|
||||||
if(linkedCore != null){
|
if(linkedCore != null){
|
||||||
incinerateEffect(this, source);
|
if(linkedCore.items.get(item) >= ((CoreBuild)linkedCore).storageCapacity){
|
||||||
|
incinerateEffect(this, source);
|
||||||
|
}
|
||||||
((CoreBuild)linkedCore).noEffect = true;
|
((CoreBuild)linkedCore).noEffect = true;
|
||||||
linkedCore.handleItem(source, item);
|
linkedCore.handleItem(source, item);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Reference in New Issue
Block a user