Successful desktop compilation
This commit is contained in:
@@ -2,7 +2,7 @@ package io.anuke.mindustry.content;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.entities.Effects;
|
||||
import io.anuke.arc.Graphics;
|
||||
import io.anuke.arc.graphics.Blending;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||
@@ -202,14 +202,14 @@ public class Mechs implements ContentList{
|
||||
public void draw(Player player){
|
||||
if(player.shootHeat <= 0.01f) return;
|
||||
|
||||
float alpha = Core.batch.getColor().a;
|
||||
float alpha = Core.graphics.batch().getColor().a;
|
||||
Shaders.build.progress = player.shootHeat;
|
||||
Shaders.build.region = armorRegion;
|
||||
Shaders.build.time = Time.time() / 10f;
|
||||
Shaders.build.color.set(Palette.accent).a = player.shootHeat;
|
||||
Draw.shader(Shaders.build);
|
||||
Draw.alpha(1f);
|
||||
Draw.rect(armorRegion, player.snappedX(), player.snappedY(), player.rotation);
|
||||
Draw.rect(armorRegion, player.snappedX(), player.snappedY()).rot(player.rotation);
|
||||
Draw.shader(Shaders.mix);
|
||||
Draw.color(1f, 1f, 1f, alpha);
|
||||
}
|
||||
@@ -268,13 +268,11 @@ public class Mechs implements ContentList{
|
||||
public void draw(Player player){
|
||||
float scl = scld(player);
|
||||
if(scl < 0.01f) return;
|
||||
float alpha = Core.batch.getColor().a;
|
||||
float alpha = Core.graphics.batch().getColor().a;
|
||||
Draw.shader();
|
||||
Graphics.setAdditiveBlending();
|
||||
Draw.color(Palette.lancerLaser);
|
||||
Draw.alpha(scl/2f);
|
||||
Draw.rect(shield, player.snappedX() + Mathf.range(scl/2f), player.snappedY() + Mathf.range(scl/2f), player.rotation - 90);
|
||||
Graphics.setNormalBlending();
|
||||
Draw.rect(shield, player.snappedX() + Mathf.range(scl/2f), player.snappedY() + Mathf.range(scl/2f)).rot(player.rotation - 90).blend(Blending.additive);
|
||||
Draw.shader(Shaders.mix);
|
||||
Draw.color();
|
||||
Draw.alpha(alpha);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class TurretBlocks extends BlockList implements ContentList{
|
||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||
health = 160;
|
||||
|
||||
drawer = (tile, entity) -> Draw.rect(entity.target != null ? shootRegion : region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||
drawer = (tile, entity) -> Draw.rect(entity.target != null ? shootRegion : region, tile.drawx() + tr2.x, tile.drawy() + tr2.y).rot(entity.rotation - 90);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -157,20 +157,25 @@ public class TurretBlocks extends BlockList implements ContentList{
|
||||
ammoUseEffect = ShootFx.shellEjectBig;
|
||||
|
||||
drawer = (tile, entity) -> {
|
||||
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||
float offsetx = (int) (Mathf.abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 3f);
|
||||
float offsety = -(int) (Mathf.abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 2f);
|
||||
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y).rot(entity.rotation - 90);
|
||||
float offsetx = (int) (abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 3f);
|
||||
float offsety = -(int) (abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 2f);
|
||||
|
||||
for(int i : Mathf.signs){
|
||||
float rot = entity.rotation + 90 * i;
|
||||
Draw.rect(panels[i == -1 ? 0 : 1],
|
||||
tile.drawx() + tr2.x + Angles.trnsx(rot, offsetx, offsety),
|
||||
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90);
|
||||
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety)).rot(entity.rotation - 90);
|
||||
}
|
||||
};
|
||||
|
||||
health = 360;
|
||||
}
|
||||
|
||||
/** Converts a value range from 0-1 to a value range 0-1-0. */
|
||||
float abscurve(float f){
|
||||
return 1f - Math.abs(f - 0.5f) * 2f;
|
||||
}
|
||||
};
|
||||
|
||||
ripple = new ArtilleryTurret("ripple"){{
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
package io.anuke.mindustry.content.bullets;
|
||||
|
||||
import io.anuke.arc.entities.Effects;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.CapStyle;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.graphics.g2d.Fill;
|
||||
import io.anuke.arc.graphics.g2d.Lines;
|
||||
import io.anuke.arc.math.Angles;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.arc.util.Time;
|
||||
import io.anuke.mindustry.content.Liquids;
|
||||
import io.anuke.mindustry.content.StatusEffects;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
@@ -15,14 +23,10 @@ import io.anuke.mindustry.entities.effect.Fire;
|
||||
import io.anuke.mindustry.entities.effect.Lightning;
|
||||
import io.anuke.mindustry.game.ContentList;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.graphics.Shapes;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.BuildBlock;
|
||||
import io.anuke.mindustry.world.blocks.distribution.MassDriver.DriverBulletData;
|
||||
import io.anuke.arc.entities.Effects;
|
||||
import io.anuke.arc.util.Time;
|
||||
import io.anuke.arc.graphics.*;
|
||||
import io.anuke.arc.math.Angles;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
|
||||
import static io.anuke.mindustry.Vars.content;
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
@@ -342,10 +346,10 @@ public class TurretBullets extends BulletList implements ContentList{
|
||||
float w = 11f, h = 13f;
|
||||
|
||||
Draw.color(Palette.bulletYellowBack);
|
||||
Draw.rect("shell-back", b.x, b.y, w, h, b.angle() + 90);
|
||||
Draw.rect("shell-back", b.x, b.y, w, h).rot(b.angle() + 90);
|
||||
|
||||
Draw.color(Palette.bulletYellow);
|
||||
Draw.rect("shell", b.x, b.y, w, h, b.angle() + 90);
|
||||
Draw.rect("shell", b.x, b.y, w, h).rot(b.angle() + 90);
|
||||
|
||||
Draw.reset();
|
||||
}
|
||||
@@ -379,7 +383,7 @@ public class TurretBullets extends BulletList implements ContentList{
|
||||
float baseAngle = data.to.angleTo(data.from);
|
||||
|
||||
//if angles are nearby, then yes, it did
|
||||
if(Mathf.angNear(angleTo, baseAngle, 2f)){
|
||||
if(Angles.near(angleTo, baseAngle, 2f)){
|
||||
intersect = true;
|
||||
//snap bullet position back; this is used for low-FPS situations
|
||||
b.set(data.to.x + Angles.trnsx(baseAngle, hitDst), data.to.y + Angles.trnsy(baseAngle, hitDst));
|
||||
|
||||
@@ -263,14 +263,14 @@ public class BlockFx extends FxList implements ContentList{
|
||||
Draw.reset();
|
||||
});
|
||||
ripple = new GroundEffect(false, 30, e -> {
|
||||
Draw.color(Hue.shift(Tmp.c1.set(e.color), 2, 0.1f));
|
||||
Draw.color(Tmp.c1.set(e.color).shiftValue(0.1f));
|
||||
Lines.stroke(e.fout() + 0.4f);
|
||||
Lines.circle(e.x, e.y, 2f + e.fin() * 4f);
|
||||
Draw.reset();
|
||||
});
|
||||
|
||||
bubble = new Effect(20, e -> {
|
||||
Draw.color(Hue.shift(Tmp.c1.set(e.color), 2, 0.1f));
|
||||
Draw.color(Tmp.c1.set(e.color).shiftValue(0.1f));
|
||||
Lines.stroke(e.fout() + 0.2f);
|
||||
Angles.randLenVectors(e.id, 2, 8f, (x, y) -> {
|
||||
Lines.circle(e.x + x, e.y + y, 1f + e.fin() * 3f);
|
||||
|
||||
@@ -4,6 +4,7 @@ import io.anuke.arc.entities.Effects.Effect;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.graphics.g2d.Fill;
|
||||
import io.anuke.arc.math.Angles;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.mindustry.content.Liquids;
|
||||
import io.anuke.mindustry.game.ContentList;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package io.anuke.mindustry.content.fx;
|
||||
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.game.ContentList;
|
||||
import io.anuke.arc.entities.Effects.Effect;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.graphics.g2d.Fill;
|
||||
import io.anuke.arc.graphics.g2d.Lines;
|
||||
import io.anuke.arc.graphics.Shapes;
|
||||
import io.anuke.arc.math.Angles;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
|
||||
import io.anuke.mindustry.game.ContentList;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.graphics.Shapes;
|
||||
|
||||
public class ShootFx extends FxList implements ContentList{
|
||||
public static Effect shootSmall, shootHeal, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke, shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium, shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot;
|
||||
@@ -111,7 +111,7 @@ public class ShootFx extends FxList implements ContentList{
|
||||
Draw.rect("white",
|
||||
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
|
||||
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
|
||||
1f, 2f, rot + e.fin() * 50f * i);
|
||||
1f, 2f).rot(rot + e.fin() * 50f * i);
|
||||
|
||||
Draw.color();
|
||||
});
|
||||
@@ -125,7 +125,7 @@ public class ShootFx extends FxList implements ContentList{
|
||||
Draw.rect("casing",
|
||||
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
|
||||
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
|
||||
2f, 3f, rot);
|
||||
2f, 3f).rot(rot);
|
||||
}
|
||||
|
||||
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
|
||||
@@ -148,8 +148,8 @@ public class ShootFx extends FxList implements ContentList{
|
||||
Draw.rect("casing",
|
||||
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
|
||||
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
|
||||
2.5f, 4f,
|
||||
rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin()));
|
||||
2.5f, 4f)
|
||||
.rot(rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin()));
|
||||
}
|
||||
|
||||
Draw.color(Color.LIGHT_GRAY);
|
||||
|
||||
Reference in New Issue
Block a user