@@ -4,20 +4,73 @@ Date: Sun, 19 May 2024 19:40:31 +0800
4
4
Subject: [PATCH] ARC arcScanMode
5
5
6
6
---
7
- .../arcModule/toolpack/ArcScanMode.java | 397 ++++++++++++++++++
8
7
.../blocks/distribution/DirectionBridge.java | 7 +
9
8
.../world/blocks/distribution/ItemBridge.java | 12 +
10
9
.../world/blocks/distribution/MassDriver.java | 3 +
11
- 4 files changed, 419 insertions(+)
12
- create mode 100644 core/src/mindustry/arcModule/toolpack/ArcScanMode.java
10
+ core/src/mindustryX/features/ArcScanMode.java | 398 ++++++++++++++++++
11
+ 4 files changed, 420 insertions(+)
12
+ create mode 100644 core/src/mindustryX/features/ArcScanMode.java
13
13
14
- diff --git a/core/src/mindustry/arcModule/toolpack/ArcScanMode.java b/core/src/mindustry/arcModule/toolpack/ArcScanMode.java
14
+ diff --git a/core/src/mindustry/world/blocks/distribution/DirectionBridge.java b/core/src/mindustry/world/blocks/distribution/DirectionBridge.java
15
+ index 2c0077cc99557c80f49d0cf496c92309b31e482e..341b81c8ec8cae795b3e5c3872e253f9317975bc 100644
16
+ --- a/core/src/mindustry/world/blocks/distribution/DirectionBridge.java
17
+ +++ b/core/src/mindustry/world/blocks/distribution/DirectionBridge.java
18
+ @@ -215,5 +215,12 @@ public class DirectionBridge extends Block{
19
+ }
20
+ return null;
21
+ }
22
+ + public boolean arcCheckAccept(Building source) {
23
+ + //only accept if there's an output point.
24
+ + if(findLink() == null) return false;
25
+ +
26
+ + int rel = this.relativeToEdge(source.tile);
27
+ + return rel != rotation && occupied[(rel + 2) % 4] == null;
28
+ + }
29
+ }
30
+ }
31
+ diff --git a/core/src/mindustry/world/blocks/distribution/ItemBridge.java b/core/src/mindustry/world/blocks/distribution/ItemBridge.java
32
+ index 050e7151487c8d248c0e6e0b48913fbe944164d9..ecad9d1a4270e0611bca5c6b3d23f4d6f07dd027 100644
33
+ --- a/core/src/mindustry/world/blocks/distribution/ItemBridge.java
34
+ +++ b/core/src/mindustry/world/blocks/distribution/ItemBridge.java
35
+ @@ -530,5 +530,17 @@ public class ItemBridge extends Block{
36
+ wasMoved = moved = read.bool();
37
+ }
38
+ }
39
+ +
40
+ + public boolean arcLinkValid() {
41
+ + return linkValid(this.tile, world.tile(link));
42
+ + }
43
+ +
44
+ + public boolean arcCheckDump(Building to){
45
+ + return checkDump(to);
46
+ + }
47
+ +
48
+ + public boolean arcCheckAccept(Building source) {
49
+ + return checkAccept(source, world.tile(link));
50
+ + }
51
+ }
52
+ }
53
+ diff --git a/core/src/mindustry/world/blocks/distribution/MassDriver.java b/core/src/mindustry/world/blocks/distribution/MassDriver.java
54
+ index 7fc0d5f0ec12e7d2aaa70d32beebed9027914449..f749a280f0307a1c44294b6ebcba25808f429ef0 100644
55
+ --- a/core/src/mindustry/world/blocks/distribution/MassDriver.java
56
+ +++ b/core/src/mindustry/world/blocks/distribution/MassDriver.java
57
+ @@ -335,6 +335,9 @@ public class MassDriver extends Block{
58
+ return other instanceof MassDriverBuild entity && other.isValid() && other.efficiency > 0 && entity.block == block && entity.link == pos() && within(other, range);
59
+ }
60
+
61
+ + public boolean arcLinkValid(){
62
+ + return linkValid();
63
+ + }
64
+ protected boolean linkValid(){
65
+ if(link == -1) return false;
66
+ return world.build(this.link) instanceof MassDriverBuild other && other.block == block && other.team == team && within(other, range);
67
+ diff --git a/core/src/mindustryX/features/ArcScanMode.java b/core/src/mindustryX/features/ArcScanMode.java
15
68
new file mode 100644
16
- index 0000000000000000000000000000000000000000..b5336d79400f724b39d50c304e417ba52b8b6aaa
69
+ index 0000000000000000000000000000000000000000..f2b394217a66d92c418db8ae1311a07f4bbf9263
17
70
--- /dev/null
18
- +++ b/core/src/mindustry/arcModule/toolpack /ArcScanMode.java
19
- @@ -0,0 +1,397 @@
20
- + package mindustry.arcModule.toolpack ;
71
+ +++ b/core/src/mindustryX/features /ArcScanMode.java
72
+ @@ -0,0 +1,398 @@
73
+ + package mindustryX.features ;
21
74
+
22
75
+ import arc.*;
23
76
+ import arc.func.*;
@@ -30,7 +83,6 @@ index 0000000000000000000000000000000000000000..b5336d79400f724b39d50c304e417ba5
30
83
+ import arc.struct.*;
31
84
+ import arc.util.*;
32
85
+ import mindustry.ai.types.*;
33
- + import mindustry.arcModule.*;
34
86
+ import mindustry.gen.*;
35
87
+ import mindustry.graphics.*;
36
88
+ import mindustry.input.*;
@@ -42,9 +94,11 @@ index 0000000000000000000000000000000000000000..b5336d79400f724b39d50c304e417ba5
42
94
+ import mindustry.world.blocks.production.*;
43
95
+ import mindustry.world.blocks.storage.*;
44
96
+ import mindustry.world.meta.*;
97
+ + import mindustryX.features.ui.*;
45
98
+
46
99
+ import static mindustry.Vars.*;
47
100
+
101
+ + //move from mindustry.arcModule.toolpack.ArcScanMode
48
102
+ public class ArcScanMode{
49
103
+ public static boolean enabled = false;
50
104
+ private static final Table ctTable = new Table();
@@ -90,8 +144,8 @@ index 0000000000000000000000000000000000000000..b5336d79400f724b39d50c304e417ba5
90
144
+ private static void updateSpawnerDisplay(){
91
145
+ spawnerTable.clear();
92
146
+ flyerTable.clear();
93
- + if(arcWaveSpawner .arcWave.isEmpty()) return;
94
- + arcWaveSpawner .waveInfo thisWave = arcWaveSpawner .arcWave.get(Math.min(state.wave - 1, arcWaveSpawner .arcWave.size - 1));
147
+ + if(ArcWaveSpawner .arcWave.isEmpty()) return;
148
+ + ArcWaveSpawner .waveInfo thisWave = ArcWaveSpawner .arcWave.get(Math.min(state.wave - 1, ArcWaveSpawner .arcWave.size - 1));
95
149
+ for(Tile tile : spawner.getSpawns()){
96
150
+ if(Mathf.dst(tile.worldx(), tile.worldy(), Core.input.mouseWorldX(), Core.input.mouseWorldY()) < state.rules.dropZoneRadius){
97
151
+ float curve = Mathf.curve(Time.time % 240f, 120f, 240f);
@@ -104,7 +158,7 @@ index 0000000000000000000000000000000000000000..b5336d79400f724b39d50c304e417ba5
104
158
+ float spawnX = Mathf.clamp(world.width() * tilesize / 2f + Angles.trnsx(flyerAngle, trns), 0, world.width() * tilesize);
105
159
+ float spawnY = Mathf.clamp(world.height() * tilesize / 2f + Angles.trnsy(flyerAngle, trns), 0, world.height() * tilesize);
106
160
+
107
- + if(arcWaveSpawner .hasFlyer){
161
+ + if(ArcWaveSpawner .hasFlyer){
108
162
+ Lines.line(tile.worldx(), tile.worldy(), spawnX, spawnY);
109
163
+ Tmp.v1.set(spawnX - tile.worldx(), spawnY - tile.worldy());
110
164
+ Tmp.v1.setLength(Tmp.v1.len() * curve);
@@ -113,7 +167,7 @@ index 0000000000000000000000000000000000000000..b5336d79400f724b39d50c304e417ba5
113
167
+ Vec2 v = Core.camera.project(spawnX, spawnY);
114
168
+ flyerTable.setPosition(v.x, v.y);
115
169
+ flyerTable.table(Styles.black3, tt -> {
116
- + tt.add(RFuncs.calWaveTimer( )).row();
170
+ + tt.add(FormatDefault.duration(state.wavetime / 60, false )).row();
117
171
+ thisWave.specLoc(tile.pos(), group -> group.type.flying);
118
172
+ tt.add(thisWave.proTable(false));
119
173
+ tt.row();
@@ -133,7 +187,7 @@ index 0000000000000000000000000000000000000000..b5336d79400f724b39d50c304e417ba5
133
187
+ Vec2 v = Core.camera.project(tile.worldx(), tile.worldy());
134
188
+ spawnerTable.setPosition(v.x, v.y);
135
189
+ spawnerTable.table(Styles.black3, tt -> {
136
- + tt.add(RFuncs.calWaveTimer( )).row();
190
+ + tt.add(FormatDefault.duration(state.wavetime / 60, false )).row();
137
191
+ thisWave.specLoc(tile.pos(), group -> !group.type.flying);
138
192
+ tt.add(thisWave.proTable(false));
139
193
+ tt.row();
@@ -414,56 +468,3 @@ index 0000000000000000000000000000000000000000..b5336d79400f724b39d50c304e417ba5
414
468
+ }
415
469
+ }
416
470
+ }
417
- diff --git a/core/src/mindustry/world/blocks/distribution/DirectionBridge.java b/core/src/mindustry/world/blocks/distribution/DirectionBridge.java
418
- index 2c0077cc99557c80f49d0cf496c92309b31e482e..341b81c8ec8cae795b3e5c3872e253f9317975bc 100644
419
- --- a/core/src/mindustry/world/blocks/distribution/DirectionBridge.java
420
- +++ b/core/src/mindustry/world/blocks/distribution/DirectionBridge.java
421
- @@ -215,5 +215,12 @@ public class DirectionBridge extends Block{
422
- }
423
- return null;
424
- }
425
- + public boolean arcCheckAccept(Building source) {
426
- + //only accept if there's an output point.
427
- + if(findLink() == null) return false;
428
- +
429
- + int rel = this.relativeToEdge(source.tile);
430
- + return rel != rotation && occupied[(rel + 2) % 4] == null;
431
- + }
432
- }
433
- }
434
- diff --git a/core/src/mindustry/world/blocks/distribution/ItemBridge.java b/core/src/mindustry/world/blocks/distribution/ItemBridge.java
435
- index 050e7151487c8d248c0e6e0b48913fbe944164d9..ecad9d1a4270e0611bca5c6b3d23f4d6f07dd027 100644
436
- --- a/core/src/mindustry/world/blocks/distribution/ItemBridge.java
437
- +++ b/core/src/mindustry/world/blocks/distribution/ItemBridge.java
438
- @@ -530,5 +530,17 @@ public class ItemBridge extends Block{
439
- wasMoved = moved = read.bool();
440
- }
441
- }
442
- +
443
- + public boolean arcLinkValid() {
444
- + return linkValid(this.tile, world.tile(link));
445
- + }
446
- +
447
- + public boolean arcCheckDump(Building to){
448
- + return checkDump(to);
449
- + }
450
- +
451
- + public boolean arcCheckAccept(Building source) {
452
- + return checkAccept(source, world.tile(link));
453
- + }
454
- }
455
- }
456
- diff --git a/core/src/mindustry/world/blocks/distribution/MassDriver.java b/core/src/mindustry/world/blocks/distribution/MassDriver.java
457
- index 7fc0d5f0ec12e7d2aaa70d32beebed9027914449..f749a280f0307a1c44294b6ebcba25808f429ef0 100644
458
- --- a/core/src/mindustry/world/blocks/distribution/MassDriver.java
459
- +++ b/core/src/mindustry/world/blocks/distribution/MassDriver.java
460
- @@ -335,6 +335,9 @@ public class MassDriver extends Block{
461
- return other instanceof MassDriverBuild entity && other.isValid() && other.efficiency > 0 && entity.block == block && entity.link == pos() && within(other, range);
462
- }
463
-
464
- + public boolean arcLinkValid(){
465
- + return linkValid();
466
- + }
467
- protected boolean linkValid(){
468
- if(link == -1) return false;
469
- return world.build(this.link) instanceof MassDriverBuild other && other.block == block && other.team == team && within(other, range);
0 commit comments