This commit is contained in:
Anuken
2018-09-18 17:04:24 -04:00
133 changed files with 1940 additions and 4188 deletions

View File

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 208 B

View File

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

View File

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

View File

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 208 B

View File

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 283 B

View File

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

View File

Before

Width:  |  Height:  |  Size: 210 B

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

After

Width:  |  Height:  |  Size: 564 B

View File

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

View File

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 230 B

View File

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

View File

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 178 B

View File

Before

Width:  |  Height:  |  Size: 170 B

After

Width:  |  Height:  |  Size: 170 B

View File

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

View File

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 178 B

View File

Before

Width:  |  Height:  |  Size: 170 B

After

Width:  |  Height:  |  Size: 170 B

View File

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

View File

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 196 B

View File

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 208 B

View File

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

View File

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 178 B

View File

Before

Width:  |  Height:  |  Size: 170 B

After

Width:  |  Height:  |  Size: 170 B

View File

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 295 B

View File

Before

Width:  |  Height:  |  Size: 185 B

After

Width:  |  Height:  |  Size: 185 B

View File

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 175 B

View File

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

View File

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 234 B

View File

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 234 B

View File

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

View File

Before

Width:  |  Height:  |  Size: 155 B

After

Width:  |  Height:  |  Size: 155 B

View File

Before

Width:  |  Height:  |  Size: 94 B

After

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 B

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 B

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

View File

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 245 B

View File

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

View File

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 182 B

View File

Before

Width:  |  Height:  |  Size: 169 B

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

View File

@@ -92,7 +92,8 @@ text.server.kicked.idInUse=You are already on this server! Connecting with two a
text.server.kicked.customClient=This server does not support custom builds. Download an official version.
text.host.info=The [accent]host[] button hosts a server on port [scarlet]6567[]. \nAnybody on the same [LIGHT_GRAY]wifi or local network[] should be able to see your server in their server list.\n\nIf you want people to be able to connect from anywhere by IP, [accent]port forwarding[] is required.\n\n[LIGHT_GRAY]Note: If someone is experiencing trouble connecting to your LAN game, make sure you have allowed Mindustry access to your local network in your firewall settings.
text.join.info=Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[LIGHT_GRAY]Note: There is no automatic global server list; if you want to connect to someone by IP, you would need to ask the host for their IP.
text.hostserver=Host Server
text.hostserver=Host Game
text.hostserver.mobile=Host\nGame
text.host=Host
text.hosting=[accent]Opening server...
text.hosts.refresh=Refresh
@@ -340,6 +341,7 @@ text.category.shooting=Shooting
setting.fpscap.name=Max FPS
setting.fpscap.none=None
setting.fpscap.text={0} FPS
setting.difficulty.training=training
setting.difficulty.easy=easy
setting.difficulty.normal=normal
setting.difficulty.hard=hard
@@ -512,8 +514,8 @@ block.blackrock.name=blackrock
block.icerock.name=icerock
block.copper-wall.name=Copper Wall
block.copper-wall-large.name=Large Copper Wall
block.composite-wall.name=Composite Wall
block.composite-wall-large.name=Large Composite Wall
block.dense-alloy-wall.name=Dense Alloy Wall
block.dense-alloy-wall-large.name=Large Dense Alloy Wall
block.phase-wall.name=Phase Wall
block.phase-wall-large.name=Large Phase Wall
block.thorium-wall.name=Thorium Wall
@@ -559,13 +561,13 @@ block.pneumatic-drill.name=Pneumatic Drill
block.laser-drill.name=Laser Drill
block.water-extractor.name=Water Extractor
block.cultivator.name=Cultivator
block.dart-ship-factory.name=Dart Ship Reconstructor
block.delta-mech-factory.name=Delta Mech Reconstructor
block.javelin-ship-factory.name=Javelin Ship Reconstructor
block.trident-ship-factory.name=Trident Ship Reconstructor
block.glaive-ship-factory.name=Glaive Ship Reconstructor
block.omega-mech-factory.name=Omega Mech Reconstructor
block.tau-mech-factory.name=Tau Mech Reconstructor
block.dart-ship-pad.name=Dart Ship Pad
block.delta-mech-pad.name=Delta Mech Pad
block.javelin-ship-pad.name=Javelin Ship Pad
block.trident-ship-pad.name=Trident Ship Pad
block.glaive-ship-pad.name=Glaive Ship Pad
block.omega-mech-pad.name=Omega Mech Pad
block.tau-mech-pad.name=Tau Mech Pad
block.repairpoint.name=Repair Point
block.resupplypoint.name=Resupply Point
block.conduit.name=Conduit
@@ -596,10 +598,13 @@ block.solidifer.name=Solidifer
block.solar-panel.name=Solar Panel
block.solar-panel-large.name=Large Solar Panel
block.oil-extractor.name=Oil Extractor
block.drone-pad.name=Drone Pad
block.fabricator-pad.name=Fabricator Pad
block.interceptor-pad.name=Interceptor Pad
block.monsoon-pad.name=Monsoon Pad
block.spirit-factory.name=Spirit Drone Factory
block.phantom-factory.name=Phantom Drone Factory
block.wraith-factory.name=Wraith Fighter Factory
block.ghoul-factory.name=Ghoul Bomber Factory
block.dagger-factory.name=Dagger Factory
block.titan-factory.name=Titan Factory
block.revenant-factory.name=Revenant Factory
block.repair-point.name=Repair Point
block.resupply-point.name=Resupply Point
block.pulse-conduit.name=Pulse Conduit
@@ -614,8 +619,6 @@ block.command-center.name=Command Center
block.mass-driver.name=Mass Driver
block.blast-drill.name=Blast Drill
block.thermal-pump.name=Thermal Pump
block.dagger-pad.name=Dagger Pad
block.titan-pad.name=Titan Pad
block.thermal-generator.name=Thermal Generator
block.alloy-smelter.name=Alloy Smelter
block.mend-projector.name=Mend Projector
@@ -628,17 +631,23 @@ block.overdrive-projector.name=Overdrive Projector
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown
unit.alpha-drone.name=Alpha Drone
unit.drone.name=Drone
unit.drone.description=The starter drone unit. Spawns in the core by default. Automatically mines ores, collects items and repairs blocks.
unit.fabricator.name=Fabricator
unit.fabricator.description=An advanced drone unit. Automatically mines ores, collects items and repairs blocks. Significantly more effective than a drone.
unit.spirit.name=Spirit Drone
unit.spirit.description=The starter drone unit. Spawns in the core by default. Automatically mines ores, collects items and repairs blocks.
unit.phantom.name=Phantom Drone
unit.phantom.description=An advanced drone unit. Automatically mines ores, collects items and repairs blocks. Significantly more effective than a drone.
unit.dagger.name=Dagger
unit.dagger.description=A basic ground unit. Useful in swarms.
unit.titan.name=Titan
unit.titan.description=An advanced, armored ground unit. Attacks both ground and air targets.
unit.monsoon.name=Monsoon
unit.monsoon.description=A heavy carpet bomber. Uses blast compound or pyratite as ammo.
unit.interceptor.name=Interceptor
unit.interceptor.description=A fast, hit-and-run strike unit.
unit.ghoul.name=Ghoul Bomber
unit.ghoul.description=A heavy carpet bomber. Uses blast compound or pyratite as ammo.
unit.wraith.name=Wraith Fighter
unit.wraith.description=A fast, hit-and-run interceptor unit.
unit.fortress.name=Fortress
unit.fortress.description=A heavy artillery ground unit.
unit.revenant.name=Revenant
unit.revenant.description=A heavy laser platform.

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -640,3 +640,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -640,3 +640,5 @@ unit.interceptor.name=Винищувач-перехполювач
unit.interceptor.description=Швидка, ударна бойова одиниця, котра використовує набіг з відскоком
mode.custom.warning=Note that blocks cannot be used in custom games until they are unlocked in sectors.\n\n[LIGHT_GRAY]If you have not unlocked any blocks, none will appear.
content.unit.name=Units
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

View File

@@ -610,3 +610,5 @@ content.unit.name=Units
block.force-projector.name=Force Projector
block.arc.name=Arc
block.rtg-generator.name=RTG Generator
block.spectre.name=Spectre
block.meltdown.name=Meltdown

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 100 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

View File

