diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000000..b973171f8d --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,52 @@ +name: Deployment + +on: + push: + tags: + - 'v*' + +jobs: + buildJava14: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + - name: Create artifacts + run: | + ./gradlew desktop:dist server:dist core:javadoc -Pbuildversion=${GITHUB_REF:1}" + - name: Update docs + run: | + cd ../ + git clone --depth=1 https://github.com/MindustryGame/docs.git + cp -a Mindustry/core/build/docs/javadoc/. docs/ + cd docs + git add . + git commit -m "Update ${GITHUB_REF:1}" + git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/MindustryGame/docs + cd ../Mindustry + - name: Update F-Droid build string + run: | + git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds + cd ../MindustryBuilds + echo "Updating version to ${GITHUB_REF:1}" + echo versionName=6-fdroid-${GITHUB_REF:1}$'\n'versionCode=${GITHUB_REF:1} > version_fdroid.txt + git add . + git commit -m "Updating to build ${GITHUB_REF:1}" + cd ../Mindustry + - name: Upload client artifacts + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: desktop/libs/Mindustry.jar + tag: ${{ github.ref }} + - name: Upload server artifacts + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: server/libs/server-release.jar + tag: ${{ github.ref }} + diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index 38cfeeee4e..0000000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Java CI - -on: [push, pull_request] - -jobs: - buildJava14: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Set up JDK 14 - uses: actions/setup-java@v1 - with: - java-version: 14 - - name: Run unit tests with gradle and Java 14 - run: ./gradlew compileJava - - name: Compile desktop jar - run: ./gradlew desktop:dist - - name: Upload desktop jar for testing - uses: actions/upload-artifact@v2 - with: - name: Desktop jar (zipped) - path: desktop/build/libs/Mindustry.jar - buildJava15: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Set up JDK 15 - uses: actions/setup-java@v1 - with: - java-version: 15 - - name: Run unit tests with gradle and Java 15 - run: ./gradlew compileJava diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000000..81cf1ff4e9 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,21 @@ +name: Pull Request Tests + +on: [pull_request] + +jobs: + buildJava14: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + - name: Run unit tests and build JAR + run: ./gradlew test desktop:dist + - name: Upload desktop JAR for testing + uses: actions/upload-artifact@v2 + with: + name: Desktop JAR (zipped) + path: desktop/build/libs/Mindustry.jar diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000000..bccad0196e --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,23 @@ +name: Tests + +on: [push] + +jobs: + buildJava14: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + - name: Run unit tests + run: ./gradlew test + - name: Trigger BE build + run: | + git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds + cd ../MindustryBuilds + git tag ${GITHUB_RUN_NUMBER} + git config --global user.name "Build Uploader" + git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryBuilds ${GITHUB_RUN_NUMBER} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bbf20a5063..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -jdk: -- openjdk14 -dist: xenial -android: - components: - - android-29 - - build-tools-29.0.3 - -script: -- git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds -- cd ../MindustryBuilds -- echo ${TRAVIS_TAG} -- if [ -n "$TRAVIS_TAG" ]; then echo versionName=6-fdroid-${TRAVIS_TAG:1}$'\n'versionCode=${TRAVIS_TAG:1} > version_fdroid.txt; git add .; git commit -m "Updating to build ${TRAVIS_TAG}"; fi -- git tag ${TRAVIS_BUILD_NUMBER} -- git config --global user.name "Build Uploader" -- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git push https://Anuken:${GH_PUSH_TOKEN}@github.com/Anuken/MindustryBuilds ${TRAVIS_BUILD_NUMBER}; git push https://Anuken:${GH_PUSH_TOKEN}@github.com/Anuken/MindustryBuilds; fi -- cd ../Mindustry -- git clone --depth=1 --branch=master https://github.com/Anuken/Arc ../Arc -- if [ -n "$TRAVIS_TAG" ]; then cd ../Arc; git tag ${TRAVIS_TAG}; git push https://Anuken:${GH_PUSH_TOKEN}@github.com/Anuken/Arc ${TRAVIS_TAG}; cd ../Mindustry; fi -- "./gradlew test" -- "./gradlew desktop:dist -Pbuildversion=${TRAVIS_TAG:1}" -- "./gradlew server:dist -Pbuildversion=${TRAVIS_TAG:1}" -- "./gradlew core:javadoc" -- cd ../ -- git clone --depth=1 https://github.com/MindustryGame/docs.git -- cp -a Mindustry/core/build/docs/javadoc/. docs/ -- cd docs -- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git add .; git commit -m "Update ${TRAVIS_BUILD_NUMBER}"; git push https://Anuken:${GH_PUSH_TOKEN}@github.com/MindustryGame/docs; fi -- cd ../Mindustry -deploy: -- provider: releases - cleanup: false - 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/Mindustry.jar - - server/build/libs/server-release.jar - on: - repo: Anuken/Mindustry - tags: true -#- provider: script -# script: bash update_wiki.sh -# on: -# repo: Anuken/Mindustry -# tags: true -env: - global: - - secure: TqlUl/ojjkCMVOGbCTKz7Cnr4F08UyWzY/CiJ0vvUOGJGZ1qm7XavAlDf5XT0egU4mvr37THubFO8vojbqmrmy0oZnYh3njKFA8axgyZ8PyKkjGHOfd0i6qyEWsOr9H90/2X8r3LwEeLaDFyHpu3wljIGBjweg53g2qwmDwCFa9UR80FJZ+xDB+rD6B3cXT0DTEkCoLZXLqXm0Y3HvBdSuBL1LR/FNb2BSxNq+tNLGiz1kdQZV5erausbbZypBoGxzz63xAnyz2kkFz73A8xQYVTzGbFodTPz7HM13GVZ5s43I03Y+HYyHBgBaSLziO2hi2kzVJccOwzBp7wS4fs1MqsFY5+IeWJ9k+hm89NiYT7+6zlEgoUMlIniny1qLqWTzx7btUeuC/y/h5TVBNgaV+z0jmHycHfeSyq5I+vmX4J8qe3wmaN8TcdqYKU5nIznOTk3CM5Fzu0Bs9vkCkOxmormmcjMFW1RbdOLc/hpZWZggsBA88sNEAI8eq+r5QEeqzeCx8YKoZDjdrsqvgLMc3El3gS9oMGxkn0Y/TEcqs9Tc4BXtTkqIA68hD0DYzlAxYjVbbkAI9Hh9lHNvV3Dr/oCkGXQ/HflM143kj1L3tSBZpqeqQE2XhngB5nqpS3OZTmZbMTQ8qD2luU18yaTGMLF5tJS/fdKPRx0gQ1kL8= - - secure: VEskj/0TVX2o7iUVXuVPysj/VSWmPhDl57SrT7/nBNN/P/8N5jFAvx8PMzG7qT0S5FzKxuV20psE4WylUGRKdeRtK7/QNBV7T3YqYYM6BUB1VeRpxe5hLxTeuBK3izglFO8DkdDqjUtzQSjzkoYT75ilROjhBrBUPhVek7UlbBHbaklPWYFXHnJmYS1FpZTdzqIj+Y0Gd1PSL2MzK4X74aAHl0qaDgsTwYwtKs7IAz+kFaTZBRpi9VjQHAFhDlkDR3jo9wQjH8/F6x0lCgV/FulSc37Okdb40sLFG98xcEA6gWh1NPMkz8CulUdVE7mj7SJNxLbNvoMNrWOVRjmEsn59p/9LiNC1F9ncFz9vjQjAmi7rMFFGHGxe5nn8cIAkpTvHQQkZoWHAA9SNJTDMMf09m2pRy/vvzx+a6NVxyC9iNrhLlnBg4gxAqRh0S6NU0uL+fuygKixn7rqlnb7KMT7bAbfcuV+dng6c8V7hYKDCh7sJbH8iJump1xkwoM7ecnU8fxJF/oKOr/fbk0Bfxu+Q9qYLrV1+DEdm93Vl2Thq+DBKmI66jRGSva6HeCLFo81PEiEjP1nLv75+kvVfOqVqJrZD1BrvoG2eWT/3hVLrN2kEIWWlpvQVC7FL11yWmYtAuOBh/vfhI76zKr+YTS6ccG9rqW4XeYjJytshe8M= diff --git a/android/build.gradle b/android/build.gradle index 3ec6b34cfe..24de0e599f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -35,7 +35,8 @@ dependencies{ natives "com.github.Anuken.Arc:natives-box2d-android:${getArcHash()}" //android dependencies magically disappear during compilation, thanks gradle! - if(new File(projectDir.parent, '../Arc').exists()) compileOnly fileTree(dir: '../../Arc/backends/backend-android/libs', include: ['*.jar']) + def sdkFile = new File(System.getenv("ANDROID_HOME"), "/platforms/android-29/android.jar") + if(sdkFile.exists()) compileOnly files(sdkFile.absolutePath) } task deploy(type: Copy){ diff --git a/core/assets/maps/extractionOutpost.msav b/core/assets/maps/extractionOutpost.msav index 5e5bffccfb..5728a4b217 100644 Binary files a/core/assets/maps/extractionOutpost.msav and b/core/assets/maps/extractionOutpost.msav differ diff --git a/core/src/mindustry/content/Planets.java b/core/src/mindustry/content/Planets.java index 57f8dbe728..9450c441da 100644 --- a/core/src/mindustry/content/Planets.java +++ b/core/src/mindustry/content/Planets.java @@ -40,8 +40,6 @@ public class Planets implements ContentList{ startSector = 10; atmosphereRadIn = -0.01f; atmosphereRadOut = 0.3f; - accessible = false; - visible = false; }};*/ serpulo = new Planet("serpulo", sun, 3, 1){{ diff --git a/core/src/mindustry/game/Waves.java b/core/src/mindustry/game/Waves.java index 8309f99a8b..586fb285c1 100644 --- a/core/src/mindustry/game/Waves.java +++ b/core/src/mindustry/game/Waves.java @@ -257,10 +257,10 @@ public class Waves{ public static Seq generate(float difficulty){ //apply power curve to make starting sectors easier - return generate(new Rand(), Mathf.pow(difficulty, 1.12f)); + return generate(Mathf.pow(difficulty, 1.12f), new Rand(), false); } - public static Seq generate(Rand rand, float difficulty){ + public static Seq generate(float difficulty, Rand rand, boolean attack){ UnitType[][] species = { {dagger, mace, fortress, scepter, reign}, {nova, pulsar, quasar, vela, corvus}, @@ -395,6 +395,21 @@ public class Waves{ effect = StatusEffects.boss; }}); + //add megas to heal the base. + if(attack && difficulty >= 0.5){ + int amount = Mathf.random(1, 3 + (int)(difficulty*2)); + + for(int i = 0; i < amount; i++){ + int wave = Mathf.random(3, 20); + out.add(new SpawnGroup(mega){{ + unitAmount = 1; + begin = wave; + end = wave; + max = 16; + }}); + } + } + //shift back waves on higher difficulty for a harder start int shift = Math.max((int)(difficulty * 15 - 5), 0); diff --git a/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java b/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java index 0a49e1869d..08db3f0cca 100644 --- a/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java @@ -439,7 +439,7 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ state.rules.waves = sector.info.waves = true; state.rules.enemyCoreBuildRadius = 600f; - state.rules.spawns = Waves.generate(difficulty); + state.rules.spawns = Waves.generate(difficulty, new Rand(), state.rules.attackMode); } @Override diff --git a/core/src/mindustry/maps/planet/TantrosPlanetGenerator.java b/core/src/mindustry/maps/planet/TantrosPlanetGenerator.java index fc8f23fd88..934291dab8 100644 --- a/core/src/mindustry/maps/planet/TantrosPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/TantrosPlanetGenerator.java @@ -15,7 +15,7 @@ public class TantrosPlanetGenerator extends PlanetGenerator{ @Override public Color getColor(Vec3 position){ - float depth = (float)noise.octaveNoise3D(2, 0.56, 1.7f, position.x, position.y, position.z) / 1.7f; + float depth = (float)noise.octaveNoise3D(2, 0.56, 1.7f, position.x, position.y, position.z) / 2f; return c1.write(out).lerp(c2, Mathf.clamp(Mathf.round(depth, 0.15f))).a(0.6f); } } diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index 9720fed59e..706815d3b3 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -629,7 +629,7 @@ public class Mods implements Loadable{ } //make sure the main class exists before loading it; if it doesn't just don't put it there - if(mainFile.exists() && Core.settings.getBool("mod-" + meta.name.toLowerCase().replace(" ", "-") + "-enabled", true)){ + if(mainFile.exists() && Core.settings.getBool("mod-" + baseName + "-enabled", true)){ //mobile versions don't support class mods if(ios){ throw new IllegalArgumentException("Java class mods are not supported on iOS."); diff --git a/update_wiki.sh b/update_wiki.sh deleted file mode 100755 index a3ed44ee33..0000000000 --- a/update_wiki.sh +++ /dev/null @@ -1,9 +0,0 @@ -git config --global user.name "Wiki Updater" -git clone --depth=1 --branch=master https://github.com/MindustryGame/wiki ../wiki -git clone --depth=1 --branch=master https://github.com/Anuken/Mindustry-Wiki-Generator ../Mindustry-Wiki-Generator -cd ../Mindustry-Wiki-Generator -./gradlew run -cd ../wiki -git add . -git commit -m "Update to match build ${TRAVIS_TAG}" -git push https://Anuken:${GH_PUSH_TOKEN}@github.com/MindustryGame/wiki