Slightly better core upgrade effect

This commit is contained in:
Anuken
2022-02-06 23:06:34 -05:00
parent 1fb88c13b0
commit bf22b601f7
6 changed files with 28 additions and 8 deletions

View File

@@ -843,6 +843,7 @@ bar.output = Output
bar.strength = [stat]{0}[lightgray]x strength bar.strength = [stat]{0}[lightgray]x strength
units.processorcontrol = [lightgray]Processor Controlled units.processorcontrol = [lightgray]Processor Controlled
units.nocontroller = [lightgray]\ue815 No Controller
bullet.damage = [stat]{0}[lightgray] damage bullet.damage = [stat]{0}[lightgray] damage
bullet.splashdamage = [stat]{0}[lightgray] area dmg ~[stat] {1}[lightgray] tiles 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 bullet.range = [stat]{0}[lightgray] tiles range
unit.blocks = blocks unit.blocks = blocks
unit.blockssquared = blocks² unit.blockssquared = blocks²
unit.powersecond = power units/second unit.powersecond = power units/second
unit.tilessecond = tiles/second unit.tilessecond = tiles/second
unit.liquidsecond = liquid units/second unit.liquidsecond = liquid units/second

View File

@@ -190,9 +190,17 @@ public class Fx{
}), }),
upgradeCore = new Effect(120f, e -> { 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()); 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 -> { placeBlock = new Effect(16, e -> {

View File

@@ -125,7 +125,11 @@ public class Units{
* @return whether the target is invalid * @return whether the target is invalid
*/ */
public static boolean invalidateTarget(Posc target, Team team, float x, float y, float range){ 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)} */ /** See {@link #invalidateTarget(Posc, Team, float, float, float)} */
@@ -253,7 +257,7 @@ public class Units{
cdist = 0f; cdist = 0f;
nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> { 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); float dst2 = e.dst2(x, y) - (e.hitSize * e.hitSize);
if(dst2 < range*range && (result == null || dst2 < cdist)){ if(dst2 < range*range && (result == null || dst2 < cdist)){
@@ -274,7 +278,7 @@ public class Units{
cpriority = -99999f; cpriority = -99999f;
nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> { 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); float cost = sort.cost(e, x, y);
if((result == null || cost < cdist) && e.type.targetPriority >= cpriority){ if((result == null || cost < cdist) && e.type.targetPriority >= cpriority){

View File

@@ -85,6 +85,8 @@ public class UnitType extends UnlockableContent{
public float buildBeamOffset = 3.8f; public float buildBeamOffset = 3.8f;
/** WIP: Units of low priority will always be ignored in favor of those with higher priority, regardless of distance. */ /** WIP: Units of low priority will always be ignored in favor of those with higher priority, regardless of distance. */
public float targetPriority = 0f; public float targetPriority = 0f;
/** If false, this unit is not targeted by anything. */
public boolean targetable = true;
public boolean drawBuildBeam = true; public boolean drawBuildBeam = true;
public boolean rotateToBuilding = true; public boolean rotateToBuilding = true;
public int commandLimit = 8; public int commandLimit = 8;
@@ -290,6 +292,10 @@ public class UnitType extends UnlockableContent{
} }
}).growX(); }).growX();
if(coreUnitDock && !defaultAI){
table.row().add("@units.nocontroller").growX().left().row();
}
if(unit.controller() instanceof LogicAI){ if(unit.controller() instanceof LogicAI){
table.row(); table.row();
table.add(Blocks.microProcessor.emoji() + " " + Core.bundle.get("units.processorcontrol")).growX().wrap().left(); table.add(Blocks.microProcessor.emoji() + " " + Core.bundle.get("units.processorcontrol")).growX().wrap().left();

View File

@@ -134,7 +134,8 @@ public class CoreBlock extends StorageBlock{
if(previous instanceof CoreBlock){ if(previous instanceof CoreBlock){
tile.setBlock(this, tile.team()); tile.setBlock(this, tile.team());
Fx.placeBlock.at(tile, tile.block().size); 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 //set up the correct items
if(nextItems != null){ if(nextItems != null){