Many various bugfixes
This commit is contained in:
@@ -84,7 +84,7 @@ public class Pathfinder {
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ public class StatusEffects implements ContentList {
|
||||
|
||||
@Override
|
||||
public void update(Unit unit, float time) {
|
||||
unit.damagePeriodic(0.1f);
|
||||
unit.damagePeriodic(0.3f);
|
||||
|
||||
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));
|
||||
|
||||
@@ -76,7 +76,7 @@ public class Blocks extends BlockList implements ContentList{
|
||||
lava = new Floor("lava") {{
|
||||
liquidColor = Color.valueOf("ed5334");
|
||||
speedMultiplier = 0.2f;
|
||||
damageTaken = 0.1f;
|
||||
damageTaken = 0.5f;
|
||||
status = StatusEffects.melting;
|
||||
statusIntensity = 0.8f;
|
||||
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.effect.Fire;
|
||||
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.traits.TypeTrait;
|
||||
import io.anuke.mindustry.entities.units.UnitType;
|
||||
@@ -154,5 +155,6 @@ public class ContentLoader {
|
||||
TypeTrait.registerType(Fire.class, Fire::new);
|
||||
TypeTrait.registerType(Puddle.class, Puddle::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 ++){
|
||||
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)){
|
||||
ui.hudfrag.showUnlock(recipe);
|
||||
}
|
||||
|
||||
@@ -280,10 +280,12 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
||||
}
|
||||
|
||||
public void damage(float amount, boolean withEffect){
|
||||
if(withEffect){
|
||||
damage(amount);
|
||||
}else{
|
||||
super.damage(amount);
|
||||
float pre = hitTime;
|
||||
|
||||
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.mindustry.content.StatusEffects;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.entities.traits.SyncTrait;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.gen.CallEntity;
|
||||
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.SeedRandom;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
|
||||
import static io.anuke.mindustry.Vars.bulletGroup;
|
||||
|
||||
//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 Rectangle rect = 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!*/
|
||||
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
|
||||
public float lifetime() {
|
||||
return 10;
|
||||
|
||||
@@ -299,9 +299,9 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
@Override
|
||||
public void drawOutlined(){
|
||||
|
||||
Draw.color(Palette.placing);
|
||||
Lines.poly(player.x, player.y, 100, Player.placeDistance);
|
||||
Draw.color();
|
||||
//Draw.color(Palette.placing);
|
||||
//Lines.poly(player.x, player.y, 100, Player.placeDistance);
|
||||
//Draw.color();
|
||||
|
||||
Shaders.mix.color.set(Palette.accent);
|
||||
Graphics.shader(Shaders.mix);
|
||||
|
||||
@@ -129,9 +129,9 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
sound.volumePrefs();
|
||||
|
||||
game.screenshakePref();
|
||||
game.checkPref("smoothcam", true);
|
||||
//game.checkPref("smoothcam", 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));
|
||||
|
||||
if(!gwt){
|
||||
@@ -160,8 +160,6 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
|
||||
graphics.checkPref("fps", false);
|
||||
graphics.checkPref("lasers", true);
|
||||
graphics.sliderPref("previewopacity", 50, 0, 100, i -> i + "%");
|
||||
graphics.checkPref("indicators", true);
|
||||
graphics.checkPref("healthbars", true);
|
||||
graphics.checkPref("minimap", !mobile); //minimap is disabled by default on mobile devices
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class UnlocksDialog extends FloatingDialog {
|
||||
table.table(list -> {
|
||||
list.left();
|
||||
|
||||
int maxWidth = UIUtils.portrait() ? 6 : 14;
|
||||
int maxWidth = UIUtils.portrait() ? 7 : 14;
|
||||
int size = 8*6;
|
||||
|
||||
int count = 0;
|
||||
|
||||
@@ -150,6 +150,7 @@ public class BlocksFragment extends Fragment{
|
||||
}
|
||||
lastCategory = cat;
|
||||
stack.act(Gdx.graphics.getDeltaTime());
|
||||
stack.act(Gdx.graphics.getDeltaTime());
|
||||
}).growX().height(54).group(group)
|
||||
.name("sectionbutton" + cat.name()).get();
|
||||
|
||||
@@ -251,10 +252,12 @@ public class BlocksFragment extends Fragment{
|
||||
recipeTable.add(image).size(size + 8);
|
||||
|
||||
image.update(() -> {
|
||||
for(Player player : players){
|
||||
if(control.input(player.playerIndex).recipe == r){
|
||||
image.setChecked(true);
|
||||
return;
|
||||
if(!image.isDisabled()) {
|
||||
for (Player player : players) {
|
||||
if (control.input(player.playerIndex).recipe == r) {
|
||||
image.setChecked(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
image.setChecked(false);
|
||||
|
||||
@@ -18,6 +18,13 @@ public class InventoryModule extends BlockModule{
|
||||
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.*/
|
||||
public boolean hasAtLeastOneOfItems(ItemStack[] stacks){
|
||||
for(ItemStack stack : stacks){
|
||||
|
||||
Reference in New Issue
Block a user