New tentative edge style / Zone tweaks

This commit is contained in:
Anuken
2019-03-26 20:10:01 -04:00
parent 545a64f7dc
commit 7ce571e59c
17 changed files with 296 additions and 297 deletions

View File

@@ -230,6 +230,7 @@ public class Blocks implements ContentList{
dragMultiplier = 1f;
speedMultiplier = 1f;
attributes.set(Attribute.water, 0.4f);
edgeStyle = "blocky";
}};
iceSnow = new Floor("ice-snow"){{
@@ -702,16 +703,20 @@ public class Blocks implements ContentList{
reload = 200f;
range = 40f;
healPercent = 5f;
consumes.item(Items.phasefabric).optional(true);
phaseBoost = 4f;
phaseRangeBoost = 20f;
health = 80;
consumes.item(Items.silicon).optional(true);
}};
mendProjector = new MendProjector("mend-projector"){{
requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 40, Items.silicon, 80));
requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 50, Items.silicon, 80));
consumes.power(1.8f);
size = 2;
reload = 250f;
range = 70f;
healPercent = 13f;
range = 85f;
healPercent = 14f;
health = 80 * size * size;
consumes.item(Items.phasefabric).optional(true);
}};
@@ -1131,7 +1136,7 @@ public class Blocks implements ContentList{
Items.scrap, Bullets.flakScrap,
Items.lead, Bullets.flakLead
);
reload = 25f;
reload = 20f;
range = 180f;
size = 2;
burstSpacing = 5f;
@@ -1317,8 +1322,8 @@ public class Blocks implements ContentList{
Items.surgealloy, Bullets.flakSurge
);
xRand = 4f;
reload = 8f;
range = 160f;
reload = 7f;
range = 170f;
size = 3;
recoil = 3f;
rotatespeed = 10f;

View File

@@ -178,7 +178,7 @@ public class UnitTypes implements ContentList{
drag = 0.01f;
mass = 1.5f;
isFlying = true;
health = 70;
health = 75;
engineOffset = 5.5f;
weapon = new Weapon("chain-blaster"){{
length = 1.5f;
@@ -190,7 +190,7 @@ public class UnitTypes implements ContentList{
}};
ghoul = new UnitType("ghoul", Ghoul.class, Ghoul::new){{
health = 250;
health = 220;
speed = 0.2f;
maxVelocity = 1.4f;
mass = 3f;

View File

@@ -211,7 +211,7 @@ public class FloorRenderer{
int chunksx = Mathf.ceil((float) (world.width()) / chunksize),
chunksy = Mathf.ceil((float) (world.height()) / chunksize) ;
cache = new Chunk[chunksx][chunksy];
SpriteCache sprites = new SpriteCache(world.width() * world.height() * 5, (world.width() / chunksize) * (world.height() / chunksize) * 2, false);
SpriteCache sprites = new SpriteCache(world.width() * world.height() * 6, (world.width() / chunksize) * (world.height() / chunksize) * 2, false);
cbatch = new CacheBatch(sprites);
Time.mark();

View File

@@ -8,11 +8,9 @@ import io.anuke.arc.function.Supplier;
import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.scene.ui.layout.Table;
import io.anuke.mindustry.content.Loadouts;
import io.anuke.mindustry.content.StatusEffects;
import io.anuke.mindustry.game.EventType.ZoneCompleteEvent;
import io.anuke.mindustry.game.EventType.ZoneConfigureCompleteEvent;
import io.anuke.mindustry.game.Rules;
import io.anuke.mindustry.game.SpawnGroup;
import io.anuke.mindustry.game.UnlockableContent;
import io.anuke.mindustry.maps.generators.Generator;
import io.anuke.mindustry.maps.generators.MapGenerator;
@@ -32,7 +30,7 @@ public class Zone extends UnlockableContent{
public Supplier<Rules> rules = Rules::new;
public boolean alwaysUnlocked;
public int conditionWave = Integer.MAX_VALUE;
public int configureWave = 40;
public int configureWave = 10;
public int launchPeriod = 10;
public Loadout loadout = Loadouts.basicShard;
@@ -45,15 +43,6 @@ public class Zone extends UnlockableContent{
this.generator = generator;
}
protected SpawnGroup bossGroup(UnitType type){
return new SpawnGroup(type){{
begin = configureWave-1;
effect = StatusEffects.boss;
unitScaling = 1;
spacing = configureWave;
}};
}
public boolean isBossWave(int wave){
return wave % configureWave == 0 && wave > 0;
}

View File

@@ -124,10 +124,17 @@ public class ZoneInfoDialog extends FloatingDialog{
rebuildLoadout[0] = () -> {
load.clear();
float bsize = 40f;
int step = 100;
int step = 50;
load.left();
for(ItemStack stack : zone.getStartingItems()){
load.addButton("x", () -> {
zone.getStartingItems().remove(stack);
zone.updateLaunchCost();
rebuildItems.run();
rebuildLoadout[0].run();
}).size(bsize).pad(2);
load.addButton("-", () -> {
stack.amount = Math.max(stack.amount - step, 0);
zone.updateLaunchCost();

View File

@@ -1,6 +1,8 @@
package io.anuke.mindustry.world.blocks;
import io.anuke.arc.Core;
import io.anuke.arc.collection.Array;
import io.anuke.arc.collection.IntSet;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf;
@@ -58,6 +60,8 @@ public class Floor extends Block{
protected TextureRegion[][] edges;
protected byte eq = 0;
protected Array<Block> blenders = new Array<>();
protected IntSet blended = new IntSet();
public Floor(String name){
super(name);
@@ -121,25 +125,34 @@ public class Floor extends Block{
}
protected void drawEdges(Tile tile, boolean sameLayer){
blenders.clear();
blended.clear();
eq = 0;
for(int i = 0; i < 8; i++){
Point2 point = Geometry.d8[i];
Tile other = tile.getNearby(point);
if(other != null && doEdge(other.floor(), sameLayer) && other.floor().edges() != null){
if(blended.add(other.floor().id)){
blenders.add(other.floor());
}
eq |= (1 << i);
}
}
for(int i = 0; i < 8; i++){
if(eq(i)){
blenders.sort((a, b) -> Integer.compare(a.id, b.id));
for(Block block : blenders){
for(int i = 0; i < 8; i++){
Point2 point = Geometry.d8[i];
Tile other = tile.getNearby(point);
TextureRegion region = edge(other.floor(), type(i), 2-(point.x + 1), 2-(point.y + 1));
Draw.rect(region, tile.worldx(), tile.worldy());
if(other != null && other.floor() == block){
TextureRegion region = edge((Floor)block, type(i), 2-(point.x + 1), 2-(point.y + 1));
Draw.rect(region, tile.worldx(), tile.worldy());
}
}
}
}
protected TextureRegion[][] edges(){

View File

@@ -34,20 +34,7 @@ public abstract class Consume{
return update;
}
public abstract void build(Tile tile, Table table);/*{
Table t = new Table("flat");
t.margin(4);
buildTooltip(t);
int scale = mobile ? 4 : 3;
table.table(out -> {
out.addImage(getIcon()).size(10 * scale).color(Color.DARK_GRAY).padRight(-10 * scale).padBottom(-scale * 2);
out.addImage(getIcon()).size(10 * scale).color(Pal.accent);
out.addImage("icon-missing").size(10 * scale).color(Pal.remove).padLeft(-10 * scale);
}).size(10 * scale).get().addListener(new Tooltip<>(t));
}*/
public abstract void build(Tile tile, Table table);
/**Called when a consumption is triggered manually.*/
public void trigger(Block block, TileEntity entity){