Added definitions for all bullet types

This commit is contained in:
Anuken
2018-05-25 21:56:23 -04:00
parent 908a569413
commit b051a296fc
9 changed files with 166 additions and 90 deletions

View File

@@ -0,0 +1,57 @@
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.GRAY){{
type = ItemType.ammo;
}},
compositeFlak = new Item("composite-flak", Color.GRAY){{
type = ItemType.ammo;
}},
armorPiercingBullet = new Item("armor-piercing-bullet", Color.GRAY){{
type = ItemType.ammo;
}},
homingBullet = new Item("homing-bullet", Color.GRAY){{
type = ItemType.ammo;
}},
tracerBullet = new Item("tracer-bullet", Color.GRAY){{
type = ItemType.ammo;
}},
explosiveShell = new Item("explosive-shell", Color.GRAY){{
type = ItemType.ammo;
}},
fragShell = new Item("frag-shell", Color.GRAY){{
type = ItemType.ammo;
}},
thoriumShell = new Item("thorium-shell", Color.GRAY){{
type = ItemType.ammo;
}},
swarmMissile = new Item("swarm-missile", Color.GRAY){{
type = ItemType.ammo;
}},
scytheMissile = new Item("scythe-missile", Color.GRAY){{
type = ItemType.ammo;
}},
incendiaryMortarShell = new Item("incendiary-mortar-shell", Color.GRAY){{
type = ItemType.ammo;
}},
surgeMortarShell = new Item("surge-mortar-shell", Color.GRAY){{
type = ItemType.ammo;
}};
}

View File

