mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-20 17:28:14 +07:00
Slightly better core upgrade effect
This commit is contained in:
parent
1fb88c13b0
commit
bf22b601f7
@ -843,6 +843,7 @@ bar.output = Output
|
||||
bar.strength = [stat]{0}[lightgray]x strength
|
||||
|
||||
units.processorcontrol = [lightgray]Processor Controlled
|
||||
units.nocontroller = [lightgray]\ue815 No Controller
|
||||
|
||||
bullet.damage = [stat]{0}[lightgray] damage
|
||||
bullet.splashdamage = [stat]{0}[lightgray] area dmg ~[stat] {1}[lightgray] tiles
|
||||
@ -862,7 +863,7 @@ bullet.reload = [stat]{0}[lightgray]x fire rate
|
||||
bullet.range = [stat]{0}[lightgray] tiles range
|
||||
|
||||
unit.blocks = blocks
|
||||
unit.blockssquared = blocks²
|
||||
unit.blockssquared = blocks²
|
||||
unit.powersecond = power units/second
|
||||
unit.tilessecond = tiles/second
|
||||
unit.liquidsecond = liquid units/second
|
||||
|
@ -190,9 +190,17 @@ public class Fx{
|
||||
}),
|
||||
|
||||
upgradeCore = new Effect(120f, e -> {
|
||||
color(Color.white, Pal.accent, e.fin());
|
||||
if(!(e.data instanceof Block block)) return;
|
||||
|
||||
mixcol(Tmp.c1.set(Color.white).lerp(Pal.accent, e.fin()), 1f);
|
||||
alpha(e.fout());
|
||||
Fill.square(e.x, e.y, tilesize / 2f * e.rotation);
|
||||
rect(block.fullIcon, e.x, e.y);
|
||||
}).layer(Layer.turret - 5f),
|
||||
|
||||
upgradeCoreBloom = new Effect(80f, e -> {
|
||||
color(Pal.accent);
|
||||
stroke(4f * e.fout());
|
||||
Lines.square(e.x, e.y, tilesize / 2f * e.rotation + 2f);
|
||||
}),
|
||||
|
||||
placeBlock = new Effect(16, e -> {
|
||||
|
@ -2816,7 +2816,7 @@ public class UnitTypes{
|
||||
rotateSpeed = 0.4f;
|
||||
rotate = true;
|
||||
|
||||
x = 43/4f;
|
||||
x = 43 / 4f;
|
||||
y = -20f / 4f;
|
||||
shootY = 39 / 4f;
|
||||
shootX = -5f / 4f;
|
||||
|
@ -125,7 +125,11 @@ public class Units{
|
||||
* @return whether the target is invalid
|
||||
*/
|
||||
public static boolean invalidateTarget(Posc target, Team team, float x, float y, float range){
|
||||
return target == null || (range != Float.MAX_VALUE && !target.within(x, y, range + (target instanceof Sized hb ? hb.hitSize()/2f : 0f))) || (target instanceof Teamc t && t.team() == team) || (target instanceof Healthc h && !h.isValid());
|
||||
return target == null ||
|
||||
(range != Float.MAX_VALUE && !target.within(x, y, range + (target instanceof Sized hb ? hb.hitSize()/2f : 0f))) ||
|
||||
(target instanceof Teamc t && t.team() == team) ||
|
||||
(target instanceof Healthc h && !h.isValid()) ||
|
||||
(target instanceof Unit u && !u.type.targetable);
|
||||
}
|
||||
|
||||
/** See {@link #invalidateTarget(Posc, Team, float, float, float)} */
|
||||
@ -253,7 +257,7 @@ public class Units{
|
||||
cdist = 0f;
|
||||
|
||||
nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> {
|
||||
if(e.dead() || !predicate.get(e) || e.team == Team.derelict) return;
|
||||
if(e.dead() || !predicate.get(e) || e.team == Team.derelict || !e.type.targetable) return;
|
||||
|
||||
float dst2 = e.dst2(x, y) - (e.hitSize * e.hitSize);
|
||||
if(dst2 < range*range && (result == null || dst2 < cdist)){
|
||||
@ -274,7 +278,7 @@ public class Units{
|
||||
cpriority = -99999f;
|
||||
|
||||
nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> {
|
||||
if(e.dead() || !predicate.get(e) || e.team == Team.derelict || !e.within(x, y, range + e.hitSize/2f)) return;
|
||||
if(e.dead() || !predicate.get(e) || e.team == Team.derelict || !e.within(x, y, range + e.hitSize/2f) || !e.type.targetable) return;
|
||||
|
||||
float cost = sort.cost(e, x, y);
|
||||
if((result == null || cost < cdist) && e.type.targetPriority >= cpriority){
|
||||
|
@ -85,6 +85,8 @@ public class UnitType extends UnlockableContent{
|
||||
public float buildBeamOffset = 3.8f;
|
||||
/** WIP: Units of low priority will always be ignored in favor of those with higher priority, regardless of distance. */
|
||||
public float targetPriority = 0f;
|
||||
/** If false, this unit is not targeted by anything. */
|
||||
public boolean targetable = true;
|
||||
public boolean drawBuildBeam = true;
|
||||
public boolean rotateToBuilding = true;
|
||||
public int commandLimit = 8;
|
||||
@ -290,6 +292,10 @@ public class UnitType extends UnlockableContent{
|
||||
}
|
||||
}).growX();
|
||||
|
||||
if(coreUnitDock && !defaultAI){
|
||||
table.row().add("@units.nocontroller").growX().left().row();
|
||||
}
|
||||
|
||||
if(unit.controller() instanceof LogicAI){
|
||||
table.row();
|
||||
table.add(Blocks.microProcessor.emoji() + " " + Core.bundle.get("units.processorcontrol")).growX().wrap().left();
|
||||
|
@ -134,7 +134,8 @@ public class CoreBlock extends StorageBlock{
|
||||
if(previous instanceof CoreBlock){
|
||||
tile.setBlock(this, tile.team());
|
||||
Fx.placeBlock.at(tile, tile.block().size);
|
||||
Fx.upgradeCore.at(tile, tile.block().size);
|
||||
Fx.upgradeCore.at(tile.drawx(), tile.drawy(), 0f, tile.block());
|
||||
Fx.upgradeCoreBloom.at(tile, tile.block().size);
|
||||
|
||||
//set up the correct items
|
||||
if(nextItems != null){
|
||||
|
Loading…
Reference in New Issue
Block a user