Compare commits

..

27 Commits
v57 ... v58

Author SHA1 Message Date
Anuken
d68d2e9f30 Moved paused text details into bundle 2018-10-18 22:33:11 -04:00
Anuken
948c48ea23 Merge remote-tracking branch 'origin/master' 2018-10-18 21:57:19 -04:00
Anuken
a9ccf6ca42 Updated travis config / Fixed flying mech land effect 2018-10-18 21:57:13 -04:00
Baramos666
fd7b829e70 Update bundle_fr.properties (#249) 2018-10-18 21:56:44 -04:00
LQ
87a7cc6289 add liquid out speed display (#250) 2018-10-18 21:56:35 -04:00
VizardAlpha
2f8b5e53bb Updates bundle_fr_be.properties (#251)
Recast of the French translation (Belgium)
2018-10-18 21:56:09 -04:00
Prosta4okua
8b7fa3b646 [WIP]Update bundle_ru.properties (#243)
* Update bundle_ru.properties

* Update bundle_ru.properties
2018-10-18 21:56:00 -04:00
Anuken
dd2c71fe61 Removed sandbox from shuffle list / duplicate maps / mobile mech pickup 2018-10-18 18:20:07 -04:00
Anuken
3b58d57e5c Fixed unlocks not clearing / Fixed map editor not updating 2018-10-18 16:58:57 -04:00
Anuken
cecf32e52e Fixed RTG generator not using items 2018-10-18 16:33:39 -04:00
Anuken
91a2dfab36 Fixed build block repair / Sectors in random maps / Editor unlocks 2018-10-18 16:31:15 -04:00
Anuken
5e5838a8c1 let me make this PAINFULLY CLEAR 2018-10-18 16:04:40 -04:00
Skybbles // L5474
0fffbc06dd Spelling correction (#252)
*maybe you mean CLI board.*
2018-10-18 14:35:33 -04:00
Anuken
4d360bfb73 Bugfixes 2018-10-18 09:19:29 -04:00
Anuken
e3001b614e Fixed pathfinding through liquids / Switched overlay render layer 2018-10-18 00:02:12 -04:00
Anuken
6ecdef02ab Block break visual cleanup 2018-10-17 22:10:56 -04:00
Anuken
36903eb749 Fixed mission onBegin() being called many times 2018-10-17 17:35:33 -04:00
Anuken
f530c9514f Changed placement controls / Fixed complete sectors not resetting 2018-10-17 17:28:24 -04:00
Anuken
fdffa77bc5 Fixed mobile targeting / Removed 'transfer speed' / Buffed large nodes 2018-10-17 17:09:26 -04:00
Anuken
245dd39a60 Potentially fixed targeting issues 2018-10-17 14:01:18 -04:00
Anuken
4614aacc02 Fixed chat not clearing 2018-10-17 13:54:34 -04:00
Anuken
64ccdab90c Removed extra trace info (for now) 2018-10-17 13:41:25 -04:00
Anuken
02286b0c4e Fixed player build indicators, power void 2018-10-17 10:31:59 -04:00
Anuken
8e952a550b Fixed: map mirror / crashes / mech pads / player list / mobile placement 2018-10-17 10:20:58 -04:00
Anuken
a29f95194d Various fixes / Placement visual improvements 2018-10-17 00:36:43 -04:00
Anuken
0e5db49b93 Fixed missing blocks causing invalid map data error 2018-10-16 20:03:35 -04:00
Anuken
a2c29c0937 Removed tutorial ore post-generation / Updated uCore 2018-10-16 19:31:06 -04:00
69 changed files with 849 additions and 689 deletions

View File

@@ -1,26 +1,28 @@
language: android language: android
jdk: jdk:
- openjdk8 - openjdk8
android: android:
components: components:
- android-28 - android-28
# Additional components
- extra-google-google_play_services - extra-google-google_play_services
- extra-google-m2repository - extra-google-m2repository
- extra-android-m2repository - extra-android-m2repository
- addon-google_apis-google-28 - addon-google_apis-google-28
- build-tools-28.0.3 - build-tools-28.0.3
script: script:
- ./gradlew test - "./gradlew test"
- ./gradlew desktop:dist - "./gradlew desktop:dist"
- ./gradlew server:dist - "./gradlew server:dist"
after_success:
- chmod +x upload-build.sh
- chmod +x cleanup_builds.sh
- ./upload-build.sh
deploy:
provider: releases
skip_cleanup: true
draft: false
api_key:
secure: Cv5wFtWt62/A24EvSEQvMow7gKPbZ3oATEFPuSghhB2TQz1dA40Zee3Qvk4LFlpLrhYo4K0ZSczCZRGpR+hCd8+Dpww52bheYEvWuh3ZQfvu/fXtEx2j5PwP1qMpmIgSxETV/gkD7l9FImdh0VzktYiAvQfmi0bEocG9/D4QwjFpNat7iwBdcMiw1MvAygpdIWRsjiw0RKlB2mWarmoHhQ7Gu7qlU3j50uaEvcrtmU0pBUPggNQwQRv32i9NPvNFxrqqlUjDLIS8JFea99zCkp8BwYqbEvBIMzd+Qip1/stLJJA3+cDUClbsDtg8rAVetzpOrdLEEBmqShFe5MDl2yEHcsgpN9CFsyTaUfvB3P3rVjizvycMm42IsUkXQiarm5xTQ/TIA8Rd8AHiSKuweNCg1Fd5SFaRtKy8JVLXuxyfUccmyje6hhz2L4lS2Wfj3mAG7sqZUCXhWP79EKdGkiPOjKv4CwXEKmuH3BMVqPlNUZJr9Eg3sV1FG0h2l+MVOOnR635qdUbb49sYojYxVruMLX0BH1c4ZCu230m8CUoWA1Em1QNI75ya7+9Y5T6AsgWDVpBvdUo9fWNbdp+VQ0GskFQsJD5wtnxbcbHeFiERAgGBm7z6qt9u9LrQpBH+dsW52ADvYsu3L4nQEa+sdMHwTTwmGY+iUvsxu0DqxGg=
file:
- "desktop/build/libs/desktop-release.jar"
- "server/build/libs/server-release.jar"
on:
repo: Anuken/Mindustry
tags: true

View File

@@ -27,11 +27,11 @@ allprojects {
appName = 'Mindustry' appName = 'Mindustry'
gdxVersion = '1.9.8' gdxVersion = '1.9.8'
roboVMVersion = '2.3.0' roboVMVersion = '2.3.0'
uCoreVersion = 'd5f892dcf1773b0f6d47d2190d139cc6342ac75f' uCoreVersion = '53f99fbdc50910a15b4f55e9739385f47cf800cf'
getVersionString = { getVersionString = {
String buildVersion = getBuildVersion() String buildVersion = getBuildVersion()
return "$versionNumber-$versionType-$buildVersion" return "$versionNumber-$versionModifier-$buildVersion"
} }
getBuildVersion = { getBuildVersion = {

View File

@@ -8,7 +8,7 @@ text.link.trello.description=Official trello board for planned features
text.link.itch.io.description=itch.io page with PC downloads and web version text.link.itch.io.description=itch.io page with PC downloads and web version
text.link.google-play.description=Google Play store listing text.link.google-play.description=Google Play store listing
text.link.wiki.description=official Mindustry wiki text.link.wiki.description=official Mindustry wiki
text.linkfail=Failed to open link!\nThe URL has been copied to your cliboard. text.linkfail=Failed to open link!\nThe URL has been copied to your clipboard.
text.editor.web=The web version does not support the editor!\nDownload the game to use it. text.editor.web=The web version does not support the editor!\nDownload the game to use it.
text.web.unsupported=The web version does not support this feature! Download the game to use it. text.web.unsupported=The web version does not support this feature! Download the game to use it.
text.gameover=Game Over text.gameover=Game Over
@@ -63,6 +63,7 @@ text.sector.unexplored=[accent][[Unexplored]
text.missions=Missions:[LIGHT_GRAY] {0} text.missions=Missions:[LIGHT_GRAY] {0}
text.mission=Mission:[LIGHT_GRAY] {0} text.mission=Mission:[LIGHT_GRAY] {0}
text.mission.main=Main Mission:[LIGHT_GRAY] {0}
text.mission.info=Mission Info text.mission.info=Mission Info
text.mission.complete=Mission complete! text.mission.complete=Mission complete!
text.mission.complete.body=Sector {0},{1} has been conquered. text.mission.complete.body=Sector {0},{1} has been conquered.
@@ -293,7 +294,7 @@ text.settings.clearall.confirm=[scarlet]WARNING![]\nThis will clear all data, in
text.settings.clearsectors=Clear Sectors text.settings.clearsectors=Clear Sectors
text.settings.clearunlocks=Clear Unlocks text.settings.clearunlocks=Clear Unlocks
text.settings.clearall=Clear All text.settings.clearall=Clear All
text.paused=Paused text.paused=[accent]< Paused >
text.yes=Yes text.yes=Yes
text.no=No text.no=No
text.info.title=Info text.info.title=Info
@@ -325,6 +326,7 @@ text.blocks.outputitem=Output Item
text.blocks.drilltier=Drillables text.blocks.drilltier=Drillables
text.blocks.drillspeed=Base Drill Speed text.blocks.drillspeed=Base Drill Speed
text.blocks.liquidoutput=Liquid Output text.blocks.liquidoutput=Liquid Output
text.blocks.liquidoutputspeed=Liquid Output Speed
text.blocks.liquiduse=Liquid Use text.blocks.liquiduse=Liquid Use
text.blocks.coolant=Coolant text.blocks.coolant=Coolant
text.blocks.coolantuse=Coolant Use text.blocks.coolantuse=Coolant Use
@@ -425,7 +427,8 @@ mode.waves.name=waves
mode.waves.description=the normal mode. limited resources and automatic incoming waves. mode.waves.description=the normal mode. limited resources and automatic incoming waves.
mode.sandbox.name=sandbox mode.sandbox.name=sandbox
mode.sandbox.description=infinite resources and no timer for waves. mode.sandbox.description=infinite resources and no timer for waves.
mode.custom.warning=Note that blocks unlocked in custom games are not carried over to sectors.\n\n[LIGHT_GRAY]In sandbox, only blocks unlocked with sector play can be used. mode.custom.warning=[scarlet]UNLOCKS IN CUSTOM GAMES OR SERVERS ARE NOT SAVED.[]\n\nPlay in sectors to unlock things.
mode.custom.warning.read=Just to make sure you've read it:\n[scarlet]UNLOCKS IN CUSTOM GAMES DO NOT CARRY OVER TO SECTORS OR OTHER MODES!\n\n[LIGHT_GRAY](I wish this wasn't necessary, but apparently it is)
mode.freebuild.name=freebuild mode.freebuild.name=freebuild
mode.freebuild.description=limited resources and no timer for waves. mode.freebuild.description=limited resources and no timer for waves.
mode.pvp.name=PvP mode.pvp.name=PvP
@@ -666,15 +669,15 @@ team.purple.name=purple
unit.alpha-drone.name=Alpha Drone unit.alpha-drone.name=Alpha Drone
unit.spirit.name=Spirit Drone unit.spirit.name=Spirit Drone
unit.spirit.description=The starter drone unit. Spawns in the core by default. Automatically mines ores, collects items and repairs blocks. unit.spirit.description=The starter drone unit. Spawns in the core by default. Automatically mines ores and repairs blocks.
unit.phantom.name=Phantom Drone unit.phantom.name=Phantom Drone
unit.phantom.description=An advanced drone unit. Automatically mines ores, collects items and repairs blocks. Significantly more effective than a drone. unit.phantom.description=An advanced drone unit. Automatically mines ores and repairs blocks. Significantly more effective than a spirit drone.
unit.dagger.name=Dagger unit.dagger.name=Dagger
unit.dagger.description=A basic ground unit. Useful in swarms. unit.dagger.description=A basic ground unit. Useful in swarms.
unit.titan.name=Titan unit.titan.name=Titan
unit.titan.description=An advanced, armored ground unit. Attacks both ground and air targets. unit.titan.description=An advanced, armored ground unit. Attacks both ground and air targets.
unit.ghoul.name=Ghoul Bomber unit.ghoul.name=Ghoul Bomber
unit.ghoul.description=A heavy carpet bomber. Uses blast compound or pyratite as ammo. unit.ghoul.description=A heavy carpet bomber.
unit.wraith.name=Wraith Fighter unit.wraith.name=Wraith Fighter
unit.wraith.description=A fast, hit-and-run interceptor unit. unit.wraith.description=A fast, hit-and-run interceptor unit.
unit.fortress.name=Fortress unit.fortress.name=Fortress

View File

@@ -460,7 +460,7 @@ text.none=<none>
text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created. text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created.
text.mission.complete=Mission complete! text.mission.complete=Mission complete!
text.mission.complete.body=Sector {0},{1} has been conquered. text.mission.complete.body=Sector {0},{1} has been conquered.
text.mission.resource=Obtain {0} x{1} text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
text.unit.health=[LIGHT_GRAY]Health: {0} text.unit.health=[LIGHT_GRAY]Health: {0}
text.unit.speed=[LIGHT_GRAY]Speed: {0} text.unit.speed=[LIGHT_GRAY]Speed: {0}
block.mass-driver.name=Mass Driver block.mass-driver.name=Mass Driver

View File

@@ -11,6 +11,8 @@ text.linkfail=Failed to open link!\nThe URL has been copied to your cliboard.
text.editor.web=The web version does not support the editor!\nDownload the game to use it. text.editor.web=The web version does not support the editor!\nDownload the game to use it.
text.web.unsupported=La version web ne supporte pas cette fonction ! Téléchargez le jeu pour l'utiliser. text.web.unsupported=La version web ne supporte pas cette fonction ! Téléchargez le jeu pour l'utiliser.
text.gameover=Votre base a été détruite text.gameover=Votre base a été détruite
text.gameover=Partie terminée.
text.gameover.pvp=L'équipe [accent] {0}[] a gagnée !
text.sector.gameover=Ce secteur a été perdu. Réessayer? text.sector.gameover=Ce secteur a été perdu. Réessayer?
text.highscore=[YELLOW]Nouveau meilleur score! text.highscore=[YELLOW]Nouveau meilleur score!
text.level.highscore=Meilleur score: [accent]{0} text.level.highscore=Meilleur score: [accent]{0}
@@ -36,6 +38,8 @@ text.sector.deploy=Se déployer
text.sector.resume=Reprendre text.sector.resume=Reprendre
text.sector.locked=[scarlet][[Incomplet] text.sector.locked=[scarlet][[Incomplet]
text.sector.unexplored=[accent][[Inexploré] text.sector.unexplored=[accent][[Inexploré]
text.sector.abandon=Abandonner
text.sector.abandon.confirm=Êtes-vous sûr d'abandonner ce secteur ?\nCe choix ne peut être annulé!
text.missions=Missions:[LIGHT_GRAY] {0} text.missions=Missions:[LIGHT_GRAY] {0}
text.mission=Mission:[LIGHT_GRAY] {0} text.mission=Mission:[LIGHT_GRAY] {0}
@@ -184,6 +188,7 @@ text.saving=[accent]Sauvegarde...
text.wave=[orange]Vague {0} text.wave=[orange]Vague {0}
text.wave.waiting=[LIGHT_GRAY]Vague dans {0} text.wave.waiting=[LIGHT_GRAY]Vague dans {0}
text.waiting=[LIGHT_GRAY]En attente... text.waiting=[LIGHT_GRAY]En attente...
text.waiting.players=En attente de joueurs...
text.wave.enemies=[LIGHT_GRAY]{0} Ennemis restants text.wave.enemies=[LIGHT_GRAY]{0} Ennemis restants
text.wave.enemy=[LIGHT_GRAY]{0} Ennemi restant text.wave.enemy=[LIGHT_GRAY]{0} Ennemi restant
text.loadimage=Charger l'image text.loadimage=Charger l'image
@@ -194,6 +199,7 @@ text.builtin=Pré-fait
text.map.delete.confirm=Êtes-vous sûr de supprimer cette carte? Cette action ne peut pas être défaite! text.map.delete.confirm=Êtes-vous sûr de supprimer cette carte? Cette action ne peut pas être défaite!
text.map.random=[accent]Carte aléatoire text.map.random=[accent]Carte aléatoire
text.map.nospawn=Cette carte n'a pas de base pour que le joueur y apparaisse! Ajouter une [ROYAL]base bleue[] sur cette carte dans l'éditeur. text.map.nospawn=Cette carte n'a pas de base pour que le joueur y apparaisse! Ajouter une [ROYAL]base bleue[] sur cette carte dans l'éditeur.
text.map.nospawn.pvp=Cette carte n'a pas de base ennemies pour qu'un joueur ennemi y apparaisse! Ajouter au moins une [SCARLET]Base rouge[] sur cette carte dans l'éditeur.
text.map.invalid=Erreur lors du chargement de la carte: carte corrompue ou invalide. text.map.invalid=Erreur lors du chargement de la carte: carte corrompue ou invalide.
text.editor.brush=Pinceau text.editor.brush=Pinceau
text.editor.slope=\\ text.editor.slope=\\
@@ -388,6 +394,9 @@ mode.waves.description=le mode de jeu normal. Ressource limitée et vagues d'enn
mode.sandbox.description=Ressources infinies et pas de timer pour les vagues. mode.sandbox.description=Ressources infinies et pas de timer pour les vagues.
mode.custom.warning=Notez que les blocs débloqués en partie personnalisées ne sont pas conservés pour les secteurs.\n\n[LIGHT_GRAY]En mode bac à sable, seul les blocs débloqués en mode secteur peuvent être utilisés. mode.custom.warning=Notez que les blocs débloqués en partie personnalisées ne sont pas conservés pour les secteurs.\n\n[LIGHT_GRAY]En mode bac à sable, seul les blocs débloqués en mode secteur peuvent être utilisés.
mode.freebuild.description=Ressource limitée et pas de timer pour les vagues. mode.freebuild.description=Ressource limitée et pas de timer pour les vagues.
mode.pvp.name=JcJ
mode.pvp.description=Battez-vous contre d'autres joueurs en local.
content.item.name=Objets content.item.name=Objets
content.liquid.name=Liquides content.liquid.name=Liquides
content.unit.name=Unités content.unit.name=Unités
@@ -467,6 +476,13 @@ text.mech.minespeed=[LIGHT_GRAY]Vitesse de minage: {0}
text.mech.minepower=[LIGHT_GRAY]Puissance du minage: {0} text.mech.minepower=[LIGHT_GRAY]Puissance du minage: {0}
text.mech.ability=[LIGHT_GRAY]Compétence: {0} text.mech.ability=[LIGHT_GRAY]Compétence: {0}
team.blue.name=bleu
team.red.name=rouge
team.orange.name=orange
team.none.name=gris
team.green.name=vert
team.purple.name=violet
block.spawn.name=Générateur d'ennemi block.spawn.name=Générateur d'ennemi
block.core.name=Base block.core.name=Base
block.metalfloor.name=Sol en métal block.metalfloor.name=Sol en métal
@@ -556,6 +572,7 @@ block.powerinfinite.name=Puissance infinie
block.unloader.name=Déchargeur block.unloader.name=Déchargeur
block.sortedunloader.name=Déchargeur-trieur block.sortedunloader.name=Déchargeur-trieur
block.vault.name=Coffre-Fort block.vault.name=Coffre-Fort
block.container.name=Conteneur
block.repair-point.name=Point de Réparation block.repair-point.name=Point de Réparation
block.conduit.name=Conduit block.conduit.name=Conduit
block.pulse-conduit.name=Conduit à Impulsion block.pulse-conduit.name=Conduit à Impulsion
@@ -583,6 +600,7 @@ block.rock.name=pierre
block.blackrock.name=pierre sombre block.blackrock.name=pierre sombre
block.icerock.name=pierre gelée block.icerock.name=pierre gelée
block.command-center.name=Centre de commandement block.command-center.name=Centre de commandement
block.alpha-mech-pad.name=Reconstructeur de mécha "Alpha"
block.dart-ship-pad.name=Reconstructeur de vaisseau "Dard" block.dart-ship-pad.name=Reconstructeur de vaisseau "Dard"
block.delta-mech-pad.name=Reconstructeur de mécha "Delta" block.delta-mech-pad.name=Reconstructeur de mécha "Delta"
block.javelin-ship-pad.name=Reconstructeur de vaisseau "Javelin" block.javelin-ship-pad.name=Reconstructeur de vaisseau "Javelin"

File diff suppressed because it is too large Load Diff

View File

@@ -460,7 +460,7 @@ text.none=<none>
text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created. text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created.
text.mission.complete=Mission complete! text.mission.complete=Mission complete!
text.mission.complete.body=Sector {0},{1} has been conquered. text.mission.complete.body=Sector {0},{1} has been conquered.
text.mission.resource=Obtain {0} x{1} text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
text.unit.health=[LIGHT_GRAY]Health: {0} text.unit.health=[LIGHT_GRAY]Health: {0}
text.unit.speed=[LIGHT_GRAY]Speed: {0} text.unit.speed=[LIGHT_GRAY]Speed: {0}
block.mass-driver.name=Mass Driver block.mass-driver.name=Mass Driver

View File

@@ -474,7 +474,7 @@ text.none=<없음>
text.sector.corrupted=[orange]저장 파일에서 구역을 발견했으나 불러오지 못했습니다.\n새로 생성되었습니다. text.sector.corrupted=[orange]저장 파일에서 구역을 발견했으나 불러오지 못했습니다.\n새로 생성되었습니다.
text.mission.complete=미션 성공! text.mission.complete=미션 성공!
text.mission.complete.body=구역 {0},{1} 탐색 성공. text.mission.complete.body=구역 {0},{1} 탐색 성공.
text.mission.resource=Obtain {0} x{1} text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
text.unit.health=[LIGHT_GRAY]체력:{0} text.unit.health=[LIGHT_GRAY]체력:{0}
text.unit.speed=[LIGHT_GRAY]속도:{0} text.unit.speed=[LIGHT_GRAY]속도:{0}
block.mass-driver.name=물질 이동기 block.mass-driver.name=물질 이동기

View File

@@ -460,7 +460,7 @@ text.none=<none>
text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created. text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created.
text.mission.complete=Mission complete! text.mission.complete=Mission complete!
text.mission.complete.body=Sector {0},{1} has been conquered. text.mission.complete.body=Sector {0},{1} has been conquered.
text.mission.resource=Obtain {0} x{1} text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
text.unit.health=[LIGHT_GRAY]Health: {0} text.unit.health=[LIGHT_GRAY]Health: {0}
text.unit.speed=[LIGHT_GRAY]Speed: {0} text.unit.speed=[LIGHT_GRAY]Speed: {0}
block.mass-driver.name=Mass Driver block.mass-driver.name=Mass Driver

View File

@@ -459,7 +459,7 @@ text.none=<none>
text.sector.corrupted=[orange]Um arquivo de save Foi encontrado neste setor, Mas o login falhou.\nUm novo foi criado. text.sector.corrupted=[orange]Um arquivo de save Foi encontrado neste setor, Mas o login falhou.\nUm novo foi criado.
text.mission.complete=Mission complete! text.mission.complete=Mission complete!
text.mission.complete.body=Sector {0},{1} has been conquered. text.mission.complete.body=Sector {0},{1} has been conquered.
text.mission.resource=Obtain {0} x{1} text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
text.join.info=Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[LIGHT_GRAY]Note: There is no automatic global server list; if you want to connect to someone by IP, you would need to ask the host for their IP. text.join.info=Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[LIGHT_GRAY]Note: There is no automatic global server list; if you want to connect to someone by IP, you would need to ask the host for their IP.
text.unit.health=[LIGHT_GRAY]Health: {0} text.unit.health=[LIGHT_GRAY]Health: {0}
text.unit.speed=[LIGHT_GRAY]Speed: {0} text.unit.speed=[LIGHT_GRAY]Speed: {0}

View File

@@ -11,9 +11,12 @@ text.link.wiki.description=Официальная вики Mindustry(англ.)
text.linkfail=Не удалось открыть ссылку!\nURL-адрес был скопирован в буфер обмена. text.linkfail=Не удалось открыть ссылку!\nURL-адрес был скопирован в буфер обмена.
text.editor.web=Веб-версия не поддерживает редактор!\nЗагрузите игру, чтобы использовать его. text.editor.web=Веб-версия не поддерживает редактор!\nЗагрузите игру, чтобы использовать его.
text.web.unsupported=Веб-версия не поддерживает эту функцию! Загрузите игру, чтобы использовать её. text.web.unsupported=Веб-версия не поддерживает эту функцию! Загрузите игру, чтобы использовать её.
text.gameover=Ядро было уничтожено. text.gameover=Игра окончена
text.gameover.pvp=[accent] {0}[] команда победила!
text.sector.gameover=Этот сектор потерян. Высадится повторно? text.sector.gameover=Этот сектор потерян. Высадится повторно?
text.sector.retry=Повторить попытку text.sector.retry=Повторить попытку
text.sector.abandon=Отступить
text.sector.abandon.confirm=Вы уверены, что хотите отступить?\nЭто не может быть отменено!
text.highscore=[YELLOW]Новый рекорд! text.highscore=[YELLOW]Новый рекорд!
text.wave.lasted=Вы продержались до волны [accent]{0}[]. text.wave.lasted=Вы продержались до волны [accent]{0}[].
text.level.highscore=Рекорд: [accent]{0} text.level.highscore=Рекорд: [accent]{0}
@@ -89,7 +92,7 @@ text.server.kicked.idInUse=Вы уже на этом сервере! Соеди
text.server.kicked.customClient=Этот сервер не поддерживает пользовательские сборки. Загрузите официальную версию. text.server.kicked.customClient=Этот сервер не поддерживает пользовательские сборки. Загрузите официальную версию.
text.host.info=Кнопка [accent] Сервер [] размещает сервер на порт [accent]6567[].[]\nЛюбой пользователь в той же [LIGHT_GRAY]сети [] получет возможность видеть ваш сервер в своём списке серверов.\n\nЕсли вы хотите, чтобы люди могли подключаться из любого места по IP, то требуется переадресация(проброс) портов.[].\n\n[LIGHT_GRAY] Примечание. Если у кого-то возникают проблемы с подключением к вашей локальной сети, убедитесь, что вы разрешили Mindustry доступ к вашей локальной сети в настройках брандмауэра. text.host.info=Кнопка [accent] Сервер [] размещает сервер на порт [accent]6567[].[]\nЛюбой пользователь в той же [LIGHT_GRAY]сети [] получет возможность видеть ваш сервер в своём списке серверов.\n\nЕсли вы хотите, чтобы люди могли подключаться из любого места по IP, то требуется переадресация(проброс) портов.[].\n\n[LIGHT_GRAY] Примечание. Если у кого-то возникают проблемы с подключением к вашей локальной сети, убедитесь, что вы разрешили Mindustry доступ к вашей локальной сети в настройках брандмауэра.
text.join.info=Здесь вы можете ввести IP-адрес [accent]сервера[] для подключения или открыть [accent]локальную сеть [] для подключения к другим серверам.\nПоддерживается многопользовательский режим LAN и WAN.\n\n[LIGHT_GRAY] Примечание: это не является автоматическим глобальным списком серверов; если вы хотите подключиться к кому-то по IP, вам нужно будет спросить у хоста его IP-адрес. text.join.info=Здесь вы можете ввести IP-адрес [accent]сервера[] для подключения или открыть [accent]локальную сеть [] для подключения к другим серверам.\nПоддерживается многопользовательский режим LAN и WAN.\n\n[LIGHT_GRAY] Примечание: это не является автоматическим глобальным списком серверов; если вы хотите подключиться к кому-то по IP, вам нужно будет спросить у хоста его IP-адрес.
text.hostserver=Запустить сервер. text.hostserver=Запустить сервер
text.closeserver=Закрыть сервер text.closeserver=Закрыть сервер
text.hostserver.mobile=Запустить\nсервер. text.hostserver.mobile=Запустить\nсервер.
text.host=Сервер text.host=Сервер
@@ -190,7 +193,7 @@ text.saving=[accent]Сохранение..
text.wave=[orange]Волна {0} text.wave=[orange]Волна {0}
text.wave.waiting=Волна через {0} text.wave.waiting=Волна через {0}
text.waiting=Ожидание... text.waiting=Ожидание...
text.waiting.players=Ожидание двух игроков ... text.waiting.players=Ожидание игроков ...
text.enemies={0} Противников text.enemies={0} Противников
text.enemies.single={0} Противник text.enemies.single={0} Противник
text.loadimage=Загрузить изображение text.loadimage=Загрузить изображение
@@ -200,7 +203,7 @@ text.custom=Пользовательская
text.builtin=Встроенная text.builtin=Встроенная
text.map.delete.confirm=Вы действительно хотите удалить эту карту? Это действие не может быть отменено! text.map.delete.confirm=Вы действительно хотите удалить эту карту? Это действие не может быть отменено!
text.map.random=[accent]Случайная карта text.map.random=[accent]Случайная карта
text.map.nospawn=Эта карта не имеет ядер, в которых игрок может появиться! Добавьте [ROYAL]синее[] ядро на эту карту в редакторе карт. text.map.nospawn=Эта карта не имеет ядер, в которых игрок может появиться! Добавьте[ROYAL] синее[] ядро на эту карту в редакторе карт.
text.map.nospawn.pvp=У этой карты нет вражеских ядер, в которых игрок может появиться! Добавьте[SCARLET] красные[] ядра к этой карте в редакторе. text.map.nospawn.pvp=У этой карты нет вражеских ядер, в которых игрок может появиться! Добавьте[SCARLET] красные[] ядра к этой карте в редакторе.
text.map.invalid=Ошибка загрузки карты: повреждённый или недопустимый файл карты. text.map.invalid=Ошибка загрузки карты: повреждённый или недопустимый файл карты.
text.editor.brush=Кисть text.editor.brush=Кисть
@@ -213,7 +216,7 @@ text.editor.author=Автор:
text.editor.description=Описание: text.editor.description=Описание:
text.editor.name=Название: text.editor.name=Название:
text.editor.teams=Команды text.editor.teams=Команды
text.editor.elevation=Высота возвышенности text.editor.elevation=Возвышенность
text.editor.badsize=[orange]Не правильный размер изображения! [] \nДопустимый размер карты: {0} text.editor.badsize=[orange]Не правильный размер изображения! [] \nДопустимый размер карты: {0}
text.editor.errorimageload=Ошибка загрузки изображения: [orange] {0} text.editor.errorimageload=Ошибка загрузки изображения: [orange] {0}
text.editor.errorimagesave=Ошибка сохранения изображения: [orange] {0} text.editor.errorimagesave=Ошибка сохранения изображения: [orange] {0}
@@ -404,8 +407,8 @@ mode.sandbox.description=Бесконечные ресурсы и нет тай
mode.custom.warning=Обратите внимание, что блоки, разблокированные в пользовательских играх, не переносятся на сектора.\n\n[LIGHT_GRAY] В песочнице можно использовать только блоки, разблокированные в секторах. mode.custom.warning=Обратите внимание, что блоки, разблокированные в пользовательских играх, не переносятся на сектора.\n\n[LIGHT_GRAY] В песочнице можно использовать только блоки, разблокированные в секторах.
mode.freebuild.name=ободная\nстройка mode.freebuild.name=ободная\nстройка
mode.freebuild.description=ограниченные ресурсы и нет таймера для волн. mode.freebuild.description=ограниченные ресурсы и нет таймера для волн.
mode.pvp.name=PvP mode.pvp.name=Противо-\nстояние
mode.pvp.description=боритесь против других игроков здесь. mode.pvp.description=боритесь против других игроков.
content.item.name=Предметы content.item.name=Предметы
content.liquid.name=Жидкости content.liquid.name=Жидкости
content.unit.name=Боевые единицы content.unit.name=Боевые единицы
@@ -596,11 +599,11 @@ block.pneumatic-drill.description=Улучшенная версия механи
block.laser-drill.name=Лазерный бур block.laser-drill.name=Лазерный бур
block.laser-drill.description=Улучшенная версия пневматического бура.\n\nДобывает тоже самое, что и пневматический бур. Также может добывать торий.\n\nМожно подвести к нему [BLUE]воду[] для увеличения скорости сверления. block.laser-drill.description=Улучшенная версия пневматического бура.\n\nДобывает тоже самое, что и пневматический бур. Также может добывать торий.\n\nМожно подвести к нему [BLUE]воду[] для увеличения скорости сверления.
block.water-extractor.name=Экстрактор воды block.water-extractor.name=Экстрактор воды
block.water-extractor.description=Делает воду из энергии.\n[PINK]МАГИЯ! block.water-extractor.description=Добывает воду из земли. Требует Энергию.
block.cultivator.name=Культиватор block.cultivator.name=Культиватор
block.cultivator.description=Производит биоматерию из травы воды. Требует энергии. block.cultivator.description=Производит биоматерию из травы и воды. Требует энергии.
block.alpha-mech-pad.name=Завод мехов "Альфа" block.alpha-mech-pad.name=Завод мехов "Альфа"
block.alpha-mech-pad.description=Превращает вас в Джавелин. Требует энергию.\n Подробности про Джавелин в "разблокированное" block.alpha-mech-pad.description=Превращает вас в "Альфа". Требует энергию.\n Подробности про Джавелин в "разблокированное"
block.dart-ship-pad.name=Завод дротиковых самолётов block.dart-ship-pad.name=Завод дротиковых самолётов
block.delta-mech-pad.name=Завод мехов "Дельта" block.delta-mech-pad.name=Завод мехов "Дельта"
block.javelin-ship-pad.name=Реконструктор кораблей "Джавелин" block.javelin-ship-pad.name=Реконструктор кораблей "Джавелин"
@@ -629,7 +632,7 @@ block.liquidsource.name=Источник жидкостей
block.liquidsource.description=Из этого блока можно получить любую жидкость. block.liquidsource.description=Из этого блока можно получить любую жидкость.
block.powervoid.name=Энергетический вакуум block.powervoid.name=Энергетический вакуум
block.powervoid.description=Жидкости просто уходят в пустоту block.powervoid.description=Жидкости просто уходят в пустоту
block.powerinfinite.name=Бесконечная энергия block.powerinfinite.name=Источник энергии
block.powerinfinite.description=Бесконечность — не предел. block.powerinfinite.description=Бесконечность — не предел.
block.unloader.name=Разгрузчик block.unloader.name=Разгрузчик
block.unloader.description=Выгружает из ядра или хранилища верхний левый предмет. block.unloader.description=Выгружает из ядра или хранилища верхний левый предмет.
@@ -732,6 +735,14 @@ block.spectre.name=Призрак
block.spectre.description=Первая турель 4х4 с средним радиусом атаки. Использует в качестве снарядов плотный сплав, торий и пиротит. block.spectre.description=Первая турель 4х4 с средним радиусом атаки. Использует в качестве снарядов плотный сплав, торий и пиротит.
block.meltdown.name=Катастрофа block.meltdown.name=Катастрофа
block.meltdown.description=Турель с средним радиусом атаки.Для патронов требует воду или криогенную жидкость. Также нужна энергия. block.meltdown.description=Турель с средним радиусом атаки.Для патронов требует воду или криогенную жидкость. Также нужна энергия.
team.blue.name=Синяя
team.red.name=Красная
team.orange.name=Оранжевая
team.none.name=Серая
team.green.name=Зелёная
team.purple.name=Фиолетовая
block.container.name=Склад
block.container.description=Хранит ресурсы. Попробуй оттуда их достать :)
unit.alpha-drone.name=Альфа unit.alpha-drone.name=Альфа
unit.spirit.name=Дрон-привидение unit.spirit.name=Дрон-привидение
unit.spirit.description=Начальный дрон. По умолчанию появляется из ядра. Автоматически добывает руды, собирает предметы, ремонтирует блоки. unit.spirit.description=Начальный дрон. По умолчанию появляется из ядра. Автоматически добывает руды, собирает предметы, ремонтирует блоки.
@@ -749,20 +760,20 @@ unit.fortress.name=Крепость
unit.fortress.description=Боевая единица с тяжёлой артилерийской установкой. unit.fortress.description=Боевая единица с тяжёлой артилерийской установкой.
unit.revenant.name=Потусторонний убийца unit.revenant.name=Потусторонний убийца
unit.revenant.description=Боевая единица с тяжёлой лазерной установкой. unit.revenant.description=Боевая единица с тяжёлой лазерной установкой.
tutorial.begin=Ваша миссия здесь состоит в том, чтобы уничтожить[LIGHT_GRAY]вашего врага[].\n\nНачните с[accent] добычи меди[]. Чтобы добыть её, коснитесь месторождения медной руды рядом с вашим ядром. tutorial.begin=Ваша миссия здесь состоит в том, чтобы уничтожить[LIGHT_GRAY] вашего врага[].\n\nНачните с[accent] добычи меди[]. Чтобы добыть её, коснитесь месторождения медной руды рядом с вашим ядром.
tutorial.drill=Ручная работа не очень эффективна.\n[accent]Буры[] могут копать автоматически.\nПоставьте один на медной жиле. tutorial.drill=Ручная работа не очень эффективна.\n[accent]Буры[] могут копать автоматически.\nПоставьте один на медной жиле.
tutorial.conveyor=[accent]Конвейеры[] используются для транспортировки предметов к ядру.\nСоздайте конвейеры от бура к ядру. tutorial.conveyor=[accent]Конвейеры[] используются для транспортировки предметов к ядру.\nСоздайте конвейеры от бура к ядру.
tutorial.morecopper=Требуется больше меди.\n\nЛибо добудьте её вручную, либо разместите больше буров. tutorial.morecopper=Требуется больше меди.\n\nЛибо добудьте её вручную, либо разместите больше буров.
tutorial.turret=Оборонительные сооружения должны быть созданы, чтобы отразить[LIGHT_GRAY] атаку противника[].Постройте двойную турель рядом с вашей базой. tutorial.turret=Оборонительные сооружения должны быть созданы, чтобы отразить[LIGHT_GRAY] атаку противника[].Постройте двойную турель рядом с вашей базой.
tutorial.drillturret=Двойные турели требуют[accent] патронов из меди[] для стрельбы.\nРазместите бур рядом с турелью, чтобы снабдить её добытой медью. tutorial.drillturret=Двойные турели требуют[accent] патронов из меди[] для стрельбы.\nРазместите бур рядом с турелью, чтобы снабдить её добытой медью.
tutorial.waves=[LIGHT_GRAY] Враг[] приближается.\n\nЗащитите своё ядро от 2-ух волн. Вам может понадобится больше турелей. tutorial.waves=[LIGHT_GRAY]Враг[] приближается.\n\nЗащитите своё ядро от 2-ух волн. Вам может понадобится больше турелей.
tutorial.lead=Осмотритесь! Магическим образом появились новые руды. Добудьте [accent] свинец[].\n\nПеретащите из своего устройства(юнита) в ядро для переноса ресурсов. tutorial.lead=Осмотритесь! Магическим образом появились новые руды. Добудьте [accent] свинец[].\n\nПеретащите из своего устройства(юнита) в ядро для переноса ресурсов.
tutorial.smelter=Медь и свинец являются мягкими металлами.\nПревосходный[accent] Плотный сплав[] может быть создан в плавильном заводе.\n\nПостройте один. tutorial.smelter=Медь и свинец являются мягкими металлами.\nПревосходный[accent] Плотный сплав[] может быть создан в плавильном заводе.\n\nПостройте один завод.
tutorial.densealloy=Теперь плавильный завод производит плотный сплав.\nПолучите немного.\nУсовершенствуйте производство, если это необходимо. tutorial.densealloy=Теперь плавильный завод производит плотный сплав.\nСоздайте немного.\nУсовершенствуйте производство, если это необходимо.
tutorial.siliconsmelter=Сейчас ядро создаст[accent] дрона[] для добычи и ремонта блоков. \n\nЗаводы для других единиц могут быть созданы с помощью кремния.\nСоздайте [accent]кремниевый завод[]. tutorial.siliconsmelter=Сейчас ядро создаст[accent] дрона[] для добычи и ремонта блоков. \n\nЗаводы для других единиц могут быть созданы с помощью кремния.\nСоздайте [accent]кремниевый завод[].
tutorial.silicondrill=Для производства кремния требуется [accent] уголь[] и [accent] песок[].\nНачните их добычу, сделав буры. tutorial.silicondrill=Для производства кремния требуется[accent] уголь[] и[accent] песок[].\nНачните их добычу, сделав буры.
tutorial.generator=Эта технология требует энергии.\nПостройте [accent] генератор внутреннего сгорания[] для того, чтобы запитать ядро энергией. tutorial.generator=Эта технология требует энергии.\nПостройте [accent] генератор внутреннего сгорания[] для того, чтобы запитать ядро энергией.
tutorial.generatordrill=Генератор внутреннего сгорания нуждаются в топливе.\nЗаправьте его углём. tutorial.generatordrill=Генератор внутреннего сгорания нуждается в топливе.\nЗаправьте его углём.
tutorial.node=Энергия требует транспортировки.\nСоздайте [accent] силовой узел[] рядом с генератором внутреннего сгорания для передачи его энергии. tutorial.node=Энергия требует транспортировки.\nСоздайте [accent] силовой узел[] рядом с генератором внутреннего сгорания для передачи его энергии.
tutorial.nodelink=Энергия может быть передана посредством соприкосновения блоков питания и генераторов или связанных силовых узлов.\n\nСоедините их энергией, нажав на силовой узел и выбрав генератор, а затем кремниевый завод. tutorial.nodelink=Энергия может быть передана посредством соприкосновения блоков питания и генераторов или связанных силовых узлов.\n\nСоедините их энергией, нажав на силовой узел и выбрав генератор, а затем кремниевый завод.
tutorial.silicon=Производство кремния началось. Получите немного.\nРекомендуется улучшить эту систему. tutorial.silicon=Производство кремния началось. Получите немного.\nРекомендуется улучшить эту систему.

View File

@@ -460,7 +460,7 @@ text.none=<none>
text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created. text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created.
text.mission.complete=Mission complete! text.mission.complete=Mission complete!
text.mission.complete.body=Sector {0},{1} has been conquered. text.mission.complete.body=Sector {0},{1} has been conquered.
text.mission.resource=Obtain {0} x{1} text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
text.unit.health=[LIGHT_GRAY]Health: {0} text.unit.health=[LIGHT_GRAY]Health: {0}
text.unit.speed=[LIGHT_GRAY]Speed: {0} text.unit.speed=[LIGHT_GRAY]Speed: {0}
block.mass-driver.name=Mass Driver block.mass-driver.name=Mass Driver

View File

@@ -42,7 +42,7 @@ text.sector.unexplored=[accent][[Unexplored]
text.mission=任务[LIGHT_GRAY] {0} text.mission=任务[LIGHT_GRAY] {0}
text.mission.wave=存活了 [accent]{0}[] 波。 text.mission.wave=存活了 [accent]{0}[] 波。
text.mission.battle=摧毁敌方基地。 text.mission.battle=摧毁敌方基地。
text.mission.resource=获得 {0} x{1} text.mission.resource=获得 {0}:\n[accent]{1}/{2}[]
text.none=<none> text.none=<none>
text.close=关闭 text.close=关闭
text.quit=退出 text.quit=退出
@@ -267,7 +267,8 @@ text.blocks.inputitems=输入物品
text.blocks.outputitem=输出物品 text.blocks.outputitem=输出物品
text.blocks.drilltier=可钻探矿物 text.blocks.drilltier=可钻探矿物
text.blocks.drillspeed=基础钻探速度 text.blocks.drillspeed=基础钻探速度
text.blocks.liquidoutput=液体输出速度 text.blocks.liquidoutput=液体输出
text.blocks.liquidoutputspeed=液体输出速度
text.blocks.liquiduse=使用液体 text.blocks.liquiduse=使用液体
text.blocks.coolant=冷却剂 text.blocks.coolant=冷却剂
text.blocks.coolantuse=使用冷却剂 text.blocks.coolantuse=使用冷却剂

View File

@@ -460,7 +460,7 @@ text.none=<none>
text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created. text.sector.corrupted=[orange]A save file for this sector was found, but loading failed.\nA new one has been created.
text.mission.complete=Mission complete! text.mission.complete=Mission complete!
text.mission.complete.body=Sector {0},{1} has been conquered. text.mission.complete.body=Sector {0},{1} has been conquered.
text.mission.resource=Obtain {0} x{1} text.mission.resource=Obtain {0}:\n[accent]{1}/{2}[]
text.unit.health=[LIGHT_GRAY]Health: {0} text.unit.health=[LIGHT_GRAY]Health: {0}
text.unit.speed=[LIGHT_GRAY]Speed: {0} text.unit.speed=[LIGHT_GRAY]Speed: {0}
block.mass-driver.name=Mass Driver block.mass-driver.name=Mass Driver

View File

@@ -155,7 +155,7 @@ public class Pathfinder{
int dx = tile.x + point.x, dy = tile.y + point.y; int dx = tile.x + point.x, dy = tile.y + point.y;
Tile other = world.tile(dx, dy); Tile other = world.tile(dx, dy);
if(other != null && (path.weights[dx][dy] == Float.MAX_VALUE || path.searches[dx][dy] < path.search) if(other != null && (path.weights[dx][dy] > cost + other.cost || path.searches[dx][dy] < path.search)
&& passable(other, team)){ && passable(other, team)){
path.frontier.addFirst(world.tile(dx, dy)); path.frontier.addFirst(world.tile(dx, dy));
path.weights[dx][dy] = cost + other.cost; path.weights[dx][dy] = cost + other.cost;

View File

@@ -75,7 +75,7 @@ public class WaveSpawner{
int amount = group.getGroupsSpawned(state.wave); int amount = group.getGroupsSpawned(state.wave);
if(group.type.isFlying){ if(group.type.isFlying){
flyGroups += amount; flyGroups += amount;
}else{ }else if(dynamicSpawn){
groundGroups += amount; groundGroups += amount;
} }
} }
@@ -109,6 +109,8 @@ public class WaveSpawner{
float spawnX, spawnY; float spawnX, spawnY;
float spread; float spread;
if(!group.type.isFlying && groundCount >= groundSpawns.size) continue;
if(group.type.isFlying){ if(group.type.isFlying){
FlyerSpawn spawn = flySpawns.get(flyCount); FlyerSpawn spawn = flySpawns.get(flyCount);
//TODO verify flyer spawn //TODO verify flyer spawn
@@ -119,7 +121,7 @@ public class WaveSpawner{
spread = margin / 1.5f; spread = margin / 1.5f;
flyCount++; flyCount++;
}else{ }else{ //make sure it works for non-dynamic spawns
GroundSpawn spawn = groundSpawns.get(groundCount); GroundSpawn spawn = groundSpawns.get(groundCount);
if(dynamicSpawn){ if(dynamicSpawn){

View File

@@ -84,7 +84,6 @@ public class Mechs implements ContentList{
mass = 0.9f; mass = 0.9f;
armor = 30f; armor = 30f;
weaponOffsetX = -1; weaponOffsetX = -1;
itemCapacity = 15;
weaponOffsetY = -1; weaponOffsetY = -1;
weapon = Weapons.shockgun; weapon = Weapons.shockgun;
trailColorTo = Color.valueOf("d3ddff"); trailColorTo = Color.valueOf("d3ddff");

View File

@@ -16,6 +16,7 @@ import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.PowerBlock; import io.anuke.mindustry.world.blocks.PowerBlock;
import io.anuke.mindustry.world.blocks.distribution.Sorter; import io.anuke.mindustry.world.blocks.distribution.Sorter;
import io.anuke.mindustry.world.blocks.power.PowerNode; import io.anuke.mindustry.world.blocks.power.PowerNode;
import io.anuke.mindustry.world.meta.BlockStat;
import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.scene.ui.ButtonGroup; import io.anuke.ucore.scene.ui.ButtonGroup;
import io.anuke.ucore.scene.ui.ImageButton; import io.anuke.ucore.scene.ui.ImageButton;
@@ -48,12 +49,17 @@ public class DebugBlocks extends BlockList implements ContentList{
super.setBars(); super.setBars();
bars.remove(BarType.power); bars.remove(BarType.power);
} }
@Override
public void init(){
super.init();
stats.remove(BlockStat.powerCapacity);
}
}; };
powerInfinite = new PowerNode("powerinfinite"){ powerInfinite = new PowerNode("powerinfinite"){
{ {
powerCapacity = 10000f; powerCapacity = 10000f;
powerSpeed = 100f;
maxNodes = 100; maxNodes = 100;
outputsPower = true; outputsPower = true;
consumesPower = false; consumesPower = false;

View File

@@ -74,15 +74,14 @@ public class PowerBlocks extends BlockList implements ContentList{
powerNode = new PowerNode("power-node"){{ powerNode = new PowerNode("power-node"){{
shadow = "shadow-round-1"; shadow = "shadow-round-1";
powerSpeed = 0.5f;
maxNodes = 4; maxNodes = 4;
laserRange = 6;
}}; }};
powerNodeLarge = new PowerNode("power-node-large"){{ powerNodeLarge = new PowerNode("power-node-large"){{
size = 2; size = 2;
powerSpeed = 1.5f;
maxNodes = 6; maxNodes = 6;
laserRange = 7.5f; laserRange = 9.5f;
shadow = "shadow-round-2"; shadow = "shadow-round-2";
}}; }};

View File

@@ -16,6 +16,7 @@ import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.BuildBlock;
import io.anuke.mindustry.world.blocks.distribution.MassDriver.DriverBulletData; import io.anuke.mindustry.world.blocks.distribution.MassDriver.DriverBulletData;
import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers; import io.anuke.ucore.core.Timers;
@@ -63,11 +64,11 @@ public class TurretBullets extends BulletList implements ContentList{
@Override @Override
public void hitTile(Bullet b, Tile tile){ public void hitTile(Bullet b, Tile tile){
super.hit(b); super.hit(b);
tile = tile.target();
if(tile.getTeam() == b.getTeam()){ if(tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){
Effects.effect(BlockFx.healBlock, tile.drawx(), tile.drawy(), tile.block().size); Effects.effect(BlockFx.healBlock, tile.drawx(), tile.drawy(), tile.block().size);
tile.entity.health += healAmount; tile.entity.healBy(healAmount);
tile.entity.health = Mathf.clamp(tile.entity.health, 0, tile.block().health);
} }
} }
}; };

View File

@@ -114,10 +114,13 @@ public class Control extends Module{
state.set(State.playing); state.set(State.playing);
if(world.getSector() == null && !Settings.getBool("custom-warning", false)){ if(world.getSector() == null && !Settings.getBool("custom-warning-for-real-1", false)){
threads.runGraphics(() -> ui.showInfo("$mode.custom.warning")); threads.runGraphics(() -> ui.showInfo("$mode.custom.warning", () ->
Settings.putBool("custom-warning", true); ui.showInfo("$mode.custom.warning.read", () -> {
Settings.putBool("custom-warning-for-real-1", true);
Settings.save(); Settings.save();
})));
} }
}); });

View File

@@ -112,6 +112,7 @@ public class Logic extends Module{
world.getSector().completedMissions ++; world.getSector().completedMissions ++;
state.mode = world.getSector().currentMission().getMode(); state.mode = world.getSector().currentMission().getMode();
world.getSector().currentMission().onFirstBegin();
world.getSector().currentMission().onBegin(); world.getSector().currentMission().onBegin();
world.sectors.save(); world.sectors.save();
} }

View File

@@ -12,7 +12,6 @@ import io.anuke.annotations.Annotations.Variant;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.Vars;
import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest; import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest;
import io.anuke.mindustry.entities.traits.SyncTrait; import io.anuke.mindustry.entities.traits.SyncTrait;
import io.anuke.mindustry.entities.traits.TypeTrait; import io.anuke.mindustry.entities.traits.TypeTrait;
@@ -24,6 +23,7 @@ import io.anuke.mindustry.net.NetworkIO;
import io.anuke.mindustry.net.Packets.*; import io.anuke.mindustry.net.Packets.*;
import io.anuke.mindustry.net.TraceInfo; import io.anuke.mindustry.net.TraceInfo;
import io.anuke.mindustry.net.ValidateException; import io.anuke.mindustry.net.ValidateException;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.modules.InventoryModule; import io.anuke.mindustry.world.modules.InventoryModule;
import io.anuke.ucore.core.Core; import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Settings; import io.anuke.ucore.core.Settings;
@@ -292,9 +292,9 @@ public class NetClient extends Module{
byte cores = input.readByte(); byte cores = input.readByte();
for(int i = 0; i < cores; i++){ for(int i = 0; i < cores; i++){
int pos = input.readInt(); int pos = input.readInt();
TileEntity entity = world.tile(pos).entity; Tile tile = world.tile(pos);
if(entity != null){ if(tile != null && tile.entity != null){
entity.items.read(input); tile.entity.items.read(input);
}else{ }else{
new InventoryModule().read(input); new InventoryModule().read(input);
} }

View File

@@ -145,7 +145,7 @@ public class Renderer extends RendererModule{
if(players[0].isDead()){ if(players[0].isDead()){
TileEntity core = players[0].getClosestCore(); TileEntity core = players[0].getClosestCore();
if(core != null){ if(core != null && players[0].spawner == -1){
smoothCamera(core.x, core.y, 0.08f); smoothCamera(core.x, core.y, 0.08f);
}else{ }else{
smoothCamera(position.x + 0.0001f, position.y + 0.0001f, 0.08f); smoothCamera(position.x + 0.0001f, position.y + 0.0001f, 0.08f);
@@ -247,15 +247,15 @@ public class Renderer extends RendererModule{
overlays.drawBottom(); overlays.drawBottom();
drawAndInterpolate(playerGroup, p -> true, Player::drawBuildRequests); drawAndInterpolate(playerGroup, p -> true, Player::drawBuildRequests);
overlays.drawTop();
Shaders.shield.color.set(Palette.accent); Shaders.shield.color.set(Palette.accent);
Graphics.beginShaders(Shaders.shield); Graphics.beginShaders(Shaders.shield);
EntityDraw.draw(shieldGroup); EntityDraw.draw(shieldGroup);
EntityDraw.drawWith(shieldGroup, shield -> true, shield -> ((ShieldEntity)shield).drawOver()); EntityDraw.drawWith(shieldGroup, shield -> true, shield -> ((ShieldEntity)shield).drawOver());
Graphics.endShaders(); Graphics.endShaders();
overlays.drawTop();
if(showFog){ if(showFog){
Graphics.surface(); Graphics.surface();
}else{ }else{

View File

@@ -244,6 +244,17 @@ public class UI extends SceneModule{
}}.show(); }}.show();
} }
public void showInfo(String info, Runnable clicked){
new Dialog("$text.info.title", "dialog"){{
getCell(content()).growX();
content().margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
buttons().addButton("$text.ok", () -> {
clicked.run();
hide();
}).size(90, 50).pad(4);
}}.show();
}
public void showError(String text){ public void showError(String text){
new Dialog("$text.error.title", "dialog"){{ new Dialog("$text.error.title", "dialog"){{
content().margin(15).add(text).width(400f).wrap().get().setAlignment(Align.center, Align.center); content().margin(15).add(text).width(400f).wrap().get().setAlignment(Align.center, Align.center);

View File

@@ -222,7 +222,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
clearChildren(); clearChildren();
margin(0); margin(0);
build(); shown(this::build);
update(() -> { update(() -> {
if(Core.scene.getKeyboardFocus() instanceof Dialog && Core.scene.getKeyboardFocus() != this){ if(Core.scene.getKeyboardFocus() instanceof Dialog && Core.scene.getKeyboardFocus() != this){
@@ -382,6 +382,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
float size = mobile ? (int) (Math.min(Gdx.graphics.getHeight(), Gdx.graphics.getWidth()) / amount / Unit.dp.scl(1f)) : float size = mobile ? (int) (Math.min(Gdx.graphics.getHeight(), Gdx.graphics.getWidth()) / amount / Unit.dp.scl(1f)) :
Math.min(Gdx.graphics.getDisplayMode().height / amount, baseSize); Math.min(Gdx.graphics.getDisplayMode().height / amount, baseSize);
clearChildren();
table(cont -> { table(cont -> {
cont.left(); cont.left();

View File

@@ -60,7 +60,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
public boolean achievedFlight; public boolean achievedFlight;
public Color color = new Color(); public Color color = new Color();
public Mech mech; public Mech mech;
public int spawner; public int spawner = -1;
public NetConnection con; public NetConnection con;
public int playerIndex = 0; public int playerIndex = 0;
@@ -418,27 +418,48 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
public void drawBuildRequests(){ public void drawBuildRequests(){
synchronized(getPlaceQueue()){ synchronized(getPlaceQueue()){
for(BuildRequest request : getPlaceQueue()){ for(BuildRequest request : getPlaceQueue()){
if(getCurrentRequest() == request) continue;
if(request.remove){ if(request.remove){
Block block = world.tile(request.x, request.y).target().block(); Block block = world.tile(request.x, request.y).target().block();
//draw removal request //draw removal request
Lines.stroke(2f);
Draw.color(Palette.removeBack);
float rad = Mathf.absin(Timers.time(), 7f, 1f) + block.size * tilesize / 2f - 1;
Lines.square(
request.x * tilesize + block.offset(),
request.y * tilesize + block.offset() - 1,
rad);
Draw.color(Palette.remove); Draw.color(Palette.remove);
Lines.stroke((1f - request.progress)); Lines.square(
request.x * tilesize + block.offset(),
Lines.poly(request.x * tilesize + block.offset(),
request.y * tilesize + block.offset(), request.y * tilesize + block.offset(),
4, block.size * tilesize / 2f, 45 + 15); rad);
}else{ }else{
//draw place request //draw place request
Lines.stroke(2f);
Draw.color(Palette.accentBack);
float rad = Mathf.absin(Timers.time(), 7f, 1f) - 2f + request.recipe.result.size * tilesize / 2f;
Lines.square(
request.x * tilesize + request.recipe.result.offset(),
request.y * tilesize + request.recipe.result.offset() - 1,
rad);
Draw.color(Palette.accent); Draw.color(Palette.accent);
Lines.stroke((1f - request.progress)); Lines.square(
request.x * tilesize + request.recipe.result.offset(),
Lines.poly(request.x * tilesize + request.recipe.result.offset(),
request.y * tilesize + request.recipe.result.offset(), request.y * tilesize + request.recipe.result.offset(),
4, request.recipe.result.size * tilesize / 2f, 45 + 15); rad);
} }
} }
@@ -461,6 +482,10 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
setDead(true); setDead(true);
} }
if(netServer.isWaitingForPlayers()){
setDead(true);
}
if(isDead()){ if(isDead()){
isBoosting = false; isBoosting = false;
boostHeat = 0f; boostHeat = 0f;
@@ -487,7 +512,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
} }
Effects.effect(UnitFx.unitLand, tile.floor().minimapColor, x, y, tile.floor().isLiquid ? 1f : 0.5f); Effects.effect(UnitFx.unitLand, tile.floor().minimapColor, x, y, tile.floor().isLiquid ? 1f : 0.5f);
} }
mech.onLand(this); if(!mech.flying) mech.onLand(this);
achievedFlight = false; achievedFlight = false;
} }
@@ -757,7 +782,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
((SpawnerTrait) world.tile(spawner).entity).updateSpawning(this); ((SpawnerTrait) world.tile(spawner).entity).updateSpawning(this);
}else{ }else{
CoreEntity entity = (CoreEntity) getClosestCore(); CoreEntity entity = (CoreEntity) getClosestCore();
if(entity != null){ if(entity != null && !netServer.isWaitingForPlayers()){
this.spawner = entity.tile.id(); this.spawner = entity.tile.id();
} }
} }
@@ -768,6 +793,10 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
this.dead = true; this.dead = true;
} }
public void endRespawning(){
spawner = -1;
}
//endregion //endregion
//region read and write methods //region read and write methods
@@ -834,7 +863,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
color.set(buffer.readInt()); color.set(buffer.readInt());
mech = content.getByID(ContentType.mech, buffer.readByte()); mech = content.getByID(ContentType.mech, buffer.readByte());
int mine = buffer.readInt(); int mine = buffer.readInt();
spawner = buffer.readInt(); int spawner = buffer.readInt();
float baseRotation = buffer.readShort() / 2f; float baseRotation = buffer.readShort() / 2f;
readBuilding(buffer, !isLocal); readBuilding(buffer, !isLocal);
@@ -848,6 +877,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
}else{ }else{
mining = world.tile(mine); mining = world.tile(mine);
isBoosting = boosting; isBoosting = boosting;
this.spawner = spawner;
} }
} }

View File

@@ -198,6 +198,11 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
return tile == null ? (Floor) Blocks.air : tile.floor(); return tile == null ? (Floor) Blocks.air : tile.floor();
} }
@Override
public boolean isValid(){
return !isDead() && isAdded();
}
/**Updates velocity and status effects.*/ /**Updates velocity and status effects.*/
public void updateVelocityStatus(){ public void updateVelocityStatus(){
Floor floor = getFloorOn(); Floor floor = getFloorOn();

View File

@@ -143,7 +143,7 @@ public class Units{
/**Returns the closest target enemy. First, units are checked, then tile entities.*/ /**Returns the closest target enemy. First, units are checked, then tile entities.*/
public static TargetTrait getClosestTarget(Team team, float x, float y, float range){ public static TargetTrait getClosestTarget(Team team, float x, float y, float range){
return getClosestTarget(team, x, y, range, u -> true); return getClosestTarget(team, x, y, range, u -> !u.isDead() && u.isAdded());
} }
/**Returns the closest target enemy. First, units are checked, then tile entities.*/ /**Returns the closest target enemy. First, units are checked, then tile entities.*/

View File

@@ -210,7 +210,9 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
tile = tile.target(); tile = tile.target();
if(tile.entity != null && tile.entity.collide(this) && !tile.entity.isDead() && (type.collidesTeam || tile.getTeam() != team)){ if(tile.entity != null && tile.entity.collide(this) && !tile.entity.isDead() && (type.collidesTeam || tile.getTeam() != team)){
if(tile.getTeam() != team){
tile.entity.collision(this); tile.entity.collision(this);
}
if(!supressCollision){ if(!supressCollision){
type.hitTile(this, tile); type.hitTile(this, tile);

View File

@@ -49,7 +49,7 @@ public class ItemTransfer extends TimedEntity implements DrawTrait{
@Remote(called = Loc.server) @Remote(called = Loc.server)
public static void transferItemTo(Item item, int amount, float x, float y, Tile tile){ public static void transferItemTo(Item item, int amount, float x, float y, Tile tile){
if(tile == null) return; if(tile == null || tile.entity == null || tile.entity.items == null) return;
for(int i = 0; i < Mathf.clamp(amount / 3, 1, 8); i++){ for(int i = 0; i < Mathf.clamp(amount / 3, 1, 8); i++){
Timers.run(i * 3, () -> create(item, x, y, tile, () -> { Timers.run(i * 3, () -> create(item, x, y, tile, () -> {
})); }));

View File

@@ -14,7 +14,7 @@ public interface TypeTrait{
*/ */
static <T extends TypeTrait> void registerType(Class<T> type, Supplier<T> supplier){ static <T extends TypeTrait> void registerType(Class<T> type, Supplier<T> supplier){
if(typeToID.get(type, -1) != -1){ if(typeToID.get(type, -1) != -1){
throw new RuntimeException("Type is already registered: '" + type + "'!"); return; //already registered
} }
registeredTypes.add(supplier); registeredTypes.add(supplier);

View File

@@ -4,6 +4,7 @@ import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.ObjectMap.Entry; import com.badlogic.gdx.utils.ObjectMap.Entry;
import com.badlogic.gdx.utils.ObjectSet; import com.badlogic.gdx.utils.ObjectSet;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.ContentType;
import io.anuke.ucore.core.Settings; import io.anuke.ucore.core.Settings;
@@ -46,7 +47,7 @@ public class Unlocks{
//client connected to server: always return the IP-specific set //client connected to server: always return the IP-specific set
if(Net.client()){ if(Net.client()){
return getSet(Net.getLastIP()); return getSet(Net.getLastIP());
}else if(world.getSector() != null || state.mode.infiniteResources){ //sector-sandbox have shared set }else if((world.getSector() != null || state.mode.infiniteResources) || state.is(State.menu)){ //sector-sandbox have shared set
return rootSet(); return rootSet();
}else{ //per-mode set }else{ //per-mode set
return getSet(state.mode.name()); return getSet(state.mode.name());

View File

@@ -60,8 +60,10 @@ public class Palette{
bar = Color.SLATE, bar = Color.SLATE,
interact = Color.ORANGE, interact = Color.ORANGE,
accent = Color.valueOf("f4ba6e"), accent = Color.valueOf("f4ba6e"),
accentBack = new Color(accent.r * 0.8f, accent.g * 0.8f, accent.b * 0.8f, 1f),
place = Color.valueOf("6335f8"), place = Color.valueOf("6335f8"),
remove = Color.valueOf("e55454"), remove = Color.valueOf("e55454"),
removeBack = Color.valueOf("a73e3e"),
placeRotate = accent, placeRotate = accent,
breakInvalid = Color.valueOf("d44b3d"), breakInvalid = Color.valueOf("d44b3d"),
range = Color.valueOf("f4ba6e"), range = Color.valueOf("f4ba6e"),

View File

@@ -20,7 +20,7 @@ public class DefaultKeybinds{
"move_x", new Axis(Input.A, Input.D), "move_x", new Axis(Input.A, Input.D),
"move_y", new Axis(Input.S, Input.W), "move_y", new Axis(Input.S, Input.W),
"select", Input.MOUSE_LEFT, "select", Input.MOUSE_LEFT,
"deselect", Input.SPACE, "deselect", Input.MOUSE_RIGHT,
"break", Input.MOUSE_RIGHT, "break", Input.MOUSE_RIGHT,
"rotate", new Axis(Input.SCROLL), "rotate", new Axis(Input.SCROLL),
"dash", Input.SHIFT_LEFT, "dash", Input.SHIFT_LEFT,

View File

@@ -57,6 +57,8 @@ public class DesktopInput extends InputHandler{
region.getRegionWidth() * selectScale, region.getRegionHeight() * selectScale, block.rotate ? rotation * 90 : 0); region.getRegionWidth() * selectScale, region.getRegionHeight() * selectScale, block.rotate ? rotation * 90 : 0);
} }
}else{ }else{
Draw.color(Palette.removeBack);
Lines.square(x * tilesize + block.offset(), y * tilesize + block.offset() - 1, block.size * tilesize / 2f);
Draw.color(Palette.remove); Draw.color(Palette.remove);
Lines.square(x * tilesize + block.offset(), y * tilesize + block.offset(), block.size * tilesize / 2f); Lines.square(x * tilesize + block.offset(), y * tilesize + block.offset(), block.size * tilesize / 2f);
} }
@@ -94,18 +96,22 @@ public class DesktopInput extends InputHandler{
NormalizeDrawResult result = PlaceUtils.normalizeDrawArea(Blocks.air, selectX, selectY, cursorX, cursorY, false, maxLength, 1f); NormalizeDrawResult result = PlaceUtils.normalizeDrawArea(Blocks.air, selectX, selectY, cursorX, cursorY, false, maxLength, 1f);
NormalizeResult dresult = PlaceUtils.normalizeArea(selectX, selectY, cursorX, cursorY, rotation, false, maxLength); NormalizeResult dresult = PlaceUtils.normalizeArea(selectX, selectY, cursorX, cursorY, rotation, false, maxLength);
Draw.color(Palette.remove);
for(int x = dresult.x; x <= dresult.x2; x++){ for(int x = dresult.x; x <= dresult.x2; x++){
for(int y = dresult.y; y <= dresult.y2; y++){ for(int y = dresult.y; y <= dresult.y2; y++){
Tile tile = world.tile(x, y); Tile tile = world.tile(x, y);
if(tile == null || !validBreak(tile.x, tile.y)) continue; if(tile == null || !validBreak(tile.x, tile.y)) continue;
tile = tile.target(); tile = tile.target();
Lines.poly(tile.drawx(), tile.drawy(), 4, tile.block().size * tilesize / 2f, 45 + 15); Draw.color(Palette.removeBack);
Lines.square(tile.drawx(), tile.drawy()-1, tile.block().size * tilesize / 2f - 1);
Draw.color(Palette.remove);
Lines.square(tile.drawx(), tile.drawy(), tile.block().size * tilesize / 2f - 1);
} }
} }
Draw.color(Palette.removeBack);
Lines.rect(result.x, result.y - 1, result.x2 - result.x, result.y2 - result.y);
Draw.color(Palette.remove);
Lines.rect(result.x, result.y, result.x2 - result.x, result.y2 - result.y); Lines.rect(result.x, result.y, result.x2 - result.x, result.y2 - result.y);
}else if(isPlacing()){ }else if(isPlacing()){
if(recipe.result.rotate){ if(recipe.result.rotate){
@@ -145,11 +151,13 @@ public class DesktopInput extends InputHandler{
pollInput(); pollInput();
//removed for now, will add back if necessary
/*
if(recipe != null && !Settings.getBool("desktop-place-help-2", false)){ if(recipe != null && !Settings.getBool("desktop-place-help-2", false)){
ui.showInfo("$text.construction.desktop"); ui.showInfo("$text.construction.desktop");
Settings.putBool("desktop-place-help-2", true); Settings.putBool("desktop-place-help-2", true);
Settings.save(); Settings.save();
} }*/
//deselect if not placing //deselect if not placing
if(!isPlacing() && mode == placing){ if(!isPlacing() && mode == placing){
@@ -221,7 +229,8 @@ public class DesktopInput extends InputHandler{
}else{ //if it's out of bounds, shooting is just fine }else{ //if it's out of bounds, shooting is just fine
player.isShooting = true; player.isShooting = true;
} }
}else if(Inputs.keyTap(section, "deselect") && (recipe != null || mode != none || player.isBuilding())){ }else if(Inputs.keyTap(section, "deselect") && (recipe != null || mode != none || player.isBuilding()) &&
!(player.getCurrentRequest() != null && player.getCurrentRequest().remove && KeyBinds.get(section, "deselect") == KeyBinds.get(section, "break"))){
if(recipe == null){ if(recipe == null){
player.clearBuilding(); player.clearBuilding();
} }

View File

@@ -8,7 +8,6 @@ import io.anuke.annotations.Annotations.Loc;
import io.anuke.annotations.Annotations.Remote; import io.anuke.annotations.Annotations.Remote;
import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.fx.EnvironmentFx; import io.anuke.mindustry.content.fx.EnvironmentFx;
import io.anuke.mindustry.core.World;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.Units;
import io.anuke.mindustry.entities.effect.ItemTransfer; import io.anuke.mindustry.entities.effect.ItemTransfer;
@@ -227,6 +226,12 @@ public abstract class InputHandler extends InputAdapter{
frag.consume.hide(); frag.consume.hide();
} }
if(!consumed && player.isBuilding()){
player.clearBuilding();
recipe = null;
return true;
}
return consumed; return consumed;
} }

View File

@@ -85,7 +85,7 @@ public class MobileInput extends InputHandler implements GestureListener{
/** Check and assign targets for a specific position. */ /** Check and assign targets for a specific position. */
void checkTargets(float x, float y){ void checkTargets(float x, float y){
synchronized(Entities.entityLock){ synchronized(Entities.entityLock){
Unit unit = Units.getClosestEnemy(player.getTeam(), x, y, 20f, u -> true); Unit unit = Units.getClosestEnemy(player.getTeam(), x, y, 20f, u -> !u.isDead() && u.isAdded());
if(unit != null){ if(unit != null){
threads.run(() -> player.target = unit); threads.run(() -> player.target = unit);
@@ -178,9 +178,13 @@ public class MobileInput extends InputHandler implements GestureListener{
request.recipe.result.rotate ? request.rotation * 90 : 0); request.recipe.result.rotate ? request.rotation * 90 : 0);
} }
}else{ }else{
Draw.color(Palette.remove); float rad = (tile.block().size * tilesize / 2f - 1) * request.scale;
Draw.alpha(0f);
//draw removing request //draw removing request
Lines.poly(tile.drawx(), tile.drawy(), 4, tile.block().size * tilesize / 2f * request.scale, 45 + 15); Draw.tint(Palette.removeBack);
Lines.square(tile.drawx(), tile.drawy()-1, rad);
Draw.tint(Palette.remove);
Lines.square(tile.drawx(), tile.drawy(), rad);
} }
} }
@@ -240,7 +244,7 @@ public class MobileInput extends InputHandler implements GestureListener{
} }
} }
//move all current requests to removal array to they fade out //move all current requests to removal array so they fade out
removals.addAll(selection); removals.addAll(selection);
selection.clear(); selection.clear();
selecting = false; selecting = false;
@@ -364,7 +368,9 @@ public class MobileInput extends InputHandler implements GestureListener{
region.getRegionWidth() * lineScale, region.getRegionHeight() * lineScale, recipe.result.rotate ? result.rotation * 90 : 0); region.getRegionWidth() * lineScale, region.getRegionHeight() * lineScale, recipe.result.rotate ? result.rotation * 90 : 0);
} }
}else{ }else{
Draw.color(Palette.breakInvalid); Draw.color(Palette.removeBack);
Lines.square(x * tilesize + recipe.result.offset(), y * tilesize + recipe.result.offset() - 1, recipe.result.size * tilesize / 2f);
Draw.color(Palette.remove);
Lines.square(x * tilesize + recipe.result.offset(), y * tilesize + recipe.result.offset(), recipe.result.size * tilesize / 2f); Lines.square(x * tilesize + recipe.result.offset(), y * tilesize + recipe.result.offset(), recipe.result.size * tilesize / 2f);
} }
} }
@@ -374,21 +380,22 @@ public class MobileInput extends InputHandler implements GestureListener{
NormalizeDrawResult result = PlaceUtils.normalizeDrawArea(Blocks.air, lineStartX, lineStartY, tileX, tileY, false, maxLength, 1f); NormalizeDrawResult result = PlaceUtils.normalizeDrawArea(Blocks.air, lineStartX, lineStartY, tileX, tileY, false, maxLength, 1f);
NormalizeResult dresult = PlaceUtils.normalizeArea(lineStartX, lineStartY, tileX, tileY, rotation, false, maxLength); NormalizeResult dresult = PlaceUtils.normalizeArea(lineStartX, lineStartY, tileX, tileY, rotation, false, maxLength);
Draw.color(Palette.remove);
Draw.alpha(0.6f);
Draw.alpha(1f);
for(int x = dresult.x; x <= dresult.x2; x++){ for(int x = dresult.x; x <= dresult.x2; x++){
for(int y = dresult.y; y <= dresult.y2; y++){ for(int y = dresult.y; y <= dresult.y2; y++){
Tile other = world.tile(x, y); Tile other = world.tile(x, y);
if(other == null || !validBreak(other.x, other.y)) continue; if(other == null || !validBreak(other.x, other.y)) continue;
other = other.target(); other = other.target();
Lines.poly(other.drawx(), other.drawy(), 4, other.block().size * tilesize / 2f, 45 + 15); Draw.color(Palette.removeBack);
Lines.square(other.drawx(), other.drawy()-1, other.block().size * tilesize / 2f - 1);
Draw.color(Palette.remove);
Lines.square(other.drawx(), other.drawy(), other.block().size * tilesize / 2f - 1);
} }
} }
Draw.color(Palette.removeBack);
Lines.rect(result.x, result.y - 1, result.x2 - result.x, result.y2 - result.y);
Draw.color(Palette.remove);
Lines.rect(result.x, result.y, result.x2 - result.x, result.y2 - result.y); Lines.rect(result.x, result.y, result.x2 - result.x, result.y2 - result.y);
} }
@@ -560,7 +567,7 @@ public class MobileInput extends InputHandler implements GestureListener{
//add to selection queue if it's a valid BREAK position //add to selection queue if it's a valid BREAK position
cursor = cursor.target(); cursor = cursor.target();
selection.add(new PlaceRequest(cursor.worldx(), cursor.worldy())); selection.add(new PlaceRequest(cursor.worldx(), cursor.worldy()));
}else if(!canTapPlayer(worldx, worldy)){ }else if(!canTapPlayer(worldx, worldy) && player.mech.flying){
boolean consumed = false; boolean consumed = false;
//else, try and carry units //else, try and carry units
if(player.getCarry() != null){ if(player.getCarry() != null){

View File

@@ -78,7 +78,7 @@ public class MapIO{
for(int x = 0; x < data.width(); x++){ for(int x = 0; x < data.width(); x++){
for(int y = 0; y < data.height(); y++){ for(int y = 0; y < data.height(); y++){
int color = pixmap.getPixel(y, pixmap.getWidth() - 1 - x); int color = pixmap.getPixel(x, pixmap.getHeight() - 1 - y);
LegacyBlock block = LegacyColorMapper.get(color); LegacyBlock block = LegacyColorMapper.get(color);
data.write(x, y, DataPosition.floor, block.floor.id); data.write(x, y, DataPosition.floor, block.floor.id);

View File

@@ -1,7 +1,11 @@
package io.anuke.mindustry.maps; package io.anuke.mindustry.maps;
import com.badlogic.gdx.utils.IntIntMap; import com.badlogic.gdx.utils.IntIntMap;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.world.Block;
import io.anuke.ucore.util.Bits; import io.anuke.ucore.util.Bits;
import io.anuke.ucore.util.Structs;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
@@ -38,12 +42,44 @@ public class MapTileData{
this.readOnly = readOnly; this.readOnly = readOnly;
if(mapping != null && !readOnly){ if(mapping != null && !readOnly){
for(int i = 0; i < width * height; i++){ buffer.position(0);
TileDataMarker marker = new TileDataMarker(); TileDataMarker marker = new TileDataMarker();
for(int i = 0; i < width * height; i++){
read(marker); read(marker);
//strip blockparts from map data, as they can be invalid
if(marker.wall == Blocks.blockpart.id){
marker.wall = Blocks.air.id;
}
buffer.position(i * TILE_SIZE); buffer.position(i * TILE_SIZE);
//write mapped marker
write(marker); write(marker);
} }
buffer.position(0);
for(int x = 0; x < width; x ++){
for(int y = 0; y < height; y ++){
//add missing blockparts
Block drawBlock = Vars.content.block(read(x, y, DataPosition.wall));
if(drawBlock.isMultiblock()){
int offsetx = -(drawBlock.size - 1) / 2;
int offsety = -(drawBlock.size - 1) / 2;
for(int dx = 0; dx < drawBlock.size; dx++){
for(int dy = 0; dy < drawBlock.size; dy++){
int worldx = dx + offsetx + x;
int worldy = dy + offsety + y;
if(Structs.inBounds(worldx, worldy, width, height) && !(dx + offsetx == 0 && dy + offsety == 0)){
write(worldx, worldy, DataPosition.wall, Blocks.blockpart.id);
write(worldx, worldy, DataPosition.link, Bits.packByte((byte) (dx + offsetx + 8), (byte) (dy + offsety + 8)));
}
}
}
}
}
}
buffer.position(0); buffer.position(0);
this.map = null; this.map = null;
} }
@@ -122,8 +158,8 @@ public class MapTileData{
team = Bits.getRightByte(rt); team = Bits.getRightByte(rt);
if(map != null){ if(map != null){
floor = (byte) map.get(floor, floor); floor = (byte) map.get(floor, Blocks.stone.id);
wall = (byte) map.get(wall, wall); wall = (byte) map.get(wall, 0);
} }
} }

View File

@@ -57,7 +57,7 @@ public class Maps implements Disposable{
/**Returns map by internal name.*/ /**Returns map by internal name.*/
public Map getByName(String name){ public Map getByName(String name){
return maps.get(name); return maps.get(name.toLowerCase());
} }
/**Load all maps. Should be called at application start.*/ /**Load all maps. Should be called at application start.*/
@@ -81,6 +81,7 @@ public class Maps implements Disposable{
ObjectMap<String, String> newTags = new ObjectMap<>(); ObjectMap<String, String> newTags = new ObjectMap<>();
newTags.putAll(tags); newTags.putAll(tags);
tags = newTags; tags = newTags;
if (!gwt) { if (!gwt) {
FileHandle file = customMapDirectory.child(name + "." + mapExtension); FileHandle file = customMapDirectory.child(name + "." + mapExtension);
MapIO.writeMap(file.write(false), tags, data); MapIO.writeMap(file.write(false), tags, data);
@@ -144,7 +145,7 @@ public class Maps implements Disposable{
map.texture = new Texture(MapIO.generatePixmap(MapIO.readTileData(ds, meta, true))); map.texture = new Texture(MapIO.generatePixmap(MapIO.readTileData(ds, meta, true)));
} }
maps.put(map.name, map); maps.put(map.name.toLowerCase(), map);
allMaps.add(map); allMaps.add(map);
} }
} }

View File

@@ -26,7 +26,7 @@ public class SectorPresets{
//base tutorial mission //base tutorial mission
add(new SectorPreset(0, 0, add(new SectorPreset(0, 0,
TutorialSector.getMissions(), TutorialSector.getMissions(),
Array.with(), Array.with(Items.copper, Items.coal, Items.lead),
1)); 1));
//command center mission //command center mission
@@ -63,10 +63,6 @@ public class SectorPresets{
), ),
Array.with(Items.copper, Items.lead, Items.coal, Items.titanium), Array.with(Items.copper, Items.lead, Items.coal, Items.titanium),
2)); 2));
//tutorial ore presets
orePresets.put(0, 0, Array.with(Items.copper));
orePresets.put(1, 0, Array.with(Items.copper, Items.lead, Items.coal));
} }
public Array<Item> getOres(int x, int y){ public Array<Item> getOres(int x, int y){

View File

@@ -53,14 +53,14 @@ public class Sectors{
} }
world.sectors.save(); world.sectors.save();
world.setSector(sector); world.setSector(sector);
sector.currentMission().onBegin(); if(!sector.complete) sector.currentMission().onBegin();
}else if(SaveIO.breakingVersions.contains(sector.getSave().getBuild())){ }else if(SaveIO.breakingVersions.contains(sector.getSave().getBuild())){
ui.showInfo("$text.save.old"); ui.showInfo("$text.save.old");
}else try{ }else try{
sector.getSave().load(); sector.getSave().load();
world.setSector(sector); world.setSector(sector);
state.set(State.playing); state.set(State.playing);
sector.currentMission().onBegin(); if(!sector.complete) sector.currentMission().onBegin();
}catch(Exception e){ }catch(Exception e){
Log.err(e); Log.err(e);
sector.getSave().delete(); sector.getSave().delete();
@@ -270,6 +270,7 @@ public class Sectors{
sector.getSave().delete(); sector.getSave().delete();
} }
sector.completedMissions = 0; sector.completedMissions = 0;
sector.complete = false;
initSector(sector); initSector(sector);
for(int x = sector.x; x < sector.width + sector.x; x++){ for(int x = sector.x; x < sector.width + sector.x; x++){

View File

@@ -4,16 +4,9 @@ import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.UnitTypes; import io.anuke.mindustry.content.UnitTypes;
import io.anuke.mindustry.content.blocks.*; import io.anuke.mindustry.content.blocks.*;
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
import io.anuke.mindustry.maps.generation.Generation; import io.anuke.mindustry.maps.generation.Generation;
import io.anuke.mindustry.maps.generation.WorldGenerator.GenResult;
import io.anuke.mindustry.maps.missions.*; import io.anuke.mindustry.maps.missions.*;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.Floor;
import io.anuke.ucore.core.Events;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.util.Bundles; import io.anuke.ucore.util.Bundles;
import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.Vars.*;
@@ -41,30 +34,6 @@ public class TutorialSector{
new WaveMission(2).setMessage("$tutorial.waves"), new WaveMission(2).setMessage("$tutorial.waves"),
new ActionMission(() ->
Timers.runTask(30f, () -> {
Runnable r = () -> {
Array<Item> ores = Array.with(Items.copper, Items.coal, Items.lead);
GenResult res = new GenResult();
for(int x = 0; x < world.width(); x++){
for(int y = 0; y < world.height(); y++){
Tile tile = world.tile(x, y);
world.generator.generateTile(res, 0, 0, x, y, true, null, ores);
if(!tile.hasCliffs()){
tile.setFloor((Floor) res.floor);
}
}
}
Events.fire(new WorldLoadEvent());
};
if(!headless){
ui.loadLogic(r);
}else{
threads.run(r);
}
})),
new ItemMission(Items.lead, 150).setMessage("$tutorial.lead"), new ItemMission(Items.lead, 150).setMessage("$tutorial.lead"),
new ItemMission(Items.copper, 250).setMessage("$tutorial.morecopper"), new ItemMission(Items.copper, 250).setMessage("$tutorial.morecopper"),
@@ -130,7 +99,7 @@ public class TutorialSector{
}, },
new BattleMission(){ new BattleMission(){
public void generate(Generation gen){} //no public void generate(Generation gen){} //no
public void onBegin(){} //also no public void onFirstBegin(){} //also no
}.setMessage("$tutorial.battle") }.setMessage("$tutorial.battle")
); );

View File

@@ -141,6 +141,7 @@ public class WorldGenerator{
public void playRandomMap(){ public void playRandomMap(){
ui.loadLogic(() -> { ui.loadLogic(() -> {
world.setSector(null);
logic.reset(); logic.reset();
int sx = (short)Mathf.range(Short.MAX_VALUE/2); int sx = (short)Mathf.range(Short.MAX_VALUE/2);

View File

@@ -25,7 +25,7 @@ public class BattleMission extends Mission{
} }
@Override @Override
public void onBegin(){ public void onFirstBegin(){
if(state.teams.get(defaultTeam).cores.size == 0){ if(state.teams.get(defaultTeam).cores.size == 0){
return; return;
} }

View File

@@ -35,7 +35,7 @@ public class BlockLocMission extends Mission{
public void drawOverlay(){ public void drawOverlay(){
Lines.stroke(2f); Lines.stroke(2f);
Draw.color(Palette.accent.r * 0.8f,Palette.accent.g * 0.8f,Palette.accent.b * 0.8f); Draw.color(Palette.accentBack);
Lines.square(x * tilesize + block.offset(), y * tilesize + block.offset() - 1f, block.size * tilesize/2f + 1f+ Mathf.absin(Timers.time(), 6f, 2f)); Lines.square(x * tilesize + block.offset(), y * tilesize + block.offset() - 1f, block.size * tilesize/2f + 1f+ Mathf.absin(Timers.time(), 6f, 2f));
Draw.color(Palette.accent); Draw.color(Palette.accent);

View File

@@ -25,7 +25,7 @@ public class ExpandMission extends ActionMission{
} }
@Override @Override
public void onBegin(){ public void onFirstBegin(){
runner.run(); runner.run();
} }

View File

@@ -62,6 +62,10 @@ public abstract class Mission{
} }
public void onFirstBegin(){
}
/**Shows the unique sector message.*/ /**Shows the unique sector message.*/
public void showMessage(){ public void showMessage(){
if(!headless && extraMessage != null){ if(!headless && extraMessage != null){

View File

@@ -244,7 +244,7 @@ public class Net{
} }
}else if(!((object instanceof Packet) && ((Packet) object).isUnimportant())){ }else if(!((object instanceof Packet) && ((Packet) object).isUnimportant())){
packetQueue.add(object); packetQueue.add(object);
Log.info("Queuing packet {0}.", object); Log.info("Queuing packet {0}", object);
}else{ }else{
synchronized(packetPoolLock){ synchronized(packetPoolLock){
Pooling.free(object); Pooling.free(object);

View File

@@ -11,8 +11,6 @@ import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.scene.ui.layout.Table; import io.anuke.ucore.scene.ui.layout.Table;
import io.anuke.ucore.util.Bundles; import io.anuke.ucore.util.Bundles;
import static io.anuke.mindustry.Vars.mobile;
//TODO merge unit type with mech //TODO merge unit type with mech
public class Mech extends UnlockableContent{ public class Mech extends UnlockableContent{
public final String name; public final String name;
@@ -73,11 +71,6 @@ public class Mech extends UnlockableContent{
public void onLand(Player player){} public void onLand(Player player){}
@Override
public boolean isHidden() {
return !flying && mobile;
}
@Override @Override
public void displayInfo(Table table){ public void displayInfo(Table table){
ContentDisplay.displayMech(table, this); ContentDisplay.displayMech(table, this);

View File

@@ -32,7 +32,6 @@ public class LanguageDialog extends FloatingDialog{
for(Locale loc : locales){ for(Locale loc : locales){
TextButton button = new TextButton(Platform.instance.getLocaleName(loc), "toggle"); TextButton button = new TextButton(Platform.instance.getLocaleName(loc), "toggle");
button.setChecked(getLocale().equals(loc));
button.clicked(() -> { button.clicked(() -> {
if(getLocale().equals(loc)) return; if(getLocale().equals(loc)) return;
Settings.putString("locale", loc.toString()); Settings.putString("locale", loc.toString());
@@ -40,9 +39,7 @@ public class LanguageDialog extends FloatingDialog{
Log.info("Setting locale: {0}", loc.toString()); Log.info("Setting locale: {0}", loc.toString());
ui.showInfo("$text.language.restart"); ui.showInfo("$text.language.restart");
}); });
langs.add(button).group(group).update(t -> { langs.add(button).group(group).update(t -> t.setChecked(loc.equals(getLocale()))).size(400f, 60f).row();
t.setChecked(loc.equals(getLocale()));
}).size(400f, 60f).row();
} }
content().add(pane); content().add(pane);
@@ -50,9 +47,11 @@ public class LanguageDialog extends FloatingDialog{
public Locale getLocale(){ public Locale getLocale(){
String loc = Settings.getString("locale"); String loc = Settings.getString("locale");
if(loc.equals("default")){ if(loc.equals("default")){
return Locale.getDefault(); findClosestLocale();
}else{ }
if(lastLocale == null || !lastLocale.toString().equals(loc)){ if(lastLocale == null || !lastLocale.toString().equals(loc)){
if(loc.contains("_")){ if(loc.contains("_")){
String[] split = loc.split("_"); String[] split = loc.split("_");
@@ -64,5 +63,24 @@ public class LanguageDialog extends FloatingDialog{
return lastLocale; return lastLocale;
} }
void findClosestLocale(){
//check exact locale
for(Locale l : locales){
if(l.equals(Locale.getDefault())){
Settings.putString("locale", l.toString());
return;
}
}
//find by language
for(Locale l : locales){
if(l.getLanguage().equals(Locale.getDefault().getLanguage())){
Settings.putString("locale", l.toString());
return;
}
}
Settings.putString("locale", new Locale("en").toString());
} }
} }

View File

@@ -9,7 +9,6 @@ import io.anuke.ucore.core.Graphics;
import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Lines; import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.scene.Element; import io.anuke.ucore.scene.Element;
import io.anuke.ucore.scene.event.ClickListener;
import io.anuke.ucore.scene.event.InputEvent; import io.anuke.ucore.scene.event.InputEvent;
import io.anuke.ucore.scene.event.InputListener; import io.anuke.ucore.scene.event.InputListener;
import io.anuke.ucore.scene.ui.layout.Unit; import io.anuke.ucore.scene.ui.layout.Unit;
@@ -18,7 +17,8 @@ import io.anuke.ucore.scene.utils.ScissorStack;
import io.anuke.ucore.util.Bundles; import io.anuke.ucore.util.Bundles;
import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.Vars.ui;
import static io.anuke.mindustry.Vars.world;
public class SectorsDialog extends FloatingDialog{ public class SectorsDialog extends FloatingDialog{
private Rectangle clip = new Rectangle(); private Rectangle clip = new Rectangle();
@@ -42,7 +42,7 @@ public class SectorsDialog extends FloatingDialog{
+ (selected.saveID == -1 ? " " + Bundles.get("text.sector.unexplored") : + (selected.saveID == -1 ? " " + Bundles.get("text.sector.unexplored") :
(selected.hasSave() ? " [accent]/[white] " + Bundles.format("text.sector.time", selected.getSave().getPlayTime()) : "")))); (selected.hasSave() ? " [accent]/[white] " + Bundles.format("text.sector.time", selected.getSave().getPlayTime()) : ""))));
content().row(); content().row();
content().label(() -> Bundles.format("text.mission", selected == null || selected.completedMissions >= selected.missions.size content().label(() -> Bundles.format("text.mission.main", selected == null || selected.completedMissions >= selected.missions.size
? Bundles.get("text.none") : selected.getDominantMission().menuDisplayString())); ? Bundles.get("text.none") : selected.getDominantMission().menuDisplayString()));
content().row(); content().row();
content().add(new SectorView()).grow(); content().add(new SectorView()).grow();
@@ -59,10 +59,6 @@ public class SectorsDialog extends FloatingDialog{
ui.loadLogic(() -> world.sectors.playSector(selected)); ui.loadLogic(() -> world.sectors.playSector(selected));
}).disabled(b -> selected == null) }).disabled(b -> selected == null)
.fillX().height(64f).colspan(2).update(t -> t.setText(selected != null && selected.hasSave() ? "$text.sector.resume" : "$text.sector.deploy")); .fillX().height(64f).colspan(2).update(t -> t.setText(selected != null && selected.hasSave() ? "$text.sector.resume" : "$text.sector.deploy"));
} }
void selectSector(Sector sector){ void selectSector(Sector sector){
@@ -108,12 +104,7 @@ public class SectorsDialog extends FloatingDialog{
} }
}); });
addListener(new ClickListener(){ clicked(() -> clicked = true);
@Override
public void clicked(InputEvent event, float x, float y){
clicked = true;
}
});
} }
@Override @Override

View File

@@ -160,7 +160,7 @@ public class SettingsMenuDialog extends SettingsDialog{
dialog.content().row(); dialog.content().row();
dialog.content().addButton("$text.settings.clearunlocks", "clear", () -> { dialog.content().addButton("$text.settings.clearunlocks", "clear", () -> {
ui.showConfirm("$text.confirm", "$text.settings.clear.confirm", () -> { ui.showConfirm("$text.confirm", "$text.settings.clear.confirm", () -> {
Settings.clearBytes("unlocks"); control.unlocks.reset();
Settings.save(); Settings.save();
dialog.hide(); dialog.hide();
}); });

View File

@@ -16,7 +16,7 @@ public class TraceDialog extends FloatingDialog{
public void show(Player player, TraceInfo info){ public void show(Player player, TraceInfo info){
content().clear(); content().clear();
Table table = new Table("button"); Table table = new Table("clear");
table.margin(14); table.margin(14);
table.defaults().pad(1); table.defaults().pad(1);
@@ -35,6 +35,8 @@ public class TraceDialog extends FloatingDialog{
table.add().pad(5); table.add().pad(5);
table.row(); table.row();
//disabled until further notice
/*
table.add(Bundles.format("text.trace.totalblocksbroken", info.totalBlocksBroken)); table.add(Bundles.format("text.trace.totalblocksbroken", info.totalBlocksBroken));
table.row(); table.row();
table.add(Bundles.format("text.trace.structureblocksbroken", info.structureBlocksBroken)); table.add(Bundles.format("text.trace.structureblocksbroken", info.structureBlocksBroken));
@@ -48,7 +50,7 @@ public class TraceDialog extends FloatingDialog{
table.add(Bundles.format("text.trace.totalblocksplaced", info.totalBlocksPlaced)); table.add(Bundles.format("text.trace.totalblocksplaced", info.totalBlocksPlaced));
table.row(); table.row();
table.add(Bundles.format("text.trace.lastblockplaced", info.lastBlockPlaced.formalName)); table.add(Bundles.format("text.trace.lastblockplaced", info.lastBlockPlaced.formalName));
table.row(); table.row();*/
content().add(table); content().add(table);

View File

@@ -56,10 +56,8 @@ public class ChatFragment extends Table{
setFillParent(true); setFillParent(true);
font = Core.skin.getFont("default-font"); font = Core.skin.getFont("default-font");
visible(() -> !state.is(State.menu) && Net.active()); visible(() -> {
if(!Net.active() && messages.size > 0){
update(() -> {
if(!Net.active()){
clearMessages(); clearMessages();
if(chatOpen){ if(chatOpen){
@@ -67,6 +65,10 @@ public class ChatFragment extends Table{
} }
} }
return !state.is(State.menu) && Net.active();
});
update(() -> {
if(Net.active() && Inputs.keyTap("chat")){ if(Net.active() && Inputs.keyTap("chat")){
toggle(); toggle();

View File

@@ -142,7 +142,7 @@ public class HudFragment extends Fragment{
//paused table //paused table
parent.fill(t -> { parent.fill(t -> {
t.top().visible(() -> state.is(State.paused) && !Net.active()); t.top().visible(() -> state.is(State.paused) && !Net.active());
t.table("clear", top -> top.add("[orange]< " + Bundles.get("text.paused") + " >").pad(6).get().setFontScale(fontScale * 1.5f)); t.table("clear", top -> top.add("$text.paused").pad(6).get().setFontScale(fontScale * 1.5f));
}); });
parent.fill(t -> { parent.fill(t -> {
@@ -380,7 +380,7 @@ public class HudFragment extends Fragment{
}); });
table.setDisabled(() -> !(world.getSector() != null && world.getSector().currentMission().hasMessage())); table.setDisabled(() -> !(world.getSector() != null && world.getSector().currentMission().hasMessage()));
table.visible(() -> !((world.getSector() == null && state.mode.disableWaves) || !state.mode.showMission)); table.visible(() -> !((world.getSector() == null && state.mode.disableWaves) || !state.mode.showMission || (world.getSector() != null && world.getSector().complete)));
} }
private void addPlayButton(Table table){ private void addPlayButton(Table table){

View File

@@ -1,5 +1,6 @@
package io.anuke.mindustry.ui.fragments; package io.anuke.mindustry.ui.fragments;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Batch;
import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
@@ -8,6 +9,7 @@ import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.net.NetConnection; import io.anuke.mindustry.net.NetConnection;
import io.anuke.mindustry.net.Packets.AdminAction; import io.anuke.mindustry.net.Packets.AdminAction;
import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Timers; import io.anuke.ucore.core.Timers;
import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Lines; import io.anuke.ucore.graphics.Lines;
@@ -36,6 +38,10 @@ public class PlayerListFragment extends Fragment{
if(visible && Timers.get("player-list-rebuild", 20)){ if(visible && Timers.get("player-list-rebuild", 20)){
rebuild(); rebuild();
content.pack();
content.act(Gdx.graphics.getDeltaTime());
//TODO hack
Core.scene.act(0f);
} }
}); });
@@ -104,7 +110,7 @@ public class PlayerListFragment extends Fragment{
t.addImageButton("icon-ban", 14 * 2, t.addImageButton("icon-ban", 14 * 2,
() -> ui.showConfirm("$text.confirm", "$text.confirmban", () -> Call.onAdminRequest(player, AdminAction.ban))).padBottom(-5.1f); () -> ui.showConfirm("$text.confirm", "$text.confirmban", () -> Call.onAdminRequest(player, AdminAction.ban))).padBottom(-5.1f);
t.addImageButton("icon-cancel", 14 * 2, t.addImageButton("icon-cancel", 16 * 2,
() -> ui.showConfirm("$text.confirm", "$text.confirmkick", () -> Call.onAdminRequest(player, AdminAction.kick))).padBottom(-5.1f); () -> ui.showConfirm("$text.confirm", "$text.confirmkick", () -> Call.onAdminRequest(player, AdminAction.kick))).padBottom(-5.1f);
t.row(); t.row();

View File

@@ -85,7 +85,6 @@ public abstract class ItemGenerator extends PowerGenerator{
ItemGeneratorEntity entity = tile.entity(); ItemGeneratorEntity entity = tile.entity();
float maxPower = Math.min(powerCapacity - entity.power.amount, powerOutput * entity.delta()) * entity.efficiency; float maxPower = Math.min(powerCapacity - entity.power.amount, powerOutput * entity.delta()) * entity.efficiency;
float mfract = maxPower / (powerOutput);
if(entity.generateTime <= 0f && entity.items.total() > 0){ if(entity.generateTime <= 0f && entity.items.total() > 0){
Effects.effect(generateEffect, tile.worldx() + Mathf.range(3f), tile.worldy() + Mathf.range(3f)); Effects.effect(generateEffect, tile.worldx() + Mathf.range(3f), tile.worldy() + Mathf.range(3f));
@@ -98,7 +97,7 @@ public abstract class ItemGenerator extends PowerGenerator{
entity.power.graph.update(); entity.power.graph.update();
if(entity.generateTime > 0f){ if(entity.generateTime > 0f){
entity.generateTime -= 1f / itemDuration * mfract * entity.delta(); entity.generateTime -= 1f / itemDuration * entity.delta();
entity.power.amount += maxPower; entity.power.amount += maxPower;
entity.generateTime = Mathf.clamp(entity.generateTime); entity.generateTime = Mathf.clamp(entity.generateTime);

View File

@@ -57,7 +57,6 @@ public abstract class ItemLiquidGenerator extends ItemGenerator{
}else if(entity.cons.valid()){ }else if(entity.cons.valid()){
float maxPower = Math.min(powerCapacity - entity.power.amount, powerOutput * entity.delta()) * entity.efficiency; float maxPower = Math.min(powerCapacity - entity.power.amount, powerOutput * entity.delta()) * entity.efficiency;
float mfract = maxPower / (powerOutput);
if(entity.generateTime <= 0f && entity.items.total() > 0){ if(entity.generateTime <= 0f && entity.items.total() > 0){
Effects.effect(generateEffect, tile.worldx() + Mathf.range(3f), tile.worldy() + Mathf.range(3f)); Effects.effect(generateEffect, tile.worldx() + Mathf.range(3f), tile.worldy() + Mathf.range(3f));
@@ -68,7 +67,7 @@ public abstract class ItemLiquidGenerator extends ItemGenerator{
} }
if(entity.generateTime > 0f){ if(entity.generateTime > 0f){
entity.generateTime -= 1f / itemDuration * mfract * entity.delta(); entity.generateTime -= 1f / itemDuration * entity.delta();
entity.power.amount += maxPower; entity.power.amount += maxPower;
entity.generateTime = Mathf.clamp(entity.generateTime); entity.generateTime = Mathf.clamp(entity.generateTime);

View File

@@ -35,7 +35,6 @@ public class PowerNode extends PowerBlock{
protected Translator t2 = new Translator(); protected Translator t2 = new Translator();
protected float laserRange = 6; protected float laserRange = 6;
protected float powerSpeed = 0.5f;
protected int maxNodes = 3; protected int maxNodes = 3;
public PowerNode(String name){ public PowerNode(String name){
@@ -111,7 +110,6 @@ public class PowerNode extends PowerBlock{
super.setStats(); super.setStats();
stats.add(BlockStat.powerRange, laserRange, StatUnit.blocks); stats.add(BlockStat.powerRange, laserRange, StatUnit.blocks);
stats.add(BlockStat.powerTransferSpeed, powerSpeed * 60 / 2f, StatUnit.powerSecond); //divided by 2 since passback exists
} }
@Override @Override

View File

@@ -8,6 +8,7 @@ import io.anuke.mindustry.world.blocks.LiquidBlock;
import io.anuke.mindustry.world.consumers.ConsumeLiquid; import io.anuke.mindustry.world.consumers.ConsumeLiquid;
import io.anuke.mindustry.world.meta.BlockBar; import io.anuke.mindustry.world.meta.BlockBar;
import io.anuke.mindustry.world.meta.BlockStat; import io.anuke.mindustry.world.meta.BlockStat;
import io.anuke.mindustry.world.meta.StatUnit;
import io.anuke.mindustry.world.modules.LiquidModule; import io.anuke.mindustry.world.modules.LiquidModule;
import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Draw;
@@ -35,6 +36,7 @@ public class LiquidMixer extends LiquidBlock{
super.setStats(); super.setStats();
stats.add(BlockStat.liquidOutput, outputLiquid); stats.add(BlockStat.liquidOutput, outputLiquid);
stats.add(BlockStat.liquidOutputSpeed, 60f * consumes.get(ConsumeLiquid.class).used(), StatUnit.liquidSecond);
} }
@Override @Override

View File

@@ -41,7 +41,7 @@ public class Pump extends LiquidBlock{
@Override @Override
public void setStats(){ public void setStats(){
super.setStats(); super.setStats();
stats.add(BlockStat.liquidOutput, 60f * pumpAmount, StatUnit.liquidSecond); stats.add(BlockStat.liquidOutputSpeed, 60f * pumpAmount, StatUnit.liquidSecond);
} }
@Override @Override

View File

@@ -37,7 +37,7 @@ public class SolidPump extends Pump{
public void setStats(){ public void setStats(){
super.setStats(); super.setStats();
stats.remove(BlockStat.liquidOutput); // stats.remove(BlockStat.liquidOutput);
stats.add(BlockStat.liquidOutput, result); stats.add(BlockStat.liquidOutput, result);
} }

View File

@@ -29,16 +29,13 @@ import io.anuke.ucore.core.Timers;
import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Lines; import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.EnumSet; import io.anuke.ucore.util.EnumSet;
import io.anuke.ucore.util.Log;
import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Mathf;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import static io.anuke.mindustry.Vars.netServer; import static io.anuke.mindustry.Vars.*;
import static io.anuke.mindustry.Vars.state;
import static io.anuke.mindustry.Vars.unitGroups;
public class CoreBlock extends StorageBlock{ public class CoreBlock extends StorageBlock{
protected float droneRespawnDuration = 60 * 6; protected float droneRespawnDuration = 60 * 6;
@@ -74,6 +71,10 @@ public class CoreBlock extends StorageBlock{
entity.currentUnit.setNet(tile.drawx(), tile.drawy()); entity.currentUnit.setNet(tile.drawx(), tile.drawy());
entity.currentUnit.add(); entity.currentUnit.add();
entity.currentUnit = null; entity.currentUnit = null;
if(player instanceof Player){
((Player) player).endRespawning();
}
} }
@Remote(called = Loc.server) @Remote(called = Loc.server)

View File

@@ -93,6 +93,7 @@ public class MechPad extends Block{
entity.progress = 0; entity.progress = 0;
entity.player.heal(); entity.player.heal();
entity.player.endRespawning();
entity.open = true; entity.open = true;
entity.player.setDead(false); entity.player.setDead(false);
entity.player.inventory.clear(); entity.player.inventory.clear();

View File

@@ -1,5 +1,6 @@
package io.anuke.mindustry.world.consumers; package io.anuke.mindustry.world.consumers;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
public class ConsumePowerExact extends ConsumePower{ public class ConsumePowerExact extends ConsumePower{
@@ -8,7 +9,8 @@ public class ConsumePowerExact extends ConsumePower{
super(use); super(use);
} }
protected float use(Block block){ @Override
protected float use(Block block, TileEntity entity){
return this.use; return this.use;
} }
} }

View File

@@ -18,6 +18,7 @@ public enum BlockStat{
liquidCapacity(StatCategory.liquids), liquidCapacity(StatCategory.liquids),
liquidOutput(StatCategory.liquids), liquidOutput(StatCategory.liquids),
liquidOutputSpeed(StatCategory.liquids),
coolant(StatCategory.liquids), coolant(StatCategory.liquids),
coolantUse(StatCategory.liquids), coolantUse(StatCategory.liquids),

View File

@@ -112,7 +112,7 @@ public class ServerControl extends Module{
if(Settings.getBool("shuffle")){ if(Settings.getBool("shuffle")){
if(world.getSector() == null){ if(world.getSector() == null){
if(world.maps.all().size > 0){ if(world.maps.all().size > 0){
Array<Map> maps = world.maps.all(); Array<Map> maps = world.maps.customMaps().size == 0 ? world.maps.defaultMaps() : world.maps.customMaps();
Map previous = world.getMap(); Map previous = world.getMap();
Map map = previous; Map map = previous;