mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-11-11 14:56:10 +03:00
Implemented homing silicon bullets
This commit is contained in:
parent
6e5aec080a
commit
6ec28be541
@ -42,9 +42,10 @@ public class AmmoTypes implements ContentList {
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}};
|
||||
|
||||
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 4) {{
|
||||
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 5) {{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
reloadMultiplier = 1.4f;
|
||||
}};
|
||||
|
||||
bulletThermite = new AmmoType(Items.thermite, StandardBullets.tracer, 3) {{
|
||||
|
@ -18,10 +18,11 @@ public class TurretBlocks extends BlockList implements ContentList {
|
||||
@Override
|
||||
public void load() {
|
||||
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;
|
||||
restitution = 0.03f;
|
||||
range = 80f;
|
||||
shootCone = 15f;
|
||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||
}};
|
||||
/*
|
||||
|
@ -1,8 +1,13 @@
|
||||
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.Bullet;
|
||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||
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 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;
|
||||
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;
|
||||
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") {
|
||||
|
@ -418,6 +418,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
|
||||
|
||||
if(isDead()){
|
||||
isBoosting = false;
|
||||
boostHeat = 0f;
|
||||
CoreEntity entity = (CoreEntity)getClosestCore();
|
||||
|
||||
if (!respawning && entity != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user