More mod content support
This commit is contained in:
@@ -20,6 +20,10 @@ public class ArtilleryBulletType extends BasicBulletType{
|
||||
hitSound = Sounds.explosion;
|
||||
}
|
||||
|
||||
public ArtilleryBulletType(){
|
||||
this(1f, 1f, "shell");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(io.anuke.mindustry.entities.type.Bullet b){
|
||||
super.update(b);
|
||||
|
||||
@@ -22,6 +22,11 @@ public class BasicBulletType extends BulletType{
|
||||
this.bulletSprite = bulletSprite;
|
||||
}
|
||||
|
||||
/** For mods. */
|
||||
public BasicBulletType(){
|
||||
this(1f, 1f, "bullet");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
backRegion = Core.atlas.find(bulletSprite + "-back");
|
||||
|
||||
@@ -17,4 +17,8 @@ public class BombBulletType extends BasicBulletType{
|
||||
collidesAir = false;
|
||||
hitSound = Sounds.explosion;
|
||||
}
|
||||
|
||||
public BombBulletType(){
|
||||
this(1f, 1f, "shell");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@ public abstract class FlakBulletType extends BasicBulletType{
|
||||
bulletHeight = 10f;
|
||||
}
|
||||
|
||||
public FlakBulletType(){
|
||||
this(1f, 1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Bullet b){
|
||||
super.update(b);
|
||||
|
||||
@@ -22,6 +22,10 @@ public class HealBulletType extends BulletType{
|
||||
collidesTeam = true;
|
||||
}
|
||||
|
||||
public HealBulletType(){
|
||||
this(1f, 1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean collides(Bullet b, Tile tile){
|
||||
return tile.getTeam() != b.getTeam() || tile.entity.healthf() < 1f;
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.entities.bullet;
|
||||
import io.anuke.arc.graphics.*;
|
||||
import io.anuke.arc.graphics.g2d.*;
|
||||
import io.anuke.arc.math.geom.*;
|
||||
import io.anuke.arc.util.ArcAnnotate.*;
|
||||
import io.anuke.mindustry.content.*;
|
||||
import io.anuke.mindustry.entities.*;
|
||||
import io.anuke.mindustry.entities.effect.*;
|
||||
@@ -13,14 +14,17 @@ import io.anuke.mindustry.world.*;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class LiquidBulletType extends BulletType{
|
||||
Liquid liquid;
|
||||
@NonNull Liquid liquid;
|
||||
|
||||
public LiquidBulletType(Liquid liquid){
|
||||
public LiquidBulletType(@Nullable Liquid liquid){
|
||||
super(3.5f, 0);
|
||||
this.liquid = liquid;
|
||||
|
||||
if(liquid != null){
|
||||
this.liquid = liquid;
|
||||
this.status = liquid.effect;
|
||||
}
|
||||
|
||||
lifetime = 74f;
|
||||
status = liquid.effect;
|
||||
statusDuration = 90f;
|
||||
despawnEffect = Fx.none;
|
||||
hitEffect = Fx.hitLiquid;
|
||||
@@ -30,13 +34,17 @@ public class LiquidBulletType extends BulletType{
|
||||
knockback = 0.55f;
|
||||
}
|
||||
|
||||
public LiquidBulletType(){
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float range(){
|
||||
return speed * lifetime / 2f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(io.anuke.mindustry.entities.type.Bullet b){
|
||||
public void update(Bullet b){
|
||||
super.update(b);
|
||||
|
||||
if(liquid.canExtinguish()){
|
||||
@@ -50,7 +58,7 @@ public class LiquidBulletType extends BulletType{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(io.anuke.mindustry.entities.type.Bullet b){
|
||||
public void draw(Bullet b){
|
||||
Draw.color(liquid.color, Color.white, b.fout() / 100f);
|
||||
|
||||
Fill.circle(b.x, b.y, 0.5f + b.fout() * 2.5f);
|
||||
|
||||
@@ -23,6 +23,10 @@ public class MissileBulletType extends BasicBulletType{
|
||||
hitSound = Sounds.explosion;
|
||||
}
|
||||
|
||||
public MissileBulletType(){
|
||||
this(1f, 1f, "missile");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Bullet b){
|
||||
super.update(b);
|
||||
|
||||
Reference in New Issue
Block a user