This commit is contained in:
Anuken
2025-11-23 19:58:39 -05:00
95 changed files with 322 additions and 133 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

After

Width:  |  Height:  |  Size: 840 B

View File

@@ -472,7 +472,7 @@ editor.generation = Generation
editor.objectives = Objectives editor.objectives = Objectives
editor.locales = Locale Bundles editor.locales = Locale Bundles
editor.patches.guide = Patch Guide editor.patches.guide = Patch Guide
editor.patches = Content Patches editor.patches = Data Patches
editor.patch: Patchset: {0} editor.patch: Patchset: {0}
editor.patches.none = [lightgray]No patchsets loaded. editor.patches.none = [lightgray]No patchsets loaded.
editor.patches.errors = Patchset Errors editor.patches.errors = Patchset Errors

View File

@@ -110,6 +110,7 @@ dsmolenaers (freesound.org)
Headphaze (freesound.org) Headphaze (freesound.org)
Michel Baradari (opengameart.org) Michel Baradari (opengameart.org)
Michael Klier (opengameart.org) Michael Klier (opengameart.org)
Lee Barkovich (opengameart.org)
Neoqueto (Darktech LDR Font) Neoqueto (Darktech LDR Font)
Nikolass Nikolass
VolasYouKnow VolasYouKnow

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -270,7 +270,6 @@ public class CommandAI extends AIController{
Building targetBuild = world.buildWorld(targetPos.x, targetPos.y); Building targetBuild = world.buildWorld(targetPos.x, targetPos.y);
//TODO: should the unit stop when it finds a target? //TODO: should the unit stop when it finds a target?
if( if(
(hasStance(UnitStance.patrol) && !hasStance(UnitStance.pursueTarget) && target != null && unit.within(target, unit.type.range - 2f) && !unit.type.circleTarget) || (hasStance(UnitStance.patrol) && !hasStance(UnitStance.pursueTarget) && target != null && unit.within(target, unit.type.range - 2f) && !unit.type.circleTarget) ||
@@ -347,7 +346,7 @@ public class CommandAI extends AIController{
if(move){ if(move){
if(unit.type.circleTarget && attackTarget != null){ if(unit.type.circleTarget && attackTarget != null){
target = attackTarget; target = attackTarget;
circleAttack(80f); circleAttack(unit.type.circleTargetRadius);
}else{ }else{
moveTo(vecOut, moveTo(vecOut,
withinAttackRange ? engageRange : withinAttackRange ? engageRange :
@@ -362,7 +361,7 @@ public class CommandAI extends AIController{
attackTarget = null; attackTarget = null;
} }
if(unit.isFlying() && move && (attackTarget == null || !unit.within(attackTarget, unit.type.range))){ if(unit.isFlying() && move && !(unit.type.circleTarget && !unit.type.omniMovement) && (attackTarget == null || !unit.within(attackTarget, unit.type.range))){
unit.lookAt(vecMovePos); unit.lookAt(vecMovePos);
}else{ }else{
faceTarget(); faceTarget();
@@ -379,9 +378,13 @@ public class CommandAI extends AIController{
} }
}else if(target != null){ }else if(target != null){
if(unit.type.circleTarget && shouldFire()){
circleAttack(unit.type.circleTargetRadius);
}else{
faceTarget(); faceTarget();
} }
} }
}
void finishPath(){ void finishPath(){
//the enter payload command never finishes until they are actually accepted //the enter payload command never finishes until they are actually accepted

View File

@@ -19,7 +19,7 @@ public class FlyingAI extends AIController{
if(target != null && unit.hasWeapons()){ if(target != null && unit.hasWeapons()){
if(unit.type.circleTarget){ if(unit.type.circleTarget){
circleAttack(120f); circleAttack(unit.type.circleTargetRadius);
}else{ }else{
moveTo(target, unit.type.range * 0.8f); moveTo(target, unit.type.range * 0.8f);
unit.lookAt(target); unit.lookAt(target);

View File

@@ -30,7 +30,7 @@ public class RepairAI extends AIController{
if(target != null && target instanceof Building b && b.team == unit.team){ if(target != null && target instanceof Building b && b.team == unit.team){
if(unit.type.circleTarget){ if(unit.type.circleTarget){
circleAttack(120f); circleAttack(unit.type.circleTargetRadius);
}else if(!target.within(unit, unit.type.range * 0.65f)){ }else if(!target.within(unit, unit.type.range * 0.65f)){
moveTo(target, unit.type.range * 0.65f); moveTo(target, unit.type.range * 0.65f);
} }

View File

@@ -3,25 +3,33 @@ package mindustry.audio;
import arc.*; import arc.*;
import arc.audio.*; import arc.audio.*;
import arc.struct.*; import arc.struct.*;
import mindustry.gen.*;
import static mindustry.gen.Sounds.*; import static mindustry.gen.Sounds.*;
/** Sets up priorities and groups for various sounds. */ /** Sets up priorities and groups for various sounds. */
public class SoundPriority{ public class SoundPriority{
static int lastGroup = 1;
public static void init(){ public static void init(){
max(7, laserbig, beam, laserbeam);
//priority 2: long weapon loops //priority 2: long weapon loops
set( set(
2f, 2f,
laserbig, laserbig,
beam beam,
laserbeam,
beamPlasma
); );
//priority 1.5: big weapon sounds, not loops //priority 1.5: big weapon sounds, not loops
set(1.5f, set(
1.5f,
railgun, railgun,
largeCannon largeCannon,
lasercharge,
lasercharge2,
lasercharge3
); );
//priority 1: ambient noises //priority 1: ambient noises
@@ -36,13 +44,35 @@ public class SoundPriority{
respawning respawning
); );
//this is spammed a LOT //very loud
Sounds.shootBig.setMinConcurrentInterrupt(shootBig.getLength() * 0.9f); laser.setMaxConcurrent(5);
sameGroup(flame, flamePlasma);
//sameGroup(hit1, hit2, hit3);
//max(4, hit1, hit2, hit3);
sameGroup(missile, missileShort, missilePlasmaShort);
sameGroup(spark, shock);
for(var sound : Core.assets.getAll(Sound.class, new Seq<>())){ for(var sound : Core.assets.getAll(Sound.class, new Seq<>())){
sound.setMinConcurrentInterrupt(Math.min(0.25f, sound.getLength() * 0.5f)); sound.setMinConcurrentInterrupt(Math.min(0.25f, sound.getLength() * 0.5f));
sound.setMaxConcurrent(7);
} }
mechStep.setMinConcurrentInterrupt(0.5f);
walkerStep.setMinConcurrentInterrupt(0.6f);
mechStep.setMaxConcurrent(4);
walkerStep.setMaxConcurrent(4);
}
static void max(int max, Sound... sounds){
for(var s : sounds) s.setMaxConcurrent(max);
}
static void sameGroup(Sound... sounds){
int id = lastGroup ++;
for(var s : sounds) s.setConcurrentGroup(id);
} }
static void set(float value, Sound... sounds){ static void set(float value, Sound... sounds){

View File

@@ -3298,6 +3298,7 @@ public class Blocks{
} }
}}; }};
shootSound = Sounds.shootDuo;
recoil = 0.5f; recoil = 0.5f;
shootY = 3f; shootY = 3f;
reload = 20f; reload = 20f;
@@ -3501,7 +3502,7 @@ public class Blocks{
inaccuracy = 1f; inaccuracy = 1f;
shootCone = 10f; shootCone = 10f;
health = 260; health = 260;
shootSound = Sounds.bang; shootSound = Sounds.artillerySmall;
coolant = consumeCoolant(0.1f); coolant = consumeCoolant(0.1f);
limitRange(0f); limitRange(0f);
}}; }};
@@ -3538,7 +3539,6 @@ public class Blocks{
flags = EnumSet.of(BlockFlag.turret, BlockFlag.extinguisher); flags = EnumSet.of(BlockFlag.turret, BlockFlag.extinguisher);
}}; }};
//TODO these may work in space, but what's the point?
lancer = new PowerTurret("lancer"){{ lancer = new PowerTurret("lancer"){{
requirements(Category.turret, with(Items.copper, 60, Items.lead, 70, Items.silicon, 60, Items.titanium, 30)); requirements(Category.turret, with(Items.copper, 60, Items.lead, 70, Items.silicon, 60, Items.titanium, 30));
range = 165f; range = 165f;
@@ -3558,6 +3558,7 @@ public class Blocks{
accurateDelay = false; accurateDelay = false;
shootSound = Sounds.laser; shootSound = Sounds.laser;
coolant = consumeCoolant(0.2f); coolant = consumeCoolant(0.2f);
chargeSound = Sounds.lasercharge3;
consumePower(6f); consumePower(6f);
@@ -3800,7 +3801,7 @@ public class Blocks{
ammoUseEffect = Fx.casing2; ammoUseEffect = Fx.casing2;
scaledHealth = 240; scaledHealth = 240;
shootSound = Sounds.shootBig; shootSound = Sounds.shootSalvo;
limitRange(); limitRange();
coolant = consumeCoolant(0.2f); coolant = consumeCoolant(0.2f);
@@ -3900,6 +3901,7 @@ public class Blocks{
scaledHealth = 220; scaledHealth = 220;
shootSound = Sounds.shotgun; shootSound = Sounds.shotgun;
shootSoundVolume = 0.9f;
coolant = consumeCoolant(0.3f); coolant = consumeCoolant(0.3f);
float brange = range + 10f; float brange = range + 10f;
@@ -3925,25 +3927,31 @@ public class Blocks{
ripple = new ItemTurret("ripple"){{ ripple = new ItemTurret("ripple"){{
requirements(Category.turret, with(Items.copper, 150, Items.graphite, 135, Items.titanium, 60)); requirements(Category.turret, with(Items.copper, 150, Items.graphite, 135, Items.titanium, 60));
ammo( ammo(
Items.graphite, new ArtilleryBulletType(3f, 20){{ Items.graphite, new ArtilleryBulletType(3f, 40){{
hitEffect = new MultiEffect(Fx.flakExplosion, Fx.shockwaveSmaller);
knockback = 0.8f; knockback = 0.8f;
lifetime = 80f; lifetime = 80f;
width = height = 11f; width = 12f;
height = 14f;
collidesTiles = false; collidesTiles = false;
splashDamageRadius = 25f * 0.75f; splashDamageRadius = 30f * 0.75f;
splashDamage = 33f; splashDamage = 70f;
backColor = hitColor = trailColor = Pal.graphiteAmmoBack; backColor = hitColor = trailColor = Pal.graphiteAmmoBack;
frontColor = Pal.graphiteAmmoFront; frontColor = Pal.graphiteAmmoFront;
despawnEffect = Fx.hitBulletColor; despawnEffect = Fx.hitBulletColor;
lifeScaleRandMax = 1.08f;
lifeScaleRandMin = 0.95f;
}}, }},
Items.silicon, new ArtilleryBulletType(3f, 20){{ Items.silicon, new ArtilleryBulletType(3f, 40){{
hitEffect = new MultiEffect(Fx.flakExplosion, Fx.shockwaveSmaller);
knockback = 0.8f; knockback = 0.8f;
lifetime = 80f; lifetime = 80f;
width = height = 11f; width = 12f;
height = 14f;
collidesTiles = false; collidesTiles = false;
splashDamageRadius = 25f * 0.75f; splashDamageRadius = 30f * 0.75f;
splashDamage = 33f; splashDamage = 70f;
reloadMultiplier = 1.2f; reloadMultiplier = 1.2f;
ammoMultiplier = 3f; ammoMultiplier = 3f;
homingPower = 0.08f; homingPower = 0.08f;
@@ -3955,15 +3963,18 @@ public class Blocks{
despawnEffect = Fx.hitBulletColor; despawnEffect = Fx.hitBulletColor;
backColor = hitColor = trailColor = Pal.siliconAmmoBack; backColor = hitColor = trailColor = Pal.siliconAmmoBack;
frontColor = Pal.siliconAmmoFront; frontColor = Pal.siliconAmmoFront;
lifeScaleRandMax = 1.08f;
lifeScaleRandMin = 0.95f;
}}, }},
Items.pyratite, new ArtilleryBulletType(3f, 24){{ Items.pyratite, new ArtilleryBulletType(3f, 48){{
hitEffect = Fx.blastExplosion; hitEffect = new MultiEffect(Fx.blastExplosion, Fx.shockwave);
knockback = 0.8f; knockback = 0.8f;
lifetime = 80f; lifetime = 80f;
width = height = 13f; width = 13f;
height = 15f;
collidesTiles = false; collidesTiles = false;
splashDamageRadius = 25f * 0.75f; splashDamageRadius = 30f * 0.75f;
splashDamage = 45f; splashDamage = 90f;
status = StatusEffects.burning; status = StatusEffects.burning;
statusDuration = 60f * 12f; statusDuration = 60f * 12f;
frontColor = Pal.lightishOrange; frontColor = Pal.lightishOrange;
@@ -3972,32 +3983,38 @@ public class Blocks{
trailEffect = Fx.incendTrail; trailEffect = Fx.incendTrail;
ammoMultiplier = 4f; ammoMultiplier = 4f;
despawnEffect = Fx.hitBulletColor; despawnEffect = Fx.hitBulletColor;
lifeScaleRandMax = 1.08f;
lifeScaleRandMin = 0.95f;
}}, }},
Items.blastCompound, new ArtilleryBulletType(2f, 20, "shell"){{ Items.blastCompound, new ArtilleryBulletType(2f, 40, "shell"){{
hitEffect = Fx.blastExplosion; hitEffect = new MultiEffect(Fx.blastExplosion, Fx.shockwave);
knockback = 0.8f; knockback = 0.8f;
lifetime = 80f; lifetime = 80f;
width = height = 14f; width = 14f;
height = 16f;
collidesTiles = false; collidesTiles = false;
ammoMultiplier = 4f; ammoMultiplier = 4f;
splashDamageRadius = 45f * 0.75f; splashDamageRadius = 50f * 0.75f;
splashDamage = 55f; splashDamage = 90f;
status = StatusEffects.blasted; status = StatusEffects.blasted;
lifeScaleRandMax = 1.08f;
lifeScaleRandMin = 0.95f;
despawnEffect = Fx.hitBulletColor; despawnEffect = Fx.hitBulletColor;
backColor = hitColor = trailColor = Pal.blastAmmoBack; backColor = hitColor = trailColor = Pal.blastAmmoBack;
frontColor = Pal.blastAmmoFront; frontColor = Pal.blastAmmoFront;
}}, }},
Items.plastanium, new ArtilleryBulletType(3.4f, 20, "shell"){{ Items.plastanium, new ArtilleryBulletType(3.4f, 40, "shell"){{
hitEffect = Fx.plasticExplosion; hitEffect = new MultiEffect(Fx.plasticExplosion, Fx.shockwave);
knockback = 1f; knockback = 1f;
lifetime = 80f; lifetime = 80f;
width = height = 13f; width = 13f;
height = 15f;
collidesTiles = false; collidesTiles = false;
splashDamageRadius = 35f * 0.75f; splashDamageRadius = 40f * 0.75f;
splashDamage = 45f; splashDamage = 90f;
fragBullet = new BasicBulletType(2.5f, 10, "bullet"){{ fragBullet = new BasicBulletType(2.5f, 14, "bullet"){{
width = 10f; width = 10f;
height = 12f; height = 12f;
shrinkY = 1f; shrinkY = 1f;
@@ -4007,21 +4024,24 @@ public class Blocks{
despawnEffect = Fx.none; despawnEffect = Fx.none;
collidesAir = false; collidesAir = false;
}}; }};
fragBullets = 10; fragBullets = 15;
backColor = Pal.plastaniumBack; backColor = Pal.plastaniumBack;
frontColor = Pal.plastaniumFront; frontColor = Pal.plastaniumFront;
lifeScaleRandMax = 1.08f;
lifeScaleRandMin = 0.95f;
}} }}
); );
targetAir = false; targetAir = false;
size = 3; size = 3;
shoot.shots = 4; shoot.shots = 4;
inaccuracy = 12f; inaccuracy = 11f;
reload = 60f; reload = 120f;
ammoEjectBack = 5f; ammoEjectBack = 5f;
ammoUseEffect = Fx.casing3Double; ammoUseEffect = Fx.casing3Double;
ammoPerShot = 2; ammoPerShot = 2;
velocityRnd = 0.2f; velocityRnd = 0.2f;
scaleLifetimeOffset = 1f / 9f; scaleLifetimeOffset = 1f / 9f;
recoil = 6f; recoil = 6f;
shake = 2f; shake = 2f;
@@ -4030,7 +4050,7 @@ public class Blocks{
coolant = consumeCoolant(0.3f); coolant = consumeCoolant(0.3f);
scaledHealth = 130; scaledHealth = 130;
shootSound = Sounds.artillery; shootSound = Sounds.shootRipple;
}}; }};
cyclone = new ItemTurret("cyclone"){{ cyclone = new ItemTurret("cyclone"){{
@@ -4143,7 +4163,7 @@ public class Blocks{
rotateSpeed = 10f; rotateSpeed = 10f;
inaccuracy = 10f; inaccuracy = 10f;
shootCone = 30f; shootCone = 30f;
shootSound = Sounds.shootSnap; shootSound = Sounds.shootCyclone;
coolant = consumeCoolant(0.3f); coolant = consumeCoolant(0.3f);
scaledHealth = 145; scaledHealth = 145;
@@ -4251,7 +4271,7 @@ public class Blocks{
shake = 2f; shake = 2f;
size = 4; size = 4;
shootCone = 24f; shootCone = 24f;
shootSound = Sounds.shootBig; shootSound = Sounds.shootSpectre;
scaledHealth = 160; scaledHealth = 160;
coolant = consumeCoolant(1f); coolant = consumeCoolant(1f);

View File

@@ -1530,6 +1530,12 @@ public class Fx{
Lines.circle(e.x, e.y, e.fin() * 28f); Lines.circle(e.x, e.y, e.fin() * 28f);
}), }),
shockwaveSmaller = new Effect(9f, 80f, e -> {
color(Color.white, Color.lightGray, e.fin());
stroke(e.fout() * 2f + 0.2f);
Lines.circle(e.x, e.y, e.fin() * 22f);
}),
bigShockwave = new Effect(10f, 80f, e -> { bigShockwave = new Effect(10f, 80f, e -> {
color(Color.white, Color.lightGray, e.fin()); color(Color.white, Color.lightGray, e.fin());
stroke(e.fout() * 3f); stroke(e.fout() * 3f);
@@ -2017,18 +2023,18 @@ public class Fx{
shootSmallFlame = new Effect(32f, 80f, e -> { shootSmallFlame = new Effect(32f, 80f, e -> {
color(Pal.lightFlame, Pal.darkFlame, Color.gray, e.fin()); color(Pal.lightFlame, Pal.darkFlame, Color.gray, e.fin());
randLenVectors(e.id, 8, e.finpow() * 60f, e.rotation, 10f, (x, y) -> { randLenVectors(e.id, 12, e.finpow() * 60f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f); Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f);
}); });
}), }).followParent(false),
shootPyraFlame = new Effect(33f, 80f, e -> { shootPyraFlame = new Effect(33f, 80f, e -> {
color(Pal.lightPyraFlame, Pal.darkPyraFlame, Color.gray, e.fin()); color(Pal.lightPyraFlame, Pal.darkPyraFlame, Color.gray, e.fin());
randLenVectors(e.id, 10, e.finpow() * 70f, e.rotation, 10f, (x, y) -> { randLenVectors(e.id, 13, e.finpow() * 70f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.6f); Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.6f);
}); });
}), }).followParent(false),
shootLiquid = new Effect(15f, 80f, e -> { shootLiquid = new Effect(15f, 80f, e -> {
color(e.color); color(e.color);

View File

@@ -103,6 +103,7 @@ public class UnitTypes{
hitSize = 8f; hitSize = 8f;
health = 150; health = 150;
weapons.add(new Weapon("large-weapon"){{ weapons.add(new Weapon("large-weapon"){{
shootSound = Sounds.shootDagger;
reload = 13f; reload = 13f;
x = 4f; x = 4f;
y = 2f; y = 2f;
@@ -122,24 +123,23 @@ public class UnitTypes{
health = 550; health = 550;
armor = 4f; armor = 4f;
ammoType = new ItemAmmoType(Items.coal); ammoType = new ItemAmmoType(Items.coal);
immunities.add(StatusEffects.burning); immunities.add(StatusEffects.burning);
weapons.add(new Weapon("flamethrower"){{ weapons.add(new Weapon("flamethrower"){{
top = false; top = false;
shootSound = Sounds.flame; shootSound = Sounds.flame;
shootY = 2f; shootY = 2f;
reload = 11f; reload = 22f;
recoil = 1f; recoil = 1f;
ejectEffect = Fx.none; ejectEffect = Fx.none;
bullet = new BulletType(4.2f, 37f){{ bullet = new BulletType(4.2f, 37f*2f){{
ammoMultiplier = 3f; ammoMultiplier = 3f;
hitSize = 7f; hitSize = 7f;
lifetime = 13f; lifetime = 13f;
pierce = true; pierce = true;
pierceBuilding = true; pierceBuilding = true;
pierceCap = 2; pierceCap = 2;
statusDuration = 60f * 4; statusDuration = 60f * 5;
shootEffect = Fx.shootSmallFlame; shootEffect = Fx.shootSmallFlame;
hitEffect = Fx.hitFlameSmall; hitEffect = Fx.hitFlameSmall;
despawnEffect = Fx.none; despawnEffect = Fx.none;
@@ -197,6 +197,8 @@ public class UnitTypes{
stepShake = 0.15f; stepShake = 0.15f;
singleTarget = true; singleTarget = true;
drownTimeMultiplier = 1.5f; drownTimeMultiplier = 1.5f;
stepSound = Sounds.mechStep;
stepSoundVolume = 0.25f;
abilities.add(new ShieldRegenFieldAbility(25f, 250f, 60f * 1, 60f)); abilities.add(new ShieldRegenFieldAbility(25f, 250f, 60f * 1, 60f));
@@ -216,7 +218,7 @@ public class UnitTypes{
recoil = 5f; recoil = 5f;
shake = 2f; shake = 2f;
ejectEffect = Fx.casing3; ejectEffect = Fx.casing3;
shootSound = Sounds.bang; shootSound = Sounds.shootScepter;
inaccuracy = 3f; inaccuracy = 3f;
shoot.shots = 3; shoot.shots = 3;
@@ -232,6 +234,7 @@ public class UnitTypes{
lightningColor = Pal.surge; lightningColor = Pal.surge;
//standard bullet damage is far too much for lightning //standard bullet damage is far too much for lightning
lightningDamage = 20; lightningDamage = 20;
despawnSound = Sounds.sparkBullet;
}}; }};
}}, }},
@@ -242,6 +245,7 @@ public class UnitTypes{
rotate = true; rotate = true;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
bullet = smallBullet; bullet = smallBullet;
shootSound = Sounds.shootDagger;
}}, }},
new Weapon("mount-weapon"){{ new Weapon("mount-weapon"){{
reload = 16f; reload = 16f;
@@ -250,6 +254,7 @@ public class UnitTypes{
rotate = true; rotate = true;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
bullet = smallBullet; bullet = smallBullet;
shootSound = Sounds.shootDagger;
}} }}
); );
}}; }};
@@ -266,6 +271,7 @@ public class UnitTypes{
mechFrontSway = 1.9f; mechFrontSway = 1.9f;
mechSideSway = 0.6f; mechSideSway = 0.6f;
ammoType = new ItemAmmoType(Items.thorium); ammoType = new ItemAmmoType(Items.thorium);
stepSound = Sounds.mechStep;
weapons.add( weapons.add(
new Weapon("reign-weapon"){{ new Weapon("reign-weapon"){{
@@ -277,7 +283,7 @@ public class UnitTypes{
recoil = 5f; recoil = 5f;
shake = 2f; shake = 2f;
ejectEffect = Fx.casing4; ejectEffect = Fx.casing4;
shootSound = Sounds.bang; shootSound = Sounds.shootReign;
bullet = new BasicBulletType(13f, 80){{ bullet = new BasicBulletType(13f, 80){{
pierce = true; pierce = true;
@@ -295,6 +301,7 @@ public class UnitTypes{
fragBullets = 3; fragBullets = 3;
fragLifeMin = 0f; fragLifeMin = 0f;
fragRandomSpread = 30f; fragRandomSpread = 30f;
despawnSound = Sounds.explosion;
fragBullet = new BasicBulletType(9f, 20){{ fragBullet = new BasicBulletType(9f, 20){{
width = 10f; width = 10f;
@@ -380,7 +387,7 @@ public class UnitTypes{
ejectEffect = Fx.none; ejectEffect = Fx.none;
recoil = 2.5f; recoil = 2.5f;
shootSound = Sounds.spark; shootSound = Sounds.shock;
bullet = new LightningBulletType(){{ bullet = new LightningBulletType(){{
lightningColor = hitColor = Pal.heal; lightningColor = hitColor = Pal.heal;
@@ -475,6 +482,8 @@ public class UnitTypes{
immunities = ObjectSet.with(StatusEffects.burning); immunities = ObjectSet.with(StatusEffects.burning);
singleTarget = true; singleTarget = true;
stepSound = Sounds.mechStep;
stepSoundVolume = 0.25f;
weapons.add(new Weapon("vela-weapon"){{ weapons.add(new Weapon("vela-weapon"){{
mirror = false; mirror = false;
@@ -489,7 +498,8 @@ public class UnitTypes{
reload = 155f; reload = 155f;
recoil = 0f; recoil = 0f;
chargeSound = Sounds.lasercharge2; chargeSound = Sounds.lasercharge2;
shootSound = Sounds.beam; shootSound = Sounds.beamPlasma;
initialShootSound = Sounds.beamPlasmaFire;
continuous = true; continuous = true;
cooldownTime = 200f; cooldownTime = 200f;
@@ -541,6 +551,10 @@ public class UnitTypes{
rotateSpeed = 1.5f; rotateSpeed = 1.5f;
drownTimeMultiplier = 1.6f; drownTimeMultiplier = 1.6f;
stepSound = Sounds.walkerStep;
stepSoundVolume = 1.1f;
stepSoundPitch = 0.9f;
legCount = 4; legCount = 4;
legLength = 14f; legLength = 14f;
legBaseOffset = 11f; legBaseOffset = 11f;
@@ -623,13 +637,13 @@ public class UnitTypes{
reload = 24f; reload = 24f;
shootCone = 180f; shootCone = 180f;
ejectEffect = Fx.none; ejectEffect = Fx.none;
shootSound = Sounds.explosion; shootSound = Sounds.crawlerExplosion;
shootSoundVolume = 0.4f;
x = shootY = 0f; x = shootY = 0f;
mirror = false; mirror = false;
bullet = new BulletType(){{ bullet = new BulletType(){{
collidesTiles = false; collidesTiles = false;
collides = false; collides = false;
hitSound = Sounds.explosion;
rangeOverride = 25f; rangeOverride = 25f;
hitEffect = Fx.pulverize; hitEffect = Fx.pulverize;
@@ -671,7 +685,7 @@ public class UnitTypes{
ejectEffect = Fx.none; ejectEffect = Fx.none;
recoil = 1f; recoil = 1f;
x = 7f; x = 7f;
shootSound = Sounds.flame; shootSound = Sounds.shootAtrax;
bullet = new LiquidBulletType(Liquids.slag){{ bullet = new LiquidBulletType(Liquids.slag){{
damage = 13; damage = 13;
@@ -768,6 +782,10 @@ public class UnitTypes{
legSpeed = 0.2f; legSpeed = 0.2f;
ammoType = new PowerAmmoType(2000); ammoType = new PowerAmmoType(2000);
stepSound = Sounds.walkerStep;
stepSoundVolume = 0.75f;
stepSoundPitch = 1.1f;
legSplashDamage = 32; legSplashDamage = 32;
legSplashRange = 30; legSplashRange = 30;
@@ -820,13 +838,14 @@ public class UnitTypes{
shake = 3f; shake = 3f;
rotateSpeed = 2f; rotateSpeed = 2f;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.artillery; shootSound = Sounds.artillerySap;
rotate = true; rotate = true;
shadow = 8f; shadow = 8f;
recoil = 3f; recoil = 3f;
bullet = new ArtilleryBulletType(2f, 12){{ bullet = new ArtilleryBulletType(2f, 12){{
hitEffect = Fx.sapExplosion; hitEffect = Fx.sapExplosion;
despawnSound = Sounds.artilleryShockExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 70f; lifetime = 70f;
width = height = 19f; width = height = 19f;
@@ -854,6 +873,8 @@ public class UnitTypes{
health = 22000; health = 22000;
armor = 13f; armor = 13f;
lightRadius = 140f; lightRadius = 140f;
stepSound = Sounds.walkerStep;
stepSoundVolume = 1.1f;
rotateSpeed = 1.9f; rotateSpeed = 1.9f;
@@ -885,7 +906,8 @@ public class UnitTypes{
shake = 4f; shake = 4f;
rotateSpeed = 2f; rotateSpeed = 2f;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.shootBig; shootSound = Sounds.shotgunSap;
shootSoundVolume = 0.8f;
rotate = true; rotate = true;
shadow = 12f; shadow = 12f;
recoil = 3f; recoil = 3f;
@@ -917,13 +939,14 @@ public class UnitTypes{
recoil = 10f; recoil = 10f;
rotateSpeed = 1f; rotateSpeed = 1f;
ejectEffect = Fx.casing3; ejectEffect = Fx.casing3;
shootSound = Sounds.artillery; shootSound = Sounds.artillerySapBig;
rotate = true; rotate = true;
shadow = 30f; shadow = 30f;
rotationLimit = 80f; rotationLimit = 80f;
bullet = new ArtilleryBulletType(3f, 50){{ bullet = new ArtilleryBulletType(3f, 50){{
despawnSound = Sounds.artilleryShockExplosionBig;
hitEffect = Fx.sapExplosion; hitEffect = Fx.sapExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 80f; lifetime = 80f;
@@ -949,6 +972,7 @@ public class UnitTypes{
fragBullets = 9; fragBullets = 9;
fragBullet = new ArtilleryBulletType(2.3f, 30){{ fragBullet = new ArtilleryBulletType(2.3f, 30){{
despawnSound = Sounds.artilleryShockExplosion;
hitEffect = Fx.sapExplosion; hitEffect = Fx.sapExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 90f; lifetime = 90f;
@@ -984,18 +1008,25 @@ public class UnitTypes{
flying = true; flying = true;
health = 70; health = 70;
engineOffset = 5.75f; engineOffset = 5.75f;
//TODO balance
//targetAir = false;
targetFlags = new BlockFlag[]{BlockFlag.generator, null}; targetFlags = new BlockFlag[]{BlockFlag.generator, null};
hitSize = 9; hitSize = 9;
itemCapacity = 10; itemCapacity = 10;
circleTarget = true;
omniMovement = false;
rotateSpeed = 5f;
circleTargetRadius = 60f;
weapons.add(new Weapon(){{ weapons.add(new Weapon(){{
y = 0f; y = 1f;
x = 2f; x = 0f;
reload = 20f; minShootVelocity = 2f;
shootCone = 10f;
reload = 80f;
shoot.shots = 3;
shoot.shotDelay = 3f;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
bullet = new BasicBulletType(2.5f, 9){{ mirror = false;
bullet = new BasicBulletType(2.5f, 16){{
width = 7f; width = 7f;
height = 9f; height = 9f;
lifetime = 45f; lifetime = 45f;
@@ -1003,7 +1034,7 @@ public class UnitTypes{
smokeEffect = Fx.shootSmallSmoke; smokeEffect = Fx.shootSmallSmoke;
ammoMultiplier = 2; ammoMultiplier = 2;
}}; }};
shootSound = Sounds.pew; shootSound = Sounds.shootDagger;
}}); }});
}}; }};
@@ -1024,9 +1055,12 @@ public class UnitTypes{
targetFlags = new BlockFlag[]{BlockFlag.factory, null}; targetFlags = new BlockFlag[]{BlockFlag.factory, null};
circleTarget = true; circleTarget = true;
ammoType = new ItemAmmoType(Items.graphite); ammoType = new ItemAmmoType(Items.graphite);
omniMovement = false;
rotateSpeed = 4.5f;
circleTargetRadius = 40f;
weapons.add(new Weapon(){{ weapons.add(new Weapon(){{
minShootVelocity = 0.75f; minShootVelocity = 1f;
x = 3f; x = 3f;
shootY = 0f; shootY = 0f;
reload = 12f; reload = 12f;
@@ -1034,7 +1068,8 @@ public class UnitTypes{
ejectEffect = Fx.none; ejectEffect = Fx.none;
inaccuracy = 15f; inaccuracy = 15f;
ignoreRotation = true; ignoreRotation = true;
shootSound = Sounds.none; shootSound = Sounds.bombDrop;
soundPitchMax = 1.2f;
bullet = new BombBulletType(27f, 25f){{ bullet = new BombBulletType(27f, 25f){{
width = 10f; width = 10f;
height = 14f; height = 14f;
@@ -1074,7 +1109,7 @@ public class UnitTypes{
shoot.shots = 2; shoot.shots = 2;
inaccuracy = 5f; inaccuracy = 5f;
velocityRnd = 0.2f; velocityRnd = 0.2f;
shootSound = Sounds.missile; shootSound = Sounds.missileLong;
bullet = new MissileBulletType(3f, 14){{ bullet = new MissileBulletType(3f, 14){{
width = 8f; width = 8f;
@@ -1159,7 +1194,7 @@ public class UnitTypes{
shake = 1f; shake = 1f;
rotateSpeed = 2f; rotateSpeed = 2f;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.shootBig; shootSound = Sounds.shootSpectre;
rotate = true; rotate = true;
shadow = 8f; shadow = 8f;
bullet = new BasicBulletType(7f, 55){{ bullet = new BasicBulletType(7f, 55){{
@@ -1208,7 +1243,7 @@ public class UnitTypes{
rotateSpeed = 2f; rotateSpeed = 2f;
reload = 45f; reload = 45f;
recoil = 4f; recoil = 4f;
shootSound = Sounds.laser; shootSound = Sounds.laser2;
shadow = 20f; shadow = 20f;
rotate = true; rotate = true;
@@ -1228,7 +1263,7 @@ public class UnitTypes{
y = 27f; y = 27f;
rotateSpeed = 2f; rotateSpeed = 2f;
reload = 9f; reload = 9f;
shootSound = Sounds.shoot; shootSound = Sounds.shootCyclone;
shadow = 7f; shadow = 7f;
rotate = true; rotate = true;
recoil = 0.5f; recoil = 0.5f;
@@ -1242,7 +1277,7 @@ public class UnitTypes{
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
rotateSpeed = 7f; rotateSpeed = 7f;
shake = 1f; shake = 1f;
shootSound = Sounds.shoot; shootSound = Sounds.shootCyclone;
rotate = true; rotate = true;
shadow = 12f; shadow = 12f;
shootY = 7.25f; shootY = 7.25f;
@@ -1301,7 +1336,7 @@ public class UnitTypes{
reload = 30f; reload = 30f;
ejectEffect = Fx.none; ejectEffect = Fx.none;
recoil = 2f; recoil = 2f;
shootSound = Sounds.missile; shootSound = Sounds.missilePlasmaShort;
velocityRnd = 0.5f; velocityRnd = 0.5f;
inaccuracy = 15f; inaccuracy = 15f;
alternate = true; alternate = true;
@@ -1498,6 +1533,7 @@ public class UnitTypes{
y = 1.5f; y = 1.5f;
rotate = true; rotate = true;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.shootDagger;
bullet = new BasicBulletType(2.5f, 9){{ bullet = new BasicBulletType(2.5f, 9){{
width = 7f; width = 7f;
height = 9f; height = 9f;
@@ -1513,7 +1549,7 @@ public class UnitTypes{
y = -5f; y = -5f;
rotate = true; rotate = true;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.missile; shootSound = Sounds.missileShort;
bullet = new MissileBulletType(2.7f, 12, "missile"){{ bullet = new MissileBulletType(2.7f, 12, "missile"){{
keepVelocity = true; keepVelocity = true;
width = 8f; width = 8f;
@@ -1559,7 +1595,7 @@ public class UnitTypes{
rotateSpeed = 5f; rotateSpeed = 5f;
inaccuracy = 8f; inaccuracy = 8f;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.shoot; shootSound = Sounds.shootDuo;
bullet = new FlakBulletType(4.2f, 3){{ bullet = new FlakBulletType(4.2f, 3){{
lifetime = 60f; lifetime = 60f;
ammoMultiplier = 4f; ammoMultiplier = 4f;
@@ -1581,7 +1617,7 @@ public class UnitTypes{
rotateSpeed = 2f; rotateSpeed = 2f;
shake = 1.5f; shake = 1.5f;
ejectEffect = Fx.casing2; ejectEffect = Fx.casing2;
shootSound = Sounds.bang; shootSound = Sounds.artillerySmall;
bullet = new ArtilleryBulletType(3f, 20, "shell"){{ bullet = new ArtilleryBulletType(3f, 20, "shell"){{
hitEffect = Fx.flakExplosion; hitEffect = Fx.flakExplosion;
knockback = 0.8f; knockback = 0.8f;
@@ -1665,7 +1701,7 @@ public class UnitTypes{
inaccuracy = 5f; inaccuracy = 5f;
velocityRnd = 0.1f; velocityRnd = 0.1f;
shootSound = Sounds.missile; shootSound = Sounds.missileShort;
ammoType = new ItemAmmoType(Items.thorium); ammoType = new ItemAmmoType(Items.thorium);
ejectEffect = Fx.none; ejectEffect = Fx.none;
@@ -1724,7 +1760,7 @@ public class UnitTypes{
inaccuracy = 7f; inaccuracy = 7f;
ejectEffect = Fx.none; ejectEffect = Fx.none;
shake = 1f; shake = 1f;
shootSound = Sounds.missile; shootSound = Sounds.missileLong;
shoot = new ShootAlternate(){{ shoot = new ShootAlternate(){{
shots = 6; shots = 6;
@@ -1766,7 +1802,7 @@ public class UnitTypes{
recoil = 3f; recoil = 3f;
shadow = 12f; shadow = 12f;
ejectEffect = Fx.casing3; ejectEffect = Fx.casing3;
shootSound = Sounds.shootBig; shootSound = Sounds.shootSpectre;
shoot.shots = 3; shoot.shots = 3;
shoot.shotDelay = 4f; shoot.shotDelay = 4f;
@@ -1792,10 +1828,6 @@ public class UnitTypes{
faceTarget = false; faceTarget = false;
ammoType = new PowerAmmoType(4000); ammoType = new PowerAmmoType(4000);
float spawnTime = 60f * 15f;
abilities.add(new UnitSpawnAbility(flare, spawnTime, 19.25f, -31.75f), new UnitSpawnAbility(flare, spawnTime, -19.25f, -31.75f));
trailLength = 70; trailLength = 70;
waveTrailX = 23f; waveTrailX = 23f;
waveTrailY = -32f; waveTrailY = -32f;
@@ -1813,7 +1845,7 @@ public class UnitTypes{
shake = 6f; shake = 6f;
recoil = 10.5f; recoil = 10.5f;
shadow = 50f; shadow = 50f;
shootSound = Sounds.railgun; shootSound = Sounds.shootOmura;
ejectEffect = Fx.none; ejectEffect = Fx.none;
@@ -1886,8 +1918,9 @@ public class UnitTypes{
rotate = true; rotate = true;
reload = 90f; reload = 90f;
x = y = shootX = shootY = 0f; x = y = shootX = shootY = 0f;
shootSound = Sounds.mineDeploy; shootSound = Sounds.missilePlasmaShort;
rotateSpeed = 180f; rotateSpeed = 180f;
shootSoundVolume = 0.9f;
shoot.shots = 3; shoot.shots = 3;
shoot.shotDelay = 7f; shoot.shotDelay = 7f;
@@ -1906,7 +1939,7 @@ public class UnitTypes{
frontColor = Color.white; frontColor = Color.white;
mixColorTo = Color.white; mixColorTo = Color.white;
hitSound = Sounds.plasmaboom; hitSound = Sounds.explosionPlasmaSmall;
underwater = true; underwater = true;
ejectEffect = Fx.none; ejectEffect = Fx.none;
@@ -1968,7 +2001,8 @@ public class UnitTypes{
rotateSpeed = 5f; rotateSpeed = 5f;
inaccuracy = 10f; inaccuracy = 10f;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.flame; shootSound = Sounds.flamePlasma;
shootSoundVolume = 0.9f;
shootCone = 30f; shootCone = 30f;
bullet = new BulletType(3.4f, 23f){{ bullet = new BulletType(3.4f, 23f){{
@@ -2057,7 +2091,7 @@ public class UnitTypes{
rotate = true; rotate = true;
inaccuracy = 1f; inaccuracy = 1f;
velocityRnd = 0.1f; velocityRnd = 0.1f;
shootSound = Sounds.missile; shootSound = Sounds.missilePlasma;
ejectEffect = Fx.none; ejectEffect = Fx.none;
bullet = new FlakBulletType(2.5f, 25){{ bullet = new FlakBulletType(2.5f, 25){{
@@ -2073,6 +2107,7 @@ public class UnitTypes{
lightRadius = 60f; lightRadius = 60f;
lightOpacity = 0.7f; lightOpacity = 0.7f;
lightColor = Pal.heal; lightColor = Pal.heal;
despawnSound = Sounds.explosion;
splashDamageRadius = 30f; splashDamageRadius = 30f;
splashDamage = 25f; splashDamage = 25f;
@@ -2240,7 +2275,8 @@ public class UnitTypes{
rotateSpeed = 3.5f; rotateSpeed = 3.5f;
reload = 170f; reload = 170f;
recoil = 1f; recoil = 1f;
shootSound = Sounds.beam; shootSound = Sounds.beamPlasmaSmall;
initialShootSound = Sounds.beamPlasmaFireSmall;
continuous = true; continuous = true;
cooldownTime = reload; cooldownTime = reload;
immunities.add(StatusEffects.burning); immunities.add(StatusEffects.burning);
@@ -2291,8 +2327,7 @@ public class UnitTypes{
shootY = 7f; shootY = 7f;
recoil = 4f; recoil = 4f;
cooldownTime = reload - 10f; cooldownTime = reload - 10f;
//TODO better sound shootSound = Sounds.shootNavanax;
shootSound = Sounds.laser;
bullet = new EmpBulletType(){{ bullet = new EmpBulletType(){{
float rad = 100f; float rad = 100f;
@@ -2326,7 +2361,7 @@ public class UnitTypes{
hitShake = 4f; hitShake = 4f;
trailRotation = true; trailRotation = true;
status = StatusEffects.electrified; status = StatusEffects.electrified;
hitSound = Sounds.plasmaboom; hitSound = Sounds.empBlast;
trailEffect = new Effect(16f, e -> { trailEffect = new Effect(16f, e -> {
color(Pal.heal); color(Pal.heal);
@@ -2431,15 +2466,14 @@ public class UnitTypes{
health = 170f; health = 170f;
engineOffset = 6f; engineOffset = 6f;
hitSize = 9f; hitSize = 9f;
faceTarget = false;
lowAltitude = true; lowAltitude = true;
weapons.add(new Weapon("small-mount-weapon"){{ weapons.add(new Weapon("small-mount-weapon"){{
top = false; top = false;
reload = 20f; reload = 20f;
x = 3f; x = 3f;
y = 0.5f; y = 1f;
rotate = true; recoil = 1f;
shoot.shots = 2; shoot.shots = 2;
shoot.shotDelay = 4f; shoot.shotDelay = 4f;
@@ -2533,6 +2567,7 @@ public class UnitTypes{
researchCostMultiplier = 0f; researchCostMultiplier = 0f;
weapons.add(new Weapon("stell-weapon"){{ weapons.add(new Weapon("stell-weapon"){{
shootSound = Sounds.shootStell;
layerOffset = 0.0001f; layerOffset = 0.0001f;
reload = 50f; reload = 50f;
shootY = 4.5f; shootY = 4.5f;
@@ -2797,6 +2832,7 @@ public class UnitTypes{
recoil = 2f; recoil = 2f;
rotate = true; rotate = true;
rotateSpeed = 2f; rotateSpeed = 2f;
shootSound = Sounds.shootStell;
bullet = new BasicBulletType(4.5f, 25){{ bullet = new BasicBulletType(4.5f, 25){{
width = 6.5f; width = 6.5f;
@@ -3349,6 +3385,10 @@ public class UnitTypes{
legMaxLength = 1.3f; legMaxLength = 1.3f;
researchCostMultiplier = 0f; researchCostMultiplier = 0f;
stepSound = Sounds.walkerStep;
stepSoundVolume = 1f;
stepSoundPitch = 1f;
abilities.add(new ShieldArcAbility(){{ abilities.add(new ShieldArcAbility(){{
region = "tecta-shield"; region = "tecta-shield";
radius = 45f; radius = 45f;
@@ -3452,6 +3492,10 @@ public class UnitTypes{
legStraightness = 0.6f; legStraightness = 0.6f;
baseLegStraightness = 0.5f; baseLegStraightness = 0.5f;
stepSound = Sounds.walkerStep;
stepSoundVolume = 1.1f;
stepSoundPitch = 0.9f;
legCount = 8; legCount = 8;
legLength = 30f; legLength = 30f;
legForwardScl = 2.1f; legForwardScl = 2.1f;

View File

@@ -44,7 +44,7 @@ public class GameState{
/** Team data. Gets reset every new game. */ /** Team data. Gets reset every new game. */
public Teams teams = new Teams(); public Teams teams = new Teams();
/** Handles JSON edits of game content. */ /** Handles JSON edits of game content. */
public ContentPatcher patcher = new ContentPatcher(); public DataPatcher patcher = new DataPatcher();
/** Number of enemies in the game; only used clientside in servers. */ /** Number of enemies in the game; only used clientside in servers. */
public int enemies; public int enemies;
/** Map being playtested (not edited!) */ /** Map being playtested (not edited!) */

View File

@@ -14,14 +14,14 @@ public class ArtilleryBulletType extends BasicBulletType{
collidesAir = false; collidesAir = false;
scaleLife = true; scaleLife = true;
hitShake = 1f; hitShake = 1f;
hitSound = Sounds.explosion; hitSound = Sounds.artilleryExplosion;
hitEffect = Fx.flakExplosion; hitEffect = Fx.flakExplosion;
shootEffect = Fx.shootBig; shootEffect = Fx.shootBig;
trailEffect = Fx.artilleryTrail; trailEffect = Fx.artilleryTrail;
//default settings: //default settings:
shrinkX = 0.15f; shrinkX = 0.15f;
shrinkY = 0.63f; shrinkY = 0.5f;
shrinkInterp = Interp.slope; shrinkInterp = Interp.slope;
//for trail: //for trail:

View File

@@ -25,6 +25,9 @@ public class BasicBulletType extends BulletType{
public BasicBulletType(float speed, float damage, String bulletSprite){ public BasicBulletType(float speed, float damage, String bulletSprite){
super(speed, damage); super(speed, damage);
this.sprite = bulletSprite; this.sprite = bulletSprite;
hitSoundPitchRange = 0.2f;
hitSoundVolume = 0.4f;
} }
public BasicBulletType(float speed, float damage){ public BasicBulletType(float speed, float damage){

View File

@@ -81,7 +81,7 @@ public class BulletType extends Content implements Cloneable{
/** Sound made when hitting something or getting removed.*/ /** Sound made when hitting something or getting removed.*/
public Sound despawnSound = Sounds.none; public Sound despawnSound = Sounds.none;
/** Pitch of the sound made when hitting something */ /** Pitch of the sound made when hitting something */
public float hitSoundPitch = 1; public float hitSoundPitch = 1, hitSoundPitchRange = 0.1f;
/** Volume of the sound made when hitting something */ /** Volume of the sound made when hitting something */
public float hitSoundVolume = 1; public float hitSoundVolume = 1;
/** Extra inaccuracy when firing. */ /** Extra inaccuracy when firing. */
@@ -511,7 +511,7 @@ public class BulletType extends Content implements Cloneable{
public void hit(Bullet b, float x, float y){ public void hit(Bullet b, float x, float y){
hitEffect.at(x, y, b.rotation(), hitColor); hitEffect.at(x, y, b.rotation(), hitColor);
hitSound.at(x, y, hitSoundPitch, hitSoundVolume); hitSound.at(x, y, hitSoundPitch + Mathf.range(hitSoundPitchRange), hitSoundVolume);
Effect.shake(hitShake, hitShake, b); Effect.shake(hitShake, hitShake, b);
@@ -609,7 +609,7 @@ public class BulletType extends Content implements Cloneable{
} }
despawnEffect.at(b.x, b.y, b.rotation(), hitColor); despawnEffect.at(b.x, b.y, b.rotation(), hitColor);
despawnSound.at(b); despawnSound.at(b, 1f + Mathf.range(hitSoundPitchRange));
Effect.shake(despawnShake, despawnShake, b); Effect.shake(despawnShake, despawnShake, b);
} }

View File

@@ -62,7 +62,7 @@ public class ShrapnelBulletType extends BulletType{
Drawf.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, serrationWidth, sl, b.rotation() + 90); Drawf.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, serrationWidth, sl, b.rotation() + 90);
Drawf.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, serrationWidth, sl, b.rotation() - 90); Drawf.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, serrationWidth, sl, b.rotation() - 90);
} }
Drawf.tri(b.x, b.y, width * b.fout(), (realLength + 50), b.rotation()); Drawf.tri(b.x, b.y, width * b.fout(), (realLength + 4f), b.rotation());
Drawf.tri(b.x, b.y, width * b.fout(), 10f, b.rotation() + 180f); Drawf.tri(b.x, b.y, width * b.fout(), 10f, b.rotation() + 180f);
Draw.reset(); Draw.reset();

View File

@@ -179,6 +179,7 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Unitc{
floor.walkSound.at(x, y, 1f, floor.walkSoundVolume); floor.walkSound.at(x, y, 1f, floor.walkSoundVolume);
}else{ }else{
Fx.unitLandSmall.at(l.base.x, l.base.y, type.rippleScale, floor.mapColor); Fx.unitLandSmall.at(l.base.x, l.base.y, type.rippleScale, floor.mapColor);
type.stepSound.at(l.base.x, l.base.y, type.stepSoundPitch + Mathf.range(0.1f), type.stepSoundVolume);
} }
//shake when legs contact ground //shake when legs contact ground

View File

@@ -51,6 +51,7 @@ abstract class MechComp implements Posc, Hitboxc, Unitc, Mechc, ElevationMovec{
if(type.mechStepParticles){ if(type.mechStepParticles){
Effect.floorDust(cx, cy, hitSize/8f); Effect.floorDust(cx, cy, hitSize/8f);
} }
type.stepSound.at(cx, cy, type.stepSoundPitch + Mathf.range(0.1f), type.stepSoundVolume);
} }
walkExtension = extendScl; walkExtension = extendScl;

View File

@@ -98,7 +98,7 @@ public class RegionPart extends DrawPart{
int i = params.sideOverride == -1 ? s : params.sideOverride; int i = params.sideOverride == -1 ? s : params.sideOverride;
//can be null //can be null
var region = drawRegion ? regions[Math.min(i, regions.length - 1)] : null; var region = drawRegion && regions.length > 0 ? regions[Math.min(i, regions.length - 1)] : null;
float sign = (i == 0 ? 1 : -1) * params.sideMultiplier; float sign = (i == 0 ? 1 : -1) * params.sideMultiplier;
Tmp.v1.set((x + mx) * sign, y + my).rotateRadExact((params.rotation - 90) * Mathf.degRad); Tmp.v1.set((x + mx) * sign, y + my).rotateRadExact((params.rotation - 90) * Mathf.degRad);

View File

@@ -28,6 +28,7 @@ public class AIController implements UnitController{
/** main target that is being faced */ /** main target that is being faced */
protected @Nullable Teamc target; protected @Nullable Teamc target;
protected @Nullable Teamc bomberTarget; protected @Nullable Teamc bomberTarget;
protected boolean turningAway;
{ {
resetTimers(); resetTimers();
@@ -155,7 +156,8 @@ public class AIController implements UnitController{
} }
public void targetInvalidated(){ public void targetInvalidated(){
//TODO: try this for normal units, reset the target timer //immediately find a new target
timer.reset(timerTarget, -1f);
} }
public void updateWeapons(){ public void updateWeapons(){
@@ -169,7 +171,7 @@ public class AIController implements UnitController{
noTargetTime += Time.delta; noTargetTime += Time.delta;
if(invalid(target)){ if(invalid(target)){
if(target != null && !target.isAdded()){ if(target instanceof Healthc h && !h.isValid()){
targetInvalidated(); targetInvalidated();
} }
target = null; target = null;
@@ -300,14 +302,32 @@ public class AIController implements UnitController{
} }
public void circleAttack(float circleLength){ public void circleAttack(float circleLength){
if(target == null) return;
vec.set(target).sub(unit); vec.set(target).sub(unit);
float ang = unit.angleTo(target); float ang = unit.angleTo(target);
float diff = Angles.angleDist(ang, unit.rotation()); float diff = Angles.angleDist(ang, unit.rotation());
if(target instanceof Unit u && u.collisionLayer() == unit.collisionLayer()){
float avoidDist = u.physicSize() + 30f;
if(turningAway){
vec.setLength(prefSpeed()).scl(-1f);
unit.movePref(vec);
if(!unit.within(u, unit.type.circleTargetRadius*0.5f + u.physicSize())){
turningAway = false;
}
return;
}else if(unit.within(u, avoidDist)){
turningAway = true;
}
}
if(diff > 70f && vec.len() < circleLength){ if(diff > 70f && vec.len() < circleLength){
vec.setAngle(unit.vel().angle()); vec.setAngle(unit.vel().angle());
}else{ }else if(unit.type.omniMovement){ //non-omni movement units don't need to do this as the turning is already smoothed out
vec.setAngle(Angles.moveToward(unit.vel().angle(), vec.angle(), 6f)); vec.setAngle(Angles.moveToward(unit.vel().angle(), vec.angle(), 6f));
} }
@@ -359,7 +379,12 @@ public class AIController implements UnitController{
if(arrive){ if(arrive){
Tmp.v3.set(-unit.vel.x / unit.type.accel * 2f, -unit.vel.y / unit.type.accel * 2f).add((target.getX() - unit.x), (target.getY() - unit.y)); Tmp.v3.set(-unit.vel.x / unit.type.accel * 2f, -unit.vel.y / unit.type.accel * 2f).add((target.getX() - unit.x), (target.getY() - unit.y));
if(unit.type.omniMovement){
vec.add(Tmp.v3).limit(speed * length); vec.add(Tmp.v3).limit(speed * length);
}else{
//directly move the unit to prevent a backwards movement vector from messing things up
unit.moveAt(Tmp.v3.limit(speed * length));
}
} }
if(length < -0.5f){ if(length < -0.5f){

View File

@@ -437,6 +437,13 @@ public class FloorRenderer{
int idx = vidx; int idx = vidx;
vidx += spriteSize; vidx += spriteSize;
//fixes graphical artifacting due to low precision positions/UVs. TODO: test for issues
final float grow = 0.01f;
x -= grow;
y -= grow;
width += grow*2f;
height += grow*2f;
if(!Mathf.zero(rotation)){ if(!Mathf.zero(rotation)){
//bottom left and top right corner points relative to origin //bottom left and top right corner points relative to origin
float worldOriginX = x + originX; float worldOriginX = x + originX;

View File

@@ -461,6 +461,8 @@ public abstract class SaveVersion extends SaveFileReader{
} }
public void readWorldEntities(DataInput stream, Prov[] mapping) throws IOException{ public void readWorldEntities(DataInput stream, Prov[] mapping) throws IOException{
IntSet used = new IntSet();
Seq<Entityc> reassign = new Seq<>();
int amount = stream.readInt(); int amount = stream.readInt();
for(int j = 0; j < amount; j++){ for(int j = 0; j < amount; j++){
@@ -477,10 +479,20 @@ public abstract class SaveVersion extends SaveFileReader{
EntityGroup.checkNextId(id); EntityGroup.checkNextId(id);
entity.id(id); entity.id(id);
entity.read(in); entity.read(in);
if(used.add(id)){
entity.add(); entity.add();
}else{
Log.warn("Duplicate entity ID in save: @ (@)", id, entity);
reassign.add(entity);
}
}); });
} }
for(var ent : reassign){
ent.id(EntityGroup.nextId());
ent.add();
}
Groups.all.each(Entityc::afterReadAll); Groups.all.each(Entityc::afterReadAll);
} }

View File

@@ -22,7 +22,7 @@ import java.util.*;
/** The current implementation is awful. Consider it a proof of concept. */ /** The current implementation is awful. Consider it a proof of concept. */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public class ContentPatcher{ public class DataPatcher{
private static final Object root = new Object(); private static final Object root = new Object();
private static final ObjectMap<String, ContentType> nameToType = new ObjectMap<>(); private static final ObjectMap<String, ContentType> nameToType = new ObjectMap<>();
private static ContentParser parser = createParser(); private static ContentParser parser = createParser();
@@ -129,6 +129,8 @@ public class ContentPatcher{
if(!Vars.headless){ if(!Vars.headless){
if(object instanceof DrawPart part && parent instanceof MappableContent cont){ if(object instanceof DrawPart part && parent instanceof MappableContent cont){
part.load(cont.name); part.load(cont.name);
}else if(object instanceof DrawPart part && parent instanceof Weapon w){
part.load(w.name);
}else if(object instanceof DrawBlock draw && parent instanceof Block block){ }else if(object instanceof DrawBlock draw && parent instanceof Block block){
draw.load(block); draw.load(block);
}else if(object instanceof Weapon weapon){ }else if(object instanceof Weapon weapon){

View File

@@ -629,7 +629,9 @@ public class Planet extends UnlockableContent{
batch.color(Tmp.c1); batch.color(Tmp.c1);
batch.vertex(Tmp.bz3.valueAt(Tmp.v32, f).add(normal, -stroke)); batch.vertex(Tmp.bz3.valueAt(Tmp.v32, f).add(normal, -stroke));
} }
Gl.disable(Gl.cullFace);
batch.flush(Gl.triangleStrip); batch.flush(Gl.triangleStrip);
Gl.enable(Gl.cullFace);
} }
public Vec3 lookAt(Sector sector, Vec3 out){ public Vec3 lookAt(Sector sector, Vec3 out){

View File

@@ -93,6 +93,8 @@ public class UnitType extends UnlockableContent implements Senseable{
mineRange = 70f, mineRange = 70f,
/** range at which this unit can build */ /** range at which this unit can build */
buildRange = Vars.buildingRange, buildRange = Vars.buildingRange,
/** radius for circleTarget, if true */
circleTargetRadius = 80f,
/** multiplier for damage this (flying) unit deals when crashing on enemy things */ /** multiplier for damage this (flying) unit deals when crashing on enemy things */
crashDamageMultiplier = 1f, crashDamageMultiplier = 1f,
/** multiplier for health that this flying unit has for its wreck, based on its max health. */ /** multiplier for health that this flying unit has for its wreck, based on its max health. */
@@ -298,6 +300,12 @@ public class UnitType extends UnlockableContent implements Senseable{
public Sound loopSound = Sounds.none; public Sound loopSound = Sounds.none;
/** volume of loop sound */ /** volume of loop sound */
public float loopSoundVolume = 0.5f; public float loopSoundVolume = 0.5f;
/** sound played when this mech/insect unit does a step */
public Sound stepSound = Sounds.none;
/** volume of step sound */
public float stepSoundVolume = 0.5f;
/** base pitch of step sound */
public float stepSoundPitch = 1f;
/** effect that this unit emits when falling */ /** effect that this unit emits when falling */
public Effect fallEffect = Fx.fallSmoke; public Effect fallEffect = Fx.fallSmoke;
/** effect created at engine when unit falls. */ /** effect created at engine when unit falls. */
@@ -1351,7 +1359,7 @@ public class UnitType extends UnlockableContent implements Senseable{
if(stacks != null){ if(stacks != null){
ItemStack[] out = new ItemStack[stacks.length]; ItemStack[] out = new ItemStack[stacks.length];
for(int i = 0; i < out.length; i++){ for(int i = 0; i < out.length; i++){
out[i] = new ItemStack(stacks[i].item, UI.roundAmount((int)(Math.pow(stacks[i].amount, 1.1) * researchCostMultiplier))); out[i] = new ItemStack(stacks[i].item, UI.roundAmount((int)(stacks[i].amount * researchCostMultiplier)));
} }
//remove zero-requirements for automatic unlocks //remove zero-requirements for automatic unlocks

View File

@@ -128,6 +128,10 @@ public class Weapon implements Cloneable{
public float layerOffset = 0f; public float layerOffset = 0f;
/** sound used for shooting */ /** sound used for shooting */
public Sound shootSound = Sounds.pew; public Sound shootSound = Sounds.pew;
/** volume of the shoot sound */
public float shootSoundVolume = 1f;
/** sound used when this weapon first fires; for continuous weapons only */
public Sound initialShootSound = Sounds.none;
/** sound used for weapons that have a delay */ /** sound used for weapons that have a delay */
public Sound chargeSound = Sounds.none; public Sound chargeSound = Sounds.none;
/** sound played when there is nothing to shoot */ /** sound played when there is nothing to shoot */
@@ -498,7 +502,9 @@ public class Weapon implements Cloneable{
handleBullet(unit, mount, mount.bullet); handleBullet(unit, mount, mount.bullet);
if(!continuous){ if(!continuous){
shootSound.at(bulletX, bulletY, Mathf.random(soundPitchMin, soundPitchMax)); shootSound.at(bulletX, bulletY, Mathf.random(soundPitchMin, soundPitchMax), shootSoundVolume);
}else{
initialShootSound.at(bulletX, bulletY, Mathf.random(soundPitchMin, soundPitchMax), shootSoundVolume);
} }
ejectEffect.at(mountX, mountY, angle * Mathf.sign(this.x)); ejectEffect.at(mountX, mountY, angle * Mathf.sign(this.x));

View File

@@ -3,6 +3,7 @@ package mindustry.world.blocks.campaign;
import arc.*; import arc.*;
import arc.Graphics.*; import arc.Graphics.*;
import arc.Graphics.Cursor.*; import arc.Graphics.Cursor.*;
import arc.audio.*;
import arc.graphics.*; import arc.graphics.*;
import arc.graphics.g2d.*; import arc.graphics.g2d.*;
import arc.math.*; import arc.math.*;
@@ -52,6 +53,10 @@ public class LandingPad extends Block{
public float liquidPad = 2f; public float liquidPad = 2f;
public Color bottomColor = Pal.darkerMetal; public Color bottomColor = Pal.darkerMetal;
public float landSoundVolume = 0.75f;
//impact timing must be exactly equal to arrivalDuration
public Sound landSound = Sounds.padLand;
public LandingPad(String name){ public LandingPad(String name){
super(name); super(name);
@@ -145,6 +150,7 @@ public class LandingPad extends Block{
arriving = config; arriving = config;
arrivingTimer = 0f; arrivingTimer = 0f;
liquidRemoved = 0f; liquidRemoved = 0f;
landSound.at(x, y, 1f, landSoundVolume);
if(state.isCampaign() && !isFake()){ if(state.isCampaign() && !isFake()){
state.rules.sector.info.importCooldownTimers.put(config, 0f); state.rules.sector.info.importCooldownTimers.put(config, 0f);

View File

@@ -30,7 +30,8 @@ import static mindustry.Vars.*;
public class LaunchPad extends Block{ public class LaunchPad extends Block{
/** Time between launches. */ /** Time between launches. */
public float launchTime = 1f; public float launchTime = 1f;
public Sound launchSound = Sounds.none; public float launchSoundPitchRand = 0.1f;
public Sound launchSound = Sounds.padLaunch;
public @Load("@-light") TextureRegion lightRegion; public @Load("@-light") TextureRegion lightRegion;
public @Load(value = "@-pod", fallback = "launchpod") TextureRegion podRegion; public @Load(value = "@-pod", fallback = "launchpod") TextureRegion podRegion;
@@ -145,7 +146,7 @@ public class LaunchPad extends Block{
if((launchCounter += edelta()) >= launchTime && items.total() >= itemCapacity){ if((launchCounter += edelta()) >= launchTime && items.total() >= itemCapacity){
//if there are item requirements, use those. //if there are item requirements, use those.
consume(); consume();
launchSound.at(x, y); launchSound.at(x, y, 1f + Mathf.range(launchSoundPitchRand));
LaunchPayload entity = LaunchPayload.create(); LaunchPayload entity = LaunchPayload.create();
items.each((item, amount) -> entity.stacks.add(new ItemStack(item, amount))); items.each((item, amount) -> entity.stacks.add(new ItemStack(item, amount)));
entity.set(this); entity.set(this);

View File

@@ -27,7 +27,7 @@ public class PointDefenseTurret extends ReloadTurret{
public Effect hitEffect = Fx.pointHit; public Effect hitEffect = Fx.pointHit;
public Effect shootEffect = Fx.sparkShoot; public Effect shootEffect = Fx.sparkShoot;
public Sound shootSound = Sounds.lasershoot; public Sound shootSound = Sounds.shootSegment;
public float shootCone = 5f; public float shootCone = 5f;
public float bulletDamage = 10f; public float bulletDamage = 10f;

View File

@@ -119,6 +119,8 @@ public class Turret extends ReloadTurret{
public Effect ammoUseEffect = Fx.none; public Effect ammoUseEffect = Fx.none;
/** Sound emitted when a single bullet is shot. */ /** Sound emitted when a single bullet is shot. */
public Sound shootSound = Sounds.shoot; public Sound shootSound = Sounds.shoot;
/** Volume of shooting sound. */
public float shootSoundVolume = 1f;
/** Sound emitted when shoot.firstShotDelay is >0 and shooting begins. */ /** Sound emitted when shoot.firstShotDelay is >0 and shooting begins. */
public Sound chargeSound = Sounds.none; public Sound chargeSound = Sounds.none;
/** The sound that this block makes while active. One sound loop. Do not overuse. */ /** The sound that this block makes while active. One sound loop. Do not overuse. */
@@ -735,7 +737,7 @@ public class Turret extends ReloadTurret{
(shootEffect == null ? type.shootEffect : shootEffect).at(bulletX, bulletY, rotation + angleOffset, type.hitColor); (shootEffect == null ? type.shootEffect : shootEffect).at(bulletX, bulletY, rotation + angleOffset, type.hitColor);
(smokeEffect == null ? type.smokeEffect : smokeEffect).at(bulletX, bulletY, rotation + angleOffset, type.hitColor); (smokeEffect == null ? type.smokeEffect : smokeEffect).at(bulletX, bulletY, rotation + angleOffset, type.hitColor);
shootSound.at(bulletX, bulletY, Mathf.random(soundPitchMin, soundPitchMax)); shootSound.at(bulletX, bulletY, Mathf.random(soundPitchMin, soundPitchMax), shootSoundVolume);
ammoUseEffect.at( ammoUseEffect.at(
x - Angles.trnsx(rotation, ammoEjectBack), x - Angles.trnsx(rotation, ammoEjectBack),

View File

@@ -36,7 +36,9 @@ public class MassDriver extends Block{
public Effect shootEffect = Fx.shootBig2; public Effect shootEffect = Fx.shootBig2;
public Effect smokeEffect = Fx.shootBigSmoke2; public Effect smokeEffect = Fx.shootBigSmoke2;
public Effect receiveEffect = Fx.mineBig; public Effect receiveEffect = Fx.mineBig;
public Sound shootSound = Sounds.shootBig; public Sound shootSound = Sounds.massdriver;
public Sound receiveSound = Sounds.massdriverReceive;
public float shootSoundVolume = 0.5f;
public float shake = 3f; public float shake = 3f;
public @Load("@-base") TextureRegion baseRegion; public @Load("@-base") TextureRegion baseRegion;
@@ -306,7 +308,7 @@ public class MassDriver extends Block{
Effect.shake(shake, shake, this); Effect.shake(shake, shake, this);
shootSound.at(tile, Mathf.random(0.9f, 1.1f)); shootSound.at(x, y, 1f + Mathf.range(0.2f), shootSoundVolume);
} }
public void handlePayload(Bullet bullet, DriverBulletData data){ public void handlePayload(Bullet bullet, DriverBulletData data){
@@ -326,6 +328,7 @@ public class MassDriver extends Block{
Effect.shake(shake, shake, this); Effect.shake(shake, shake, this);
receiveEffect.at(bullet); receiveEffect.at(bullet);
receiveSound.at(x, y, 1f + Mathf.range(0.2f), shootSoundVolume);
reloadCounter = 1f; reloadCounter = 1f;
bullet.remove(); bullet.remove();

View File

@@ -32,7 +32,9 @@ public class PayloadMassDriver extends PayloadBlock{
public Effect shootEffect = Fx.shootBig2; public Effect shootEffect = Fx.shootBig2;
public Effect smokeEffect = Fx.shootPayloadDriver; public Effect smokeEffect = Fx.shootPayloadDriver;
public Effect receiveEffect = Fx.payloadReceive; public Effect receiveEffect = Fx.payloadReceive;
public Sound shootSound = Sounds.shootBig; public Sound shootSound = Sounds.massdriver;
public Sound receiveSound = Sounds.massdriverReceive;
public float shootSoundVolume = 0.7f;
public float shake = 3f; public float shake = 3f;
public Effect transferEffect = new Effect(11f, 600f, e -> { public Effect transferEffect = new Effect(11f, 600f, e -> {
@@ -176,6 +178,7 @@ public class PayloadMassDriver extends PayloadBlock{
receiveEffect.at(x - cx/2f, y - cy/2f, turretRotation); receiveEffect.at(x - cx/2f, y - cy/2f, turretRotation);
reloadCounter = 1f; reloadCounter = 1f;
Effect.shake(shake, shake, this); Effect.shake(shake, shake, this);
receiveSound.at(x, y, 1f + Mathf.range(0.2f), shootSoundVolume);
} }
charging = false; charging = false;
@@ -294,7 +297,7 @@ public class PayloadMassDriver extends PayloadBlock{
smokeEffect.at(x, y, turretRotation); smokeEffect.at(x, y, turretRotation);
Effect.shake(shake, shake, this); Effect.shake(shake, shake, this);
shootSound.at(this, Mathf.random(0.9f, 1.1f)); shootSound.at(x, y, Mathf.random(0.9f, 1.1f), shootSoundVolume);
transferEffect.at(x + cx, y + cy, turretRotation, new PayloadMassDriverData(x + cx, y + cy, other.x - cx, other.y - cy, payload)); transferEffect.at(x + cx, y + cy, turretRotation, new PayloadMassDriverData(x + cx, y + cy, other.x - cx, other.y - cy, payload));
Payload pay = payload; Payload pay = payload;
other.recPayload = payload; other.recPayload = payload;

View File

@@ -34,6 +34,8 @@ public class NuclearReactor extends PowerGenerator{
public float heatOutput = 15f; public float heatOutput = 15f;
/** rate at which heat progress increases */ /** rate at which heat progress increases */
public float heatWarmupRate = 1f; public float heatWarmupRate = 1f;
/** time taken to cool down if no fuel is inputted even if coolant is not present*/
public float ambientCooldownTime = 60f * 20f;
/** threshold at which block starts smoking */ /** threshold at which block starts smoking */
public float smokeThreshold = 0.3f; public float smokeThreshold = 0.3f;
/** heat threshold at which lights start flashing */ /** heat threshold at which lights start flashing */
@@ -66,7 +68,7 @@ public class NuclearReactor extends PowerGenerator{
explosionDamage = 1250 * 4; explosionDamage = 1250 * 4;
explodeEffect = Fx.reactorExplosion; explodeEffect = Fx.reactorExplosion;
explodeSound = Sounds.explosionbig; explodeSound = Sounds.reactorExplosion;
} }
@Override @Override
@@ -104,6 +106,7 @@ public class NuclearReactor extends PowerGenerator{
} }
}else{ }else{
productionEfficiency = 0f; productionEfficiency = 0f;
heat = Math.max(0f, heat - Time.delta / ambientCooldownTime);
} }
if(heat > 0){ if(heat > 0){

View File

@@ -82,7 +82,7 @@ public class Drill extends Block{
liquidCapacity = 5f; liquidCapacity = 5f;
hasItems = true; hasItems = true;
ambientSound = Sounds.drill; ambientSound = Sounds.drill;
ambientSoundVolume = 0.018f; ambientSoundVolume = 0.019f;
//drills work in space I guess //drills work in space I guess
envEnabled |= Env.space; envEnabled |= Env.space;
flags = EnumSet.of(BlockFlag.drill); flags = EnumSet.of(BlockFlag.drill);