mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-27 23:11:12 -08:00
Improved generator distribution and shield block
This commit is contained in:
parent
d2a678f0b8
commit
de397a237b
11 changed files with 169 additions and 135 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 232 B |
Binary file not shown.
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 575 B |
|
|
@ -60,13 +60,6 @@ blocks/coalgenerator
|
|||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/combustiongenerator
|
||||
rotate: false
|
||||
xy: 449, 397
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/coalpurifier
|
||||
rotate: false
|
||||
xy: 230, 62
|
||||
|
|
@ -74,55 +67,62 @@ blocks/coalpurifier
|
|||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/compositewall
|
||||
blocks/combustiongenerator
|
||||
rotate: false
|
||||
xy: 230, 52
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/conduit
|
||||
blocks/compositewall
|
||||
rotate: false
|
||||
xy: 467, 451
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/conduitbottom
|
||||
blocks/conduit
|
||||
rotate: false
|
||||
xy: 477, 453
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/conduitliquid
|
||||
blocks/conduitbottom
|
||||
rotate: false
|
||||
xy: 459, 407
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/conduittop
|
||||
blocks/conduitliquid
|
||||
rotate: false
|
||||
xy: 459, 397
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/conveyor
|
||||
blocks/conduittop
|
||||
rotate: false
|
||||
xy: 252, 173
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/conveyormove
|
||||
blocks/conveyor
|
||||
rotate: false
|
||||
xy: 262, 173
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/conveyormove
|
||||
rotate: false
|
||||
xy: 272, 173
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/core
|
||||
rotate: false
|
||||
xy: 401, 418
|
||||
|
|
@ -132,49 +132,49 @@ blocks/core
|
|||
index: -1
|
||||
blocks/cross
|
||||
rotate: false
|
||||
xy: 272, 173
|
||||
xy: 282, 173
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/crucible
|
||||
rotate: false
|
||||
xy: 282, 173
|
||||
xy: 292, 173
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/deepwater
|
||||
rotate: false
|
||||
xy: 292, 173
|
||||
xy: 302, 173
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/dirt1
|
||||
rotate: false
|
||||
xy: 302, 173
|
||||
xy: 312, 173
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/dirt2
|
||||
rotate: false
|
||||
xy: 312, 173
|
||||
xy: 322, 173
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/dirt3
|
||||
rotate: false
|
||||
xy: 322, 173
|
||||
xy: 228, 154
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/dirtblock
|
||||
rotate: false
|
||||
xy: 228, 154
|
||||
xy: 228, 144
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -195,14 +195,14 @@ blocks/doubleturret
|
|||
index: -1
|
||||
blocks/drill
|
||||
rotate: false
|
||||
xy: 228, 144
|
||||
xy: 228, 134
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/duriumwall
|
||||
rotate: false
|
||||
xy: 228, 134
|
||||
xy: 211, 8
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -216,35 +216,35 @@ blocks/flameturret
|
|||
index: -1
|
||||
blocks/grass1
|
||||
rotate: false
|
||||
xy: 488, 487
|
||||
xy: 487, 477
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/grass2
|
||||
rotate: false
|
||||
xy: 487, 477
|
||||
xy: 487, 467
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/grass3
|
||||
rotate: false
|
||||
xy: 487, 467
|
||||
xy: 487, 457
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/grassblock
|
||||
rotate: false
|
||||
xy: 487, 457
|
||||
xy: 498, 487
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/grassblock2
|
||||
rotate: false
|
||||
xy: 498, 487
|
||||
xy: 497, 477
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -258,42 +258,42 @@ blocks/grassedge
|
|||
index: -1
|
||||
blocks/iron1
|
||||
rotate: false
|
||||
xy: 487, 437
|
||||
xy: 497, 437
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/iron2
|
||||
rotate: false
|
||||
xy: 497, 437
|
||||
xy: 477, 433
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/iron3
|
||||
rotate: false
|
||||
xy: 477, 433
|
||||
xy: 487, 427
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/irondrill
|
||||
rotate: false
|
||||
xy: 487, 427
|
||||
xy: 497, 427
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/ironwall
|
||||
rotate: false
|
||||
xy: 497, 427
|
||||
xy: 463, 417
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/junction
|
||||
rotate: false
|
||||
xy: 463, 417
|
||||
xy: 463, 427
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -307,7 +307,7 @@ blocks/laserturret
|
|||
index: -1
|
||||
blocks/lava
|
||||
rotate: false
|
||||
xy: 463, 427
|
||||
xy: 473, 423
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -321,14 +321,14 @@ blocks/lavaedge
|
|||
index: -1
|
||||
blocks/liquidjunction
|
||||
rotate: false
|
||||
xy: 473, 423
|
||||
xy: 473, 413
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/liquidrouter
|
||||
rotate: false
|
||||
xy: 473, 413
|
||||
xy: 483, 417
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -356,14 +356,14 @@ blocks/mortarturret
|
|||
index: -1
|
||||
blocks/mossblock
|
||||
rotate: false
|
||||
xy: 493, 417
|
||||
xy: 503, 417
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/mossstone
|
||||
rotate: false
|
||||
xy: 493, 417
|
||||
xy: 503, 417
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -377,14 +377,14 @@ blocks/nuclearreactor
|
|||
index: -1
|
||||
blocks/nuclearreactor-icon
|
||||
rotate: false
|
||||
xy: 469, 403
|
||||
xy: 469, 393
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/oil
|
||||
rotate: false
|
||||
xy: 469, 393
|
||||
xy: 483, 407
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -398,14 +398,14 @@ blocks/oiledge
|
|||
index: -1
|
||||
blocks/oilrefinery
|
||||
rotate: false
|
||||
xy: 483, 407
|
||||
xy: 493, 407
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/omnidrill
|
||||
rotate: false
|
||||
xy: 493, 407
|
||||
xy: 503, 407
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -419,21 +419,21 @@ blocks/plasmaturret
|
|||
index: -1
|
||||
blocks/poweredconveyor
|
||||
rotate: false
|
||||
xy: 479, 397
|
||||
xy: 489, 397
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/poweredconveyormove
|
||||
rotate: false
|
||||
xy: 489, 397
|
||||
xy: 499, 397
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/pump
|
||||
rotate: false
|
||||
xy: 499, 397
|
||||
xy: 479, 387
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -447,35 +447,35 @@ blocks/repairturret
|
|||
index: -1
|
||||
blocks/rock
|
||||
rotate: false
|
||||
xy: 489, 387
|
||||
xy: 499, 387
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/rock2
|
||||
rotate: false
|
||||
xy: 499, 387
|
||||
xy: 389, 224
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/rock2shadow
|
||||
rotate: false
|
||||
xy: 389, 224
|
||||
xy: 389, 214
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/rockshadow
|
||||
rotate: false
|
||||
xy: 389, 214
|
||||
xy: 389, 204
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/router
|
||||
rotate: false
|
||||
xy: 389, 204
|
||||
xy: 332, 197
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -489,7 +489,7 @@ blocks/shadow
|
|||
index: -1
|
||||
blocks/shieldgenerator
|
||||
rotate: false
|
||||
xy: 332, 197
|
||||
xy: 332, 187
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -503,21 +503,21 @@ blocks/shotgunturret
|
|||
index: -1
|
||||
blocks/shrub
|
||||
rotate: false
|
||||
xy: 332, 187
|
||||
xy: 342, 197
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/shrubshadow
|
||||
rotate: false
|
||||
xy: 342, 197
|
||||
xy: 332, 177
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/smelter
|
||||
rotate: false
|
||||
xy: 332, 177
|
||||
xy: 342, 187
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -531,21 +531,21 @@ blocks/sniperturret
|
|||
index: -1
|
||||
blocks/steelconveyor
|
||||
rotate: false
|
||||
xy: 342, 187
|
||||
xy: 342, 177
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/steelconveyormove
|
||||
rotate: false
|
||||
xy: 342, 177
|
||||
xy: 352, 192
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/steelwall
|
||||
rotate: false
|
||||
xy: 352, 192
|
||||
xy: 352, 182
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -559,49 +559,49 @@ blocks/stone
|
|||
index: -1
|
||||
blocks/stone1
|
||||
rotate: false
|
||||
xy: 352, 182
|
||||
xy: 362, 192
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/stone2
|
||||
rotate: false
|
||||
xy: 362, 192
|
||||
xy: 362, 182
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/stone3
|
||||
rotate: false
|
||||
xy: 362, 182
|
||||
xy: 372, 192
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/stoneblock
|
||||
rotate: false
|
||||
xy: 372, 192
|
||||
xy: 372, 182
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/stoneblock2
|
||||
rotate: false
|
||||
xy: 372, 182
|
||||
xy: 382, 192
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/stoneblock3
|
||||
rotate: false
|
||||
xy: 382, 192
|
||||
xy: 382, 182
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/stonedrill
|
||||
rotate: false
|
||||
xy: 382, 182
|
||||
xy: 352, 172
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -615,63 +615,63 @@ blocks/stoneedge
|
|||
index: -1
|
||||
blocks/stonewall
|
||||
rotate: false
|
||||
xy: 352, 172
|
||||
xy: 362, 172
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/thermalgenerator
|
||||
rotate: false
|
||||
xy: 362, 172
|
||||
xy: 372, 172
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/titanium1
|
||||
rotate: false
|
||||
xy: 372, 172
|
||||
xy: 382, 172
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/titanium2
|
||||
rotate: false
|
||||
xy: 382, 172
|
||||
xy: 392, 194
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/titanium3
|
||||
rotate: false
|
||||
xy: 392, 194
|
||||
xy: 392, 184
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/titaniumdrill
|
||||
rotate: false
|
||||
xy: 392, 184
|
||||
xy: 392, 174
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/titaniumpurifier
|
||||
rotate: false
|
||||
xy: 392, 174
|
||||
xy: 332, 167
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/titaniumshieldwall
|
||||
rotate: false
|
||||
xy: 332, 167
|
||||
xy: 342, 167
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/titaniumwall
|
||||
rotate: false
|
||||
xy: 342, 167
|
||||
xy: 352, 162
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -685,35 +685,35 @@ blocks/turret
|
|||
index: -1
|
||||
blocks/uranium1
|
||||
rotate: false
|
||||
xy: 362, 162
|
||||
xy: 372, 162
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/uranium2
|
||||
rotate: false
|
||||
xy: 372, 162
|
||||
xy: 382, 162
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/uranium3
|
||||
rotate: false
|
||||
xy: 382, 162
|
||||
xy: 392, 164
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/uraniumdrill
|
||||
rotate: false
|
||||
xy: 392, 164
|
||||
xy: 389, 282
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
blocks/water
|
||||
rotate: false
|
||||
xy: 389, 282
|
||||
xy: 389, 272
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -909,49 +909,49 @@ enemies/tankenemy-t3
|
|||
index: -1
|
||||
icon-coal
|
||||
rotate: false
|
||||
xy: 497, 477
|
||||
xy: 497, 467
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
icon-dirium
|
||||
rotate: false
|
||||
xy: 497, 467
|
||||
xy: 497, 457
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
icon-iron
|
||||
rotate: false
|
||||
xy: 497, 457
|
||||
xy: 487, 447
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
icon-steel
|
||||
rotate: false
|
||||
xy: 487, 447
|
||||
xy: 497, 447
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
icon-stone
|
||||
rotate: false
|
||||
xy: 497, 447
|
||||
xy: 477, 443
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
icon-titanium
|
||||
rotate: false
|
||||
xy: 477, 443
|
||||
xy: 467, 441
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
icon-uranium
|
||||
rotate: false
|
||||
xy: 467, 441
|
||||
xy: 487, 437
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -972,7 +972,7 @@ laserend
|
|||
index: -1
|
||||
player
|
||||
rotate: false
|
||||
xy: 503, 407
|
||||
xy: 479, 397
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
@ -1346,35 +1346,35 @@ weapons/blaster
|
|||
index: -1
|
||||
weapons/flamer
|
||||
rotate: false
|
||||
xy: 211, 8
|
||||
xy: 488, 487
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
weapons/mortar
|
||||
rotate: false
|
||||
xy: 483, 417
|
||||
xy: 493, 417
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
weapons/multigun
|
||||
rotate: false
|
||||
xy: 503, 417
|
||||
xy: 469, 403
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
weapons/railgun
|
||||
rotate: false
|
||||
xy: 479, 387
|
||||
xy: 489, 387
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
weapons/triblaster
|
||||
rotate: false
|
||||
xy: 352, 162
|
||||
xy: 362, 162
|
||||
size: 8, 8
|
||||
orig: 8, 8
|
||||
offset: 0, 0
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
|
@ -14,6 +14,7 @@ import io.anuke.ucore.util.Mathf;
|
|||
|
||||
public class Shield extends Entity{
|
||||
public boolean active;
|
||||
private float uptime = 0f;
|
||||
private final Tile tile;
|
||||
//TODO
|
||||
|
||||
|
|
@ -29,6 +30,15 @@ public class Shield extends Entity{
|
|||
|
||||
@Override
|
||||
public void update(){
|
||||
if(active){
|
||||
uptime += Timers.delta() / 90f;
|
||||
}else{
|
||||
uptime -= Timers.delta() / 60f;
|
||||
if(uptime < 0)
|
||||
remove();
|
||||
}
|
||||
uptime = Mathf.clamp(uptime);
|
||||
|
||||
if(!(tile.block() instanceof ShieldBlock)){
|
||||
remove();
|
||||
return;
|
||||
|
|
@ -36,7 +46,7 @@ public class Shield extends Entity{
|
|||
|
||||
ShieldBlock block = (ShieldBlock)tile.block();
|
||||
|
||||
Entities.getNearby(x, y, block.shieldRadius * 2 + 10, entity->{
|
||||
Entities.getNearby(x, y, block.shieldRadius * 2*uptime + 10, entity->{
|
||||
if(entity instanceof BulletEntity){
|
||||
BulletEntity bullet = (BulletEntity)entity;
|
||||
|
||||
|
|
@ -58,6 +68,7 @@ public class Shield extends Entity{
|
|||
ShieldBlock block = (ShieldBlock)tile.block();
|
||||
|
||||
float rad = block.shieldRadius*2 + Mathf.sin(Timers.time(), 25f, 2f);
|
||||
rad *= uptime;
|
||||
|
||||
Graphics.surface("shield", false);
|
||||
Draw.color(Color.ROYAL);
|
||||
|
|
@ -67,6 +78,10 @@ public class Shield extends Entity{
|
|||
Graphics.surface();
|
||||
}
|
||||
|
||||
public void removeDelay(){
|
||||
active = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void added(){
|
||||
active = true;
|
||||
|
|
@ -75,5 +90,7 @@ public class Shield extends Entity{
|
|||
@Override
|
||||
public void removed(){
|
||||
active = false;
|
||||
uptime = 0f;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ import io.anuke.mindustry.world.blocks.types.PowerBlock;
|
|||
import io.anuke.ucore.core.Timers;
|
||||
|
||||
public class ShieldBlock extends PowerBlock{
|
||||
private static boolean debugShield = true;
|
||||
private static boolean debugShield = false;
|
||||
|
||||
public float shieldRadius = 40f;
|
||||
public float powerDrain = 0.01f;
|
||||
public float powerDrain = 0.005f;
|
||||
|
||||
public ShieldBlock(String name) {
|
||||
super(name);
|
||||
|
|
@ -34,7 +34,7 @@ public class ShieldBlock extends PowerBlock{
|
|||
entity.power -= powerDrain * Timers.delta();
|
||||
}else{
|
||||
if(entity.shield.active && !debugShield){
|
||||
entity.shield.remove();
|
||||
entity.shield.removeDelay();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ public class PowerBooster extends Generator{
|
|||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Tile tile){
|
||||
distributePower(tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float addPower(Tile tile, float amount){
|
||||
PowerEntity entity = tile.entity();
|
||||
|
|
|
|||
|
|
@ -8,57 +8,71 @@ import io.anuke.mindustry.world.World;
|
|||
import io.anuke.mindustry.world.blocks.types.PowerAcceptor;
|
||||
import io.anuke.mindustry.world.blocks.types.PowerBlock;
|
||||
import io.anuke.ucore.core.Draw;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class Generator extends PowerBlock{
|
||||
public static final int powerTime = 8;
|
||||
|
||||
public static final int powerTime = 2;
|
||||
|
||||
public int powerRange = 6;
|
||||
public float powerSpeed = 0.15f;
|
||||
public float powerSpeed = 0.2f;
|
||||
|
||||
public Generator(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void drawPixelOverlay(Tile tile){
|
||||
super.drawPixelOverlay(tile);
|
||||
|
||||
|
||||
Draw.color("yellow");
|
||||
Draw.dashcircle(tile.worldx(), tile.worldy(), powerRange * Vars.tilesize);
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
|
||||
protected void distributePower(Tile tile){
|
||||
if(!Timers.get(tile, "generate", powerTime)){
|
||||
return;
|
||||
}
|
||||
|
||||
PowerEntity p = tile.entity();
|
||||
|
||||
int acceptors = 0;
|
||||
float flow = 0f;
|
||||
|
||||
//TODO have two phases, where it checks nearby blocks first, then distributes it evenly
|
||||
for(int x = -powerRange; x <= powerRange; x ++){
|
||||
for(int y = -powerRange; y <= powerRange; y ++){
|
||||
|
||||
if(x == 0 && y == 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(p.power <= 0.0001f){
|
||||
return;
|
||||
}
|
||||
|
||||
if(Vector2.dst(x, y, 0, 0) < powerRange){
|
||||
Tile dest = World.tile(tile.x + x, tile.y + y);
|
||||
if(dest != null && dest.block() instanceof PowerAcceptor){
|
||||
PowerAcceptor block = (PowerAcceptor)dest.block();
|
||||
|
||||
float transmission = Math.min(powerSpeed, p.power);
|
||||
|
||||
if(p.power >= 0.0001f){
|
||||
float amount = block.addPower(dest, transmission);
|
||||
p.power -= amount;
|
||||
for(int i = 0; i < 2; i++){
|
||||
for(int x = -powerRange; x <= powerRange; x++){
|
||||
for(int y = -powerRange; y <= powerRange; y++){
|
||||
|
||||
if(x == 0 && y == 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(Vector2.dst(x, y, 0, 0) < powerRange){
|
||||
Tile dest = World.tile(tile.x + x, tile.y + y);
|
||||
if(dest != null && dest.block() instanceof PowerAcceptor){
|
||||
if(i == 1){
|
||||
PowerAcceptor block = (PowerAcceptor) dest.block();
|
||||
|
||||
float transmission = Math.min(flow, p.power);
|
||||
|
||||
float amount = block.addPower(dest, transmission);
|
||||
p.power -= amount;
|
||||
}else{
|
||||
acceptors ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(i == 0 && acceptors > 0){
|
||||
flow = Mathf.clamp(powerSpeed / acceptors, 0f, p.power / acceptors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//don't accept any power
|
||||
@Override
|
||||
public float addPower(Tile tile, float amount){
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import io.anuke.mindustry.entities.TileEntity;
|
|||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
|
||||
public class ItemPowerGenerator extends Generator{
|
||||
public int itemCapacity = 20;
|
||||
|
|
@ -42,9 +41,8 @@ public class ItemPowerGenerator extends Generator{
|
|||
entity.removeItem(generateItem, 1);
|
||||
}
|
||||
|
||||
if(Timers.get(tile, "power", powerTime)){
|
||||
distributePower(tile);
|
||||
}
|
||||
distributePower(tile);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ public class LiquidItemPowerGenerator extends LiquidPowerGenerator{
|
|||
|
||||
//TODO don't generate when full of energy
|
||||
if(entity.liquidAmount >= inputLiquid && entity.hasItem(generateItem, itemInput)
|
||||
&& entity.power + generatePower < powerCapacity
|
||||
&& Timers.get(tile, "consume", generateTime)){
|
||||
entity.liquidAmount -= inputLiquid;
|
||||
entity.power += generatePower;
|
||||
|
|
@ -45,9 +46,8 @@ public class LiquidItemPowerGenerator extends LiquidPowerGenerator{
|
|||
Effects.effect(generateEffect, tile.worldx() + offset.x, tile.worldy() + offset.y);
|
||||
}
|
||||
|
||||
if(Timers.get(tile, "generate", generateTime)){
|
||||
distributePower(tile);
|
||||
}
|
||||
distributePower(tile);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@ public class LiquidPowerGenerator extends Generator implements LiquidAcceptor{
|
|||
LiquidPowerEntity entity = tile.entity();
|
||||
|
||||
//TODO don't generate when full of energy
|
||||
if(entity.liquidAmount >= inputLiquid && Timers.get(tile, "consume", generateTime)){
|
||||
if(entity.liquidAmount >= inputLiquid && entity.power + generatePower < powerCapacity
|
||||
&& Timers.get(tile, "consume", generateTime)){
|
||||
entity.liquidAmount -= inputLiquid;
|
||||
entity.power += generatePower;
|
||||
|
||||
|
|
@ -57,9 +58,8 @@ public class LiquidPowerGenerator extends Generator implements LiquidAcceptor{
|
|||
Effects.effect(generateEffect, tile.worldx() + offset.x, tile.worldy() + offset.y);
|
||||
}
|
||||
|
||||
if(Timers.get(tile, "consume", generateTime)){
|
||||
distributePower(tile);
|
||||
}
|
||||
distributePower(tile);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue