Added alternate health bar on all units
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 390 B After Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 298 B After Width: | Height: | Size: 302 B |
Before Width: | Height: | Size: 423 B After Width: | Height: | Size: 423 B |
BIN
core/assets-raw/sprites/units/power-cell.png
Normal file
After Width: | Height: | Size: 388 B |
Before Width: | Height: | Size: 323 B After Width: | Height: | Size: 327 B |
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 140 KiB |
@ -325,8 +325,8 @@ public class Renderer extends RendererModule{
|
||||
|
||||
Graphics.beginShaders(Shaders.outline);
|
||||
Graphics.shader(Shaders.mix, true);
|
||||
drawAndInterpolate(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead());
|
||||
drawAndInterpolate(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team);
|
||||
drawAndInterpolate(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawAll);
|
||||
drawAndInterpolate(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team, Unit::drawAll);
|
||||
Graphics.shader();
|
||||
blocks.drawTeamBlocks(Layer.turret, team);
|
||||
Graphics.endShaders();
|
||||
|
@ -263,6 +263,23 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
Draw.rect(mech.iconRegion, x , y, rotation - 90);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAll(){
|
||||
boolean snap = snapCamera && isLocal;
|
||||
|
||||
float px = x, py = y;
|
||||
|
||||
if(snap){
|
||||
x = (int) (x + 0.0001f);
|
||||
y = (int) (y + 0.0001f);
|
||||
}
|
||||
|
||||
super.drawAll();
|
||||
|
||||
x = px;
|
||||
y = py;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
if((debug && (!showPlayer || !showUI)) || dead) return;
|
||||
@ -274,15 +291,6 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
|
||||
boostHeat = Mathf.lerpDelta(boostHeat, isBoosting && ((!movement.isZero() && moved) || !isLocal) ? 1f : 0f, 0.08f);
|
||||
|
||||
boolean snap = snapCamera && isLocal;
|
||||
|
||||
float px = x, py = y;
|
||||
|
||||
if(snap){
|
||||
x = (int) (x + 0.0001f);
|
||||
y = (int) (y + 0.0001f);
|
||||
}
|
||||
|
||||
float ft = Mathf.sin(walktime, 6f, 2f) * (1f - boostHeat);
|
||||
|
||||
Floor floor = getFloorOn();
|
||||
@ -341,9 +349,6 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
}
|
||||
|
||||
Draw.alpha(1f);
|
||||
|
||||
x = px;
|
||||
y = py;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.anuke.mindustry.entities;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
@ -306,6 +307,24 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
||||
public void drawOver(){
|
||||
}
|
||||
|
||||
public void drawStats(){
|
||||
Draw.color(Color.BLACK, team.color, healthf() + Mathf.absin(Timers.time(), healthf()*5f, 1f - healthf()));
|
||||
Draw.alpha(hitTime);
|
||||
Draw.rect(getPowerCellRegion(), x, y, rotation - 90);
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
public TextureRegion getPowerCellRegion(){
|
||||
return Draw.region("power-cell");
|
||||
}
|
||||
|
||||
public void drawAll(){
|
||||
if(!isDead()){
|
||||
draw();
|
||||
drawStats();
|
||||
}
|
||||
}
|
||||
|
||||
public void drawShadow(){
|
||||
Draw.rect(getIconRegion(), x , y, rotation - 90);
|
||||
}
|
||||
@ -314,10 +333,6 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
||||
Fill.circle(x, y, getViewDistance());
|
||||
}
|
||||
|
||||
public boolean isInfiniteAmmo(){
|
||||
return false;
|
||||
}
|
||||
|
||||
public float getViewDistance(){
|
||||
return 135f;
|
||||
}
|
||||
|
@ -252,11 +252,6 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
||||
return type.itemCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInfiniteAmmo(){
|
||||
return isWave;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void interpolate(){
|
||||
super.interpolate();
|
||||
|
@ -3,7 +3,6 @@ package io.anuke.mindustry.game;
|
||||
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||
import io.anuke.mindustry.entities.units.GroundUnit;
|
||||
import io.anuke.mindustry.entities.units.UnitType;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
import io.anuke.mindustry.type.StatusEffect;
|
||||
import io.anuke.mindustry.type.Weapon;
|
||||
@ -62,10 +61,6 @@ public class SpawnGroup{
|
||||
* Items this unit spawns with. Null to disable.
|
||||
*/
|
||||
protected ItemStack items;
|
||||
/**
|
||||
* Ammo type this unit spawns with. Null to use the first available ammo.
|
||||
*/
|
||||
protected Item ammoItem;
|
||||
|
||||
public SpawnGroup(UnitType type){
|
||||
this.type = type;
|
||||
|
@ -41,7 +41,6 @@ public class Waves{
|
||||
unitScaling = 2;
|
||||
unitAmount = 1;
|
||||
spacing = 2;
|
||||
ammoItem = Items.tungsten;
|
||||
end = 30;
|
||||
}},
|
||||
|
||||
@ -86,7 +85,6 @@ public class Waves{
|
||||
groupAmount = 2;
|
||||
unitScaling = 3;
|
||||
effect = StatusEffects.overdrive;
|
||||
ammoItem = Items.silicon;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.dagger){{
|
||||
@ -95,7 +93,6 @@ public class Waves{
|
||||
unitAmount = 1;
|
||||
unitScaling = 3;
|
||||
effect = StatusEffects.shielded;
|
||||
ammoItem = Items.thorium;
|
||||
max = 10;
|
||||
}},
|
||||
|
||||
@ -121,7 +118,6 @@ public class Waves{
|
||||
|
||||
new SpawnGroup(UnitTypes.monsoon){{
|
||||
begin = 40;
|
||||
ammoItem = Items.blastCompound;
|
||||
unitAmount = 2;
|
||||
spacing = 2;
|
||||
unitScaling = 3;
|
||||
@ -140,7 +136,6 @@ public class Waves{
|
||||
|
||||
new SpawnGroup(UnitTypes.monsoon){{
|
||||
begin = 53;
|
||||
ammoItem = Items.pyratite;
|
||||
unitAmount = 2;
|
||||
unitScaling = 3;
|
||||
spacing = 4;
|
||||
@ -150,7 +145,6 @@ public class Waves{
|
||||
|
||||
new SpawnGroup(UnitTypes.monsoon){{
|
||||
begin = 53;
|
||||
ammoItem = Items.coal;
|
||||
unitAmount = 2;
|
||||
unitScaling = 3;
|
||||
spacing = 4;
|
||||
@ -176,10 +170,6 @@ public class Waves{
|
||||
System.out.print(":" + spawn.weapon.name);
|
||||
}
|
||||
|
||||
if(spawn.ammoItem != null){
|
||||
System.out.print(":" + spawn.ammoItem.name);
|
||||
}
|
||||
|
||||
System.out.print(" ");
|
||||
}
|
||||
}
|
||||
|
@ -7,14 +7,11 @@ import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.Unit;
|
||||
import io.anuke.mindustry.game.TeamInfo.TeamData;
|
||||
import io.anuke.mindustry.input.InputHandler;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.meta.BlockBar;
|
||||
import io.anuke.ucore.core.Graphics;
|
||||
import io.anuke.ucore.core.Settings;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Fill;
|
||||
@ -157,31 +154,7 @@ public class OverlayRenderer{
|
||||
Draw.color();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if((!debug || showUI) && Settings.getBool("healthbars")){
|
||||
for(TeamData ally : (debug ? state.teams.getTeams() : state.teams.getTeams(true))){
|
||||
renderer.drawAndInterpolate(unitGroups[ally.team.ordinal()], u -> !u.isDead(), this::drawStats);
|
||||
}
|
||||
|
||||
renderer.drawAndInterpolate(playerGroup, u -> !u.isDead(), this::drawStats);
|
||||
}
|
||||
}
|
||||
|
||||
void drawStats(Unit unit){
|
||||
if(unit.isDead()) return;
|
||||
|
||||
float x = unit.x;
|
||||
float y = unit.y;
|
||||
|
||||
if(unit == players[0] && players.length == 1 && snapCamera){
|
||||
x = (int) (x + 0.0001f);
|
||||
y = (int) (y + 0.0001f);
|
||||
}
|
||||
|
||||
//drawEncloser(x, y - 8f, 1f);
|
||||
//drawBar(Palette.healthstats, x, y - 8f, unit.healthf());
|
||||
}
|
||||
|
||||
void drawBar(Color color, float x, float y, float finion){
|
||||
|
@ -3,70 +3,72 @@ package io.anuke.mindustry.graphics;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
|
||||
public class Palette{
|
||||
public static final Color command = Color.valueOf("eab678");
|
||||
public static final Color
|
||||
|
||||
public static final Color bulletYellow = Color.valueOf("ffeec9");
|
||||
public static final Color bulletYellowBack = Color.valueOf("f9c87a");
|
||||
command = Color.valueOf("eab678"),
|
||||
|
||||
public static final Color missileYellow = Color.valueOf("ffd2ae");
|
||||
public static final Color missileYellowBack = Color.valueOf("e58956");
|
||||
bulletYellow = Color.valueOf("ffeec9"),
|
||||
bulletYellowBack = Color.valueOf("f9c87a"),
|
||||
|
||||
public static final Color plastaniumBack = Color.valueOf("d8d97f");
|
||||
public static final Color plastaniumFront = Color.valueOf("fffac6");
|
||||
missileYellow = Color.valueOf("ffd2ae"),
|
||||
missileYellowBack = Color.valueOf("e58956"),
|
||||
|
||||
public static final Color lightFlame = Color.valueOf("ffdd55");
|
||||
public static final Color darkFlame = Color.valueOf("db401c");
|
||||
plastaniumBack = Color.valueOf("d8d97f"),
|
||||
plastaniumFront = Color.valueOf("fffac6"),
|
||||
|
||||
public static final Color turretHeat = Color.valueOf("ab3400");
|
||||
lightFlame = Color.valueOf("ffdd55"),
|
||||
darkFlame = Color.valueOf("db401c"),
|
||||
|
||||
public static final Color lightOrange = Color.valueOf("f68021");
|
||||
public static final Color lightishOrange = Color.valueOf("f8ad42");
|
||||
public static final Color lighterOrange = Color.valueOf("f6e096");
|
||||
turretHeat = Color.valueOf("ab3400"),
|
||||
|
||||
public static final Color lightishGray = Color.valueOf("a2a2a2");
|
||||
public static final Color darkishGray = new Color(0.3f, 0.3f, 0.3f, 1f);
|
||||
lightOrange = Color.valueOf("f68021"),
|
||||
lightishOrange = Color.valueOf("f8ad42"),
|
||||
lighterOrange = Color.valueOf("f6e096"),
|
||||
|
||||
public static final Color lancerLaser = Color.valueOf("a9d8ff");
|
||||
lightishGray = Color.valueOf("a2a2a2"),
|
||||
darkishGray = new Color(0.3f, 0.3f, 0.3f, 1f),
|
||||
|
||||
public static final Color stoneGray = Color.valueOf("8f8f8f");
|
||||
lancerLaser = Color.valueOf("a9d8ff"),
|
||||
|
||||
public static final Color portalLight = Color.valueOf("9054ea");
|
||||
public static final Color portal = Color.valueOf("6344d7");
|
||||
public static final Color portalDark = Color.valueOf("3f3dac");
|
||||
stoneGray = Color.valueOf("8f8f8f"),
|
||||
|
||||
public static final Color powerLaserFrom = Color.valueOf("e3e3e3");
|
||||
public static final Color powerLaserTo = Color.valueOf("ffe7a8");
|
||||
portalLight = Color.valueOf("9054ea"),
|
||||
portal = Color.valueOf("6344d7"),
|
||||
portalDark = Color.valueOf("3f3dac"),
|
||||
|
||||
public static final Color description = Color.WHITE;
|
||||
public static final Color turretinfo = Color.ORANGE;
|
||||
public static final Color iteminfo = Color.LIGHT_GRAY;
|
||||
public static final Color powerinfo = Color.YELLOW;
|
||||
public static final Color liquidinfo = Color.ROYAL;
|
||||
public static final Color craftinfo = Color.LIGHT_GRAY;
|
||||
powerLaserFrom = Color.valueOf("e3e3e3"),
|
||||
powerLaserTo = Color.valueOf("ffe7a8"),
|
||||
|
||||
public static final Color missingitems = Color.SCARLET;
|
||||
public static final Color health = Color.YELLOW;
|
||||
public static final Color ammo = Color.valueOf("32cf6d");
|
||||
public static final Color healthstats = Color.SCARLET;
|
||||
public static final Color bar = Color.SLATE;
|
||||
public static final Color interact = Color.ORANGE;
|
||||
public static final Color accent = Color.valueOf("f4ba6e");
|
||||
public static final Color place = Color.valueOf("6335f8");
|
||||
public static final Color remove = Color.valueOf("e55454");
|
||||
public static final Color placeRotate = accent;
|
||||
public static final Color breakInvalid = Color.valueOf("d44b3d");
|
||||
public static final Color range = Color.valueOf("f4ba6e");
|
||||
public static final Color power = Color.valueOf("fbd367");
|
||||
public static final Color placing = Color.valueOf("616161");
|
||||
description = Color.WHITE,
|
||||
turretinfo = Color.ORANGE,
|
||||
iteminfo = Color.LIGHT_GRAY,
|
||||
powerinfo = Color.YELLOW,
|
||||
liquidinfo = Color.ROYAL,
|
||||
craftinfo = Color.LIGHT_GRAY,
|
||||
|
||||
public static final Color lightTrail = Color.valueOf("ffe2a9");
|
||||
missingitems = Color.SCARLET,
|
||||
health = Color.YELLOW,
|
||||
ammo = Color.valueOf("32cf6d"),
|
||||
healthstats = Color.SCARLET,
|
||||
bar = Color.SLATE,
|
||||
interact = Color.ORANGE,
|
||||
accent = Color.valueOf("f4ba6e"),
|
||||
place = Color.valueOf("6335f8"),
|
||||
remove = Color.valueOf("e55454"),
|
||||
placeRotate = accent,
|
||||
breakInvalid = Color.valueOf("d44b3d"),
|
||||
range = Color.valueOf("f4ba6e"),
|
||||
power = Color.valueOf("fbd367"),
|
||||
placing = Color.valueOf("616161"),
|
||||
|
||||
public static final Color redSpark = Color.valueOf("fbb97f");
|
||||
public static final Color orangeSpark = Color.valueOf("d2b29c");
|
||||
lightTrail = Color.valueOf("ffe2a9"),
|
||||
|
||||
public static final Color redDust = Color.valueOf("ffa480");
|
||||
public static final Color redderDust = Color.valueOf("ff7b69");
|
||||
redSpark = Color.valueOf("fbb97f"),
|
||||
orangeSpark = Color.valueOf("d2b29c"),
|
||||
|
||||
public static final Color plasticSmoke = Color.valueOf("f1e479");
|
||||
public static final Color plasticBurn = Color.valueOf("e9ead3");
|
||||
redDust = Color.valueOf("ffa480"),
|
||||
redderDust = Color.valueOf("ff7b69"),
|
||||
|
||||
plasticSmoke = Color.valueOf("f1e479"),
|
||||
plasticBurn = Color.valueOf("e9ead3");
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ public class OreBlock extends Floor{
|
||||
|
||||
public OreBlock(Item ore, Floor base){
|
||||
super("ore-" + ore.name + "-" + base.name);
|
||||
this.formalName = ore.name + " " + base.formalName;
|
||||
this.formalName = ore.localizedName() + " " + base.formalName;
|
||||
this.drops = new ItemStack(ore, 1);
|
||||
this.base = base;
|
||||
this.variants = 3;
|
||||
|