This commit is contained in:
Anuken
2019-01-04 15:27:39 -05:00
484 changed files with 10025 additions and 9800 deletions
@@ -1,6 +1,6 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Item;
@@ -1,6 +1,6 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Liquid;
+25 -55
View File
@@ -1,30 +1,24 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;
import io.anuke.arc.Core;
import io.anuke.arc.entities.Effects;
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;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Rectangle;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.content.fx.UnitFx;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.Units;
import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.entities.units.BaseUnit;
import io.anuke.mindustry.entities.units.types.AlphaDrone;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.graphics.Shaders;
import io.anuke.mindustry.maps.TutorialSector;
import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Mech;
import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Graphics;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.unitGroups;
public class Mechs implements ContentList{
public static Mech alpha, delta, tau, omega, dart, javelin, trident, glaive;
@@ -36,8 +30,6 @@ public class Mechs implements ContentList{
public void load(){
alpha = new Mech("alpha-mech", false){
int maxDrones = 3;
float buildTime = 20f;
{
drillPower = 1;
@@ -53,28 +45,6 @@ public class Mechs implements ContentList{
@Override
public void updateAlt(Player player){
if(player.isShooting && getDrones(player) < maxDrones && !TutorialSector.supressDrone()){
player.timer.get(Player.timerAbility, buildTime);
if(player.timer.getTime(Player.timerAbility) > buildTime/2f){
if(!Net.client()){
AlphaDrone drone = (AlphaDrone) UnitTypes.alphaDrone.create(player.getTeam());
drone.leader = player;
drone.set(player.x, player.y);
drone.add();
Effects.effect(UnitFx.unitLand, player);
}
}
}
}
int getDrones(Player player){
int sum = 0;
for(BaseUnit unit : unitGroups[player.getTeam().ordinal()].all()){
if(unit instanceof AlphaDrone && ((AlphaDrone) unit).leader == player) sum ++;
}
return sum;
}
};
@@ -100,7 +70,7 @@ public class Mechs implements ContentList{
Effects.shake(1f, 1f, player);
Effects.effect(UnitFx.landShock, player);
for(int i = 0; i < 8; i++){
Timers.run(Mathf.random(8f), () -> Lightning.create(player.getTeam(), Palette.lancerLaser, 17f, player.x, player.y, Mathf.random(360f), 14));
Time.run(Mathf.random(8f), () -> Lightning.create(player.getTeam(), Palette.lancerLaser, 17f, player.x, player.y, Mathf.random(360f), 14));
}
}
}
@@ -137,7 +107,7 @@ public class Mechs implements ContentList{
rect.setSize(healRange*2f).setCenter(player.x, player.y);
Units.getNearby(player.getTeam(), rect, unit -> {
if(unit.distanceTo(player) <= healRange){
if(unit.dst(player) <= healRange){
if(unit.health < unit.maxHealth()){
Effects.effect(UnitFx.heal, unit);
wasHealed = true;
@@ -184,7 +154,7 @@ public class Mechs implements ContentList{
@Override
public void load(){
super.load();
armorRegion = Draw.region(name + "-armor");
armorRegion = Core.atlas.find(name + "-armor");
}
@Override
@@ -202,15 +172,15 @@ public class Mechs implements ContentList{
public void draw(Player player){
if(player.shootHeat <= 0.01f) return;
float alpha = Core.batch.getColor().a;
float alpha = Draw.getColor().a;
Shaders.build.progress = player.shootHeat;
Shaders.build.region = armorRegion;
Shaders.build.time = Timers.time() / 10f;
Shaders.build.time = Time.time() / 10f;
Shaders.build.color.set(Palette.accent).a = player.shootHeat;
Graphics.shader(Shaders.build);
Draw.shader(Shaders.build);
Draw.alpha(1f);
Draw.rect(armorRegion, player.snappedX(), player.snappedY(), player.rotation);
Graphics.shader(Shaders.mix);
Draw.rect(armorRegion, player.x, player.y, player.rotation);
Draw.shader(Shaders.mix);
Draw.color(1f, 1f, 1f, alpha);
}
};
@@ -246,7 +216,7 @@ public class Mechs implements ContentList{
@Override
public void load(){
super.load();
shield = Draw.region(name + "-shield");
shield = Core.atlas.find(name + "-shield");
}
@Override
@@ -257,7 +227,7 @@ public class Mechs implements ContentList{
@Override
public void updateAlt(Player player){
float scl = scld(player);
if(Mathf.chance(Timers.delta() * (0.15*scl))){
if(Mathf.chance(Time.delta() * (0.15*scl))){
Effects.effect(BulletFx.hitLancer, Palette.lancerLaser, player.x, player.y);
Lightning.create(player.getTeam(), Palette.lancerLaser, 10f,
player.x + player.getVelocity().x, player.y + player.getVelocity().y, player.rotation, 14);
@@ -268,14 +238,14 @@ 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;
Graphics.shader();
Graphics.setAdditiveBlending();
float alpha = Draw.getColor().a;
Draw.shader();
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();
Graphics.shader(Shaders.mix);
Draw.blend(Blending.additive);
Draw.rect(shield, player.x + Mathf.range(scl/2f), player.y + Mathf.range(scl/2f), player.rotation - 90);
Draw.blend();
Draw.shader(Shaders.mix);
Draw.color();
Draw.alpha(alpha);
}
@@ -45,10 +45,9 @@ public class Recipes implements ContentList{
new Recipe(effect, StorageBlocks.container, new ItemStack(Items.densealloy, 200));
new Recipe(effect, StorageBlocks.vault, new ItemStack(Items.densealloy, 500), new ItemStack(Items.thorium, 250));
//core disabled due to being broken
new Recipe(effect, StorageBlocks.core,
new ItemStack(Items.copper, 2000), new ItemStack(Items.densealloy, 1500),
new ItemStack(Items.silicon, 1500), new ItemStack(Items.thorium, 500),
new ItemStack(Items.copper, 2000), new ItemStack(Items.densealloy, 2000),
new ItemStack(Items.silicon, 1750), new ItemStack(Items.thorium, 1000),
new ItemStack(Items.surgealloy, 500), new ItemStack(Items.phasefabric, 750)
);
@@ -1,14 +1,14 @@
package io.anuke.mindustry.content;
import io.anuke.arc.entities.Effects;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.fx.EnvironmentFx;
import io.anuke.mindustry.entities.StatusController.StatusEntry;
import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.StatusEffect;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.util.Mathf;
public class StatusEffects implements ContentList{
public static StatusEffect none, burning, freezing, wet, melting, tarred, overdrive, shielded, shocked;
@@ -38,7 +38,7 @@ public class StatusEffects implements ContentList{
public void update(Unit unit, float time){
unit.damagePeriodic(0.04f);
if(Mathf.chance(Timers.delta() * 0.2f)){
if(Mathf.chance(Time.delta() * 0.2f)){
Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
}
}
@@ -54,7 +54,7 @@ public class StatusEffects implements ContentList{
@Override
public void update(Unit unit, float time){
if(Mathf.chance(Timers.delta() * 0.15f)){
if(Mathf.chance(Time.delta() * 0.15f)){
Effects.effect(EnvironmentFx.freezing, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
}
}
@@ -79,7 +79,7 @@ public class StatusEffects implements ContentList{
@Override
public void update(Unit unit, float time){
if(Mathf.chance(Timers.delta() * 0.15f)){
if(Mathf.chance(Time.delta() * 0.15f)){
Effects.effect(EnvironmentFx.wet, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
}
}
@@ -105,7 +105,7 @@ public class StatusEffects implements ContentList{
public void update(Unit unit, float time){
unit.damagePeriodic(0.3f);
if(Mathf.chance(Timers.delta() * 0.2f)){
if(Mathf.chance(Time.delta() * 0.2f)){
Effects.effect(EnvironmentFx.melting, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
}
}
@@ -118,7 +118,7 @@ public class StatusEffects implements ContentList{
@Override
public void update(Unit unit, float time){
if(Mathf.chance(Timers.delta() * 0.15f)){
if(Mathf.chance(Time.delta() * 0.15f)){
Effects.effect(EnvironmentFx.oily, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
}
}
@@ -143,9 +143,9 @@ public class StatusEffects implements ContentList{
@Override
public void update(Unit unit, float time){
//idle regen boosted
unit.health += 0.01f * Timers.delta();
unit.health += 0.01f * Time.delta();
if(Mathf.chance(Timers.delta() * 0.25f)){
if(Mathf.chance(Time.delta() * 0.25f)){
Effects.effect(EnvironmentFx.overdriven, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f), 0f, unit);
}
}
@@ -1,7 +1,6 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.utils.ObjectSet;
import io.anuke.arc.collection.ObjectSet;
import io.anuke.mindustry.entities.units.UnitType;
import io.anuke.mindustry.entities.units.types.*;
import io.anuke.mindustry.game.ContentList;
@@ -10,32 +9,11 @@ import io.anuke.mindustry.type.ContentType;
public class UnitTypes implements ContentList{
public static UnitType
spirit, phantom,
alphaDrone,
wraith, ghoul, revenant,
dagger, titan, fortress;
@Override
public void load(){
alphaDrone = new UnitType("alpha-drone", AlphaDrone.class, AlphaDrone::new){
{
isFlying = true;
drag = 0.005f;
speed = 0.6f;
maxVelocity = 1.7f;
range = 40f;
health = 45;
hitsize = 4f;
mass = 0.1f;
weapon = Weapons.droneBlaster;
trailColor = Color.valueOf("ffd37f");
}
@Override
public boolean isHidden() {
return true;
}
};
spirit = new UnitType("spirit", Spirit.class, Spirit::new){{
weapon = Weapons.healBlasterDrone;
isFlying = true;
@@ -1,6 +1,6 @@
package io.anuke.mindustry.content.blocks;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.StatusEffects;
@@ -10,13 +10,14 @@ import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.*;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Mathf;
import io.anuke.arc.util.Time;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Mathf;
public class Blocks extends BlockList implements ContentList{
public static Block air, blockpart, spawn, space, metalfloor, deepwater, water, lava, tar, stone, blackstone, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock;
public static Block air, blockpart, spawn, space, metalfloor, deepwater, water, lava, tar, stone,
blackstone, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock;
@Override
@@ -40,7 +41,7 @@ public class Blocks extends BlockList implements ContentList{
public void draw(Tile tile){
Draw.color(Color.SCARLET);
Lines.circle(tile.worldx(), tile.worldy(), 4f +Mathf.absin(Timers.time(), 6f, 6f));
Lines.circle(tile.worldx(), tile.worldy(), 4f +Mathf.absin(Time.time(), 6f, 6f));
Draw.color();
}
};
@@ -90,6 +91,7 @@ public class Blocks extends BlockList implements ContentList{
}};
lava = new Floor("lava"){{
drownTime = 100f;
liquidColor = Color.valueOf("ed5334");
speedMultiplier = 0.2f;
damageTaken = 0.5f;
@@ -103,6 +105,7 @@ public class Blocks extends BlockList implements ContentList{
}};
tar = new Floor("tar"){{
drownTime = 150f;
liquidColor = Color.valueOf("292929");
status = StatusEffects.tarred;
statusIntensity = 1f;
@@ -157,9 +160,7 @@ public class Blocks extends BlockList implements ContentList{
minimapColor = Color.valueOf("549d5b");
}};
shrub = new Rock("shrub"){{
shadow = "shrubshadow";
}};
shrub = new Rock("shrub");
rock = new Rock("rock"){{
variants = 2;
@@ -1,6 +1,6 @@
package io.anuke.mindustry.content.blocks;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.fx.BlockFx;
@@ -23,7 +23,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
burnDuration = 46f;
useFlux = true;
consumes.items(new ItemStack[]{new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2)});
consumes.items(new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2));
consumes.item(Items.coal).optional(true);
}};
@@ -37,7 +37,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
useFlux = true;
fluxNeeded = 2;
consumes.items(new ItemStack[]{new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2)});
consumes.items(new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2));
consumes.power(0.1f);
}};
@@ -46,12 +46,11 @@ public class CraftingBlocks extends BlockList implements ContentList{
craftEffect = BlockFx.smeltsmoke;
result = Items.silicon;
craftTime = 40f;
powerCapacity = 20f;
size = 2;
hasLiquids = false;
flameColor = Color.valueOf("ffef99");
consumes.items(new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2)});
consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2));
consumes.power(0.05f);
}};
@@ -61,7 +60,6 @@ public class CraftingBlocks extends BlockList implements ContentList{
craftTime = 60f;
output = Items.plastanium;
itemCapacity = 30;
powerCapacity = 40f;
size = 2;
health = 320;
hasPower = hasLiquids = true;
@@ -77,10 +75,9 @@ public class CraftingBlocks extends BlockList implements ContentList{
craftEffect = BlockFx.smeltsmoke;
result = Items.phasefabric;
craftTime = 120f;
powerCapacity = 50f;
size = 2;
consumes.items(new ItemStack[]{new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10)});
consumes.items(new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10));
consumes.power(0.5f);
}};
@@ -88,14 +85,13 @@ public class CraftingBlocks extends BlockList implements ContentList{
craftEffect = BlockFx.smeltsmoke;
result = Items.surgealloy;
craftTime = 75f;
powerCapacity = 60f;
size = 2;
useFlux = true;
fluxNeeded = 3;
consumes.power(0.4f);
consumes.items(new ItemStack[]{new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.copper, 3)});
consumes.items(new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.copper, 3));
}};
cryofluidmixer = new LiquidMixer("cryofluidmixer"){{
@@ -133,7 +129,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
size = 2;
consumes.power(0.02f);
consumes.items(new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2)});
consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2));
}};
melter = new PowerCrafter("melter"){{
@@ -1,6 +1,6 @@
package io.anuke.mindustry.content.blocks;
import com.badlogic.gdx.utils.Array;
import io.anuke.arc.collection.Array;
import io.anuke.annotations.Annotations.Loc;
import io.anuke.annotations.Annotations.Remote;
import io.anuke.mindustry.content.Liquids;
@@ -10,17 +10,16 @@ import io.anuke.mindustry.gen.Call;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.BarType;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.PowerBlock;
import io.anuke.mindustry.world.blocks.distribution.Sorter;
import io.anuke.mindustry.world.blocks.power.PowerNode;
import io.anuke.mindustry.world.meta.BlockStat;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.scene.ui.ButtonGroup;
import io.anuke.ucore.scene.ui.ImageButton;
import io.anuke.ucore.scene.ui.layout.Table;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.scene.ui.ButtonGroup;
import io.anuke.arc.scene.ui.ImageButton;
import io.anuke.arc.scene.ui.layout.Table;
import java.io.DataInput;
import java.io.DataOutput;
@@ -40,36 +39,26 @@ public class DebugBlocks extends BlockList implements ContentList{
public void load(){
powerVoid = new PowerBlock("powervoid"){
{
powerCapacity = Float.MAX_VALUE;
shadow = "shadow-round-1";
}
@Override
public void setBars(){
super.setBars();
bars.remove(BarType.power);
consumes.power(Float.MAX_VALUE);
}
@Override
public void init(){
super.init();
stats.remove(BlockStat.powerCapacity);
stats.remove(BlockStat.powerUse);
}
};
powerInfinite = new PowerNode("powerinfinite"){
{
powerCapacity = 10000f;
maxNodes = 100;
outputsPower = true;
consumesPower = false;
shadow = "shadow-round-1";
}
@Override
public void update(Tile tile){
super.update(tile);
tile.entity.power.amount = powerCapacity;
public float getPowerProduction(Tile tile){
return 10000f;
}
};
@@ -83,12 +72,6 @@ public class DebugBlocks extends BlockList implements ContentList{
return true;
}
@Override
public void setBars(){
super.setBars();
bars.remove(BarType.inventory);
}
@Override
public void update(Tile tile){
SorterEntity entity = tile.entity();
@@ -71,19 +71,18 @@ public class DefenseBlocks extends BlockList implements ContentList{
}};
mendProjector = new MendProjector("mend-projector"){{
consumes.power(0.2f);
consumes.power(0.2f, 1.0f);
size = 2;
consumes.item(Items.phasefabric).optional(true);
}};
overdriveProjector = new OverdriveProjector("overdrive-projector"){{
consumes.power(0.35f);
consumes.power(0.35f, 1.0f);
size = 2;
consumes.item(Items.phasefabric).optional(true);
}};
forceProjector = new ForceProjector("force-projector"){{
consumes.power(0.2f);
size = 3;
consumes.item(Items.phasefabric).optional(true);
}};
@@ -35,7 +35,7 @@ public class DistributionBlocks extends BlockList implements ContentList{
phaseConveyor = new ItemBridge("phase-conveyor"){{
range = 12;
hasPower = true;
consumes.power(0.03f);
consumes.power(0.03f, 1.0f);
}};
sorter = new Sorter("sorter");
@@ -12,29 +12,24 @@ public class LiquidBlocks extends BlockList implements ContentList{
public void load(){
mechanicalPump = new Pump("mechanical-pump"){{
shadow = "shadow-round-1";
pumpAmount = 0.1f;
tier = 0;
}};
rotaryPump = new Pump("rotary-pump"){{
shadow = "shadow-rounded-2";
pumpAmount = 0.2f;
consumes.power(0.015f);
liquidCapacity = 30f;
powerCapacity = 20f;
hasPower = true;
size = 2;
tier = 1;
}};
thermalPump = new Pump("thermal-pump"){{
shadow = "shadow-rounded-2";
pumpAmount = 0.275f;
consumes.power(0.03f);
liquidCapacity = 40f;
hasPower = true;
powerCapacity = 20f;
size = 2;
tier = 2;
}};
@@ -69,7 +64,7 @@ public class LiquidBlocks extends BlockList implements ContentList{
phaseConduit = new LiquidBridge("phase-conduit"){{
range = 12;
hasPower = true;
consumes.power(0.03f);
consumes.power(0.03f, 1.0f);
}};
}
}
@@ -1,6 +1,6 @@
package io.anuke.mindustry.content.blocks;
import com.badlogic.gdx.utils.ObjectMap;
import io.anuke.arc.collection.ObjectMap;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.Floor;
@@ -4,6 +4,7 @@ import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.fx.BlockFx;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.power.*;
public class PowerBlocks extends BlockList implements ContentList{
@@ -13,48 +14,43 @@ public class PowerBlocks extends BlockList implements ContentList{
@Override
public void load(){
combustionGenerator = new BurnerGenerator("combustion-generator"){{
powerOutput = 0.09f;
powerCapacity = 40f;
powerProduction = 0.09f;
itemDuration = 40f;
}};
thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{
maxLiquidGenerate = 2f;
powerCapacity = 40f;
powerPerLiquid = 0.35f;
powerProduction = 2f;
generateEffect = BlockFx.redgeneratespark;
size = 2;
}};
turbineGenerator = new TurbineGenerator("turbine-generator"){{
powerOutput = 0.28f;
powerCapacity = 40f;
powerProduction = 0.28f;
itemDuration = 30f;
powerPerLiquid = 0.7f;
consumes.liquid(Liquids.water, 0.05f);
size = 2;
}};
rtgGenerator = new DecayGenerator("rtg-generator"){{
powerCapacity = 40f;
size = 2;
powerOutput = 0.3f;
powerProduction = 0.3f;
itemDuration = 220f;
}};
solarPanel = new SolarGenerator("solar-panel"){{
generation = 0.0045f;
powerProduction = 0.0045f;
}};
largeSolarPanel = new SolarGenerator("solar-panel-large"){{
size = 3;
generation = 0.055f;
powerProduction = 0.055f;
}};
thoriumReactor = new NuclearReactor("thorium-reactor"){{
size = 3;
health = 700;
powerMultiplier = 1.1f;
powerProduction = 1.1f;
}};
fusionReactor = new FusionReactor("fusion-reactor"){{
@@ -63,16 +59,15 @@ public class PowerBlocks extends BlockList implements ContentList{
}};
battery = new Battery("battery"){{
powerCapacity = 320f;
consumes.powerBuffered(320f, 1f);
}};
batteryLarge = new Battery("battery-large"){{
size = 3;
powerCapacity = 2000f;
consumes.powerBuffered(2000f, 1f);
}};
powerNode = new PowerNode("power-node"){{
shadow = "shadow-round-1";
maxNodes = 4;
laserRange = 6;
}};
@@ -81,7 +76,6 @@ public class PowerBlocks extends BlockList implements ContentList{
size = 2;
maxNodes = 6;
laserRange = 9.5f;
shadow = "shadow-round-2";
}};
}
@@ -1,6 +1,6 @@
package io.anuke.mindustry.content.blocks;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.fx.BlockFx;
@@ -1,16 +1,17 @@
package io.anuke.mindustry.content.blocks;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import io.anuke.arc.Core;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.mindustry.content.AmmoTypes;
import io.anuke.mindustry.content.fx.ShootFx;
import io.anuke.mindustry.type.AmmoType;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.defense.turrets.*;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf;
public class TurretBlocks extends BlockList implements ContentList{
public static Block duo, /*scatter,*/
@@ -46,7 +47,7 @@ public class TurretBlocks extends BlockList implements ContentList{
@Override
public void load(){
super.load();
shootRegion = Draw.region(name + "-shoot");
shootRegion = Core.atlas.find(name + "-shoot");
}
{
@@ -91,8 +92,8 @@ public class TurretBlocks extends BlockList implements ContentList{
recoil = 2f;
reload = 100f;
cooldown = 0.03f;
powerUsed = 20f;
powerCapacity = 60f;
powerUsed = 1 / 3f;
consumes.powerBuffered(60f);
shootShake = 2f;
shootEffect = ShootFx.lancerLaserShoot;
smokeEffect = ShootFx.lancerLaserShootSmoke;
@@ -110,8 +111,8 @@ public class TurretBlocks extends BlockList implements ContentList{
shootShake = 1f;
shootCone = 40f;
rotatespeed = 8f;
powerUsed = 10f;
powerCapacity = 30f;
powerUsed = 1f / 3f;
consumes.powerBuffered(30f);
range = 150f;
shootEffect = ShootFx.lightningShoot;
heatColor = Color.RED;
@@ -137,8 +138,8 @@ public class TurretBlocks extends BlockList implements ContentList{
@Override
public void load() {
super.load();
panels[0] = Draw.region(name + "-panel-left");
panels[1] = Draw.region(name + "-panel-right");
panels[0] = Core.atlas.find(name + "-panel-left");
panels[1] = Core.atlas.find(name + "-panel-right");
}
{
@@ -157,8 +158,8 @@ public class TurretBlocks extends BlockList implements ContentList{
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);
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;
@@ -170,6 +171,11 @@ public class TurretBlocks extends BlockList implements ContentList{
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"){{
@@ -243,8 +249,8 @@ public class TurretBlocks extends BlockList implements ContentList{
recoil = 4f;
size = 4;
shootShake = 2f;
powerUsed = 60f;
powerCapacity = 120f;
powerUsed = 0.5f;
consumes.powerBuffered(120f);
range = 160f;
reload = 200f;
firingMoveFract = 0.1f;
@@ -45,7 +45,6 @@ public class UnitBlocks extends BlockList implements ContentList{
produceTime = 3600;
size = 3;
consumes.power(0.2f);
shadow = "shadow-round-3";
consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 30), new ItemStack(Items.plastanium, 20));
}};
@@ -54,7 +53,6 @@ public class UnitBlocks extends BlockList implements ContentList{
produceTime = 8000;
size = 4;
consumes.power(0.3f);
shadow = "shadow-round-4";
consumes.items(new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 80), new ItemStack(Items.plastanium, 50));
}};
@@ -71,7 +69,6 @@ public class UnitBlocks extends BlockList implements ContentList{
produceTime = 3400;
size = 3;
consumes.power(0.15f);
shadow = "shadow-round-3";
consumes.items(new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30));
}};
@@ -80,12 +77,10 @@ public class UnitBlocks extends BlockList implements ContentList{
produceTime = 5000;
size = 3;
consumes.power(0.2f);
shadow = "shadow-round-3";
consumes.items(new ItemStack(Items.silicon, 40), new ItemStack(Items.thorium, 50));
}};
repairPoint = new RepairPoint("repair-point"){{
shadow = "shadow-round-1";
repairSpeed = 0.1f;
}};
@@ -9,56 +9,53 @@ public class UpgradeBlocks extends BlockList{
@Override
public void load(){
alphaPad = new MechPad("alpha-mech-pad"){{
mech = Mechs.alpha;
size = 2;
powerCapacity = 50f;
consumes.powerBuffered(50f);
}};
deltaPad = new MechPad("delta-mech-pad"){{
mech = Mechs.delta;
size = 2;
powerCapacity = 70f;
consumes.powerBuffered(70f);
}};
tauPad = new MechPad("tau-mech-pad"){{
mech = Mechs.tau;
size = 2;
powerCapacity = 100f;
consumes.powerBuffered(100f);
}};
omegaPad = new MechPad("omega-mech-pad"){{
mech = Mechs.omega;
size = 3;
powerCapacity = 120f;
consumes.powerBuffered(120f);
}};
dartPad = new MechPad("dart-ship-pad"){{
mech = Mechs.dart;
size = 2;
powerCapacity = 50f;
shadow = "shadow-rounded-2";
consumes.powerBuffered(50f);
}};
javelinPad = new MechPad("javelin-ship-pad"){{
mech = Mechs.javelin;
size = 2;
powerCapacity = 80f;
shadow = "shadow-rounded-2";
consumes.powerBuffered(80f);
}};
tridentPad = new MechPad("trident-ship-pad"){{
mech = Mechs.trident;
size = 2;
powerCapacity = 100f;
shadow = "shadow-rounded-2";
consumes.powerBuffered(100f);
}};
glaivePad = new MechPad("glaive-ship-pad"){{
mech = Mechs.glaive;
size = 3;
powerCapacity = 120f;
shadow = "shadow-round-3";
consumes.powerBuffered(120f);
}};
}
}
@@ -7,7 +7,7 @@ import io.anuke.mindustry.entities.bullet.FlakBulletType;
import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.ucore.util.Mathf;
import io.anuke.arc.math.Mathf;
public class FlakBullets extends BulletList implements ContentList{
public static BulletType plastic, explosive, surge;
@@ -1,6 +1,6 @@
package io.anuke.mindustry.content.bullets;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.bullet.BulletType;
@@ -8,8 +8,8 @@ import io.anuke.mindustry.entities.bullet.MissileBulletType;
import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.util.Mathf;
import io.anuke.arc.util.Time;
import io.anuke.arc.math.Mathf;
public class MissileBullets extends BulletList implements ContentList{
public static BulletType explosive, incindiary, surge, javelin, swarm;
@@ -92,7 +92,7 @@ public class MissileBullets extends BulletList implements ContentList{
@Override
public void update(Bullet b){
super.update(b);
b.getVelocity().rotate(Mathf.sin(Timers.time() + b.id * 4422, 8f, 2f));
b.getVelocity().rotate(Mathf.sin(Time.time() + b.id * 4422, 8f, 2f));
}
};
@@ -117,7 +117,7 @@ public class MissileBullets extends BulletList implements ContentList{
@Override
public void update(Bullet b){
super.update(b);
b.getVelocity().rotate(Mathf.sin(Timers.time() + b.id * 4422, 8f, 2f));
b.getVelocity().rotate(Mathf.sin(Time.time() + b.id * 4422, 8f, 2f));
}
};
}
@@ -1,6 +1,6 @@
package io.anuke.mindustry.content.bullets;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.entities.bullet.BasicBulletType;
import io.anuke.mindustry.entities.bullet.BulletType;
@@ -1,6 +1,14 @@
package io.anuke.mindustry.content.bullets;
import com.badlogic.gdx.graphics.Color;
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.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.graphics.*;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.content;
import static io.anuke.mindustry.Vars.world;
@@ -105,18 +109,18 @@ public class TurretBullets extends BulletList implements ContentList{
@Override
public void update(Bullet b){
if(Mathf.chance(0.04 * Timers.delta())){
if(Mathf.chance(0.04 * Time.delta())){
Tile tile = world.tileWorld(b.x, b.y);
if(tile != null){
Fire.create(tile);
}
}
if(Mathf.chance(0.1 * Timers.delta())){
if(Mathf.chance(0.1 * Time.delta())){
Effects.effect(EnvironmentFx.fireballsmoke, b.x, b.y);
}
if(Mathf.chance(0.1 * Timers.delta())){
if(Mathf.chance(0.1 * Time.delta())){
Effects.effect(EnvironmentFx.ballfire, b.x, b.y);
}
}
@@ -213,10 +217,10 @@ public class TurretBullets extends BulletList implements ContentList{
Lines.lineAngle(b.x, b.y, b.angle(), baseLen);
for(int s = 0; s < colors.length; s++){
Draw.color(tmpColor.set(colors[s]).mul(1f + Mathf.absin(Timers.time(), 1f, 0.1f)));
Draw.color(tmpColor.set(colors[s]).mul(1f + Mathf.absin(Time.time(), 1f, 0.1f)));
for(int i = 0; i < tscales.length; i++){
vector.trns(b.angle() + 180f, (lenscales[i] - 1f) * 35f);
Lines.stroke((9f + Mathf.absin(Timers.time(), 0.8f, 1.5f)) * b.fout() * strokes[s] * tscales[i]);
Lines.stroke((9f + Mathf.absin(Time.time(), 0.8f, 1.5f)) * b.fout() * strokes[s] * tscales[i]);
Lines.lineAngle(b.x + vector.x, b.y + vector.y, b.angle(), baseLen * lenscales[i], CapStyle.none);
}
}
@@ -367,9 +371,9 @@ public class TurretBullets extends BulletList implements ContentList{
return;
}
float baseDst = data.from.distanceTo(data.to);
float dst1 = b.distanceTo(data.from);
float dst2 = b.distanceTo(data.to);
float baseDst = data.from.dst(data.to);
float dst1 = b.dst(data.from);
float dst2 = b.dst(data.to);
boolean intersect = false;
@@ -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));
@@ -1,6 +1,6 @@
package io.anuke.mindustry.content.bullets;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.fx.BlockFx;
import io.anuke.mindustry.content.fx.BulletFx;
@@ -12,7 +12,7 @@ import io.anuke.mindustry.entities.effect.Fire;
import io.anuke.mindustry.entities.effect.Puddle;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.util.Mathf;
import io.anuke.arc.math.Mathf;
import static io.anuke.mindustry.Vars.world;
@@ -1,17 +1,16 @@
package io.anuke.mindustry.content.fx;
import com.badlogic.gdx.graphics.Color;
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.ucore.core.Effects.Effect;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.graphics.Hue;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Tmp;
import io.anuke.arc.entities.Effects.Effect;
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.Tmp;
import static io.anuke.mindustry.Vars.tilesize;
@@ -236,7 +235,7 @@ public class BlockFx extends FxList implements ContentList{
Lines.stroke(e.fout() * 2f);
Angles.randLenVectors(e.id, 30, 4f + 40f * e.fin(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fin() * 4f + 1f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f);
});
Draw.reset();
@@ -247,7 +246,7 @@ public class BlockFx extends FxList implements ContentList{
Lines.circle(e.x, e.y, 7f + e.fout() * 8f);
Angles.randLenVectors(e.id, 20, 6f + 20f * e.fout(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fin() * 4f + 1f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f);
});
Draw.reset();
@@ -258,20 +257,20 @@ public class BlockFx extends FxList implements ContentList{
Lines.circle(e.x, e.y, 7f + e.fin() * 8f);
Angles.randLenVectors(e.id, 20, 4f + 20f * e.fin(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fslope() * 4f + 1f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 4f + 1f);
});
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);
@@ -310,7 +309,7 @@ public class BlockFx extends FxList implements ContentList{
healBlockFull = new Effect(20, e -> {
Draw.color(e.color);
Draw.alpha(e.fout());
Fill.square(e.x, e.y, e.rotation * tilesize);
Fill.square(e.x, e.y, e.rotation * tilesize / 2f);
Draw.color();
});
@@ -1,14 +1,14 @@
package io.anuke.mindustry.content.fx;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import io.anuke.arc.entities.Effects.Effect;
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;
public class BulletFx extends FxList implements ContentList{
public static Effect hitBulletSmall, hitFuse, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, hitMeltdown, despawn, flakExplosion, blastExplosion, plasticExplosion,
@@ -29,7 +29,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(0.5f + e.fout());
Angles.randLenVectors(e.id, 5, e.fin() * 15f, (x, y) -> {
float ang = Mathf.atan2(x, y);
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
});
@@ -48,7 +48,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(0.5f + e.fout());
Angles.randLenVectors(e.id, 6, e.fin() * 15f, (x, y) -> {
float ang = Mathf.atan2(x, y);
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
});
@@ -60,7 +60,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(0.5f + e.fout() * 1.5f);
Angles.randLenVectors(e.id, 8, e.finpow() * 30f, e.rotation, 50f, (x, y) -> {
float ang = Mathf.atan2(x, y);
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1.5f);
});
@@ -72,7 +72,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(0.5f + e.fout());
Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation, 50f, (x, y) -> {
float ang = Mathf.atan2(x, y);
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
});
@@ -94,7 +94,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(e.fout() * 1.5f);
Angles.randLenVectors(e.id, 8, e.finpow() * 17f, e.rotation, 360f, (x, y) -> {
float ang = Mathf.atan2(x, y);
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f);
});
@@ -106,7 +106,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(e.fout() * 2f);
Angles.randLenVectors(e.id, 6, e.finpow() * 18f, e.rotation, 360f, (x, y) -> {
float ang = Mathf.atan2(x, y);
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f);
});
@@ -125,7 +125,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(e.fout());
Angles.randLenVectors(e.id, 7, e.fin() * 7f, e.rotation, 40f, (x, y) -> {
float ang = Mathf.atan2(x, y);
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 2 + 1f);
});
@@ -150,7 +150,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
@@ -174,7 +174,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 25f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
@@ -198,7 +198,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 30f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
@@ -222,7 +222,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
@@ -271,7 +271,7 @@ public class BulletFx extends FxList implements ContentList{
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
@@ -1,15 +1,15 @@
package io.anuke.mindustry.content.fx;
import com.badlogic.gdx.graphics.Color;
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;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.type.Item;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class EnvironmentFx extends FxList implements ContentList{
public static Effect burning, fire, smoke, steam, fireballsmoke, ballfire, freezing, melting, wet, oily, overdriven, dropItem;
@@ -1,14 +1,14 @@
package io.anuke.mindustry.content.fx;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import io.anuke.arc.entities.Effects.Effect;
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;
public class ExplosionFx extends FxList implements ContentList{
public static Effect shockwave, bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke;
@@ -54,7 +54,7 @@ public class ExplosionFx extends FxList implements ContentList{
Lines.stroke(1.5f * e.fout());
Angles.randLenVectors(e.id + 1, 8, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
@@ -77,7 +77,7 @@ public class ExplosionFx extends FxList implements ContentList{
Lines.stroke(1.7f * e.fout());
Angles.randLenVectors(e.id + 1, 9, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
@@ -1,13 +1,13 @@
package io.anuke.mindustry.content.fx;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.arc.entities.Effects.Effect;
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 static io.anuke.mindustry.Vars.tilesize;
@@ -1,16 +1,17 @@
package io.anuke.mindustry.content.fx;
import com.badlogic.gdx.graphics.Color;
import io.anuke.arc.Core;
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.math.Angles;
import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.graphics.Shapes;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
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;
@@ -108,8 +109,7 @@ public class ShootFx extends FxList implements ContentList{
float len = (2f + e.finpow() * 6f) * i;
float lr = rot + e.fin() * 30f * i;
Draw.rect("white",
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
Fill.rect(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);
@@ -122,7 +122,7 @@ public class ShootFx extends FxList implements ContentList{
for(int i : Mathf.signs){
float len = (2f + e.finpow() * 10f) * i;
float lr = rot + e.fin() * 20f * i;
Draw.rect("casing",
Draw.rect(Core.atlas.find("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);
@@ -145,11 +145,11 @@ public class ShootFx extends FxList implements ContentList{
for(int i : Mathf.signs){
float len = (4f + e.finpow() * 8f) * i;
float lr = rot + Mathf.randomSeedRange(e.id + i + 6, 20f * e.fin()) * i;
Draw.rect("casing",
Draw.rect(Core.atlas.find("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()));
rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin()));
}
Draw.color(Color.LIGHT_GRAY);
@@ -177,7 +177,7 @@ public class ShootFx extends FxList implements ContentList{
Draw.color(Palette.lancerLaser);
Angles.randLenVectors(e.id, 7, 80f, e.rotation, 0f, (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fout() * 9f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f);
});
Draw.reset();
@@ -187,7 +187,7 @@ public class ShootFx extends FxList implements ContentList{
Draw.color(Palette.lancerLaser);
Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fslope() * 3f + 1f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 1f);
});
Draw.reset();
@@ -205,7 +205,7 @@ public class ShootFx extends FxList implements ContentList{
Draw.color(Palette.lancerLaser);
Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> {
Shapes.tri(e.x + x, e.y + y, e.fslope() * 3f + 1, e.fslope() * 3f + 1, Mathf.atan2(x, y));
Shapes.tri(e.x + x, e.y + y, e.fslope() * 3f + 1, e.fslope() * 3f + 1, Mathf.angle(x, y));
});
Draw.reset();
@@ -216,7 +216,7 @@ public class ShootFx extends FxList implements ContentList{
Lines.stroke(e.fout() * 1.2f + 0.5f);
Angles.randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fin() * 5f + 2f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 5f + 2f);
});
Draw.reset();
@@ -3,12 +3,12 @@ package io.anuke.mindustry.content.fx;
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import io.anuke.arc.entities.Effects.Effect;
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;
public class UnitFx extends FxList implements ContentList{
public static Effect vtolHover, unitDrop, unitPickup, unitLand, pickup, healWave, heal, landShock;