Added dart as default starter

This commit is contained in:
Anuken
2020-05-22 14:35:25 -04:00
parent 795bd84d06
commit 12d9479184
21 changed files with 818 additions and 772 deletions

View File

@@ -1,5 +1,7 @@
#Maps entity names to IDs. Autogenerated. #Maps entity names to IDs. Autogenerated.
alpha=14
dart=15
draug=0 draug=0
mindustry.entities.comp.BulletComp=1 mindustry.entities.comp.BulletComp=1
mindustry.entities.comp.DecalComp=2 mindustry.entities.comp.DecalComp=2

View File

@@ -0,0 +1 @@
{fields:[{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{fields:[{name:armor,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:2,fields:[{name:armor,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:2,fields:[{name:armor,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:2,fields:[{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:2,fields:[{name:armor,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:2,fields:[{name:armor,type:float,size:4},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:vel,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 654 B

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 1019 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 742 KiB

After

Width:  |  Height:  |  Size: 736 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 128 KiB

View File

@@ -12,17 +12,23 @@ import mindustry.type.*;
public class UnitTypes implements ContentList{ public class UnitTypes implements ContentList{
//ground //ground
public static @EntityDef({Unitc.class, Legsc.class}) UnitType titan, dagger, crawler, fortress, eruptor, chaosArray, eradicator, alpha; public static @EntityDef({Unitc.class, Legsc.class}) UnitType titan, dagger, crawler, fortress, eruptor, chaosArray, eradicator;
//ground + builder
public static @EntityDef({Unitc.class, Legsc.class, Builderc.class}) UnitType alpha;
//air //air
public static @EntityDef({Unitc.class}) UnitType wraith, reaper, ghoul, revenant, lich; public static @EntityDef({Unitc.class}) UnitType wraith, reaper, ghoul, revenant, lich;
//mining //air + mining
public static @EntityDef({Unitc.class, Minerc.class}) UnitType draug; public static @EntityDef({Unitc.class, Minerc.class}) UnitType draug;
//building //air + building
public static @EntityDef({Unitc.class, Builderc.class}) UnitType phantom, spirit; public static @EntityDef({Unitc.class, Builderc.class}) UnitType phantom, spirit;
//air + building + mining
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class}) UnitType dart;
//water //water
public static @EntityDef({Unitc.class, WaterMovec.class, Commanderc.class}) UnitType vanguard; public static @EntityDef({Unitc.class, WaterMovec.class, Commanderc.class}) UnitType vanguard;
@@ -245,7 +251,32 @@ public class UnitTypes implements ContentList{
recoil = 2f; recoil = 2f;
bullet = Bullets.healBulletBig; bullet = Bullets.healBulletBig;
shootSound = Sounds.pew; shootSound = Sounds.pew;
}});
}};
dart = new UnitType("dart"){{
flying = true;
mineSpeed = 2f;
drag = 0.05f;
mass = 2f;
speed = 2.9f;
rotateSpeed = 15f;
accel = 0.15f;
range = 70f;
itemCapacity = 70;
health = 400;
buildSpeed = 0.85f;
engineOffset = 6f;
hitsize = 8f;
weapons.add(new Weapon("small-heal-weapon"){{
reload = 14f;
x = -1f;
y = -1f;
shootX = 3.5f;
alternate = true;
ejectEffect = Fx.none;
bullet = Bullets.healBullet;
}}); }});
}}; }};

View File

@@ -4,6 +4,7 @@ import arc.*;
import arc.math.*; import arc.math.*;
import arc.math.geom.*; import arc.math.geom.*;
import arc.util.*; import arc.util.*;
import arc.util.ArcAnnotate.*;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.entities.*; import mindustry.entities.*;
@@ -174,7 +175,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
controller.update(); controller.update();
//remove units spawned by the core //remove units spawned by the core
if(spawnedByCore && !(controller instanceof Playerc)){ if(spawnedByCore && !isPlayer()){
Fx.unitDespawn.at(x, y, 0, this); Fx.unitDespawn.at(x, y, 0, this);
remove(); remove();
} }
@@ -195,6 +196,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
return controller instanceof Playerc; return controller instanceof Playerc;
} }
@Nullable
public Playerc getPlayer(){ public Playerc getPlayer(){
return isPlayer() ? (Playerc)controller : null; return isPlayer() ? (Playerc)controller : null;
} }

View File

@@ -560,7 +560,9 @@ public class DesktopInput extends InputHandler{
protected void updateMovement(Unitc unit){ protected void updateMovement(Unitc unit){
boolean omni = !(unit instanceof WaterMovec); boolean omni = !(unit instanceof WaterMovec);
boolean legs = unit.isGrounded(); boolean legs = unit.isGrounded();
float speed = unit.type().speed * Mathf.lerp(1f, unit.type().canBoost ? unit.type().boostMultiplier : 1f, unit.elevation());
float strafePenalty = legs ? 1f : Mathf.lerp(1f, unit.type().strafePenalty, Angles.angleDist(unit.vel().angle(), unit.rotation()) / 180f);
float speed = unit.type().speed * Mathf.lerp(1f, unit.type().canBoost ? unit.type().boostMultiplier : 1f, unit.elevation()) * strafePenalty;
float xa = Core.input.axis(Binding.move_x); float xa = Core.input.axis(Binding.move_x);
float ya = Core.input.axis(Binding.move_y); float ya = Core.input.axis(Binding.move_y);
@@ -572,11 +574,7 @@ public class DesktopInput extends InputHandler{
unit.lookAt(mouseAngle); unit.lookAt(mouseAngle);
}else{ }else{
if(!unit.vel().isZero(0.01f)){ if(!unit.vel().isZero(0.01f)){
if(unit.type().flying){ unit.lookAt(unit.vel().angle());
unit.rotation(unit.vel().angle());
}else{
unit.lookAt(unit.vel().angle());
}
} }
} }

View File

@@ -1,8 +1,6 @@
package mindustry.maps.generators; package mindustry.maps.generators;
import arc.math.geom.*;
import arc.struct.*; import arc.struct.*;
import mindustry.content.*;
import mindustry.game.*; import mindustry.game.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.world.*; import mindustry.world.*;
@@ -10,8 +8,8 @@ import mindustry.world.*;
public class BaseGenerator{ public class BaseGenerator{
public void generate(Tiles tiles, Array<Tile> cores, Tile spawn, Team team, Sector sector){ public void generate(Tiles tiles, Array<Tile> cores, Tile spawn, Team team, Sector sector){
//algorithm idea: make it spawn prefab turret setups and route resources to them with conveyors from chunks of ore drill setups
/*
GridBits used = new GridBits(tiles.width, tiles.height); GridBits used = new GridBits(tiles.width, tiles.height);
Queue<Tile> frontier = new Queue<>(); Queue<Tile> frontier = new Queue<>();
for(Tile tile : cores){ for(Tile tile : cores){
@@ -44,7 +42,7 @@ public class BaseGenerator{
tile.clearOverlay(); tile.clearOverlay();
tile.setBlock(Blocks.coreShard, team); tile.setBlock(Blocks.coreShard, team);
} }*/
} }

View File

@@ -45,6 +45,7 @@ public class UnitType extends UnlockableContent{
public Color engineColor = Pal.engine; public Color engineColor = Pal.engine;
public float engineOffset = 5f, engineSize = 2.5f; public float engineOffset = 5f, engineSize = 2.5f;
public float strafePenalty = 0.5f;
public float hitsize = 6f; public float hitsize = 6f;
public float itemOffsetY = 3f; public float itemOffsetY = 3f;
public float lightRadius = 60f, lightOpacity = 0.6f; public float lightRadius = 60f, lightOpacity = 0.6f;
@@ -147,7 +148,7 @@ public class UnitType extends UnlockableContent{
unit.trns(legOffset.x, legOffset.y); unit.trns(legOffset.x, legOffset.y);
} }
Draw.z(z - 0.01f); Draw.z(Math.min(z - 0.01f, Layer.bullet - 1f));
drawOcclusion(unit); drawOcclusion(unit);
Draw.z(z); Draw.z(z);

View File

@@ -21,7 +21,7 @@ import mindustry.world.modules.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
public class CoreBlock extends StorageBlock{ public class CoreBlock extends StorageBlock{
public UnitType unitType = UnitTypes.phantom; public UnitType unitType = UnitTypes.dart;
public CoreBlock(String name){ public CoreBlock(String name){
super(name); super(name);