Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -8,15 +8,15 @@ import mindustry.type.*;
|
||||
|
||||
/** Spawns a certain amount of units upon death. */
|
||||
public class SpawnDeathAbility extends Ability{
|
||||
public UnitType type;
|
||||
public UnitType unit;
|
||||
public int amount = 1, randAmount = 0;
|
||||
/** Random spread of units away from the spawned. */
|
||||
public float spread = 8f;
|
||||
/** If true, units spawned face outwards from the middle. */
|
||||
public boolean faceOutwards = true;
|
||||
|
||||
public SpawnDeathAbility(UnitType type, int amount, float spread){
|
||||
this.type = type;
|
||||
public SpawnDeathAbility(UnitType unit, int amount, float spread){
|
||||
this.unit = unit;
|
||||
this.amount = amount;
|
||||
this.spread = spread;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public class SpawnDeathAbility extends Ability{
|
||||
int spawned = amount + Mathf.random(randAmount);
|
||||
for(int i = 0; i < spawned; i++){
|
||||
Tmp.v1.rnd(Mathf.random(spread));
|
||||
var u = type.spawn(unit.team, unit.x + Tmp.v1.x, unit.y + Tmp.v1.y);
|
||||
var u = this.unit.spawn(unit.team, unit.x + Tmp.v1.x, unit.y + Tmp.v1.y);
|
||||
|
||||
u.rotation = faceOutwards ? Tmp.v1.angle() : unit.rotation + Mathf.range(5f);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,8 @@ public class BasicBulletType extends BulletType{
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
super.load();
|
||||
|
||||
backRegion = Core.atlas.find(backSprite == null ? (sprite + "-back") : backSprite);
|
||||
frontRegion = Core.atlas.find(sprite);
|
||||
}
|
||||
|
||||
@@ -301,6 +301,14 @@ public class BulletType extends Content implements Cloneable{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
for(var part : parts){
|
||||
part.turretShading = false;
|
||||
part.load(null);
|
||||
}
|
||||
}
|
||||
|
||||
/** @return estimated damage per shot. this can be very inaccurate. */
|
||||
public float estimateDPS(){
|
||||
float sum = damage + splashDamage*0.75f;
|
||||
|
||||
Reference in New Issue
Block a user