@@ -13,27 +13,42 @@ public class AmmoTypes {
smokeEffect = ShootFx.shootSmallSmoke;
}},
basicLead = new AmmoType(Items.iron, TurretBullets.basicIron, 5){{
basicLead = new AmmoType(Items.lead, TurretBullets.basicIron, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
standardLead = new AmmoType(Items.iron, TurretBullets.basicIron, 5){{
basicLeadFlak = new AmmoType(Items.lead, TurretBullets.basicIron, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
standardArmorPiercing = new AmmoType(Items.steel, TurretBullets.basicSteel, 5){{
standardLead = new AmmoType(AmmoItems.leadBullet, TurretBullets.basicIron, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
standardLeadFlak = new AmmoType(AmmoItems.leadBullet, TurretBullets.basicIron, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
compositeFlak = new AmmoType(AmmoItems.compositeFlak, TurretBullets.basicIron, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}},
standardArmorPiercing = new AmmoType(AmmoItems.armorPiercingBullet, TurretBullets.basicSteel, 5){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}},
homing = new AmmoType(Items.steel, TurretBullets.basicSteel, 5){{
homing = new AmmoType(AmmoItems.homingBullet, TurretBullets.basicSteel, 5){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}},
tracer = new AmmoType(Items.steel, TurretBullets.basicSteel, 5){{
tracer = new AmmoType(AmmoItems.tracerBullet, TurretBullets.basicSteel, 5){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}},
@@ -47,37 +62,37 @@ public class AmmoTypes {
smokeEffect = ShootFx.shootBigSmoke2;
}},
explosiveFragShell = new AmmoType(Items.lead, TurretBullets.basicLeadFragShell, 1){{
explosiveFragShell = new AmmoType(AmmoItems.explosiveShell, TurretBullets.basicLeadFragShell, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
fragShell = new AmmoType(Items.lead, TurretBullets.basicLeadFragShell, 1){{
fragShell = new AmmoType(AmmoItems.fragShell, TurretBullets.basicLeadFragShell, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
standardThoriumShell = new AmmoType(Items.lead, TurretBullets.basicLeadFragShell, 1){{
standardThoriumShell = new AmmoType(AmmoItems.thoriumShell, TurretBullets.basicLeadFragShell, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
swarmMissile = new AmmoType(Items.lead, TurretBullets.basicLeadFragShell, 1){{
swarmMissile = new AmmoType(AmmoItems.swarmMissile, TurretBullets.basicLeadFragShell, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
scytheMissile = new AmmoType(Items.lead, TurretBullets.basicLeadFragShell, 1){{
scytheMissile = new AmmoType(AmmoItems.scytheMissile, TurretBullets.basicLeadFragShell, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
incendiaryMortar = new AmmoType(Items.lead, TurretBullets.basicLeadFragShell, 1){{
incendiaryMortar = new AmmoType(AmmoItems.incendiaryMortarShell, TurretBullets.basicLeadFragShell, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},
surgeMortar = new AmmoType(Items.lead, TurretBullets.basicLeadFragShell, 1){{
surgeMortar = new AmmoType(AmmoItems.surgeMortarShell, TurretBullets.basicLeadFragShell, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}},

View File

@@ -15,14 +15,14 @@ public class WeaponBlocks{
public static Block
duo = new DoubleTurret("duo"){{
ammoTypes = new AmmoType[]{AmmoTypes.basicIron};
ammoTypes = new AmmoType[]{AmmoTypes.basicIron, AmmoTypes.basicLead, AmmoTypes.standardLead, AmmoTypes.tracer};
reload = 25f;
restitution = 0.03f;
ammoUseEffect = ShootFx.shellEjectSmall;
}},
scatter = new BurstTurret("scatter") {{
ammoTypes = new AmmoType[]{AmmoTypes.basicIron};
ammoTypes = new AmmoType[]{AmmoTypes.basicLeadFlak, AmmoTypes.standardLeadFlak, AmmoTypes.compositeFlak};
ammoPerShot = 1;
shots = 3;
reload = 60f;
@@ -67,7 +67,7 @@ public class WeaponBlocks{
crux = new ItemTurret("crux"){{
size = 2;
range = 100f;
ammoTypes = new AmmoType[]{AmmoTypes.basicLeadShell};
ammoTypes = new AmmoType[]{AmmoTypes.basicLeadShell, AmmoTypes.explosiveFragShell, AmmoTypes.fragShell, AmmoTypes.standardThoriumShell};
reload = 70f;
restitution = 0.03f;
ammoEjectBack = 3f;
@@ -104,6 +104,7 @@ public class WeaponBlocks{
chargeEffect = ShootFx.lancerLaserCharge;
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
heatColor = Color.RED;
size = 2;
}},
arc = new LaserTurret("arc"){{
@@ -121,11 +122,13 @@ public class WeaponBlocks{
size = 2;
}},
swarmer = new PowerTurret("missileturret") {{
swarmer = new ItemTurret("missileturret") {{
ammoTypes = new AmmoType[]{AmmoTypes.basicLeadShell, AmmoTypes.explosiveFragShell, AmmoTypes.fragShell, AmmoTypes.standardThoriumShell};
size = 2;
}},
fuse = new PowerTurret("fornaxcannon") {{
fuse = new ItemTurret("fuse") {{
ammoTypes = new AmmoType[]{AmmoTypes.basicLeadShell, AmmoTypes.explosiveFragShell, AmmoTypes.fragShell, AmmoTypes.standardThoriumShell};
size = 3;
}},

View File

@@ -30,6 +30,7 @@ public class ContentLoader {
//items
new Items(),
new AmmoItems(),
//liquids
new Liquids(),

View File

@@ -119,7 +119,7 @@ public abstract class Turret extends Block{
@Override
public TextureRegion[] getBlockIcon(){
if(blockIcon == null){
blockIcon = new TextureRegion[]{Draw.region("block-" + size), Draw.region(name)};
blockIcon = Draw.hasRegion(name) ? new TextureRegion[]{Draw.region("block-" + size), Draw.region(name)} : new TextureRegion[0];
}
return blockIcon;
}

View File

@@ -85,8 +85,8 @@ public class Conveyor extends Block{
tr2.trns(rotation * 90, -tilesize / 2, pos.x * tilesize / 2);
Draw.rect(pos.item.region,
tile.x * tilesize + tr1.x * pos.y + tr2.x,
tile.y * tilesize + tr1.y * pos.y + tr2.y, itemSize, itemSize);
(int)(tile.x * tilesize + tr1.x * pos.y + tr2.x),
(int)(tile.y * tilesize + tr1.y * pos.y + tr2.y), itemSize, itemSize);
}
}catch (IndexOutOfBoundsException e){