Re-definition of all ammo and new turrets

This commit is contained in:
Anuken
2018-05-28 12:28:50 -04:00
parent 83c3a80766
commit 857f36e01a
42 changed files with 985 additions and 850 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

View File

Before

Width:  |  Height:  |  Size: 682 B

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 827 B

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

@ -1,57 +0,0 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemType;
public class AmmoItems {
public static final Item
leadBullet = new Item("lead-bullet", Color.valueOf("8e85a2")){{
type = ItemType.ammo;
}},
armorPiercingBullet = new Item("armor-piercing-bullet", Color.valueOf("f9a3c7")){{
type = ItemType.ammo;
}},
homingBullet = new Item("homing-bullet", Color.valueOf("6a6c72")){{
type = ItemType.ammo;
}},
tracerBullet = new Item("tracer-bullet", Color.valueOf("ffe58b")){{
type = ItemType.ammo;
}},
compositeFlak = new Item("composite-flak", Color.valueOf("e9ead3")){{
type = ItemType.ammo;
}},
explosiveShell = new Item("explosive-shell", Color.valueOf("ff795e")){{
type = ItemType.ammo;
}},
fragShell = new Item("frag-shell", Color.valueOf("e9ead3")){{
type = ItemType.ammo;
}},
thoriumShell = new Item("thorium-shell", Color.valueOf("f9a3c7")){{
type = ItemType.ammo;
}},
swarmMissile = new Item("swarm-missile", Color.valueOf("ff795e")){{
type = ItemType.ammo;
}},
scytheMissile = new Item("scythe-missile", Color.valueOf("f9a3c7")){{
type = ItemType.ammo;
}},
incendiaryMortarShell = new Item("incendiary-mortar-shell", Color.valueOf("ffe58b")){{
type = ItemType.ammo;
}},
surgeMortarShell = new Item("surge-mortar-shell", Color.valueOf("bcddff")){{
type = ItemType.ammo;
}};
}

View File

