mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-24 21:41:25 -08:00
Fixed #1436 / Fixed crawlers not exploding
This commit is contained in:
parent
081edde1f2
commit
923d576a5f
4 changed files with 15 additions and 7 deletions
|
|
@ -103,9 +103,10 @@ public class UnitTypes implements ContentList{
|
|||
shootSound = Sounds.explosion;
|
||||
bullet = new BombBulletType(2f, 3f, "clear"){{
|
||||
hitEffect = Fx.pulverize;
|
||||
lifetime = 2f;
|
||||
lifetime = 30f;
|
||||
speed = 1.1f;
|
||||
splashDamageRadius = 55f;
|
||||
instantDisappear = true;
|
||||
splashDamage = 30f;
|
||||
killShooter = true;
|
||||
}};
|
||||
|
|
@ -126,7 +127,6 @@ public class UnitTypes implements ContentList{
|
|||
shootSound = Sounds.flame;
|
||||
length = 1f;
|
||||
reload = 14f;
|
||||
range = 30f;
|
||||
alternate = true;
|
||||
recoil = 1f;
|
||||
ejectEffect = Fx.none;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@ package mindustry.entities.bullet;
|
|||
import arc.audio.*;
|
||||
import arc.math.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.ctype.Content;
|
||||
import mindustry.ctype.ContentType;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.Effects.*;
|
||||
import mindustry.entities.effect.*;
|
||||
|
|
@ -41,7 +40,9 @@ public abstract class BulletType extends Content{
|
|||
public float recoil;
|
||||
/** Whether to kill the shooter when this is shot. For suicide bombers. */
|
||||
public boolean killShooter;
|
||||
|
||||
/** Whether to instantly make the bullet disappear. */
|
||||
public boolean instantDisappear;
|
||||
/** Damage dealt in splash. 0 to disable.*/
|
||||
public float splashDamage = 0f;
|
||||
/** Knockback in velocity. */
|
||||
public float knockback;
|
||||
|
|
@ -151,6 +152,10 @@ public abstract class BulletType extends Content{
|
|||
if(killShooter && b.getOwner() instanceof HealthTrait){
|
||||
((HealthTrait)b.getOwner()).kill();
|
||||
}
|
||||
|
||||
if(instantDisappear){
|
||||
b.time(lifetime);
|
||||
}
|
||||
}
|
||||
|
||||
public void update(Bullet b){
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ public class GroundUnit extends BaseUnit{
|
|||
moveToCore(PathTarget.enemyCores);
|
||||
}
|
||||
}else{
|
||||
|
||||
float dst = dst(core);
|
||||
|
||||
if(dst < getWeapon().bullet.range() / 1.1f){
|
||||
|
|
@ -170,6 +169,7 @@ public class GroundUnit extends BaseUnit{
|
|||
|
||||
if(!Units.invalidateTarget(target, this)){
|
||||
if(dst(target) < getWeapon().bullet.range()){
|
||||
|
||||
rotate(angleTo(target));
|
||||
|
||||
if(Angles.near(angleTo(target), rotation, 13f)){
|
||||
|
|
|
|||
|
|
@ -182,8 +182,11 @@ public class PowerNode extends PowerBlock{
|
|||
|
||||
if(tile == other){
|
||||
if(other.entity.power.links.size == 0){
|
||||
int[] total = {0};
|
||||
getPotentialLinks(tile, link -> {
|
||||
if(!insulated(tile, link)) tile.configure(link.pos());
|
||||
if(!insulated(tile, link) && total[0]++ < maxNodes){
|
||||
tile.configure(link.pos());
|
||||
}
|
||||
});
|
||||
}else{
|
||||
while(entity.power.links.size > 0){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue