Fixed some minor bugs
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user