From 223fb8d6f5c4acd06d12e5ae9868b3a82d921047 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Sun, 31 Oct 2021 18:30:35 -0700 Subject: [PATCH 01/20] Basic unitsorts for hjson (#6280) * Create some basic unitSorts * Set as defaults * add to ContentParser --- core/src/mindustry/content/Blocks.java | 5 +++-- core/src/mindustry/entities/UnitSorts.java | 14 ++++++++++++++ core/src/mindustry/mod/ContentParser.java | 4 +++- .../world/blocks/defense/turrets/Turret.java | 4 ++-- 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 core/src/mindustry/entities/UnitSorts.java diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 2d32e621be..3e6c2bfe21 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -5,6 +5,7 @@ import arc.math.*; import arc.struct.*; import mindustry.*; import mindustry.ctype.*; +import mindustry.entities.*; import mindustry.entities.bullet.*; import mindustry.gen.*; import mindustry.graphics.*; @@ -1839,7 +1840,7 @@ public class Blocks implements ContentList{ size = 4; shootCone = 2f; shootSound = Sounds.railgun; - unitSort = (u, x, y) -> -u.maxHealth + Mathf.dst2(u.x, u.y, x, y) / 6400f; + unitSort = UnitSorts.strongest; coolantMultiplier = 0.4f; @@ -2287,4 +2288,4 @@ public class Blocks implements ContentList{ //endregion } -} +} \ No newline at end of file diff --git a/core/src/mindustry/entities/UnitSorts.java b/core/src/mindustry/entities/UnitSorts.java new file mode 100644 index 0000000000..25afb0def6 --- /dev/null +++ b/core/src/mindustry/entities/UnitSorts.java @@ -0,0 +1,14 @@ +package mindustry.entities; + +import arc.math.*; +import mindustry.entities.Units.*; +import mindustry.gen.*; + +public class UnitSorts{ + public static Sortf + + closest = Unit::dst2, + farthest = (u, x, y) -> -u.dst2(x, y), + strongest = (u, x, y) -> -u.maxHealth + Mathf.dst2(u.x, u.y, x, y) / 6400f, + weakest = (u, x, y) -> u.maxHealth + Mathf.dst2(u.x, u.y, x, y) / 6400f; +} \ No newline at end of file diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 1ffae2a6ea..f5840f7df6 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -20,6 +20,7 @@ import mindustry.content.*; import mindustry.content.TechTree.*; import mindustry.ctype.*; import mindustry.entities.*; +import mindustry.entities.Units.*; import mindustry.entities.abilities.*; import mindustry.entities.bullet.*; import mindustry.entities.effect.*; @@ -61,6 +62,7 @@ public class ContentParser{ readFields(result, data); return result; }); + put(Sortf.class, (type, data) -> field(UnitSorts.class, data)); put(Interp.class, (type, data) -> field(Interp.class, data)); put(CacheLayer.class, (type, data) -> field(CacheLayer.class, data)); put(Attribute.class, (type, data) -> Attribute.get(data.asString())); @@ -826,4 +828,4 @@ public class ContentParser{ void parsed(Class type, JsonValue jsonData, Object result); } -} +} \ No newline at end of file diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index 29236505ab..45c049c6a0 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -76,7 +76,7 @@ public class Turret extends ReloadTurret{ public Effect chargeBeginEffect = Fx.none; public Sound chargeSound = Sounds.none; - public Sortf unitSort = Unit::dst2; + public Sortf unitSort = UnitSorts.closest; protected Vec2 tr = new Vec2(); protected Vec2 tr2 = new Vec2(); @@ -508,4 +508,4 @@ public class Turret extends ReloadTurret{ return 1; } } -} +} \ No newline at end of file From 99e7fcd2d2eade9f50305c58bdd6dd828d59c079 Mon Sep 17 00:00:00 2001 From: VizardAlpha <43859764+VizardAlpha@users.noreply.github.com> Date: Mon, 1 Nov 2021 14:31:25 +0100 Subject: [PATCH 02/20] Update bundle_fr.properties (#6241) * Update bundle_fr.properties After checking, there was some text missing to be translated. * Minor modification --- core/assets/bundles/bundle_fr.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/assets/bundles/bundle_fr.properties b/core/assets/bundles/bundle_fr.properties index 894d9fa228..f0484316b3 100644 --- a/core/assets/bundles/bundle_fr.properties +++ b/core/assets/bundles/bundle_fr.properties @@ -583,6 +583,8 @@ weather.sandstorm.name = Tempête de sable weather.sporestorm.name = Tempête de spores weather.fog.name = Brouillard +sectorlist = Secteurs +sectorlist.attacked = {0} pris d'assaut sectors.unexplored = [lightgray]Inexploré sectors.resources = Ressources : sectors.production = Production : From 4cbc4a0bca7c1bfe0e0ea72674202d65616582bc Mon Sep 17 00:00:00 2001 From: NgLam is SIMP <33188123+NgLamVN@users.noreply.github.com> Date: Mon, 1 Nov 2021 20:31:34 +0700 Subject: [PATCH 03/20] Update Vietnamese translation for V7 (#6246) --- core/assets/bundles/bundle_vi.properties | 101 ++++++++++++++++++----- 1 file changed, 80 insertions(+), 21 deletions(-) diff --git a/core/assets/bundles/bundle_vi.properties b/core/assets/bundles/bundle_vi.properties index 53d47d8f21..24f859c862 100644 --- a/core/assets/bundles/bundle_vi.properties +++ b/core/assets/bundles/bundle_vi.properties @@ -78,13 +78,12 @@ schematic.tagexists = Thẻ đã tồn tại. stats = Thống kê stat.wave = Đợt đã vượt qua:[accent] {0} +stat.unitsCreated = Quân lính đã tạo:[accent] {0} stat.enemiesDestroyed = Kẻ thù bị tiêu diệt:[accent] {0} stat.built = Số công trình đã xây dựng:[accent] {0} stat.destroyed = Số công trình đã bị phá:[accent] {0} stat.deconstructed = Số công trình được xây dựng lại:[accent] {0} -stat.delivered = Lượng tài nguyên được phóng: stat.playtime = Thời gian chơi:[accent] {0} -stat.rank = Xếp hạng: [accent]{0} globalitems = [accent]Toàn bộ vật phẩm map.delete = Bạn có chắc chắn muốn xóa bản đồ "[accent]{0}[]"? @@ -94,6 +93,7 @@ level.mode = Chế độ: coreattack = < Căn cứ đang bị tấn công! > nearpoint = [[ [scarlet]RỜI KHỎI KHU VỰC ĐÁP NGAY LẬP TỨC[] ]\nsự hủy diệt sắp xảy ra database = Cơ sở dữ liệu +database.button = Cơ sở dữ liệu savegame = Lưu trò chơi loadgame = Tải lại màn chơi joingame = Tham gia trò chơi @@ -101,6 +101,7 @@ customgame = Tùy chỉnh newgame = Trò chơi mới none = none.found = [lightgray] +none.inmap = [lightgray] minimap = Bản đồ nhỏ position = Vị trí close = Đóng @@ -168,6 +169,7 @@ launchcore = Phóng căn cứ filename = Tên tệp: unlocked = Đã mở khóa nội dung mới! available = Đã có mục nghiên cứu mới! +unlock.incampaign = < Mở khóa trong chiến dịch để biết chi tiết > completed = [accent]Hoàn tất techtree = Tiến trình research.legacy = Dữ liệu nghiên cứu từ phiên bản[accent]5.0[] được tìm thấy.\nBạn có muốn [accent]tải dữ liệu này[], hoặc [accent]bỏ qua[] và bắt đầu nghiên cứu lại trong chiến dịch mới (khuyến nghị)? @@ -214,6 +216,7 @@ hosts.none = [lightgray]Không có máy chủ cục bộ nào được tìm th host.invalid = [scarlet]Không thể kết nối đến máy chủ. servers.local = Máy chủ cục bộ +servers.local.steam = Màn chơi hiện có & Máy chủ cục bộ servers.remote = Máy chủ tùy chỉnh servers.global = Máy chủ từ cộng đồng @@ -285,6 +288,7 @@ save.corrupted = Tệp bản lưu bị hỏng hoặc không hợp lệ! empty = on = Bật off = Tắt +save.search = Tìm kiếm màn chơi đã lưu... save.autosave = Tự động lưu: {0} save.map = Bản đồ: {0} save.wave = Đợt {0} @@ -315,7 +319,7 @@ data.invalid = Đây không phải dữ liệu trò chơi hợp lệ. data.import.confirm = Nhập dữ liệu bên ngoài sẽ ghi đè[scarlet] tất cả[] dữ liệu trò chơi hiện tại.\n[accent]Điều này không thể hoàn tác![]\n\nSau khi dữ liệu được nhập, trò chơi của bạn sẽ thoát ngay lập tức. quit.confirm = Bạn có chắc muốn thoát? loading = [accent]Đang tải... -reloading = [accent]Đang tải lại Mods... +downloading = [accent]Đang tải xuống... saving = [accent]Đang lưu... respawn = [accent][[{0}][] để hồi sinh tại căn cứ cancelbuilding = [accent][[{0}][] để hủy xây @@ -360,6 +364,7 @@ publish.confirm = Bạn có chắc chắn muốn xuất bản không?\n\n[lightg publish.error = Lỗi khi xuất bản: {0} steam.error = Không thể khởi chạy dịch vụ Steam.\nLỗi: {0} +editor.cliffs = Chuyển tường thành vách đá editor.brush = Kích thước editor.openin = Mở trong trình chỉnh sửa editor.oregen = Cấu trúc quặng @@ -375,6 +380,13 @@ editor.ingame = Chỉnh sửa trong trò chơi editor.publish.workshop = Xuất bản lên Workshop editor.newmap = Bản đồ mới editor.center = Trung tâm +editor.search = Tìm kiếm bản đồ... +editor.filters = Lọc bản đồ +editor.filters.mode = Chế độ: +editor.filters.type = Kiểu bản đồ: +editor.filters.search = Tìm kiếm trongtrong: +editor.filters.author = Tác giả +editor.filters.description = Miêu tả workshop = Workshop waves.title = Đợt waves.remove = Xóa @@ -383,6 +395,7 @@ waves.waves = đợt waves.perspawn = mỗi lần xuất hiện waves.shields = khiên/đợt waves.to = đến +waves.max = Số lượng quân lính tối đa waves.guardian = Boss waves.preview = Xem trước waves.edit = Chỉnh sửa... @@ -391,6 +404,13 @@ waves.load = Lấy từ bộ nhớ tạm waves.invalid = Lượt không hợp lệ trong bộ nhớ tạm. waves.copied = Đã sao chép lượt. waves.none = Không có kẻ thù được xác định.\nLưu ý rằng bố cục mỗi đợt trống sẽ tự động được thay thế bằng bố cục mặc định. +waves.sort = Sắp xếp theo +waves.sort.reverse = Đảo ngược sắp xếp +waves.sort.begin = Bắt đầu +waves.sort.health = Máu +waves.sort.type = Thể loại +waves.units.hide = Ẩn tất cả +waves.units.show = Hiện tất cả #these are intentionally in lower case wavemode.counts = số lượng @@ -400,6 +420,7 @@ wavemode.health = máu editor.default = [lightgray] details = Chi tiết... edit = Chỉnh sửa... +variables = Thông số editor.name = Tên: editor.spawn = Thêm kẻ địch editor.removeunit = Xóa kẻ địch @@ -537,6 +558,7 @@ configure = Tùy chỉnh vật phẩm loadout = Vật phẩm resources = Tài nguyên bannedblocks = Khối bị cấm +bannedunits = Quân lính bị cấm addall = Thêm tất cả launch.from = Đang phóng từ: [accent]{0} launch.destination = Đích đến: {0} @@ -561,10 +583,13 @@ weather.sandstorm.name = Bão cát weather.sporestorm.name = Bão bào tử weather.fog.name = Sương mù +sectorlist = Khu vực +sectorlist.attacked = {0} đang bị tấn công sectors.unexplored = [lightgray]Chưa được khám phá sectors.resources = Tài nguyên: sectors.production = Sản lượng: sectors.export = Xuất: +sectors.import = Nhập: sectors.time = Thời gian: sectors.threat = Mối đe dọa: sectors.wave = Đợt: @@ -632,6 +657,8 @@ sector.windsweptIslands.description = Xa hơn đường bờ biển là chuỗi sector.extractionOutpost.description = Một tiền đồn xa, được kẻ thù xây dựng với mục đích phóng nguồn lực sang các khu vực khác.\n\nCông nghệ vận tải xuyên ngành là điều cần thiết để chinh phục hơn nữa. Phá hủy căn cứ. Nghiên cứu bệ phóng của họ. sector.impact0078.description = Đây là tàn tích của tàu vận chuyển giữa các vì sao lần đầu tiên đi vào hệ thống này.\n\nLấy càng nhiều càng tốt từ đống đổ nát. Nghiên cứu bất kỳ công nghệ nguyên vẹn nào. sector.planetaryTerminal.description = Mục tiêu cuối cùng.\n\nCăn cứ ven biển này chứa một cấu trúc có khả năng phóng căn cứ tới các hành tinh địa phương. Nó được bảo vệ cực kỳ cẩn thận.\n\nSản xuất quân lính hải quân. Loại bỏ kẻ thù càng nhanh càng tốt. Nghiên cứu cấu trúc phóng. +sector.coastline.name = Coastline +sector.navalFortress.name = Naval Fortress status.burning.name = Cháy status.freezing.name = Đóng băng @@ -643,9 +670,11 @@ status.electrified.name = Electrified status.spore-slowed.name = Spore Slowed status.tarred.name = Tarred status.overclock.name = Overclock +status.overdrive.name = Overdrive status.shocked.name = Shock status.blasted.name = Nổ status.unmoving.name = Bất động +status.boss.name = Guardian settings.language = Ngôn ngữ settings.data = Dữ liệu trò chơi @@ -794,7 +823,7 @@ bullet.splashdamage = [stat]{0}[lightgray] sát thương diện rộng ~[stat] { bullet.incendiary = [stat]cháy bullet.homing = [stat]truy đuổi bullet.buildingdamage = [stat]{0}%[lightgray] sát thương khối -bullet.frag = [stat]phá mảnh +bullet.frags = [stat]phá mảnh bullet.lightning = [stat]{0}[lightgray]x tia chớp ~ [stat]{1}[lightgray] sát thương bullet.knockback = [stat]{0}[lightgray] bật lùi bullet.pierce = [stat]{0}[lightgray]x xuyên giáp @@ -806,6 +835,7 @@ bullet.reload = [stat]{0}[lightgray]x tốc độ bắn unit.blocks = Khối unit.blockssquared = Khối² unit.powersecond = đơn vị năng lượng/giây +unit.tilessecond = ô/giây unit.liquidsecond = đơn vị chất lỏng/giây unit.itemssecond = vật phẩm/giây unit.liquidunits = đơn vị chất lỏng @@ -831,20 +861,19 @@ category.items = Vật phẩm category.crafting = Vào/Sản phẩm category.function = Chức năng category.optional = Cải tiến +setting.skipcoreanimation.name = Bỏ qua hiệu ứng phóng/đáp căn cứcứ setting.landscape.name = Khóa ngang setting.shadows.name = Bóng đổ setting.blockreplace.name = Tự động đề xuất khối setting.linear.name = Lọc tuyến tính setting.hints.name = Gợi ý setting.logichints.name = Gợi ý Logic -setting.flow.name = Hiện thị tốc độ chuyền tài nguyên setting.backgroundpause.name = Tạm dừng trong nền setting.buildautopause.name = Tự động dừng xây dựng setting.doubletapmine.name = Nhấn đúp để Đào setting.modcrashdisable.name = Tắt các mod khi gặp sự cố trong khởi động setting.animatedwater.name = Hiệu ứng nước setting.animatedshields.name = Hiệu ứng khiên -setting.antialias.name = Khử răng cưa[lightgray] (yêu cầu khởi động lại)[] setting.playerindicators.name = Hướng người chơi setting.indicators.name = Hướng kẻ địch setting.autotarget.name = Tự động nhắm mục tiêu @@ -853,7 +882,8 @@ setting.touchscreen.name = Điều khiển bằng màn hình cảm ứng setting.fpscap.name = FPS tối đa setting.fpscap.none = Không giới hạn setting.fpscap.text = {0} FPS -setting.uiscale.name = Kích thước UI[lightgray] (yêu cầu khởi động lại)[] +setting.uiscale.name = Kích thước UI +setting.uiscale.description = Trò chơi sẽ khởi động lại để áp dụng các thay đổi. setting.swapdiagonal.name = Đặt luôn theo đường chéo setting.difficulty.training = Luyện tập setting.difficulty.easy = Dễ @@ -871,7 +901,9 @@ setting.saveinterval.name = Khoảng thời gian lưu setting.seconds = {0} giây setting.milliseconds = {0} mili giây setting.fullscreen.name = Toàn màn hình -setting.borderlesswindow.name = Không viền[lightgray] (yêu cầu khởi động lại) +setting.borderlesswindow.name = Không viền +setting.borderlesswindow.name.windows = Toàn màng hình (không viền) +setting.borderlesswindow.description = Trò chơi có thể sẽ khởi động lại để áp dụng các thay đổi setting.fps.name = Hiển thị FPS & Ping setting.smoothcamera.name = Chế độ mượt mà setting.vsync.name = VSync @@ -994,6 +1026,8 @@ rules.wavetimer = Đếm ngược đợt rules.waves = Đợt rules.attack = Chế độ tấn công rules.buildai = AI Xây dựng +rules.aitier = Cấp độ AI +rules.cleanupdeadteams = Xóa công trình của đội bị đánh bại (PvP) rules.corecapture = Chiếm căn cứ khi phá hủy rules.polygoncoreprotection = Bảo vệ lõi kiểu đa giác. rules.enemyCheat = Tài nguyên vô hạn (kẻ địch) @@ -1012,12 +1046,15 @@ rules.deconstructrefundmultiplier = Hệ số số vật phẩm hoàn lại khi rules.waitForWaveToEnd = Đợt chờ hết kẻ địch rules.dropzoneradius = Bán kính vùng thả:[lightgray] (ô) rules.unitammo = Quân lính cần đạn +rules.enemyteam = Đội quân địch +rules.playerteam = Đội người chơi rules.title.waves = Đợt rules.title.resourcesbuilding = Tài nguyên & Xây dựng rules.title.enemy = Kẻ địch rules.title.unit = Quân lính rules.title.experimental = Thực nghiệm rules.title.environment = Môi trường +rules.title.teams = Đội rules.lighting = Ánh sáng rules.enemyLights = Đèn địch rules.fire = Lửa @@ -1096,13 +1133,13 @@ unit.reign.name = Reign unit.vela.name = Vela unit.corvus.name = Corvus -block.resupply-point.name = Điểm tiếp tế block.parallax.name = Parallax block.cliff.name = Vách đá block.sand-boulder.name = Tường cát block.basalt-boulder.name = Tường đá basalt block.grass.name = Cỏ block.molten-slag.name = Xỉ nóng chảy +block.pooled-cryofluid.name = Chất làm lạnh block.space.name = Không gian block.salt.name = Muối block.salt-wall.name = Tường muối @@ -1136,6 +1173,7 @@ block.core-nucleus.name = Căn cứ: Trung tâm block.deep-water.name = Nước sâu block.shallow-water.name = Nước block.tainted-water.name = Nước nhiểm bẩn +block.deep-tainted-water.name = Nước nhiểm bẩn sâu block.darksand-tainted-water.name = Nước nhiễm bẩn cát đen block.tar.name = Dầu block.stone.name = Đá @@ -1263,6 +1301,7 @@ block.plated-conduit.name = Ống dẫn bọc giáp block.phase-conduit.name = Ống dẫn Phase block.liquid-router.name = Bộ phân phát chất lỏng block.liquid-tank.name = Thùng chất lỏng +block.liquid-container.name = Bình chất lỏng block.liquid-junction.name = Giao điểm chất lỏng block.bridge-conduit.name = Cầu dẫn chất lỏng block.rotary-pump.name = Bơm điện @@ -1288,7 +1327,6 @@ block.meltdown.name = Meltdown block.foreshadow.name = Foreshadow block.container.name = Container block.launch-pad.name = Bệ phóng -block.launch-pad-large.name = Bệ phóng lớn block.segment.name = Segment block.command-center.name = Trung tâm chỉ huy block.ground-factory.name = Nhà máy bộ binh @@ -1303,17 +1341,23 @@ block.payload-router.name = Bộ định tuyến khối hàng block.duct.name = Duct block.duct-router.name = Duct Router block.duct-bridge.name = Duct Bridge -block.payload-propulsion-tower.name = Payload Propulsion Tower +block.payload-propulsion-tower.name = Tháp đẩy khối hàng block.payload-void.name = Payload Void block.payload-source.name = Payload Source block.disassembler.name = Máy phân tách lớn block.silicon-crucible.name = Máy nấu Silicon lớn block.overdrive-dome.name = Máy tăng tốc lớn -#experimental, may be removed -block.block-forge.name = Block Forge -block.block-loader.name = Block Loader -block.block-unloader.name = Điểm dỡ hàng block.interplanetary-accelerator.name = Máy gia tốc liên hành tinh +block.constructor.name = Máy chế tạo +block.constructor.description = Chế tạo các khối có kích thước 2x2 ô. +block.large-constructor.name = Máy chế tạo lớn +block.large-constructor.description = Chế tạo các khối có kích thước lên đến 4x4 ô. +block.deconstructor.name = Máy tháo dỡ +block.deconstructor.description = Tháo dỡ khối và quân lính, trả lại 100% nguyên liệu. +block.payload-loader.name = Payload Loader +block.payload-loader.description = Nạp chất lỏng và vật phẩm vào khối. +block.payload-unloader.name = Payload Unloader +block.payload-unloader.description = Lấy chất lỏng và vật phẩm từ khối. block.switch.name = Công tắc block.micro-processor.name = Bộ xử lí nhỏ @@ -1348,6 +1392,7 @@ hint.placeTurret = Đặt \uf861 [accent]Súng[] để bảo vệ căn cứ củ hint.breaking = [accent]Chuột phải[] và kéo để phá vỡ các khối. hint.breaking.mobile = Kích hoạt \ue817 [accent]Cây búa[] ở phía dưới cùng bên phải và nhấn để phá vỡ các khối.\n\nGiữ ngón tay của bạn trong một giây và kéo để phá khối trong vùng được chọn. hint.blockInfo = Xem thông tin của một khối bằng cách chọn nó trong [accent]menu xây dựng[], Sau đó chọn nút [accent][[?][] ở bên phải. +hint.derelict = [accent]Derelict[] structures are broken remnants of old bases that no longer function.\n\nThese structures can be [accent]deconstructed[] for resources. hint.research = Sử dụng nút \ue875 [accent]Nghiên cứu[] để nghiên cứu công nghệ mới. hint.research.mobile = Sử dụng nút \ue875 [accent]Nghiên cứu[] trong \ue88c [accent]Menu[] để nghiên cứu công nghệ mới. hint.unitControl = Giữ [accent][[L-ctrl][] và [accent]click[] để điều khiển quân lính của bạn hoặc súng. @@ -1369,6 +1414,7 @@ hint.generator = \uf879 [accent]Máy phát điện đốt cháy[] đốt than v hint.guardian = [accent]Boss[] được bọc giáp. Sử dụng loại đạn yếu chẳng hạn như [accent]Đồng[] và [accent]Chì[] là [scarlet]không hiệu quả[].\n\nSử dụng súng tiên tiến hơn hoặc sử dụng \uf835 [accent]Than chì làm đạn [] \uf861Duo/\uf859Salvo đạn dược để hạ gục Boss. hint.coreUpgrade = Các căn cứ có thể được nâng cấp bằng cách [accent]đặt căn cứ cấp cao hơn trên chúng[].\n\nĐặt một căn cứ  [accent]Trụ sở[] trên căn cứ  [accent]Cơ sở[]. Đảm bảo không có vật cản gần đó. hint.presetLaunch = Khác khu vực đáp [accent] xám[], như [accent]Frozen Forest[], có thể được phóng đến từ bất cứ đâu. Nó không yêu cầu chiếm các khu vực lân cận.\n\n[accent]Các khu vực được đánh số[], chẳng hạn như cái này, là [accent]không bắt buộc[]. +hint.presetDifficulty = This sector has a [scarlet]high enemy threat level[].\nLaunching to such sectors is [accent]not recommended[] without proper technology and preparation. hint.coreIncinerate = Sau khi căn cứ đầy vật phẩm, bất kì vật phẩm vào thuộc loại đó nhận được sẽ bị [accent]tiêu hủy[]. hint.coopCampaign = Khi chơi chiến dịch[accent]co-op[], các vật phẩm được sản xuất trong bản đồ hiện tại cũng sẽ được gửi [accent]đến các khu vực của bạn[].\n\nBất kỳ nghiên cứu mới nào được thực hiện đều được lưu lại. @@ -1399,7 +1445,7 @@ liquid.slag.description = Dùng để tách các kim loại, hoặc phun vào k liquid.oil.description = Dùng trong sản xuất vật liệu tiên tiến và làm đạn gây cháy. liquid.cryofluid.description = Dùng làm chất làm mát trong lò phản ứng, súng và nhà máy. -block.resupply-point.description = Cung cấp đạn đồng cho các quân lính ở gần. Không tương thích với quân lính sử dụng điện. +block.derelict =  [lightgray]Derelict block.armored-conveyor.description = Vận chuyển vật phẩm về phía trước. Không nhận đầu vào từ phía bên cạnh. block.illuminator.description = Phát sáng. block.message.description = Lưu trữ tin nhắn giao tiếp giữa đồng đội. @@ -1425,6 +1471,8 @@ block.item-source.description = Tạo ra vật phẩm mãi mãi. Chỉ có trong block.item-void.description = Hủy mọi vật phẩm. Chỉ có trong chế độ tự do. block.liquid-source.description = Tạo ra chất lỏng mãi mãi. Chỉ có trong chế độ tự do. block.liquid-void.description = Loại bỏ mọi chất lỏng. Chỉ có trong chế độ tự do. +block.payload-source.description = Tạo ra bất kì khối hàng nào. Chỉ có trong chế độ tự do. +block.payload-void.description = Phá hủy bất kì khối hàng nào. Chỉ có trong chế độ tự do. block.copper-wall.description = Bảo vệ các công trình khỏi đạn của kẻ thù. block.copper-wall-large.description = Bảo vệ nhiều công trình khỏi đạn của kẻ thù. block.titanium-wall.description = Bảo vệ các công trình khỏi đạn của kẻ thù. @@ -1465,7 +1513,8 @@ block.conduit.description = Đẩy chất lỏng đến trước, dùng với b block.pulse-conduit.description = Đẩy chất lỏng đến trước, vận chuyển nhanh và trữ nhiều hơn so với ống tiêu chuẩn. block.plated-conduit.description = Đẩy chất lỏng đến trước, không nhận đầu vào ở bên, không bị rò rỉ. block.liquid-router.description = Nhận chất lỏng từ một phía và đưa đều ra ba phía còn lại. Có thể trữ một lượng chất lỏng nhất định. -block.liquid-tank.description = Trữ được nhiều chất lỏng. Đưa đều ra mọi phía như bộ phân nhánh chất lỏng. +block.liquid-tank.description = Trữ được một lượng lớn chất lỏng. Đưa đều ra mọi phía như bộ phân phát chất lỏng. +block.liquid-container.description = Lưu trữ một lượng vừa phải chất lỏng. Đưa đều ra mọi phía như bộ phân phát chất lỏng. block.liquid-junction.description = Chức năng như cầu cho hai ống nước băng chéo nhau. block.bridge-conduit.description = Vận chuyển chất lỏng qua nhiều loại địa hình hoặc công trình. block.phase-conduit.description = Vận chuyển chất lỏng qua địa hình hoặc công trình. Phạm vi dài hơn cầu nối, nhưng cần năng lượng. @@ -1543,6 +1592,8 @@ block.memory-bank.description = Lưu trữ thông tin cho bộ xử lí. Dung l block.logic-display.description = Hiển thị đồ họa tùy ý từ bộ xử lí. block.large-logic-display.description = Hiển thị đồ họa tùy ý từ bộ xử lí. block.interplanetary-accelerator.description = Tòa súng từ trường cỡ lớn. Tăng tốc vật phóng đến vận tốc thoát để di chuyển giữa các hành tinh. +block.repair-turret.description = Sửa chữa những quân lính bị hư hỏng trong khu vực nhất địnhđịnh. Có thể làm mát để tăng hiệu quả. +block.payload-propulsion-tower.description = Cơ cấu vận chuyển các khối hàng tầm xa. Bắn khối hàng cho các tháp đẩy khối hàng kháckhác. unit.dagger.description = Bắn đạn tiêu chuẩn vào tất cả kẻ địch xung quanh. unit.mace.description = Phun lửa vào tất cả kẻ địch xung quanh. @@ -1577,6 +1628,11 @@ unit.omura.description = Bắn đạn từ trường xuyên giáp tầm xa vào unit.alpha.description = Bảo vệ căn cứ cơ sở khỏi kẻ thù. Có thể xây dựng. unit.beta.description = Bảo vệ căn cứ trụ sở khỏi kẻ thù. Có thể xây dựng. unit.gamma.description = Bảo vệ căn cứ trung tâm khỏi kẻ thù. Có thể xây dựng. +unit.retusa.description = Fires homing torpedoes at nearby enemies. Repairs allied units. +unit.oxynoe.description = Fires structure-repairing streams of flame at nearby enemies. Targets nearby enemy projectiles with a point defense turret. +unit.cyerce.description = Fires seeking cluster-missiles at enemies. Repairs allied units. +unit.aegires.description = Shocks all enemy units and structures that enter its energy field. Repairs all allies. +unit.navanax.description = Fires explosive EMP projectiles, dealing significant damage to enemy power networks and repairing allied structures. Melts nearby enemies with 4 autonomous laser turrets. lst.read = Đọc một số từ bộ nhớ được liên kết. lst.write = Ghi một số vào bộ nhớ được liên kết. @@ -1591,6 +1647,8 @@ lst.sensor = Lấy dữ liệu từ một khối hoặc quân lính. lst.set = Đặt một biến. lst.operation = Thực hiện thao tác trên 1-2 biến. lst.end = Chuyển đến lệnh đầu tiên. +lst.wait = Chờ trong khoảng thời gian nhất định. +lst.lookup = Look up an item/liquid/unit/block type by ID.\nTotal counts of each type can be accessed with:\n[accent]@unitCount[] / [accent]@itemCount[] / [accent]@liquidCount[] / [accent]@blockCount[] lst.jump = Chuyển qua lệnh khác nếu điều kiện đúng. lst.unitbind = Bind to the next unit of a type, and store it in [accent]@unit[]. lst.unitcontrol = Control the currently bound unit. @@ -1689,13 +1747,13 @@ sensor.in = The building/unit to sense. radar.from = Building to sense from.\nSensor range is limited by building range. radar.target = Filter for units to sense. radar.and = Additional filters. -radar.order = Sorting order. 0 to reverse. +radar.order = Sắp xếp theo thứ tự. đặt giá trị 0 để đảo ngược. radar.sort = Metric to sort results by. radar.output = Variable to write output unit to. unitradar.target = Filter for units to sense. unitradar.and = Additional filters. -unitradar.order = Sorting order. 0 to reverse. +unitradar.order = Sắp xếp theo thứ tự. đặt giá trị 0 để đảo ngược. unitradar.sort = Metric to sort results by. unitradar.output = Variable to write output unit to. @@ -1706,8 +1764,8 @@ control.shoot = Whether to shoot. unitlocate.enemy = Whether to locate enemy buildings. unitlocate.found = Whether the object was found. unitlocate.building = Output variable for located building. -unitlocate.outx = Output X coordinate. -unitlocate.outy = Output Y coordinate. +unitlocate.outx = Cho ra tọa độ X. +unitlocate.outy = Cho ra tọa độ Y. unitlocate.group = Building group to look for. lenum.idle = Không di chuyển, nhưng vẫn xây dựng/đào.\nTrạng thái mặc định. @@ -1721,6 +1779,7 @@ lenum.itemdrop = Thả vật phẩm. lenum.itemtake = Lấy vật phẩm từ khối. lenum.paydrop = Thả khối hàng hiện tại. lenum.paytake = Nhất khối hàng tại vị trí hiện tại. +lenum.payenter = Enter/land on the payload block the unit is on. lenum.flag = Numeric unit flag. lenum.mine = Đào tại vị trí. lenum.build = Xây công trình. From 13d16f1883da0140e091aa6cc67bea2f4fb80ab5 Mon Sep 17 00:00:00 2001 From: Darkness#3729 <79508138+Darkness6030@users.noreply.github.com> Date: Mon, 1 Nov 2021 16:32:22 +0300 Subject: [PATCH 04/20] InvalidCommandHandler (#6247) * InvalidCommandHandler * Update NetClient.java * Add player * And here * :thonk: * And this * Update NetClient.java --- core/src/mindustry/core/NetClient.java | 29 +++---------------------- core/src/mindustry/core/NetServer.java | 30 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index ce2498792a..e7f69c8eb4 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -260,33 +260,10 @@ public class NetClient implements ApplicationListener{ //a command was sent, now get the output if(response.type != ResponseType.valid){ - String text; - - //send usage - if(response.type == ResponseType.manyArguments){ - text = "[scarlet]Too many arguments. Usage:[lightgray] " + response.command.text + "[gray] " + response.command.paramText; - }else if(response.type == ResponseType.fewArguments){ - text = "[scarlet]Too few arguments. Usage:[lightgray] " + response.command.text + "[gray] " + response.command.paramText; - }else{ //unknown command - int minDst = 0; - Command closest = null; - - for(Command command : netServer.clientCommands.getCommandList()){ - int dst = Strings.levenshtein(command.text, response.runCommand); - if(dst < 3 && (closest == null || dst < minDst)){ - minDst = dst; - closest = command; - } - } - - if(closest != null){ - text = "[scarlet]Unknown command. Did you mean \"[lightgray]" + closest.text + "[]\"?"; - }else{ - text = "[scarlet]Unknown command. Check [lightgray]/help[scarlet]."; - } + String text = netServer.invalidHandler.handle(player, response); + if(text != null){ + player.sendMessage(text); } - - player.sendMessage(text); } } } diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 9a72f7ad51..8c8498c03f 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -67,6 +67,32 @@ public class NetServer implements ApplicationListener{ /** Converts a message + NULLABLE player sender into a single string. Override for custom prefixes/suffixes. */ public ChatFormatter chatFormatter = (player, message) -> player == null ? message : "[coral][[" + player.coloredName() + "[coral]]:[white] " + message; + /** Handles an incorrect command response. Returns text that will be sent to player. Override for customisation. */ + public InvalidCommandHandler invalidHandler = (player, response) -> { + if(response.type == ResponseType.manyArguments){ + return "[scarlet]Too many arguments. Usage:[lightgray] " + response.command.text + "[gray] " + response.command.paramText; + }else if(response.type == ResponseType.fewArguments){ + return "[scarlet]Too few arguments. Usage:[lightgray] " + response.command.text + "[gray] " + response.command.paramText; + }else{ //unknown command + int minDst = 0; + Command closest = null; + + for(Command command : netServer.clientCommands.getCommandList()){ + int dst = Strings.levenshtein(command.text, response.runCommand); + if(dst < 3 && (closest == null || dst < minDst)){ + minDst = dst; + closest = command; + } + } + + if(closest != null){ + return "[scarlet]Unknown command. Did you mean \"[lightgray]" + closest.text + "[]\"?"; + }else{ + return "[scarlet]Unknown command. Check [lightgray]/help[scarlet]."; + } + } + }; + private boolean closing = false; private Interval timer = new Interval(); @@ -994,4 +1020,8 @@ public class NetServer implements ApplicationListener{ /** @return text to be placed before player name */ String format(@Nullable Player player, String message); } + + public interface InvalidCommandHandler{ + String handle(Player player, CommandResponse response); + } } From 450f651c8fb313d0092fe201314582af3ef64ad9 Mon Sep 17 00:00:00 2001 From: Yuri Polyakov <86189625+Kowkodivka@users.noreply.github.com> Date: Mon, 1 Nov 2021 20:32:57 +0700 Subject: [PATCH 05/20] Update bundle_ru.properties (#6267) * Update bundle_ru.properties * Update bundle_ru.properties --- core/assets/bundles/bundle_ru.properties | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/assets/bundles/bundle_ru.properties b/core/assets/bundles/bundle_ru.properties index 32bc7153af..3c3797e52b 100644 --- a/core/assets/bundles/bundle_ru.properties +++ b/core/assets/bundles/bundle_ru.properties @@ -391,6 +391,11 @@ waves.every = каждый waves.waves = волна(ы) waves.perspawn = за появление waves.shields = ед. щита/волну +waves.sort = Сортировать по +waves.sort.reverse = Обратная сортировка +waves.sort.begin = Начало +waves.sort.health = Здоровье +waves.sort.type = Тип waves.to = до waves.max = максимум единиц waves.guardian = Страж @@ -895,6 +900,7 @@ setting.seconds = {0} секунд setting.milliseconds = {0} миллисекунд setting.fullscreen.name = Полноэкранный режим setting.borderlesswindow.name = Безрамочное окно +setting.borderlesswindow.description = Для вступления изменений в силу может потребоваться перезагрузка игры. setting.fps.name = Показывать FPS и пинг setting.smoothcamera.name = Плавная камера setting.vsync.name = Вертикальная синхронизация @@ -1513,7 +1519,7 @@ block.liquid-router.description = Принимает жидкости из од block.liquid-tank.description = Хранит большое количество жидкости. Выводит жидкости во все стороны, подобно жидкостному маршрутизатору. block.liquid-junction.description = Действует как мост для двух пересекающихся трубопроводов. block.bridge-conduit.description = Перемещает жидкости над любой местностью или зданиями. -block.liquid-container.description = Хранит большое количество жидкости. Выводит их во все стороны, как жидкостный маршрутизатор. +block.liquid-container.description = Хранит небольшое количество жидкости. Выводит жидкости во все стороны, подобно жидкостному маршрутизатору. block.phase-conduit.description = Перемещает жидкости над любой местностью или зданиями. Большая дистанция, чем у жидкостного моста, но требует энергию. block.power-node.description = Передает питание на подключенные узлы. Узел будет получать питание или поставлять питание на любые соседние блоки. block.power-node-large.description = Усовершенствованный силовой узел с большей дальностью. From 0639e3eedb62ab9edf5e6c6c039c4d7489b90336 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 1 Nov 2021 09:41:33 -0400 Subject: [PATCH 06/20] Power pickup bugfixes --- core/src/mindustry/entities/comp/BuildingComp.java | 13 ++++++++----- core/src/mindustry/entities/comp/PayloadComp.java | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index a90efd9ce6..1bdd1f4c01 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1293,16 +1293,19 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, return true; } + /** Called right before this building is picked up. */ public void pickedUp(){ + + + } + + /** Called right after this building is picked up. */ + public void afterPickedUp(){ if(power != null){ - if(power.graph != null){ - power.graph.removeList(self()); - power.graph = new PowerGraph(); - } + power.graph = new PowerGraph(); power.links.clear(); power.status = 0f; } - } public void removeFromProximity(){ diff --git a/core/src/mindustry/entities/comp/PayloadComp.java b/core/src/mindustry/entities/comp/PayloadComp.java index 045ae581d0..5bd52e7165 100644 --- a/core/src/mindustry/entities/comp/PayloadComp.java +++ b/core/src/mindustry/entities/comp/PayloadComp.java @@ -93,6 +93,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{ void pickup(Building tile){ tile.pickedUp(); tile.tile.remove(); + tile.afterPickedUp(); addPayload(new BuildPayload(tile)); Fx.unitPickup.at(tile); Events.fire(new PickupEvent(self(), tile)); From 8cabae1d46511e35f237efd4a3b6aa6fe74604f9 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 1 Nov 2021 12:27:00 -0400 Subject: [PATCH 07/20] Display infinity symbol for "unlimited" unit cap --- core/src/mindustry/entities/Units.java | 6 ++++++ core/src/mindustry/world/blocks/units/UnitFactory.java | 2 +- gradle.properties | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/Units.java b/core/src/mindustry/entities/Units.java index 532c74fbbf..a4b94ae570 100644 --- a/core/src/mindustry/entities/Units.java +++ b/core/src/mindustry/entities/Units.java @@ -81,6 +81,12 @@ public class Units{ return Math.max(0, state.rules.unitCapVariable ? state.rules.unitCap + team.data().unitCap : state.rules.unitCap); } + /** @return unit cap as a string, substituting the infinity symbol instead of MAX_VALUE */ + public static String getStringCap(Team team){ + int cap = getCap(team); + return cap >= Integer.MAX_VALUE - 1 ? "∞" : cap + ""; + } + /** @return whether this player can interact with a specific tile. if either of these are null, returns true.*/ public static boolean canInteract(Player player, Building tile){ return player == null || tile == null || tile.interactable(player.team()); diff --git a/core/src/mindustry/world/blocks/units/UnitFactory.java b/core/src/mindustry/world/blocks/units/UnitFactory.java index 882ccec5d6..d0295fc36b 100644 --- a/core/src/mindustry/world/blocks/units/UnitFactory.java +++ b/core/src/mindustry/world/blocks/units/UnitFactory.java @@ -78,7 +78,7 @@ public class UnitFactory extends UnitBlock{ Core.bundle.format("bar.unitcap", Fonts.getUnicodeStr(e.unit().name), e.team.data().countType(e.unit()), - Units.getCap(e.team) + Units.getStringCap(e.team) ), () -> Pal.power, () -> e.unit() == null ? 0f : (float)e.team.data().countType(e.unit()) / Units.getCap(e.team) diff --git a/gradle.properties b/gradle.properties index 10919a574f..e53459d921 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,4 +24,4 @@ android.useAndroidX=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 -archash=f1b1c17bf6385b607dad4af3c51ad88646c9e9ca +archash=07d01125a25b789cc081249c469b91b5f65070dc From 72e3461745e58fca809b9b6d9574c3e60dbb3fc4 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 1 Nov 2021 15:15:13 -0400 Subject: [PATCH 08/20] indent --- core/src/mindustry/entities/comp/BuildingComp.java | 1 - gradle.properties | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 1bdd1f4c01..8182b24d3d 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1296,7 +1296,6 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, /** Called right before this building is picked up. */ public void pickedUp(){ - } /** Called right after this building is picked up. */ diff --git a/gradle.properties b/gradle.properties index e53459d921..a7fc8bc057 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,4 +24,4 @@ android.useAndroidX=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 -archash=07d01125a25b789cc081249c469b91b5f65070dc +archash=7289b987eb5aae0999f561551d1b3bb50a195dc2 From f5c09845aecf62e16bfd0309bd4237465173ceb8 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 1 Nov 2021 15:29:07 -0400 Subject: [PATCH 09/20] Fixed #6282 --- .../mindustry/world/blocks/distribution/PayloadConveyor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java b/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java index 86062deb6c..9f909ba934 100644 --- a/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/PayloadConveyor.java @@ -95,7 +95,7 @@ public class PayloadConveyor extends Block{ public void onProximityUpdate(){ super.onProximityUpdate(); - Building accept = nearby(Geometry.d4(rotation).x * size, Geometry.d4(rotation).y * size); + Building accept = nearby(Geometry.d4(rotation).x * (size/2+1), Geometry.d4(rotation).y * (size/2+1)); //next block must be aligned and of the same size if(accept != null && ( //same size From 134ef9e00edb8c67e436841abaa5f3aec3a8c0ad Mon Sep 17 00:00:00 2001 From: hortiSquash <45213805+hortiSquash@users.noreply.github.com> Date: Mon, 1 Nov 2021 22:34:40 +0100 Subject: [PATCH 10/20] hortiloaders hotfix randomness (#6283) * hortiloaders hotfix randomness Improved the unloaders' balance with multiple blocks having the same load * deterministic lets go Co-Authored-By: citrusMarmelade <20476281+citrusMarmelade@users.noreply.github.com> * update contributors forgot to add them since they helped a lot for the previous commits/PRs Co-authored-by: citrusMarmelade <20476281+citrusMarmelade@users.noreply.github.com> --- core/assets/contributors | 1 + .../world/blocks/storage/Unloader.java | 31 +++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/core/assets/contributors b/core/assets/contributors index 85c23f7c7d..f740969d67 100644 --- a/core/assets/contributors +++ b/core/assets/contributors @@ -130,3 +130,4 @@ TranquillyUnpleasant Darkness6030 hortiSquash King-BR +citrusMarmelade diff --git a/core/src/mindustry/world/blocks/storage/Unloader.java b/core/src/mindustry/world/blocks/storage/Unloader.java index abd4b4a99c..bf70385092 100644 --- a/core/src/mindustry/world/blocks/storage/Unloader.java +++ b/core/src/mindustry/world/blocks/storage/Unloader.java @@ -64,8 +64,11 @@ public class Unloader extends Block{ float loadFactor; boolean canLoad; boolean canUnload; + int index; } + public int[] lastUsed; + @Override public void updateTile(){ if(((unloadTimer += delta()) < speed) || (proximity.size < 2)) return; @@ -80,14 +83,14 @@ public class Unloader extends Block{ for(int i = tmp; i < proximity.size; i++){ possibleBlocks.set(i, new ContainerStat()); } + lastUsed = new int[proximity.size]; } if(sortItem != null){ item = sortItem; - for(int j = 0; j < proximity.size; j++){ - int pos = (offset + j) % proximity.size; - var other = proximity.get(j); + for(int pos = 0; pos < proximity.size; pos++){ + var other = proximity.get(pos); boolean interactable = other.interactable(team); //set the stats of all buildings in possibleBlocks @@ -95,6 +98,7 @@ public class Unloader extends Block{ pb.building = other; pb.canUnload = interactable && other.canUnload() && other.items != null && other.items.has(sortItem); pb.canLoad = interactable && !(other.block instanceof StorageBlock) && other.acceptItem(this, sortItem); + pb.index = pos; } }else{ //select the next item for nulloaders @@ -106,9 +110,8 @@ public class Unloader extends Block{ boolean isDistinct = false; Item possibleItem = content.item(total); - for(int j = 0; j < proximity.size; j++){ - int pos = (offset + j) % proximity.size; - var other = proximity.get(j); + for(int pos = 0; pos < proximity.size; pos++){ + var other = proximity.get(pos); boolean interactable = other.interactable(team); //set the stats of all buildings in possibleBlocks while we are at it @@ -116,6 +119,7 @@ public class Unloader extends Block{ pb.building = other; pb.canUnload = interactable && other.canUnload() && other.items != null && other.items.has(possibleItem); pb.canLoad = interactable && !(other.block instanceof StorageBlock) && other.acceptItem(this, possibleItem); + pb.index = pos; //the part handling framerate issues and slow conveyor belts, to avoid skipping items if(hasProvider && pb.canLoad) isDistinct = true; @@ -138,11 +142,13 @@ public class Unloader extends Block{ pb.loadFactor = (other.getMaximumAccepted(item) == 0) || (other.items == null) ? 0 : other.items.get(item) / (float)other.getMaximumAccepted(item); } - //sort so it gives full priority to blocks that can give but not receive (stackConveyors and Storage), and then by load + //sort so it gives full priority to blocks that can give but not receive (stackConveyors and Storage), and then by load, and then by last use possibleBlocks.sort(Structs.comps( Structs.comparingBool(e -> e.building.block.highUnloadPriority), - Structs.comparingFloat(e -> e.loadFactor) - )); + Structs.comps( + Structs.comparingFloat(e -> e.loadFactor), + Structs.comparingInt(e -> -lastUsed[e.index]) + ))); ContainerStat dumpingFrom = null; ContainerStat dumpingTo = null; @@ -163,10 +169,17 @@ public class Unloader extends Block{ } } + //increment the priority if not used + for(int i = 0; i < possibleBlocks.size; i++){ + lastUsed[i] = (lastUsed[i] + 1 ) % 2147483647; + } + //trade the items if(dumpingFrom != null && dumpingTo != null && (dumpingFrom.loadFactor != dumpingTo.loadFactor || dumpingFrom.building.block.highUnloadPriority)){ dumpingTo.building.handleItem(this, item); dumpingFrom.building.removeStack(item, 1); + lastUsed[dumpingFrom.index] = 0; + lastUsed[dumpingTo.index] = 0; any = true; } From 48b9bbc31703e9e6f739908b3b34336bc58d96d0 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 2 Nov 2021 00:24:28 -0400 Subject: [PATCH 11/20] Less thruster rotation --- core/src/mindustry/world/blocks/defense/Thruster.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/mindustry/world/blocks/defense/Thruster.java b/core/src/mindustry/world/blocks/defense/Thruster.java index 89c9a28c12..f015b02b38 100644 --- a/core/src/mindustry/world/blocks/defense/Thruster.java +++ b/core/src/mindustry/world/blocks/defense/Thruster.java @@ -29,8 +29,7 @@ public class Thruster extends Wall{ @Override public void draw(){ - super.draw(); - + Draw.rect(block.region, x, y); Draw.rect(topRegion, x, y, rotdeg()); } } From 99d30b6351233473236de43a0a95d6e83bcf762a Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 2 Nov 2021 09:04:37 -0400 Subject: [PATCH 12/20] Fixed #6287 --- core/src/mindustry/entities/Damage.java | 3 ++- gradle.properties | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 8dcea7cbb2..52a2f0d6c7 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -461,11 +461,12 @@ public class Damage{ } private static void completeDamage(Team team, float x, float y, float radius, float damage){ + int trad = (int)(radius / tilesize); for(int dx = -trad; dx <= trad; dx++){ for(int dy = -trad; dy <= trad; dy++){ Tile tile = world.tile(Math.round(x / tilesize) + dx, Math.round(y / tilesize) + dy); - if(tile != null && tile.build != null && (team == null ||team.isEnemy(tile.team())) && dx*dx + dy*dy <= trad){ + if(tile != null && tile.build != null && (team == null ||team.isEnemy(tile.team())) && dx*dx + dy*dy <= trad*trad){ tile.build.damage(team, damage); } } diff --git a/gradle.properties b/gradle.properties index a7fc8bc057..0d1105982b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,4 +24,4 @@ android.useAndroidX=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 -archash=7289b987eb5aae0999f561551d1b3bb50a195dc2 +archash=ace698cee9e0ea2bc7993ffa44501122bd891b44 From b418afed630d392c35811e07b0dd0659570d7371 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 2 Nov 2021 10:03:44 -0400 Subject: [PATCH 13/20] Added WorldLabel entity for better server-side labels --- .../src/main/resources/classids.properties | 1 + .../resources/revisions/WorldLabelComp/0.json | 1 + core/src/mindustry/entities/GroupDefs.java | 1 + .../entities/comp/WorldLabelComp.java | 68 +++++++++++++++++++ core/src/mindustry/ui/Menus.java | 13 +++- 5 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 annotations/src/main/resources/revisions/WorldLabelComp/0.json create mode 100644 core/src/mindustry/entities/comp/WorldLabelComp.java diff --git a/annotations/src/main/resources/classids.properties b/annotations/src/main/resources/classids.properties index 2dc5b73284..d37431c7b0 100644 --- a/annotations/src/main/resources/classids.properties +++ b/annotations/src/main/resources/classids.properties @@ -20,6 +20,7 @@ mindustry.entities.comp.PlayerComp=12 mindustry.entities.comp.PosTeam=27 mindustry.entities.comp.PosTeamDef=28 mindustry.entities.comp.PuddleComp=13 +mindustry.entities.comp.WorldLabelComp=35 mindustry.type.Weather.WeatherStateComp=14 mindustry.world.blocks.campaign.LaunchPad.LaunchPayloadComp=15 mindustry.world.blocks.campaign.PayloadLaunchPad.LargeLaunchPayloadComp=34 diff --git a/annotations/src/main/resources/revisions/WorldLabelComp/0.json b/annotations/src/main/resources/revisions/WorldLabelComp/0.json new file mode 100644 index 0000000000..e3d056549b --- /dev/null +++ b/annotations/src/main/resources/revisions/WorldLabelComp/0.json @@ -0,0 +1 @@ +{fields:[{name:flags,type:byte},{name:fontSize,type:float},{name:text,type:java.lang.String},{name:x,type:float},{name:y,type:float},{name:z,type:float}]} \ No newline at end of file diff --git a/core/src/mindustry/entities/GroupDefs.java b/core/src/mindustry/entities/GroupDefs.java index 8f98a69442..b995d4c415 100644 --- a/core/src/mindustry/entities/GroupDefs.java +++ b/core/src/mindustry/entities/GroupDefs.java @@ -14,4 +14,5 @@ class GroupDefs{ @GroupDef(value = Firec.class) G fire; @GroupDef(value = Puddlec.class) G puddle; @GroupDef(value = WeatherStatec.class) G weather; + @GroupDef(value = WorldLabelc.class, mapping = true) G label; } diff --git a/core/src/mindustry/entities/comp/WorldLabelComp.java b/core/src/mindustry/entities/comp/WorldLabelComp.java new file mode 100644 index 0000000000..d33d95f1e0 --- /dev/null +++ b/core/src/mindustry/entities/comp/WorldLabelComp.java @@ -0,0 +1,68 @@ +package mindustry.entities.comp; + +import arc.graphics.*; +import arc.graphics.g2d.*; +import arc.scene.ui.layout.*; +import arc.util.*; +import arc.util.pooling.*; +import mindustry.annotations.Annotations.*; +import mindustry.gen.*; +import mindustry.graphics.*; +import mindustry.ui.*; + +/** Component/entity for labels in world space. Useful for servers. Does not save in files - create only on world load. */ +@EntityDef(value = {WorldLabelc.class}, serialize = false) +@Component(base = true) +public abstract class WorldLabelComp implements Posc, Drawc, Syncc{ + @Import int id; + @Import float x, y; + + public static final byte flagBackground = 1, flagOutline = 2; + + public String text = "sample text"; + public float fontSize = 1f, z = Layer.playerName + 1; + /** Flags are packed into a byte for sync efficiency; see the flag static values. */ + public byte flags = flagBackground | flagOutline; + + @Replace + public float clipSize(){ + return text.length() * 10f * fontSize; + } + + @Override + public void draw(){ + Draw.z(z); + float z = Drawf.text(); + + Font font = (flags & flagOutline) != 0 ? Fonts.outline : Fonts.def; + GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new); + + boolean ints = font.usesIntegerPositions(); + font.setUseIntegerPositions(false); + font.getData().setScale(0.25f / Scl.scl(1f) * fontSize); + layout.setText(font, text); + + if((flags & flagBackground) != 0){ + Draw.color(0f, 0f, 0f, 0.3f); + Fill.rect(x, y - layout.height / 2, layout.width + 2, layout.height + 3); + Draw.color(); + } + + font.setColor(Color.white); + font.draw(text, x, y, 0, Align.center, false); + + Draw.reset(); + Pools.free(layout); + font.getData().setScale(1f); + font.setColor(Color.white); + font.setUseIntegerPositions(ints); + + Draw.z(z); + } + + /** This MUST be called instead of remove()! */ + public void hide(){ + remove(); + Call.removeWorldLabel(id); + } +} diff --git a/core/src/mindustry/ui/Menus.java b/core/src/mindustry/ui/Menus.java index 2503e60535..7d4d601a8d 100644 --- a/core/src/mindustry/ui/Menus.java +++ b/core/src/mindustry/ui/Menus.java @@ -94,9 +94,7 @@ public class Menus{ @Remote(variants = Variant.both) public static void labelReliable(String message, float duration, float worldx, float worldy){ - if(message == null) return; - - ui.showLabel(message, duration, worldx, worldy); + label(message, duration, worldx, worldy); } @Remote(variants = Variant.both) @@ -113,6 +111,15 @@ public class Menus{ ui.hudfrag.showToast(Fonts.getGlyph(Fonts.icon, (char)unicode), text); } + //internal use only + @Remote + public static void removeWorldLabel(int id){ + var label = Groups.label.getByID(id); + if(label != null){ + label.remove(); + } + } + public interface MenuListener{ void get(Player player, int option); } From 77044db39f4b5c80ffc020c783c1fe660bc92caf Mon Sep 17 00:00:00 2001 From: Darkness#3729 <79508138+Darkness6030@users.noreply.github.com> Date: Tue, 2 Nov 2021 18:26:57 +0300 Subject: [PATCH 14/20] Remove v6 servers from v7 serverlist (#6286) --- servers_v7.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/servers_v7.json b/servers_v7.json index 9da1fdac62..e7feb0ad29 100644 --- a/servers_v7.json +++ b/servers_v7.json @@ -1,8 +1,4 @@ [ - { - "name": "Mindustry Central", - "address": ["n2.mindustry.me:4019", "mindustry.me:2034", "mindustry.me:2035"] - }, { "name": "mindustry.pl", "address": ["0.baseduser.eu.org:6000", "0.baseduser.eu.org:6666", "0.baseduser.eu.org:6966"] @@ -55,10 +51,6 @@ "name": "Shiza Minigames", "address": ["shizashizashiza.ml"] }, - { - "name": "devass.su", - "address": ["185.22.152.66"] - }, { "name": "Phoenix Network", "address": ["172.104.253.198"] From a7cd8c8ef3e79e43dd7d433a3a275fb8d679a316 Mon Sep 17 00:00:00 2001 From: Valeriy Date: Wed, 3 Nov 2021 01:27:09 +1000 Subject: [PATCH 15/20] Removing to v7 (#6284) --- servers_v6.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/servers_v6.json b/servers_v6.json index 39130c65cd..98cbeb7ac5 100644 --- a/servers_v6.json +++ b/servers_v6.json @@ -7,10 +7,6 @@ "name": "RCM", "address": ["185.104.248.61", "easyplay.su"] }, - { - "name": "SkaarjDustry", - "address": ["skaarjproject.duckdns.org"] - }, { "name": "{AA}", "address": ["aamindustry.play.ai", "aamindustry.play.ai:6571", "aamindustry.play.ai:6572", "aamindustry.play.ai:6573", "aamindustry.play.ai:6574"] From 921c1133753dba04c1654fcf29368246005c9bbd Mon Sep 17 00:00:00 2001 From: Valeriy Date: Wed, 3 Nov 2021 01:27:14 +1000 Subject: [PATCH 16/20] Moving to v7 (#6285) --- servers_v7.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servers_v7.json b/servers_v7.json index e7feb0ad29..fcefdd7745 100644 --- a/servers_v7.json +++ b/servers_v7.json @@ -23,6 +23,10 @@ "name": "DarkDustry", "address": ["darkdustry.ml", "darkdustry.ml:6000", "darkdustry.ml:7000", "darkdustry.ml:8000", "darkdustry.ml:9000"] }, + { + "name": "SkaarjDustry", + "address": ["skaarjproject.duckdns.org"] + }, { "name": "Chaotic Neutral", "address": ["c-n.ddns.net:5555", "c-n.ddns.net:6666"] From a438be7fcd22c8aa96c570762366302960cbc6a2 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 2 Nov 2021 17:22:07 -0700 Subject: [PATCH 17/20] when and why was this hardcoded (#6289) --- core/src/mindustry/ai/types/MinerAI.java | 4 ++-- core/src/mindustry/game/Teams.java | 4 +--- core/src/mindustry/type/UnitType.java | 4 +++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/mindustry/ai/types/MinerAI.java b/core/src/mindustry/ai/types/MinerAI.java index f4a408800f..bc9b1a9da9 100644 --- a/core/src/mindustry/ai/types/MinerAI.java +++ b/core/src/mindustry/ai/types/MinerAI.java @@ -25,7 +25,7 @@ public class MinerAI extends AIController{ if(mining){ if(timer.get(timerTarget2, 60 * 4) || targetItem == null){ - targetItem = unit.team.data().mineItems.min(i -> indexer.hasOre(i) && unit.canMine(i), i -> core.items.get(i)); + targetItem = unit.type.mineItems.min(i -> indexer.hasOre(i) && unit.canMine(i), i -> core.items.get(i)); } //core full of the target item, do nothing @@ -75,4 +75,4 @@ public class MinerAI extends AIController{ circle(core, unit.type.range / 1.8f); } } -} +} \ No newline at end of file diff --git a/core/src/mindustry/game/Teams.java b/core/src/mindustry/game/Teams.java index f6f284ab35..0f3bf22c69 100644 --- a/core/src/mindustry/game/Teams.java +++ b/core/src/mindustry/game/Teams.java @@ -234,8 +234,6 @@ public class Teams{ public Queue blocks = new Queue<>(); /** The current command for units to follow. */ public UnitCommand command = UnitCommand.attack; - /** Target items to mine. */ - public Seq mineItems = Seq.with(Items.copper, Items.lead, Items.titanium, Items.thorium); /** Quadtree for all buildings of this team. Null if not active. */ @Nullable @@ -370,4 +368,4 @@ public class Teams{ '}'; } } -} +} \ No newline at end of file diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index fcff622497..ac576f396d 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -88,6 +88,8 @@ public class UnitType extends UnlockableContent{ public BlockFlag[] targetFlags = {null}; /** targetFlags, as an override for "non-AI" teams. By default, units of this type will rush the core. */ public BlockFlag[] playerTargetFlags = {BlockFlag.core, null}; + /** Target items to mine. Used in MinerAI */ + public Seq mineItems = Seq.with(Items.copper, Items.lead, Items.titanium, Items.thorium); public Color outlineColor = Pal.darkerMetal; public int outlineRadius = 3; @@ -965,4 +967,4 @@ public class UnitType extends UnlockableContent{ //endregion -} +} \ No newline at end of file From 3574b982abb316b24ef5ca8cb82488aedb317386 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 2 Nov 2021 19:03:47 -0700 Subject: [PATCH 18/20] misspelling (#6291) --- core/src/mindustry/world/Block.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 167f7e8b4b..f75d256bef 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -86,7 +86,7 @@ public class Block extends UnlockableContent{ public boolean solid; /** whether this block CAN be solid. */ public boolean solidifes; - /** whether this is rotateable */ + /** whether this is rotatable */ public boolean rotate; /** number of different variant regions to use */ public int variants = 0; From 996193ea69ea4f34cfc00b0cf0cad32caaa9a83c Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Wed, 3 Nov 2021 10:34:42 -0700 Subject: [PATCH 19/20] `payloadRotation` field (#6294) --- core/src/mindustry/entities/comp/BuildingComp.java | 1 + core/src/mindustry/world/blocks/payloads/BuildPayload.java | 1 + 2 files changed, 2 insertions(+) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 8182b24d3d..eb5490446c 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -61,6 +61,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, transient boolean updateFlow; transient byte cdump; transient int rotation; + transient float payloadRotation; transient boolean enabled = true; transient float enabledControlTime; transient String lastAccessed; diff --git a/core/src/mindustry/world/blocks/payloads/BuildPayload.java b/core/src/mindustry/world/blocks/payloads/BuildPayload.java index 4b8454fd5c..cf6370ccf7 100644 --- a/core/src/mindustry/world/blocks/payloads/BuildPayload.java +++ b/core/src/mindustry/world/blocks/payloads/BuildPayload.java @@ -80,6 +80,7 @@ public class BuildPayload implements Payload{ @Override public void set(float x, float y, float rotation){ build.set(x, y); + build.payloadRotation = rotation; } @Override From 7884bbd29971088844547a650a14f4a161fde390 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Wed, 3 Nov 2021 10:37:02 -0700 Subject: [PATCH 20/20] stack conveyor looks weird on payload conveyors (#6295) --- .../mindustry/world/blocks/distribution/StackConveyor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/mindustry/world/blocks/distribution/StackConveyor.java b/core/src/mindustry/world/blocks/distribution/StackConveyor.java index d19004d243..fa7d2427e3 100644 --- a/core/src/mindustry/world/blocks/distribution/StackConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/StackConveyor.java @@ -153,6 +153,11 @@ public class StackConveyor extends Block implements Autotiler{ Draw.z(Layer.block - 0.15f); super.drawCracks(); } + + @Override + public void payloadDraw(){ + Draw.rect(block.fullIcon, x, y); + } @Override public void onProximityUpdate(){