Re-added Tau

This commit is contained in:
Anuken
2020-05-23 21:53:11 -04:00
parent df08498d70
commit 65f63fd4d2
19 changed files with 762 additions and 651 deletions

View File

@@ -1672,8 +1672,9 @@ public class Blocks implements ContentList{
groundFactory = new UnitFactory("ground-factory"){{
requirements(Category.units, ItemStack.with(Items.copper, 30, Items.lead, 70));
plans = new UnitPlan[]{
new UnitPlan(UnitTypes.dagger, 200f, ItemStack.with(Items.silicon, 10)),
new UnitPlan(UnitTypes.titan, 800f, ItemStack.with(Items.silicon, 20, Items.titanium, 10)),
new UnitPlan(UnitTypes.dagger, 200f, ItemStack.with(Items.silicon, 10, Items.lead, 10)),
new UnitPlan(UnitTypes.crawler, 200f, ItemStack.with(Items.silicon, 10, Items.blastCompound, 5)),
new UnitPlan(UnitTypes.tau, 200f, ItemStack.with(Items.silicon, 20, Items.lead, 10)),
};
size = 3;
consumes.power(1.2f);
@@ -1683,7 +1684,9 @@ public class Blocks implements ContentList{
requirements(Category.units, ItemStack.with(Items.copper, 30, Items.lead, 70));
plans = new UnitPlan[]{
new UnitPlan(UnitTypes.wraith, 200f, ItemStack.with(Items.silicon, 10)),
//new UnitPlan(UnitTypes.ghoul, 200f, ItemStack.with(Items.silicon, 10)),
new UnitPlan(UnitTypes.spirit, 200f, ItemStack.with(Items.silicon, 10)),
new UnitPlan(UnitTypes.draug, 200f, ItemStack.with(Items.silicon, 10)),
new UnitPlan(UnitTypes.phantom, 200f, ItemStack.with(Items.silicon, 10)),
};
size = 3;
consumes.power(1.2f);
@@ -1706,7 +1709,8 @@ public class Blocks implements ContentList{
consumes.power(3f);
consumes.items(ItemStack.with(Items.silicon, 30, Items.graphite, 30));
itemCapacity = 30;
constructTime = 200f;
constructTime = 60f * 5f;
}};
repairPoint = new RepairPoint("repair-point"){{

View File

@@ -15,7 +15,7 @@ public class UnitTypes implements ContentList{
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 oculon;
public static @EntityDef({Unitc.class, Legsc.class, Builderc.class}) UnitType oculon, tau;
//air
public static @EntityDef({Unitc.class}) UnitType wraith, reaper, ghoul, revenant, lich;
@@ -96,9 +96,59 @@ public class UnitTypes implements ContentList{
}});
}};
tau = new UnitType("tau"){{
itemCapacity = 60;
canBoost = true;
boostMultiplier = 1.5f;
speed = 0.5f;
hitsize = 8f;
health = 100f;
buildSpeed = 0.8f;
weapons.add(new Weapon("heal-weapon"){{
shootY = 1.5f;
reload = 24f;
x = 1f;
shootX = 3.5f;
alternate = false;
ejectEffect = Fx.none;
recoil = 2f;
bullet = Bullets.healBullet;
shootSound = Sounds.pew;
}});
}
/*
float healRange = 60f;
float healAmount = 10f;
float healReload = 160f;
boolean wasHealed;
@Override
public void update(Unitc player){
if(player.timer().get(Playerc.timerAbility, healReload)){
wasHealed = false;
Units.nearby(player.team(), player.x, player.y, healRange, unit -> {
if(unit.health < unit.maxHealth()){
Fx.heal.at(unit);
wasHealed = true;
}
unit.heal(healAmount);
});
if(wasHealed){
Fx.healWave.at(player);
}
}
}*/
};
fortress = new UnitType("fortress"){{
titan.upgrade = this;
tier = 2;
tier = 3;
speed = 0.38f;
mass = 5f;

View File

@@ -162,7 +162,7 @@ public abstract class BulletType extends Content{
public void update(Bulletc b){
if(homingPower > 0.0001f){
Teamc target = Units.closestTarget(b.team(), b.getX(), b.getY(), homingRange, e -> (e.isGrounded() && collidesGround) || (e.isFlying() && collidesAir));
Teamc target = Units.closestTarget(b.team(), b.getX(), b.getY(), homingRange, e -> (e.isGrounded() && collidesGround) || (e.isFlying() && collidesAir), t -> collidesGround);
if(target != null){
b.vel().setAngle(Mathf.slerpDelta(b.rotation(), b.angleTo(target), homingPower));
}
@@ -178,8 +178,6 @@ public abstract class BulletType extends Content{
return ContentType.bullet;
}
//TODO change 'create' to 'at'
public Bulletc create(Teamc owner, float x, float y, float angle){
return create(owner, owner.team(), x, y, angle);
}

View File

@@ -11,6 +11,7 @@ import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.ui.*;
import mindustry.world.blocks.payloads.*;
import mindustry.world.meta.*;
import static mindustry.Vars.state;
@@ -38,6 +39,13 @@ public class Reconstructor extends UnitBlock{
bars.add("progress", entity -> new Bar("bar.progress", Pal.ammo, ((ReconstructorEntity)entity)::fraction));
}
@Override
public void setStats(){
super.setStats();
stats.add(BlockStat.productionTime, constructTime / 60f, StatUnit.seconds);
}
public class ReconstructorEntity extends UnitBlockEntity{
public float fraction(){