@@ -10,11 +10,6 @@ Font: {
markup: false,
scale: 0.5
},
korean: {
file: korean.fnt,
markup: true,
scale: 0.5
},
trad-chinese: {
file: trad_chinese.fnt,
markup: true,

View File

@@ -9,7 +9,6 @@ import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.effect.Fire;
import io.anuke.mindustry.entities.effect.ItemDrop;
import io.anuke.mindustry.entities.effect.Puddle;
import io.anuke.mindustry.entities.traits.SyncTrait;
import io.anuke.mindustry.entities.units.BaseUnit;
@@ -29,12 +28,15 @@ import io.anuke.ucore.util.Translator;
import java.util.Arrays;
import java.util.Locale;
@SuppressWarnings("unchecked")
public class Vars{
public static final String discordURL = "https://discord.gg/mindustry";
public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
public static final String crashReportURL = "http://mindustry.us.to/report";
//time between waves in frames (on normal mode)
public static final float wavespace = 60 * 60 * 1.5f;
public static final float mineTransferRange = 310f;
//set ridiculously high for now
public static final float coreBuildRange = 999999f;
//team of the player by default
@@ -115,7 +117,6 @@ public class Vars{
public static EntityGroup<Bullet> bulletGroup;
public static EntityGroup<EffectEntity> effectGroup;
public static EntityGroup<DrawTrait> groundEffectGroup;
public static EntityGroup<ItemDrop> itemGroup;
public static EntityGroup<ShieldEntity> shieldGroup;
public static EntityGroup<Puddle> puddleGroup;
public static EntityGroup<Fire> fireGroup;
@@ -139,7 +140,6 @@ public class Vars{
}
Arrays.sort(locales, (l1, l2) -> Platform.instance.getLocaleName(l1).compareTo(Platform.instance.getLocaleName(l2)));
Version.init();
content = new ContentLoader();
@@ -150,7 +150,6 @@ public class Vars{
effectGroup = Entities.addGroup(EffectEntity.class, false);
groundEffectGroup = Entities.addGroup(DrawTrait.class, false);
puddleGroup = Entities.addGroup(Puddle.class).enableMapping();
itemGroup = Entities.addGroup(ItemDrop.class).enableMapping();
shieldGroup = Entities.addGroup(ShieldEntity.class, false);
fireGroup = Entities.addGroup(Fire.class).enableMapping();
unitGroups = new EntityGroup[Team.all.length];

View File

@@ -10,6 +10,7 @@ import io.anuke.mindustry.type.ContentType;
public class AmmoTypes implements ContentList{
public static AmmoType bulletCopper, bulletDense, bulletThorium, bulletSilicon, bulletPyratite,
bulletDenseBig, bulletPyratiteBig, bulletThoriumBig,
shock, bombExplosive, bombIncendiary, bombOil, shellCarbide, flamerThermite, weaponMissile, weaponMissileSwarm, bulletMech,
healBlaster, bulletGlaive,
flakExplosive, flakPlastic, flakSurge,
@@ -115,6 +116,22 @@ public class AmmoTypes implements ContentList{
inaccuracy = 3f;
}};
bulletDenseBig = new AmmoType(Items.densealloy, StandardBullets.denseBig, 1){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}};
bulletThoriumBig = new AmmoType(Items.thorium, StandardBullets.thoriumBig, 1){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}};
bulletPyratiteBig = new AmmoType(Items.pyratite, StandardBullets.tracerBig, 2){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
inaccuracy = 3f;
}};
//flak
flakExplosive = new AmmoType(Items.blastCompound, FlakBullets.explosive, 5){{
@@ -200,7 +217,7 @@ public class AmmoTypes implements ContentList{
spectreLaser = new AmmoType(TurretBullets.lancerLaser);
meltdownLaser = new AmmoType(TurretBullets.lancerLaser);
meltdownLaser = new AmmoType(TurretBullets.meltdownLaser);
fuseShotgun = new AmmoType(Items.densealloy, TurretBullets.fuseShot, 1f){{
shootEffect = Fx.none;

View File

@@ -19,8 +19,8 @@ public class Recipes implements ContentList{
new Recipe(defense, DefenseBlocks.copperWall, new ItemStack(Items.copper, 12));
new Recipe(defense, DefenseBlocks.copperWallLarge, new ItemStack(Items.copper, 12 * 4));
new Recipe(defense, DefenseBlocks.compositeWall, new ItemStack(Items.densealloy, 12));
new Recipe(defense, DefenseBlocks.compositeWallLarge, new ItemStack(Items.densealloy, 12 * 4));
new Recipe(defense, DefenseBlocks.denseAlloyWall, new ItemStack(Items.densealloy, 12));
new Recipe(defense, DefenseBlocks.denseAlloyWallLarge, new ItemStack(Items.densealloy, 12 * 4));
new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.densealloy, 12), new ItemStack(Items.silicon, 8));
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.densealloy, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
@@ -35,7 +35,7 @@ public class Recipes implements ContentList{
new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4));
//projectors
new Recipe(defense, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
new Recipe(defense, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 180));
new Recipe(defense, DefenseBlocks.overdriveProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
new Recipe(defense, DefenseBlocks.forceProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
@@ -54,6 +54,8 @@ public class Recipes implements ContentList{
new Recipe(weapon, TurretBlocks.ripple, new ItemStack(Items.copper, 300), new ItemStack(Items.densealloy, 220), new ItemStack(Items.thorium, 120));
new Recipe(weapon, TurretBlocks.cyclone, new ItemStack(Items.copper, 400), new ItemStack(Items.densealloy, 400), new ItemStack(Items.surgealloy, 200), new ItemStack(Items.plastanium, 150));
new Recipe(weapon, TurretBlocks.fuse, new ItemStack(Items.copper, 450), new ItemStack(Items.densealloy, 450), new ItemStack(Items.surgealloy, 250));
new Recipe(weapon, TurretBlocks.spectre, new ItemStack(Items.copper, 700), new ItemStack(Items.densealloy, 600), new ItemStack(Items.surgealloy, 500), new ItemStack(Items.plastanium, 350), new ItemStack(Items.thorium, 500));
new Recipe(weapon, TurretBlocks.meltdown, new ItemStack(Items.copper, 500), new ItemStack(Items.lead, 700), new ItemStack(Items.densealloy, 600), new ItemStack(Items.surgealloy, 650), new ItemStack(Items.silicon, 650));
//DISTRIBUTION
new Recipe(distribution, DistributionBlocks.conveyor, new ItemStack(Items.copper, 1));
@@ -143,24 +145,25 @@ public class Recipes implements ContentList{
//UNITS
//bodies
new Recipe(units, UpgradeBlocks.dartFactory, new ItemStack(Items.lead, 150), new ItemStack(Items.copper, 150), new ItemStack(Items.silicon, 200), new ItemStack(Items.titanium, 240)).setDesktop(); //dart is desktop only, because it's the starter mobile ship
new Recipe(units, UpgradeBlocks.tridentFactory, new ItemStack(Items.lead, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200));
new Recipe(units, UpgradeBlocks.javelinFactory, new ItemStack(Items.lead, 350), new ItemStack(Items.silicon, 450), new ItemStack(Items.titanium, 500), new ItemStack(Items.plastanium, 400), new ItemStack(Items.phasematter, 200));
new Recipe(units, UpgradeBlocks.glaiveFactory, new ItemStack(Items.lead, 450), new ItemStack(Items.silicon, 650), new ItemStack(Items.titanium, 700), new ItemStack(Items.plastanium, 600), new ItemStack(Items.surgealloy, 200));
new Recipe(units, UpgradeBlocks.dartPad, new ItemStack(Items.lead, 150), new ItemStack(Items.copper, 150), new ItemStack(Items.silicon, 200), new ItemStack(Items.titanium, 240)).setDesktop(); //dart is desktop only, because it's the starter mobile ship
new Recipe(units, UpgradeBlocks.tridentPad, new ItemStack(Items.lead, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200));
new Recipe(units, UpgradeBlocks.javelinPad, new ItemStack(Items.lead, 350), new ItemStack(Items.silicon, 450), new ItemStack(Items.titanium, 500), new ItemStack(Items.plastanium, 400), new ItemStack(Items.phasematter, 200));
new Recipe(units, UpgradeBlocks.glaivePad, new ItemStack(Items.lead, 450), new ItemStack(Items.silicon, 650), new ItemStack(Items.titanium, 700), new ItemStack(Items.plastanium, 600), new ItemStack(Items.surgealloy, 200));
new Recipe(units, UpgradeBlocks.tauFactory, new ItemStack(Items.lead, 250), new ItemStack(Items.densealloy, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250)).setDesktop();
new Recipe(units, UpgradeBlocks.deltaFactory, new ItemStack(Items.lead, 350), new ItemStack(Items.densealloy, 350), new ItemStack(Items.copper, 400), new ItemStack(Items.silicon, 450), new ItemStack(Items.thorium, 300)).setDesktop();
new Recipe(units, UpgradeBlocks.omegaFactory, new ItemStack(Items.lead, 450), new ItemStack(Items.densealloy, 550), new ItemStack(Items.silicon, 650), new ItemStack(Items.thorium, 600), new ItemStack(Items.surgealloy, 240)).setDesktop();
new Recipe(units, UpgradeBlocks.tauPad, new ItemStack(Items.lead, 250), new ItemStack(Items.densealloy, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250)).setDesktop();
new Recipe(units, UpgradeBlocks.deltaPad, new ItemStack(Items.lead, 350), new ItemStack(Items.densealloy, 350), new ItemStack(Items.copper, 400), new ItemStack(Items.silicon, 450), new ItemStack(Items.thorium, 300)).setDesktop();
new Recipe(units, UpgradeBlocks.omegaPad, new ItemStack(Items.lead, 450), new ItemStack(Items.densealloy, 550), new ItemStack(Items.silicon, 650), new ItemStack(Items.thorium, 600), new ItemStack(Items.surgealloy, 240)).setDesktop();
//actual unit related stuff
new Recipe(units, UnitBlocks.dronePad, new ItemStack(Items.copper, 70), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 130));
new Recipe(units, UnitBlocks.fabricatorPad, new ItemStack(Items.densealloy, 90), new ItemStack(Items.thorium, 80), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 210));
new Recipe(units, UnitBlocks.spiritFactory, new ItemStack(Items.copper, 70), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 130));
new Recipe(units, UnitBlocks.phantomFactory, new ItemStack(Items.densealloy, 90), new ItemStack(Items.thorium, 80), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 210));
new Recipe(units, UnitBlocks.daggerPad, new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 70));
new Recipe(units, UnitBlocks.titanPad, new ItemStack(Items.thorium, 90), new ItemStack(Items.lead, 140), new ItemStack(Items.silicon, 90));
new Recipe(units, UnitBlocks.daggerFactory, new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 70));
new Recipe(units, UnitBlocks.titanFactory, new ItemStack(Items.thorium, 90), new ItemStack(Items.lead, 140), new ItemStack(Items.silicon, 90));
new Recipe(units, UnitBlocks.interceptorPad, new ItemStack(Items.titanium, 60), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 90));
new Recipe(units, UnitBlocks.monsoonPad, new ItemStack(Items.plastanium, 80), new ItemStack(Items.titanium, 100), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 220));
new Recipe(units, UnitBlocks.wraithFactory, new ItemStack(Items.titanium, 60), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 90));
new Recipe(units, UnitBlocks.ghoulFactory, new ItemStack(Items.plastanium, 80), new ItemStack(Items.titanium, 100), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 220));
new Recipe(units, UnitBlocks.revenantFactory, new ItemStack(Items.plastanium, 300), new ItemStack(Items.titanium, 400), new ItemStack(Items.lead, 300), new ItemStack(Items.silicon, 400), new ItemStack(Items.surgealloy, 100));
new Recipe(units, UnitBlocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.copper, 30), new ItemStack(Items.silicon, 30));
new Recipe(units, UnitBlocks.commandCenter, new ItemStack(Items.lead, 100), new ItemStack(Items.densealloy, 100), new ItemStack(Items.silicon, 200));

