WIP bullet shotgun for T4 tank
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 331 B After Width: | Height: | Size: 338 B |
@ -290,7 +290,7 @@ public class UnitTypes{
|
|||||||
|
|
||||||
fragBullets = 3;
|
fragBullets = 3;
|
||||||
fragLifeMin = 0f;
|
fragLifeMin = 0f;
|
||||||
fragCone = 30f;
|
fragRandomSpread = 30f;
|
||||||
|
|
||||||
fragBullet = new BasicBulletType(9f, 20){{
|
fragBullet = new BasicBulletType(9f, 20){{
|
||||||
width = 10f;
|
width = 10f;
|
||||||
@ -2680,11 +2680,11 @@ public class UnitTypes{
|
|||||||
sprite = "missile-large";
|
sprite = "missile-large";
|
||||||
width = 9.5f;
|
width = 9.5f;
|
||||||
height = 15f;
|
height = 15f;
|
||||||
lifetime = 30f;
|
lifetime = 18f;
|
||||||
hitSize = 6f;
|
hitSize = 6f;
|
||||||
shootEffect = Fx.shootTitan;
|
shootEffect = Fx.shootTitan;
|
||||||
smokeEffect = Fx.shootSmokeTitan;
|
smokeEffect = Fx.shootSmokeTitan;
|
||||||
pierceCap = 3;
|
pierceCap = 2;
|
||||||
pierce = true;
|
pierce = true;
|
||||||
pierceBuilding = true;
|
pierceBuilding = true;
|
||||||
hitColor = backColor = trailColor = Color.valueOf("feb380");
|
hitColor = backColor = trailColor = Color.valueOf("feb380");
|
||||||
@ -2694,6 +2694,28 @@ public class UnitTypes{
|
|||||||
hitEffect = despawnEffect = Fx.blastExplosion;
|
hitEffect = despawnEffect = Fx.blastExplosion;
|
||||||
splashDamageRadius = 20f;
|
splashDamageRadius = 20f;
|
||||||
splashDamage = 50f;
|
splashDamage = 50f;
|
||||||
|
|
||||||
|
fragOnHit = false;
|
||||||
|
fragRandomSpread = 0f;
|
||||||
|
fragSpread = 10f;
|
||||||
|
fragBullets = 5;
|
||||||
|
fragVelocityMin = 1f;
|
||||||
|
|
||||||
|
//TODO
|
||||||
|
fragBullet = new BasicBulletType(8f, 30){{
|
||||||
|
sprite = "missile-large";
|
||||||
|
width = 8f;
|
||||||
|
height = 12f;
|
||||||
|
lifetime = 15f;
|
||||||
|
hitSize = 4f;
|
||||||
|
hitColor = backColor = trailColor = Color.valueOf("feb380");
|
||||||
|
frontColor = Color.white;
|
||||||
|
trailWidth = 2.8f;
|
||||||
|
trailLength = 6;
|
||||||
|
hitEffect = despawnEffect = Fx.blastExplosion;
|
||||||
|
splashDamageRadius = 10f;
|
||||||
|
splashDamage = 20f;
|
||||||
|
}};
|
||||||
}};
|
}};
|
||||||
}});
|
}});
|
||||||
|
|
||||||
@ -3503,7 +3525,7 @@ public class UnitTypes{
|
|||||||
spread = 11f;
|
spread = 11f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
bullet = new BasicBulletType(5f, 18){{
|
bullet = new BasicBulletType(5f, 24){{
|
||||||
homingPower = 0.19f;
|
homingPower = 0.19f;
|
||||||
homingDelay = 4f;
|
homingDelay = 4f;
|
||||||
width = 7f;
|
width = 7f;
|
||||||
|
@ -138,6 +138,8 @@ public class BulletType extends Content implements Cloneable{
|
|||||||
public boolean makeFire = false;
|
public boolean makeFire = false;
|
||||||
/** Whether to create hit effects on despawn. Forced to true if this bullet has any special effects like splash damage. */
|
/** Whether to create hit effects on despawn. Forced to true if this bullet has any special effects like splash damage. */
|
||||||
public boolean despawnHit = false;
|
public boolean despawnHit = false;
|
||||||
|
/** If true, this bullet will create bullets when it hits anything, not just when it despawns. */
|
||||||
|
public boolean fragOnHit = true;
|
||||||
/** If true, unit armor is ignored in damage calculations. Ignored for building armor. */
|
/** If true, unit armor is ignored in damage calculations. Ignored for building armor. */
|
||||||
public boolean pierceArmor = false;
|
public boolean pierceArmor = false;
|
||||||
|
|
||||||
@ -146,7 +148,8 @@ public class BulletType extends Content implements Cloneable{
|
|||||||
/** Whether status and despawnHit should automatically be set. */
|
/** Whether status and despawnHit should automatically be set. */
|
||||||
public boolean setDefaults = true;
|
public boolean setDefaults = true;
|
||||||
|
|
||||||
public float fragCone = 360f;
|
public float fragRandomSpread = 360f;
|
||||||
|
public float fragSpread = 0f;
|
||||||
public float fragAngle = 0f;
|
public float fragAngle = 0f;
|
||||||
public int fragBullets = 9;
|
public int fragBullets = 9;
|
||||||
public float fragVelocityMin = 0.2f, fragVelocityMax = 1f, fragLifeMin = 1f, fragLifeMax = 1f;
|
public float fragVelocityMin = 0.2f, fragVelocityMax = 1f, fragLifeMin = 1f, fragLifeMax = 1f;
|
||||||
@ -308,12 +311,11 @@ public class BulletType extends Content implements Cloneable{
|
|||||||
|
|
||||||
Effect.shake(hitShake, hitShake, b);
|
Effect.shake(hitShake, hitShake, b);
|
||||||
|
|
||||||
createFrags(b, x, y);
|
if(fragOnHit){
|
||||||
createPuddles(b, x, y);
|
createFrags(b, x, y);
|
||||||
|
|
||||||
if(incendChance > 0 && Mathf.chance(incendChance)){
|
|
||||||
Damage.createIncend(x, y, incendSpread, incendAmount);
|
|
||||||
}
|
}
|
||||||
|
createPuddles(b, x, y);
|
||||||
|
createIncend(b, x, y);
|
||||||
|
|
||||||
if(suppressionRange > 0){
|
if(suppressionRange > 0){
|
||||||
//bullets are pooled, require separate Vec2 instance
|
//bullets are pooled, require separate Vec2 instance
|
||||||
@ -327,6 +329,12 @@ public class BulletType extends Content implements Cloneable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void createIncend(Bullet b, float x, float y){
|
||||||
|
if(incendChance > 0 && Mathf.chance(incendChance)){
|
||||||
|
Damage.createIncend(x, y, incendSpread, incendAmount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void createPuddles(Bullet b, float x, float y){
|
public void createPuddles(Bullet b, float x, float y){
|
||||||
if(puddleLiquid != null && puddles > 0){
|
if(puddleLiquid != null && puddles > 0){
|
||||||
for(int i = 0; i < puddles; i++){
|
for(int i = 0; i < puddles; i++){
|
||||||
@ -361,7 +369,7 @@ public class BulletType extends Content implements Cloneable{
|
|||||||
if(fragBullet != null){
|
if(fragBullet != null){
|
||||||
for(int i = 0; i < fragBullets; i++){
|
for(int i = 0; i < fragBullets; i++){
|
||||||
float len = Mathf.random(1f, 7f);
|
float len = Mathf.random(1f, 7f);
|
||||||
float a = b.rotation() + Mathf.range(fragCone / 2) + fragAngle;
|
float a = b.rotation() + Mathf.range(fragRandomSpread / 2) + fragAngle + ((i - fragBullets/2) * fragSpread);
|
||||||
fragBullet.create(b, x + Angles.trnsx(a, len), y + Angles.trnsy(a, len), a, Mathf.random(fragVelocityMin, fragVelocityMax), Mathf.random(fragLifeMin, fragLifeMax));
|
fragBullet.create(b, x + Angles.trnsx(a, len), y + Angles.trnsy(a, len), a, Mathf.random(fragVelocityMin, fragVelocityMax), Mathf.random(fragLifeMin, fragLifeMax));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -373,6 +381,11 @@ public class BulletType extends Content implements Cloneable{
|
|||||||
if(despawnHit){
|
if(despawnHit){
|
||||||
hit(b);
|
hit(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!fragOnHit){
|
||||||
|
createFrags(b, b.x, b.y);
|
||||||
|
}
|
||||||
|
|
||||||
despawnEffect.at(b.x, b.y, b.rotation(), hitColor);
|
despawnEffect.at(b.x, b.y, b.rotation(), hitColor);
|
||||||
despawnSound.at(b);
|
despawnSound.at(b);
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
transient float efficiency;
|
transient float efficiency;
|
||||||
/** Same as efficiency, but for optional consumers only. */
|
/** Same as efficiency, but for optional consumers only. */
|
||||||
transient float optionalEfficiency;
|
transient float optionalEfficiency;
|
||||||
/** The efficiency this block would have if consValid() / productionValid() returned true. */
|
/** The efficiency this block *would* have if shouldConsume() returned true. */
|
||||||
transient float potentialEfficiency;
|
transient float potentialEfficiency;
|
||||||
|
|
||||||
transient float healSuppressionTime = -1f;
|
transient float healSuppressionTime = -1f;
|
||||||
|
@ -187,7 +187,6 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
|
|||||||
type.collideFloor && (tile == null || tile.floor().hasSurface() || tile.block() != Blocks.air) ||
|
type.collideFloor && (tile == null || tile.floor().hasSurface() || tile.block() != Blocks.air) ||
|
||||||
type.collideTerrain && tile != null && tile.block() instanceof StaticWall
|
type.collideTerrain && tile != null && tile.block() instanceof StaticWall
|
||||||
){
|
){
|
||||||
type.despawned(self());
|
|
||||||
remove();
|
remove();
|
||||||
hit = true;
|
hit = true;
|
||||||
return;
|
return;
|
||||||
|
@ -54,7 +54,7 @@ public class MenuFragment{
|
|||||||
|
|
||||||
parent.fill(c -> c.bottom().right().button(Icon.discord, new ImageButtonStyle(){{
|
parent.fill(c -> c.bottom().right().button(Icon.discord, new ImageButtonStyle(){{
|
||||||
up = discordBanner;
|
up = discordBanner;
|
||||||
}}, ui.discord::show).tooltip("@discord").size(84, 45).name("discord"));
|
}}, ui.discord::show).marginTop(9f).marginLeft(10f).tooltip("@discord").size(84, 45).name("discord"));
|
||||||
|
|
||||||
//info icon
|
//info icon
|
||||||
if(mobile){
|
if(mobile){
|
||||||
|