Skip to content

Commit

Permalink
Merge branch 'Anuken:master' into vi-VN
Browse files Browse the repository at this point in the history
  • Loading branch information
SITUVNgcd authored Jan 19, 2025
2 parents 0428063 + 34cc625 commit 94dd67d
Show file tree
Hide file tree
Showing 12 changed files with 134 additions and 27 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified core/assets-raw/sprites/units/weapons/scathe-missile-phase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core/assets/bundles/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ error.mapnotfound = Map file not found!
error.io = Network I/O error.
error.any = Unknown network error.
error.bloom = Failed to initialize bloom.\nYour device may not support it.
error.moddex = Mindustry is unable to load this mod.\nYour device is blocking import of Java mods due to recent changes in Android.\nThere is no known workaround for this issue.
error.moddex = Mindustry is unable to load this mod.\nYour device is blocking import of Java mods due to recent changes in Android.\nThis will not be fixed. There is no known workaround for this issue.

weather.rain.name = Rain
weather.snowing.name = Snow
Expand Down
97 changes: 74 additions & 23 deletions core/src/mindustry/content/Blocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ public static void load(){
}};

electricHeater = new HeatProducer("electric-heater"){{
requirements(Category.crafting, with(Items.tungsten, 30, Items.oxide, 30));
requirements(Category.crafting, with(Items.tungsten, 30, Items.oxide, 30, Items.beryllium, 30));

researchCostMultiplier = 4f;

Expand Down Expand Up @@ -4047,26 +4047,50 @@ Items.tungsten, new BasicBulletType(8f, 95){{
rangeChange = 40f;
buildingDamageMultiplier = 0.3f;
}},
Items.carbide, new BasicBulletType(12f, 450f/0.75f){{
Items.carbide, new BasicBulletType(12f, 325f/0.75f){{
width = 15f;
height = 21f;
hitSize = 7f;
shootEffect = sfe;
smokeEffect = Fx.shootBigSmoke;
ammoMultiplier = 2;
reloadMultiplier = 0.5f;
reloadMultiplier = 0.2f;
hitColor = backColor = trailColor = Color.valueOf("ab8ec5");
frontColor = Color.white;
trailWidth = 2.2f;
trailLength = 11;
trailEffect = Fx.disperseTrail;
trailInterval = 2f;
hitEffect = despawnEffect = Fx.hitBulletColor;
rangeChange = 20f*8f;
rangeChange = 7f*8f;
buildingDamageMultiplier = 0.3f;
targetBlocks = false;
targetMissiles = false;
//targetBlocks = false;
//targetMissiles = false;
trailRotation = true;

fragBullets = 3;
fragRandomSpread = 0f;
fragSpread = 25f;
fragVelocityMin = 1f;

fragBullet = new BasicBulletType(8.1f, 227f){{
lifetime = 8f;
width = 11f;
height = 14f;
hitSize = 7f;
shootEffect = sfe;
ammoMultiplier = 1;
reloadMultiplier = 1f;
pierceCap = 2;
pierce = true;
pierceBuilding = true;
hitColor = backColor = trailColor = Color.valueOf("ab8ec5");
frontColor = Color.white;
trailWidth = 1.8f;
trailLength = 11;
hitEffect = despawnEffect = Fx.hitBulletColor;
buildingDamageMultiplier = 0.2f;
}};
}}
);

Expand Down Expand Up @@ -4335,10 +4359,10 @@ Items.carbide, new ArtilleryBulletType(2.5f, 500, "shell"){{
trailInterp = v -> Math.max(Mathf.slope(v), 0.8f);
shrinkX = 0.2f;
shrinkY = 0.1f;
buildingDamageMultiplier = 0.3f;
buildingDamageMultiplier = 0.2f;
}},
Items.oxide, new ArtilleryBulletType(2.5f, 300, "shell"){{
hitEffect = new MultiEffect(Fx.titanExplosionLarge, Fx.titanSmokeLarge);
hitEffect = new MultiEffect(Fx.titanExplosionLarge, Fx.titanSmokeLarge, Fx.smokeAoeCloud);
despawnEffect = Fx.none;
knockback = 2f;
lifetime = 190f;
Expand Down Expand Up @@ -4371,6 +4395,23 @@ Items.oxide, new ArtilleryBulletType(2.5f, 300, "shell"){{
shrinkX = 0.2f;
shrinkY = 0.1f;
buildingDamageMultiplier = 0.25f;

fragBullets = 1;
fragBullet = new EmptyBulletType(){{
lifetime = 60f * 2.5f;
bulletInterval = 20f;
intervalBullet = new EmptyBulletType(){{
splashDamage = 30f;
collidesGround = true;
collidesAir = false;
collides = false;
hitEffect = Fx.none;
pierce = true;
instantDisappear = true;
splashDamageRadius = 90f;
buildingDamageMultiplier = 0.2f;
}};
}};
}}
);

Expand Down Expand Up @@ -4608,7 +4649,7 @@ Items.surgeAlloy, new BasicBulletType(){{
}};

afflict = new PowerTurret("afflict"){{
requirements(Category.turret, with(Items.surgeAlloy, 100, Items.silicon, 200, Items.graphite, 250, Items.oxide, 40));
requirements(Category.turret, with(Items.surgeAlloy, 125, Items.silicon, 200, Items.graphite, 250, Items.oxide, 40));

shootType = new BasicBulletType(){{
shootEffect = new MultiEffect(Fx.shootTitan, new WaveEffect(){{
Expand Down Expand Up @@ -4886,18 +4927,17 @@ Items.carbide, new BulletType(0f, 0f){{
}};
}},

//TODO - needs balancing
Items.phaseFabric, new BulletType(0f, 0f){{
shootEffect = Fx.shootBig;
smokeEffect = Fx.shootSmokeMissileColor;
hitColor = Color.valueOf("ffd37f");
ammoMultiplier = 1f;
ammoMultiplier = 5f;
reloadMultiplier = 0.8f;

spawnUnit = new MissileUnitType("scathe-missile-phase"){{
speed = 4.4f;
speed = 4f;
maxRange = 6f;
lifetime = 60f * 5.7f;
lifetime = 60f * 6.1f;
outlineColor = Pal.darkOutline;
engineColor = trailColor = Color.valueOf("ffd37f");
engineLayer = Layer.effect;
Expand All @@ -4913,9 +4953,20 @@ Items.phaseFabric, new BulletType(0f, 0f){{
targetAir = false;
targetUnderBlocks = false;

parts.add(new ShapePart(){{
progress = PartProgress.constant(1f);
color = Pal.accent;
sides = 6;
radius = 3f;
rotateSpeed = 3f;
hollow = true;
layer = Layer.effect;
y = 1.8f;
}});

fogRadius = 6f;

health = 250;
health = 500;

weapons.add(new Weapon(){{
shootCone = 360f;
Expand All @@ -4924,7 +4975,7 @@ Items.phaseFabric, new BulletType(0f, 0f){{
deathExplosionEffect = Fx.massiveExplosion;
shootOnDeath = true;
shake = 10f;
bullet = new ExplosionBulletType(1500f, 50f){{
bullet = new ExplosionBulletType(400f, 120f){{
hitColor = engineColor;
shootEffect = new MultiEffect(Fx.massiveExplosion, Fx.scatheExplosion, Fx.scatheLight, new WaveEffect(){{
lifetime = 10f;
Expand All @@ -4933,7 +4984,7 @@ Items.phaseFabric, new BulletType(0f, 0f){{
}});

collidesAir = false;
buildingDamageMultiplier = 0.2f;
buildingDamageMultiplier = 0.1f;

ammoMultiplier = 1f;
fragLifeMin = 0.1f;
Expand All @@ -4947,8 +4998,8 @@ Items.phaseFabric, new BulletType(0f, 0f){{
lifetime = 23f;
width = height = 18f;
collidesTiles = false;
splashDamageRadius = 40f;
splashDamage = 160f;
splashDamageRadius = 56f;
splashDamage = 164f;
backColor = trailColor = hitColor = engineColor;
frontColor = Color.white;
smokeEffect = Fx.shootBigSmoke2;
Expand All @@ -4972,7 +5023,7 @@ Items.phaseFabric, new BulletType(0f, 0f){{
interval = 7f;
}});

abilities.add(new ForceFieldAbility(30f, 0f, 160f, 999999999f));
abilities.add(new ForceFieldAbility(90f, 0f, 2000f, 999999999f));

}};
}},
Expand Down Expand Up @@ -5017,12 +5068,12 @@ Items.surgeAlloy, new BulletType(0f, 0f){{
deathExplosionEffect = Fx.massiveExplosion;
shootOnDeath = true;
shake = 10f;
bullet = new ExplosionBulletType(400f, 40f){{
bullet = new ExplosionBulletType(300f, 40f){{
hitColor = engineColor;
shootEffect = new MultiEffect(Fx.massiveExplosion, Fx.scatheExplosionSmall);

collidesAir = false;
buildingDamageMultiplier = 0.25f;
buildingDamageMultiplier = 0.1f;

ammoMultiplier = 1f;
fragLifeMin = 0.1f;
Expand Down Expand Up @@ -5064,7 +5115,7 @@ Items.surgeAlloy, new BulletType(0f, 0f){{
deathExplosionEffect = Fx.massiveExplosion;
shootOnDeath = true;
shake = 10f;
bullet = new ExplosionBulletType(340f, 35f){{
bullet = new ExplosionBulletType(360f, 35f){{
lightning = 6;
lightningDamage = 35f;
lightningLength = 8;
Expand All @@ -5077,7 +5128,7 @@ Items.surgeAlloy, new BulletType(0f, 0f){{
}});

collidesAir = false;
buildingDamageMultiplier = 0.2f;
buildingDamageMultiplier = 0.1f;
}};
}});

Expand Down
6 changes: 5 additions & 1 deletion core/src/mindustry/content/Bullets.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class Bullets{
public static BulletType

placeholder, spaceLiquid, damageLightning, damageLightningGround, fireball;
placeholder, spaceLiquid, damageLightning, damageLightningGround, damageLightningAir, fireball;

public static void load(){

Expand All @@ -37,6 +37,10 @@ public static void load(){
damageLightningGround = damageLightning.copy();
damageLightningGround.collidesAir = false;

damageLightningAir = damageLightning.copy();
damageLightningAir.collidesGround = false;
damageLightningAir.collidesTiles = false;

fireball = new FireBulletType(1f, 4){{
hittable = false;
}};
Expand Down
8 changes: 8 additions & 0 deletions core/src/mindustry/content/Fx.java
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,14 @@ public class Fx{
}
}),

smokeAoeCloud = new Effect(60f * 3f, 250f, e -> {
color(e.color, 0.65f);

randLenVectors(e.id, 80, 90f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 6f * Mathf.clamp(e.fin() / 0.1f) * Mathf.clamp(e.fout() / 0.1f));
});
}),

missileTrailSmoke = new Effect(180f, 300f, b -> {
float intensity = 2f;

Expand Down
9 changes: 9 additions & 0 deletions core/src/mindustry/entities/abilities/ForceFieldAbility.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ public void update(Unit unit){
}
}

@Override
public void death(Unit unit){

//self-destructing units can have a shield on death
if(unit.shield > 0f && !wasBroken){
Fx.shieldBreak.at(unit.x, unit.y, radius, unit.type.shieldColor(unit), this);
}
}

@Override
public void draw(Unit unit){
checkRadius(unit);
Expand Down
5 changes: 4 additions & 1 deletion core/src/mindustry/entities/bullet/BulletType.java
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,10 @@ public void init(){
}

if(lightningType == null){
lightningType = !collidesAir ? Bullets.damageLightningGround : Bullets.damageLightning;
lightningType =
!collidesAir ? Bullets.damageLightningGround :
!collidesGround ? Bullets.damageLightningAir :
Bullets.damageLightning;
}

if(lightRadius <= -1){
Expand Down
10 changes: 10 additions & 0 deletions core/src/mindustry/entities/bullet/EmptyBulletType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package mindustry.entities.bullet;

public class EmptyBulletType extends BulletType{

public EmptyBulletType(){
hittable = collidesGround = collidesAir = collidesTiles = false;
speed = 0f;
keepVelocity = false;
}
}
1 change: 1 addition & 0 deletions core/src/mindustry/ui/dialogs/ResearchDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ void spend(TechNode node){
Core.scene.act();
rebuild(shine);
itemDisplay.rebuild(items, usedShine);
checkMargin();
}

void unlock(TechNode node){
Expand Down
16 changes: 16 additions & 0 deletions core/src/mindustry/world/DirectionalItemBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,21 @@ public void write(Writes write){
}

public void read(Reads read){
read(read, false);
}

public void read(Reads read, boolean legacy){
for(int i = 0; i < 4; i++){
indexes[i] = read.b();
byte length = read.b();
for(int j = 0; j < length; j++){
long value = read.l();

if(legacy){
//read value as the old format with 1-byte items, and create a new one with the new 2-byte format
value = BufferItem.get(BufferItemLegacy.item(value), BufferItemLegacy.time(value));
}

if(j < buffers[i].length){
buffers[i][j] = value;
}
Expand All @@ -71,4 +81,10 @@ class BufferItemStruct{
short item;
float time;
}

@Struct
class BufferItemLegacyStruct{
byte item;
float time;
}
}
7 changes: 6 additions & 1 deletion core/src/mindustry/world/blocks/distribution/Junction.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ public boolean acceptItem(Building source, Item item){
return to != null && to.team == team;
}

@Override
public byte version(){
return 1;
}

@Override
public void write(Writes write){
super.write(write);
Expand All @@ -88,7 +93,7 @@ public void write(Writes write){
@Override
public void read(Reads read, byte revision){
super.read(read, revision);
buffer.read(read);
buffer.read(read, revision == 0);
}
}
}

0 comments on commit 94dd67d

Please sign in to comment.