Fixed some minor bugs

This commit is contained in:
Anuken
2017-10-02 17:14:32 -04:00
parent 77f574e974
commit 3e9aca023a
10 changed files with 18 additions and 14 deletions

View File

@@ -3,6 +3,7 @@ package io.anuke.mindustry.entities;
import static io.anuke.mindustry.Vars.*;
import com.badlogic.gdx.Input.Buttons;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
@@ -51,7 +52,7 @@ public class Player extends DestructibleEntity{
float speed = this.speed;
if(Vars.debug)
if(Vars.debug && Inputs.keyDown(Keys.SHIFT_LEFT))
speed *= 3f;
if(health < maxhealth && Timers.get(this, 50))

View File

@@ -108,10 +108,9 @@ public class Enemy extends DestructibleEntity{
int x2 = path[node].x, y2 = path[node].y;
if(World.raycast(Mathf.scl2(x, Vars.tilesize), Mathf.scl2(y, Vars.tilesize), x2, y2) != null){
Timers.run(Mathf.random(10f), ()->{
Timers.run(Mathf.random(15f), ()->{
set(x2 * Vars.tilesize, y2 * Vars.tilesize);
});
}
}
@@ -173,7 +172,7 @@ public class Enemy extends DestructibleEntity{
String region = ClassReflection.getSimpleName(getClass()).toLowerCase() + "-t" + Mathf.clamp(tier, 1, 3);
//TODO is this necessary?
//TODO is this really necessary?
Draw.getShader(Outline.class).color.set(tierColors[tier-1]);
Draw.getShader(Outline.class).region = Draw.region(region);

View File

@@ -205,6 +205,8 @@ public class World{
Tile tile = tile(x, y);
if(tile == null) return false;
if(tile.block() != type && type.canReplace(tile.block())){
return true;
}

View File

@@ -68,6 +68,7 @@ public class ProductionBlocks{
dir = (dir+4)%4;
Tile to = tile.getNearby()[dir];
Timers.run(10, ()->{
if(to == null || to.entity == null) return;
to.block().handleItem(to, item, tile);
});
@@ -146,7 +147,7 @@ public class ProductionBlocks{
@Override
public String description(){
return "Takes in iron + water, outputs coal.";
return "Takes in iron + water, outputs titanium.";
}
},

View File

@@ -105,7 +105,6 @@ public class WeaponBlocks{
}
},
//TODO
mortarturret = new Turret("mortarturret"){
{
rotatespeed = 0.1f;
@@ -116,10 +115,10 @@ public class WeaponBlocks{
ammo = Item.coal;
ammoMultiplier = 5;
health = 110;
overPrediction = 0.09f;
}
},
//TODO
laserturret = new LaserTurret("laserturret"){
@@ -135,7 +134,6 @@ public class WeaponBlocks{
}
},
//TODO
teslaturret = new Turret("waveturret"){
{
formalName = "tesla turret";
@@ -156,7 +154,6 @@ public class WeaponBlocks{
}
},
//TODO
plasmaturret = new Turret("plasmaturret"){
{
inaccuracy = 7f;

View File

@@ -34,6 +34,7 @@ public class Turret extends Block{
protected int maxammo = 400;
protected float rotatespeed = 0.2f;
protected float shootCone = 8f;
protected float overPrediction = 0f;
public Turret(String name) {
super(name);
@@ -108,7 +109,7 @@ public class Turret extends Block{
if(entity.target != null){
float targetRot = Angles.predictAngle(tile.worldx(), tile.worldy(),
entity.target.x, entity.target.y, entity.target.xvelocity, entity.target.yvelocity, bullet.speed);
entity.target.x, entity.target.y, entity.target.xvelocity, entity.target.yvelocity, bullet.speed + overPrediction);
entity.rotation = MathUtils.lerpAngleDeg(entity.rotation, targetRot,
rotatespeed*Timers.delta());