mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-05 13:08:20 +07:00
Cleanup
This commit is contained in:
parent
dda1f18f67
commit
fed3bcd79d
@ -1,6 +1,7 @@
|
||||
package io.anuke.mindustry.content;
|
||||
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.collection.*;
|
||||
import io.anuke.arc.graphics.*;
|
||||
import io.anuke.arc.graphics.g2d.*;
|
||||
import io.anuke.arc.math.*;
|
||||
@ -1646,12 +1647,14 @@ public class Blocks implements ContentList{
|
||||
|
||||
commandCenter = new CommandCenter("command-center"){{
|
||||
requirements(Category.units, ItemStack.with(Items.copper, 200, Items.lead, 250, Items.silicon, 250, Items.graphite, 100));
|
||||
flags = EnumSet.of(BlockFlag.rally, BlockFlag.comandCenter);
|
||||
size = 2;
|
||||
health = size * size * 55;
|
||||
}};
|
||||
|
||||
//TODO unused, but may be useful later
|
||||
rallyPoint = new RallyPoint("rally-point"){{
|
||||
requirements(Category.units, ItemStack.with(Items.lead, 100, Items.silicon, 100, Items.graphite, 50));
|
||||
//requirements(Category.units, ItemStack.with(Items.lead, 100, Items.silicon, 100, Items.graphite, 50));
|
||||
size = 2;
|
||||
health = size * size * 85;
|
||||
}};
|
||||
|
@ -100,7 +100,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
||||
return indexer.getAllied(team, BlockFlag.comandCenter).size != 0 && indexer.getAllied(team, BlockFlag.comandCenter).first().entity instanceof CommandCenterEntity;
|
||||
}
|
||||
|
||||
public UnitCommand getCommand(){
|
||||
public @Nullable UnitCommand getCommand(){
|
||||
if(isCommanded()){
|
||||
return indexer.getAllied(team, BlockFlag.comandCenter).first().<CommandCenterEntity>entity().command;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public abstract class FlyingUnit extends BaseUnit{
|
||||
}
|
||||
}else{
|
||||
target = getClosestSpawner();
|
||||
moveTo(Vars.state.rules.dropZoneRadius + 80f);
|
||||
moveTo(Vars.state.rules.dropZoneRadius + 120f);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -88,7 +88,7 @@ public abstract class FlyingUnit extends BaseUnit{
|
||||
}
|
||||
|
||||
if(target != null){
|
||||
circle(80f + Mathf.randomSeed(id) * 120);
|
||||
circle(65f + Mathf.randomSeed(id) * 100);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -37,7 +37,7 @@ public abstract class GroundUnit extends BaseUnit{
|
||||
|
||||
if(core == null){
|
||||
Tile closestSpawn = getClosestSpawner();
|
||||
if(closestSpawn == null || !withinDst(closestSpawn, Vars.state.rules.dropZoneRadius + 75f)){
|
||||
if(closestSpawn == null || !withinDst(closestSpawn, Vars.state.rules.dropZoneRadius + 85f)){
|
||||
moveToCore(PathTarget.enemyCores);
|
||||
}
|
||||
}else{
|
||||
@ -58,7 +58,7 @@ public abstract class GroundUnit extends BaseUnit{
|
||||
public void update(){
|
||||
Tile target = getClosest(BlockFlag.rally);
|
||||
|
||||
if(target != null && dst(target) > 100f){
|
||||
if(target != null && dst(target) > 80f){
|
||||
moveToCore(PathTarget.rallyPoints);
|
||||
}
|
||||
}
|
||||
@ -243,11 +243,18 @@ public abstract class GroundUnit extends BaseUnit{
|
||||
}
|
||||
}
|
||||
|
||||
if(enemy == null){
|
||||
for(Team team : Vars.state.teams.enemiesOf(team)){
|
||||
enemy = team;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(enemy == null) return;
|
||||
|
||||
Tile tile = world.tileWorld(x, y);
|
||||
if(tile == null) return;
|
||||
Tile targetTile = pathfinder.getTargetTile(tile, team, PathTarget.enemyCores);
|
||||
Tile targetTile = pathfinder.getTargetTile(tile, enemy, PathTarget.enemyCores);
|
||||
TileEntity core = getClosestCore();
|
||||
|
||||
if(tile == targetTile || core == null || dst(core) < 120f) return;
|
||||
|
@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=818e26ff093403031fcf31d3424dacb9c646d4b6
|
||||
archash=bac0b86ee98cd406cf6a227656ebf908f53119f9
|
||||
|
Loading…
Reference in New Issue
Block a user