From e3cceea1afcbe636586dd12c08ace026718cf277 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 15 Sep 2021 22:30:53 -0400 Subject: [PATCH] Re-trying JITPack --- core/src/mindustry/content/Fx.java | 2 +- core/src/mindustry/entities/Effect.java | 4 ++++ .../src/mindustry/entities/abilities/ForceFieldAbility.java | 2 +- .../mindustry/entities/abilities/MoveLightningAbility.java | 3 ++- .../mindustry/entities/abilities/RepairFieldAbility.java | 3 ++- .../entities/abilities/ShieldRegenFieldAbility.java | 3 ++- .../mindustry/entities/abilities/StatusFieldAbility.java | 6 ++++-- core/src/mindustry/entities/abilities/UnitSpawnAbility.java | 3 ++- gradle.properties | 2 +- 9 files changed, 19 insertions(+), 9 deletions(-) diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index 6a7f67ef7a..3d4cd37cda 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -1878,7 +1878,7 @@ public class Fx{ color(e.color); stroke(3f * e.fout()); Lines.poly(e.x, e.y, 6, e.rotation + e.fin()); - }), + }).followParent(true), coreLandDust = new Effect(100f, e -> { color(e.color, e.fout(0.1f)); diff --git a/core/src/mindustry/entities/Effect.java b/core/src/mindustry/entities/Effect.java index f2bc5e95d5..ba5def3822 100644 --- a/core/src/mindustry/entities/Effect.java +++ b/core/src/mindustry/entities/Effect.java @@ -76,6 +76,10 @@ public class Effect{ create(this, pos.getX(), pos.getY(), 0, Color.white, null); } + public void at(Position pos, boolean parentize){ + create(this, pos.getX(), pos.getY(), 0, Color.white, parentize ? pos : null); + } + public void at(Position pos, float rotation){ create(this, pos.getX(), pos.getY(), rotation, Color.white, null); } diff --git a/core/src/mindustry/entities/abilities/ForceFieldAbility.java b/core/src/mindustry/entities/abilities/ForceFieldAbility.java index 38961a6433..86858f6456 100644 --- a/core/src/mindustry/entities/abilities/ForceFieldAbility.java +++ b/core/src/mindustry/entities/abilities/ForceFieldAbility.java @@ -38,7 +38,7 @@ public class ForceFieldAbility extends Ability{ if(paramUnit.shield <= trait.damage()){ paramUnit.shield -= paramField.cooldown * paramField.regen; - Fx.shieldBreak.at(paramUnit.x, paramUnit.y, paramField.radius, paramUnit.team.color); + Fx.shieldBreak.at(paramUnit.x, paramUnit.y, paramField.radius, paramUnit.team.color, paramUnit); } paramUnit.shield -= trait.damage(); diff --git a/core/src/mindustry/entities/abilities/MoveLightningAbility.java b/core/src/mindustry/entities/abilities/MoveLightningAbility.java index 0a56d3bd15..cec4332dd2 100644 --- a/core/src/mindustry/entities/abilities/MoveLightningAbility.java +++ b/core/src/mindustry/entities/abilities/MoveLightningAbility.java @@ -34,6 +34,7 @@ public class MoveLightningAbility extends Ability{ public float bulletAngle = 0f, bulletSpread = 0f; public Effect shootEffect = Fx.sparkShoot; + public boolean parentizeEffects; public Sound shootSound = Sounds.spark; protected float side = 1f; @@ -67,7 +68,7 @@ public class MoveLightningAbility extends Ability{ if(Mathf.chance(Time.delta * chance * scl)){ float x = unit.x + Angles.trnsx(unit.rotation, offset, width * side), y = unit.y + Angles.trnsy(unit.rotation, offset, width * side); - shootEffect.at(x, y, unit.rotation, color); + shootEffect.at(x, y, unit.rotation, color, parentizeEffects ? unit : null); shootSound.at(unit); if(length > 0){ diff --git a/core/src/mindustry/entities/abilities/RepairFieldAbility.java b/core/src/mindustry/entities/abilities/RepairFieldAbility.java index 9e2890589a..600e3ee5ef 100644 --- a/core/src/mindustry/entities/abilities/RepairFieldAbility.java +++ b/core/src/mindustry/entities/abilities/RepairFieldAbility.java @@ -9,6 +9,7 @@ public class RepairFieldAbility extends Ability{ public float amount = 1, reload = 100, range = 60; public Effect healEffect = Fx.heal; public Effect activeEffect = Fx.healWaveDynamic; + public boolean parentizeEffects = false; protected float timer; protected boolean wasHealed = false; @@ -30,7 +31,7 @@ public class RepairFieldAbility extends Ability{ Units.nearby(unit.team, unit.x, unit.y, range, other -> { if(other.damaged()){ - healEffect.at(other); + healEffect.at(other, parentizeEffects); wasHealed = true; } other.heal(amount); diff --git a/core/src/mindustry/entities/abilities/ShieldRegenFieldAbility.java b/core/src/mindustry/entities/abilities/ShieldRegenFieldAbility.java index 7eea17b8d1..de18ea6c13 100644 --- a/core/src/mindustry/entities/abilities/ShieldRegenFieldAbility.java +++ b/core/src/mindustry/entities/abilities/ShieldRegenFieldAbility.java @@ -9,6 +9,7 @@ public class ShieldRegenFieldAbility extends Ability{ public float amount = 1, max = 100f, reload = 100, range = 60; public Effect applyEffect = Fx.shieldApply; public Effect activeEffect = Fx.shieldWave; + public boolean parentizeEffects; protected float timer; protected boolean applied = false; @@ -33,7 +34,7 @@ public class ShieldRegenFieldAbility extends Ability{ if(other.shield < max){ other.shield = Math.max(other.shield + amount, max); other.shieldAlpha = 1f; //TODO may not be necessary - applyEffect.at(unit.x, unit.y, unit.team.color); + applyEffect.at(unit.x, unit.y, 0f, unit.team.color, parentizeEffects ? other : null); applied = true; } }); diff --git a/core/src/mindustry/entities/abilities/StatusFieldAbility.java b/core/src/mindustry/entities/abilities/StatusFieldAbility.java index b41df1b851..4c1d2e3c78 100644 --- a/core/src/mindustry/entities/abilities/StatusFieldAbility.java +++ b/core/src/mindustry/entities/abilities/StatusFieldAbility.java @@ -10,8 +10,9 @@ import mindustry.type.*; public class StatusFieldAbility extends Ability{ public StatusEffect effect; public float duration = 60, reload = 100, range = 20; - public Effect applyEffect = Fx.heal; + public Effect applyEffect = Fx.none; public Effect activeEffect = Fx.overdriveWave; + public boolean parentizeEffects; protected float timer; @@ -36,9 +37,10 @@ public class StatusFieldAbility extends Ability{ if(timer >= reload){ Units.nearby(unit.team, unit.x, unit.y, range, other -> { other.apply(effect, duration); + applyEffect.at(other, parentizeEffects); }); - activeEffect.at(unit); + activeEffect.at(unit, parentizeEffects); timer = 0f; } diff --git a/core/src/mindustry/entities/abilities/UnitSpawnAbility.java b/core/src/mindustry/entities/abilities/UnitSpawnAbility.java index 04be58be39..22555d3b3a 100644 --- a/core/src/mindustry/entities/abilities/UnitSpawnAbility.java +++ b/core/src/mindustry/entities/abilities/UnitSpawnAbility.java @@ -18,6 +18,7 @@ public class UnitSpawnAbility extends Ability{ public UnitType unit; public float spawnTime = 60f, spawnX, spawnY; public Effect spawnEffect = Fx.spawn; + public boolean parentizeEffects; protected float timer; @@ -37,7 +38,7 @@ public class UnitSpawnAbility extends Ability{ if(timer >= spawnTime && Units.canCreate(unit.team, this.unit)){ float x = unit.x + Angles.trnsx(unit.rotation, spawnY, spawnX), y = unit.y + Angles.trnsy(unit.rotation, spawnY, spawnX); - spawnEffect.at(x, y); + spawnEffect.at(x, y, 0f, parentizeEffects ? unit : null); Unit u = this.unit.create(unit.team); u.set(x, y); u.rotation = unit.rotation; diff --git a/gradle.properties b/gradle.properties index 177a840e92..2c3b46df95 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,4 @@ android.useAndroidX=true #used for slow jitpack builds; TODO see if this actually works http.socketTimeout=80000 http.connectionTimeout=80000 -archash=43f8f93e80779f91fad622acfae70cdc300edecf +archash=e2eead82168c1a143e345bc5f78e2d72078f4657