Many things that won't fit in a commit message

This commit is contained in:
Anuken
2020-09-11 23:04:19 -04:00
parent 3feb9e76f0
commit 1c6fed8df8
8 changed files with 33 additions and 18 deletions

View File

@@ -366,7 +366,11 @@ public class TechTree implements ContentList{
node(dagger, () -> { node(dagger, () -> {
node(mace, () -> { node(mace, () -> {
node(fortress, () -> { node(fortress, () -> {
node(scepter, () -> {
node(reign, () -> {
});
});
}); });
}); });
@@ -381,7 +385,11 @@ public class TechTree implements ContentList{
node(crawler, () -> { node(crawler, () -> {
node(atrax, () -> { node(atrax, () -> {
node(spiroct, () -> { node(spiroct, () -> {
node(arkyid, () -> {
node(toxopid, () -> {
});
});
}); });
}); });
}); });

View File

@@ -419,7 +419,6 @@ public class UnitTypes implements ContentList{
}}; }};
spiroct = new UnitType("spiroct"){{ spiroct = new UnitType("spiroct"){{
itemCapacity = 200;
speed = 0.4f; speed = 0.4f;
drag = 0.4f; drag = 0.4f;
hitsize = 12f; hitsize = 12f;
@@ -647,7 +646,7 @@ public class UnitTypes implements ContentList{
x = 0f; x = 0f;
shootY = 22f; shootY = 22f;
mirror = false; mirror = false;
reload = 180; reload = 210;
shake = 10f; shake = 10f;
recoil = 10f; recoil = 10f;
rotateSpeed = 1f; rotateSpeed = 1f;
@@ -656,7 +655,7 @@ public class UnitTypes implements ContentList{
rotate = true; rotate = true;
occlusion = 30f; occlusion = 30f;
bullet = new ArtilleryBulletType(3f, 70){{ bullet = new ArtilleryBulletType(3f, 50){{
hitEffect = Fx.sapExplosion; hitEffect = Fx.sapExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 80f; lifetime = 80f;
@@ -684,7 +683,7 @@ public class UnitTypes implements ContentList{
lifetime = 90f; lifetime = 90f;
width = height = 20f; width = height = 20f;
collidesTiles = false; collidesTiles = false;
splashDamageRadius = 90f; splashDamageRadius = 80f;
splashDamage = 45f; splashDamage = 45f;
backColor = Pal.sapBulletBack; backColor = Pal.sapBulletBack;
frontColor = lightningColor = Pal.sapBullet; frontColor = lightningColor = Pal.sapBullet;

View File

@@ -22,6 +22,8 @@ abstract class StatusComp implements Posc, Flyingc{
@ReadOnly transient float speedMultiplier = 1, damageMultiplier = 1, armorMultiplier = 1, reloadMultiplier = 1; @ReadOnly transient float speedMultiplier = 1, damageMultiplier = 1, armorMultiplier = 1, reloadMultiplier = 1;
@Import UnitType type;
/** @return damage taken based on status armor multipliers */ /** @return damage taken based on status armor multipliers */
float getShieldDamage(float amount){ float getShieldDamage(float amount){
return amount * Mathf.clamp(1f - armorMultiplier / 100f); return amount * Mathf.clamp(1f - armorMultiplier / 100f);
@@ -102,7 +104,7 @@ abstract class StatusComp implements Posc, Flyingc{
@Override @Override
public void update(){ public void update(){
Floor floor = floorOn(); Floor floor = floorOn();
if(isGrounded()){ if(isGrounded() && !type.hovering){
//apply effect //apply effect
apply(floor.status, floor.statusDuration); apply(floor.status, floor.statusDuration);
} }

View File

@@ -64,7 +64,7 @@ public class UnitType extends UnlockableContent{
public boolean flipBackLegs = true; public boolean flipBackLegs = true;
public float mechLegMoveScl = 1f; public float mechLegMoveScl = 1f;
public int itemCapacity = 30; public int itemCapacity = -1;
public int ammoCapacity = 220; public int ammoCapacity = 220;
public int mineTier = -1; public int mineTier = -1;
public float buildSpeed = 1f, mineSpeed = 1f; public float buildSpeed = 1f, mineSpeed = 1f;
@@ -185,6 +185,10 @@ public class UnitType extends UnlockableContent{
singleTarget = weapons.size <= 1; singleTarget = weapons.size <= 1;
if(itemCapacity < 0){
itemCapacity = Math.max(Mathf.round(hitsize * 7, 20), 20);
}
//set up default range //set up default range
if(range < 0){ if(range < 0){
range = Float.MAX_VALUE; range = Float.MAX_VALUE;

View File

@@ -10,8 +10,12 @@ public class ItemImage extends Stack{
public ItemImage(TextureRegion region, int amount){ public ItemImage(TextureRegion region, int amount){
Table t = new Table().left().bottom(); Table t = new Table().left().bottom();
t.add(amount + "").name("item-label"); t.add(amount + "").name("item-label");
t.pack();
add(new Image(region)); add(new Table(o -> {
o.left();
o.add(new Image(region)).size(32f);
}));
add(t); add(t);
} }

View File

@@ -1,12 +1,13 @@
package mindustry.ui.dialogs; package mindustry.ui.dialogs;
import arc.*; import arc.*;
import arc.input.*;
import arc.struct.*;
import arc.graphics.*; import arc.graphics.*;
import arc.input.*;
import arc.math.*;
import arc.scene.event.*; import arc.scene.event.*;
import arc.scene.ui.*; import arc.scene.ui.*;
import arc.scene.ui.layout.*; import arc.scene.ui.layout.*;
import arc.struct.*;
import arc.util.*; import arc.util.*;
import mindustry.*; import mindustry.*;
import mindustry.ctype.*; import mindustry.ctype.*;
@@ -14,7 +15,7 @@ import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.ui.*; import mindustry.ui.*;
import static mindustry.Vars.ui; import static mindustry.Vars.*;
public class DatabaseDialog extends BaseDialog{ public class DatabaseDialog extends BaseDialog{
@@ -49,8 +50,7 @@ public class DatabaseDialog extends BaseDialog{
table.table(list -> { table.table(list -> {
list.left(); list.left();
int maxWidth = Core.graphics.isPortrait() ? 7 : 13; int cols = Mathf.clamp((Core.graphics.getWidth() - 30) / (32 + 10), 1, 18);
int count = 0; int count = 0;
for(int i = 0; i < array.size; i++){ for(int i = 0; i < array.size; i++){
@@ -77,7 +77,7 @@ public class DatabaseDialog extends BaseDialog{
image.addListener(new Tooltip(t -> t.background(Tex.button).add(unlock.localizedName))); image.addListener(new Tooltip(t -> t.background(Tex.button).add(unlock.localizedName)));
} }
if((++count) % maxWidth == 0){ if((++count) % cols == 0){
list.row(); list.row();
} }
} }

View File

@@ -1,7 +1,6 @@
package mindustry.world.consumers; package mindustry.world.consumers;
import arc.func.*; import arc.func.*;
import arc.math.*;
import arc.scene.ui.layout.*; import arc.scene.ui.layout.*;
import arc.struct.*; import arc.struct.*;
import arc.util.ArcAnnotate.*; import arc.util.ArcAnnotate.*;
@@ -48,7 +47,7 @@ public class ConsumeItemDynamic extends Consume{
for(ItemStack stack : items.get(tile)){ for(ItemStack stack : items.get(tile)){
table.add(new ReqImage(new ItemImage(stack.item.icon(Cicon.medium), stack.amount), table.add(new ReqImage(new ItemImage(stack.item.icon(Cicon.medium), stack.amount),
() -> tile.items != null && tile.items.has(stack.item, stack.amount))).size(8 * 4).padRight(6 * Mathf.digits(stack.amount)); () -> tile.items != null && tile.items.has(stack.item, stack.amount))).padRight(8);
} }
} }

View File

@@ -1,8 +1,7 @@
package mindustry.world.consumers; package mindustry.world.consumers;
import arc.math.*;
import arc.struct.*;
import arc.scene.ui.layout.*; import arc.scene.ui.layout.*;
import arc.struct.*;
import arc.util.ArcAnnotate.*; import arc.util.ArcAnnotate.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.type.*; import mindustry.type.*;
@@ -38,7 +37,7 @@ public class ConsumeItems extends Consume{
public void build(Building tile, Table table){ public void build(Building tile, Table table){
for(ItemStack stack : items){ for(ItemStack stack : items){
table.add(new ReqImage(new ItemImage(stack.item.icon(Cicon.medium), stack.amount), table.add(new ReqImage(new ItemImage(stack.item.icon(Cicon.medium), stack.amount),
() -> tile.items != null && tile.items.has(stack.item, stack.amount))).size(8 * 4).padRight(Mathf.digits(stack.amount) * 6); () -> tile.items != null && tile.items.has(stack.item, stack.amount))).padRight(8);
} }
} }