Merge branch 'master' into schematic

This commit is contained in:
J-VdS
2020-08-28 13:38:46 +02:00
committed by GitHub
249 changed files with 11570 additions and 10653 deletions

6
.gitignore vendored
View File

@@ -79,9 +79,11 @@ com_crashlytics_export_strings.xml
/android/bin/ /android/bin/
/core/bin/ /core/bin/
/desktop/bin/ /desktop/bin/
/html/bin/
/ios/bin/ /ios/bin/
/ios-moe/bin/ /annotations/bin/
/server/bin/
/tests/bin/
/tools/bin/
*.tmp *.tmp
*.bak *.bak
*.swp *.swp

View File

@@ -1,5 +1,5 @@
jdk: jdk:
- openjdk8 - openjdk14
dist: xenial dist: xenial
android: android:
components: components:

View File

@@ -71,22 +71,17 @@ public class LogicStatementProcessor extends BaseProcessor{
writer.addStatement("out.append(\" \")"); writer.addStatement("out.append(\" \")");
writer.addStatement("out.append((($T)obj).$L$L)", c.mirror(), field.name(), writer.addStatement("out.append((($T)obj).$L$L)", c.mirror(), field.name(),
field.mirror().toString().equals("java.lang.String") ? Seq.with(typeu.directSupertypes(field.mirror())).contains(t -> t.toString().contains("java.lang.Enum")) ? ".name()" :
".replace(\"\\n\", \"\\\\n\")" : "");
Seq.with(typeu.directSupertypes(field.mirror())).contains(t -> t.toString().contains("java.lang.Enum")) ? ".name()" :
"");
//reading primitives, strings and enums is supported; nothing else is //reading primitives, strings and enums is supported; nothing else is
reader.addStatement("if(tokens.length > $L) result.$L = $L(tokens[$L])$L", reader.addStatement("if(tokens.length > $L) result.$L = $L(tokens[$L])",
index + 1, index + 1,
field.name(), field.name(),
field.mirror().toString().equals("java.lang.String") ? field.mirror().toString().equals("java.lang.String") ?
"" : (field.tname().isPrimitive() ? field.tname().box().toString() : "" : (field.tname().isPrimitive() ? field.tname().box().toString() :
field.mirror().toString()) + ".valueOf", //if it's not a string, it must have a valueOf method field.mirror().toString()) + ".valueOf", //if it's not a string, it must have a valueOf method
index + 1, index + 1
field.mirror().toString().equals("java.lang.String") ?
".replace(\"\\\\n\", \"\\n\")" :
""
); );
index ++; index ++;

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:lifetime,type:float,size:4},{name:tile,type:mindustry.world.Tile,size:-1},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:2,fields:[{name:effectTimer,type:float,size:4},{name:intensity,type:float,size:4},{name:life,type:float,size:4},{name:opacity,type:float,size:4},{name:weather,type:mindustry.type.Weather,size:-1},{name:windVector,type:arc.math.geom.Vec2,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -187,6 +187,10 @@ configure(subprojects - project(":annotations")){
options.compilerArgs.addAll(['--release', '8']) options.compilerArgs.addAll(['--release', '8'])
} }
} }
tasks.withType(Javadoc){
options.addStringOption('Xdoclint:none', '-quiet')
}
} }
project(":desktop"){ project(":desktop"){

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 513 B

After

Width:  |  Height:  |  Size: 513 B

View File

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 B

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

View File

@@ -138,6 +138,8 @@ mod.scripts.disable = Your device does not support mods with scripts. You must d
about.button = About about.button = About
name = Name: name = Name:
noname = Pick a[accent] player name[] first. noname = Pick a[accent] player name[] first.
planetmap = Planet Map
launchcore = Launch Core
filename = File Name: filename = File Name:
unlocked = New content unlocked! unlocked = New content unlocked!
completed = [accent]Completed completed = [accent]Completed
@@ -172,7 +174,7 @@ host.info = The [accent]host[] button hosts a server on port [scarlet]6567[]. \n
join.info = Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] or [accent]global[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[lightgray]If you want to connect to someone by IP, you would need to ask the host for their IP, which can be found by googling "my ip" from their device. join.info = Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] or [accent]global[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[lightgray]If you want to connect to someone by IP, you would need to ask the host for their IP, which can be found by googling "my ip" from their device.
hostserver = Host Multiplayer Game hostserver = Host Multiplayer Game
invitefriends = Invite Friends invitefriends = Invite Friends
hostserver.mobile = Host\nGame hostserver.mobile = Host Game
host = Host host = Host
hosting = [accent]Opening server... hosting = [accent]Opening server...
hosts.refresh = Refresh hosts.refresh = Refresh
@@ -577,6 +579,8 @@ blocks.shootrange = Range
blocks.size = Size blocks.size = Size
blocks.liquidcapacity = Liquid Capacity blocks.liquidcapacity = Liquid Capacity
blocks.powerrange = Power Range blocks.powerrange = Power Range
blocks.linkrange = Link Range
blocks.instructions = Instructions
blocks.powerconnections = Max Connections blocks.powerconnections = Max Connections
blocks.poweruse = Power Use blocks.poweruse = Power Use
blocks.powerdamage = Power/Damage blocks.powerdamage = Power/Damage
@@ -729,6 +733,7 @@ category.blocks.name = Block Select
command.attack = Attack command.attack = Attack
command.rally = Rally command.rally = Rally
command.retreat = Retreat command.retreat = Retreat
command.idle = Idle
placement.blockselectkeys = \n[lightgray]Key: [{0}, placement.blockselectkeys = \n[lightgray]Key: [{0},
keybind.respawn.name = Respawn keybind.respawn.name = Respawn
keybind.control.name = Control Unit keybind.control.name = Control Unit
@@ -741,6 +746,7 @@ keybind.toggle_block_status.name = Toggle Block Statuses
keybind.move_x.name = Move X keybind.move_x.name = Move X
keybind.move_y.name = Move Y keybind.move_y.name = Move Y
keybind.mouse_move.name = Follow Mouse keybind.mouse_move.name = Follow Mouse
keybind.pan.name = Pan View
keybind.boost.name = Boost keybind.boost.name = Boost
keybind.schematic_select.name = Select Region keybind.schematic_select.name = Select Region
keybind.schematic_menu.name = Schematic Menu keybind.schematic_menu.name = Schematic Menu
@@ -1076,6 +1082,7 @@ block.container.name = Container
block.launch-pad.name = Launch Pad block.launch-pad.name = Launch Pad
block.launch-pad-large.name = Large Launch Pad block.launch-pad-large.name = Large Launch Pad
block.segment.name = Segment block.segment.name = Segment
block.command-center.name = Command Center
block.ground-factory.name = Ground Factory block.ground-factory.name = Ground Factory
block.air-factory.name = Air Factory block.air-factory.name = Air Factory
block.naval-factory.name = Naval Factory block.naval-factory.name = Naval Factory
@@ -1083,7 +1090,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Payload Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible
@@ -1092,6 +1099,7 @@ block.overdrive-dome.name = Overdrive Dome
block.switch.name = Switch block.switch.name = Switch
block.micro-processor.name = Micro Processor block.micro-processor.name = Micro Processor
block.logic-processor.name = Logic Processor block.logic-processor.name = Logic Processor
block.hyper-processor.name = Hyper Processor
block.logic-display.name = Logic Display block.logic-display.name = Logic Display
block.memory-cell.name = Memory Cell block.memory-cell.name = Memory Cell

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Přídavný přestavbovač
block.multiplicative-reconstructor.name = Násobný přestavbovač block.multiplicative-reconstructor.name = Násobný přestavbovač
block.exponential-reconstructor.name = Exponenciální přestavbovač block.exponential-reconstructor.name = Exponenciální přestavbovač
block.tetrative-reconstructor.name = Umocňující přestavbovač block.tetrative-reconstructor.name = Umocňující přestavbovač
block.mass-conveyor.name = Hromadný dopravník block.payload-conveyor.name = Hromadný dopravník
block.payload-router.name = Směřovač nákladu block.payload-router.name = Směřovač nákladu
block.disassembler.name = Rozebírač block.disassembler.name = Rozebírač
block.silicon-crucible.name = Křemíková nádoba block.silicon-crucible.name = Křemíková nádoba

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1076,7 +1076,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Reconstructeur Additif
block.multiplicative-reconstructor.name = Reconstructeur Multiplicatif block.multiplicative-reconstructor.name = Reconstructeur Multiplicatif
block.exponential-reconstructor.name = Reconstructeur Exponentiel block.exponential-reconstructor.name = Reconstructeur Exponentiel
block.tetrative-reconstructor.name = Reconstructeur Tétratif block.tetrative-reconstructor.name = Reconstructeur Tétratif
block.mass-conveyor.name = Convoyeur de Masse block.payload-conveyor.name = Convoyeur de Masse
block.payload-router.name = Routeur de Charge Utile block.payload-router.name = Routeur de Charge Utile
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Creuset de Silicium block.silicon-crucible.name = Creuset de Silicium

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = 첨가물 재구성기
block.multiplicative-reconstructor.name = 다중 재구성기 block.multiplicative-reconstructor.name = 다중 재구성기
block.exponential-reconstructor.name = 지수 재구성기 block.exponential-reconstructor.name = 지수 재구성기
block.tetrative-reconstructor.name = 정서 재구성기 block.tetrative-reconstructor.name = 정서 재구성기
block.mass-conveyor.name = 매스 컨베이어 block.payload-conveyor.name = 매스 컨베이어
block.payload-router.name = 화물 분배기 block.payload-router.name = 화물 분배기
block.disassembler.name = 분해기 block.disassembler.name = 분해기
block.silicon-crucible.name = 실리콘 도가니 block.silicon-crucible.name = 실리콘 도가니

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1063,7 +1063,7 @@ block.additive-reconstructor.name = Rekonstruktor Addytywny
block.multiplicative-reconstructor.name = Rekonstruktor Multiplikatywny block.multiplicative-reconstructor.name = Rekonstruktor Multiplikatywny
block.exponential-reconstructor.name = Rekonstruktor Wykładniczy block.exponential-reconstructor.name = Rekonstruktor Wykładniczy
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Przenośnik Masowy block.payload-conveyor.name = Przenośnik Masowy
block.payload-router.name = Rozdzielacz Ładunku block.payload-router.name = Rozdzielacz Ładunku
block.disassembler.name = Dezasembler block.disassembler.name = Dezasembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1079,7 +1079,7 @@ block.additive-reconstructor.name = Добавляющий реконструк
block.multiplicative-reconstructor.name = Умножающий реконструктор block.multiplicative-reconstructor.name = Умножающий реконструктор
block.exponential-reconstructor.name = Экспоненциальный реконструктор block.exponential-reconstructor.name = Экспоненциальный реконструктор
block.tetrative-reconstructor.name = Тетративный реконструктор block.tetrative-reconstructor.name = Тетративный реконструктор
block.mass-conveyor.name = Грузовой конвейер block.payload-conveyor.name = Грузовой конвейер
block.payload-router.name = Разгрузочный маршрутизатор block.payload-router.name = Разгрузочный маршрутизатор
block.disassembler.name = Разборщик block.disassembler.name = Разборщик
block.silicon-crucible.name = Кремниевый тигель block.silicon-crucible.name = Кремниевый тигель

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Додавальний реконструк
block.multiplicative-reconstructor.name = Примножувальний реконструктор block.multiplicative-reconstructor.name = Примножувальний реконструктор
block.exponential-reconstructor.name = Експоненційний реконструктор block.exponential-reconstructor.name = Експоненційний реконструктор
block.tetrative-reconstructor.name = Тетративний реконструктор block.tetrative-reconstructor.name = Тетративний реконструктор
block.mass-conveyor.name = Вантажний конвеєр block.payload-conveyor.name = Вантажний конвеєр
block.payload-router.name = Розвантажувальний маршрутизатор block.payload-router.name = Розвантажувальний маршрутизатор
block.disassembler.name = Розбирач block.disassembler.name = Розбирач
block.silicon-crucible.name = Кремнієвий тигель block.silicon-crucible.name = Кремнієвий тигель

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -1062,7 +1062,7 @@ block.additive-reconstructor.name = Additive Reconstructor
block.multiplicative-reconstructor.name = Multiplicative Reconstructor block.multiplicative-reconstructor.name = Multiplicative Reconstructor
block.exponential-reconstructor.name = Exponential Reconstructor block.exponential-reconstructor.name = Exponential Reconstructor
block.tetrative-reconstructor.name = Tetrative Reconstructor block.tetrative-reconstructor.name = Tetrative Reconstructor
block.mass-conveyor.name = Mass Conveyor block.payload-conveyor.name = Mass Conveyor
block.payload-router.name = Payload Router block.payload-router.name = Payload Router
block.disassembler.name = Disassembler block.disassembler.name = Disassembler
block.silicon-crucible.name = Silicon Crucible block.silicon-crucible.name = Silicon Crucible

View File

@@ -285,3 +285,5 @@
63459=logic-display|block-logic-display-medium 63459=logic-display|block-logic-display-medium
63458=switch|block-switch-medium 63458=switch|block-switch-medium
63457=memory-cell|block-memory-cell-medium 63457=memory-cell|block-memory-cell-medium
63456=payload-conveyor|block-payload-conveyor-medium
63455=hyper-processor|block-hyper-processor-medium

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

View File

@@ -5,8 +5,9 @@ const log = function(context, obj){
} }
const readString = path => Vars.mods.getScripts().readString(path) const readString = path => Vars.mods.getScripts().readString(path)
const readBytes = path => Vars.mods.getScripts().readBytes(path) const readBytes = path => Vars.mods.getScripts().readBytes(path)
const loadMusic = path => Vars.mods.getScripts().loadMusic(path)
const loadSound = path => Vars.mods.getScripts().loadSound(path)
var scriptName = "base.js" var scriptName = "base.js"
var modName = "none" var modName = "none"

View File

@@ -7,8 +7,9 @@ const log = function(context, obj){
} }
const readString = path => Vars.mods.getScripts().readString(path) const readString = path => Vars.mods.getScripts().readString(path)
const readBytes = path => Vars.mods.getScripts().readBytes(path) const readBytes = path => Vars.mods.getScripts().readBytes(path)
const loadMusic = path => Vars.mods.getScripts().loadMusic(path)
const loadSound = path => Vars.mods.getScripts().loadSound(path)
var scriptName = "base.js" var scriptName = "base.js"
var modName = "none" var modName = "none"
@@ -40,6 +41,7 @@ importPackage(Packages.arc)
importPackage(Packages.arc.func) importPackage(Packages.arc.func)
importPackage(Packages.arc.graphics) importPackage(Packages.arc.graphics)
importPackage(Packages.arc.graphics.g2d) importPackage(Packages.arc.graphics.g2d)
importPackage(Packages.arc.graphics.gl)
importPackage(Packages.arc.math) importPackage(Packages.arc.math)
importPackage(Packages.arc.math.geom) importPackage(Packages.arc.math.geom)
importPackage(Packages.arc.scene) importPackage(Packages.arc.scene)
@@ -128,8 +130,6 @@ const ConfigEvent = Packages.mindustry.game.EventType.ConfigEvent
const DepositEvent = Packages.mindustry.game.EventType.DepositEvent const DepositEvent = Packages.mindustry.game.EventType.DepositEvent
const WithdrawEvent = Packages.mindustry.game.EventType.WithdrawEvent const WithdrawEvent = Packages.mindustry.game.EventType.WithdrawEvent
const SectorCaptureEvent = Packages.mindustry.game.EventType.SectorCaptureEvent const SectorCaptureEvent = Packages.mindustry.game.EventType.SectorCaptureEvent
const ZoneConfigureCompleteEvent = Packages.mindustry.game.EventType.ZoneConfigureCompleteEvent
const ZoneRequireCompleteEvent = Packages.mindustry.game.EventType.ZoneRequireCompleteEvent
const PlayerChatEvent = Packages.mindustry.game.EventType.PlayerChatEvent const PlayerChatEvent = Packages.mindustry.game.EventType.PlayerChatEvent
const ClientPreConnectEvent = Packages.mindustry.game.EventType.ClientPreConnectEvent const ClientPreConnectEvent = Packages.mindustry.game.EventType.ClientPreConnectEvent
const CommandIssueEvent = Packages.mindustry.game.EventType.CommandIssueEvent const CommandIssueEvent = Packages.mindustry.game.EventType.CommandIssueEvent

Binary file not shown.

Before

Width:  |  Height:  |  Size: 789 B

After

Width:  |  Height:  |  Size: 795 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 KiB

After

Width:  |  Height:  |  Size: 646 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 KiB

After

Width:  |  Height:  |  Size: 406 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 KiB

After

Width:  |  Height:  |  Size: 416 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@@ -63,6 +63,7 @@ public class BaseAI{
int range = 150; int range = 150;
Position pos = randomPosition(); Position pos = randomPosition();
//when there are no random positions, do nothing. //when there are no random positions, do nothing.
if(pos == null) return; if(pos == null) return;
@@ -159,7 +160,10 @@ public class BaseAI{
private void tryWalls(){ private void tryWalls(){
Block wall = Blocks.copperWall; Block wall = Blocks.copperWall;
Tile spawn = state.rules.defaultTeam.core() != null ? state.rules.defaultTeam.core().tile : data.team.core().tile; Building spawnt = state.rules.defaultTeam.core() != null ? state.rules.defaultTeam.core() : data.team.core();
Tile spawn = spawnt == null ? null : spawnt.tile;
if(spawn == null) return;
for(int wx = lastX; wx <= lastX + lastW; wx++){ for(int wx = lastX; wx <= lastX + lastW; wx++){
for(int wy = lastY; wy <= lastY + lastH; wy++){ for(int wy = lastY; wy <= lastY + lastH; wy++){

View File

@@ -185,7 +185,7 @@ public class BlockIndexer{
if(other == null) continue; if(other == null) continue;
if(other.team() == team && pred.get(other) && intSet.add(other.pos())){ if(other.team == team && pred.get(other) && intSet.add(other.pos())){
cons.get(other); cons.get(other);
any = true; any = true;
} }
@@ -212,11 +212,11 @@ public class BlockIndexer{
} }
public void notifyTileDamaged(Building entity){ public void notifyTileDamaged(Building entity){
if(damagedTiles[entity.team().id] == null){ if(damagedTiles[entity.team.id] == null){
damagedTiles[entity.team().id] = new BuildingArray(); damagedTiles[entity.team.id] = new BuildingArray();
} }
damagedTiles[entity.team().id].add(entity); damagedTiles[entity.team.id].add(entity);
} }
public Building findEnemyTile(Team team, float x, float y, float range, Boolf<Building> pred){ public Building findEnemyTile(Team team, float x, float y, float range, Boolf<Building> pred){
@@ -251,7 +251,7 @@ public class BlockIndexer{
if(e == null) continue; if(e == null) continue;
if(e.team() != team || !pred.get(e) || !e.block().targetable) if(e.team != team || !pred.get(e) || !e.block().targetable)
continue; continue;
float ndst = e.dst2(x, y); float ndst = e.dst2(x, y);
@@ -390,7 +390,7 @@ public class BlockIndexer{
for(int y = quadrantY * quadrantSize; y < world.height() && y < (quadrantY + 1) * quadrantSize; y++){ for(int y = quadrantY * quadrantSize; y < world.height() && y < (quadrantY + 1) * quadrantSize; y++){
Building result = world.build(x, y); Building result = world.build(x, y);
//when a targetable block is found, mark this quadrant as occupied and stop searching //when a targetable block is found, mark this quadrant as occupied and stop searching
if(result != null && result.team() == team){ if(result != null && result.team == team){
bits.set(quadrantX, quadrantY); bits.set(quadrantX, quadrantY);
break outer; break outer;
} }

View File

@@ -99,7 +99,7 @@ public class WaveSpawner{
private void eachFlyerSpawn(Floatc2 cons){ private void eachFlyerSpawn(Floatc2 cons){
for(Tile tile : spawns){ for(Tile tile : spawns){
float angle = Angles.angle(tile.x, tile.y, world.width() / 2, world.height() / 2); float angle = Angles.angle(world.width() / 2, world.height() / 2, tile.x, tile.y);
float trns = Math.max(world.width(), world.height()) * Mathf.sqrt2 * tilesize; float trns = Math.max(world.width(), world.height()) * Mathf.sqrt2 * tilesize;
float spawnX = Mathf.clamp(world.width() * tilesize / 2f + Angles.trnsx(angle, trns), -margin, world.width() * tilesize + margin); float spawnX = Mathf.clamp(world.width() * tilesize / 2f + Angles.trnsx(angle, trns), -margin, world.width() * tilesize + margin);

View File

@@ -6,6 +6,8 @@ import mindustry.entities.units.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.world.meta.*; import mindustry.world.meta.*;
import static mindustry.Vars.*;
public class FlyingAI extends AIController{ public class FlyingAI extends AIController{
@Override @Override
@@ -18,7 +20,7 @@ public class FlyingAI extends AIController{
unit.wobble(); unit.wobble();
} }
if(target != null && unit.hasWeapons()){ if(target != null && unit.hasWeapons() && command() == UnitCommand.attack){
if(unit.type().weapons.first().rotate){ if(unit.type().weapons.first().rotate){
moveTo(target, unit.range() * 0.8f); moveTo(target, unit.range() * 0.8f);
unit.lookAt(target); unit.lookAt(target);
@@ -26,6 +28,15 @@ public class FlyingAI extends AIController{
attack(80f); attack(80f);
} }
} }
if(target == null && command() == UnitCommand.attack && state.rules.waves && unit.team == state.rules.defaultTeam){
moveTo(getClosestSpawner(), state.rules.dropZoneRadius + 120f);
}
if(command() == UnitCommand.rally){
target = targetFlag(unit.x, unit.y, BlockFlag.rally, false);
moveTo(target, 60f);
}
} }
@Override @Override

View File

@@ -1,31 +1,55 @@
package mindustry.ai.types; package mindustry.ai.types;
import arc.math.*;
import mindustry.ai.Pathfinder.*; import mindustry.ai.Pathfinder.*;
import mindustry.entities.*; import mindustry.entities.*;
import mindustry.entities.units.*; import mindustry.entities.units.*;
import mindustry.game.*; import mindustry.game.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.world.*; import mindustry.world.*;
import mindustry.world.meta.*;
import static mindustry.Vars.pathfinder; import java.util.*;
import static mindustry.Vars.*;
public class GroundAI extends AIController{ public class GroundAI extends AIController{
//static final float commandCooldown = 60f * 10;
//float commandTimer = 60*3;
@Override @Override
public void updateMovement(){ public void updateMovement(){
Building core = unit.closestEnemyCore(); Building core = unit.closestEnemyCore();
if(core != null){ if(core != null && unit.within(core, unit.range() / 1.1f + core.block.size * tilesize / 2f)){
if(unit.within(core,unit.range() / 1.1f)){ target = core;
target = core; Arrays.fill(targets, core);
}
if((core == null || !unit.within(core, unit.range() * 0.5f)) && command() == UnitCommand.attack){
boolean move = true;
if(state.rules.waves && unit.team == state.rules.defaultTeam){
Tile spawner = getClosestSpawner();
if(spawner != null && unit.within(spawner, state.rules.dropZoneRadius + 120f)) move = false;
} }
if(!unit.within(core, unit.range() * 0.5f)){ if(move) moveToCore(FlagTarget.enemyCores);
moveToCore(FlagTarget.enemyCores); }
if(command() == UnitCommand.rally){
Teamc target = targetFlag(unit.x, unit.y, BlockFlag.rally, false);
if(target != null && !unit.within(target, 70f)){
moveToCore(FlagTarget.rallyPoints);
} }
} }
if(unit.type().canBoost){
unit.elevation = Mathf.approachDelta(unit.elevation, 0f, 0.08f);
}
if(!Units.invalidateTarget(target, unit, unit.range())){ if(!Units.invalidateTarget(target, unit, unit.range())){
if(unit.type().hasWeapons()){ if(unit.type().hasWeapons()){
unit.aimLook(Predict.intercept(unit, target, unit.type().weapons.first().bullet.speed)); unit.aimLook(Predict.intercept(unit, target, unit.type().weapons.first().bullet.speed));
@@ -33,12 +57,27 @@ public class GroundAI extends AIController{
}else if(unit.moving()){ }else if(unit.moving()){
unit.lookAt(unit.vel().angle()); unit.lookAt(unit.vel().angle());
} }
//auto-command works but it's very buggy
/*
if(unit instanceof Commanderc){
Commanderc c = (Commanderc)unit;
//try to command when missing members
if(c.controlling().size <= unit.type().commandLimit/2){
commandTimer -= Time.delta;
if(commandTimer <= 0){
c.commandNearby(new SquareFormation(), u -> !(u.controller() instanceof FormationAI) && !(u instanceof Commanderc));
commandTimer = commandCooldown;
}
}
}*/
} }
protected void moveToCore(FlagTarget path){ protected void moveToCore(FlagTarget path){
Tile tile = unit.tileOn(); Tile tile = unit.tileOn();
if(tile == null) return; if(tile == null) return;
Tile targetTile = pathfinder.getTargetTile(tile, unit.team(), path); Tile targetTile = pathfinder.getTargetTile(tile, unit.team, path);
if(tile == targetTile) return; if(tile == targetTile) return;

View File

@@ -39,7 +39,7 @@ public class SuicideAI extends GroundAI{
boolean blocked = Vars.world.raycast(unit.tileX(), unit.tileY(), target.tileX(), target.tileY(), (x, y) -> { boolean blocked = Vars.world.raycast(unit.tileX(), unit.tileY(), target.tileX(), target.tileY(), (x, y) -> {
Tile tile = Vars.world.tile(x, y); Tile tile = Vars.world.tile(x, y);
if(tile != null && tile.build == target) return false; if(tile != null && tile.build == target) return false;
if(tile != null && tile.build != null && tile.build.team() != unit.team()){ if(tile != null && tile.build != null && tile.build.team != unit.team()){
blockedByBlock = true; blockedByBlock = true;
return true; return true;
}else{ }else{

View File

@@ -1,6 +1,5 @@
package mindustry.async; package mindustry.async;
import arc.*;
import arc.box2d.*; import arc.box2d.*;
import arc.box2d.BodyDef.*; import arc.box2d.BodyDef.*;
import arc.math.geom.*; import arc.math.geom.*;
@@ -98,7 +97,7 @@ public class PhysicsProcess implements AsyncProcess{
ref.lastVelocity.set(ref.velocity); ref.lastVelocity.set(ref.velocity);
} }
physics.step(Core.graphics.getDeltaTime(), 5, 8); physics.step(1f/45f, 5, 8);
//get delta vectors //get delta vectors
for(PhysicRef ref : refs){ for(PhysicRef ref : refs){

View File

@@ -19,6 +19,7 @@ public class MusicControl{
public Seq<Music> ambientMusic = Seq.with(); public Seq<Music> ambientMusic = Seq.with();
/** darker music, used in times of conflict */ /** darker music, used in times of conflict */
public Seq<Music> darkMusic = Seq.with(); public Seq<Music> darkMusic = Seq.with();
protected Music lastRandomPlayed; protected Music lastRandomPlayed;
protected Interval timer = new Interval(); protected Interval timer = new Interval();
protected @Nullable Music current; protected @Nullable Music current;

View File

@@ -19,7 +19,6 @@ import mindustry.world.blocks.experimental.*;
import mindustry.world.blocks.legacy.*; import mindustry.world.blocks.legacy.*;
import mindustry.world.blocks.liquid.*; import mindustry.world.blocks.liquid.*;
import mindustry.world.blocks.logic.*; import mindustry.world.blocks.logic.*;
import mindustry.world.blocks.logic.MessageBlock;
import mindustry.world.blocks.power.*; import mindustry.world.blocks.power.*;
import mindustry.world.blocks.production.*; import mindustry.world.blocks.production.*;
import mindustry.world.blocks.sandbox.*; import mindustry.world.blocks.sandbox.*;
@@ -78,12 +77,13 @@ public class Blocks implements ContentList{
duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown, segment, parallax, duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown, segment, parallax,
//units //units
commandCenter,
groundFactory, airFactory, navalFactory, groundFactory, airFactory, navalFactory,
additiveReconstructor, multiplicativeReconstructor, exponentialReconstructor, tetrativeReconstructor, additiveReconstructor, multiplicativeReconstructor, exponentialReconstructor, tetrativeReconstructor,
repairPoint, resupplyPoint, repairPoint, resupplyPoint,
//logic //logic
message, switchBlock, microProcessor, logicProcessor, logicDisplay, memoryCell, message, switchBlock, microProcessor, logicProcessor, hyperProcessor, logicDisplay, memoryCell,
//campaign //campaign
launchPad, launchPadLarge, launchPad, launchPadLarge,
@@ -270,7 +270,7 @@ public class Blocks implements ContentList{
}}; }};
grass = new Floor("grass"){{ grass = new Floor("grass"){{
attributes.set(Attribute.water, 0.1f);
}}; }};
salt = new Floor("salt"){{ salt = new Floor("salt"){{
@@ -908,6 +908,7 @@ public class Blocks implements ContentList{
health = 45; health = 45;
speed = 0.03f; speed = 0.03f;
displayedSpeed = 4.2f; displayedSpeed = 4.2f;
buildCostMultiplier = 2f;
}}; }};
titaniumConveyor = new Conveyor("titanium-conveyor"){{ titaniumConveyor = new Conveyor("titanium-conveyor"){{
@@ -995,12 +996,14 @@ public class Blocks implements ContentList{
consumes.power(1.75f); consumes.power(1.75f);
}}; }};
payloadConveyor = new PayloadConveyor("mass-conveyor"){{ payloadConveyor = new PayloadConveyor("payload-conveyor"){{
requirements(Category.distribution, with(Items.copper, 1)); requirements(Category.distribution, with(Items.graphite, 10, Items.copper, 20));
canOverdrive = false;
}}; }};
payloadRouter = new PayloadRouter("payload-router"){{ payloadRouter = new PayloadRouter("payload-router"){{
requirements(Category.distribution, with(Items.copper, 1)); requirements(Category.distribution, with(Items.graphite, 15, Items.copper, 20));
canOverdrive = false;
}}; }};
//endregion //endregion
@@ -1338,7 +1341,7 @@ public class Blocks implements ContentList{
unloader = new Unloader("unloader"){{ unloader = new Unloader("unloader"){{
requirements(Category.effect, with(Items.titanium, 25, Items.silicon, 30)); requirements(Category.effect, with(Items.titanium, 25, Items.silicon, 30));
speed = 7f; speed = 6f;
}}; }};
//endregion //endregion
@@ -1485,7 +1488,7 @@ public class Blocks implements ContentList{
reloadTime = 35f; reloadTime = 35f;
shootCone = 40f; shootCone = 40f;
rotatespeed = 8f; rotatespeed = 8f;
powerUse = 5f; powerUse = 4f;
targetAir = false; targetAir = false;
range = 90f; range = 90f;
shootEffect = Fx.lightningShoot; shootEffect = Fx.lightningShoot;
@@ -1501,8 +1504,8 @@ public class Blocks implements ContentList{
hasPower = true; hasPower = true;
size = 2; size = 2;
force = 2.5f; force = 3f;
scaledForce = 5f; scaledForce = 5.5f;
range = 170f; range = 170f;
damage = 0.08f; damage = 0.08f;
health = 160 * size * size; health = 160 * size * size;
@@ -1555,14 +1558,14 @@ public class Blocks implements ContentList{
}}; }};
segment = new PointDefenseTurret("segment"){{ segment = new PointDefenseTurret("segment"){{
requirements(Category.turret, with(Items.silicon, 130, Items.thorium, 80, Items.phasefabric, 50)); requirements(Category.turret, with(Items.silicon, 130, Items.thorium, 80, Items.phasefabric, 25));
hasPower = true; hasPower = true;
consumes.power(3f); consumes.power(3f);
size = 2; size = 2;
shootLength = 5f; shootLength = 5f;
bulletDamage = 12f; bulletDamage = 12f;
reloadTime = 25f; reloadTime = 20f;
health = 190 * size * size; health = 190 * size * size;
}}; }};
@@ -1698,11 +1701,17 @@ public class Blocks implements ContentList{
//endregion //endregion
//region units //region units
commandCenter = new CommandCenter("command-center"){{
requirements(Category.units, ItemStack.with(Items.copper, 200, Items.lead, 250, Items.silicon, 250, Items.graphite, 100));
size = 2;
health = size * size * 55;
}};
groundFactory = new UnitFactory("ground-factory"){{ groundFactory = new UnitFactory("ground-factory"){{
requirements(Category.units, with(Items.copper, 50, Items.lead, 120, Items.silicon, 80)); requirements(Category.units, with(Items.copper, 50, Items.lead, 120, Items.silicon, 80));
plans = new UnitPlan[]{ plans = new UnitPlan[]{
new UnitPlan(UnitTypes.dagger, 60f * 20, with(Items.silicon, 10, Items.lead, 10)), new UnitPlan(UnitTypes.dagger, 60f * 15, with(Items.silicon, 10, Items.lead, 10)),
new UnitPlan(UnitTypes.crawler, 60f * 15, with(Items.silicon, 10, Items.coal, 20)), new UnitPlan(UnitTypes.crawler, 60f * 12, with(Items.silicon, 10, Items.coal, 20)),
new UnitPlan(UnitTypes.nova, 60f * 40, with(Items.silicon, 30, Items.lead, 20, Items.titanium, 20)), new UnitPlan(UnitTypes.nova, 60f * 40, with(Items.silicon, 30, Items.lead, 20, Items.titanium, 20)),
}; };
size = 3; size = 3;
@@ -1710,7 +1719,7 @@ public class Blocks implements ContentList{
}}; }};
airFactory = new UnitFactory("air-factory"){{ airFactory = new UnitFactory("air-factory"){{
requirements(Category.units, with(Items.copper, 30, Items.lead, 70)); requirements(Category.units, with(Items.copper, 60, Items.lead, 70));
plans = new UnitPlan[]{ plans = new UnitPlan[]{
new UnitPlan(UnitTypes.flare, 60f * 15, with(Items.silicon, 15)), new UnitPlan(UnitTypes.flare, 60f * 15, with(Items.silicon, 15)),
new UnitPlan(UnitTypes.mono, 60f * 35, with(Items.silicon, 30, Items.lead, 15)), new UnitPlan(UnitTypes.mono, 60f * 35, with(Items.silicon, 30, Items.lead, 15)),
@@ -1720,7 +1729,7 @@ public class Blocks implements ContentList{
}}; }};
navalFactory = new UnitFactory("naval-factory"){{ navalFactory = new UnitFactory("naval-factory"){{
requirements(Category.units, with(Items.copper, 30, Items.lead, 70)); requirements(Category.units, with(Items.copper, 150, Items.lead, 130, Items.metaglass, 120));
plans = new UnitPlan[]{ plans = new UnitPlan[]{
new UnitPlan(UnitTypes.risso, 60f * 30f, with(Items.silicon, 20, Items.metaglass, 25)), new UnitPlan(UnitTypes.risso, 60f * 30f, with(Items.silicon, 20, Items.metaglass, 25)),
}; };
@@ -1768,11 +1777,11 @@ public class Blocks implements ContentList{
}}; }};
exponentialReconstructor = new Reconstructor("exponential-reconstructor"){{ exponentialReconstructor = new Reconstructor("exponential-reconstructor"){{
requirements(Category.units, with(Items.lead, 2000, Items.silicon, 750, Items.titanium, 950, Items.thorium, 450, Items.plastanium, 350, Items.phasefabric, 250)); requirements(Category.units, with(Items.lead, 2000, Items.silicon, 750, Items.titanium, 950, Items.thorium, 450, Items.plastanium, 350, Items.phasefabric, 450));
size = 7; size = 7;
consumes.power(12f); consumes.power(13f);
consumes.items(with(Items.silicon, 250, Items.titanium, 500, Items.plastanium, 400)); consumes.items(with(Items.silicon, 450, Items.titanium, 550, Items.plastanium, 550));
consumes.liquid(Liquids.cryofluid, 1f); consumes.liquid(Liquids.cryofluid, 1f);
constructTime = 60f * 60f * 1.5f; constructTime = 60f * 60f * 1.5f;
@@ -1780,15 +1789,16 @@ public class Blocks implements ContentList{
upgrades = new UnitType[][]{ upgrades = new UnitType[][]{
{UnitTypes.zenith, UnitTypes.antumbra}, {UnitTypes.zenith, UnitTypes.antumbra},
{UnitTypes.spiroct, UnitTypes.arkyid},
}; };
}}; }};
tetrativeReconstructor = new Reconstructor("tetrative-reconstructor"){{ tetrativeReconstructor = new Reconstructor("tetrative-reconstructor"){{
requirements(Category.units, with(Items.lead, 4000, Items.silicon, 1500, Items.thorium, 500, Items.plastanium, 50, Items.phasefabric, 600, Items.surgealloy, 500)); requirements(Category.units, with(Items.lead, 4000, Items.silicon, 1500, Items.thorium, 500, Items.plastanium, 450, Items.phasefabric, 600, Items.surgealloy, 500));
size = 9; size = 9;
consumes.power(25f); consumes.power(25f);
consumes.items(with(Items.silicon, 350, Items.plastanium, 450, Items.surgealloy, 400, Items.phasefabric, 150)); consumes.items(with(Items.silicon, 350, Items.plastanium, 550, Items.surgealloy, 350, Items.phasefabric, 150));
consumes.liquid(Liquids.cryofluid, 3f); consumes.liquid(Liquids.cryofluid, 3f);
constructTime = 60f * 60f * 4; constructTime = 60f * 60f * 4;
@@ -1861,7 +1871,6 @@ public class Blocks implements ContentList{
//looked up by name, no ref needed //looked up by name, no ref needed
new LegacyMechPad("legacy-mech-pad"); new LegacyMechPad("legacy-mech-pad");
new LegacyUnitFactory("legacy-unit-factory"); new LegacyUnitFactory("legacy-unit-factory");
new LegacyCommandCenter("legacy-command-center");
//endregion //endregion
//region campaign //region campaign
@@ -1897,7 +1906,7 @@ public class Blocks implements ContentList{
}}; }};
microProcessor = new LogicBlock("micro-processor"){{ microProcessor = new LogicBlock("micro-processor"){{
requirements(Category.logic, with(Items.copper, 80, Items.lead, 50, Items.silicon, 60)); requirements(Category.logic, with(Items.copper, 80, Items.lead, 50, Items.silicon, 50));
instructionsPerTick = 2; instructionsPerTick = 2;
@@ -1905,15 +1914,28 @@ public class Blocks implements ContentList{
}}; }};
logicProcessor = new LogicBlock("logic-processor"){{ logicProcessor = new LogicBlock("logic-processor"){{
requirements(Category.logic, with(Items.lead, 320, Items.silicon, 140, Items.graphite, 80, Items.thorium, 70)); requirements(Category.logic, with(Items.lead, 320, Items.silicon, 100, Items.graphite, 60, Items.thorium, 50));
instructionsPerTick = 5; instructionsPerTick = 5;
range = 16 * 10; range = 8 * 20;
size = 2; size = 2;
}}; }};
hyperProcessor = new LogicBlock("hyper-processor"){{
requirements(Category.logic, with(Items.lead, 450, Items.silicon, 150, Items.thorium, 75, Items.surgealloy, 50));
consumes.liquid(Liquids.cryofluid, 0.08f);
hasLiquids = true;
instructionsPerTick = 25;
range = 8 * 40;
size = 3;
}};
logicDisplay = new LogicDisplay("logic-display"){{ logicDisplay = new LogicDisplay("logic-display"){{
requirements(Category.logic, with(Items.copper, 200, Items.lead, 120, Items.silicon, 100, Items.metaglass, 50)); requirements(Category.logic, with(Items.copper, 200, Items.lead, 120, Items.silicon, 100, Items.metaglass, 50));

View File

@@ -163,7 +163,7 @@ public class Bullets implements ContentList{
width = 6f; width = 6f;
height = 8f; height = 8f;
hitEffect = Fx.flakExplosion; hitEffect = Fx.flakExplosion;
splashDamage = 20f; splashDamage = 22f;
splashDamageRadius = 20f; splashDamageRadius = 20f;
fragBullet = flakGlassFrag; fragBullet = flakGlassFrag;
fragBullets = 5; fragBullets = 5;
@@ -240,7 +240,7 @@ public class Bullets implements ContentList{
explodeRange = 20f; explodeRange = 20f;
}}; }};
missileExplosive = new MissileBulletType(3f, 10){{ missileExplosive = new MissileBulletType(3.7f, 10){{
width = 8f; width = 8f;
height = 8f; height = 8f;
shrinkY = 0f; shrinkY = 0f;
@@ -255,7 +255,7 @@ public class Bullets implements ContentList{
statusDuration = 60f; statusDuration = 60f;
}}; }};
missileIncendiary = new MissileBulletType(3f, 12){{ missileIncendiary = new MissileBulletType(3.7f, 12){{
frontColor = Pal.lightishOrange; frontColor = Pal.lightishOrange;
backColor = Pal.lightOrange; backColor = Pal.lightOrange;
width = 7f; width = 7f;
@@ -269,7 +269,7 @@ public class Bullets implements ContentList{
status = StatusEffects.burning; status = StatusEffects.burning;
}}; }};
missileSurge = new MissileBulletType(3f, 20){{ missileSurge = new MissileBulletType(3.7f, 20){{
width = 8f; width = 8f;
height = 8f; height = 8f;
shrinkY = 0f; shrinkY = 0f;
@@ -279,7 +279,7 @@ public class Bullets implements ContentList{
hitEffect = Fx.blastExplosion; hitEffect = Fx.blastExplosion;
despawnEffect = Fx.blastExplosion; despawnEffect = Fx.blastExplosion;
lightning = 2; lightning = 2;
lightningLength = 14; lightningLength = 10;
}}; }};
standardCopper = new BasicBulletType(2.5f, 9){{ standardCopper = new BasicBulletType(2.5f, 9){{

View File

@@ -33,8 +33,10 @@ public class Fx{
float scl = 1f + e.fout() * 2f; float scl = 1f + e.fout() * 2f;
UnitType unit = e.data(); UnitType unit = e.data();
rect(unit.region, e.x, e.y, TextureRegion region = unit.icon(Cicon.full);
unit.region.getWidth() * Draw.scl * scl, unit.region.getHeight() * Draw.scl * scl, 180f);
rect(region, e.x, e.y,
region.getWidth() * Draw.scl * scl, region.getHeight() * Draw.scl * scl, 180f);
}), }),
@@ -512,6 +514,29 @@ public class Fx{
}), }),
sapExplosion = new Effect(25, e -> {
color(Pal.sapBullet);
e.scaled(6, i -> {
stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 80f);
});
color(Color.gray);
randLenVectors(e.id, 9, 2f + 70 * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
});
color(Pal.sapBulletBack);
stroke(1f * e.fout());
randLenVectors(e.id + 1, 8, 1f + 60f * e.finpow(), (x, y) -> {
lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
}),
massiveExplosion = new Effect(30, e -> { massiveExplosion = new Effect(30, e -> {
color(Pal.missileYellow); color(Pal.missileYellow);

View File

@@ -17,7 +17,7 @@ import static mindustry.content.UnitTypes.*;
import static mindustry.type.ItemStack.*; import static mindustry.type.ItemStack.*;
public class TechTree implements ContentList{ public class TechTree implements ContentList{
private static ObjectMap<UnlockableContent, TechNode> map = new ObjectMap<>(); static ObjectMap<UnlockableContent, TechNode> map = new ObjectMap<>();
public static Seq<TechNode> all; public static Seq<TechNode> all;
public static TechNode root; public static TechNode root;
@@ -38,7 +38,6 @@ public class TechTree implements ContentList{
node(distributor); node(distributor);
node(sorter, () -> { node(sorter, () -> {
node(invertedSorter); node(invertedSorter);
node(message);
node(overflowGate, () -> { node(overflowGate, () -> {
node(underflowGate); node(underflowGate);
}); });
@@ -204,6 +203,26 @@ public class TechTree implements ContentList{
}); });
}); });
}); });
node(microProcessor, () -> {
node(switchBlock, () -> {
node(message, () -> {
node(logicDisplay, () -> {
});
node(memoryCell, () -> {
});
});
node(logicProcessor, () -> {
node(hyperProcessor, () -> {
});
});
});
});
}); });
}); });
}); });
@@ -340,6 +359,10 @@ public class TechTree implements ContentList{
}); });
node(groundFactory, () -> { node(groundFactory, () -> {
node(commandCenter, () -> {
});
node(dagger, () -> { node(dagger, () -> {
node(mace, () -> { node(mace, () -> {
node(fortress, () -> { node(fortress, () -> {
@@ -406,8 +429,6 @@ public class TechTree implements ContentList{
}); });
}); });
//TODO research sectors
node(groundZero, () -> { node(groundZero, () -> {
node(frozenForest, Seq.with( node(frozenForest, Seq.with(
new SectorComplete(groundZero), new SectorComplete(groundZero),
@@ -544,7 +565,7 @@ public class TechTree implements ContentList{
} }
public static class TechNode{ public static class TechNode{
private static TechNode context; static TechNode context;
/** Depth in tech tree. */ /** Depth in tech tree. */
public int depth; public int depth;
@@ -556,25 +577,20 @@ public class TechTree implements ContentList{
public ItemStack[] requirements; public ItemStack[] requirements;
/** Requirements that have been fulfilled. Always the same length as the requirement array. */ /** Requirements that have been fulfilled. Always the same length as the requirement array. */
public final ItemStack[] finishedRequirements; public final ItemStack[] finishedRequirements;
/** Extra objectives needed to research this. TODO implement */ /** Extra objectives needed to research this. */
public Seq<Objective> objectives = new Seq<>(); public Seq<Objective> objectives = new Seq<>();
/** Time required to research this content, in seconds. */ /** Time required to research this content, in seconds. */
public float time; public float time;
/** Nodes that depend on this node. */ /** Nodes that depend on this node. */
public final Seq<TechNode> children = new Seq<>(); public final Seq<TechNode> children = new Seq<>();
/** Research progress, in seconds. */
public float progress;
TechNode(@Nullable TechNode ccontext, UnlockableContent content, ItemStack[] requirements, Runnable children){ TechNode(@Nullable TechNode ccontext, UnlockableContent content, ItemStack[] requirements, Runnable children){
if(ccontext != null){ if(ccontext != null) ccontext.children.add(this);
ccontext.children.add(this);
}
this.parent = ccontext; this.parent = ccontext;
this.content = content; this.content = content;
this.requirements = requirements; this.requirements = requirements;
this.depth = parent == null ? 0 : parent.depth + 1; this.depth = parent == null ? 0 : parent.depth + 1;
this.progress = Core.settings == null ? 0 : Core.settings.getFloat("research-" + content.name, 0f);
this.time = Seq.with(requirements).mapFloat(i -> i.item.cost * i.amount).sum() * 10; this.time = Seq.with(requirements).mapFloat(i -> i.item.cost * i.amount).sum() * 10;
this.finishedRequirements = new ItemStack[requirements.length]; this.finishedRequirements = new ItemStack[requirements.length];
@@ -599,7 +615,6 @@ public class TechTree implements ContentList{
/** Flushes research progress to settings. */ /** Flushes research progress to settings. */
public void save(){ public void save(){
Core.settings.put("research-" + content.name, progress);
//save finished requirements by item type //save finished requirements by item type
for(ItemStack stack : finishedRequirements){ for(ItemStack stack : finishedRequirements){

View File

@@ -27,7 +27,7 @@ public class UnitTypes implements ContentList{
public static @EntityDef({Unitc.class, Legsc.class}) UnitType atrax; public static @EntityDef({Unitc.class, Legsc.class}) UnitType atrax;
//legs + building //legs + building
public static @EntityDef({Unitc.class, Legsc.class, Builderc.class}) UnitType spiroct, arkyid; public static @EntityDef({Unitc.class, Legsc.class, Builderc.class}) UnitType spiroct, arkyid, toxopid;
//air (no special traits) //air (no special traits)
public static @EntityDef({Unitc.class}) UnitType flare, eclipse, horizon, zenith, antumbra; public static @EntityDef({Unitc.class}) UnitType flare, eclipse, horizon, zenith, antumbra;
@@ -72,7 +72,6 @@ public class UnitTypes implements ContentList{
mace = new UnitType("mace"){{ mace = new UnitType("mace"){{
speed = 0.4f; speed = 0.4f;
hitsize = 9f; hitsize = 9f;
range = 10f;
health = 500; health = 500;
armor = 4f; armor = 4f;
@@ -84,12 +83,11 @@ public class UnitTypes implements ContentList{
reload = 14f; reload = 14f;
recoil = 1f; recoil = 1f;
ejectEffect = Fx.none; ejectEffect = Fx.none;
bullet = new BulletType(3f, 30f){{ bullet = new BulletType(3.9f, 30f){{
ammoMultiplier = 3f; ammoMultiplier = 3f;
hitSize = 7f; hitSize = 7f;
lifetime = 42f; lifetime = 12f;
pierce = true; pierce = true;
drag = 0.05f;
statusDuration = 60f * 4; statusDuration = 60f * 4;
shootEffect = Fx.shootSmallFlame; shootEffect = Fx.shootSmallFlame;
hitEffect = Fx.hitFlameSmall; hitEffect = Fx.hitFlameSmall;
@@ -165,7 +163,7 @@ public class UnitTypes implements ContentList{
boostMultiplier = 1.5f; boostMultiplier = 1.5f;
speed = 0.48f; speed = 0.48f;
hitsize = 10f; hitsize = 10f;
health = 300f; health = 320f;
buildSpeed = 0.9f; buildSpeed = 0.9f;
armor = 4f; armor = 4f;
@@ -173,7 +171,7 @@ public class UnitTypes implements ContentList{
mineSpeed = 5f; mineSpeed = 5f;
commandLimit = 8; commandLimit = 8;
abilities.add(new ShieldFieldAbility(15f, 30f, 60f * 5, 60f)); abilities.add(new ShieldFieldAbility(20f, 40f, 60f * 5, 60f));
weapons.add(new Weapon("heal-shotgun-weapon"){{ weapons.add(new Weapon("heal-shotgun-weapon"){{
x = 5f; x = 5f;
@@ -193,7 +191,7 @@ public class UnitTypes implements ContentList{
bullet = new LightningBulletType(){{ bullet = new LightningBulletType(){{
lightningColor = hitColor = Pal.heal; lightningColor = hitColor = Pal.heal;
damage = 12f; damage = 15f;
lightningLength = 7; lightningLength = 7;
lightningLengthRand = 7; lightningLengthRand = 7;
shootEffect = Fx.shootHeal; shootEffect = Fx.shootHeal;
@@ -206,7 +204,7 @@ public class UnitTypes implements ContentList{
hitsize = 12f; hitsize = 12f;
boostMultiplier = 2f; boostMultiplier = 2f;
itemCapacity = 80; itemCapacity = 80;
health = 640f; health = 650f;
buildSpeed = 1.7f; buildSpeed = 1.7f;
canBoost = true; canBoost = true;
armor = 9f; armor = 9f;
@@ -219,7 +217,7 @@ public class UnitTypes implements ContentList{
mineSpeed = 7f; mineSpeed = 7f;
drawShields = false; drawShields = false;
abilities.add(new ForceFieldAbility(60f, 0.12f, 200f, 60f * 8)); abilities.add(new ForceFieldAbility(60f, 0.2f, 300f, 60f * 7));
weapons.add(new Weapon("beam-weapon"){{ weapons.add(new Weapon("beam-weapon"){{
shake = 2f; shake = 2f;
@@ -230,7 +228,7 @@ public class UnitTypes implements ContentList{
shootSound = Sounds.laser; shootSound = Sounds.laser;
bullet = new LaserBulletType(){{ bullet = new LaserBulletType(){{
damage = 27f; damage = 30f;
recoil = 1f; recoil = 1f;
sideAngle = 45f; sideAngle = 45f;
sideWidth = 1f; sideWidth = 1f;
@@ -316,7 +314,7 @@ public class UnitTypes implements ContentList{
drag = 0.4f; drag = 0.4f;
hitsize = 12f; hitsize = 12f;
rotateSpeed = 3f; rotateSpeed = 3f;
health = 600; health = 760;
immunities = ObjectSet.with(StatusEffects.burning, StatusEffects.melting); immunities = ObjectSet.with(StatusEffects.burning, StatusEffects.melting);
legCount = 6; legCount = 6;
legLength = 13f; legLength = 13f;
@@ -352,7 +350,7 @@ public class UnitTypes implements ContentList{
despawnEffect = Fx.none; despawnEffect = Fx.none;
width = 0.54f; width = 0.54f;
lifetime = 35f; lifetime = 35f;
knockback = -1.2f; knockback = -1.24f;
}}; }};
}}); }});
@@ -365,62 +363,109 @@ public class UnitTypes implements ContentList{
bullet = new SapBulletType(){{ bullet = new SapBulletType(){{
sapStrength = 0.65f; sapStrength = 0.65f;
length = 40f; length = 40f;
damage = 12; damage = 13;
shootEffect = Fx.shootSmall; shootEffect = Fx.shootSmall;
hitColor = color = Color.valueOf("bf92f9"); hitColor = color = Color.valueOf("bf92f9");
despawnEffect = Fx.none; despawnEffect = Fx.none;
width = 0.4f; width = 0.4f;
lifetime = 25f; lifetime = 25f;
knockback = -0.6f; knockback = -0.65f;
}}; }};
}}); }});
}}; }};
//TODO implement
arkyid = new UnitType("arkyid"){{ arkyid = new UnitType("arkyid"){{
drag = 0.1f; drag = 0.1f;
speed = 0.5f; speed = 0.5f;
hitsize = 9f; hitsize = 21f;
health = 140; health = 8000;
armor = 6f;
legCount = 6; legCount = 6;
legMoveSpace = 1f; legMoveSpace = 1f;
legPairOffset = 3; legPairOffset = 3;
legLength = 34f; legLength = 30f;
rotateShooting = false;
legExtension = -15; legExtension = -15;
legBaseOffset = 10f; legBaseOffset = 10f;
landShake = 2f; landShake = 1f;
legSpeed = 0.1f; legSpeed = 0.1f;
legLengthScl = 1f; legLengthScl = 1f;
rippleScale = 2f; rippleScale = 2f;
legSpeed = 0.2f; legSpeed = 0.2f;
legSplashDamage = 32; legSplashDamage = 32;
legSplashRange = 30; legSplashRange = 30;
hovering = true;
allowLegStep = true;
visualElevation = 0.4f;
groundLayer = Layer.legUnit;
BulletType sapper = new SapBulletType(){{
sapStrength = 0.8f;
length = 55f;
damage = 34;
shootEffect = Fx.shootSmall;
hitColor = color = Color.valueOf("bf92f9");
despawnEffect = Fx.none;
width = 0.55f;
lifetime = 30f;
knockback = -1f;
}};
weapons.add( weapons.add(
new Weapon("missiles-mount"){{ new Weapon("spiroct-weapon"){{
reload = 20f; reload = 9f;
x = 4f; x = 4f;
y = 8f;
rotate = true; rotate = true;
shake = 1f; bullet = sapper;
bullet = new MissileBulletType(2.7f, 12, "missile"){{ }},
width = 8f; new Weapon("spiroct-weapon"){{
height = 8f; reload = 15f;
shrinkY = 0f; x = 9f;
drag = -0.003f; y = 6f;
homingRange = 60f; rotate = true;
keepVelocity = false; bullet = sapper;
splashDamageRadius = 25f; }},
splashDamage = 10f; new Weapon("spiroct-weapon"){{
lifetime = 120f; reload = 23f;
trailColor = Color.gray; x = 14f;
backColor = Pal.bulletYellowBack; y = 0f;
frontColor = Pal.bulletYellow; rotate = true;
hitEffect = Fx.blastExplosion; bullet = sapper;
despawnEffect = Fx.blastExplosion; }},
weaveScale = 8f; new Weapon("large-purple-mount"){{
weaveMag = 2f; y = -7f;
x = 9f;
shootY = 7f;
reload = 45;
shake = 3f;
rotateSpeed = 2f;
ejectEffect = Fx.shellEjectSmall;
shootSound = Sounds.shootBig;
rotate = true;
occlusion = 8f;
recoil = 3f;
bullet = new ArtilleryBulletType(2f, 12){{
hitEffect = Fx.sapExplosion;
knockback = 0.8f;
lifetime = 70f;
width = height = 19f;
collidesTiles = false;
ammoMultiplier = 4f;
splashDamageRadius = 95f;
splashDamage = 55f;
backColor = Pal.sapBulletBack;
frontColor = lightningColor = Pal.sapBullet;
lightning = 3;
lightningLength = 10;
smokeEffect = Fx.shootBigSmoke2;
shake = 5f;
status = StatusEffects.sapped;
statusDuration = 60f * 10;
}}; }};
}}); }});
}}; }};
@@ -448,7 +493,7 @@ public class UnitTypes implements ContentList{
}}; }};
horizon = new UnitType("horizon"){{ horizon = new UnitType("horizon"){{
health = 300; health = 350;
speed = 2f; speed = 2f;
accel = 0.08f; accel = 0.08f;
drag = 0.016f; drag = 0.016f;
@@ -457,19 +502,19 @@ public class UnitTypes implements ContentList{
engineOffset = 7.8f; engineOffset = 7.8f;
range = 140f; range = 140f;
faceTarget = false; faceTarget = false;
armor = 2f; armor = 4f;
weapons.add(new Weapon(){{ weapons.add(new Weapon(){{
minShootVelocity = 0.75f; minShootVelocity = 0.75f;
x = 3f; x = 3f;
shootY = 0f; shootY = 0f;
reload = 12f; reload = 11f;
shootCone = 180f; shootCone = 180f;
ejectEffect = Fx.none; ejectEffect = Fx.none;
inaccuracy = 15f; inaccuracy = 15f;
ignoreRotation = true; ignoreRotation = true;
shootSound = Sounds.none; shootSound = Sounds.none;
bullet = new BombBulletType(23f, 25f){{ bullet = new BombBulletType(28f, 25f){{
width = 10f; width = 10f;
height = 14f; height = 14f;
hitEffect = Fx.flakExplosion; hitEffect = Fx.flakExplosion;
@@ -483,21 +528,21 @@ public class UnitTypes implements ContentList{
}}; }};
zenith = new UnitType("zenith"){{ zenith = new UnitType("zenith"){{
health = 1000; health = 700;
speed = 1.9f; speed = 1.7f;
accel = 0.04f; accel = 0.04f;
drag = 0.016f; drag = 0.016f;
flying = true; flying = true;
range = 140f; range = 140f;
hitsize = 18f; hitsize = 18f;
lowAltitude = true; lowAltitude = true;
armor = 6f; armor = 5f;
engineOffset = 12f; engineOffset = 12f;
engineSize = 3f; engineSize = 3f;
weapons.add(new Weapon("zenith-missiles"){{ weapons.add(new Weapon("zenith-missiles"){{
reload = 32f; reload = 40f;
x = 7f; x = 7f;
rotate = true; rotate = true;
shake = 1f; shake = 1f;
@@ -533,21 +578,21 @@ public class UnitTypes implements ContentList{
rotateSpeed = 1.9f; rotateSpeed = 1.9f;
flying = true; flying = true;
lowAltitude = true; lowAltitude = true;
health = 9000; health = 7000;
armor = 9f; armor = 9f;
engineOffset = 21; engineOffset = 21;
engineSize = 5.3f; engineSize = 5.3f;
hitsize = 58f; hitsize = 56f;
BulletType missiles = new MissileBulletType(2.7f, 10){{ BulletType missiles = new MissileBulletType(2.7f, 10){{
width = 8f; width = 8f;
height = 8f; height = 8f;
shrinkY = 0f; shrinkY = 0f;
drag = -0.01f; drag = -0.01f;
splashDamageRadius = 40f; splashDamageRadius = 20f;
splashDamage = 40f; splashDamage = 30f;
ammoMultiplier = 4f; ammoMultiplier = 4f;
lifetime = 80f; lifetime = 50f;
hitEffect = Fx.blastExplosion; hitEffect = Fx.blastExplosion;
despawnEffect = Fx.blastExplosion; despawnEffect = Fx.blastExplosion;
@@ -581,17 +626,18 @@ public class UnitTypes implements ContentList{
new Weapon("large-bullet-mount"){{ new Weapon("large-bullet-mount"){{
y = 2f; y = 2f;
x = 10f; x = 10f;
shootY = 12f; shootY = 10f;
reload = 10; reload = 12;
shake = 1f; shake = 1f;
rotateSpeed = 2f; rotateSpeed = 2f;
ejectEffect = Fx.shellEjectSmall; ejectEffect = Fx.shellEjectSmall;
shootSound = Sounds.shootBig; shootSound = Sounds.shootBig;
rotate = true; rotate = true;
occlusion = 8f; occlusion = 8f;
bullet = new BasicBulletType(7f, 60){{ bullet = new BasicBulletType(7f, 50){{
width = 12f; width = 12f;
height = 18f; height = 18f;
lifetime = 25f;
shootEffect = Fx.shootBig; shootEffect = Fx.shootBig;
}}; }};
}} }}
@@ -612,6 +658,18 @@ public class UnitTypes implements ContentList{
destructibleWreck = false; destructibleWreck = false;
armor = 13f; armor = 13f;
BulletType fragBullet = new FlakBulletType(4f, 5){{
shootEffect = Fx.shootBig;
ammoMultiplier = 4f;
splashDamage = 42f;
splashDamageRadius = 25f;
collidesGround = true;
lifetime = 38f;
status = StatusEffects.blasted;
statusDuration = 60f;
}};
weapons.add( weapons.add(
new Weapon("large-laser-mount"){{ new Weapon("large-laser-mount"){{
shake = 4f; shake = 4f;
@@ -619,14 +677,14 @@ public class UnitTypes implements ContentList{
x = 18f; x = 18f;
y = 5f; y = 5f;
rotateSpeed = 2f; rotateSpeed = 2f;
reload = 50f; reload = 45f;
recoil = 4f; recoil = 4f;
shootSound = Sounds.laser; shootSound = Sounds.laser;
occlusion = 20f; occlusion = 20f;
rotate = true; rotate = true;
bullet = new LaserBulletType(){{ bullet = new LaserBulletType(){{
damage = 75f; damage = 90f;
sideAngle = 20f; sideAngle = 20f;
sideWidth = 1.5f; sideWidth = 1.5f;
sideLength = 80f; sideLength = 80f;
@@ -636,50 +694,29 @@ public class UnitTypes implements ContentList{
colors = new Color[]{Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.white}; colors = new Color[]{Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.white};
}}; }};
}}, }},
new Weapon("missiles-mount"){{ new Weapon("large-artillery"){{
x = 11f; x = 11f;
y = 27f; y = 27f;
rotateSpeed = 2f; rotateSpeed = 2f;
reload = 4f; reload = 9f;
shootSound = Sounds.flame; shootSound = Sounds.flame;
occlusion = 7f; occlusion = 7f;
rotate = true; rotate = true;
recoil = 0.5f; recoil = 0.5f;
bullet = Bullets.pyraFlame; bullet = fragBullet;
}}, }},
new Weapon("large-artillery"){{ new Weapon("large-artillery"){{
y = -13f; y = -13f;
x = 20f; x = 20f;
reload = 18f; reload = 12f;
ejectEffect = Fx.shellEjectSmall; ejectEffect = Fx.shellEjectSmall;
rotateSpeed = 7f; rotateSpeed = 7f;
shake = 1f; shake = 1f;
shootSound = Sounds.shoot; shootSound = Sounds.shoot;
rotate = true; rotate = true;
occlusion = 12f; occlusion = 12f;
bullet = new ArtilleryBulletType(3.2f, 12){{ bullet = fragBullet;
trailMult = 0.8f;
hitEffect = Fx.massiveExplosion;
knockback = 1.5f;
lifetime = 140f;
height = 12f;
width = 12f;
collidesTiles = false;
ammoMultiplier = 4f;
splashDamageRadius = 60f;
splashDamage = 60f;
backColor = Pal.missileYellowBack;
frontColor = Pal.missileYellow;
trailEffect = Fx.artilleryTrail;
trailSize = 6f;
hitShake = 4f;
shootEffect = Fx.shootBig2;
status = StatusEffects.blasted;
statusDuration = 60f;
}};
}}); }});
}}; }};
@@ -1001,7 +1038,7 @@ public class UnitTypes implements ContentList{
lifetime = 60f; lifetime = 60f;
shootEffect = Fx.shootSmall; shootEffect = Fx.shootSmall;
smokeEffect = Fx.shootSmallSmoke; smokeEffect = Fx.shootSmallSmoke;
tileDamageMultiplier = 0.95f; tileDamageMultiplier = 0.09f;
}}; }};
}}); }});
}}; }};
@@ -1092,6 +1129,7 @@ public class UnitTypes implements ContentList{
hitsize = 0f; hitsize = 0f;
health = 1; health = 1;
rotateSpeed = 360f; rotateSpeed = 360f;
itemCapacity = 0;
} }
@Override @Override

View File

@@ -243,11 +243,11 @@ public class ContentLoader{
} }
public Block block(int id){ public Block block(int id){
return (Block)getByID(ContentType.block, id); return getByID(ContentType.block, id);
} }
public Block block(String name){ public Block block(String name){
return (Block)getByName(ContentType.block, name); return getByName(ContentType.block, name);
} }
public Seq<Item> items(){ public Seq<Item> items(){
@@ -255,7 +255,7 @@ public class ContentLoader{
} }
public Item item(int id){ public Item item(int id){
return (Item)getByID(ContentType.item, id); return getByID(ContentType.item, id);
} }
public Seq<Liquid> liquids(){ public Seq<Liquid> liquids(){
@@ -263,7 +263,7 @@ public class ContentLoader{
} }
public Liquid liquid(int id){ public Liquid liquid(int id){
return (Liquid)getByID(ContentType.liquid, id); return getByID(ContentType.liquid, id);
} }
public Seq<BulletType> bullets(){ public Seq<BulletType> bullets(){
@@ -271,7 +271,7 @@ public class ContentLoader{
} }
public BulletType bullet(int id){ public BulletType bullet(int id){
return (BulletType)getByID(ContentType.bullet, id); return getByID(ContentType.bullet, id);
} }
public Seq<SectorPreset> sectors(){ public Seq<SectorPreset> sectors(){

View File

@@ -155,12 +155,6 @@ public class Control implements ApplicationListener, Loadable{
} }
}); });
Events.on(ZoneRequireCompleteEvent.class, e -> {
if(e.objective.display() != null){
ui.hudfrag.showToast(Core.bundle.format("zone.requirement.complete", e.zoneForMet.localizedName, e.objective.display()));
}
});
//delete save on campaign game over //delete save on campaign game over
Events.on(GameOverEvent.class, e -> { Events.on(GameOverEvent.class, e -> {
if(state.isCampaign() && !net.client() && !headless){ if(state.isCampaign() && !net.client() && !headless){

View File

@@ -302,6 +302,11 @@ public class Logic implements ApplicationListener{
}); });
} }
@Remote(called = Loc.both)
public static void updateGameOver(Team winner){
state.gameOver = true;
}
@Remote(called = Loc.both) @Remote(called = Loc.both)
public static void gameOver(Team winner){ public static void gameOver(Team winner){
state.stats.wavesLasted = state.wave; state.stats.wavesLasted = state.wave;
@@ -320,6 +325,10 @@ public class Logic implements ApplicationListener{
Events.fire(Trigger.update); Events.fire(Trigger.update);
universe.updateGlobal(); universe.updateGlobal();
if(Core.settings.modified() && !state.isPlaying()){
Core.settings.forceSave();
}
if(state.isGame()){ if(state.isGame()){
if(!net.client()){ if(!net.client()){
state.enemies = Groups.unit.count(u -> u.team() == state.rules.waveTeam && u.type().isCounted); state.enemies = Groups.unit.count(u -> u.team() == state.rules.waveTeam && u.type().isCounted);

View File

@@ -366,6 +366,9 @@ public class NetClient implements ApplicationListener{
@Remote @Remote
public static void playerDisconnect(int playerid){ public static void playerDisconnect(int playerid){
if(netClient != null){
netClient.addRemovedEntity(playerid);
}
Groups.player.removeByID(playerid); Groups.player.removeByID(playerid);
} }
@@ -437,13 +440,14 @@ public class NetClient implements ApplicationListener{
} }
@Remote(variants = Variant.one, priority = PacketPriority.low, unreliable = true) @Remote(variants = Variant.one, priority = PacketPriority.low, unreliable = true)
public static void stateSnapshot(float waveTime, int wave, int enemies, boolean paused, short coreDataLen, byte[] coreData){ public static void stateSnapshot(float waveTime, int wave, int enemies, boolean paused, boolean gameOver, short coreDataLen, byte[] coreData){
try{ try{
if(wave > state.wave){ if(wave > state.wave){
state.wave = wave; state.wave = wave;
Events.fire(new WaveEvent()); Events.fire(new WaveEvent());
} }
state.gameOver = gameOver;
state.wavetime = waveTime; state.wavetime = waveTime;
state.wave = wave; state.wave = wave;
state.enemies = enemies; state.enemies = enemies;
@@ -558,6 +562,22 @@ public class NetClient implements ApplicationListener{
//limit to 10 to prevent buffer overflows //limit to 10 to prevent buffer overflows
int usedRequests = Math.min(player.builder().plans().size, 10); int usedRequests = Math.min(player.builder().plans().size, 10);
int totalLength = 0;
//prevent buffer overflow by checking config length
for(int i = 0; i < usedRequests; i++){
BuildPlan plan = player.builder().plans().get(i);
if(plan.config instanceof byte[]){
int length = ((byte[])plan.config).length;
totalLength += length;
}
if(totalLength > 2048){
usedRequests = i + 1;
break;
}
}
requests = new BuildPlan[usedRequests]; requests = new BuildPlan[usedRequests];
for(int i = 0; i < usedRequests; i++){ for(int i = 0; i < usedRequests; i++){
requests[i] = player.builder().plans().get(i); requests[i] = player.builder().plans().get(i);

View File

@@ -34,8 +34,9 @@ import static arc.util.Log.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
public class NetServer implements ApplicationListener{ public class NetServer implements ApplicationListener{
private static final int maxSnapshotSize = 430, timerBlockSync = 0; /** note that snapshots are compressed, so the max snapshot size here is above the typical UDP safe limit */
private static final float serverSyncTime = 12, blockSyncTime = 60 * 8; private static final int maxSnapshotSize = 800, timerBlockSync = 0;
private static final float serverSyncTime = 12, blockSyncTime = 60 * 6;
private static final FloatBuffer fbuffer = FloatBuffer.allocate(20); private static final FloatBuffer fbuffer = FloatBuffer.allocate(20);
private static final Vec2 vector = new Vec2(); private static final Vec2 vector = new Vec2();
private static final Rect viewport = new Rect(); private static final Rect viewport = new Rect();
@@ -370,6 +371,11 @@ public class NetServer implements ApplicationListener{
return; return;
} }
if(currentlyKicking[0] != null){
player.sendMessage("[scarlet]A vote is already in progress.");
return;
}
if(args.length == 0){ if(args.length == 0){
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("[orange]Players to kick: \n"); builder.append("[orange]Players to kick: \n");
@@ -384,9 +390,7 @@ public class NetServer implements ApplicationListener{
int id = Strings.parseInt(args[0].substring(1)); int id = Strings.parseInt(args[0].substring(1));
found = Groups.player.find(p -> p.id() == id); found = Groups.player.find(p -> p.id() == id);
}else{ }else{
found = Groups.player.find(p -> { found = Groups.player.find(p -> p.name.equalsIgnoreCase(args[0]));
return p.name.equalsIgnoreCase(args[0]);
});
} }
if(found != null){ if(found != null){
@@ -526,6 +530,10 @@ public class NetServer implements ApplicationListener{
public static void serverPacketUnreliable(Player player, String type, String contents){ public static void serverPacketUnreliable(Player player, String type, String contents){
serverPacketReliable(player, type, contents); serverPacketReliable(player, type, contents);
} }
private static boolean invalid(float f){
return Float.isInfinite(f) || Float.isNaN(f);
}
@Remote(targets = Loc.client, unreliable = true) @Remote(targets = Loc.client, unreliable = true)
public static void clientSnapshot( public static void clientSnapshot(
@@ -544,6 +552,16 @@ public class NetServer implements ApplicationListener{
NetConnection con = player.con; NetConnection con = player.con;
if(con == null || snapshotID < con.lastReceivedClientSnapshot) return; if(con == null || snapshotID < con.lastReceivedClientSnapshot) return;
//validate coordinates just in case
if(invalid(x)) x = 0f;
if(invalid(y)) y = 0f;
if(invalid(xVelocity)) xVelocity = 0f;
if(invalid(yVelocity)) yVelocity = 0f;
if(invalid(pointerX)) pointerX = 0f;
if(invalid(pointerY)) pointerY = 0f;
if(invalid(rotation)) rotation = 0f;
if(invalid(baseRotation)) baseRotation = 0f;
boolean verifyPosition = !player.dead() && netServer.admins.getStrict() && headless; boolean verifyPosition = !player.dead() && netServer.admins.getStrict() && headless;
if(con.lastReceivedClientTime == 0) con.lastReceivedClientTime = Time.millis() - 16; if(con.lastReceivedClientTime == 0) con.lastReceivedClientTime = Time.millis() - 16;
@@ -612,12 +630,12 @@ public class NetServer implements ApplicationListener{
if(!player.dead()){ if(!player.dead()){
Unit unit = player.unit(); Unit unit = player.unit();
unit.vel.set(xVelocity, yVelocity).limit(unit.type().speed);
long elapsed = Time.timeSinceMillis(con.lastReceivedClientTime); long elapsed = Time.timeSinceMillis(con.lastReceivedClientTime);
float maxSpeed = (boosting ? player.unit().type().boostMultiplier : 1f) * player.unit().type().speed; float maxSpeed = ((player.unit().type().canBoost && player.unit().isFlying()) ? player.unit().type().boostMultiplier : 1f) * player.unit().type().speed;
if(unit.isGrounded()){ if(unit.isGrounded()){
maxSpeed *= unit.floorSpeedMultiplier(); maxSpeed *= unit.floorSpeedMultiplier();
} }
unit.vel.set(xVelocity, yVelocity).limit(maxSpeed);
float maxMove = elapsed / 1000f * 60f * maxSpeed * 1.1f; float maxMove = elapsed / 1000f * 60f * maxSpeed * 1.1f;
if(con.lastUnit != unit){ if(con.lastUnit != unit){
@@ -681,8 +699,8 @@ public class NetServer implements ApplicationListener{
public static void adminRequest(Player player, Player other, AdminAction action){ public static void adminRequest(Player player, Player other, AdminAction action){
if(!player.admin){ if(!player.admin){
Log.warn("ACCESS DENIED: Player @ / @ attempted to perform admin action without proper security access.", Log.warn("ACCESS DENIED: Player @ / @ attempted to perform admin action '@' on '@' without proper security access.",
player.name, player.con.address); player.name, player.con.address, action.name(), other == null ? null : other.name);
return; return;
} }
@@ -735,7 +753,7 @@ public class NetServer implements ApplicationListener{
} }
public boolean isWaitingForPlayers(){ public boolean isWaitingForPlayers(){
if(state.rules.pvp){ if(state.rules.pvp && !state.gameOver){
int used = 0; int used = 0;
for(TeamData t : state.teams.getActive()){ for(TeamData t : state.teams.getActive()){
if(Groups.player.count(p -> p.team() == t.team) > 0){ if(Groups.player.count(p -> p.team() == t.team) > 0){
@@ -761,6 +779,10 @@ public class NetServer implements ApplicationListener{
} }
if(state.isGame() && net.server()){ if(state.isGame() && net.server()){
if(state.rules.pvp){
state.serverPaused = isWaitingForPlayers();
}
sync(); sync();
} }
} }
@@ -794,7 +816,7 @@ public class NetServer implements ApplicationListener{
if(!entity.block().sync) continue; if(!entity.block().sync) continue;
sent ++; sent ++;
dataStream.writeInt(entity.tile().pos()); dataStream.writeInt(entity.pos());
entity.writeAll(Writes.get(dataStream)); entity.writeAll(Writes.get(dataStream));
if(syncStream.size() > maxSnapshotSize){ if(syncStream.size() > maxSnapshotSize){
@@ -828,7 +850,7 @@ public class NetServer implements ApplicationListener{
byte[] stateBytes = syncStream.toByteArray(); byte[] stateBytes = syncStream.toByteArray();
//write basic state data. //write basic state data.
Call.stateSnapshot(player.con, state.wavetime, state.wave, state.enemies, state.serverPaused, (short)stateBytes.length, net.compressSnapshot(stateBytes)); Call.stateSnapshot(player.con, state.wavetime, state.wave, state.enemies, state.serverPaused, state.gameOver, (short)stateBytes.length, net.compressSnapshot(stateBytes));
viewport.setSize(player.con.viewWidth, player.con.viewHeight).setCenter(player.con.viewX, player.con.viewY); viewport.setSize(player.con.viewWidth, player.con.viewHeight).setCenter(player.con.viewX, player.con.viewY);

View File

@@ -185,6 +185,8 @@ public class Renderer implements ApplicationListener{
} }
public void draw(){ public void draw(){
Events.fire(Trigger.preDraw);
camera.update(); camera.update();
if(Float.isNaN(camera.position.x) || Float.isNaN(camera.position.y)){ if(Float.isNaN(camera.position.x) || Float.isNaN(camera.position.y)){
@@ -205,6 +207,8 @@ public class Renderer implements ApplicationListener{
Draw.sort(true); Draw.sort(true);
Events.fire(Trigger.draw);
if(pixelator.enabled()){ if(pixelator.enabled()){
pixelator.register(); pixelator.register();
} }
@@ -254,6 +258,8 @@ public class Renderer implements ApplicationListener{
Draw.reset(); Draw.reset();
Draw.flush(); Draw.flush();
Draw.sort(false); Draw.sort(false);
Events.fire(Trigger.postDraw);
} }
private void drawBackground(){ private void drawBackground(){

View File

@@ -128,6 +128,8 @@ public class UI implements ApplicationListener, Loadable{
public void update(){ public void update(){
if(disableUI || Core.scene == null) return; if(disableUI || Core.scene == null) return;
Events.fire(Trigger.uiDrawBegin);
Core.scene.act(); Core.scene.act();
Core.scene.draw(); Core.scene.draw();
@@ -143,6 +145,8 @@ public class UI implements ApplicationListener, Loadable{
control.tutorial.draw(); control.tutorial.draw();
Draw.flush(); Draw.flush();
} }
Events.fire(Trigger.uiDrawEnd);
} }
@Override @Override
@@ -221,12 +225,15 @@ public class UI implements ApplicationListener, Loadable{
} }
public TextureRegionDrawable getIcon(String name){ public TextureRegionDrawable getIcon(String name){
if(Icon.icons.containsKey(name)){ if(Icon.icons.containsKey(name)) return Icon.icons.get(name);
return Icon.icons.get(name);
}
return Core.atlas.getDrawable("error"); return Core.atlas.getDrawable("error");
} }
public TextureRegionDrawable getIcon(String name, String def){
if(Icon.icons.containsKey(name)) return Icon.icons.get(name);
return getIcon(def);
}
public void loadAnd(Runnable call){ public void loadAnd(Runnable call){
loadAnd("@loading", call); loadAnd("@loading", call);
} }

View File

@@ -484,6 +484,9 @@ public class World{
private class Context implements WorldContext{ private class Context implements WorldContext{
Context(){
}
@Override @Override
public Tile tile(int index){ public Tile tile(int index){
return tiles.geti(index); return tiles.geti(index);

View File

@@ -37,18 +37,18 @@ public class MapGenerateDialog extends BaseDialog{
private Pixmap pixmap; private Pixmap pixmap;
private Texture texture; private Texture texture;
private GenerateInput input = new GenerateInput(); private GenerateInput input = new GenerateInput();
private Seq<GenerateFilter> filters = new Seq<>(); Seq<GenerateFilter> filters = new Seq<>();
private int scaling = mobile ? 3 : 1; private int scaling = mobile ? 3 : 1;
private Table filterTable; private Table filterTable;
private AsyncExecutor executor = new AsyncExecutor(1); private AsyncExecutor executor = new AsyncExecutor(1);
private AsyncResult<Void> result; private AsyncResult<Void> result;
private boolean generating; boolean generating;
private GenTile returnTile = new GenTile(); private GenTile returnTile = new GenTile();
private GenTile[][] buffer1, buffer2; private GenTile[][] buffer1, buffer2;
private Cons<Seq<GenerateFilter>> applier; private Cons<Seq<GenerateFilter>> applier;
private CachedTile ctile = new CachedTile(){ CachedTile ctile = new CachedTile(){
//nothing. //nothing.
@Override @Override
protected void changeEntity(Team team, Prov<Building> entityprov, int rotation){ protected void changeEntity(Team team, Prov<Building> entityprov, int rotation){
@@ -178,7 +178,7 @@ public class MapGenerateDialog extends BaseDialog{
add(new Image(Styles.black8)); add(new Image(Styles.black8));
add(new Image(Icon.refresh, Scaling.none)); add(new Image(Icon.refresh, Scaling.none));
visible(() -> generating && !updateEditorOnChange); visible(() -> generating && !updateEditorOnChange);
}}).grow().padRight(10); }}).uniformX().grow().padRight(10);
t.pane(p -> filterTable = p.marginRight(6)).update(pane -> { t.pane(p -> filterTable = p.marginRight(6)).update(pane -> {
if(Core.scene.getKeyboardFocus() instanceof Dialog && Core.scene.getKeyboardFocus() != this){ if(Core.scene.getKeyboardFocus() instanceof Dialog && Core.scene.getKeyboardFocus() != this){
return; return;
@@ -191,7 +191,7 @@ public class MapGenerateDialog extends BaseDialog{
}else{ }else{
Core.scene.setScrollFocus(null); Core.scene.setScrollFocus(null);
} }
}).grow().get().setScrollingDisabled(true, false); }).grow().uniformX().get().setScrollingDisabled(true, false);
}).grow(); }).grow();
buffer1 = create(); buffer1 = create();
@@ -213,7 +213,7 @@ public class MapGenerateDialog extends BaseDialog{
} }
void rebuildFilters(){ void rebuildFilters(){
int cols = Math.max((int)(Math.max(filterTable.parent.getWidth(), Core.graphics.getWidth()/2f * 0.9f) / Scl.scl(290f)), 1); int cols = Math.max((int)(Core.graphics.getWidth()/2f / Scl.scl(290f)), 1);
filterTable.clearChildren(); filterTable.clearChildren();
filterTable.top().left(); filterTable.top().left();
int i = 0; int i = 0;
@@ -229,7 +229,7 @@ public class MapGenerateDialog extends BaseDialog{
t.setColor(Pal.gray); t.setColor(Pal.gray);
t.top().left(); t.top().left();
t.add(filter.name()).left().padLeft(6); t.add(filter.name()).left().padLeft(6).width(100f).wrap();
t.add().growX(); t.add().growX();
@@ -408,6 +408,9 @@ public class MapGenerateDialog extends BaseDialog{
public byte team; public byte team;
public short block, floor, ore; public short block, floor, ore;
GenTile(){
}
public void set(Block floor, Block wall, Block ore, Team team){ public void set(Block floor, Block wall, Block ore, Team team){
this.floor = floor.id; this.floor = floor.id;
this.block = wall.id; this.block = wall.id;

Some files were not shown because too many files have changed in this diff Show More