F O R C E P R O J E C T O R S

This commit is contained in:
Leonwang4234
2020-08-21 10:11:48 -07:00
parent 5df2a3e625
commit a97df4247b
5 changed files with 28 additions and 5 deletions

View File

@@ -596,6 +596,8 @@ blocks.inaccuracy = Inaccuracy
blocks.shots = Shots blocks.shots = Shots
blocks.reload = Shots/Second blocks.reload = Shots/Second
blocks.ammo = Ammo blocks.ammo = Ammo
blocks.shieldhealth = Shield Health
blocks.cooldowntime = Cooldown Time
bar.drilltierreq = Better Drill Required bar.drilltierreq = Better Drill Required
bar.noresources = Missing Resources bar.noresources = Missing Resources
@@ -641,6 +643,7 @@ unit.seconds = seconds
unit.persecond = /sec unit.persecond = /sec
unit.timesspeed = x speed unit.timesspeed = x speed
unit.percent = % unit.percent = %
unit.shieldhealth = shield health
unit.items = items unit.items = items
unit.thousands = k unit.thousands = k
unit.millions = mil unit.millions = mil

View File

@@ -879,7 +879,7 @@ public class Blocks implements ContentList{
forceProjector = new ForceProjector("force-projector"){{ forceProjector = new ForceProjector("force-projector"){{
requirements(Category.effect, with(Items.lead, 100, Items.titanium, 75, Items.silicon, 125)); requirements(Category.effect, with(Items.lead, 100, Items.titanium, 75, Items.silicon, 125));
size = 3; size = 3;
phaseRadiusBoost = 80f; phaseBoost = 80f;
radius = 101.7f; radius = 101.7f;
breakage = 750f; breakage = 750f;
cooldownNormal = 1.5f; cooldownNormal = 1.5f;

View File

@@ -22,7 +22,7 @@ public class ForceProjector extends Block{
public final int timerUse = timers++; public final int timerUse = timers++;
public float phaseUseTime = 350f; public float phaseUseTime = 350f;
public float phaseRadiusBoost = 80f; public float phaseBoost = 80f;
public float radius = 101.7f; public float radius = 101.7f;
public float breakage = 550f; public float breakage = 550f;
public float cooldownNormal = 1.75f; public float cooldownNormal = 1.75f;
@@ -41,6 +41,12 @@ public class ForceProjector extends Block{
} }
}; };
static final Cons<Unitc> unitPusher = unit -> {
if(unit.team() != paramEntity.team && Intersector.isInsideHexagon(paramEntity.x, paramEntity.y, paramEntity.realRadius() * 2f, unit.x(), unit.y())){
unit.impulse(Tmp.v3.set(unit).sub(paramEntity.x, paramEntity.y).nor().scl(100f));
}
};
public ForceProjector(String name){ public ForceProjector(String name){
super(name); super(name);
update = true; update = true;
@@ -60,7 +66,8 @@ public class ForceProjector extends Block{
@Override @Override
public void setStats(){ public void setStats(){
super.setStats(); super.setStats();
stats.add(BlockStat.shieldHealth, breakage, StatUnit.none);
stats.add(BlockStat.cooldownTime, (int) (breakage / cooldownBrokenBase / 60f), StatUnit.seconds);
stats.add(BlockStat.powerUse, basePowerDraw * 60f, StatUnit.powerSecond); stats.add(BlockStat.powerUse, basePowerDraw * 60f, StatUnit.powerSecond);
stats.add(BlockStat.boostEffect, phaseRadiusBoost / tilesize, StatUnit.blocks); stats.add(BlockStat.boostEffect, phaseRadiusBoost / tilesize, StatUnit.blocks);
} }
@@ -76,6 +83,15 @@ public class ForceProjector extends Block{
Lines.stroke(1f); Lines.stroke(1f);
Lines.poly(x * tilesize, y * tilesize, 6, radius); Lines.poly(x * tilesize, y * tilesize, 6, radius);
Draw.color(); Draw.color();
float phaseBoostedRadius = radius + phaseBoost;
Draw.color(Pal.gray);
Lines.stroke(3f);
Lines.poly(x * tilesize, y * tilesize, 6, phaseBoostedRadius);
Draw.color(player.team().color);
Lines.stroke(1f);
Lines.poly(x * tilesize, y * tilesize, 6, phaseBoostedRadius);
Draw.color();
} }
public class ForceProjectorEntity extends Building{ public class ForceProjectorEntity extends Building{
@@ -119,7 +135,7 @@ public class ForceProjector extends Block{
broken = false; broken = false;
} }
if(buildup >= breakage && !broken){ if(buildup >= breakage + (phaseBoost * 5f) && !broken){
broken = true; broken = true;
buildup = breakage; buildup = breakage;
Fx.shieldBreak.at(x, y, radius, team.color); Fx.shieldBreak.at(x, y, radius, team.color);
@@ -134,11 +150,12 @@ public class ForceProjector extends Block{
if(realRadius > 0 && !broken){ if(realRadius > 0 && !broken){
paramEntity = this; paramEntity = this;
Groups.bullet.intersect(x - realRadius, y - realRadius, realRadius * 2f, realRadius * 2f, shieldConsumer); Groups.bullet.intersect(x - realRadius, y - realRadius, realRadius * 2f, realRadius * 2f, shieldConsumer);
Groups.unit.intersect(x - realRadius, y - realRadius, realRadius * 2f, realRadius * 2f, unitPusher);
} }
} }
float realRadius(){ float realRadius(){
return (radius + phaseHeat * phaseRadiusBoost) * radscl; return (radius + phaseHeat * phaseBoost) * radscl;
} }
@Override @Override

View File

@@ -45,6 +45,8 @@ public enum BlockStat{
targetsGround(StatCategory.shooting), targetsGround(StatCategory.shooting),
damage(StatCategory.shooting), damage(StatCategory.shooting),
ammo(StatCategory.shooting), ammo(StatCategory.shooting),
shieldHealth(StatCategory.shooting),
cooldownTime(StatCategory.shooting),
booster(StatCategory.optional), booster(StatCategory.optional),
boostEffect(StatCategory.optional), boostEffect(StatCategory.optional),

View File

@@ -19,6 +19,7 @@ public enum StatUnit{
perSecond, perSecond,
timesSpeed(false), timesSpeed(false),
percent(false), percent(false),
shieldHealth,
none, none,
items; items;