Many various bugfixes
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ allprojects {
|
|||||||
gdxVersion = '1.9.8'
|
gdxVersion = '1.9.8'
|
||||||
roboVMVersion = '2.3.0'
|
roboVMVersion = '2.3.0'
|
||||||
aiVersion = '1.8.1'
|
aiVersion = '1.8.1'
|
||||||
uCoreVersion = '7945183f17'
|
uCoreVersion = 'a048b25074'
|
||||||
|
|
||||||
getVersionString = {
|
getVersionString = {
|
||||||
String buildVersion = getBuildVersion()
|
String buildVersion = getBuildVersion()
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class Pathfinder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean passable(Tile tile, Team team){
|
private boolean passable(Tile tile, Team team){
|
||||||
return (tile.getWallID() == 0 && tile.cliffs == 0 && !(tile.floor().isLiquid && (tile.floor().damageTaken > 0 || tile.floor().drownTime > 0)))
|
return (tile.getWallID() == 0 && tile.cliffs == 0 && !tile.floor().solid && !(tile.floor().isLiquid && (tile.floor().damageTaken > 0 || tile.floor().drownTime > 0)))
|
||||||
|| (tile.breakable() && (tile.getTeam() != team)) || !tile.solid();
|
|| (tile.breakable() && (tile.getTeam() != team)) || !tile.solid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class StatusEffects implements ContentList {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Unit unit, float time) {
|
public void update(Unit unit, float time) {
|
||||||
unit.damagePeriodic(0.1f);
|
unit.damagePeriodic(0.3f);
|
||||||
|
|
||||||
if (Mathf.chance(Timers.delta() * 0.2f)) {
|
if (Mathf.chance(Timers.delta() * 0.2f)) {
|
||||||
Effects.effect(EnvironmentFx.melting, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
|
Effects.effect(EnvironmentFx.melting, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class Blocks extends BlockList implements ContentList{
|
|||||||
lava = new Floor("lava") {{
|
lava = new Floor("lava") {{
|
||||||
liquidColor = Color.valueOf("ed5334");
|
liquidColor = Color.valueOf("ed5334");
|
||||||
speedMultiplier = 0.2f;
|
speedMultiplier = 0.2f;
|
||||||
damageTaken = 0.1f;
|
damageTaken = 0.5f;
|
||||||
status = StatusEffects.melting;
|
status = StatusEffects.melting;
|
||||||
statusIntensity = 0.8f;
|
statusIntensity = 0.8f;
|
||||||
variants = 0;
|
variants = 0;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import io.anuke.mindustry.entities.bullet.Bullet;
|
|||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
import io.anuke.mindustry.entities.effect.Fire;
|
import io.anuke.mindustry.entities.effect.Fire;
|
||||||
import io.anuke.mindustry.entities.effect.ItemDrop;
|
import io.anuke.mindustry.entities.effect.ItemDrop;
|
||||||
|
import io.anuke.mindustry.entities.effect.Lightning;
|
||||||
import io.anuke.mindustry.entities.effect.Puddle;
|
import io.anuke.mindustry.entities.effect.Puddle;
|
||||||
import io.anuke.mindustry.entities.traits.TypeTrait;
|
import io.anuke.mindustry.entities.traits.TypeTrait;
|
||||||
import io.anuke.mindustry.entities.units.UnitType;
|
import io.anuke.mindustry.entities.units.UnitType;
|
||||||
@@ -154,5 +155,6 @@ public class ContentLoader {
|
|||||||
TypeTrait.registerType(Fire.class, Fire::new);
|
TypeTrait.registerType(Fire.class, Fire::new);
|
||||||
TypeTrait.registerType(Puddle.class, Puddle::new);
|
TypeTrait.registerType(Puddle.class, Puddle::new);
|
||||||
TypeTrait.registerType(Bullet.class, Bullet::new);
|
TypeTrait.registerType(Bullet.class, Bullet::new);
|
||||||
|
TypeTrait.registerType(Lightning.class, Lightning::new);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ public class Control extends Module{
|
|||||||
|
|
||||||
for(int i = 0 ; i < Recipe.all().size; i ++){
|
for(int i = 0 ; i < Recipe.all().size; i ++){
|
||||||
Recipe recipe = Recipe.all().get(i);
|
Recipe recipe = Recipe.all().get(i);
|
||||||
if(!recipe.debugOnly && entity.items.hasItems(recipe.requirements)){
|
if(!recipe.debugOnly && entity.items.hasItems(recipe.requirements, 1.4f)){
|
||||||
if(control.database().unlockContent(recipe)){
|
if(control.database().unlockContent(recipe)){
|
||||||
ui.hudfrag.showUnlock(recipe);
|
ui.hudfrag.showUnlock(recipe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,10 +280,12 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void damage(float amount, boolean withEffect){
|
public void damage(float amount, boolean withEffect){
|
||||||
if(withEffect){
|
float pre = hitTime;
|
||||||
damage(amount);
|
|
||||||
}else{
|
damage(amount);
|
||||||
super.damage(amount);
|
|
||||||
|
if(!withEffect){
|
||||||
|
hitTime = pre;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import io.anuke.annotations.Annotations.Loc;
|
|||||||
import io.anuke.annotations.Annotations.Remote;
|
import io.anuke.annotations.Annotations.Remote;
|
||||||
import io.anuke.mindustry.content.StatusEffects;
|
import io.anuke.mindustry.content.StatusEffects;
|
||||||
import io.anuke.mindustry.entities.Units;
|
import io.anuke.mindustry.entities.Units;
|
||||||
|
import io.anuke.mindustry.entities.traits.SyncTrait;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.mindustry.gen.CallEntity;
|
import io.anuke.mindustry.gen.CallEntity;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
@@ -26,10 +27,14 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
import io.anuke.ucore.util.Pooling;
|
import io.anuke.ucore.util.Pooling;
|
||||||
import io.anuke.ucore.util.SeedRandom;
|
import io.anuke.ucore.util.SeedRandom;
|
||||||
|
|
||||||
|
import java.io.DataInput;
|
||||||
|
import java.io.DataOutput;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.bulletGroup;
|
import static io.anuke.mindustry.Vars.bulletGroup;
|
||||||
|
|
||||||
//TODO utterly broken
|
//TODO utterly broken
|
||||||
public class Lightning extends TimedEntity implements Poolable, DrawTrait{
|
public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncTrait{
|
||||||
private static Array<SolidTrait> entities = new Array<>();
|
private static Array<SolidTrait> entities = new Array<>();
|
||||||
private static Rectangle rect = new Rectangle();
|
private static Rectangle rect = new Rectangle();
|
||||||
private static Rectangle hitrect = new Rectangle();
|
private static Rectangle hitrect = new Rectangle();
|
||||||
@@ -113,6 +118,21 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait{
|
|||||||
/**For pooling use only. Do not call directly!*/
|
/**For pooling use only. Do not call directly!*/
|
||||||
public Lightning(){}
|
public Lightning(){}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSyncing() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void write(DataOutput data) throws IOException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void read(DataInput data, long time) throws IOException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float lifetime() {
|
public float lifetime() {
|
||||||
return 10;
|
return 10;
|
||||||
|
|||||||
@@ -299,9 +299,9 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
@Override
|
@Override
|
||||||
public void drawOutlined(){
|
public void drawOutlined(){
|
||||||
|
|
||||||
Draw.color(Palette.placing);
|
//Draw.color(Palette.placing);
|
||||||
Lines.poly(player.x, player.y, 100, Player.placeDistance);
|
//Lines.poly(player.x, player.y, 100, Player.placeDistance);
|
||||||
Draw.color();
|
//Draw.color();
|
||||||
|
|
||||||
Shaders.mix.color.set(Palette.accent);
|
Shaders.mix.color.set(Palette.accent);
|
||||||
Graphics.shader(Shaders.mix);
|
Graphics.shader(Shaders.mix);
|
||||||
|
|||||||
@@ -129,9 +129,9 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
sound.volumePrefs();
|
sound.volumePrefs();
|
||||||
|
|
||||||
game.screenshakePref();
|
game.screenshakePref();
|
||||||
game.checkPref("smoothcam", true);
|
//game.checkPref("smoothcam", true);
|
||||||
game.checkPref("effects", true);
|
game.checkPref("effects", true);
|
||||||
game.sliderPref("sensitivity", 100, 10, 300, i -> i + "%");
|
//game.sliderPref("sensitivity", 100, 10, 300, i -> i + "%");
|
||||||
game.sliderPref("saveinterval", 90, 10, 5*120, i -> Bundles.format("setting.seconds", i));
|
game.sliderPref("saveinterval", 90, 10, 5*120, i -> Bundles.format("setting.seconds", i));
|
||||||
|
|
||||||
if(!gwt){
|
if(!gwt){
|
||||||
@@ -160,8 +160,6 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
|
|
||||||
graphics.checkPref("fps", false);
|
graphics.checkPref("fps", false);
|
||||||
graphics.checkPref("lasers", true);
|
graphics.checkPref("lasers", true);
|
||||||
graphics.sliderPref("previewopacity", 50, 0, 100, i -> i + "%");
|
|
||||||
graphics.checkPref("indicators", true);
|
|
||||||
graphics.checkPref("healthbars", true);
|
graphics.checkPref("healthbars", true);
|
||||||
graphics.checkPref("minimap", !mobile); //minimap is disabled by default on mobile devices
|
graphics.checkPref("minimap", !mobile); //minimap is disabled by default on mobile devices
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class UnlocksDialog extends FloatingDialog {
|
|||||||
table.table(list -> {
|
table.table(list -> {
|
||||||
list.left();
|
list.left();
|
||||||
|
|
||||||
int maxWidth = UIUtils.portrait() ? 6 : 14;
|
int maxWidth = UIUtils.portrait() ? 7 : 14;
|
||||||
int size = 8*6;
|
int size = 8*6;
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ public class BlocksFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
lastCategory = cat;
|
lastCategory = cat;
|
||||||
stack.act(Gdx.graphics.getDeltaTime());
|
stack.act(Gdx.graphics.getDeltaTime());
|
||||||
|
stack.act(Gdx.graphics.getDeltaTime());
|
||||||
}).growX().height(54).group(group)
|
}).growX().height(54).group(group)
|
||||||
.name("sectionbutton" + cat.name()).get();
|
.name("sectionbutton" + cat.name()).get();
|
||||||
|
|
||||||
@@ -251,10 +252,12 @@ public class BlocksFragment extends Fragment{
|
|||||||
recipeTable.add(image).size(size + 8);
|
recipeTable.add(image).size(size + 8);
|
||||||
|
|
||||||
image.update(() -> {
|
image.update(() -> {
|
||||||
for(Player player : players){
|
if(!image.isDisabled()) {
|
||||||
if(control.input(player.playerIndex).recipe == r){
|
for (Player player : players) {
|
||||||
image.setChecked(true);
|
if (control.input(player.playerIndex).recipe == r) {
|
||||||
return;
|
image.setChecked(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
image.setChecked(false);
|
image.setChecked(false);
|
||||||
|
|||||||
@@ -18,6 +18,13 @@ public class InventoryModule extends BlockModule{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasItems(ItemStack[] stacks, float amountScaling){
|
||||||
|
for(ItemStack stack : stacks){
|
||||||
|
if(!hasItem(stack.item, (int)(stack.amount * amountScaling))) return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**Returns true if this entity has at least one of each item in each stack.*/
|
/**Returns true if this entity has at least one of each item in each stack.*/
|
||||||
public boolean hasAtLeastOneOfItems(ItemStack[] stacks){
|
public boolean hasAtLeastOneOfItems(ItemStack[] stacks){
|
||||||
for(ItemStack stack : stacks){
|
for(ItemStack stack : stacks){
|
||||||
|
|||||||
Reference in New Issue
Block a user