From 8b916d03af5bd083c727f4476109ecc80c9e8e8f Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 20 Feb 2022 16:58:29 -0500 Subject: [PATCH] Editor & access modifier fixes --- .../annotations/entity/EntityProcess.java | 2 +- core/assets-raw/sprites/units/locus-treads.png | Bin 0 -> 408 bytes core/assets-raw/sprites/units/locus-weapon.png | Bin 0 -> 603 bytes core/assets-raw/sprites/units/locus.png | Bin 426 -> 1647 bytes core/src/mindustry/editor/MapEditorDialog.java | 8 +++++++- .../entities/bullet/EmpBulletType.java | 8 +++----- .../mindustry/entities/comp/BuildingComp.java | 8 ++++++++ core/src/mindustry/maps/SectorDamage.java | 6 +++--- .../world/blocks/power/ImpactReactor.java | 2 +- .../world/blocks/production/Drill.java | 2 +- 10 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 core/assets-raw/sprites/units/locus-treads.png create mode 100644 core/assets-raw/sprites/units/locus-weapon.png diff --git a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java index a9ada9f45c..6aded8c817 100644 --- a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java +++ b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java @@ -336,7 +336,7 @@ public class EntityProcess extends BaseProcessor{ fbuilder.initializer(varInitializers.get(f.descString())); } - fbuilder.addModifiers(f.has(ReadOnly.class) ? Modifier.PROTECTED : Modifier.PUBLIC); + fbuilder.addModifiers(f.has(ReadOnly.class) || f.is(Modifier.PRIVATE) ? Modifier.PROTECTED : Modifier.PUBLIC); fbuilder.addAnnotations(f.annotations().map(AnnotationSpec::get)); FieldSpec spec = fbuilder.build(); diff --git a/core/assets-raw/sprites/units/locus-treads.png b/core/assets-raw/sprites/units/locus-treads.png new file mode 100644 index 0000000000000000000000000000000000000000..e39c164a76000913934e684765cdd2e6de863895 GIT binary patch literal 408 zcmeAS@N?(olHy`uVBq!ia0y~yU`POA4mJh`hDS5XEf^RW7>k44ofy`glX=O&z!>D| z;uumf=k1+?p3aUU4j0!)w5+?r6vO>3Ve2=A9orZlYrS*|FI3!da(;#SlQ~Rn;(Edo zaVIu0Ffbgj+$m9b;_>Cr*E@>8-HVHFJM;B+PjOtIM9X1L0bzwQ(?=7|_kR~WE_1i1 zco(A~V-nL5mJX1NnuAZnjS1~H-u^w@kzDs?+w6tU-=4KtE-fIe0Fs))09AXlXMIs<;{dHnl9$OWJSq_|0#bgk&4V*$23k7#J8B zTwLz#d*6Ti``?FEdzEWfa7*;|{`$M~{i=^IUdx_cHDhVyuC1Bw@$Y%&zhb(#G4*Fb zY>}HTQ%A)03wme!GejJYRQJBU@~0z>(Pd9w!S-kFCOipdEDCN6NkkB4j3ITipME(z z)0LsCZAVLj;DM=v4HAqUf(;R;8UF2V+;u19`mZ4I4WZZD`k(l7u9jX|7Zhc+W7khl z$)=oy>Ce(2V8w->xRy4&1-u4L2MWX<#XpVmCkIu>y{N!;Yz2II7tqY}|4-ZQS3D!ig| z*VyfKwZpB?pC?v3-!MKVvU|anr|cox_ZYpCeM|W~eky6to`0>!@@cYWcF3Eim>Z%c z-@aYYWm%oH>f19v#Tz0)wFX6;2N!W%U3o>3rF-&+sVCDNk~obDx5f&1PndBv$3x}_ zkA_`Wzy=+y&^n3bNzoCjepp1E+_fV;ySX60CM)pCio^e#_pXjTc=E6OCs5Qv@PPyJ X&Mx0y>Q}0!fCM~U{an^LB{Ts5CTId> literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/units/locus.png b/core/assets-raw/sprites/units/locus.png index 453eeddadf1b720ee77537b23f7d147523bbf863..7d69b23f0408e645973b90a6c07f99bc8f8fb66b 100644 GIT binary patch delta 1618 zcmZ3*{GMlmK|PzMr;B4q#hkY>yYp^)h{&>LeiPodT$=Hddqty&XTsr|WsK#Gt6Mk3 zKhWpk32(~U?m0ohQ}BTOMy5LvPnrI;=N1;Pip5Jo@vcLNznua z{PCHQsTa3)z5J#7&)5GKxOw_*Mh@@8!&>j_1)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)ub-m8_WWGkmU3Vk(g1>PBsonalrH1~@ zXV|y2dL2~RFTQ2Z&-%Idnrgb0d_Hd7_x{l7t8K3PMBXvEIIVe?=PS5O=~!0kdbVrT zha@&M*w-^hVAGrr-|{Z6W|!HNwN+(*pjVmhd_k!{lj~ELPE&|H=+ilILj0@) zyn)R{9dW_BcNy1HPnod6u5mftpa+9K)jNHC0GBf&`iX6_Ln|^N#PhxpV zvZv5hJ@Yv39lcFi`g&LD|J}Zq8xzHx7B013Y?*$RdjQinpDu3SJlXL{vJnmI0c*eL!siw5jPk44ofy`glX=O&z?kCc z;uumf=j~lbze5fT4i{fF_PRgdIL7_D%cVDP=FCqA_ibO^`jbc3mwg*A0|@+hFZW9Q z!%Vud!A{y%*oYabPFO(=Aq~=q zCa}{ukFosNUAVcM{VFcKu}ai_s=g*d^S!dhwm0tTeP-NYe-qjz1&VoQJdpUnZ^1iv z%DgtY+7IW`lp+>wIg!z_kX`c6`(Bp { if(other.team == b.team){ - if(other.block.hasPower && other.block.canOverdrive && other.timeScale < timeIncrease){ - other.timeScale = Math.max(other.timeScale, timeIncrease); - other.timeScaleDuration = Math.max(other.timeScaleDuration, timeDuration); + if(other.block.hasPower && other.block.canOverdrive && other.timeScale() < timeIncrease){ + other.applyBoost(timeIncrease, timeDuration); chainEffect.at(x, y, 0, hitColor, other); applyEffect.at(other, other.block.size * 7f); } @@ -39,8 +38,7 @@ public class EmpBulletType extends BasicBulletType{ } if(other.power != null && other.power.graph.getLastPowerProduced() > 0f){ - other.timeScale = Math.min(other.timeScale, powerSclDecrease); - other.timeScaleDuration = timeDuration; + other.applySlowdown(powerSclDecrease, timeDuration); other.damage(damage * powerDamageScl); hitPowerEffect.at(other.x, other.y, b.angleTo(other), hitColor); chainEffect.at(x, y, 0, hitColor, other); diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index acf0cb00f3..ce908627b1 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -346,6 +346,14 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, timeScale = Math.max(timeScale, intensity); } + public void applySlowdown(float intensity, float duration){ + //do not refresh time scale when getting a weaker intensity + if(intensity <= this.timeScale - 0.001f){ + timeScaleDuration = Math.max(timeScaleDuration, duration); + } + timeScale = Math.min(timeScale, intensity); + } + public void applyHealSuppression(float amount){ healSuppressionTime = Math.max(healSuppressionTime, Time.time + amount); } diff --git a/core/src/mindustry/maps/SectorDamage.java b/core/src/mindustry/maps/SectorDamage.java index 949d62a2e8..a1bc023531 100644 --- a/core/src/mindustry/maps/SectorDamage.java +++ b/core/src/mindustry/maps/SectorDamage.java @@ -291,16 +291,16 @@ public class SectorDamage{ } if(build.block instanceof MendProjector m){ - sumRps += m.healPercent / m.reload * avgHealth * 60f / 100f * e * build.timeScale; + sumRps += m.healPercent / m.reload * avgHealth * 60f / 100f * e * build.timeScale(); } //point defense turrets act as flat health right now if(build.block instanceof PointDefenseTurret && build.consValid()){ - sumHealth += 150f * build.timeScale; + sumHealth += 150f * build.timeScale(); } if(build.block instanceof ForceProjector f){ - sumHealth += f.shieldHealth * e * build.timeScale; + sumHealth += f.shieldHealth * e * build.timeScale(); sumRps += e; } } diff --git a/core/src/mindustry/world/blocks/power/ImpactReactor.java b/core/src/mindustry/world/blocks/power/ImpactReactor.java index 0b4dfa909b..75039604d3 100644 --- a/core/src/mindustry/world/blocks/power/ImpactReactor.java +++ b/core/src/mindustry/world/blocks/power/ImpactReactor.java @@ -52,7 +52,7 @@ public class ImpactReactor extends PowerGenerator{ addBar("poweroutput", (GeneratorBuild entity) -> new Bar(() -> Core.bundle.format("bar.poweroutput", - Strings.fixed(Math.max(entity.getPowerProduction() - consPower.usage, 0) * 60 * entity.timeScale, 1)), + Strings.fixed(Math.max(entity.getPowerProduction() - consPower.usage, 0) * 60 * entity.timeScale(), 1)), () -> Pal.powerBar, () -> entity.productionEfficiency)); } diff --git a/core/src/mindustry/world/blocks/production/Drill.java b/core/src/mindustry/world/blocks/production/Drill.java index a1b324c5bb..c32b9292c2 100644 --- a/core/src/mindustry/world/blocks/production/Drill.java +++ b/core/src/mindustry/world/blocks/production/Drill.java @@ -104,7 +104,7 @@ public class Drill extends Block{ super.setBars(); addBar("drillspeed", (DrillBuild e) -> - new Bar(() -> Core.bundle.format("bar.drillspeed", Strings.fixed(e.lastDrillSpeed * 60 * e.timeScale, 2)), () -> Pal.ammo, () -> e.warmup)); + new Bar(() -> Core.bundle.format("bar.drillspeed", Strings.fixed(e.lastDrillSpeed * 60 * e.timeScale(), 2)), () -> Pal.ammo, () -> e.warmup)); } public Item getDrop(Tile tile){