@ -1,8 +1,6 @@
package io.anuke.mindustry.content;
import io.anuke.mindustry.content.bullets.ShellBullets;
import io.anuke.mindustry.content.bullets.StandardBullets;
import io.anuke.mindustry.content.bullets.TurretBullets;
import io.anuke.mindustry.content.bullets.*;
import io.anuke.mindustry.content.fx.ShootFx;
import io.anuke.mindustry.type.AmmoType;
@ -10,99 +8,146 @@ public class AmmoTypes {
//TODO add definitions for all ammo types
public static final AmmoType
basicIron = new AmmoType(Items.iron, StandardBullets.basicIron, 5){{
//bullets
bulletIron = new AmmoType(Items.iron, StandardBullets.iron, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
basicLead = new AmmoType(Items.lead, StandardBullets.basicLead, 5){{
bulletLead = new AmmoType(Items.lead, StandardBullets.lead, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
standardLead = new AmmoType(AmmoItems.leadBullet, StandardBullets.standardLead, 5){{
bulletSteel = new AmmoType(Items.steel, StandardBullets.steel, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
standardArmorPiercing = new AmmoType(AmmoItems.armorPiercingBullet, StandardBullets.standardArmorPiercing, 5){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}},
standardHoming = new AmmoType(AmmoItems.homingBullet, StandardBullets.standardHoming, 5){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}},
standardTracer = new AmmoType(AmmoItems.tracerBullet, StandardBullets.standardTracer, 5){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}},
basicLeadFlak = new AmmoType(Items.lead, StandardBullets.basicLeadFlak, 5){{
bulletThorium = new AmmoType(Items.thorium, StandardBullets.thorium, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
standardLeadFlak = new AmmoType(AmmoItems.leadBullet, StandardBullets.standardLeadFlak, 5){{
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
compositeFlak = new AmmoType(AmmoItems.compositeFlak, StandardBullets.compositeFlak, 5){{
bulletThermite = new AmmoType(Items.thermite, StandardBullets.tracer, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
//flak
flakLead = new AmmoType(Items.lead, FlakBullets.lead, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
flakExplosive = new AmmoType(Items.rdx, FlakBullets.explosive, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
flakPlastic = new AmmoType(Items.plastic, FlakBullets.plastic, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
flakSurge = new AmmoType(Items.densealloy, FlakBullets.surge, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
//shells
shellLead = new AmmoType(Items.lead, ShellBullets.lead, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
shellExplosive = new AmmoType(Items.rdx, ShellBullets.explosive, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
shellPlastic = new AmmoType(Items.plastic, ShellBullets.plastic, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
shellThorium = new AmmoType(Items.thorium, ShellBullets.thorium, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
//missiles
missileExplosive = new AmmoType(Items.rdx, MissileBullets.explosive, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
missileIncindiary = new AmmoType(Items.thermite, MissileBullets.incindiary, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
missileSurge = new AmmoType(Items.densealloy, MissileBullets.surge, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
//artillery
artilleryLead = new AmmoType(Items.lead, ArtilleryBullets.lead, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
artilleryThorium = new AmmoType(Items.thorium, ArtilleryBullets.thorium, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
artilleryPlastic = new AmmoType(Items.plastic, ArtilleryBullets.plastic, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
artilleryHoming = new AmmoType(Items.silicon, ArtilleryBullets.homing, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
artilleryIncindiary = new AmmoType(Items.thermite, ArtilleryBullets.incindiary, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
//flame
basicFlame = new AmmoType(Liquids.oil, TurretBullets.basicFlame, 0.3f){{
shootEffect = ShootFx.shootSmallFlame;
}},
basicLeadShell = new AmmoType(Items.lead, ShellBullets.basicLeadShell, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
explosiveFragShell = new AmmoType(AmmoItems.explosiveShell, ShellBullets.explosiveShell, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
fragShell = new AmmoType(AmmoItems.fragShell, ShellBullets.fragShell, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
standardThoriumShell = new AmmoType(AmmoItems.thoriumShell, ShellBullets.thoriumShell, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
swarmMissile = new AmmoType(AmmoItems.swarmMissile, ShellBullets.swarmMissile, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
scytheMissile = new AmmoType(AmmoItems.scytheMissile, ShellBullets.scytheMissile, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
incendiaryMortar = new AmmoType(AmmoItems.incendiaryMortarShell, ShellBullets.incendiaryMortar, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
surgeMortar = new AmmoType(AmmoItems.surgeMortarShell, ShellBullets.surgeMortar, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
//power
lancerLaser = new AmmoType(TurretBullets.lancerLaser),
lightning = new AmmoType(TurretBullets.lightning),
spectreLaser = new AmmoType(TurretBullets.lancerLaser),
meltdownLaser = new AmmoType(TurretBullets.lancerLaser),
fuseShotgun = new AmmoType(Items.iron, TurretBullets.fuseShot, 0.1f),
//liquid
oil = new AmmoType(Liquids.oil, TurretBullets.oilShot, 0.3f),
water = new AmmoType(Liquids.water, TurretBullets.waterShot, 0.3f),

View File

@ -33,6 +33,7 @@ public class Items {
}},
titanium = new Item("titanium", Color.valueOf("8da1e3")){{
type = ItemType.material;
hardness = 3;
}},
@ -62,12 +63,16 @@ public class Items {
}},
sand = new Item("sand", Color.valueOf("e3d39e")){{
fluxiness = 0.5f;
}},
rdx = new Item("rdx", Color.valueOf("ff795e")){{
flammability = 0.2f;
explosiveness = 0.6f;
}},
thermite = new Item("thermite", Color.valueOf("ff795e")){{
flammability = 0.7f;
explosiveness = 0.2f;
}};
}

View File

@ -42,6 +42,7 @@ public class Recipes {
new Recipe(weapon, WeaponBlocks.crux, new ItemStack(Items.steel, 25), new ItemStack(Items.titanium, 15));
new Recipe(weapon, WeaponBlocks.arc, new ItemStack(Items.steel, 20), new ItemStack(Items.titanium, 25), new ItemStack(Items.densealloy, 15));
new Recipe(weapon, WeaponBlocks.swarmer, new ItemStack(Items.steel, 80), new ItemStack(Items.titanium, 70), new ItemStack(Items.densealloy, 60));
new Recipe(weapon, WeaponBlocks.ripple, new ItemStack(Items.steel, 80), new ItemStack(Items.titanium, 70), new ItemStack(Items.densealloy, 60));
new Recipe(weapon, WeaponBlocks.fuse, new ItemStack(Items.steel, 70), new ItemStack(Items.titanium, 50), new ItemStack(Items.densealloy, 55));
new Recipe(weapon, WeaponBlocks.spectre, new ItemStack(Items.steel, 70), new ItemStack(Items.titanium, 50), new ItemStack(Items.densealloy, 55));
new Recipe(weapon, WeaponBlocks.meltdown, new ItemStack(Items.steel, 70), new ItemStack(Items.titanium, 50), new ItemStack(Items.densealloy, 55));

View File

@ -11,6 +11,6 @@ public class Weapons {
reload = 15f;
roundrobin = true;
ejectEffect = ShootFx.shellEjectSmall;
setAmmo(AmmoTypes.basicIron);
setAmmo(AmmoTypes.bulletIron);
}};
}

View File

@ -39,6 +39,7 @@ public class Blocks {
}},
space = new Floor("space") {{
placeableOn = false;
variants = 0;
cacheLayer = CacheLayer.space;
solid = true;
@ -62,6 +63,7 @@ public class Blocks {
}},
water = new Floor("water") {{
placeableOn = false;
liquidColor = Color.valueOf("546bb3");
speedMultiplier = 0.5f;
variants = 0;
@ -73,6 +75,7 @@ public class Blocks {
}},
lava = new Floor("lava") {{
placeableOn = false;
liquidColor = Color.valueOf("ed5334");
speedMultiplier = 0.2f;
damageTaken = 0.1f;
@ -85,6 +88,7 @@ public class Blocks {
}},
oil = new Floor("oil") {{
placeableOn = false;
liquidColor = Color.valueOf("292929");
status = StatusEffects.oiled;
statusIntensity = 1f;

View File

@ -15,14 +15,14 @@ public class WeaponBlocks{
public static Block
duo = new DoubleTurret("duo"){{
ammoTypes = new AmmoType[]{AmmoTypes.basicIron, AmmoTypes.basicLead, AmmoTypes.standardLead, AmmoTypes.standardTracer};
ammoTypes = new AmmoType[]{AmmoTypes.bulletIron, AmmoTypes.bulletLead, AmmoTypes.bulletSteel, AmmoTypes.bulletThermite};
reload = 25f;
restitution = 0.03f;
ammoUseEffect = ShootFx.shellEjectSmall;
}},
scatter = new BurstTurret("scatter") {{
ammoTypes = new AmmoType[]{AmmoTypes.basicLeadFlak, AmmoTypes.standardLeadFlak, AmmoTypes.compositeFlak};
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic};
ammoPerShot = 1;
shots = 3;
reload = 60f;
@ -39,9 +39,11 @@ public class WeaponBlocks{
shootCone = 50f;
ammoUseEffect = ShootFx.shellEjectSmall;
drawer = (tile, entity) -> {
Draw.rect(entity.target != null ? name + "-shoot" : name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
};
drawer = (tile, entity) -> Draw.rect(entity.target != null ? name + "-shoot" : name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
}},
hail = new ItemTurret("hail") {{
ammoTypes = new AmmoType[]{AmmoTypes.artilleryLead, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary};
}},
wave = new LiquidTurret("wave") {{
@ -67,7 +69,7 @@ public class WeaponBlocks{
crux = new ItemTurret("crux"){{
size = 2;
range = 100f;
ammoTypes = new AmmoType[]{AmmoTypes.basicLeadShell, AmmoTypes.explosiveFragShell, AmmoTypes.fragShell, AmmoTypes.standardThoriumShell};
ammoTypes = new AmmoType[]{AmmoTypes.shellExplosive, AmmoTypes.shellLead, AmmoTypes.shellPlastic, AmmoTypes.shellThorium};
reload = 70f;
restitution = 0.03f;
ammoEjectBack = 3f;
@ -122,21 +124,54 @@ public class WeaponBlocks{
size = 2;
}},
swarmer = new ItemTurret("missileturret") {{
ammoTypes = new AmmoType[]{AmmoTypes.basicLeadShell, AmmoTypes.explosiveFragShell, AmmoTypes.fragShell, AmmoTypes.standardThoriumShell};
swarmer = new ItemTurret("swarmer") {{
ammoTypes = new AmmoType[]{AmmoTypes.missileExplosive, AmmoTypes.missileIncindiary, AmmoTypes.missileSurge};
size = 2;
}},
fuse = new ItemTurret("fuse") {{
ammoTypes = new AmmoType[]{AmmoTypes.basicLeadShell, AmmoTypes.explosiveFragShell, AmmoTypes.fragShell, AmmoTypes.standardThoriumShell};
ripple = new ItemTurret("ripple") {{
ammoTypes = new AmmoType[]{AmmoTypes.artilleryLead, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryPlastic, AmmoTypes.artilleryThorium};
size = 3;
}},
spectre = new PowerTurret("spectre") {{
cyclone = new ItemTurret("cyclone") {{
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge};
size = 3;
}},
fuse = new ItemTurret("fuse") {{
//TODO make it use power
ammoTypes = new AmmoType[]{AmmoTypes.fuseShotgun};
size = 3;
}},
spectre = new LaserTurret("spectre") {{
range = 70f;
chargeTime = 70f;
chargeMaxDelay = 30f;
chargeEffects = 7;
shootType = AmmoTypes.spectreLaser;
recoil = 2f;
reload = 130f;
cooldown = 0.03f;
shootEffect = ShootFx.lancerLaserShoot;
smokeEffect = ShootFx.lancerLaserShootSmoke;
chargeEffect = ShootFx.lancerLaserCharge;
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
heatColor = Color.RED;
size = 3;
}},
eraser = new ItemTurret("eraser"){{
ammoTypes = new AmmoType[]{AmmoTypes.bulletIron, AmmoTypes.bulletLead, AmmoTypes.bulletSteel, AmmoTypes.bulletThermite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
reload = 25f;
restitution = 0.03f;
ammoUseEffect = ShootFx.shellEjectSmall;
size = 4;
}},
meltdown = new PowerTurret("meltdown") {{
size = 3;
shootType = AmmoTypes.meltdownLaser;
size = 4;
}};
}

View File

@ -0,0 +1,81 @@
package io.anuke.mindustry.content.bullets;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.entities.bullet.BasicBulletType;
import io.anuke.mindustry.entities.bullet.BulletType;
public class ArtilleryBullets {
public static final BulletType
lead = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
},
thorium = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
},
plastic = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
},
homing = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
},
incindiary = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
},
surge = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};
}

View File

@ -0,0 +1,36 @@
package io.anuke.mindustry.content.bullets;
import io.anuke.mindustry.entities.bullet.BasicBulletType;
import io.anuke.mindustry.entities.bullet.BulletType;
public class FlakBullets {
public static final BulletType
lead = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
plastic = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
explosive = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
surge = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
}

View File

@ -0,0 +1,29 @@
package io.anuke.mindustry.content.bullets;
import io.anuke.mindustry.entities.bullet.BasicBulletType;
import io.anuke.mindustry.entities.bullet.BulletType;
public class MissileBullets {
public static final BulletType
explosive = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
incindiary = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
surge = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
}

View File

@ -8,20 +8,20 @@ import io.anuke.mindustry.entities.bullet.BulletType;
public class ShellBullets {
public static final BulletType
basicLeadShell = new BasicBulletType(3f, 0) {
lead = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = basicLeadShard;
fragBullet = leadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
},
basicLeadShard = new BasicBulletType(3f, 0) {
leadShard = new BasicBulletType(3f, 0) {
{
drag = 0.1f;
hiteffect = Fx.none;
@ -34,66 +34,14 @@ public class ShellBullets {
}
},
explosiveShell = new BasicBulletType(3f, 0) {
thorium = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = basicLeadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
},
explosiveShard = new BasicBulletType(3f, 0) {
{
drag = 0.1f;
hiteffect = Fx.none;
despawneffect = Fx.none;
hitsize = 4;
lifetime = 20f;
bulletWidth = 9f;
bulletHeight = 11f;
bulletShrink = 1f;
}
},
fragShell = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = basicLeadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
},
fragShard = new BasicBulletType(3f, 0) {
{
drag = 0.1f;
hiteffect = Fx.none;
despawneffect = Fx.none;
hitsize = 4;
lifetime = 20f;
bulletWidth = 9f;
bulletHeight = 11f;
bulletShrink = 1f;
}
},
thoriumShell = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = basicLeadShard;
fragBullet = leadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
@ -112,53 +60,66 @@ public class ShellBullets {
}
},
swarmMissile = new BasicBulletType(3f, 0) {
plastic = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = basicLeadShard;
fragBullet = leadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
},
scytheMissile = new BasicBulletType(3f, 0) {
plasticShard = new BasicBulletType(3f, 0) {
{
drag = 0.1f;
hiteffect = Fx.none;
despawneffect = Fx.none;
hitsize = 4;
lifetime = 20f;
bulletWidth = 9f;
bulletHeight = 11f;
bulletShrink = 1f;
}
},
explosive = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = basicLeadShard;
fragBullet = leadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
},
incendiaryMortar = new BasicBulletType(3f, 0) {
explosiveShard = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = basicLeadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
drag = 0.1f;
hiteffect = Fx.none;
despawneffect = Fx.none;
hitsize = 4;
lifetime = 20f;
bulletWidth = 9f;
bulletHeight = 11f;
bulletShrink = 1f;
}
},
surgeMortar = new BasicBulletType(3f, 0) {
incindiary = new BasicBulletType(3f, 0) {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = basicLeadShard;
fragBullet = leadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}

View File

@ -6,63 +6,42 @@ import io.anuke.mindustry.entities.bullet.BulletType;
public class StandardBullets {
public static final BulletType
basicIron = new BasicBulletType(3f, 5) {
iron = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
basicLead = new BasicBulletType(3f, 5) {
lead = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
standardLead = new BasicBulletType(3f, 5) {
steel = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
standardArmorPiercing = new BasicBulletType(3f, 5) {
thorium = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
standardHoming = new BasicBulletType(3f, 5) {
homing = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
standardTracer = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
basicLeadFlak = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
standardLeadFlak = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
},
compositeFlak = new BasicBulletType(3f, 5) {
tracer = new BasicBulletType(3f, 5) {
{
bulletWidth = 7f;
bulletHeight = 9f;

View File

@ -41,7 +41,7 @@ public class TurretBullets {
@Override
public void draw(Bullet b) {
//TODO add color to the bullet
//TODO add color to the bullet depending on the color of the flame it came from
Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, b.fin());
Fill.circle(b.x, b.y, 3f * b.fout());
Draw.reset();
@ -117,6 +117,10 @@ public class TurretBullets {
}
},
fuseShot = new BulletType(0.01f, 100) {
//TODO
},
waterShot = new LiquidBulletType(Liquids.water) {
{
status = StatusEffects.wet;

View File

@ -2,7 +2,9 @@ package io.anuke.mindustry.core;
import io.anuke.mindustry.content.*;
import io.anuke.mindustry.content.blocks.*;
import io.anuke.mindustry.content.bullets.*;
import io.anuke.mindustry.entities.StatusEffect;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.entities.units.UnitType;
import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.Block;
@ -30,7 +32,6 @@ public class ContentLoader {
//items
new Items(),
new AmmoItems(),
//liquids
new Liquids(),
@ -44,6 +45,15 @@ public class ContentLoader {
//units
new UnitTypes(),
//bullets
new ArtilleryBullets(),
new FlakBullets(),
new MissileBullets(),
new ShellBullets(),
new StandardBullets(),
new TurretBullets(),
//ammotypes
new AmmoTypes(),
@ -59,9 +69,9 @@ public class ContentLoader {
}
Log.info("--- CONTENT INFO ---");
Log.info("Blocks loaded: {0}\nItems loaded: {1}\nLiquids loaded: {2}\nUpgrades loaded: {3}\nUnits loaded: {4}\nAmmo types loaded: {5}\nStatus effects loaded: {6}\nRecipes loaded: {7}\nTotal content classes: {8}",
Log.info("Blocks loaded: {0}\nItems loaded: {1}\nLiquids loaded: {2}\nUpgrades loaded: {3}\nUnits loaded: {4}\nAmmo types loaded: {5}\nBullet types loaded: {6}\nStatus effects loaded: {7}\nRecipes loaded: {8}\nTotal content classes: {9}",
Block.getAllBlocks().size, io.anuke.mindustry.type.Item.getAllItems().size, Liquid.getAllLiquids().size,
io.anuke.mindustry.type.Mech.getAllUpgrades().size, UnitType.getAllTypes().size, io.anuke.mindustry.type.AmmoType.getAllTypes().size, StatusEffect.getAllEffects().size, io.anuke.mindustry.type.Recipe.getAllRecipes().size, content.length);
io.anuke.mindustry.type.Mech.getAllUpgrades().size, UnitType.getAllTypes().size, io.anuke.mindustry.type.AmmoType.getAllTypes().size, BulletType.all().size, StatusEffect.getAllEffects().size, io.anuke.mindustry.type.Recipe.getAllRecipes().size, content.length);
Log.info("-------------------");
}

View File

@ -81,7 +81,7 @@ public class Logic extends Module {
for(int i = 0; i < 10; i ++){
BaseUnit unit = new BaseUnit(UnitTypes.vtol, Team.red);
Vector2 offset = new Vector2().setToRandomDirection().scl(world.width()/2f*tilesize).add(world.width()/2f*tilesize, world.height()/2f*tilesize);
unit.inventory.addAmmo(AmmoTypes.basicIron);
unit.inventory.addAmmo(AmmoTypes.bulletIron);
unit.inventory.setInfiniteAmmo(true);
unit.set(offset.x, offset.y).add();
}

View File

@ -4,9 +4,9 @@ import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.utils.IntMap;
import com.badlogic.gdx.utils.IntSet;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.SyncEntity;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.entities.units.BaseUnit;
import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.net.Net.SendMode;
@ -19,7 +19,6 @@ import io.anuke.mindustry.world.Build;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.entities.BaseBulletType;
import io.anuke.ucore.entities.Entities;
import io.anuke.ucore.entities.EntityGroup;
import io.anuke.ucore.modules.Module;
@ -208,7 +207,7 @@ public class NetClient extends Module {
});
Net.handleClient(EntityShootPacket.class, packet -> {
BulletType type = BaseBulletType.getByID(packet.bulletid);
BulletType type = BulletType.getByID(packet.bulletid);
EntityGroup group = Entities.getGroup(packet.groupid);
SyncEntity owner = (SyncEntity) group.getByID(packet.entityid);

View File

@ -168,7 +168,7 @@ public class NetServer extends Module{
Net.handleServer(EntityShootPacket.class, (id, packet) -> {
Player player = connections.get(id);
BulletType type = BaseBulletType.getByID(packet.bulletid);
BulletType type = BulletType.getByID(packet.bulletid);
Weapon weapon = Upgrade.getByID((byte)packet.data);
if(!player.upgrades.contains(weapon, true)){

View File

@ -1,5 +1,6 @@
package io.anuke.mindustry.entities.bullet;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.StatusEffects;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.entities.StatusEffect;
@ -7,6 +8,10 @@ import io.anuke.ucore.core.Effects;
import io.anuke.ucore.entities.BaseBulletType;
public abstract class BulletType extends BaseBulletType<Bullet>{
private static int lastid = 0;
private static Array<BulletType> types = new Array<>();
public final int id;
/**Knockback in velocity.*/
public float knockback;
/**Whether this bullet hits tiles.*/
@ -19,11 +24,14 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public float armorPierce = 0f;
public BulletType(float speed, float damage){
this.id = lastid ++;
this.speed = speed;
this.damage = damage;
lifetime = 40f;
hiteffect = BulletFx.hitBulletSmall;
despawneffect = BulletFx.despawn;
types.add(this);
}
@Override
@ -35,4 +43,12 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void despawned(Bullet b){
Effects.effect(despawneffect, b.x, b.y, b.angle());
}
public static BulletType getByID(int id){
return types.get(id);
}
public static Array<BulletType> all(){
return types;
}
}

View File

@ -7,7 +7,7 @@ public class Brute extends GroundUnitType {
public Brute(String name) {
super(name);
setAmmo(AmmoTypes.basicIron);
setAmmo(AmmoTypes.bulletIron);
}
}

View File

@ -16,7 +16,7 @@ public class Cruiser extends FlyingUnitType {
public Cruiser(){
super("vtol");
setAmmo(AmmoTypes.basicIron);
setAmmo(AmmoTypes.bulletIron);
speed = 0.2f;
maxVelocity = 1.4f;
health = 300f;

View File

@ -7,6 +7,6 @@ public class Scout extends GroundUnitType {
public Scout(){
super("scout");
setAmmo(AmmoTypes.basicIron);
setAmmo(AmmoTypes.bulletIron);
}
}

View File

@ -15,7 +15,7 @@ public class Vtol extends FlyingUnitType {
public Vtol(){
super("vtol");
setAmmo(AmmoTypes.basicIron);
setAmmo(AmmoTypes.bulletIron);
speed = 0.3f;
maxVelocity = 2f;
reload = 7;

View File

@ -304,7 +304,6 @@ public enum PlaceMode{
Graphics.flush();
}
//Lines.crect(x, y, block.size * tilesize, block.size * tilesize);
}
public void released(InputHandler input, int tilex, int tiley, int endx, int endy){

View File

@ -13,7 +13,7 @@ public class AmmoType {
/**The item used. Always null if liquid isn't.*/
public final Item item;
/**The liquid used. Always null if item isn't.*/
public final io.anuke.mindustry.type.Liquid liquid;
public final Liquid liquid;
/**The resulting bullet.*/
public final BulletType bullet;
/**For item ammo, this is amount given per ammo item.
@ -48,7 +48,7 @@ public class AmmoType {
this.quantityMultiplier = multiplier;
}
public AmmoType(io.anuke.mindustry.type.Liquid liquid, BulletType result, float multiplier){
public AmmoType(Liquid liquid, BulletType result, float multiplier){
this.item = null;
this.liquid = liquid;
this.bullet = result;

View File

@ -30,9 +30,7 @@ import io.anuke.ucore.util.Bundles;
import io.anuke.ucore.util.EnumSet;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.state;
import static io.anuke.mindustry.Vars.tilesize;
import static io.anuke.mindustry.Vars.world;
import static io.anuke.mindustry.Vars.*;
public class Block extends BaseBlock {
private static int lastid;
@ -135,11 +133,22 @@ public class Block extends BaseBlock {
public boolean isLayer2(Tile tile){return true;}
public void drawLayer(Tile tile){}
public void drawLayer2(Tile tile){}
/**Draw the block overlay that is shown when a cursor is over the block.*/
public void drawSelect(Tile tile){}
/**Drawn when you are placing a block.*/
public void drawPlace(int x, int y, int rotation, boolean valid){}
/**Called after the block is placed.*/
public void placed(Tile tile){}
/**Called every frame a unit is on this tile.*/
public void unitOn(Tile tile, Unit unit){}
/**Returns whether ot not this block can be place on the specified tile.*/
public boolean canPlaceOn(Tile tile){ return true; }
/**Called after all blocks are created.*/
public void init(){
setStats();
@ -147,14 +156,25 @@ public class Block extends BaseBlock {
}
/**Called after texture atlas is loaded.*/
public void load(){
public void load(){}
/**Called when the block is tapped.*/
public void tapped(Tile tile, Player player){}
/**Called when this block is tapped to build a UI on the table.
* {@link #isConfigurable(Tile)} able} must return true for this to be called.*/
public void buildTable(Tile tile, Table table) {}
//TODO make it a boolean?
/**Returns whether this tile can be configured.*/
public boolean isConfigurable(Tile tile){
return false;
}
public void tapped(Tile tile, Player player){}
public void buildTable(Tile tile, Table table) {}
//TODO remove this
public void configure(Tile tile, byte data){}
//TODO remove this
public void setConfigure(Tile tile, byte data){
configure(tile, data);
if(Net.active()) NetEvents.handleBlockConfig(tile, data);
@ -178,10 +198,6 @@ public class Block extends BaseBlock {
tile.block().size * tilesize / 2f + 1f);
Draw.reset();
}
public boolean isConfigurable(Tile tile){
return false;
}
public void setStats(){
stats.add("size", size);

View File

@ -137,8 +137,8 @@ public class Build {
return true;
}else {
return (tile.getTeam() == Team.none || tile.getTeam() == team) && tile.floor().placeableOn
&& ((type.canReplace(tile.block()) && !(type == tile.block() && rotation == tile.getRotation() && type.rotate)) || tile.block().alwaysReplace)
&& tile.block().isMultiblock() == type.isMultiblock() || tile.block() == Blocks.air;
&& ((type.canReplace(tile.block()) && !(type == tile.block() && rotation == tile.getRotation() && type.rotate)) || tile.block().alwaysReplace || tile.block() == Blocks.air)
&& tile.block().isMultiblock() == type.isMultiblock() && type.canPlaceOn(tile);
}
}