Fixed fusion reactor power transfer / Start of turret overhaul
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 416 B After Width: | Height: | Size: 461 B |
Binary file not shown.
|
Before Width: | Height: | Size: 632 B After Width: | Height: | Size: 678 B |
Binary file not shown.
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
@@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Sat Mar 31 22:48:10 EDT 2018
|
#Sun Apr 01 10:41:23 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=805
|
androidBuildCode=807
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.4
|
code=3.4
|
||||||
build=custom build
|
build=custom build
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class WeaponBlocks{
|
|||||||
bullet = BulletType.stone;
|
bullet = BulletType.stone;
|
||||||
ammo = Items.stone;
|
ammo = Items.stone;
|
||||||
health = 45;
|
health = 45;
|
||||||
|
shots = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ public class Turret extends Block{
|
|||||||
protected float reload = 10f;
|
protected float reload = 10f;
|
||||||
protected float inaccuracy = 0f;
|
protected float inaccuracy = 0f;
|
||||||
protected int shots = 1;
|
protected int shots = 1;
|
||||||
|
protected float shotTransation = 2;
|
||||||
protected float shotDelayScale = 0;
|
protected float shotDelayScale = 0;
|
||||||
protected String shootsound = "shoot";
|
protected String shootsound = "shoot";
|
||||||
protected BulletType bullet = BulletType.iron;
|
protected BulletType bullet = BulletType.iron;
|
||||||
@@ -42,7 +43,7 @@ public class Turret extends Block{
|
|||||||
protected int maxammo = 400;
|
protected int maxammo = 400;
|
||||||
protected float rotatespeed = 0.2f;
|
protected float rotatespeed = 0.2f;
|
||||||
protected float shootCone = 5f;
|
protected float shootCone = 5f;
|
||||||
protected Effect shootEffect = null;
|
protected Effect shootEffect = Fx.none;
|
||||||
protected float shootShake = 0f;
|
protected float shootShake = 0f;
|
||||||
protected int soundReload = 0;
|
protected int soundReload = 0;
|
||||||
protected Translator tr = new Translator();
|
protected Translator tr = new Translator();
|
||||||
@@ -168,11 +169,6 @@ public class Turret extends Block{
|
|||||||
entity.ammo --;
|
entity.ammo --;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity getEntity(){
|
|
||||||
return new TurretEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
void drawTargeting(Tile tile){
|
void drawTargeting(Tile tile){
|
||||||
TurretEntity entity = tile.entity();
|
TurretEntity entity = tile.entity();
|
||||||
|
|
||||||
@@ -201,9 +197,7 @@ public class Turret extends Block{
|
|||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|
||||||
if(Timers.getTime(tile, "reload") <= 0){
|
if(Timers.getTime(tile, "reload") <= 0){
|
||||||
Timers.run(hittime, ()->{
|
Timers.run(hittime, () -> Effects.effect(Fx.spawn, predictX, predictY));
|
||||||
Effects.effect(Fx.spawn, predictX, predictY);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +208,7 @@ public class Turret extends Block{
|
|||||||
|
|
||||||
for(int i = 0; i < shots; i ++){
|
for(int i = 0; i < shots; i ++){
|
||||||
if(Mathf.zero(shotDelayScale)){
|
if(Mathf.zero(shotDelayScale)){
|
||||||
|
|
||||||
bullet(tile, entity.rotation + Mathf.range(inaccuracy));
|
bullet(tile, entity.rotation + Mathf.range(inaccuracy));
|
||||||
}else{
|
}else{
|
||||||
Timers.run(i * shotDelayScale, () -> {
|
Timers.run(i * shotDelayScale, () -> {
|
||||||
@@ -224,10 +219,8 @@ public class Turret extends Block{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(shootEffect != null){
|
Effects.effect(shootEffect, tile.drawx() + tr.x,
|
||||||
Effects.effect(shootEffect, tile.drawx() + tr.x,
|
tile.drawy() + tr.y, entity.rotation);
|
||||||
tile.drawy() + tr.y, entity.rotation);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(shootShake > 0){
|
if(shootShake > 0){
|
||||||
Effects.shake(shootShake, shootShake, tile.entity);
|
Effects.shake(shootShake, shootShake, tile.entity);
|
||||||
@@ -238,6 +231,11 @@ public class Turret extends Block{
|
|||||||
new Bullet(bullet, tile.entity, tile.getTeam(), tile.drawx() + tr.x, tile.drawy() + tr.y, angle).add();
|
new Bullet(bullet, tile.entity, tile.getTeam(), tile.drawx() + tr.x, tile.drawy() + tr.y, angle).add();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity getEntity(){
|
||||||
|
return new TurretEntity();
|
||||||
|
}
|
||||||
|
|
||||||
public static class TurretEntity extends TileEntity{
|
public static class TurretEntity extends TileEntity{
|
||||||
public TileEntity blockTarget;
|
public TileEntity blockTarget;
|
||||||
public int ammo;
|
public int ammo;
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ public class FusionReactor extends PowerGenerator {
|
|||||||
float powerAdded = Math.min(powerCapacity - entity.power.amount, maxPowerProduced * Mathf.pow(entity.warmup, 3f) * Timers.delta());
|
float powerAdded = Math.min(powerCapacity - entity.power.amount, maxPowerProduced * Mathf.pow(entity.warmup, 3f) * Timers.delta());
|
||||||
entity.power.amount += powerAdded;
|
entity.power.amount += powerAdded;
|
||||||
entity.totalProgress += entity.warmup * Timers.delta();
|
entity.totalProgress += entity.warmup * Timers.delta();
|
||||||
|
|
||||||
|
distributePower(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user