View File

@@ -8,20 +8,14 @@ import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
public class UnitTypes implements ContentList{
public static UnitType drone, alphaDrone, dagger, interceptor, monsoon, titan, fortress, fabricator;
public static UnitType
spirit, phantom,
alphaDrone,
wraith, ghoul, revenant,
dagger, titan, fortress;
@Override
public void load(){
drone = new UnitType("drone", Drone.class, Drone::new){{
isFlying = true;
drag = 0.01f;
speed = 0.2f;
maxVelocity = 0.8f;
range = 50f;
healSpeed = 0.05f;
health = 60;
}};
alphaDrone = new UnitType("alpha-drone", AlphaDrone.class, AlphaDrone::new){
{
isFlying = true;
@@ -40,13 +34,23 @@ public class UnitTypes implements ContentList{
}
};
spirit = new UnitType("spirit", Spirit.class, Spirit::new){{
isFlying = true;
drag = 0.01f;
speed = 0.2f;
maxVelocity = 0.8f;
range = 50f;
healSpeed = 0.25f;
health = 60;
}};
dagger = new UnitType("dagger", Dagger.class, Dagger::new){{
maxVelocity = 1.1f;
speed = 0.2f;
drag = 0.4f;
range = 40f;
weapon = Weapons.chainBlaster;
health = 180;
health = 150;
}};
titan = new UnitType("titan", Titan.class, Titan::new){{
@@ -55,7 +59,7 @@ public class UnitTypes implements ContentList{
drag = 0.4f;
range = 10f;
weapon = Weapons.flamethrower;
health = 500;
health = 440;
}};
fortress = new UnitType("fortress", Fortress.class, Fortress::new){{
@@ -63,11 +67,11 @@ public class UnitTypes implements ContentList{
speed = 0.18f;
drag = 0.4f;
range = 10f;
weapon = Weapons.flamethrower;
weapon = Weapons.artillery;
health = 500;
}};
interceptor = new UnitType("interceptor", Interceptor.class, Interceptor::new){{
wraith = new UnitType("wraith", Wraith.class, Wraith::new){{
speed = 0.3f;
maxVelocity = 1.9f;
drag = 0.01f;
@@ -76,7 +80,7 @@ public class UnitTypes implements ContentList{
health = 70;
}};
monsoon = new UnitType("monsoon", Monsoon.class, Monsoon::new){{
ghoul = new UnitType("ghoul", Ghoul.class, Ghoul::new){{
health = 250;
speed = 0.2f;
maxVelocity = 1.4f;
@@ -85,7 +89,16 @@ public class UnitTypes implements ContentList{
weapon = Weapons.bomber;
}};
fabricator = new UnitType("fabricator", Fabricator.class, Fabricator::new){{
revenant = new UnitType("revenant", Revenant.class, Revenant::new){{
health = 250;
speed = 0.2f;
maxVelocity = 1.4f;
drag = 0.01f;
isFlying = true;
weapon = Weapons.bomber;
}};
phantom = new UnitType("phantom", Phantom.class, Phantom::new){{
isFlying = true;
drag = 0.01f;
speed = 0.2f;
@@ -95,7 +108,7 @@ public class UnitTypes implements ContentList{
health = 220;
buildPower = 0.9f;
minePower = 1.1f;
healSpeed = 0.09f;
healSpeed = 0.55f;
toMine = ObjectSet.with(Items.lead, Items.copper, Items.titanium);
}};
}

View File

@@ -7,7 +7,8 @@ import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Weapon;
public class Weapons implements ContentList{
public static Weapon blaster, blasterSmall, glaiveBlaster, droneBlaster, healBlaster, chainBlaster, shockgun, sapper, swarmer, bomber, bomberTrident, flakgun, flamethrower, missiles;
public static Weapon blaster, blasterSmall, glaiveBlaster, droneBlaster, healBlaster, chainBlaster, shockgun,
sapper, swarmer, bomber, bomberTrident, flakgun, flamethrower, missiles, artillery;
@Override
public void load(){
@@ -119,6 +120,15 @@ public class Weapons implements ContentList{
ammo = AmmoTypes.flamerThermite;
}};
artillery = new Weapon("artillery"){{
length = 1f;
reload = 60f;
roundrobin = true;
recoil = 1f;
ejectEffect = ShootFx.shellEjectMedium;
ammo = AmmoTypes.artilleryExplosive;
}};
sapper = new Weapon("sapper"){{
length = 1.5f;
reload = 12f;

View File

@@ -57,7 +57,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{
hasItems = true;
liquidCapacity = 60f;
craftTime = 80f;
craftTime = 60f;
output = Items.plastanium;
itemCapacity = 30;
size = 2;
@@ -67,7 +67,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
updateEffect = BlockFx.plasticburn;
consumes.liquid(Liquids.oil, 0.25f);
consumes.power(0.25f);
consumes.power(0.3f);
consumes.item(Items.titanium, 2);
}};

View File

@@ -61,6 +61,11 @@ public class DebugBlocks extends BlockList implements ContentList{
hasItems = true;
}
@Override
public boolean outputsItems(){
return true;
}
@Override
public void update(Tile tile){
SorterEntity entity = tile.entity();
@@ -81,6 +86,7 @@ public class DebugBlocks extends BlockList implements ContentList{
hasLiquids = true;
liquidCapacity = 100f;
configurable = true;
outputsLiquid = true;
}
@Override
@@ -114,10 +120,9 @@ public class DebugBlocks extends BlockList implements ContentList{
for(int i = 0; i < items.size; i++){
if(i == 0) continue;
final int f = i;
ImageButton button = cont.addImageButton("white", "toggle", 24, () -> {
ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "toggle", 24, () -> {
Call.setLiquidSourceLiquid(null, tile, items.get(f));
}).size(38, 42).padBottom(-5.1f).group(group).get();
button.getStyle().imageUpColor = items.get(i).color;
button.setChecked(entity.source.id == f);
if(i % 4 == 3){

View File

@@ -7,7 +7,7 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.defense.*;
public class DefenseBlocks extends BlockList implements ContentList{
public static Block copperWall, copperWallLarge, compositeWall, compositeWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
public static Block copperWall, copperWallLarge, denseAlloyWall, denseAlloyWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector, overdriveProjector, forceProjector, shockMine;
@Override
@@ -23,11 +23,11 @@ public class DefenseBlocks extends BlockList implements ContentList{
size = 2;
}};
compositeWall = new Wall("composite-wall"){{
denseAlloyWall = new Wall("dense-alloy-wall"){{
health = 110 * wallHealthMultiplier;
}};
compositeWallLarge = new Wall("composite-wall-large"){{
denseAlloyWallLarge = new Wall("dense-alloy-wall-large"){{
health = 110 * wallHealthMultiplier * 4;
size = 2;
}};

View File

@@ -19,7 +19,7 @@ public class LiquidBlocks extends BlockList implements ContentList{
rotaryPump = new Pump("rotary-pump"){{
shadow = "shadow-rounded-2";
pumpAmount = 0.25f;
pumpAmount = 0.2f;
consumes.power(0.015f);
liquidCapacity = 30f;
powerCapacity = 20f;
@@ -30,7 +30,7 @@ public class LiquidBlocks extends BlockList implements ContentList{
thermalPump = new Pump("thermal-pump"){{
shadow = "shadow-rounded-2";
pumpAmount = 0.55f;
pumpAmount = 0.3f;
consumes.power(0.03f);
liquidCapacity = 40f;
hasPower = true;

View File

@@ -22,7 +22,7 @@ public class PowerBlocks extends BlockList implements ContentList{
thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{
maxLiquidGenerate = 0.5f;
powerCapacity = 40f;
powerPerLiquid = 1.5f;
powerPerLiquid = 1f;
generateEffect = BlockFx.redgeneratespark;
size = 2;
}};

View File

@@ -12,7 +12,7 @@ public class StorageBlocks extends BlockList implements ContentList{
@Override
public void load(){
core = new CoreBlock("core"){{
health = 800;
health = 1400;
}};
vault = new Vault("vault"){{

View File

@@ -82,7 +82,7 @@ public class TurretBlocks extends BlockList implements ContentList{
};
}};
lancer = new LaserTurret("lancer"){{
lancer = new ChargeTurret("lancer"){{
range = 90f;
chargeTime = 60f;
chargeMaxDelay = 30f;
@@ -105,7 +105,7 @@ public class TurretBlocks extends BlockList implements ContentList{
arc = new PowerTurret("arc"){{
shootType = AmmoTypes.arc;
reload = 30f;
reload = 40f;
shootShake = 1f;
powerUsed = 5f;
powerCapacity = 30f;
@@ -197,6 +197,8 @@ public class TurretBlocks extends BlockList implements ContentList{
rotatespeed = 10f;
inaccuracy = 13f;
shootCone = 30f;
health = 145 * size * size;
}};
fuse = new ItemTurret("fuse"){{
@@ -208,19 +210,45 @@ public class TurretBlocks extends BlockList implements ContentList{
recoil = 5f;
restitution = 0.1f;
size = 3;
health = 155 * size * size;
}};
spectre = new ItemTurret("spectre"){{
ammoTypes = new AmmoType[]{AmmoTypes.bulletCopper, AmmoTypes.bulletDense, AmmoTypes.bulletPyratite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
reload = 25f;
restitution = 0.03f;
ammoUseEffect = ShootFx.shellEjectSmall;
spectre = new DoubleTurret("spectre"){{
ammoTypes = new AmmoType[]{AmmoTypes.bulletDenseBig, AmmoTypes.bulletPyratiteBig, AmmoTypes.bulletThoriumBig};
reload = 6f;
coolantMultiplier = 0.5f;
maxCoolantUsed = 1.5f;
restitution = 0.1f;
ammoUseEffect = ShootFx.shellEjectBig;
range = 200f;
inaccuracy = 3f;
recoil = 3f;
xRand = 3f;
shotWidth = 4f;
shootShake = 2f;
shots = 2;
size = 4;
shootCone = 24f;
health = 155 * size * size;
}};
meltdown = new PowerTurret("meltdown"){{
meltdown = new LaserTurret("meltdown"){{
shootType = AmmoTypes.meltdownLaser;
shootEffect = ShootFx.shootBigSmoke2;
shootCone = 40f;
recoil = 4f;
size = 4;
shootShake = 2f;
powerUsed = 60f;
powerCapacity = 120f;
range = 160f;
reload = 200f;
firingMoveFract = 0.1f;
shootDuration = 220f;
health = 165 * size * size;
}};
}
}

View File

@@ -8,38 +8,40 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.units.*;
public class UnitBlocks extends BlockList implements ContentList{
public static Block repairPoint, dronePad,
fabricatorPad, interceptorPad, monsoonPad, daggerPad, titanPad,
reconstructor, commandCenter;
public static Block
spiritFactory, phantomFactory,
wraithFactory, ghoulFactory, revenantFactory,
daggerFactory, titanFactory,
reconstructor, repairPoint, commandCenter;
@Override
public void load(){
dronePad = new UnitPad("drone-pad"){{
type = UnitTypes.drone;
spiritFactory = new UnitFactory("spirit-factory"){{
type = UnitTypes.spirit;
produceTime = 5700;
size = 2;
consumes.power(0.08f);
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30)});
}};
fabricatorPad = new UnitPad("fabricator-pad"){{
type = UnitTypes.fabricator;
phantomFactory = new UnitFactory("phantom-factory"){{
type = UnitTypes.phantom;
produceTime = 7300;
size = 2;
consumes.power(0.2f);
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80)});
}};
interceptorPad = new UnitPad("interceptor-pad"){{
type = UnitTypes.interceptor;
wraithFactory = new UnitFactory("wraith-factory"){{
type = UnitTypes.wraith;
produceTime = 1800;
size = 2;
consumes.power(0.1f);
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10), new ItemStack(Items.titanium, 10)});
}};
monsoonPad = new UnitPad("monsoon-pad"){{
type = UnitTypes.monsoon;
ghoulFactory = new UnitFactory("ghoul-factory"){{
type = UnitTypes.ghoul;
produceTime = 3600;
size = 3;
consumes.power(0.2f);
@@ -47,7 +49,16 @@ public class UnitBlocks extends BlockList implements ContentList{
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 30), new ItemStack(Items.plastanium, 20)});
}};
daggerPad = new UnitPad("dagger-pad"){{
revenantFactory = new UnitFactory("revenant-factory"){{
type = UnitTypes.revenant;
produceTime = 8000;
size = 4;
consumes.power(0.3f);
shadow = "shadow-round-3";
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 80), new ItemStack(Items.plastanium, 50)});
}};
daggerFactory = new UnitFactory("dagger-factory"){{
type = UnitTypes.dagger;
produceTime = 1700;
size = 2;
@@ -55,7 +66,7 @@ public class UnitBlocks extends BlockList implements ContentList{
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10), new ItemStack(Items.copper, 10)});
}};
titanPad = new UnitPad("titan-pad"){{
titanFactory = new UnitFactory("titan-factory"){{
type = UnitTypes.titan;
produceTime = 3400;
size = 3;

View File

@@ -2,53 +2,53 @@ package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.content.Mechs;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.units.MechFactory;
import io.anuke.mindustry.world.blocks.units.MechPad;
public class UpgradeBlocks extends BlockList{
public static Block deltaFactory, tauFactory, omegaFactory, dartFactory, javelinFactory, tridentFactory, glaiveFactory;
public static Block deltaPad, tauPad, omegaPad, dartPad, javelinPad, tridentPad, glaivePad;
@Override
public void load(){
deltaFactory = new MechFactory("delta-mech-factory"){{
deltaPad = new MechPad("delta-mech-pad"){{
mech = Mechs.delta;
size = 2;
powerCapacity = 70f;
}};
tauFactory = new MechFactory("tau-mech-factory"){{
tauPad = new MechPad("tau-mech-pad"){{
mech = Mechs.tau;
size = 2;
powerCapacity = 100f;
}};
omegaFactory = new MechFactory("omega-mech-factory"){{
omegaPad = new MechPad("omega-mech-pad"){{
mech = Mechs.omega;
size = 3;
powerCapacity = 120f;
}};
dartFactory = new MechFactory("dart-ship-factory"){{
dartPad = new MechPad("dart-ship-pad"){{
mech = Mechs.dart;
size = 2;
powerCapacity = 50f;
shadow = "shadow-rounded-2";
}};
javelinFactory = new MechFactory("javelin-ship-factory"){{
javelinPad = new MechPad("javelin-ship-pad"){{
mech = Mechs.javelin;
size = 2;
powerCapacity = 80f;
shadow = "shadow-rounded-2";
}};
tridentFactory = new MechFactory("trident-ship-factory"){{
tridentPad = new MechPad("trident-ship-pad"){{
mech = Mechs.trident;
size = 2;
powerCapacity = 100f;
shadow = "shadow-rounded-2";
}};
glaiveFactory = new MechFactory("glaive-ship-factory"){{
glaivePad = new MechPad("glaive-ship-pad"){{
mech = Mechs.glaive;
size = 3;
powerCapacity = 120f;

View File

@@ -8,7 +8,7 @@ import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
public class StandardBullets extends BulletList implements ContentList{
public static BulletType copper, dense, thorium, homing, tracer, mechSmall, glaive;
public static BulletType copper, dense, thorium, homing, tracer, mechSmall, glaive, denseBig, thoriumBig, tracerBig;
@Override
public void load(){
@@ -76,5 +76,33 @@ public class StandardBullets extends BulletList implements ContentList{
despawneffect = BulletFx.hitBulletSmall;
}
};
denseBig = new BasicBulletType(7f, 42, "bullet"){
{
bulletWidth = 15f;
bulletHeight = 21f;
armorPierce = 0.2f;
}
};
thoriumBig = new BasicBulletType(8f, 65, "bullet"){
{
bulletWidth = 16f;
bulletHeight = 23f;
armorPierce = 0.5f;
}
};
tracerBig = new BasicBulletType(7f, 38, "bullet"){
{
bulletWidth = 16f;
bulletHeight = 21f;
frontColor = Palette.lightishOrange;
backColor = Palette.lightOrange;
incendSpread = 3f;
incendAmount = 2;
incendChance = 0.3f;
}
};
}
}

View File

@@ -12,7 +12,6 @@ import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.entities.bullet.LiquidBulletType;
import io.anuke.mindustry.entities.effect.Fire;
import io.anuke.mindustry.entities.effect.ItemDrop;
import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.Palette;
@@ -20,10 +19,7 @@ import io.anuke.mindustry.world.Tile;
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.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.graphics.Shapes;
import io.anuke.ucore.graphics.*;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
@@ -31,7 +27,7 @@ import static io.anuke.mindustry.Vars.content;
import static io.anuke.mindustry.Vars.world;
public class TurretBullets extends BulletList implements ContentList{
public static BulletType fireball, basicFlame, lancerLaser, fuseShot, waterShot, cryoShot, lavaShot, oilShot, lightning, driverBolt, healBullet, arc;
public static BulletType fireball, basicFlame, lancerLaser, meltdownLaser, fuseShot, waterShot, cryoShot, lavaShot, oilShot, lightning, driverBolt, healBullet, arc;
@Override
public void load(){
@@ -161,6 +157,56 @@ public class TurretBullets extends BulletList implements ContentList{
}
};
meltdownLaser = new BulletType(0.001f, 26){
Color tmpColor = new Color();
Color[] colors = {Color.valueOf("ec745855"), Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.WHITE};
float[] tscales = {1f, 0.7f, 0.5f, 0.2f};
float[] strokes = {2f, 1.5f, 1f, 0.3f};
float[] lenscales = {1f, 1.12f, 1.15f, 1.17f};
float length = 200f;
{
hiteffect = BulletFx.hitMeltdown;
despawneffect = Fx.none;
hitsize = 4;
drawSize = 420f;
lifetime = 16f;
pierce = true;
}
@Override
public void update(Bullet b){
if(b.timer.get(1, 5f)){
Damage.collideLine(b, b.getTeam(), hiteffect, b.x, b.y, b.angle(), length);
}
Effects.shake(1f, 1f, b.x, b.y);
}
@Override
public void hit(Bullet b, float hitx, float hity){
Effects.effect(hiteffect, colors[2], hitx, hity);
if(Mathf.chance(0.4)){
Fire.create(world.tileWorld(hitx+Mathf.range(5f), hity+Mathf.range(5f)));
}
}
@Override
public void draw(Bullet b){
float baseLen = (length) * b.fout();
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)));
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.lineAngle(b.x + vector.x, b.y + vector.y, b.angle(), baseLen * lenscales[i], CapStyle.none);
}
}
Draw.reset();
}
};
fuseShot = new BulletType(0.01f, 70){
int rays = 3;
float raySpace = 2f;
@@ -345,8 +391,7 @@ public class TurretBullets extends BulletList implements ContentList{
int amountDropped = Mathf.random(0, data.items[i]);
if(amountDropped > 0){
float angle = b.angle() + Mathf.range(100f);
float vs = Mathf.random(0f, 4f);
ItemDrop.create(content.item(i), amountDropped, b.x, b.y, Angles.trnsx(angle, vs), Angles.trnsy(angle, vs));
Effects.effect(EnvironmentFx.dropItem, Color.WHITE, b.x, b.y, angle, content.item(i));
}
}
}

View File

@@ -11,7 +11,7 @@ import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class BulletFx extends FxList implements ContentList{
public static Effect hitBulletSmall, hitFuse, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, despawn, flakExplosion, blastExplosion, plasticExplosion,
public static Effect hitBulletSmall, hitFuse, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, hitMeltdown, despawn, flakExplosion, blastExplosion, plasticExplosion,
artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig, plasticExplosionFlak;
@Override
@@ -101,6 +101,18 @@ public class BulletFx extends FxList implements ContentList{
Draw.reset();
});
hitMeltdown = new Effect(12, e -> {
Draw.color(Palette.meltdownHit);
Lines.stroke(e.fout() * 2f);
Angles.randLenVectors(e.id, 6, e.finpow() * 18f, e.rotation, 360f, (x, y) -> {
float ang = Mathf.atan2(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f);
});
Draw.reset();
});
hitLaser = new Effect(8, e -> {
Draw.color(Color.WHITE, Palette.heal, e.fin());
Lines.stroke(0.5f + e.fout());

View File

@@ -2,8 +2,9 @@ package io.anuke.mindustry.content.fx;
import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.graphics.Palette;
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;
@@ -11,7 +12,7 @@ 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;
public static Effect burning, fire, smoke, steam, fireballsmoke, ballfire, freezing, melting, wet, oily, overdriven, dropItem;
@Override
public void load(){
@@ -125,5 +126,12 @@ public class EnvironmentFx extends FxList implements ContentList{
Draw.color();
});
dropItem = new Effect(20f, e -> {
float length = 20f * e.finpow();
float size = 7f * e.fout();
Draw.rect(((Item) e.data).region, e.x + Angles.trnsx(e.rotation, length), e.y + Angles.trnsy(e.rotation, length), size, size);
});
}
}

View File

@@ -11,7 +11,6 @@ import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.entities.effect.Fire;
import io.anuke.mindustry.entities.effect.ItemDrop;
import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.entities.effect.Puddle;
import io.anuke.mindustry.entities.traits.TypeTrait;
@@ -202,6 +201,9 @@ public class ContentLoader{
if(id < 0) id += 256;
if(temporaryMapper != null && temporaryMapper[type.ordinal()] != null && temporaryMapper[type.ordinal()].length != 0){
if(temporaryMapper[type.ordinal()][id] == null){
return getByID(type, 0); //default value is always ID 0
}
return (T)temporaryMapper[type.ordinal()][id];
}
@@ -263,7 +265,6 @@ public class ContentLoader{
*/
private void registerTypes(){
TypeTrait.registerType(Player.class, Player::new);
TypeTrait.registerType(ItemDrop.class, ItemDrop::new);
TypeTrait.registerType(Fire.class, Fire::new);
TypeTrait.registerType(Puddle.class, Puddle::new);
TypeTrait.registerType(Bullet.class, Bullet::new);

View File

@@ -131,7 +131,6 @@ public class Logic extends Module{
Entities.update(bulletGroup);
Entities.update(fireGroup);
Entities.update(playerGroup);
Entities.update(itemGroup);
//effect group only contains item drops in the headless version, update it!
if(headless){
@@ -145,7 +144,6 @@ public class Logic extends Module{
}
EntityPhysics.collideGroups(bulletGroup, playerGroup);
EntityPhysics.collideGroups(itemGroup, playerGroup);
world.pathfinder().update();
}

View File

@@ -246,17 +246,6 @@ public class Renderer extends RendererModule{
blocks.drawBlocks(Layer.overlay);
if(itemGroup.size() > 0){
Graphics.surface(effectSurface);
drawAndInterpolate(itemGroup);
Graphics.surface();
Draw.color(0, 0, 0, 0.2f);
Draw.rect(effectSurface, -1, -1);
Draw.color();
Draw.rect(effectSurface, 0, 0);
}
drawAllTeams(false);
blocks.skipLayer(Layer.turret);
@@ -301,10 +290,6 @@ public class Renderer extends RendererModule{
float trnsX = -12, trnsY = -13;
//Graphics.end();
//Core.batch.getTransformMatrix().translate(trnsX, trnsY, 0);
//Graphics.begin();
for(EntityGroup<? extends BaseUnit> group : unitGroups){
if(!group.isEmpty()){
drawAndInterpolate(group, unit -> unit.isFlying() && !unit.isDead(), baseUnit -> baseUnit.drawShadow(trnsX, trnsY));
@@ -315,11 +300,6 @@ public class Renderer extends RendererModule{
drawAndInterpolate(playerGroup, unit -> unit.isFlying() && !unit.isDead(), player -> player.drawShadow(trnsX, trnsY));
}
//Graphics.end();
//Core.batch.getTransformMatrix().translate(-trnsX, -trnsY, 0);
//Graphics.begin();
//TODO this actually isn't necessary
Draw.color(0, 0, 0, 0.15f);
Graphics.flushSurface();
Draw.color();

View File

@@ -117,7 +117,7 @@ public class UI extends SceneModule{
font.getData().setScale(Vars.fontScale);
font.getData().down += Unit.dp.scl(4f);
font.getData().lineHeight -= Unit.dp.scl(4.3f);
}, skin.font(), skin.getFont("default-font-chat"), skin.getFont("korean"), skin.getFont("trad-chinese"), skin.getFont("simp-chinese"));
}, skin.font(), skin.getFont("default-font-chat"), skin.getFont("trad-chinese"), skin.getFont("simp-chinese"));
}
@Override

View File

@@ -572,10 +572,6 @@ public class MapEditorDialog extends Dialog implements Disposable{
continue;
}
if(Recipe.getByResult(block) != null){
continue;
}
if(Recipe.getByResult(block) != null && Recipe.getByResult(block).desktopOnly && mobile){
continue;
}

View File

@@ -90,7 +90,7 @@ public class Damage{
Tile tile = world.tile(cx, cy);
if(tile != null && tile.entity != null && tile.target().getTeamID() != team.ordinal() && tile.entity.collide(hitter)){
tile.entity.collision(hitter);
Effects.effect(effect, tile.worldx(), tile.worldy());
hitter.getBulletType().hit(hitter, tile.worldx(), tile.worldy());
}
return false;
});

View File

@@ -10,7 +10,6 @@ import io.anuke.annotations.Annotations.Remote;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.Mechs;
import io.anuke.mindustry.content.fx.UnitFx;
import io.anuke.mindustry.entities.effect.ItemDrop;
import io.anuke.mindustry.entities.effect.ScorchDecal;
import io.anuke.mindustry.entities.traits.*;
import io.anuke.mindustry.game.Team;
@@ -102,6 +101,11 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
player.onDeath();
}
@Override
public float getDrag(){
return mech.drag;
}
@Override
public Timer getTimer(){
return timer;
@@ -217,11 +221,6 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
}
}
@Override
public boolean collides(SolidTrait other){
return super.collides(other) || other instanceof ItemDrop;
}
@Override
public void set(float x, float y){
this.x = x;
@@ -431,6 +430,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
//region update methods
float lastx, lasty;
@Override
public void update(){
hitTime -= Timers.delta();

View File

@@ -53,7 +53,9 @@ public class Predict{
* See {@link #intercept(float, float, float, float, float, float, float)}.
*/
public static Vector2 intercept(TargetTrait src, TargetTrait dst, float v){
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), dst.getVelocity().x - src.getVelocity().x, dst.getVelocity().x - src.getVelocity().y, v);
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(),
dst.getTargetVelocityX() - src.getTargetVelocityX(),
dst.getTargetVelocityY() - src.getTargetVelocityY(), v);
}
private static Vector2 quad(float a, float b, float c){

View File

@@ -207,13 +207,15 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
/**Updates velocity and status effects.*/
public void updateVelocityStatus(float drag, float maxVelocity){
Floor floor = getFloorOn();
if(isCarried()){ //carried units do not take into account velocity normally
set(carrier.getX(), carrier.getY());
velocity.set(carrier.getVelocity());
return;
}
Floor floor = getFloorOn();
Tile tile = world.tileWorld(x, y);
status.update(this);

View File

@@ -5,6 +5,7 @@ import com.badlogic.gdx.utils.TimeUtils;
import io.anuke.annotations.Annotations.Loc;
import io.anuke.annotations.Annotations.Remote;
import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.entities.traits.AbsorbTrait;
import io.anuke.mindustry.entities.traits.SyncTrait;
import io.anuke.mindustry.entities.traits.TeamTrait;
import io.anuke.mindustry.game.Team;
@@ -15,6 +16,7 @@ import io.anuke.ucore.entities.impl.BulletEntity;
import io.anuke.ucore.entities.trait.Entity;
import io.anuke.ucore.entities.trait.SolidTrait;
import io.anuke.ucore.entities.trait.VelocityTrait;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Pooling;
import io.anuke.ucore.util.Timer;
@@ -22,13 +24,12 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import static io.anuke.mindustry.Vars.bulletGroup;
import static io.anuke.mindustry.Vars.content;
import static io.anuke.mindustry.Vars.world;
import static io.anuke.mindustry.Vars.*;
public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncTrait{
public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncTrait, AbsorbTrait{
private static Vector2 vector = new Vector2();
public Timer timer = new Timer(3);
private float lifeScl;
private Team team;
private Object data;
private boolean supressCollision, supressOnce, initialized;
@@ -37,23 +38,23 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
public Bullet(){
}
public static void create(BulletType type, TeamTrait owner, float x, float y, float angle){
create(type, owner, owner.getTeam(), x, y, angle);
public static Bullet create(BulletType type, TeamTrait owner, float x, float y, float angle){
return create(type, owner, owner.getTeam(), x, y, angle);
}
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle){
create(type, owner, team, x, y, angle, 1f);
public static Bullet create(BulletType type, Entity owner, Team team, float x, float y, float angle){
return create(type, owner, team, x, y, angle, 1f);
}
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl){
create(type, owner, team, x, y, angle, velocityScl, 1f, null);
public static Bullet create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl){
return create(type, owner, team, x, y, angle, velocityScl, 1f, null);
}
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl){
create(type, owner, team, x, y, angle, velocityScl, lifetimeScl, null);
public static Bullet create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl){
return create(type, owner, team, x, y, angle, velocityScl, lifetimeScl, null);
}
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl, Object data){
public static Bullet create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl, Object data){
Bullet bullet = Pooling.obtain(Bullet.class, Bullet::new);
bullet.type = type;
bullet.owner = owner;
@@ -67,7 +68,7 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
bullet.team = team;
bullet.type = type;
bullet.time(type.lifetime() * (1f - lifetimeScl));
bullet.lifeScl = lifetimeScl;
//translate bullets backwards, purely for visual reasons
float backDelta = Timers.delta();
@@ -78,14 +79,15 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
bullet.set(x, y);
bullet.add();
return bullet;
}
public static void create(BulletType type, Bullet parent, float x, float y, float angle){
create(type, parent.owner, parent.team, x, y, angle);
public static Bullet create(BulletType type, Bullet parent, float x, float y, float angle){
return create(type, parent.owner, parent.team, x, y, angle);
}
public static void create(BulletType type, Bullet parent, float x, float y, float angle, float velocityScl){
create(type, parent.owner, parent.team, x, y, angle, velocityScl);
public static Bullet create(BulletType type, Bullet parent, float x, float y, float angle, float velocityScl){
return create(type, parent.owner, parent.team, x, y, angle, velocityScl);
}
@Remote(called = Loc.server)
@@ -107,6 +109,10 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
remove();
}
public BulletType getBulletType(){
return type;
}
public void resetOwner(Entity entity, Team team){
this.owner = entity;
this.team = team;
@@ -124,6 +130,11 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
this.data = data;
}
@Override
public float drawSize(){
return type.drawSize;
}
@Override
public float getDamage(){
if(owner instanceof Unit){
@@ -168,11 +179,6 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
type.draw(this);
}
@Override
public float drawSize(){
return 8;
}
@Override
public boolean collides(SolidTrait other){
return type.collides && super.collides(other) && !supressCollision;
@@ -225,6 +231,9 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
@Override
protected void updateLife(){
time += Timers.delta() * 1f/(lifeScl);
time = Mathf.clamp(time, 0, type.lifetime());
if(time >= type.lifetime){
if(!supressCollision) type.despawned(this);
remove();
@@ -235,6 +244,7 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
public void reset(){
super.reset();
timer.clear();
lifeScl = 1f;
team = null;
data = null;
supressCollision = false;

View File

@@ -1,250 +0,0 @@
package io.anuke.mindustry.entities.effect;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Pool.Poolable;
import io.anuke.annotations.Annotations.Loc;
import io.anuke.annotations.Annotations.Remote;
import io.anuke.mindustry.content.fx.UnitFx;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.entities.traits.SaveTrait;
import io.anuke.mindustry.entities.traits.SyncTrait;
import io.anuke.mindustry.entities.traits.TargetTrait;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.gen.Call;
import io.anuke.mindustry.net.Interpolator;
import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.entities.EntityGroup;
import io.anuke.ucore.entities.impl.SolidEntity;
import io.anuke.ucore.entities.trait.DrawTrait;
import io.anuke.ucore.entities.trait.SolidTrait;
import io.anuke.ucore.entities.trait.TimeTrait;
import io.anuke.ucore.entities.trait.VelocityTrait;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.util.Mathf;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import static io.anuke.mindustry.Vars.*;
public class ItemDrop extends SolidEntity implements SaveTrait, SyncTrait, DrawTrait, VelocityTrait, TimeTrait, TargetTrait, Poolable{
private static final float sinkLifetime = 80f;
private Interpolator interpolator = new Interpolator();
private Item item;
private int amount;
private Vector2 velocity = new Vector2();
private float time;
private float sinktime;
/**
* Internal use only!
*/
public ItemDrop(){
hitbox.setSize(5f);
hitboxTile.setSize(5f);
}
public static ItemDrop create(Item item, int amount, float x, float y, float angle){
ItemDrop drop = new ItemDrop();
drop.item = item;
drop.amount = amount;
drop.velocity.set(4f, 0f).rotate(angle);
drop.setNet(x, y);
drop.add();
return drop;
}
public static void create(Item item, int amount, float x, float y, float velocityX, float velocityY){
create(item, amount, x, y, 0).getVelocity().set(velocityX, velocityY);
}
@Remote(called = Loc.server)
public static void onPickup(int itemid){
ItemDrop drop = itemGroup.getByID(itemid);
if(drop != null){
Effects.effect(UnitFx.pickup, drop);
}
itemGroup.removeByID(itemid);
if(Net.client()){
netClient.addRemovedEntity(itemid);
}
}
public Item getItem(){
return item;
}
public int getAmount(){
return amount;
}
@Override
public boolean isDead(){
return !isAdded();
}
@Override
public Team getTeam(){
return Team.none;
}
@Override
public float lifetime(){
return 60 * 60;
}
@Override
public void time(float time){
this.time = time;
}
@Override
public float time(){
return time;
}
@Override
public Vector2 getVelocity(){
return velocity;
}
@Override
public boolean collides(SolidTrait other){
return other instanceof Player && time > 20f;
}
@Override
public void collision(SolidTrait other, float x, float y){
Unit player = (Unit) other;
if(player.inventory.canAcceptItem(item, 1)){
int used = Math.min(amount, player.inventory.capacity() - player.inventory.getItem().amount);
player.inventory.addItem(item, used);
amount -= used;
if(amount <= 0){
Call.onPickup(getID());
}
}
}
@Override
public void draw(){
float size = itemSize * (1f - sinktime / sinkLifetime) * (1f - Mathf.curve(fin(), 0.98f));
Tile tile = world.tileWorld(x, y);
Draw.color(Color.WHITE, tile == null || !tile.floor().isLiquid ? Color.WHITE : tile.floor().liquidColor, sinktime / sinkLifetime);
Draw.rect(item.region, x, y, size, size);
int stored = Mathf.clamp(amount / 6, 1, 8);
for(int i = 0; i < stored; i++){
float px = stored == 1 ? 0 : (int)Mathf.randomSeedRange(i + 1, 4f);
float py = stored == 1 ? 0 : (int)Mathf.randomSeedRange(i + 2, 4f);
Draw.rect(item.region, x + px, y + py, size, size);
}
Draw.color();
}
@Override
public void update(){
if(Net.client()){
interpolate();
}else{
updateVelocity(0.2f);
updateTime();
if(time >= lifetime()){
Call.onPickup(getID());
}
}
Tile tile = world.tileWorld(x, y);
if(tile != null && tile.solid()){
Call.onPickup(getID());
}
if(tile != null && tile.floor().isLiquid){
sinktime += Timers.delta();
if(Mathf.chance(0.04 * Timers.delta())){
Effects.effect(tile.floor().drownUpdateEffect, tile.floor().liquidColor, x, y);
}
if(sinktime >= sinkLifetime){
remove();
}
}else{
sinktime = 0f;
}
}
@Override
public void reset(){
time = 0f;
interpolator.reset();
}
@Override
public Interpolator getInterpolator(){
return interpolator;
}
@Override
public float drawSize(){
return 10;
}
@Override
public float fin() {
return time()/lifetime();
}
@Override
public EntityGroup targetGroup(){
return itemGroup;
}
@Override
public void writeSave(DataOutput data) throws IOException{
data.writeFloat(x);
data.writeFloat(y);
data.writeByte(item.id);
data.writeShort(amount);
}
@Override
public void readSave(DataInput data) throws IOException{
x = data.readFloat();
y = data.readFloat();
item = content.item(data.readByte());
amount = data.readShort();
add();
}
@Override
public void write(DataOutput data) throws IOException{
data.writeFloat(x);
data.writeFloat(y);
data.writeByte(item.id);
data.writeShort(amount);
}
@Override
public void read(DataInput data, long time) throws IOException{
interpolator.read(x, y, data.readFloat(), data.readFloat(), time);
item = content.item(data.readByte());
amount = data.readShort();
}
}

View File

@@ -9,7 +9,9 @@ import io.anuke.annotations.Annotations.Loc;
import io.anuke.annotations.Annotations.Remote;
import io.anuke.mindustry.content.StatusEffects;
import io.anuke.mindustry.entities.Units;
import io.anuke.mindustry.entities.traits.AbsorbTrait;
import io.anuke.mindustry.entities.traits.SyncTrait;
import io.anuke.mindustry.entities.traits.TeamTrait;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.gen.Call;
import io.anuke.mindustry.graphics.Palette;
@@ -17,9 +19,10 @@ import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.entities.EntityGroup;
import io.anuke.ucore.entities.impl.TimedEntity;
import io.anuke.ucore.entities.impl.SolidEntity;
import io.anuke.ucore.entities.trait.DrawTrait;
import io.anuke.ucore.entities.trait.SolidTrait;
import io.anuke.ucore.entities.trait.TimeTrait;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
@@ -34,17 +37,24 @@ import java.io.IOException;
import static io.anuke.mindustry.Vars.bulletGroup;
import static io.anuke.mindustry.Vars.world;
public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncTrait{
private static Array<SolidTrait> entities = new Array<>();
private static Rectangle rect = new Rectangle();
private static Rectangle hitrect = new Rectangle();
public class Lightning extends SolidEntity implements Poolable, DrawTrait, SyncTrait, AbsorbTrait, TeamTrait, TimeTrait{
private static final Array<SolidTrait> entities = new Array<>();
private static final Rectangle rect = new Rectangle();
private static final Rectangle hitrect = new Rectangle();
private static final float wetDamageMultiplier = 2;
private static final float step = 4f, range = 6f, attractRange = 20f;
private static int lastSeed = 0;
private static float angle;
private static float wetDamageMultiplier = 2;
private Array<Vector2> lines = new Array<>();
private Color color = Palette.lancerLaser;
private Lightning parent;
private SeedRandom random = new SeedRandom();
private float damage, time;
private int activeFrame;
private Effect effect;
private Team team;
/**For pooling use only. Do not call directly!*/
public Lightning(){
@@ -57,18 +67,17 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
/**Do not invoke!*/
@Remote(called = Loc.server)
public static void createLighting(int seed, Team team, Effect effect, Color color, float damage, float x, float y, float targetAngle, int length){
public static Lightning createLighting(int seed, Team team, Effect effect, Color color, float damage, float x, float y, float targetAngle, int length){
Lightning l = Pooling.obtain(Lightning.class, Lightning::new);
l.x = x;
l.y = y;
l.damage = damage;
l.effect = effect;
l.team = team;
l.random.setSeed(seed);
l.color = color;
float step = 4f;
float range = 6f;
float attractRange = 20f;
angle = targetAngle;
entities.clear();
@@ -77,10 +86,8 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
for(int i = 0; i < length; i++){
l.lines.add(new Vector2(x, y));
float fx = x, fy = y;
float x2 = x + Angles.trnsx(angle, step);
float y2 = y + Angles.trnsy(angle, step);
float fangle = angle;
angle += Mathf.range(15f);
rect.setSize(attractRange).setCenter(x, y);
@@ -90,32 +97,11 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
if(dst < attractRange){
angle = Mathf.slerp(angle, Angles.angle(x2, y2, entity.x, entity.y), (attractRange - dst) / attractRange / 4f);
}
entity.getHitbox(hitrect);
hitrect.x -= range / 2f;
hitrect.y -= range / 2f;
hitrect.width += range / 2f;
hitrect.height += range / 2f;
if(hitrect.contains(x2, y2) || hitrect.contains(fx, fy)){
float result = damage;
if(entity.hasEffect(StatusEffects.wet))
result = (result * wetDamageMultiplier);
entity.damage(result);
Effects.effect(effect, x2, y2, fangle);
}
});
if(l.random.chance(0.1f)){
createLighting(l.random.nextInt(), team, effect, color, damage, x2, y2, angle + l.random.range(30f), length / 3);
}
Tile tile = world.tileWorld(x, y);
if(tile != null && tile.entity != null && tile.getTeamID() != team.ordinal()){
Effects.effect(effect, x, y, fangle);
tile.entity.damage(damage/4f);
createLighting(l.random.nextInt(), team, effect, color, damage, x2, y2, angle + l.random.range(30f), length / 3)
.parent = l;
}
x = x2;
@@ -124,6 +110,41 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
l.lines.add(new Vector2(x, y));
l.add();
return l;
}
@Override
public void absorb(){
activeFrame = 99;
if(parent != null){
parent.absorb();
}
}
@Override
public boolean collides(SolidTrait other){
return false;
}
@Override
public void time(float time){
this.time = time;
}
@Override
public boolean canBeAbsorbed(){
return activeFrame < 3;
}
@Override
public float time(){
return time;
}
@Override
public float fin(){
return time/lifetime();
}
@Override
@@ -146,11 +167,45 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
return 10;
}
@Override
public Team getTeam(){
return team;
}
@Override
public void update(){
updateTime();
if(activeFrame == 2){
for(Vector2 vec : lines){
rect.setSize(range).setCenter(x, y);
Units.getNearbyEnemies(team, rect, unit -> {
unit.getHitbox(hitrect);
if(rect.overlaps(hitrect)){
unit.damage(damage * (unit.hasEffect(StatusEffects.wet) ? 2f : 1f));
Effects.effect(effect, vec.x, vec.y, 0f);
}
});
Tile tile = world.tileWorld(vec.x, vec.y);
if(tile != null && tile.entity != null && tile.getTeamID() != team.ordinal()){
Effects.effect(effect, vec.x, vec.y, 0f);
tile.entity.damage(damage/4f);
}
}
}
activeFrame ++;
}
@Override
public void reset(){
super.reset();
time = 0f;
color = Palette.lancerLaser;
lines.clear();
parent = null;
activeFrame = 0;
}
@Override
@@ -159,6 +214,11 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
Pooling.free(this);
}
@Override
public float getDamage(){
return damage/10f;
}
@Override
public void draw(){
float lx = x, ly = y;

View File

@@ -0,0 +1,12 @@
package io.anuke.mindustry.entities.traits;
import io.anuke.ucore.entities.trait.DamageTrait;
import io.anuke.ucore.entities.trait.Entity;
public interface AbsorbTrait extends Entity, TeamTrait, DamageTrait{
void absorb();
default boolean canBeAbsorbed(){
return true;
}
}

View File

@@ -24,10 +24,7 @@ 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.Geometry;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Translator;
import io.anuke.ucore.util.*;
import java.io.DataInput;
import java.io.DataOutput;
@@ -184,12 +181,7 @@ public interface BuilderTrait extends Entity{
setMineTile(null);
}
TileEntity core = unit.getClosestCore();
//if there is no core to build with, stop building!
if(core == null){
return;
}
Tile tile = world.tile(current.x, current.y);
@@ -208,6 +200,13 @@ public interface BuilderTrait extends Entity{
}
}
TileEntity core = unit.getClosestCore();
//if there is no core to build with, stop building!
if(core == null){
return;
}
//otherwise, update it.
BuildEntity entity = tile.entity();
@@ -238,19 +237,26 @@ public interface BuilderTrait extends Entity{
/**Do not call directly.*/
default void updateMining(Unit unit){
Tile tile = getMineTile();
TileEntity core = unit.getClosestCore();
if(tile.block() != Blocks.air || unit.distanceTo(tile.worldx(), tile.worldy()) > mineDistance || !unit.inventory.canAcceptItem(tile.floor().drops.item)){
if(core == null || tile.block() != Blocks.air || unit.distanceTo(tile.worldx(), tile.worldy()) > mineDistance || !unit.inventory.canAcceptItem(tile.floor().drops.item)){
setMineTile(null);
}else{
Item item = tile.floor().drops.item;
unit.rotation = Mathf.slerpDelta(unit.rotation, unit.angleTo(tile.worldx(), tile.worldy()), 0.4f);
if(unit.inventory.canAcceptItem(item) &&
Mathf.chance(Timers.delta() * (0.06 - item.hardness * 0.01) * getMinePower())){
Call.transferItemToUnit(item,
if(Mathf.chance(Timers.delta() * (0.06 - item.hardness * 0.01) * getMinePower())){
if(unit.distanceTo(core) < mineTransferRange && core.items.get(item) < core.tile.block().getMaximumAccepted(core.tile, item)){
Call.transferItemTo(item, 1,
tile.worldx() + Mathf.range(tilesize / 2f),
tile.worldy() + Mathf.range(tilesize / 2f), core.tile);
}else if(unit.inventory.canAcceptItem(item)){
Call.transferItemToUnit(item,
tile.worldx() + Mathf.range(tilesize / 2f),
tile.worldy() + Mathf.range(tilesize / 2f),
unit);
}
}
if(Mathf.chance(0.06 * Timers.delta())){

View File

@@ -2,6 +2,7 @@ package io.anuke.mindustry.entities.traits;
import io.anuke.mindustry.game.Team;
import io.anuke.ucore.entities.trait.PosTrait;
import io.anuke.ucore.entities.trait.SolidTrait;
import io.anuke.ucore.entities.trait.VelocityTrait;
/**
@@ -13,6 +14,22 @@ public interface TargetTrait extends PosTrait, VelocityTrait{
Team getTeam();
default float getTargetVelocityX(){
if(this instanceof SolidTrait){
return getX() - ((SolidTrait) this).lastPosition().x;
}else{
return getVelocity().x;
}
}
default float getTargetVelocityY(){
if(this instanceof SolidTrait){
return getY() - ((SolidTrait) this).lastPosition().y;
}else{
return getVelocity().y;
}
}
/**
* Whether this entity is a valid target.
*/

Some files were not shown because too many files have changed in this diff Show More