Diffuse turret
This commit is contained in:
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;
|
size = 3;
|
||||||
reload = 3f;
|
reload = 3f;
|
||||||
shoot.shots = 2;
|
shoot.shots = 2;
|
||||||
velocityInaccuracy = 0.1f;
|
velocityRnd = 0.1f;
|
||||||
inaccuracy = 4f;
|
inaccuracy = 4f;
|
||||||
recoilAmount = 1f;
|
recoilAmount = 1f;
|
||||||
restitution = 0.04f;
|
restitution = 0.04f;
|
||||||
@@ -3456,7 +3456,7 @@ public class Blocks{
|
|||||||
ammoUseEffect = Fx.casing3Double;
|
ammoUseEffect = Fx.casing3Double;
|
||||||
ammoPerShot = 2;
|
ammoPerShot = 2;
|
||||||
cooldown = 0.03f;
|
cooldown = 0.03f;
|
||||||
velocityInaccuracy = 0.2f;
|
velocityRnd = 0.2f;
|
||||||
restitution = 0.02f;
|
restitution = 0.02f;
|
||||||
recoilAmount = 6f;
|
recoilAmount = 6f;
|
||||||
shootShake = 2f;
|
shootShake = 2f;
|
||||||
@@ -3759,22 +3759,22 @@ public class Blocks{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
diffuse = new ItemTurret("diffuse"){{
|
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(
|
ammo(
|
||||||
Items.graphite, new BasicBulletType(8f, 30){{
|
Items.graphite, new BasicBulletType(8f, 35){{
|
||||||
knockback = 5f;
|
knockback = 6f;
|
||||||
width = 25f;
|
width = 25f;
|
||||||
hitSize = 7f;
|
hitSize = 7f;
|
||||||
height = 20f;
|
height = 20f;
|
||||||
shootEffect = Fx.shootTitan;
|
shootEffect = Fx.shootBigColor;
|
||||||
smokeEffect = Fx.shootBigSmoke;
|
smokeEffect = Fx.shootSmokeSquareSparse;
|
||||||
ammoMultiplier = 4;
|
ammoMultiplier = 4;
|
||||||
hitColor = backColor = trailColor = Color.valueOf("ea8878");
|
hitColor = backColor = trailColor = Color.valueOf("ea8878");
|
||||||
frontColor = Color.white;
|
frontColor = Color.valueOf("feb380");
|
||||||
trailWidth = 6f;
|
trailWidth = 6f;
|
||||||
trailLength = 3;
|
trailLength = 3;
|
||||||
hitEffect = despawnEffect = Fx.hitBulletColor;
|
hitEffect = despawnEffect = Fx.hitSquaresColor;
|
||||||
buildingDamageMultiplier = 0.2f;
|
buildingDamageMultiplier = 0.2f;
|
||||||
}}
|
}}
|
||||||
);
|
);
|
||||||
@@ -3786,10 +3786,19 @@ public class Blocks{
|
|||||||
|
|
||||||
coolantMultiplier = 6f;
|
coolantMultiplier = 6f;
|
||||||
|
|
||||||
|
velocityRnd = 0.17f;
|
||||||
shootShake = 1f;
|
shootShake = 1f;
|
||||||
ammoPerShot = 1;
|
ammoPerShot = 1;
|
||||||
maxAmmo = 50;
|
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;
|
shootY = 5f;
|
||||||
outlineColor = Pal.darkOutline;
|
outlineColor = Pal.darkOutline;
|
||||||
size = 3;
|
size = 3;
|
||||||
@@ -3797,7 +3806,7 @@ public class Blocks{
|
|||||||
reload = 30f;
|
reload = 30f;
|
||||||
recoilAmount = 2f;
|
recoilAmount = 2f;
|
||||||
restitution = 0.03f;
|
restitution = 0.03f;
|
||||||
range = 100;
|
range = 110;
|
||||||
shootCone = 3f;
|
shootCone = 3f;
|
||||||
scaledHealth = 180;
|
scaledHealth = 180;
|
||||||
rotateSpeed = 2f;
|
rotateSpeed = 2f;
|
||||||
@@ -3977,7 +3986,7 @@ public class Blocks{
|
|||||||
shrinkY = 0.3f;
|
shrinkY = 0.3f;
|
||||||
backSprite = "large-bomb-back";
|
backSprite = "large-bomb-back";
|
||||||
sprite = "mine-bullet";
|
sprite = "mine-bullet";
|
||||||
velocityInaccuracy = 0.11f;
|
velocityRnd = 0.11f;
|
||||||
collidesGround = false;
|
collidesGround = false;
|
||||||
collidesTiles = false;
|
collidesTiles = false;
|
||||||
shootEffect = Fx.shootBig2;
|
shootEffect = Fx.shootBig2;
|
||||||
@@ -3994,7 +4003,6 @@ public class Blocks{
|
|||||||
hitEffect = despawnEffect = Fx.hitBulletColor;
|
hitEffect = despawnEffect = Fx.hitBulletColor;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
|
||||||
reload = 9f;
|
reload = 9f;
|
||||||
shootY = 15f;
|
shootY = 15f;
|
||||||
rotateSpeed = 5f;
|
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 -> {
|
shootSmokeSquareBig = new Effect(30f, e -> {
|
||||||
color(Color.white, e.color, e.fin());
|
color(Color.white, e.color, e.fin());
|
||||||
|
|
||||||
|
|||||||
@@ -2922,6 +2922,7 @@ public class UnitTypes{
|
|||||||
|
|
||||||
legMoveSpace = 1f;
|
legMoveSpace = 1f;
|
||||||
allowLegStep = true;
|
allowLegStep = true;
|
||||||
|
hovering = true;
|
||||||
legPhysicsLayer = false;
|
legPhysicsLayer = false;
|
||||||
|
|
||||||
shadowElevation = 0.1f;
|
shadowElevation = 0.1f;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class Turret extends ReloadTurret{
|
|||||||
public Sound chargeSound = Sounds.none;
|
public Sound chargeSound = Sounds.none;
|
||||||
public float soundPitchMin = 0.9f, soundPitchMax = 1.1f;
|
public float soundPitchMin = 0.9f, soundPitchMax = 1.1f;
|
||||||
|
|
||||||
//visuals
|
//visuals TODO document
|
||||||
public float ammoEjectBack = 1f;
|
public float ammoEjectBack = 1f;
|
||||||
public float shootWarmupSpeed = 0.1f;
|
public float shootWarmupSpeed = 0.1f;
|
||||||
public boolean linearWarmup = false;
|
public boolean linearWarmup = false;
|
||||||
@@ -64,7 +64,7 @@ public class Turret extends ReloadTurret{
|
|||||||
/** Bullet angle randomness in degrees. */
|
/** Bullet angle randomness in degrees. */
|
||||||
public float inaccuracy = 0f;
|
public float inaccuracy = 0f;
|
||||||
/** Fraction of bullet velocity that is random. */
|
/** 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. */
|
/** Maximum angle difference in degrees at which turret will still try to shoot. */
|
||||||
public float shootCone = 8f;
|
public float shootCone = 8f;
|
||||||
/** Turret shoot point. */
|
/** Turret shoot point. */
|
||||||
@@ -204,7 +204,7 @@ public class Turret extends ReloadTurret{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldConsume(){
|
public boolean shouldConsume(){
|
||||||
return isShooting();
|
return isShooting() || reloadCounter < reload;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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;
|
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?
|
//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);
|
(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);
|
(smokeEffect == Fx.none ? type.smokeEffect : smokeEffect).at(bulletX, bulletY, rotation + angleOffset, type.hitColor);
|
||||||
|
|||||||
Reference in New Issue
Block a user