Added additional info to block descriptions

This commit is contained in:
Anuken
2017-08-14 15:32:20 -04:00
parent 04e4377ee4
commit 3fa3456c2b
6 changed files with 35 additions and 8 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.anuke.mindustry"
android:versionCode="5"
android:versionName="1.1.1" >
android:versionCode="6"
android:versionName="1.1.2" >
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />

View File

@ -6,20 +6,26 @@ import com.badlogic.gdx.Gdx;
import io.anuke.mindustry.entities.Player;
import io.anuke.ucore.scene.ui.layout.Unit;
/**ick, global state*/
public class Vars{
//shorthand for whether or not this is running on android
public static final boolean android = (Gdx.app.getType() == ApplicationType.Android);
//how far away from the player blocks can be placed
public static final float placerange = 66;
//respawn time in frames
public static final float respawnduration = 60*4;
//time between waves in frames
public static final float wavespace = 20*60*(android ? 2 : 1);
//how far away from spawn points the player can't place blocks
public static final float enemyspawnspace = 65;
//scale of the font
public static final float fontscale = Unit.dp.inPixels(1f)/2f;
//camera zoom displayed on startup
public static final int baseCameraScale = Math.round(Unit.dp.inPixels(4));
//how much the zoom changes every zoom button press
public static final int zoomScale = Math.round(Unit.dp.inPixels(1));
//if true, player speed will be increased, massive amounts of resources will be given on start, and other debug options will be available
public static boolean debug = false;
//number of save slots-- increasing may lead to layout issues
public static final int saveSlots = 4;
//turret and enemy shoot speed inverse multiplier

View File

@ -72,6 +72,26 @@ public class Enemy extends DestructibleEntity{
out.damage = bullet.damage*Vars.multiplier;
}
public void findClosestNode(){
Pathfind.find(this);
int index = 0;
int cindex = -1;
float dst = Float.MAX_VALUE;
for(Tile tile : path){
if(Vector2.dst(tile.worldx(), tile.worldy(), x, y) < dst){
dst = Vector2.dst(tile.worldx(), tile.worldy(), x, y);
cindex = index;
}
index ++;
}
node = cindex;
}
@Override
public boolean collides(SolidEntity other){
return (other instanceof Bullet) && !(((Bullet)other).owner instanceof Enemy);

View File

@ -302,6 +302,7 @@ public class SaveIO{
try{
Enemy enemy = (Enemy)ClassReflection.getConstructor(idEnemies.get(type), int.class).newInstance(lane);
enemy.findClosestNode();
enemy.health = health;
enemy.x = x;
enemy.y = y;

View File

@ -56,6 +56,6 @@ public class RepairTurret extends Turret{
@Override
public String description(){
return "Heals nearby tiles.";
return "[green]Range: " + (int)range + "\n[orange]Heals nearby tiles.";
}
}

View File

@ -74,7 +74,7 @@ public class Turret extends Block{
@Override
public String description(){
return "[green]Ammo: "+(ammo==null ? "N/A" : ammo.name())+"\n[]Shoots things.";
return "[green]Ammo: "+(ammo==null ? "N/A" : ammo.name())+"\nRange: " + (int)range + "\nDamage: " + bullet.damage;
}
@Override