mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-25 22:17:59 +07:00
Diffuse turret
This commit is contained in:
parent
068c0dbe4d
commit
98b01953a4
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 847 B |
Binary file not shown.
After Width: | Height: | Size: 798 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
core/assets-raw/sprites/blocks/turrets/diffuse/diffuse.png
Normal file
BIN
core/assets-raw/sprites/blocks/turrets/diffuse/diffuse.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
@ -3316,7 +3316,7 @@ public class Blocks{
|
||||
size = 3;
|
||||
reload = 3f;
|
||||
shoot.shots = 2;
|
||||
velocityInaccuracy = 0.1f;
|
||||
velocityRnd = 0.1f;
|
||||
inaccuracy = 4f;
|
||||
recoilAmount = 1f;
|
||||
restitution = 0.04f;
|
||||
@ -3456,7 +3456,7 @@ public class Blocks{
|
||||
ammoUseEffect = Fx.casing3Double;
|
||||
ammoPerShot = 2;
|
||||
cooldown = 0.03f;
|
||||
velocityInaccuracy = 0.2f;
|
||||
velocityRnd = 0.2f;
|
||||
restitution = 0.02f;
|
||||
recoilAmount = 6f;
|
||||
shootShake = 2f;
|
||||
@ -3759,22 +3759,22 @@ public class Blocks{
|
||||
}};
|
||||
|
||||
diffuse = new ItemTurret("diffuse"){{
|
||||
requirements(Category.turret, with(Items.beryllium, 150, Items.silicon, 150, Items.graphite, 250));
|
||||
requirements(Category.turret, with(Items.beryllium, 150, Items.silicon, 200, Items.graphite, 200, Items.tungsten, 50));
|
||||
|
||||
ammo(
|
||||
Items.graphite, new BasicBulletType(8f, 30){{
|
||||
knockback = 5f;
|
||||
Items.graphite, new BasicBulletType(8f, 35){{
|
||||
knockback = 6f;
|
||||
width = 25f;
|
||||
hitSize = 7f;
|
||||
height = 20f;
|
||||
shootEffect = Fx.shootTitan;
|
||||
smokeEffect = Fx.shootBigSmoke;
|
||||
shootEffect = Fx.shootBigColor;
|
||||
smokeEffect = Fx.shootSmokeSquareSparse;
|
||||
ammoMultiplier = 4;
|
||||
hitColor = backColor = trailColor = Color.valueOf("ea8878");
|
||||
frontColor = Color.white;
|
||||
frontColor = Color.valueOf("feb380");
|
||||
trailWidth = 6f;
|
||||
trailLength = 3;
|
||||
hitEffect = despawnEffect = Fx.hitBulletColor;
|
||||
hitEffect = despawnEffect = Fx.hitSquaresColor;
|
||||
buildingDamageMultiplier = 0.2f;
|
||||
}}
|
||||
);
|
||||
@ -3786,10 +3786,19 @@ public class Blocks{
|
||||
|
||||
coolantMultiplier = 6f;
|
||||
|
||||
velocityRnd = 0.17f;
|
||||
shootShake = 1f;
|
||||
ammoPerShot = 1;
|
||||
maxAmmo = 50;
|
||||
drawer = new DrawTurret("reinforced-");
|
||||
drawer = new DrawTurret("reinforced-"){{
|
||||
parts.add(new RegionPart("-front"){{
|
||||
progress = PartProgress.warmup;
|
||||
moveRot = -10f;
|
||||
mirror = true;
|
||||
moves.add(new PartMove(PartProgress.reload, 0f, -3f, -5f));
|
||||
heatColor = Color.red;
|
||||
}});
|
||||
}};
|
||||
shootY = 5f;
|
||||
outlineColor = Pal.darkOutline;
|
||||
size = 3;
|
||||
@ -3797,7 +3806,7 @@ public class Blocks{
|
||||
reload = 30f;
|
||||
recoilAmount = 2f;
|
||||
restitution = 0.03f;
|
||||
range = 100;
|
||||
range = 110;
|
||||
shootCone = 3f;
|
||||
scaledHealth = 180;
|
||||
rotateSpeed = 2f;
|
||||
@ -3977,7 +3986,7 @@ public class Blocks{
|
||||
shrinkY = 0.3f;
|
||||
backSprite = "large-bomb-back";
|
||||
sprite = "mine-bullet";
|
||||
velocityInaccuracy = 0.11f;
|
||||
velocityRnd = 0.11f;
|
||||
collidesGround = false;
|
||||
collidesTiles = false;
|
||||
shootEffect = Fx.shootBig2;
|
||||
@ -3994,7 +4003,6 @@ public class Blocks{
|
||||
hitEffect = despawnEffect = Fx.hitBulletColor;
|
||||
}});
|
||||
|
||||
|
||||
reload = 9f;
|
||||
shootY = 15f;
|
||||
rotateSpeed = 5f;
|
||||
|
@ -1521,6 +1521,17 @@ public class Fx{
|
||||
}
|
||||
}),
|
||||
|
||||
shootSmokeSquareSparse = new Effect(30f, e -> {
|
||||
color(Color.white, e.color, e.fin());
|
||||
|
||||
rand.setSeed(e.id);
|
||||
for(int i = 0; i < 2; i++){
|
||||
float rot = e.rotation + rand.range(30f);
|
||||
v.trns(rot, rand.random(e.finpow() * 27f));
|
||||
Fill.poly(e.x + v.x, e.y + v.y, 4, e.fout() * 3.8f + 0.2f, rand.random(360f));
|
||||
}
|
||||
}),
|
||||
|
||||
shootSmokeSquareBig = new Effect(30f, e -> {
|
||||
color(Color.white, e.color, e.fin());
|
||||
|
||||
|
@ -2922,6 +2922,7 @@ public class UnitTypes{
|
||||
|
||||
legMoveSpace = 1f;
|
||||
allowLegStep = true;
|
||||
hovering = true;
|
||||
legPhysicsLayer = false;
|
||||
|
||||
shadowElevation = 0.1f;
|
||||
|
@ -44,7 +44,7 @@ public class Turret extends ReloadTurret{
|
||||
public Sound chargeSound = Sounds.none;
|
||||
public float soundPitchMin = 0.9f, soundPitchMax = 1.1f;
|
||||
|
||||
//visuals
|
||||
//visuals TODO document
|
||||
public float ammoEjectBack = 1f;
|
||||
public float shootWarmupSpeed = 0.1f;
|
||||
public boolean linearWarmup = false;
|
||||
@ -64,7 +64,7 @@ public class Turret extends ReloadTurret{
|
||||
/** Bullet angle randomness in degrees. */
|
||||
public float inaccuracy = 0f;
|
||||
/** Fraction of bullet velocity that is random. */
|
||||
public float velocityInaccuracy = 0f;
|
||||
public float velocityRnd = 0f;
|
||||
/** Maximum angle difference in degrees at which turret will still try to shoot. */
|
||||
public float shootCone = 8f;
|
||||
/** Turret shoot point. */
|
||||
@ -204,7 +204,7 @@ public class Turret extends ReloadTurret{
|
||||
|
||||
@Override
|
||||
public boolean shouldConsume(){
|
||||
return isShooting();
|
||||
return isShooting() || reloadCounter < reload;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -503,7 +503,7 @@ public class Turret extends ReloadTurret{
|
||||
float lifeScl = type.scaleLife ? Mathf.clamp(Mathf.dst(bulletX, bulletY, targetPos.x, targetPos.y) / type.range, minRange / type.range, range() / type.range) : 1f;
|
||||
|
||||
//TODO aimX / aimY for multi shot turrets?
|
||||
handleBullet(type.create(this, team, bulletX, bulletY, shootAngle, -1f, 1f + Mathf.range(velocityInaccuracy), lifeScl, null, mover, targetPos.x, targetPos.y), xOffset, yOffset, angleOffset);
|
||||
handleBullet(type.create(this, team, bulletX, bulletY, shootAngle, -1f, (1f - velocityRnd) + Mathf.random(velocityRnd), lifeScl, null, mover, targetPos.x, targetPos.y), xOffset, yOffset, angleOffset);
|
||||
|
||||
(shootEffect == Fx.none ? type.shootEffect : shootEffect).at(bulletX, bulletY, rotation + angleOffset, type.hitColor);
|
||||
(smokeEffect == Fx.none ? type.smokeEffect : smokeEffect).at(bulletX, bulletY, rotation + angleOffset, type.hitColor);
|
||||
|
Loading…
Reference in New Issue
Block a user