Implemented homing silicon bullets
This commit is contained in:
@@ -42,9 +42,10 @@ public class AmmoTypes implements ContentList {
|
|||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 4) {{
|
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 5) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
|
reloadMultiplier = 1.4f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
bulletThermite = new AmmoType(Items.thermite, StandardBullets.tracer, 3) {{
|
bulletThermite = new AmmoType(Items.thermite, StandardBullets.tracer, 3) {{
|
||||||
|
|||||||
@@ -18,10 +18,11 @@ public class TurretBlocks extends BlockList implements ContentList {
|
|||||||
@Override
|
@Override
|
||||||
public void load() {
|
public void load() {
|
||||||
duo = new DoubleTurret("duo") {{
|
duo = new DoubleTurret("duo") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.bulletTungsten, AmmoTypes.bulletLead, AmmoTypes.bulletCarbide, AmmoTypes.bulletThermite};
|
ammoTypes = new AmmoType[]{AmmoTypes.bulletTungsten, AmmoTypes.bulletLead, AmmoTypes.bulletCarbide, AmmoTypes.bulletThermite, AmmoTypes.bulletSilicon};
|
||||||
reload = 25f;
|
reload = 25f;
|
||||||
restitution = 0.03f;
|
restitution = 0.03f;
|
||||||
range = 80f;
|
range = 80f;
|
||||||
|
shootCone = 15f;
|
||||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||||
}};
|
}};
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
package io.anuke.mindustry.content.bullets;
|
package io.anuke.mindustry.content.bullets;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.Unit;
|
||||||
|
import io.anuke.mindustry.entities.Units;
|
||||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||||
|
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
import io.anuke.mindustry.type.ContentList;
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
import io.anuke.ucore.core.Timers;
|
||||||
|
import io.anuke.ucore.util.Angles;
|
||||||
|
|
||||||
public class StandardBullets extends BulletList implements ContentList {
|
public class StandardBullets extends BulletList implements ContentList {
|
||||||
public static BulletType tungsten, lead, carbide, thorium, homing, tracer;
|
public static BulletType tungsten, lead, carbide, thorium, homing, tracer;
|
||||||
@@ -32,7 +37,7 @@ public class StandardBullets extends BulletList implements ContentList {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
thorium = new BasicBulletType(4f, 25, "bullet") {
|
thorium = new BasicBulletType(4f, 29, "bullet") {
|
||||||
{
|
{
|
||||||
bulletWidth = 10f;
|
bulletWidth = 10f;
|
||||||
bulletHeight = 13f;
|
bulletHeight = 13f;
|
||||||
@@ -40,11 +45,20 @@ public class StandardBullets extends BulletList implements ContentList {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
homing = new BasicBulletType(3f, 5, "bullet") {
|
homing = new BasicBulletType(3f, 9, "bullet") {
|
||||||
|
float homingPower = 5f;
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(Bullet b) {
|
||||||
|
Unit target = Units.getClosestEnemy(b.getTeam(), b.x, b.y, 40f, unit -> true);
|
||||||
|
if(target != null){
|
||||||
|
b.getVelocity().setAngle(Angles.moveToward(b.getVelocity().angle(), b.angleTo(target), homingPower * Timers.delta()));
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
tracer = new BasicBulletType(3f, 5, "bullet") {
|
tracer = new BasicBulletType(3f, 5, "bullet") {
|
||||||
|
|||||||
@@ -418,6 +418,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
|
|||||||
|
|
||||||
if(isDead()){
|
if(isDead()){
|
||||||
isBoosting = false;
|
isBoosting = false;
|
||||||
|
boostHeat = 0f;
|
||||||
CoreEntity entity = (CoreEntity)getClosestCore();
|
CoreEntity entity = (CoreEntity)getClosestCore();
|
||||||
|
|
||||||
if (!respawning && entity != null) {
|
if (!respawning && entity != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user