diff --git a/.github/workflows/gamemaker_build.yml b/.github/workflows/gamemaker_build.yml index 497e05842..a5925e1d8 100644 --- a/.github/workflows/gamemaker_build.yml +++ b/.github/workflows/gamemaker_build.yml @@ -40,7 +40,7 @@ jobs: $CommitHash = git rev-parse --short HEAD try { - $Version = "${{ github.ref_name }}".Replace("/", "-") + $Version = "${{ github.ref_name }}".Split('/')[-1] } catch { # If no tags exist, use the commit hash as the version Write-Warning "No tags found, using commit hash as version." @@ -48,7 +48,7 @@ jobs: } if ("${{ inputs.development }}" -eq "true") { - $suffix = "$Version-$BuildDate" + $suffix = "dev-$Version-$BuildDate" } else { $suffix = $Version } diff --git a/.github/workflows/release_dev.yml b/.github/workflows/release_dev.yml index 06043c14b..28eb1fd0f 100644 --- a/.github/workflows/release_dev.yml +++ b/.github/workflows/release_dev.yml @@ -13,6 +13,7 @@ on: push: branches: - release/0.9 + jobs: build_needed: name: Build needed? @@ -23,7 +24,7 @@ jobs: - uses: actions/checkout@v4 with: lfs: true - + - name: Check commit id: commit_check run: | @@ -61,6 +62,8 @@ jobs: - uses: actions/checkout@v4 with: lfs: true + fetch-depth: 0 + - name: Check if a dev release exists id: check_release run: | @@ -74,6 +77,34 @@ jobs: continue-on-error: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - id: get_commit_sha + name: Get commit SHA of the last nightly release + if: steps.check_release.outputs.release_exists + run: | + $prev_sha = git rev-parse dev/${{ github.ref_name }} + echo "prev_SHA=$prev_sha" >> $env:GITHUB_ENV + + - name: Update tag pointing to the previous nightly release + if: steps.check_release.outputs.release_exists + run: | + # Get the SHA from the environment variable + $sha = $env:prev_SHA + # Construct the URL properly + $url = "https://api.github.com/repos/$env:GITHUB_REPOSITORY/git/refs/tags/dev-old/$env:GITHUB_REF_NAME" + + # Create the JSON payload for the PATCH request + $data = @{ + sha = $sha + } | ConvertTo-Json + + # Use curl to send the PATCH request with proper headers and data + curl --fail-with-body -X PATCH ` + -H "Authorization: Bearer ${{ secrets.WORKFLOW_TOKEN }}" ` + -H "Accept: application/vnd.github.v3+json" ` + -d $data ` + $url + - id: delete_release_tag name: Delete the existing dev tag and release if: steps.check_release.outputs.release_exists @@ -81,11 +112,13 @@ jobs: gh release delete dev/${{ github.ref_name }} -y --cleanup-tag env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Download built file artifact uses: actions/download-artifact@v4 with: name: built-file path: ./build_output + - id: create_release name: Create a release and upload the build uses: softprops/action-gh-release@v2.0.9 diff --git a/.gitignore b/.gitignore index e72b8693f..385ac1a4b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ # Gamemaker stuff ChapterMaster.resource_order + +tmp/ +stitch.config.json diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 0ab56fc32..2ddcb0e55 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -61,8 +61,19 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"arms_hands","folderPath":"folders/Sprites/Marine Viewer/arms_hands.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"bionics","folderPath":"folders/Sprites/Marine Viewer/bionics.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"body_types","folderPath":"folders/Sprites/Marine Viewer/body_types.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"artificer_complex","folderPath":"folders/Sprites/Marine Viewer/body_types/artificer_complex.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"indomitus_complex","folderPath":"folders/Sprites/Marine Viewer/body_types/indomitus_complex.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"mk_3_complex","folderPath":"folders/Sprites/Marine Viewer/body_types/mk_3_complex.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"mk_4_complex","folderPath":"folders/Sprites/Marine Viewer/body_types/mk_4_complex.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"mk_5_complex","folderPath":"folders/Sprites/Marine Viewer/body_types/mk_5_complex.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"mk_6_complex","folderPath":"folders/Sprites/Marine Viewer/body_types/mk_6_complex.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"mk_7_complex","folderPath":"folders/Sprites/Marine Viewer/body_types/mk_7_complex.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"mk_8_complex","folderPath":"folders/Sprites/Marine Viewer/body_types/mk_8_complex.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"specialist","folderPath":"folders/Sprites/Marine Viewer/body_types/specialist.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"dark_angels_specials","folderPath":"folders/Sprites/Marine Viewer/body_types/specialist/dark_angels_specials.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"white_scars_specials","folderPath":"folders/Sprites/Marine Viewer/body_types/specialist/white_scars_specials.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"tartaros_complex","folderPath":"folders/Sprites/Marine Viewer/body_types/tartaros_complex.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"techmarine_complex","folderPath":"folders/Sprites/Marine Viewer/body_types/techmarine_complex.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"decorations","folderPath":"folders/Sprites/Marine Viewer/decorations.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"deprecated","folderPath":"folders/Sprites/Marine Viewer/deprecated.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"dreadnought","folderPath":"folders/Sprites/Marine Viewer/dreadnought.yy",}, @@ -71,8 +82,12 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"helms","folderPath":"folders/Sprites/Marine Viewer/helms.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"dark_angels","folderPath":"folders/Sprites/Marine Viewer/helms/dark_angels.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"packs","folderPath":"folders/Sprites/Marine Viewer/packs.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"unused","folderPath":"folders/Sprites/Marine Viewer/unused.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"weapons_terminator","folderPath":"folders/Sprites/Marine Viewer/weapons_terminator.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"weapons","folderPath":"folders/Sprites/Marine Viewer/weapons.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"heavy_ranged","folderPath":"folders/Sprites/Marine Viewer/weapons/heavy_ranged.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"melee","folderPath":"folders/Sprites/Marine Viewer/weapons/melee.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"ranged","folderPath":"folders/Sprites/Marine Viewer/weapons/ranged.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"New Ground","folderPath":"folders/Sprites/New Ground.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"New UI","folderPath":"folders/Sprites/New UI.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Ally Splash","folderPath":"folders/Sprites/New UI/Ally Splash.yy",}, @@ -94,32 +109,52 @@ ], "IncludedFiles": [ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"custom_icons_help.txt","CopyToMask":153157610357391598,"filePath":"datafiles/icons",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"creation_icons.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"existing1.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"existing2.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"existing3.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"existing4.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"existing5.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"existing7.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"existing8.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"0.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"1.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"10.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"11.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"12.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"13.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"14.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"15.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"16.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"17.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"18.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"19.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"2.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"20.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"21.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"3.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"4.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"5.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"6.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"7.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"8.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"9.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/icons",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"1.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"10.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"11.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"12.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"13.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"14.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"16.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"17.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"19.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"2.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"22.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"3.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"4.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"5.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"6.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"7.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"8.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"9.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"97.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"98.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"99.png","CopyToMask":-1,"filePath":"datafiles/images/creation/chapters/splash",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"instructions.txt","CopyToMask":9223372036854775807,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"lamenters_alternate.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"main1.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"main2.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"main3.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"main4.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"main5.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"main6.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"main7.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"main8.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"main9.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"other1.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"other3.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"other5.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"other6.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"other7.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"slate1.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"slate2.png","CopyToMask":-1,"filePath":"datafiles/images/creation",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"1.png","CopyToMask":-1,"filePath":"datafiles/images/creation/slate",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"2.png","CopyToMask":-1,"filePath":"datafiles/images/creation/slate",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"advisor1.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"advisor11.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"advisor12.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, @@ -239,6 +274,21 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"event2.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"event3.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"event4.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"1.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"10.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"11.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"12.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"13.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"15.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"2.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"3.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"30.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"4.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"5.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"6.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"7.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"8.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"9.png","CopyToMask":-1,"filePath":"datafiles/images/ui/force",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"force1.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"force10.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"force11.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, @@ -272,6 +322,23 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"formation9.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ingame_menu.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"instructions.txt","CopyToMask":9223372036854775807,"filePath":"datafiles/images/ui",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"1.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"10.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"11.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"12.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"13.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"14.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"15.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"16.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"17.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"2.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"3.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"4.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"5.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"6.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"7.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"8.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"9.png","CopyToMask":-1,"filePath":"datafiles/images/ui/planet",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"planet1.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"planet10.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"planet11.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, @@ -305,6 +372,25 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"purge8.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"raid1.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"resources.png","CopyToMask":-1,"filePath":"datafiles/images/ui",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"1.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"10.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"11.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"12.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"13.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"14.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"15.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"16.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"17.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"2.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"3.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"31.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"4.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"5.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"6.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"7.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"8.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"9.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"template.JSON","CopyToMask":-1,"filePath":"datafiles/main/chapters",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"help.ini","CopyToMask":9223372036854775807,"filePath":"datafiles/main",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"chaos.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"eldar.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, @@ -336,6 +422,7 @@ {"id":{"name":"spr_creation_icon","path":"sprites/spr_creation_icon/spr_creation_icon.yy",},}, {"id":{"name":"spr_weapon_boltstorm_gauntlet","path":"sprites/spr_weapon_boltstorm_gauntlet/spr_weapon_boltstorm_gauntlet.yy",},}, {"id":{"name":"spr_cm_specialty","path":"sprites/spr_cm_specialty/spr_cm_specialty.yy",},}, + {"id":{"name":"scr_drop_select_function","path":"scripts/scr_drop_select_function/scr_drop_select_function.yy",},}, {"id":{"name":"spr_planet_splash","path":"sprites/spr_planet_splash/spr_planet_splash.yy",},}, {"id":{"name":"spr_creation_arrow","path":"sprites/spr_creation_arrow/spr_creation_arrow.yy",},}, {"id":{"name":"spr_creation_check","path":"sprites/spr_creation_check/spr_creation_check.yy",},}, @@ -346,6 +433,7 @@ {"id":{"name":"spr_creation_other","path":"sprites/spr_creation_other/spr_creation_other.yy",},}, {"id":{"name":"spr_generic_sgt_mk4","path":"sprites/spr_generic_sgt_mk4/spr_generic_sgt_mk4.yy",},}, {"id":{"name":"spr_creation_nosplash","path":"sprites/spr_creation_nosplash/spr_creation_nosplash.yy",},}, + {"id":{"name":"spr_mk5_complex_backpack","path":"sprites/spr_mk5_complex_backpack/spr_mk5_complex_backpack.yy",},}, {"id":{"name":"spr_rg_mk6_helm","path":"sprites/spr_rg_mk6_helm/spr_rg_mk6_helm.yy",},}, {"id":{"name":"spr_creation_slate","path":"sprites/spr_creation_slate/spr_creation_slate.yy",},}, {"id":{"name":"spr_gear_halo","path":"sprites/spr_gear_halo/spr_gear_halo.yy",},}, @@ -360,6 +448,7 @@ {"id":{"name":"spr_marine_base","path":"sprites/spr_marine_base/spr_marine_base.yy",},}, {"id":{"name":"spr_clothing_colors","path":"sprites/spr_clothing_colors/spr_clothing_colors.yy",},}, {"id":{"name":"spr_facial_colors","path":"sprites/spr_facial_colors/spr_facial_colors.yy",},}, + {"id":{"name":"spr_techmarine_left_leg","path":"sprites/spr_techmarine_left_leg/spr_techmarine_left_leg.yy",},}, {"id":{"name":"scr_librarium","path":"scripts/scr_librarium/scr_librarium.yy",},}, {"id":{"name":"spr_chaplain_skull_helm","path":"sprites/spr_chaplain_skull_helm/spr_chaplain_skull_helm.yy",},}, {"id":{"name":"spr_aquila_colors","path":"sprites/spr_aquila_colors/spr_aquila_colors.yy",},}, @@ -388,7 +477,10 @@ {"id":{"name":"spr_termi_wep_fix","path":"sprites/spr_termi_wep_fix/spr_termi_wep_fix.yy",},}, {"id":{"name":"spr_honor_helm","path":"sprites/spr_honor_helm/spr_honor_helm.yy",},}, {"id":{"name":"spr_pack_brazier","path":"sprites/spr_pack_brazier/spr_pack_brazier.yy",},}, + {"id":{"name":"spr_mk7_left_trim","path":"sprites/spr_mk7_left_trim/spr_mk7_left_trim.yy",},}, {"id":{"name":"spr_pack_arm","path":"sprites/spr_pack_arm/spr_pack_arm.yy",},}, + {"id":{"name":"spr_tartaros_left_leg","path":"sprites/spr_tartaros_left_leg/spr_tartaros_left_leg.yy",},}, + {"id":{"name":"spr_mk7_leg_variants","path":"sprites/spr_mk7_leg_variants/spr_mk7_leg_variants.yy",},}, {"id":{"name":"spr_pack_arms","path":"sprites/spr_pack_arms/spr_pack_arms.yy",},}, {"id":{"name":"spr_pack_jump","path":"sprites/spr_pack_jump/spr_pack_jump.yy",},}, {"id":{"name":"scr_forge_world_functions","path":"scripts/scr_forge_world_functions/scr_forge_world_functions.yy",},}, @@ -397,8 +489,10 @@ {"id":{"name":"spr_weapon_blank","path":"sprites/spr_weapon_blank/spr_weapon_blank.yy",},}, {"id":{"name":"scr_draw_rectangle","path":"scripts/scr_draw_rectangle/scr_draw_rectangle.yy",},}, {"id":{"name":"scr_buttons","path":"scripts/scr_buttons/scr_buttons.yy",},}, + {"id":{"name":"spr_mk6_complex","path":"sprites/spr_mk6_complex/spr_mk6_complex.yy",},}, {"id":{"name":"spr_purity_s","path":"sprites/spr_purity_s/spr_purity_s.yy",},}, {"id":{"name":"spr_weapon_boltpis","path":"sprites/spr_weapon_boltpis/spr_weapon_boltpis.yy",},}, + {"id":{"name":"spr_artificer_left_leg","path":"sprites/spr_artificer_left_leg/spr_artificer_left_leg.yy",},}, {"id":{"name":"spr_weapon_bolter","path":"sprites/spr_weapon_bolter/spr_weapon_bolter.yy",},}, {"id":{"name":"spr_weapon_sbolter","path":"sprites/spr_weapon_sbolter/spr_weapon_sbolter.yy",},}, {"id":{"name":"spr_weapon_comflamer","path":"sprites/spr_weapon_comflamer/spr_weapon_comflamer.yy",},}, @@ -409,8 +503,10 @@ {"id":{"name":"spr_weapon_hbolt","path":"sprites/spr_weapon_hbolt/spr_weapon_hbolt.yy",},}, {"id":{"name":"spr_weapon_mmelta","path":"sprites/spr_weapon_mmelta/spr_weapon_mmelta.yy",},}, {"id":{"name":"spr_weapon_assca","path":"sprites/spr_weapon_assca/spr_weapon_assca.yy",},}, + {"id":{"name":"spr_mk6_complex_backpack","path":"sprites/spr_mk6_complex_backpack/spr_mk6_complex_backpack.yy",},}, {"id":{"name":"spr_weapon_lasca","path":"sprites/spr_weapon_lasca/spr_weapon_lasca.yy",},}, {"id":{"name":"spr_generic_sgt_mk7","path":"sprites/spr_generic_sgt_mk7/spr_generic_sgt_mk7.yy",},}, + {"id":{"name":"spr_techmarine_right_leg","path":"sprites/spr_techmarine_right_leg/spr_techmarine_right_leg.yy",},}, {"id":{"name":"spr_weapon_plasg","path":"sprites/spr_weapon_plasg/spr_weapon_plasg.yy",},}, {"id":{"name":"spr_weapon_plasp","path":"sprites/spr_weapon_plasp/spr_weapon_plasp.yy",},}, {"id":{"name":"spr_sanguin_guard","path":"sprites/spr_sanguin_guard/spr_sanguin_guard.yy",},}, @@ -426,6 +522,7 @@ {"id":{"name":"spr_weapon_thhammer","path":"sprites/spr_weapon_thhammer/spr_weapon_thhammer.yy",},}, {"id":{"name":"spr_weapon_evisc","path":"sprites/spr_weapon_evisc/spr_weapon_evisc.yy",},}, {"id":{"name":"spr_weapon_powaxe","path":"sprites/spr_weapon_powaxe/spr_weapon_powaxe.yy",},}, + {"id":{"name":"spr_weapon_complas","path":"sprites/spr_weapon_complas/spr_weapon_complas.yy",},}, {"id":{"name":"spr_weapon_chaxe","path":"sprites/spr_weapon_chaxe/spr_weapon_chaxe.yy",},}, {"id":{"name":"spr_weapon_powswo","path":"sprites/spr_weapon_powswo/spr_weapon_powswo.yy",},}, {"id":{"name":"spr_weapon_powspear","path":"sprites/spr_weapon_powspear/spr_weapon_powspear.yy",},}, @@ -435,6 +532,7 @@ {"id":{"name":"spr_weapon_powfist3","path":"sprites/spr_weapon_powfist3/spr_weapon_powfist3.yy",},}, {"id":{"name":"spr_servo_harness","path":"sprites/spr_servo_harness/spr_servo_harness.yy",},}, {"id":{"name":"spr_weapon_powfist_old","path":"sprites/spr_weapon_powfist_old/spr_weapon_powfist_old.yy",},}, + {"id":{"name":"scr_distribute_experience","path":"scripts/scr_distribute_experience/scr_distribute_experience.yy",},}, {"id":{"name":"spr_weapon_powmaul","path":"sprites/spr_weapon_powmaul/spr_weapon_powmaul.yy",},}, {"id":{"name":"spr_weapon_lightning1","path":"sprites/spr_weapon_lightning1/spr_weapon_lightning1.yy",},}, {"id":{"name":"spr_weapon_lightning2","path":"sprites/spr_weapon_lightning2/spr_weapon_lightning2.yy",},}, @@ -443,6 +541,7 @@ {"id":{"name":"scr_star_travel_algorithm","path":"scripts/scr_star_travel_algorithm/scr_star_travel_algorithm.yy",},}, {"id":{"name":"spr_weapon_inferno","path":"sprites/spr_weapon_inferno/spr_weapon_inferno.yy",},}, {"id":{"name":"spr_cloth_tabbard","path":"sprites/spr_cloth_tabbard/spr_cloth_tabbard.yy",},}, + {"id":{"name":"scr_equipment_struct","path":"scripts/scr_equipment_struct/scr_equipment_struct.yy",},}, {"id":{"name":"spr_weapon_relbla","path":"sprites/spr_weapon_relbla/spr_weapon_relbla.yy",},}, {"id":{"name":"spr_weapon_storm","path":"sprites/spr_weapon_storm/spr_weapon_storm.yy",},}, {"id":{"name":"spr_weapon_stalker","path":"sprites/spr_weapon_stalker/spr_weapon_stalker.yy",},}, @@ -462,6 +561,7 @@ {"id":{"name":"spr_rock_bg","path":"sprites/spr_rock_bg/spr_rock_bg.yy",},}, {"id":{"name":"spr_weapon_grav_gun","path":"sprites/spr_weapon_grav_gun/spr_weapon_grav_gun.yy",},}, {"id":{"name":"spr_ingame_menu","path":"sprites/spr_ingame_menu/spr_ingame_menu.yy",},}, + {"id":{"name":"scr_player_ship_functions","path":"scripts/scr_player_ship_functions/scr_player_ship_functions.yy",},}, {"id":{"name":"spr_sal_mk5_helm","path":"sprites/spr_sal_mk5_helm/spr_sal_mk5_helm.yy",},}, {"id":{"name":"spr_loadbar","path":"sprites/spr_loadbar/spr_loadbar.yy",},}, {"id":{"name":"scr_mission_functions","path":"scripts/scr_mission_functions/scr_mission_functions.yy",},}, @@ -475,16 +575,17 @@ {"id":{"name":"scr_load_controller","path":"scripts/scr_load_controller/scr_load_controller.yy",},}, {"id":{"name":"spr_formation_arrow","path":"sprites/spr_formation_arrow/spr_formation_arrow.yy",},}, {"id":{"name":"scr_player_fleet_functions","path":"scripts/scr_player_fleet_functions/scr_player_fleet_functions.yy",},}, + {"id":{"name":"spr_mk6_right_arm","path":"sprites/spr_mk6_right_arm/spr_mk6_right_arm.yy",},}, {"id":{"name":"spr_formation_splash","path":"sprites/spr_formation_splash/spr_formation_splash.yy",},}, {"id":{"name":"spr_purge_panel","path":"sprites/spr_purge_panel/spr_purge_panel.yy",},}, {"id":{"name":"spr_purge_buttons","path":"sprites/spr_purge_buttons/spr_purge_buttons.yy",},}, {"id":{"name":"spr_mm_butts","path":"sprites/spr_mm_butts/spr_mm_butts.yy",},}, - {"id":{"name":"scr_colour_modifiers","path":"scripts/scr_colour_modifiers/scr_colour_modifiers.yy",},}, {"id":{"name":"spr_mm_glowold","path":"sprites/spr_mm_glowold/spr_mm_glowold.yy",},}, {"id":{"name":"spr_new_ui","path":"sprites/spr_new_ui/spr_new_ui.yy",},}, {"id":{"name":"spr_new_resource","path":"sprites/spr_new_resource/spr_new_resource.yy",},}, {"id":{"name":"spr_warp_level_icon","path":"sprites/spr_warp_level_icon/spr_warp_level_icon.yy",},}, {"id":{"name":"spr_new_banner","path":"sprites/spr_new_banner/spr_new_banner.yy",},}, + {"id":{"name":"spr_mk6_left_arm","path":"sprites/spr_mk6_left_arm/spr_mk6_left_arm.yy",},}, {"id":{"name":"spr_new_ui_cover","path":"sprites/spr_new_ui_cover/spr_new_ui_cover.yy",},}, {"id":{"name":"scr_unit_spawn_functions","path":"scripts/scr_unit_spawn_functions/scr_unit_spawn_functions.yy",},}, {"id":{"name":"spr_ui_but_1","path":"sprites/spr_ui_but_1/spr_ui_but_1.yy",},}, @@ -493,8 +594,10 @@ {"id":{"name":"spr_ui_but_4","path":"sprites/spr_ui_but_4/spr_ui_but_4.yy",},}, {"id":{"name":"spr_ui_hov_1","path":"sprites/spr_ui_hov_1/spr_ui_hov_1.yy",},}, {"id":{"name":"spr_ui_hov_2","path":"sprites/spr_ui_hov_2/spr_ui_hov_2.yy",},}, + {"id":{"name":"spr_mk7_left_arm","path":"sprites/spr_mk7_left_arm/spr_mk7_left_arm.yy",},}, {"id":{"name":"spr_ui_hov_3","path":"sprites/spr_ui_hov_3/spr_ui_hov_3.yy",},}, {"id":{"name":"spr_pa_hands","path":"sprites/spr_pa_hands/spr_pa_hands.yy",},}, + {"id":{"name":"spr_mk7_complex","path":"sprites/spr_mk7_complex/spr_mk7_complex.yy",},}, {"id":{"name":"scr_image","path":"scripts/scr_image/scr_image.yy",},}, {"id":{"name":"spr_ui_hov_4","path":"sprites/spr_ui_hov_4/spr_ui_hov_4.yy",},}, {"id":{"name":"spr_settings_button","path":"sprites/spr_settings_button/spr_settings_button.yy",},}, @@ -532,8 +635,10 @@ {"id":{"name":"dsgsdgsdg","path":"sprites/dsgsdgsdg/dsgsdgsdg.yy",},}, {"id":{"name":"spr_loading","path":"sprites/spr_loading/spr_loading.yy",},}, {"id":{"name":"spr_loading2","path":"sprites/spr_loading2/spr_loading2.yy",},}, + {"id":{"name":"spr_mk4_left_trim","path":"sprites/spr_mk4_left_trim/spr_mk4_left_trim.yy",},}, {"id":{"name":"spr_penitent_ui","path":"sprites/spr_penitent_ui/spr_penitent_ui.yy",},}, {"id":{"name":"sprite230","path":"sprites/sprite230/sprite230.yy",},}, + {"id":{"name":"spr_mk3_left_arm","path":"sprites/spr_mk3_left_arm/spr_mk3_left_arm.yy",},}, {"id":{"name":"spr_fast_forward","path":"sprites/spr_fast_forward/spr_fast_forward.yy",},}, {"id":{"name":"spr_psy_hood","path":"sprites/spr_psy_hood/spr_psy_hood.yy",},}, {"id":{"name":"spr_view_small","path":"sprites/spr_view_small/spr_view_small.yy",},}, @@ -545,13 +650,17 @@ {"id":{"name":"spr_disposition","path":"sprites/spr_disposition/spr_disposition.yy",},}, {"id":{"name":"spr_laurel","path":"sprites/spr_laurel/spr_laurel.yy",},}, {"id":{"name":"spr_disposition_small","path":"sprites/spr_disposition_small/spr_disposition_small.yy",},}, + {"id":{"name":"spr_indomitus_right_arm_bionic","path":"sprites/spr_indomitus_right_arm_bionic/spr_indomitus_right_arm_bionic.yy",},}, {"id":{"name":"spr_planets","path":"sprites/spr_planets/spr_planets.yy",},}, {"id":{"name":"sprite134","path":"sprites/sprite134/sprite134.yy",},}, {"id":{"name":"spr_star_screen","path":"sprites/spr_star_screen/spr_star_screen.yy",},}, + {"id":{"name":"spr_artificer_chest","path":"sprites/spr_artificer_chest/spr_artificer_chest.yy",},}, {"id":{"name":"spr_planet_screen","path":"sprites/spr_planet_screen/spr_planet_screen.yy",},}, {"id":{"name":"spr_red_button","path":"sprites/spr_red_button/spr_red_button.yy",},}, + {"id":{"name":"spr_pack_brazier2","path":"sprites/spr_pack_brazier2/spr_pack_brazier2.yy",},}, {"id":{"name":"spr_popup","path":"sprites/spr_popup/spr_popup.yy",},}, {"id":{"name":"spr_attacked","path":"sprites/spr_attacked/spr_attacked.yy",},}, + {"id":{"name":"scr_unit_traits","path":"scripts/scr_unit_traits/scr_unit_traits.yy",},}, {"id":{"name":"scr_marine_struct","path":"scripts/scr_marine_struct/scr_marine_struct.yy",},}, {"id":{"name":"spr_raid","path":"sprites/spr_raid/spr_raid.yy",},}, {"id":{"name":"spr_purge_1","path":"sprites/spr_purge_1/spr_purge_1.yy",},}, @@ -561,8 +670,11 @@ {"id":{"name":"spr_advisors","path":"sprites/spr_advisors/spr_advisors.yy",},}, {"id":{"name":"spr_diplomacy","path":"sprites/spr_diplomacy/spr_diplomacy.yy",},}, {"id":{"name":"spr_maximus_colors2","path":"sprites/spr_maximus_colors2/spr_maximus_colors2.yy",},}, + {"id":{"name":"spr_indomitus_leg_variants","path":"sprites/spr_indomitus_leg_variants/spr_indomitus_leg_variants.yy",},}, {"id":{"name":"spr_diplomacy_dae","path":"sprites/spr_diplomacy_dae/spr_diplomacy_dae.yy",},}, {"id":{"name":"sprite267","path":"sprites/sprite267/sprite267.yy",},}, + {"id":{"name":"spr_mk4_left_arm","path":"sprites/spr_mk4_left_arm/spr_mk4_left_arm.yy",},}, + {"id":{"name":"scr_sprite_functions","path":"scripts/scr_sprite_functions/scr_sprite_functions.yy",},}, {"id":{"name":"spr_master_splash","path":"sprites/spr_master_splash/spr_master_splash.yy",},}, {"id":{"name":"spr_saveload","path":"sprites/spr_saveload/spr_saveload.yy",},}, {"id":{"name":"spr_sw_mk5_helm","path":"sprites/spr_sw_mk5_helm/spr_sw_mk5_helm.yy",},}, @@ -570,7 +682,9 @@ {"id":{"name":"spr_diplomacy_med","path":"sprites/spr_diplomacy_med/spr_diplomacy_med.yy",},}, {"id":{"name":"spr_diplomacy_defeated","path":"sprites/spr_diplomacy_defeated/spr_diplomacy_defeated.yy",},}, {"id":{"name":"sprite266","path":"sprites/sprite266/sprite266.yy",},}, + {"id":{"name":"spr_mk3_complex_backpack","path":"sprites/spr_mk3_complex_backpack/spr_mk3_complex_backpack.yy",},}, {"id":{"name":"spr_ship_song","path":"sprites/spr_ship_song/spr_ship_song.yy",},}, + {"id":{"name":"spr_tartaros_left_arm","path":"sprites/spr_tartaros_left_arm/spr_tartaros_left_arm.yy",},}, {"id":{"name":"sprite235","path":"sprites/sprite235/sprite235.yy",},}, {"id":{"name":"spr_bionics_leg_2","path":"sprites/spr_bionics_leg_2/spr_bionics_leg_2.yy",},}, {"id":{"name":"spr_ship_bb","path":"sprites/spr_ship_bb/spr_ship_bb.yy",},}, @@ -582,7 +696,9 @@ {"id":{"name":"scr_draw_unit_stat_data","path":"scripts/scr_draw_unit_stat_data/scr_draw_unit_stat_data.yy",},}, {"id":{"name":"spr_ship_glad","path":"sprites/spr_ship_glad/spr_ship_glad.yy",},}, {"id":{"name":"spr_ship_hunt","path":"sprites/spr_ship_hunt/spr_ship_hunt.yy",},}, + {"id":{"name":"spr_numeral_left_knee","path":"sprites/spr_numeral_left_knee/spr_numeral_left_knee.yy",},}, {"id":{"name":"spr_luck_icon","path":"sprites/spr_luck_icon/spr_luck_icon.yy",},}, + {"id":{"name":"spr_artificer_left_pad","path":"sprites/spr_artificer_left_pad/spr_artificer_left_pad.yy",},}, {"id":{"name":"spr_ship_apoc","path":"sprites/spr_ship_apoc/spr_ship_apoc.yy",},}, {"id":{"name":"spr_ship_nem","path":"sprites/spr_ship_nem/spr_ship_nem.yy",},}, {"id":{"name":"spr_ship_aven","path":"sprites/spr_ship_aven/spr_ship_aven.yy",},}, @@ -599,10 +715,13 @@ {"id":{"name":"spr_ship_craftworld","path":"sprites/spr_ship_craftworld/spr_ship_craftworld.yy",},}, {"id":{"name":"spr_binders_robes","path":"sprites/spr_binders_robes/spr_binders_robes.yy",},}, {"id":{"name":"spr_helm_decorations","path":"sprites/spr_helm_decorations/spr_helm_decorations.yy",},}, + {"id":{"name":"spr_ws_mk7_scar_of_the_ancients","path":"sprites/spr_ws_mk7_scar_of_the_ancients/spr_ws_mk7_scar_of_the_ancients.yy",},}, {"id":{"name":"spr_ship_ammer","path":"sprites/spr_ship_ammer/spr_ship_ammer.yy",},}, + {"id":{"name":"spr_weapon_autocannon2","path":"sprites/spr_weapon_autocannon2/spr_weapon_autocannon2.yy",},}, {"id":{"name":"scr_diplomacy_helpers","path":"scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.yy",},}, {"id":{"name":"spr_dread_iron_clad","path":"sprites/spr_dread_iron_clad/spr_dread_iron_clad.yy",},}, {"id":{"name":"scr_has_adv","path":"scripts/scr_has_adv/scr_has_adv.yy",},}, + {"id":{"name":"spr_mk3_right_trim","path":"sprites/spr_mk3_right_trim/spr_mk3_right_trim.yy",},}, {"id":{"name":"spr_ship_deth","path":"sprites/spr_ship_deth/spr_ship_deth.yy",},}, {"id":{"name":"spr_ship_gorbag","path":"sprites/spr_ship_gorbag/spr_ship_gorbag.yy",},}, {"id":{"name":"spr_ship_kroozer","path":"sprites/spr_ship_kroozer/spr_ship_kroozer.yy",},}, @@ -611,17 +730,21 @@ {"id":{"name":"spr_ih_mk6_helm","path":"sprites/spr_ih_mk6_helm/spr_ih_mk6_helm.yy",},}, {"id":{"name":"spr_mk5_colors","path":"sprites/spr_mk5_colors/spr_mk5_colors.yy",},}, {"id":{"name":"spr_ship_slam","path":"sprites/spr_ship_slam/spr_ship_slam.yy",},}, + {"id":{"name":"spr_mk7_right_trim","path":"sprites/spr_mk7_right_trim/spr_mk7_right_trim.yy",},}, {"id":{"name":"spr_ship_hulk","path":"sprites/spr_ship_hulk/spr_ship_hulk.yy",},}, {"id":{"name":"spr_fighta","path":"sprites/spr_fighta/spr_fighta.yy",},}, + {"id":{"name":"spr_weapon_comgrav","path":"sprites/spr_weapon_comgrav/spr_weapon_comgrav.yy",},}, {"id":{"name":"spr_weapon_hand_flamer","path":"sprites/spr_weapon_hand_flamer/spr_weapon_hand_flamer.yy",},}, {"id":{"name":"spr_ship_void","path":"sprites/spr_ship_void/spr_ship_void.yy",},}, {"id":{"name":"spr_faith_icon","path":"sprites/spr_faith_icon/spr_faith_icon.yy",},}, {"id":{"name":"spr_mk7_colors","path":"sprites/spr_mk7_colors/spr_mk7_colors.yy",},}, {"id":{"name":"spr_mk4_colors","path":"sprites/spr_mk4_colors/spr_mk4_colors.yy",},}, {"id":{"name":"spr_ship_shadow","path":"sprites/spr_ship_shadow/spr_ship_shadow.yy",},}, + {"id":{"name":"spr_mk4_complex_backpack","path":"sprites/spr_mk4_complex_backpack/spr_mk4_complex_backpack.yy",},}, {"id":{"name":"spr_ws_mk5_helm","path":"sprites/spr_ws_mk5_helm/spr_ws_mk5_helm.yy",},}, {"id":{"name":"spr_ship_aconite","path":"sprites/spr_ship_aconite/spr_ship_aconite.yy",},}, {"id":{"name":"spr_ship_hellebore","path":"sprites/spr_ship_hellebore/spr_ship_hellebore.yy",},}, + {"id":{"name":"spr_mk5_right_arm","path":"sprites/spr_mk5_right_arm/spr_mk5_right_arm.yy",},}, {"id":{"name":"spr_darkstar","path":"sprites/spr_darkstar/spr_darkstar.yy",},}, {"id":{"name":"sprite221","path":"sprites/sprite221/sprite221.yy",},}, {"id":{"name":"spr_ship_custodian","path":"sprites/spr_ship_custodian/spr_ship_custodian.yy",},}, @@ -634,6 +757,8 @@ {"id":{"name":"spr_manta","path":"sprites/spr_manta/spr_manta.yy",},}, {"id":{"name":"spr_ship_leviathan","path":"sprites/spr_ship_leviathan/spr_ship_leviathan.yy",},}, {"id":{"name":"spr_ship_razorfiend","path":"sprites/spr_ship_razorfiend/spr_ship_razorfiend.yy",},}, + {"id":{"name":"spr_mk7_right_arm","path":"sprites/spr_mk7_right_arm/spr_mk7_right_arm.yy",},}, + {"id":{"name":"spr_artificer_left_trim","path":"sprites/spr_artificer_left_trim/spr_artificer_left_trim.yy",},}, {"id":{"name":"scr_wait_and_execute","path":"scripts/scr_wait_and_execute/scr_wait_and_execute.yy",},}, {"id":{"name":"spr_ship_stalker","path":"sprites/spr_ship_stalker/spr_ship_stalker.yy",},}, {"id":{"name":"spr_weapon_plasc","path":"sprites/spr_weapon_plasc/spr_weapon_plasc.yy",},}, @@ -646,6 +771,7 @@ {"id":{"name":"spr_dread_claw","path":"sprites/spr_dread_claw/spr_dread_claw.yy",},}, {"id":{"name":"spr_ship_reaper","path":"sprites/spr_ship_reaper/spr_ship_reaper.yy",},}, {"id":{"name":"spr_ship_shroud","path":"sprites/spr_ship_shroud/spr_ship_shroud.yy",},}, + {"id":{"name":"spr_techmarine_complex","path":"sprites/spr_techmarine_complex/spr_techmarine_complex.yy",},}, {"id":{"name":"spr_ship_jackal","path":"sprites/spr_ship_jackal/spr_ship_jackal.yy",},}, {"id":{"name":"spr_ship_dirge","path":"sprites/spr_ship_dirge/spr_ship_dirge.yy",},}, {"id":{"name":"spr_ship_dese","path":"sprites/spr_ship_dese/spr_ship_dese.yy",},}, @@ -672,7 +798,11 @@ {"id":{"name":"spr_battle_block2","path":"sprites/spr_battle_block2/spr_battle_block2.yy",},}, {"id":{"name":"spr_weapon_storm2","path":"sprites/spr_weapon_storm2/spr_weapon_storm2.yy",},}, {"id":{"name":"spr_rg_mk7_helm","path":"sprites/spr_rg_mk7_helm/spr_rg_mk7_helm.yy",},}, + {"id":{"name":"scr_apothecarium","path":"scripts/scr_apothecarium/scr_apothecarium.yy",},}, {"id":{"name":"spr_pa_arms","path":"sprites/spr_pa_arms/spr_pa_arms.yy",},}, + {"id":{"name":"spr_indomitus_right_leg_bionic","path":"sprites/spr_indomitus_right_leg_bionic/spr_indomitus_right_leg_bionic.yy",},}, + {"id":{"name":"scr_complex_colour_kit","path":"scripts/scr_complex_colour_kit/scr_complex_colour_kit.yy",},}, + {"id":{"name":"spr_tartaros_right_leg","path":"sprites/spr_tartaros_right_leg/spr_tartaros_right_leg.yy",},}, {"id":{"name":"spr_ws_mk6_helm","path":"sprites/spr_ws_mk6_helm/spr_ws_mk6_helm.yy",},}, {"id":{"name":"spr_postbattle","path":"sprites/spr_postbattle/spr_postbattle.yy",},}, {"id":{"name":"spr_postbattle_space","path":"sprites/spr_postbattle_space/spr_postbattle_space.yy",},}, @@ -684,18 +814,24 @@ {"id":{"name":"spr_dread_plasma_cannon","path":"sprites/spr_dread_plasma_cannon/spr_dread_plasma_cannon.yy",},}, {"id":{"name":"spr_melta","path":"sprites/spr_melta/spr_melta.yy",},}, {"id":{"name":"spr_carrion_breath","path":"sprites/spr_carrion_breath/spr_carrion_breath.yy",},}, + {"id":{"name":"spr_tartaros_left_trim","path":"sprites/spr_tartaros_left_trim/spr_tartaros_left_trim.yy",},}, {"id":{"name":"spr_bullet","path":"sprites/spr_bullet/spr_bullet.yy",},}, + {"id":{"name":"Sprite544","path":"sprites/Sprite544/Sprite544.yy",},}, {"id":{"name":"spr_tech_area_pad","path":"sprites/spr_tech_area_pad/spr_tech_area_pad.yy",},}, {"id":{"name":"spr_bolt","path":"sprites/spr_bolt/spr_bolt.yy",},}, {"id":{"name":"spr_pulse","path":"sprites/spr_pulse/spr_pulse.yy",},}, + {"id":{"name":"spr_indomitus_right_eye_bionic","path":"sprites/spr_indomitus_right_eye_bionic/spr_indomitus_right_eye_bionic.yy",},}, {"id":{"name":"spr_railgun","path":"sprites/spr_railgun/spr_railgun.yy",},}, + {"id":{"name":"spr_mk7_full_colour","path":"sprites/spr_mk7_full_colour/spr_mk7_full_colour.yy",},}, {"id":{"name":"spr_ground_las","path":"sprites/spr_ground_las/spr_ground_las.yy",},}, {"id":{"name":"spr_weapon_standard2","path":"sprites/spr_weapon_standard2/spr_weapon_standard2.yy",},}, {"id":{"name":"spr_green_las","path":"sprites/spr_green_las/spr_green_las.yy",},}, {"id":{"name":"spr_ground_conv","path":"sprites/spr_ground_conv/spr_ground_conv.yy",},}, + {"id":{"name":"spr_mk4_right_trim","path":"sprites/spr_mk4_right_trim/spr_mk4_right_trim.yy",},}, {"id":{"name":"spr_ground_plasma","path":"sprites/spr_ground_plasma/spr_ground_plasma.yy",},}, {"id":{"name":"spr_glob","path":"sprites/spr_glob/spr_glob.yy",},}, {"id":{"name":"spr_cannon","path":"sprites/spr_cannon/spr_cannon.yy",},}, + {"id":{"name":"spr_artificer_mouth","path":"sprites/spr_artificer_mouth/spr_artificer_mouth.yy",},}, {"id":{"name":"spr_rocket","path":"sprites/spr_rocket/spr_rocket.yy",},}, {"id":{"name":"spr_rocket_ork","path":"sprites/spr_rocket_ork/spr_rocket_ork.yy",},}, {"id":{"name":"spr_rocket_whirl","path":"sprites/spr_rocket_whirl/spr_rocket_whirl.yy",},}, @@ -705,10 +841,12 @@ {"id":{"name":"UIComponents","path":"scripts/UIComponents/UIComponents.yy",},}, {"id":{"name":"spr_mahreen_gun","path":"sprites/spr_mahreen_gun/spr_mahreen_gun.yy",},}, {"id":{"name":"spr_star","path":"sprites/spr_star/spr_star.yy",},}, + {"id":{"name":"spr_mk3_right_arm","path":"sprites/spr_mk3_right_arm/spr_mk3_right_arm.yy",},}, {"id":{"name":"spr_da_mk5","path":"sprites/spr_da_mk5/spr_da_mk5.yy",},}, {"id":{"name":"spr_dexterity_icon","path":"sprites/spr_dexterity_icon/spr_dexterity_icon.yy",},}, {"id":{"name":"spr_star_hulk","path":"sprites/spr_star_hulk/spr_star_hulk.yy",},}, {"id":{"name":"spr_warp_storm","path":"sprites/spr_warp_storm/spr_warp_storm.yy",},}, + {"id":{"name":"spr_mk4_right_arm","path":"sprites/spr_mk4_right_arm/spr_mk4_right_arm.yy",},}, {"id":{"name":"sprite205","path":"sprites/sprite205/sprite205.yy",},}, {"id":{"name":"spr_happenings_green","path":"sprites/spr_happenings_green/spr_happenings_green.yy",},}, {"id":{"name":"spr_happenings_red","path":"sprites/spr_happenings_red/spr_happenings_red.yy",},}, @@ -724,6 +862,7 @@ {"id":{"name":"spr_ih_mk5_helm","path":"sprites/spr_ih_mk5_helm/spr_ih_mk5_helm.yy",},}, {"id":{"name":"spr_fleet_imperial","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},}, {"id":{"name":"light_dark_shader","path":"shaders/light_dark_shader/light_dark_shader.yy",},}, + {"id":{"name":"spr_indomitus_chest_variants","path":"sprites/spr_indomitus_chest_variants/spr_indomitus_chest_variants.yy",},}, {"id":{"name":"spr_fleet_mechanicus","path":"sprites/spr_fleet_mechanicus/spr_fleet_mechanicus.yy",},}, {"id":{"name":"spr_mm_glow","path":"sprites/spr_mm_glow/spr_mm_glow.yy",},}, {"id":{"name":"spr_fleet_inquisition","path":"sprites/spr_fleet_inquisition/spr_fleet_inquisition.yy",},}, @@ -738,13 +877,16 @@ {"id":{"name":"spr_ork_target","path":"sprites/spr_ork_target/spr_ork_target.yy",},}, {"id":{"name":"sprite269","path":"sprites/sprite269/sprite269.yy",},}, {"id":{"name":"spr_mar_fire_body1","path":"sprites/spr_mar_fire_body1/spr_mar_fire_body1.yy",},}, + {"id":{"name":"spr_tartaros_complex","path":"sprites/spr_tartaros_complex/spr_tartaros_complex.yy",},}, {"id":{"name":"spr_mar_fire_body2","path":"sprites/spr_mar_fire_body2/spr_mar_fire_body2.yy",},}, {"id":{"name":"spr_mar_fire_body3","path":"sprites/spr_mar_fire_body3/spr_mar_fire_body3.yy",},}, {"id":{"name":"spr_mar_fire_pauldron1","path":"sprites/spr_mar_fire_pauldron1/spr_mar_fire_pauldron1.yy",},}, {"id":{"name":"spr_mar_fire_pauldron2","path":"sprites/spr_mar_fire_pauldron2/spr_mar_fire_pauldron2.yy",},}, + {"id":{"name":"spr_mk7_complex_backpack","path":"sprites/spr_mk7_complex_backpack/spr_mk7_complex_backpack.yy",},}, {"id":{"name":"spr_mar_walk_body1","path":"sprites/spr_mar_walk_body1/spr_mar_walk_body1.yy",},}, {"id":{"name":"spr_mar_walk_body2","path":"sprites/spr_mar_walk_body2/spr_mar_walk_body2.yy",},}, {"id":{"name":"spr_mar_walk_body3","path":"sprites/spr_mar_walk_body3/spr_mar_walk_body3.yy",},}, + {"id":{"name":"spr_tartaros_faceplate","path":"sprites/spr_tartaros_faceplate/spr_tartaros_faceplate.yy",},}, {"id":{"name":"spr_mar_walk_pauldron1","path":"sprites/spr_mar_walk_pauldron1/spr_mar_walk_pauldron1.yy",},}, {"id":{"name":"spr_mar_walk_pauldron2","path":"sprites/spr_mar_walk_pauldron2/spr_mar_walk_pauldron2.yy",},}, {"id":{"name":"spr_mar_walk_legs1","path":"sprites/spr_mar_walk_legs1/spr_mar_walk_legs1.yy",},}, @@ -765,11 +907,13 @@ {"id":{"name":"snd_prologue","path":"sounds/snd_prologue/snd_prologue.yy",},}, {"id":{"name":"spr_weapon_chainfist","path":"sprites/spr_weapon_chainfist/spr_weapon_chainfist.yy",},}, {"id":{"name":"snd_royal","path":"sounds/snd_royal/snd_royal.yy",},}, + {"id":{"name":"spr_techmarine_chest","path":"sprites/spr_techmarine_chest/spr_techmarine_chest.yy",},}, {"id":{"name":"snd_vode","path":"sounds/snd_vode/snd_vode.yy",},}, {"id":{"name":"snd_battle","path":"sounds/snd_battle/snd_battle.yy",},}, {"id":{"name":"snd_postbattle","path":"sounds/snd_postbattle/snd_postbattle.yy",},}, {"id":{"name":"snd_defeat","path":"sounds/snd_defeat/snd_defeat.yy",},}, {"id":{"name":"snd_buzz","path":"sounds/snd_buzz/snd_buzz.yy",},}, + {"id":{"name":"spr_indomitus_right_arm","path":"sprites/spr_indomitus_right_arm/spr_indomitus_right_arm.yy",},}, {"id":{"name":"scr_unit_quick_find_pane","path":"scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.yy",},}, {"id":{"name":"snd_redownload","path":"sounds/snd_redownload/snd_redownload.yy",},}, {"id":{"name":"snd_click","path":"sounds/snd_click/snd_click.yy",},}, @@ -809,12 +953,15 @@ {"id":{"name":"scr_json_functions","path":"scripts/scr_json_functions/scr_json_functions.yy",},}, {"id":{"name":"scr_colors_initialize","path":"scripts/scr_colors_initialize/scr_colors_initialize.yy",},}, {"id":{"name":"scr_shader_initialize","path":"scripts/scr_shader_initialize/scr_shader_initialize.yy",},}, + {"id":{"name":"spr_indomitus_complex","path":"sprites/spr_indomitus_complex/spr_indomitus_complex.yy",},}, {"id":{"name":"spr_sal_mk6_helm","path":"sprites/spr_sal_mk6_helm/spr_sal_mk6_helm.yy",},}, + {"id":{"name":"spr_mk4_chest_variants","path":"sprites/spr_mk4_chest_variants/spr_mk4_chest_variants.yy",},}, {"id":{"name":"spr_weapon_boarding","path":"sprites/spr_weapon_boarding/spr_weapon_boarding.yy",},}, {"id":{"name":"spr_bionics_hand","path":"sprites/spr_bionics_hand/spr_bionics_hand.yy",},}, {"id":{"name":"explode_script","path":"scripts/explode_script/explode_script.yy",},}, {"id":{"name":"relative_direction","path":"scripts/relative_direction/relative_direction.yy",},}, {"id":{"name":"draw_line_dashed","path":"scripts/draw_line_dashed/draw_line_dashed.yy",},}, + {"id":{"name":"spr_mk7_mouth_variants","path":"sprites/spr_mk7_mouth_variants/spr_mk7_mouth_variants.yy",},}, {"id":{"name":"turn_towards_point","path":"scripts/turn_towards_point/turn_towards_point.yy",},}, {"id":{"name":"spr_forge_points_icon","path":"sprites/spr_forge_points_icon/spr_forge_points_icon.yy",},}, {"id":{"name":"scr_display_number","path":"scripts/scr_display_number/scr_display_number.yy",},}, @@ -827,8 +974,7 @@ {"id":{"name":"scr_lines_increase","path":"scripts/scr_lines_increase/scr_lines_increase.yy",},}, {"id":{"name":"scr_save","path":"scripts/scr_save/scr_save.yy",},}, {"id":{"name":"scr_load","path":"scripts/scr_load/scr_load.yy",},}, - {"id":{"name":"file_encrypt","path":"scripts/file_encrypt/file_encrypt.yy",},}, - {"id":{"name":"file_decrypt","path":"scripts/file_decrypt/file_decrypt.yy",},}, + {"id":{"name":"spr_indomitus_left_leg_bionic","path":"sprites/spr_indomitus_left_leg_bionic/spr_indomitus_left_leg_bionic.yy",},}, {"id":{"name":"spr_charisma_icon","path":"sprites/spr_charisma_icon/spr_charisma_icon.yy",},}, {"id":{"name":"spr_weapon_hflamer","path":"sprites/spr_weapon_hflamer/spr_weapon_hflamer.yy",},}, {"id":{"name":"spr_mk8_colors","path":"sprites/spr_mk8_colors/spr_mk8_colors.yy",},}, @@ -842,6 +988,7 @@ {"id":{"name":"spr_servo_arm","path":"sprites/spr_servo_arm/spr_servo_arm.yy",},}, {"id":{"name":"scr_battle_roster","path":"scripts/scr_battle_roster/scr_battle_roster.yy",},}, {"id":{"name":"scr_civil_roster","path":"scripts/scr_civil_roster/scr_civil_roster.yy",},}, + {"id":{"name":"scr_specialist_points","path":"scripts/scr_specialist_points/scr_specialist_points.yy",},}, {"id":{"name":"spr_constitution_icon","path":"sprites/spr_constitution_icon/spr_constitution_icon.yy",},}, {"id":{"name":"scr_battle_sort","path":"scripts/scr_battle_sort/scr_battle_sort.yy",},}, {"id":{"name":"spr_gear_combat_shield","path":"sprites/spr_gear_combat_shield/spr_gear_combat_shield.yy",},}, @@ -849,8 +996,12 @@ {"id":{"name":"scr_count_forces","path":"scripts/scr_count_forces/scr_count_forces.yy",},}, {"id":{"name":"spr_weapon_powmace","path":"sprites/spr_weapon_powmace/spr_weapon_powmace.yy",},}, {"id":{"name":"scr_dead_marines","path":"scripts/scr_dead_marines/scr_dead_marines.yy",},}, + {"id":{"name":"spr_ws_mk3__pualdron_veteran","path":"sprites/spr_ws_mk3__pualdron_veteran/spr_ws_mk3__pualdron_veteran.yy",},}, + {"id":{"name":"spr_indomitus_left_eye_bionic","path":"sprites/spr_indomitus_left_eye_bionic/spr_indomitus_left_eye_bionic.yy",},}, + {"id":{"name":"scr_specialist_point_handler","path":"scripts/scr_specialist_point_handler/scr_specialist_point_handler.yy",},}, {"id":{"name":"scr_ini_ship_cleanup","path":"scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.yy",},}, {"id":{"name":"spr_ultra_honor_guard","path":"sprites/spr_ultra_honor_guard/spr_ultra_honor_guard.yy",},}, + {"id":{"name":"spr_mk4_mouth_variants","path":"sprites/spr_mk4_mouth_variants/spr_mk4_mouth_variants.yy",},}, {"id":{"name":"scr_punit_combat_heplers","path":"scripts/scr_punit_combat_heplers/scr_punit_combat_heplers.yy",},}, {"id":{"name":"spr_weapon_powspear3","path":"sprites/spr_weapon_powspear3/spr_weapon_powspear3.yy",},}, {"id":{"name":"scr_drop_fiddle","path":"scripts/scr_drop_fiddle/scr_drop_fiddle.yy",},}, @@ -868,11 +1019,11 @@ {"id":{"name":"scr_weapon","path":"scripts/scr_weapon/scr_weapon.yy",},}, {"id":{"name":"UINodeScripts","path":"scripts/UINodeScripts/UINodeScripts.yy",},}, {"id":{"name":"scr_move_unit_info","path":"scripts/scr_move_unit_info/scr_move_unit_info.yy",},}, + {"id":{"name":"spr_indomitus_backpack_variants","path":"sprites/spr_indomitus_backpack_variants/spr_indomitus_backpack_variants.yy",},}, {"id":{"name":"scr_en_weapon","path":"scripts/scr_en_weapon/scr_en_weapon.yy",},}, - {"id":{"name":"scr_special_weapon","path":"scripts/scr_special_weapon/scr_special_weapon.yy",},}, {"id":{"name":"spr_narthecium_2","path":"sprites/spr_narthecium_2/spr_narthecium_2.yy",},}, {"id":{"name":"scr_vehicle_weapon","path":"scripts/scr_vehicle_weapon/scr_vehicle_weapon.yy",},}, - {"id":{"name":"scr_wep_abbreviate","path":"scripts/scr_wep_abbreviate/scr_wep_abbreviate.yy",},}, + {"id":{"name":"scr_sprite_helpers","path":"scripts/scr_sprite_helpers/scr_sprite_helpers.yy",},}, {"id":{"name":"scr_scrollbar","path":"scripts/scr_scrollbar/scr_scrollbar.yy",},}, {"id":{"name":"scr_thought","path":"scripts/scr_thought/scr_thought.yy",},}, {"id":{"name":"scr_ui_refresh","path":"scripts/scr_ui_refresh/scr_ui_refresh.yy",},}, @@ -882,6 +1033,7 @@ {"id":{"name":"scr_ui_display_weapons","path":"scripts/scr_ui_display_weapons/scr_ui_display_weapons.yy",},}, {"id":{"name":"scr_company_view","path":"scripts/scr_company_view/scr_company_view.yy",},}, {"id":{"name":"scr_company_order","path":"scripts/scr_company_order/scr_company_order.yy",},}, + {"id":{"name":"spr_artificer_armour","path":"sprites/spr_artificer_armour/spr_artificer_armour.yy",},}, {"id":{"name":"scr_special_view","path":"scripts/scr_special_view/scr_special_view.yy",},}, {"id":{"name":"spr_p_name_bg","path":"sprites/spr_p_name_bg/spr_p_name_bg.yy",},}, {"id":{"name":"scr_company_load","path":"scripts/scr_company_load/scr_company_load.yy",},}, @@ -891,16 +1043,18 @@ {"id":{"name":"scr_ui_diplomacy","path":"scripts/scr_ui_diplomacy/scr_ui_diplomacy.yy",},}, {"id":{"name":"scr_ui_popup","path":"scripts/scr_ui_popup/scr_ui_popup.yy",},}, {"id":{"name":"spr_weapon_plasma_cannon_term","path":"sprites/spr_weapon_plasma_cannon_term/spr_weapon_plasma_cannon_term.yy",},}, + {"id":{"name":"spr_weapon_commelta","path":"sprites/spr_weapon_commelta/spr_weapon_commelta.yy",},}, {"id":{"name":"scr_ui_formation_bars","path":"scripts/scr_ui_formation_bars/scr_ui_formation_bars.yy",},}, {"id":{"name":"scr_ui_settings","path":"scripts/scr_ui_settings/scr_ui_settings.yy",},}, {"id":{"name":"scr_arti_descr","path":"scripts/scr_arti_descr/scr_arti_descr.yy",},}, {"id":{"name":"spr_terminator_chap","path":"sprites/spr_terminator_chap/spr_terminator_chap.yy",},}, {"id":{"name":"spr_sal_mk7_helm","path":"sprites/spr_sal_mk7_helm/spr_sal_mk7_helm.yy",},}, {"id":{"name":"scr_draw_rainbow","path":"scripts/scr_draw_rainbow/scr_draw_rainbow.yy",},}, - {"id":{"name":"scr_weapons_equip","path":"scripts/scr_weapons_equip/scr_weapons_equip.yy",},}, + {"id":{"name":"scr_get_item_names","path":"scripts/scr_get_item_names/scr_get_item_names.yy",},}, {"id":{"name":"spr_chap_area_pad","path":"sprites/spr_chap_area_pad/spr_chap_area_pad.yy",},}, {"id":{"name":"scr_master_loc","path":"scripts/scr_master_loc/scr_master_loc.yy",},}, {"id":{"name":"scr_creation","path":"scripts/scr_creation/scr_creation.yy",},}, + {"id":{"name":"spr_tartaros_right_trim","path":"sprites/spr_tartaros_right_trim/spr_tartaros_right_trim.yy",},}, {"id":{"name":"scr_unit_size","path":"scripts/scr_unit_size/scr_unit_size.yy",},}, {"id":{"name":"scr_item_count","path":"scripts/scr_item_count/scr_item_count.yy",},}, {"id":{"name":"scr_marine_count","path":"scripts/scr_marine_count/scr_marine_count.yy",},}, @@ -915,6 +1069,7 @@ {"id":{"name":"scr_event_dudes","path":"scripts/scr_event_dudes/scr_event_dudes.yy",},}, {"id":{"name":"scr_event_newlines","path":"scripts/scr_event_newlines/scr_event_newlines.yy",},}, {"id":{"name":"spr_generic_terminator_sgt","path":"sprites/spr_generic_terminator_sgt/spr_generic_terminator_sgt.yy",},}, + {"id":{"name":"spr_indomitus_left_arm_bionic","path":"sprites/spr_indomitus_left_arm_bionic/spr_indomitus_left_arm_bionic.yy",},}, {"id":{"name":"scr_event_gossip","path":"scripts/scr_event_gossip/scr_event_gossip.yy",},}, {"id":{"name":"spr_weapon_grav_cannon","path":"sprites/spr_weapon_grav_cannon/spr_weapon_grav_cannon.yy",},}, {"id":{"name":"scr_alert","path":"scripts/scr_alert/scr_alert.yy",},}, @@ -931,6 +1086,7 @@ {"id":{"name":"spr_bionics_leg","path":"sprites/spr_bionics_leg/spr_bionics_leg.yy",},}, {"id":{"name":"spr_bionics_eye","path":"sprites/spr_bionics_eye/spr_bionics_eye.yy",},}, {"id":{"name":"spr_bionics_arm","path":"sprites/spr_bionics_arm/spr_bionics_arm.yy",},}, + {"id":{"name":"spr_bionics_arm_2","path":"sprites/spr_bionics_arm_2/spr_bionics_arm_2.yy",},}, {"id":{"name":"scr_enemy_ai_c","path":"scripts/scr_enemy_ai_c/scr_enemy_ai_c.yy",},}, {"id":{"name":"spr_ship_back_white","path":"sprites/spr_ship_back_white/spr_ship_back_white.yy",},}, {"id":{"name":"scr_enemy_ai_d","path":"scripts/scr_enemy_ai_d/scr_enemy_ai_d.yy",},}, @@ -939,6 +1095,7 @@ {"id":{"name":"scr_string_functions","path":"scripts/scr_string_functions/scr_string_functions.yy",},}, {"id":{"name":"scr_income","path":"scripts/scr_income/scr_income.yy",},}, {"id":{"name":"scr_apothecary_ship","path":"scripts/scr_apothecary_ship/scr_apothecary_ship.yy",},}, + {"id":{"name":"spr_mk3_complex","path":"sprites/spr_mk3_complex/spr_mk3_complex.yy",},}, {"id":{"name":"scr_apothecary_ground","path":"scripts/scr_apothecary_ground/scr_apothecary_ground.yy",},}, {"id":{"name":"scr_mission_eta","path":"scripts/scr_mission_eta/scr_mission_eta.yy",},}, {"id":{"name":"obj_garbage_collector","path":"objects/obj_garbage_collector/obj_garbage_collector.yy",},}, @@ -947,8 +1104,13 @@ {"id":{"name":"scr_random_event","path":"scripts/scr_random_event/scr_random_event.yy",},}, {"id":{"name":"obj_planet_map","path":"objects/obj_planet_map/obj_planet_map.yy",},}, {"id":{"name":"scr_khornate_fleet_functions","path":"scripts/scr_khornate_fleet_functions/scr_khornate_fleet_functions.yy",},}, + {"id":{"name":"spr_faction_icons","path":"sprites/spr_faction_icons/spr_faction_icons.yy",},}, + {"id":{"name":"spr_techmarine_right_trim","path":"sprites/spr_techmarine_right_trim/spr_techmarine_right_trim.yy",},}, + {"id":{"name":"spr_techmarine_left_trim","path":"sprites/spr_techmarine_left_trim/spr_techmarine_left_trim.yy",},}, {"id":{"name":"scr_random_find","path":"scripts/scr_random_find/scr_random_find.yy",},}, {"id":{"name":"scr_max_marine","path":"scripts/scr_max_marine/scr_max_marine.yy",},}, + {"id":{"name":"spr_mk3_left_trim","path":"sprites/spr_mk3_left_trim/spr_mk3_left_trim.yy",},}, + {"id":{"name":"spr_mk5_left_arm","path":"sprites/spr_mk5_left_arm/spr_mk5_left_arm.yy",},}, {"id":{"name":"scr_random_marine","path":"scripts/scr_random_marine/scr_random_marine.yy",},}, {"id":{"name":"scr_roman","path":"scripts/scr_roman/scr_roman.yy",},}, {"id":{"name":"scr_draw_management_unit","path":"scripts/scr_draw_management_unit/scr_draw_management_unit.yy",},}, @@ -968,13 +1130,13 @@ {"id":{"name":"spr_dread_heavy_bolter","path":"sprites/spr_dread_heavy_bolter/spr_dread_heavy_bolter.yy",},}, {"id":{"name":"spr_purity_seal","path":"sprites/spr_purity_seal/spr_purity_seal.yy",},}, {"id":{"name":"scr_zoom","path":"scripts/scr_zoom/scr_zoom.yy",},}, - {"id":{"name":"scr_chapter","path":"scripts/scr_chapter/scr_chapter.yy",},}, {"id":{"name":"scr_map_and_warp_functions","path":"scripts/scr_map_and_warp_functions/scr_map_and_warp_functions.yy",},}, + {"id":{"name":"spr_ws_mk4_monovisor","path":"sprites/spr_ws_mk4_monovisor/spr_ws_mk4_monovisor.yy",},}, {"id":{"name":"scr_chapter_new","path":"scripts/scr_chapter_new/scr_chapter_new.yy",},}, {"id":{"name":"scr_chapter_random","path":"scripts/scr_chapter_random/scr_chapter_random.yy",},}, + {"id":{"name":"spr_gear_librarian","path":"sprites/spr_gear_librarian/spr_gear_librarian.yy",},}, {"id":{"name":"scr_vehicle_order","path":"scripts/scr_vehicle_order/scr_vehicle_order.yy",},}, {"id":{"name":"scr_icon","path":"scripts/scr_icon/scr_icon.yy",},}, - {"id":{"name":"scr_squad_names","path":"scripts/scr_squad_names/scr_squad_names.yy",},}, {"id":{"name":"scr_initialize_custom","path":"scripts/scr_initialize_custom/scr_initialize_custom.yy",},}, {"id":{"name":"scr_roman_numerals","path":"scripts/scr_roman_numerals/scr_roman_numerals.yy",},}, {"id":{"name":"scr_restart_variables","path":"scripts/scr_restart_variables/scr_restart_variables.yy",},}, @@ -999,6 +1161,7 @@ {"id":{"name":"scr_add_artifact","path":"scripts/scr_add_artifact/scr_add_artifact.yy",},}, {"id":{"name":"scr_add_stc_fragment","path":"scripts/scr_add_stc_fragment/scr_add_stc_fragment.yy",},}, {"id":{"name":"action_another_room","path":"scripts/action_another_room/action_another_room.yy",},}, + {"id":{"name":"spr_tartaros_head","path":"sprites/spr_tartaros_head/spr_tartaros_head.yy",},}, {"id":{"name":"action_color","path":"scripts/action_color/action_color.yy",},}, {"id":{"name":"action_draw_ellipse","path":"scripts/action_draw_ellipse/action_draw_ellipse.yy",},}, {"id":{"name":"action_if_number","path":"scripts/action_if_number/action_if_number.yy",},}, @@ -1006,11 +1169,13 @@ {"id":{"name":"spr_medicine_icon","path":"sprites/spr_medicine_icon/spr_medicine_icon.yy",},}, {"id":{"name":"spr_ship_back_black","path":"sprites/spr_ship_back_black/spr_ship_back_black.yy",},}, {"id":{"name":"action_kill_object","path":"scripts/action_kill_object/action_kill_object.yy",},}, + {"id":{"name":"spr_tartaros_right_arm","path":"sprites/spr_tartaros_right_arm/spr_tartaros_right_arm.yy",},}, {"id":{"name":"action_restart_game","path":"scripts/action_restart_game/action_restart_game.yy",},}, {"id":{"name":"action_set_alarm","path":"scripts/action_set_alarm/action_set_alarm.yy",},}, {"id":{"name":"action_set_relative","path":"scripts/action_set_relative/action_set_relative.yy",},}, {"id":{"name":"__init_action","path":"scripts/__init_action/__init_action.yy",},}, {"id":{"name":"d3d_set_fog","path":"scripts/d3d_set_fog/d3d_set_fog.yy",},}, + {"id":{"name":"scr_PlanetData","path":"scripts/scr_PlanetData/scr_PlanetData.yy",},}, {"id":{"name":"__init_d3d","path":"scripts/__init_d3d/__init_d3d.yy",},}, {"id":{"name":"draw_set_blend_mode","path":"scripts/draw_set_blend_mode/draw_set_blend_mode.yy",},}, {"id":{"name":"instance_create","path":"scripts/instance_create/instance_create.yy",},}, @@ -1025,9 +1190,11 @@ {"id":{"name":"sReplaceColor","path":"shaders/sReplaceColor/sReplaceColor.yy",},}, {"id":{"name":"fnt_cul_14","path":"fonts/fnt_cul_14/fnt_cul_14.yy",},}, {"id":{"name":"fnt_cul_18","path":"fonts/fnt_cul_18/fnt_cul_18.yy",},}, + {"id":{"name":"spr_mk4_leg_variants","path":"sprites/spr_mk4_leg_variants/spr_mk4_leg_variants.yy",},}, {"id":{"name":"fnt_40k_10","path":"fonts/fnt_40k_10/fnt_40k_10.yy",},}, {"id":{"name":"fnt_40k_12","path":"fonts/fnt_40k_12/fnt_40k_12.yy",},}, {"id":{"name":"fnt_40k_12i","path":"fonts/fnt_40k_12i/fnt_40k_12i.yy",},}, + {"id":{"name":"spr_indomitus_left_arm","path":"sprites/spr_indomitus_left_arm/spr_indomitus_left_arm.yy",},}, {"id":{"name":"spr_dread_autocannon","path":"sprites/spr_dread_autocannon/spr_dread_autocannon.yy",},}, {"id":{"name":"fnt_40k_14","path":"fonts/fnt_40k_14/fnt_40k_14.yy",},}, {"id":{"name":"fnt_40k_14i","path":"fonts/fnt_40k_14i/fnt_40k_14i.yy",},}, @@ -1035,14 +1202,17 @@ {"id":{"name":"fnt_40k_14b","path":"fonts/fnt_40k_14b/fnt_40k_14b.yy",},}, {"id":{"name":"fnt_40k_30b","path":"fonts/fnt_40k_30b/fnt_40k_30b.yy",},}, {"id":{"name":"spr_generic_sgt_mk6","path":"sprites/spr_generic_sgt_mk6/spr_generic_sgt_mk6.yy",},}, + {"id":{"name":"spr_artificer_thorax","path":"sprites/spr_artificer_thorax/spr_artificer_thorax.yy",},}, {"id":{"name":"spr_dante","path":"sprites/spr_dante/spr_dante.yy",},}, {"id":{"name":"spr_um_mk5_helm","path":"sprites/spr_um_mk5_helm/spr_um_mk5_helm.yy",},}, {"id":{"name":"fnt_large","path":"fonts/fnt_large/fnt_large.yy",},}, {"id":{"name":"spr_data_slate","path":"sprites/spr_data_slate/spr_data_slate.yy",},}, + {"id":{"name":"spr_techmarine_head","path":"sprites/spr_techmarine_head/spr_techmarine_head.yy",},}, {"id":{"name":"scr_inquisition_fleet_functions","path":"scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.yy",},}, {"id":{"name":"fnt_fancy","path":"fonts/fnt_fancy/fnt_fancy.yy",},}, {"id":{"name":"fnt_menu","path":"fonts/fnt_menu/fnt_menu.yy",},}, {"id":{"name":"spr_dreadnought_decorations","path":"sprites/spr_dreadnought_decorations/spr_dreadnought_decorations.yy",},}, + {"id":{"name":"spr_weapon_mace_of_absolution","path":"sprites/spr_weapon_mace_of_absolution/spr_weapon_mace_of_absolution.yy",},}, {"id":{"name":"fnt_info","path":"fonts/fnt_info/fnt_info.yy",},}, {"id":{"name":"fnt_tiny","path":"fonts/fnt_tiny/fnt_tiny.yy",},}, {"id":{"name":"scr_necron_tombs","path":"scripts/scr_necron_tombs/scr_necron_tombs.yy",},}, @@ -1050,7 +1220,10 @@ {"id":{"name":"fnt_legal","path":"fonts/fnt_legal/fnt_legal.yy",},}, {"id":{"name":"obj_fleet","path":"objects/obj_fleet/obj_fleet.yy",},}, {"id":{"name":"obj_circular","path":"objects/obj_circular/obj_circular.yy",},}, + {"id":{"name":"spr_mk4_complex","path":"sprites/spr_mk4_complex/spr_mk4_complex.yy",},}, {"id":{"name":"obj_fleet_spawner","path":"objects/obj_fleet_spawner/obj_fleet_spawner.yy",},}, + {"id":{"name":"spr_tartaros_gorget","path":"sprites/spr_tartaros_gorget/spr_tartaros_gorget.yy",},}, + {"id":{"name":"spr_mk8_gorget","path":"sprites/spr_mk8_gorget/spr_mk8_gorget.yy",},}, {"id":{"name":"obj_fleet_controller","path":"objects/obj_fleet_controller/obj_fleet_controller.yy",},}, {"id":{"name":"obj_p_ship","path":"objects/obj_p_ship/obj_p_ship.yy",},}, {"id":{"name":"scr_kill_unit","path":"scripts/scr_kill_unit/scr_kill_unit.yy",},}, @@ -1077,7 +1250,9 @@ {"id":{"name":"scr_system_search_helpers","path":"scripts/scr_system_search_helpers/scr_system_search_helpers.yy",},}, {"id":{"name":"obj_p_round","path":"objects/obj_p_round/obj_p_round.yy",},}, {"id":{"name":"spr_slate_2","path":"sprites/spr_slate_2/spr_slate_2.yy",},}, + {"id":{"name":"spr_mk7_chest_variants","path":"sprites/spr_mk7_chest_variants/spr_mk7_chest_variants.yy",},}, {"id":{"name":"obj_en_round","path":"objects/obj_en_round/obj_en_round.yy",},}, + {"id":{"name":"spr_gothic_numbers_right_pauldron","path":"sprites/spr_gothic_numbers_right_pauldron/spr_gothic_numbers_right_pauldron.yy",},}, {"id":{"name":"obj_al_round","path":"objects/obj_al_round/obj_al_round.yy",},}, {"id":{"name":"scr_keyboard_helpers","path":"scripts/scr_keyboard_helpers/scr_keyboard_helpers.yy",},}, {"id":{"name":"obj_en_pulse","path":"objects/obj_en_pulse/obj_en_pulse.yy",},}, @@ -1091,6 +1266,8 @@ {"id":{"name":"obj_enunit","path":"objects/obj_enunit/obj_enunit.yy",},}, {"id":{"name":"scr_log","path":"scripts/scr_log/scr_log.yy",},}, {"id":{"name":"obj_nfort","path":"objects/obj_nfort/obj_nfort.yy",},}, + {"id":{"name":"spr_artificer_right_leg","path":"sprites/spr_artificer_right_leg/spr_artificer_right_leg.yy",},}, + {"id":{"name":"scr_livery_setup","path":"scripts/scr_livery_setup/scr_livery_setup.yy",},}, {"id":{"name":"obj_temp1","path":"objects/obj_temp1/obj_temp1.yy",},}, {"id":{"name":"obj_temp2","path":"objects/obj_temp2/obj_temp2.yy",},}, {"id":{"name":"obj_temp3","path":"objects/obj_temp3/obj_temp3.yy",},}, @@ -1115,6 +1292,7 @@ {"id":{"name":"obj_restart_vars","path":"objects/obj_restart_vars/obj_restart_vars.yy",},}, {"id":{"name":"obj_formation_bar","path":"objects/obj_formation_bar/obj_formation_bar.yy",},}, {"id":{"name":"obj_dropdown_sel","path":"objects/obj_dropdown_sel/obj_dropdown_sel.yy",},}, + {"id":{"name":"spr_pack_brazier3","path":"sprites/spr_pack_brazier3/spr_pack_brazier3.yy",},}, {"id":{"name":"obj_enemy_leftest","path":"objects/obj_enemy_leftest/obj_enemy_leftest.yy",},}, {"id":{"name":"scr_distributions","path":"scripts/scr_distributions/scr_distributions.yy",},}, {"id":{"name":"obj_marine","path":"objects/obj_marine/obj_marine.yy",},}, @@ -1123,6 +1301,7 @@ {"id":{"name":"obj_p1_bullet","path":"objects/obj_p1_bullet/obj_p1_bullet.yy",},}, {"id":{"name":"obj_p1_bullet_miss","path":"objects/obj_p1_bullet_miss/obj_p1_bullet_miss.yy",},}, {"id":{"name":"obj_main_menu","path":"objects/obj_main_menu/obj_main_menu.yy",},}, + {"id":{"name":"spr_mk5_complex","path":"sprites/spr_mk5_complex/spr_mk5_complex.yy",},}, {"id":{"name":"obj_cuicons","path":"objects/obj_cuicons/obj_cuicons.yy",},}, {"id":{"name":"obj_img","path":"objects/obj_img/obj_img.yy",},}, {"id":{"name":"scr_manage_task_selector","path":"scripts/scr_manage_task_selector/scr_manage_task_selector.yy",},}, @@ -1131,9 +1310,12 @@ {"id":{"name":"obj_fade","path":"objects/obj_fade/obj_fade.yy",},}, {"id":{"name":"obj_defeat","path":"objects/obj_defeat/obj_defeat.yy",},}, {"id":{"name":"spr_marine_head","path":"sprites/spr_marine_head/spr_marine_head.yy",},}, + {"id":{"name":"scr_player_fleet_combat_functions","path":"scripts/scr_player_fleet_combat_functions/scr_player_fleet_combat_functions.yy",},}, + {"id":{"name":"spr_mk5_head_variants","path":"sprites/spr_mk5_head_variants/spr_mk5_head_variants.yy",},}, {"id":{"name":"obj_ini","path":"objects/obj_ini/obj_ini.yy",},}, {"id":{"name":"spr_weapon_hthhammer","path":"sprites/spr_weapon_hthhammer/spr_weapon_hthhammer.yy",},}, {"id":{"name":"obj_controller","path":"objects/obj_controller/obj_controller.yy",},}, + {"id":{"name":"spr_mk7_thorax_variants","path":"sprites/spr_mk7_thorax_variants/spr_mk7_thorax_variants.yy",},}, {"id":{"name":"obj_mass_equip","path":"objects/obj_mass_equip/obj_mass_equip.yy",},}, {"id":{"name":"obj_turn_end","path":"objects/obj_turn_end/obj_turn_end.yy",},}, {"id":{"name":"obj_saveload","path":"objects/obj_saveload/obj_saveload.yy",},}, @@ -1151,6 +1333,7 @@ {"id":{"name":"obj_popup","path":"objects/obj_popup/obj_popup.yy",},}, {"id":{"name":"obj_popup_dialogue","path":"objects/obj_popup_dialogue/obj_popup_dialogue.yy",},}, {"id":{"name":"obj_event","path":"objects/obj_event/obj_event.yy",},}, + {"id":{"name":"scr_roster","path":"scripts/scr_roster/scr_roster.yy",},}, {"id":{"name":"obj_event_log","path":"objects/obj_event_log/obj_event_log.yy",},}, {"id":{"name":"scr_get_diag_string","path":"scripts/scr_get_diag_string/scr_get_diag_string.yy",},}, {"id":{"name":"spr_apoth_area_pad","path":"sprites/spr_apoth_area_pad/spr_apoth_area_pad.yy",},}, @@ -1158,9 +1341,11 @@ {"id":{"name":"spr_rack","path":"sprites/spr_rack/spr_rack.yy",},}, {"id":{"name":"spr_da_standard","path":"sprites/spr_da_standard/spr_da_standard.yy",},}, {"id":{"name":"spr_research_bar","path":"sprites/spr_research_bar/spr_research_bar.yy",},}, + {"id":{"name":"spr_tartaros_chest","path":"sprites/spr_tartaros_chest/spr_tartaros_chest.yy",},}, {"id":{"name":"obj_crusade","path":"objects/obj_crusade/obj_crusade.yy",},}, {"id":{"name":"obj_star","path":"objects/obj_star/obj_star.yy",},}, {"id":{"name":"spr_rack_and_pinion","path":"sprites/spr_rack_and_pinion/spr_rack_and_pinion.yy",},}, + {"id":{"name":"full_livery_shader","path":"shaders/full_livery_shader/full_livery_shader.yy",},}, {"id":{"name":"obj_star_event","path":"objects/obj_star_event/obj_star_event.yy",},}, {"id":{"name":"spr_cog_pinion","path":"sprites/spr_cog_pinion/spr_cog_pinion.yy",},}, {"id":{"name":"obj_tooltip","path":"objects/obj_tooltip/obj_tooltip.yy",},}, @@ -1171,6 +1356,7 @@ {"id":{"name":"Creation","path":"rooms/Creation/Creation.yy",},}, {"id":{"name":"Game","path":"rooms/Game/Game.yy",},}, {"id":{"name":"Tutorial","path":"rooms/Tutorial/Tutorial.yy",},}, + {"id":{"name":"spr_mk3_head_variants","path":"sprites/spr_mk3_head_variants/spr_mk3_head_variants.yy",},}, {"id":{"name":"scr_draw_text","path":"scripts/scr_draw_text/scr_draw_text.yy",},}, {"id":{"name":"spr_data_slate_border","path":"sprites/spr_data_slate_border/spr_data_slate_border.yy",},}, {"id":{"name":"spr_terminator_arms","path":"sprites/spr_terminator_arms/spr_terminator_arms.yy",},}, diff --git a/datafiles/images/creation/chapters/icons/0.png b/datafiles/images/creation/chapters/icons/0.png new file mode 100644 index 000000000..b2b75e6bb Binary files /dev/null and b/datafiles/images/creation/chapters/icons/0.png differ diff --git a/datafiles/images/creation/chapters/icons/1.png b/datafiles/images/creation/chapters/icons/1.png new file mode 100644 index 000000000..ce757227d Binary files /dev/null and b/datafiles/images/creation/chapters/icons/1.png differ diff --git a/datafiles/images/creation/chapters/icons/10.png b/datafiles/images/creation/chapters/icons/10.png new file mode 100644 index 000000000..280ad9907 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/10.png differ diff --git a/datafiles/images/creation/chapters/icons/11.png b/datafiles/images/creation/chapters/icons/11.png new file mode 100644 index 000000000..f12ff18a4 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/11.png differ diff --git a/datafiles/images/creation/chapters/icons/12.png b/datafiles/images/creation/chapters/icons/12.png new file mode 100644 index 000000000..22ad4a92a Binary files /dev/null and b/datafiles/images/creation/chapters/icons/12.png differ diff --git a/datafiles/images/creation/chapters/icons/13.png b/datafiles/images/creation/chapters/icons/13.png new file mode 100644 index 000000000..aef0fd06e Binary files /dev/null and b/datafiles/images/creation/chapters/icons/13.png differ diff --git a/datafiles/images/creation/chapters/icons/14.png b/datafiles/images/creation/chapters/icons/14.png new file mode 100644 index 000000000..f75544152 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/14.png differ diff --git a/datafiles/images/creation/chapters/icons/15.png b/datafiles/images/creation/chapters/icons/15.png new file mode 100644 index 000000000..9604c95a2 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/15.png differ diff --git a/datafiles/images/creation/chapters/icons/16.png b/datafiles/images/creation/chapters/icons/16.png new file mode 100644 index 000000000..b414e693d Binary files /dev/null and b/datafiles/images/creation/chapters/icons/16.png differ diff --git a/datafiles/images/creation/chapters/icons/17.png b/datafiles/images/creation/chapters/icons/17.png new file mode 100644 index 000000000..fe9b638e6 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/17.png differ diff --git a/datafiles/images/creation/chapters/icons/18.png b/datafiles/images/creation/chapters/icons/18.png new file mode 100644 index 000000000..25d5abccb Binary files /dev/null and b/datafiles/images/creation/chapters/icons/18.png differ diff --git a/datafiles/images/creation/chapters/icons/19.png b/datafiles/images/creation/chapters/icons/19.png new file mode 100644 index 000000000..86acc345a Binary files /dev/null and b/datafiles/images/creation/chapters/icons/19.png differ diff --git a/datafiles/images/creation/chapters/icons/2.png b/datafiles/images/creation/chapters/icons/2.png new file mode 100644 index 000000000..650f03b57 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/2.png differ diff --git a/datafiles/images/creation/chapters/icons/20.png b/datafiles/images/creation/chapters/icons/20.png new file mode 100644 index 000000000..d7dd07601 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/20.png differ diff --git a/datafiles/images/creation/chapters/icons/21.png b/datafiles/images/creation/chapters/icons/21.png new file mode 100644 index 000000000..6367ffb69 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/21.png differ diff --git a/datafiles/images/creation/chapters/icons/3.png b/datafiles/images/creation/chapters/icons/3.png new file mode 100644 index 000000000..d1435f202 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/3.png differ diff --git a/datafiles/images/creation/chapters/icons/4.png b/datafiles/images/creation/chapters/icons/4.png new file mode 100644 index 000000000..b32ea3366 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/4.png differ diff --git a/datafiles/images/creation/chapters/icons/5.png b/datafiles/images/creation/chapters/icons/5.png new file mode 100644 index 000000000..b55e786db Binary files /dev/null and b/datafiles/images/creation/chapters/icons/5.png differ diff --git a/datafiles/images/creation/chapters/icons/6.png b/datafiles/images/creation/chapters/icons/6.png new file mode 100644 index 000000000..c980f2a27 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/6.png differ diff --git a/datafiles/images/creation/chapters/icons/7.png b/datafiles/images/creation/chapters/icons/7.png new file mode 100644 index 000000000..25fb61562 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/7.png differ diff --git a/datafiles/images/creation/chapters/icons/8.png b/datafiles/images/creation/chapters/icons/8.png new file mode 100644 index 000000000..5cd39b133 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/8.png differ diff --git a/datafiles/images/creation/chapters/icons/9.png b/datafiles/images/creation/chapters/icons/9.png new file mode 100644 index 000000000..54e41c532 Binary files /dev/null and b/datafiles/images/creation/chapters/icons/9.png differ diff --git a/datafiles/images/creation/main1.png b/datafiles/images/creation/chapters/splash/1.png similarity index 100% rename from datafiles/images/creation/main1.png rename to datafiles/images/creation/chapters/splash/1.png diff --git a/datafiles/images/creation/existing1.png b/datafiles/images/creation/chapters/splash/10.png similarity index 100% rename from datafiles/images/creation/existing1.png rename to datafiles/images/creation/chapters/splash/10.png diff --git a/datafiles/images/creation/existing2.png b/datafiles/images/creation/chapters/splash/11.png similarity index 100% rename from datafiles/images/creation/existing2.png rename to datafiles/images/creation/chapters/splash/11.png diff --git a/datafiles/images/creation/existing3.png b/datafiles/images/creation/chapters/splash/12.png similarity index 100% rename from datafiles/images/creation/existing3.png rename to datafiles/images/creation/chapters/splash/12.png diff --git a/datafiles/images/creation/existing4.png b/datafiles/images/creation/chapters/splash/13.png similarity index 100% rename from datafiles/images/creation/existing4.png rename to datafiles/images/creation/chapters/splash/13.png diff --git a/datafiles/images/creation/existing5.png b/datafiles/images/creation/chapters/splash/14.png similarity index 100% rename from datafiles/images/creation/existing5.png rename to datafiles/images/creation/chapters/splash/14.png diff --git a/datafiles/images/creation/existing7.png b/datafiles/images/creation/chapters/splash/16.png similarity index 100% rename from datafiles/images/creation/existing7.png rename to datafiles/images/creation/chapters/splash/16.png diff --git a/datafiles/images/creation/other1.png b/datafiles/images/creation/chapters/splash/17.png similarity index 100% rename from datafiles/images/creation/other1.png rename to datafiles/images/creation/chapters/splash/17.png diff --git a/datafiles/images/creation/other3.png b/datafiles/images/creation/chapters/splash/19.png similarity index 100% rename from datafiles/images/creation/other3.png rename to datafiles/images/creation/chapters/splash/19.png diff --git a/datafiles/images/creation/main2.png b/datafiles/images/creation/chapters/splash/2.png similarity index 100% rename from datafiles/images/creation/main2.png rename to datafiles/images/creation/chapters/splash/2.png diff --git a/datafiles/images/creation/chapters/splash/22.png b/datafiles/images/creation/chapters/splash/22.png new file mode 100644 index 000000000..1081c3556 Binary files /dev/null and b/datafiles/images/creation/chapters/splash/22.png differ diff --git a/datafiles/images/creation/main3.png b/datafiles/images/creation/chapters/splash/3.png similarity index 100% rename from datafiles/images/creation/main3.png rename to datafiles/images/creation/chapters/splash/3.png diff --git a/datafiles/images/creation/main4.png b/datafiles/images/creation/chapters/splash/4.png similarity index 100% rename from datafiles/images/creation/main4.png rename to datafiles/images/creation/chapters/splash/4.png diff --git a/datafiles/images/creation/main5.png b/datafiles/images/creation/chapters/splash/5.png similarity index 100% rename from datafiles/images/creation/main5.png rename to datafiles/images/creation/chapters/splash/5.png diff --git a/datafiles/images/creation/main6.png b/datafiles/images/creation/chapters/splash/6.png similarity index 100% rename from datafiles/images/creation/main6.png rename to datafiles/images/creation/chapters/splash/6.png diff --git a/datafiles/images/creation/main7.png b/datafiles/images/creation/chapters/splash/7.png similarity index 100% rename from datafiles/images/creation/main7.png rename to datafiles/images/creation/chapters/splash/7.png diff --git a/datafiles/images/creation/main8.png b/datafiles/images/creation/chapters/splash/8.png similarity index 100% rename from datafiles/images/creation/main8.png rename to datafiles/images/creation/chapters/splash/8.png diff --git a/datafiles/images/creation/main9.png b/datafiles/images/creation/chapters/splash/9.png similarity index 100% rename from datafiles/images/creation/main9.png rename to datafiles/images/creation/chapters/splash/9.png diff --git a/datafiles/images/creation/other5.png b/datafiles/images/creation/chapters/splash/97.png similarity index 100% rename from datafiles/images/creation/other5.png rename to datafiles/images/creation/chapters/splash/97.png diff --git a/datafiles/images/creation/other6.png b/datafiles/images/creation/chapters/splash/98.png similarity index 100% rename from datafiles/images/creation/other6.png rename to datafiles/images/creation/chapters/splash/98.png diff --git a/datafiles/images/creation/other7.png b/datafiles/images/creation/chapters/splash/99.png similarity index 100% rename from datafiles/images/creation/other7.png rename to datafiles/images/creation/chapters/splash/99.png diff --git a/datafiles/images/creation/creation_icons.png b/datafiles/images/creation/creation_icons.png deleted file mode 100644 index af51854f5..000000000 Binary files a/datafiles/images/creation/creation_icons.png and /dev/null differ diff --git a/datafiles/images/creation/existing8.png b/datafiles/images/creation/existing8.png deleted file mode 100644 index 1059c296b..000000000 Binary files a/datafiles/images/creation/existing8.png and /dev/null differ diff --git a/datafiles/images/creation/lamenters_alternate.png b/datafiles/images/creation/lamenters_alternate.png deleted file mode 100644 index 15765c1d9..000000000 Binary files a/datafiles/images/creation/lamenters_alternate.png and /dev/null differ diff --git a/datafiles/images/creation/slate1.png b/datafiles/images/creation/slate/1.png similarity index 100% rename from datafiles/images/creation/slate1.png rename to datafiles/images/creation/slate/1.png diff --git a/datafiles/images/creation/slate2.png b/datafiles/images/creation/slate/2.png similarity index 100% rename from datafiles/images/creation/slate2.png rename to datafiles/images/creation/slate/2.png diff --git a/datafiles/images/title_splash.png b/datafiles/images/title_splash.png index 4adfb8088..fbe0649c7 100644 Binary files a/datafiles/images/title_splash.png and b/datafiles/images/title_splash.png differ diff --git a/datafiles/images/ui/force/1.png b/datafiles/images/ui/force/1.png new file mode 100644 index 000000000..c3fc7d947 Binary files /dev/null and b/datafiles/images/ui/force/1.png differ diff --git a/datafiles/images/ui/force/10.png b/datafiles/images/ui/force/10.png new file mode 100644 index 000000000..5cd3a8649 Binary files /dev/null and b/datafiles/images/ui/force/10.png differ diff --git a/datafiles/images/ui/force/11.png b/datafiles/images/ui/force/11.png new file mode 100644 index 000000000..c540fe725 Binary files /dev/null and b/datafiles/images/ui/force/11.png differ diff --git a/datafiles/images/ui/force/12.png b/datafiles/images/ui/force/12.png new file mode 100644 index 000000000..fc375ef68 Binary files /dev/null and b/datafiles/images/ui/force/12.png differ diff --git a/datafiles/images/ui/force/13.png b/datafiles/images/ui/force/13.png new file mode 100644 index 000000000..8c8253da6 Binary files /dev/null and b/datafiles/images/ui/force/13.png differ diff --git a/datafiles/images/ui/force/15.png b/datafiles/images/ui/force/15.png new file mode 100644 index 000000000..682fa7d71 Binary files /dev/null and b/datafiles/images/ui/force/15.png differ diff --git a/datafiles/images/ui/force/2.png b/datafiles/images/ui/force/2.png new file mode 100644 index 000000000..4a5667948 Binary files /dev/null and b/datafiles/images/ui/force/2.png differ diff --git a/datafiles/images/ui/force/3.png b/datafiles/images/ui/force/3.png new file mode 100644 index 000000000..2b4b71928 Binary files /dev/null and b/datafiles/images/ui/force/3.png differ diff --git a/datafiles/images/ui/force/30.png b/datafiles/images/ui/force/30.png new file mode 100644 index 000000000..9678f8a79 Binary files /dev/null and b/datafiles/images/ui/force/30.png differ diff --git a/datafiles/images/ui/force/4.png b/datafiles/images/ui/force/4.png new file mode 100644 index 000000000..e00d57404 Binary files /dev/null and b/datafiles/images/ui/force/4.png differ diff --git a/datafiles/images/ui/force/5.png b/datafiles/images/ui/force/5.png new file mode 100644 index 000000000..0add286ca Binary files /dev/null and b/datafiles/images/ui/force/5.png differ diff --git a/datafiles/images/ui/force/6.png b/datafiles/images/ui/force/6.png new file mode 100644 index 000000000..5de13dbf7 Binary files /dev/null and b/datafiles/images/ui/force/6.png differ diff --git a/datafiles/images/ui/force/7.png b/datafiles/images/ui/force/7.png new file mode 100644 index 000000000..007be0d84 Binary files /dev/null and b/datafiles/images/ui/force/7.png differ diff --git a/datafiles/images/ui/force/8.png b/datafiles/images/ui/force/8.png new file mode 100644 index 000000000..6e3b45012 Binary files /dev/null and b/datafiles/images/ui/force/8.png differ diff --git a/datafiles/images/ui/force/9.png b/datafiles/images/ui/force/9.png new file mode 100644 index 000000000..baaa2c4f5 Binary files /dev/null and b/datafiles/images/ui/force/9.png differ diff --git a/datafiles/images/ui/planet/1.png b/datafiles/images/ui/planet/1.png new file mode 100644 index 000000000..7f6c652b0 Binary files /dev/null and b/datafiles/images/ui/planet/1.png differ diff --git a/datafiles/images/ui/planet/10.png b/datafiles/images/ui/planet/10.png new file mode 100644 index 000000000..304604dbe Binary files /dev/null and b/datafiles/images/ui/planet/10.png differ diff --git a/datafiles/images/ui/planet/11.png b/datafiles/images/ui/planet/11.png new file mode 100644 index 000000000..c78aca1ac Binary files /dev/null and b/datafiles/images/ui/planet/11.png differ diff --git a/datafiles/images/ui/planet/12.png b/datafiles/images/ui/planet/12.png new file mode 100644 index 000000000..e452604b1 Binary files /dev/null and b/datafiles/images/ui/planet/12.png differ diff --git a/datafiles/images/ui/planet/13.png b/datafiles/images/ui/planet/13.png new file mode 100644 index 000000000..1624a9779 Binary files /dev/null and b/datafiles/images/ui/planet/13.png differ diff --git a/datafiles/images/ui/planet/14.png b/datafiles/images/ui/planet/14.png new file mode 100644 index 000000000..e8cc56090 Binary files /dev/null and b/datafiles/images/ui/planet/14.png differ diff --git a/datafiles/images/ui/planet/15.png b/datafiles/images/ui/planet/15.png new file mode 100644 index 000000000..d3da6606d Binary files /dev/null and b/datafiles/images/ui/planet/15.png differ diff --git a/datafiles/images/ui/planet/16.png b/datafiles/images/ui/planet/16.png new file mode 100644 index 000000000..747a438b7 Binary files /dev/null and b/datafiles/images/ui/planet/16.png differ diff --git a/datafiles/images/ui/planet/17.png b/datafiles/images/ui/planet/17.png new file mode 100644 index 000000000..5224e95fd Binary files /dev/null and b/datafiles/images/ui/planet/17.png differ diff --git a/datafiles/images/ui/planet/2.png b/datafiles/images/ui/planet/2.png new file mode 100644 index 000000000..7f6c652b0 Binary files /dev/null and b/datafiles/images/ui/planet/2.png differ diff --git a/datafiles/images/ui/planet/3.png b/datafiles/images/ui/planet/3.png new file mode 100644 index 000000000..6bd05f3d1 Binary files /dev/null and b/datafiles/images/ui/planet/3.png differ diff --git a/datafiles/images/ui/planet/4.png b/datafiles/images/ui/planet/4.png new file mode 100644 index 000000000..cd7c963fd Binary files /dev/null and b/datafiles/images/ui/planet/4.png differ diff --git a/datafiles/images/ui/planet/5.png b/datafiles/images/ui/planet/5.png new file mode 100644 index 000000000..aee1be66f Binary files /dev/null and b/datafiles/images/ui/planet/5.png differ diff --git a/datafiles/images/ui/planet/6.png b/datafiles/images/ui/planet/6.png new file mode 100644 index 000000000..e2af87657 Binary files /dev/null and b/datafiles/images/ui/planet/6.png differ diff --git a/datafiles/images/ui/planet/7.png b/datafiles/images/ui/planet/7.png new file mode 100644 index 000000000..3de4184a3 Binary files /dev/null and b/datafiles/images/ui/planet/7.png differ diff --git a/datafiles/images/ui/planet/8.png b/datafiles/images/ui/planet/8.png new file mode 100644 index 000000000..2a565900f Binary files /dev/null and b/datafiles/images/ui/planet/8.png differ diff --git a/datafiles/images/ui/planet/9.png b/datafiles/images/ui/planet/9.png new file mode 100644 index 000000000..426ab5d54 Binary files /dev/null and b/datafiles/images/ui/planet/9.png differ diff --git a/datafiles/main/chapters/1.JSON b/datafiles/main/chapters/1.JSON new file mode 100644 index 000000000..91a2d319b --- /dev/null +++ b/datafiles/main/chapters/1.JSON @@ -0,0 +1,407 @@ +{ + "chapter": { + "id": 1, + "name": "Dark Angels", + "flavor": "The Dark Angels claim complete allegiance and service to the Emperor of Mankind, though their actions and secret goals seem to run counter to this- above all other things they strive to atone for an ancient crime of betrayal.", + "origin": 1, // 1 - Founding, 2 -successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 0, // The id of the founding chapter, 0 for unknown or none + "splash": 1, + "icon": 1, // in \images\creation\creation_icons.png, the index from the left, 0 being blank square and 1 being dark angels etc + "icon_name": "da", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 10, // 1-10 + "purity": 8, // 1-10 + "stability": 10, // 1-10 + "cooperation": 5, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Dead", // "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "The Rock", + "recruiting": "Death", //"Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "Kimmeria", + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "SURVIVAL", // ? need to find the best way to do this + "advantages": [ //TODO something with these after rework of adv organisation + "", + "Enemy: Fallen", + "Reverent Guardians", + "", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", + "Never Forgive", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Caliban Green", + "secondary": "Caliban Green", + "pauldron_r": "Caliban Green", // todo update refs for new names + "pauldron_l": "Caliban Green", + "trim": "Grey", + "lens": "Red", + "weapon": "Dark Red", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for special trim colours // todo update ref for new name + }, + "names": { + //Chapter Staff + "hchaplain": "Sapphon", + "clibrarian": "Ezekial", + "fmaster": "Sepharon", + "hapothecary": "Razaek", + //Company Captains 1 - 10 + "honorcapt": "Belial", + "watchmaster": "Sammael", + "arsenalmaster": "Astoran", + "admiral": "Korahael", + "marchmaster": "Balthazar", + "ritesmaster": "Araphil", + "victualler": "Ezekiah", + "lordexec": "Molochi", + "relmaster": "Xerophus", + "recruiter": "Ranaeus" + }, + "battle_cry": "Repent! For tomorow you may die", + "equal_specialists": 0, + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes + "split_vets": 0 // 0 no, 1 yes + }, + "successors": 9, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ // todo maybe convert to struct + 0, // nothing + 0, // Progenitor faction + 65, // Imperium + 60, // Admech + 60, //Inquisition + 60, // Ecclesiarchy + 50, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Azrael", + "specialty": 2, //1 Leader, 2 Champion, 3 Psyker, + "melee": 5, // 1 twin power fists ... 8 force staff + "ranged": 4, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "old_guard", + "melee_enthusiast" + ], + "gear": "", + "mobi": "" + }, + "artifact": { + "name": "Sword of Secrets", + "description": "A master-crafted Power Sword of formidable potency created soon after the disappearance of Lion El'Jonson. It is the mightiest of the Heavenfall Blades", + "base_weapon_type": "Power Sword" + }, + "company_titles": [ + "", + "Deathwing", + "Ravenwing", + "The Unmerciful", + "The Feared", + "The Unrelenting", + "The Resolute", + "The Unbowed", + "The Wrathful", + "The Remorseless", + "The Redeemed" + ], + "flagship_name": "Invincible Reason", + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + */ + "extra_ships": { + "battle_barges": 1, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 0, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 80, + "assault": 0, + "veteran": -80, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * Stacks with strength for non-founding chapters + */ + // * Not working yet + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * for combat roles, `custom_squads` should probably? be used instead + */ + "custom_roles": { + "honour_guard": { + "name": "Deathwing Knight", + "wep1": "Mace of Absolution", + "armour": "Terminator Armour" + }, + "captain": { + "name": "Master", + "wep1": "Power Sword" + } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations ? idk what that does yet + */ + "squad_name": "Squad", + "custom_squads": { + "terminator_squad": [ + // Terminator Sergeant + [ + "Veteran Sergeant", + { + "max": 1, + "min": 1, + "role": "Deathwing Sergeant", + "loadout": { + "required": { + "wep1": [ + "Power Sword", + 1 + ] + } + } + } + ], + // Terminator + [ + "Terminator", + { + "max": 4, + "min": 2, + "role": "Deathwing Terminator", + "loadout": { + "required": { + "wep1": [ + "", + 0 + ], + "wep2": [ + "Storm Bolter", + 3 + ] + }, + "option": { + "wep1": [ + [ + [ + "Power Fist", + "Chainfist" + ], + 4 + ] + ], + "wep2": [ + [ + [ + "Heavy Flamer", + "Heavy Flamer", + "Heavy Flamer", + "Assault Cannon", + "Assault Cannon", + "Plasma Cannon" + ], + 1 + ] + ] + } + } + } + ], + [ + "type_data", + { + "display_data": "Deathwing Terminator Squad", + "formation_options": [ + "terminator", + "veteran", + "assault", + "devastator", + "scout", + "tactical" + ] + } + ] + ], + "terminator_assault_squad": [ + // Assault Terminator Sergeant + [ + "Veteran Sergeant", + { + "max": 1, + "min": 1, + "role": "Deathwing Sergeant", + "loadout": { + "required": { + "wep1": [ + "Thunder Hammer", + 1 + ], + "wep2": [ + "Storm Shield", + 1 + ] + } + } + } + ], + // Assault Terminator + [ + "Terminator", + { + "max": 4, + "min": 2, + "role": "Deathwing Terminator", + "loadout": { + "required": { + "wep1": [ + "Thunder Hammer", + 1 + ], + "wep2": [ + "Storm Shield", + 1 + ] + }, + "option": { + "wep1": [ + [ + [ + "Lightning Claw" + ], + 3, + { + "wep2": "Lightning Claw" + } + ] + ] + } + } + } + ], + [ + "type_data", + { + "display_data": "Deathwing Terminator Squad", + "formation_options": [ + "terminator", + "veteran", + "assault", + "devastator", + "scout", + "tactical" + ] + } + ] + ] + } + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/10.JSON b/datafiles/main/chapters/10.JSON new file mode 100644 index 000000000..7a2ca1649 --- /dev/null +++ b/datafiles/main/chapters/10.JSON @@ -0,0 +1,262 @@ +{ + "chapter": { + "id": 10, + "name": "Black Templars", + "flavor": "Not adhering to the Codex Astartes, Black Templars are a Chapter on an Eternal Crusade with unique organization and high numbers. Masters of assault, they charge at the enemy with zeal unmatched. They hate psykers, and as such, have no Librarians.", + "origin": 2, // 1 - Founding, 2 -successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 200, + "founding": 4, // The id of the founding chapter, 0 for unknown or none + "splash": 10, + "icon": 10, // in \images\creation\creation_icons.png, the index from the left, 0 being blank square and 1 being dark angels etc + "icon_name": "bt", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 3, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 7, // 1-10 + "stability": 10, // 1-10 + "cooperation": 5, // 1-10 + "homeworld_exists": 0, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "", // "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "", + "recruiting": "", //"Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "APPRENTICESHIP", // ? need to find the best way to do this + "advantages": [ //TODO something with these after rework of adv organisation + "", + "Assault Doctrine", + "Kings of Space", + "Reverent Guardians", + "Retinue of Renown", + "", + "", + "", + "" + ], + "disadvantages": [ + "", + "Psyker Intolerant", + "Suspicious", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Black", + "secondary": "Black", + "pauldron_r": "White", + "pauldron_l": "White", + "trim": "Silver", + "lens": "Dark Red", + "weapon": "Black", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for special trim colours + }, + "names": { + //Chapter Staff + "hchaplain": "Grimaldus", + "clibrarian": "", + "fmaster": "Jurisian", + "hapothecary": "Colber", + //Company Captains 1 - 10 + "honorcapt": "", + "watchmaster": "", + "arsenalmaster": "", + "admiral": "Stenheir", + "marchmaster": "", + "ritesmaster": "", + "victualler": "", + "lordexec": "", + "relmaster": "", + "recruiter": "Emrik" + }, + "battle_cry": "No Pity! No Remorse! No Fear!", + "equal_specialists": 0, + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes + "split_vets": 0 // 0 no, 1 yes + }, + "successors": 0, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 1, + "zygote": 0, + "betchers": 1, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ // todo maybe convert to struct + 0, // nothing + 50, // Progenitor faction + 60, // Imperium + 40, // Admech + 30, //Inquisition + 80, // Ecclesiarchy + 35, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Helbrecht", + "specialty": 2, //1 Leader, 2 Champion, 3 Psyker, + "melee": 5, // 1 twin power fists ... 8 force staff + "ranged": 2, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "melee_enthusiast", + "zealous_faith", + "old_guard" + ], + "gear": "", + "mobi": "", + "armour": "", + "bionics": 0 + }, + "artifact": { + "name": "Sword of the High Marshalls", + "description": "A relic blade forged from the shards of Rogal Dorn's shattered sword passed down by the High Marshalls as a sign of office", + "base_weapon_type": "Relic Blade" + }, + "company_titles": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "flagship_name": "Eternal Crusader", + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "chaplains_per_company": 0, + "techmarines": 0, + "techmarines_per_company": 0, + "apothecary": 0, + "apothecary_per_company": 0, + "epistolary": 0, + "epistolary_per_company": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * Stacks with strength for non-founding chapters + */ + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * for combat roles, `custom_squads` should probably? be used instead + */ + "custom_roles": { + "captain": { + "name": "Marshall", + "wep1": "Power Sword" + }, + "veteran": { + "name": "Sword Brother" + } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations ? idk what that does yet + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/11.JSON b/datafiles/main/chapters/11.JSON new file mode 100644 index 000000000..79baa9fcd --- /dev/null +++ b/datafiles/main/chapters/11.JSON @@ -0,0 +1,303 @@ +{ + "chapter": { + "id": 11, + "name": "Minotaurs", + "flavor": "Bronze-clad Astartes of unknown Founding, the Minotaurs prefer to channel their righteous fury in a massive storm of fire, with tanks and artillery. They could be considered the Inquisition’s attack dog, since they often attack fellow chapters suspected of heresy.", + "origin": 2, // 1 - Founding, 2 - Successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 450, + "founding": 10, // The id of the founding chapter, 0 for unknown or none, 10 for random + "splash": 11, // in \images\creation\chapters\splash folder, the img number, 1 being Dark Angels etc. + "icon": 11, // in \images\creation\chapters\icons folder, the icon number, 1 being Dark Angels etc. + "icon_name": "min", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 2, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 10, // 1-10 + "stability": 10, // 1-10 + "cooperation": 2, // 1-10 + "homeworld_exists": 0, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "", // Homeworld Planet name, leave blank to autogenerate + "recruiting": "Death", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", // Recruiting Planet name, leave blank to autogenerate + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "CHALLENGE", // one of "BLOODDUEL" "HUNTING" "SURVIVAL" "EXPOSURE" "KNOWLEDGE" "CHALLENGE" "APPRENTICESHIP" + "advantages": [ + "", // leave the first entry blank for now + "Paragon", + "Siege Masters", + "Boarders", + "Enemy: Fallen", + "", + "", + "", + "" + ], + "disadvantages": [ + "", // leave the first entry blank for now + "Suspicious", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Lightest Brown", + "secondary": "Lightest Brown", + "pauldron_r": "Dark Red", + "pauldron_l": "Dark Red", + "trim": "Light Brown", + "lens": "Red", + "weapon": "Dark Red", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 1 // 0 no, 1 yes for pauldron trim colours. Trim colour will still be used for certain complex livery items + }, + "names": { + //Chapter Staff + "hchaplain": "Ivanus Enkomi", // Head Chaplain + "clibrarian": "Lykos Gorgon", // Chief Librarian + "fmaster": "Varro Crag", // Forge Master + "hapothecary": "Raze Korthos", // Head Apothecary + //Company Captains 1 - 10 + "honorcapt": "", + "watchmaster": "", + "arsenalmaster": "", + "admiral": "Thoul Brontes", + "marchmaster": "", + "ritesmaster": "", + "victualler": "", + "lordexec": "", + "relmaster": "", + "recruiter": "Axion Eurytos" + }, + "battle_cry": "...", + "equal_specialists": 0, // 0 if no, 1 if yes. If yes, will distribute specialist roles like Assaults and Devastators equally between companies. Otherwise all Assaults go in Company 8 and all Devastators in Company 9 + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes. If yes, splits scouts between companies equally. Otherwise all scouts are kept in 10th Company. + "split_vets": 0 // 0 no, 1 yes. If yes, all veterans are distrubuted equally between companies. Otherwise all veterans are kept in the 1st Company + }, + "successors": 0, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ + 0, // nothing + 0, // Progenitor faction + 100, // Imperium + 50, // Admech + 60, //Inquisition + 25, // Ecclesiarchy + 30, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Asterion Moloc", + "specialty": 2, //1 Leader, 2 Champion, 3 Psyker, + "melee": 5, // 1 twin power fists ... 8 force staff + "ranged": 7, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "very_hard_to_kill", + "seasoned" + ], + "gear": "", + "mobi": "", + "armour": "Tartaros" // default is Artificer armour, only needed to set if changing to something else. + }, + "artifact": [ + { + "name": "The Black Spear", + "description": "An ancient artefact that is steeped in blood and said to have once been used by the Legio Custodes.", + "base_weapon_type": "Power Spear", + "slot": "wep1" + } + ], + "company_titles": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "flagship_name": "Daedelos Krata", // leave blank to autogenerate + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + * * Stacks with advantages/disadvantages + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 0, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * * Stacks with strength for non-founding chapters only + */ + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * To affect an entire squad, see `custom_squads` below + */ + "custom_roles": { + // "honour_guard": { + // "name": "Honour Guard", + // "wep1": "Power Sword", + // "wep2": "Bolter" + // }, + // "veteran": { + // "name": "Veteran", + // "wep1": "Chainaxe" + // }, + // "captain": { + // "name": "Captain", + // "wep1": "Power Sword" + // }, + // "tactical": { + // "name": "Tactical" + // }, + // "devastator": { + // "name": "Devastator" + // }, + // "assault": { + // "name": "Assault", + // "wep1": "Chainsword" + // }, + // "scout": { + // "name": "Scout", + // "wep1": "Sniper Rifle" + // }, + // "chaplain": { + // "name": "Chaplain", + // }, + // "techmarine": { + // "name": "Techmarine", + // "wep1": "Power Axe" + // }, + // "apothecary": { + // "name": "Apothecary", + // "wep1": "Power Axe" + // }, + // "librarian": { + // "name": "Librarian", + // "wep1": "Force Staff" + // }, + // "sergeant": { + // "name": "Sergeant", + // "wep1": "Chainaxe" + // }, + // "veteran_sergeant": { + // "name": "Veteran Sergeant", + // "wep1": "Chainaxe" + // } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/12.JSON b/datafiles/main/chapters/12.JSON new file mode 100644 index 000000000..b866aec27 --- /dev/null +++ b/datafiles/main/chapters/12.JSON @@ -0,0 +1,293 @@ +{ + "chapter": { + "id": 12, + "name": "Blood Ravens", + "flavor": "Of unknown origins and Founding, the origins of the Blood Ravens are shrouded in mystery and are believed to be tied to a dark truth. This elusive Chapter is drawn to the pursuit of knowledge and ancient lore and produces an unusually high number of Librarians.", + "origin": 2, // 1 - Founding, 2 - Successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 100, + "founding": 10, // The id of the founding chapter, 0 for unknown or none, 10 for random + "splash": 12, // in \images\creation\chapters\splash folder, the img number, 1 being Dark Angels etc. + "icon": 12, // in \images\creation\chapters\icons folder, the icon number, 1 being Dark Angels etc. + "icon_name": "br", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 2, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 10, // 1-10 + "stability": 6, // 1-10 + "cooperation": 7, // 1-10 + "homeworld_exists": 0, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "", // Homeworld Planet name, leave blank to autogenerate + "recruiting": "Death", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "Trontiux", // Recruiting Planet name, leave blank to autogenerate + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "KNOWLEDGE", // one of "BLOODDUEL" "HUNTING" "SURVIVAL" "EXPOSURE" "KNOWLEDGE" "CHALLENGE" "APPRENTICESHIP" + "advantages": [ + "", // leave the first entry blank for now + "Tech-Scavengers", + "Psyker Abundance", + "", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", // leave the first entry blank for now + "Suspicious", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Sanguine Red", + "secondary": "Sanguine Red", + "pauldron_r": "Bone", + "pauldron_l": "Bone", + "trim": "Lighter Black", + "lens": "Lime", + "weapon": "Black", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + "trim_on": 1 // 0 no, 1 yes for pauldron trim colours. Trim colour will still be used for certain complex livery items + }, + "names": { + //Chapter Staff + "hchaplain": "Mikelus", // Head Chaplain + "clibrarian": "Jonah Orion", // Chief Librarian + "fmaster": "Martellus", // Forge Master + "hapothecary": "Galan", // Head Apothecary + //Company Captains 1 - 10 + "honorcapt": "Apollo Diomedes", + "watchmaster": "Yriel Rikarius", + "arsenalmaster": "", + "admiral": "", + "marchmaster": "Aramus", + "ritesmaster": "Tarkus", + "victualler": "Atanaxis", + "lordexec": "Thaddeus", + "relmaster": "Avitus", + "recruiter": "Cyrus" + }, + "battle_cry": "None shall find us wanting!", + "equal_specialists": 0, // 0 if no, 1 if yes. If yes, will distribute specialist roles like Assaults and Devastators equally between companies. Otherwise all Assaults go in Company 8 and all Devastators in Company 9 + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes. If yes, splits scouts between companies equally. Otherwise all scouts are kept in 10th Company. + "split_vets": 0 // 0 no, 1 yes. If yes, all veterans are distrubuted equally between companies. Otherwise all veterans are kept in the 1st Company + }, + "successors": 0, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ + 0, // nothing + 50, // Progenitor faction + 40, // Imperium + 30, // Admech + 45, //Inquisition + 25, // Ecclesiarchy + 35, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Gabriel Angelos", + "specialty": 1, //1 Leader, 2 Champion, 3 Psyker, + "melee": 4, // 1 twin power fists ... 8 force staff + "ranged": 3, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [], + "gear": "", + "mobi": "", + "armour": "" // default is Artificer armour, only needed to set if changing to something else. + }, + "artifact": [], + "company_titles": [ + "", + "1st Company", + "2nd Company", + "3rd Company", + "4th Company", + "5th Company", + "6th Company", + "7th Company", + "8th Company", + "9th Company", + "10th Company" + ], + "flagship_name": "", // leave blank to autogenerate + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + * * Stacks with advantages/disadvantages + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 0, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * * Stacks with strength for non-founding chapters only + */ + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * To affect an entire squad, see `custom_squads` below + */ + "custom_roles": { + // "honour_guard": { + // "name": "Honour Guard", + // "wep1": "Power Sword", + // "wep2": "Bolter" + // }, + // "veteran": { + // "name": "Veteran", + // "wep1": "Chainaxe" + // }, + // "captain": { + // "name": "Captain", + // "wep1": "Power Sword" + // }, + // "tactical": { + // "name": "Tactical" + // }, + // "devastator": { + // "name": "Devastator" + // }, + // "assault": { + // "name": "Assault", + // "wep1": "Chainsword" + // }, + // "scout": { + // "name": "Scout", + // "wep1": "Sniper Rifle" + // }, + // "chaplain": { + // "name": "Chaplain", + // }, + // "techmarine": { + // "name": "Techmarine", + // "wep1": "Power Axe" + // }, + // "apothecary": { + // "name": "Apothecary", + // "wep1": "Power Axe" + // }, + // "librarian": { + // "name": "Librarian", + // "wep1": "Force Staff" + // }, + // "sergeant": { + // "name": "Sergeant", + // "wep1": "Chainaxe" + // }, + // "veteran_sergeant": { + // "name": "Veteran Sergeant", + // "wep1": "Chainaxe" + // } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/13.JSON b/datafiles/main/chapters/13.JSON new file mode 100644 index 000000000..a4bb2314b --- /dev/null +++ b/datafiles/main/chapters/13.JSON @@ -0,0 +1,293 @@ +{ + "chapter": { + "id": 13, + "name": "Crimson Fists", + "flavor": "An Imperial Fists descendant, the Crimson Fists are more level-minded than their Progenitor and brother chapters. They suffer the same lacking zygotes as their ancestors, and more resemble the Ultramarines in their balanced approach to combat. After surviving a devastating Ork WAAAGH! the chapter clings dearly to its future.", + "origin": 2, // 1 - Founding, 2 - Successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 4, // The id of the founding chapter, 0 for unknown or none, 10 for random + "splash": 13, // in \images\creation\chapters\splash folder, the img number, 1 being Dark Angels etc. + "icon": 13, // in \images\creation\chapters\icons folder, the icon number, 1 being Dark Angels etc. + "icon_name": "cf", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 2, // 1-10 + "purity": 7, // 1-10 + "stability": 10, // 1-10 + "cooperation": 8, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 0, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Agri", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "Rynn's World", // Homeworld Planet name, leave blank to autogenerate + "recruiting": "", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", // Recruiting Planet name, leave blank to autogenerate + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "CHALLENGE", // one of "BLOODDUEL" "HUNTING" "SURVIVAL" "EXPOSURE" "KNOWLEDGE" "CHALLENGE" "APPRENTICESHIP" + "advantages": [ + "", // leave the first entry blank for now + "Bolter Drilling", + "Enemy: Orks", + "", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", // leave the first entry blank for now + "Sieged", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Blue", + "secondary": "Blue", + "pauldron_r": "Blue", + "pauldron_l": "Blue", + "trim": "White", + "lens": "Red", + "weapon": "Black", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + "trim_on": 0 // 0 no, 1 yes for pauldron trim colours. Trim colour will still be used for certain complex livery items + }, + "names": { + //Chapter Staff + "hchaplain": "Marqol Tomasi", // Head Chaplain + "clibrarian": "Eustace Mendoza", // Chief Librarian + "fmaster": "Javier Adon", // Forge Master + "hapothecary": "Curien Droga", // Head Apothecary + //Company Captains 1 - 10 + "honorcapt": "Alessio Cortez", + "watchmaster": "Steffan Hios", + "arsenalmaster": "Faradis Anto", + "admiral": "Isidore Haleous", + "marchmaster": "Balthazar", + "ritesmaster": "", + "victualler": "", + "lordexec": "", + "relmaster": "", + "recruiter": "Ishmael Icario" + }, + "battle_cry": "There is only the Emperor! He is our shield and our protector!", + "equal_specialists": 0, // 0 if no, 1 if yes. If yes, will distribute specialist roles like Assaults and Devastators equally between companies. Otherwise all Assaults go in Company 8 and all Devastators in Company 9 + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes. If yes, splits scouts between companies equally. Otherwise all scouts are kept in 10th Company. + "split_vets": 0 // 0 no, 1 yes. If yes, all veterans are distrubuted equally between companies. Otherwise all veterans are kept in the 1st Company + }, + "successors": 0, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 1, + "zygote": 0, + "betchers": 1, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ + 0, // nothing + 60, // Progenitor faction + 80, // Imperium + 50, // Admech + 50, //Inquisition + 50, // Ecclesiarchy + 60, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Pedro Kantor", + "specialty": 1, //1 Leader, 2 Champion, 3 Psyker, + "melee": 1, // 1 twin power fists ... 8 force staff + "ranged": 1, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [], + "gear": "", + "mobi": "", + "armour": "" // default is Artificer armour, only needed to set if changing to something else. + }, + "artifact": [], + "company_titles": [ + "", + "The Righteous Crusaders", + "The Shieldwall", + "The Red Lightning", + "The Crimson Lancers", + "The War Riders", + "Iron Guardians", + "The Wardens of Rynn", + "The Red Path", + "The Fists of Rynn", + "The Wayfinders" + ], + "flagship_name": "Throne's Fury", // leave blank to autogenerate + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + * * Stacks with advantages/disadvantages + */ + "extra_ships": { + "battle_barges": -1, + "gladius": -3, + "strike_cruisers": -4, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 0, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 30, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * * Stacks with strength for non-founding chapters only + */ + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * To affect an entire squad, see `custom_squads` below + */ + "custom_roles": { + // "honour_guard": { + // "name": "Honour Guard", + // "wep1": "Power Sword", + // "wep2": "Bolter" + // }, + // "veteran": { + // "name": "Veteran", + // "wep1": "Chainaxe" + // }, + // "captain": { + // "name": "Captain", + // "wep1": "Power Sword" + // }, + // "tactical": { + // "name": "Tactical" + // }, + // "devastator": { + // "name": "Devastator" + // }, + // "assault": { + // "name": "Assault", + // "wep1": "Chainsword" + // }, + // "scout": { + // "name": "Scout", + // "wep1": "Sniper Rifle" + // }, + // "chaplain": { + // "name": "Chaplain", + // }, + // "techmarine": { + // "name": "Techmarine", + // "wep1": "Power Axe" + // }, + // "apothecary": { + // "name": "Apothecary", + // "wep1": "Power Axe" + // }, + // "librarian": { + // "name": "Librarian", + // "wep1": "Force Staff" + // }, + // "sergeant": { + // "name": "Sergeant", + // "wep1": "Chainaxe" + // }, + // "veteran_sergeant": { + // "name": "Veteran Sergeant", + // "wep1": "Chainaxe" + // } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/14.JSON b/datafiles/main/chapters/14.JSON new file mode 100644 index 000000000..7c89e51ae --- /dev/null +++ b/datafiles/main/chapters/14.JSON @@ -0,0 +1,293 @@ +{ + "chapter": { + "id": 14, + "name": "Lamenters", + "flavor": "The Lamenter's accursed and haunted legacy seems to taint much of what they have achieved; their victories often become bitter ashes in their hands. Nearly extinct, they fight their last days on behalf of the common folk in a crusade of endless penitence.", + "origin": 2, // 1 - Founding, 2 - Successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 5, // The id of the founding chapter, 0 for unknown or none, 10 for random + "splash": 14, // in \images\creation\chapters\splash folder, the img number, 1 being Dark Angels etc. + "icon": 14, // in \images\creation\chapters\icons folder, the icon number, 1 being Dark Angels etc. + "icon_name": "lam", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 3, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 8, // 1-10 + "stability": 4, // 1-10 + "cooperation": 5, // 1-10 + "homeworld_exists": 0, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Dead", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "Lacrima Vex", // Homeworld Planet name, leave blank to autogenerate + "recruiting": "Death", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", // Recruiting Planet name, leave blank to autogenerate + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "CHALLENGE", // one of "BLOODDUEL" "HUNTING" "SURVIVAL" "EXPOSURE" "KNOWLEDGE" "CHALLENGE" "APPRENTICESHIP" + "advantages": [ + "", // leave the first entry blank for now + "Assault Doctrine", + "Boarders", + "", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", // leave the first entry blank for now + "Suspicious", + "Shitty Luck", + "Sieged", + "Poor Equipment", + "", + "", + "", + "" + ], + "colors": { + "main": "Yellow", + "secondary": "Yellow", + "pauldron_r": "Yellow", + "pauldron_l": "Yellow", + "trim": "Dark Gold", + "lens": "Red", + "weapon": "Black", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + "trim_on": 0 // 0 no, 1 yes for pauldron trim colours. Trim colour will still be used for certain complex livery items + }, + "names": { + //Chapter Staff + "hchaplain": "", // Head Chaplain + "clibrarian": "", // Chief Librarian + "fmaster": "", // Forge Master + "hapothecary": "", // Head Apothecary + //Company Captains 1 - 10 + "honorcapt": "", + "watchmaster": "", + "arsenalmaster": "", + "admiral": "", + "marchmaster": "", + "ritesmaster": "", + "victualler": "", + "lordexec": "", + "relmaster": "", + "recruiter": "" + }, + "battle_cry": "For those we cherish, we die in Glory!", + "equal_specialists": 0, // 0 if no, 1 if yes. If yes, will distribute specialist roles like Assaults and Devastators equally between companies. Otherwise all Assaults go in Company 8 and all Devastators in Company 9 + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes. If yes, splits scouts between companies equally. Otherwise all scouts are kept in 10th Company. + "split_vets": 0 // 0 no, 1 yes. If yes, all veterans are distrubuted equally between companies. Otherwise all veterans are kept in the 1st Company + }, + "successors": 0, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ + 0, // nothing + 60, // Progenitor faction + 15, // Imperium + 20, // Admech + 10, //Inquisition + 25, // Ecclesiarchy + 50, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Malakim Phoros", + "specialty": 2, //1 Leader, 2 Champion, 3 Psyker, + "melee": 3, // 1 twin power fists ... 8 force staff + "ranged": 2, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "shitty_luck", + "old_guard" + ], + "gear": "", + "mobi": "", + "armour": "" // default is Artificer armour, only needed to set if changing to something else. + }, + "artifact": [], + "company_titles": [ + "", + "1st Company", + "2nd Company", + "3rd Company", + "4th Company", + "5th Company", + "6th Company", + "7th Company", + "8th Company", + "9th Company", + "10th Company" + ], + "flagship_name": "Flagship Name", // leave blank to autogenerate + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + * * Stacks with advantages/disadvantages + */ + "extra_ships": { + "battle_barges": -2, + "gladius": -5, + "strike_cruisers": -1, + "hunters": -2 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": -4, + "techmarines": -4, + "apothecary": -4, + "epistolary": 1, + "codiciery": 1, + "lexicanum": 2, + "terminator": -15, + "assault": 0, + "veteran": 10, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * * Stacks with strength for non-founding chapters only + */ + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": -100, + "sixth": -100, + "seventh": -100, + "eighth": -100, + "ninth": -100, + "tenth": -100 + }, + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * To affect an entire squad, see `custom_squads` below + */ + "custom_roles": { + // "honour_guard": { + // "armour": "MK6 Corvus" + // }, + // "veteran": { + // "armour": "MK6 Corvus" + // }, + // "captain": { + // "name": "Captain", + // "wep1": "Power Sword" + // }, + // "tactical": { + // "name": "Tactical" + // }, + // "devastator": { + // "name": "Devastator" + // }, + // "assault": { + // "name": "Assault", + // "wep1": "Chainsword" + // }, + // "scout": { + // "name": "Scout", + // "wep1": "Sniper Rifle" + // }, + // "chaplain": { + // "name": "Chaplain", + // }, + // "techmarine": { + // "name": "Techmarine", + // "wep1": "Power Axe" + // }, + // "apothecary": { + // "name": "Apothecary", + // "wep1": "Power Axe" + // }, + // "librarian": { + // "name": "Librarian", + // "wep1": "Force Staff" + // }, + // "sergeant": { + // "name": "Sergeant", + // "wep1": "Chainaxe" + // }, + // "veteran_sergeant": { + // "name": "Veteran Sergeant", + // "wep1": "Chainaxe" + // } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/15.JSON b/datafiles/main/chapters/15.JSON new file mode 100644 index 000000000..4cbf9dc63 --- /dev/null +++ b/datafiles/main/chapters/15.JSON @@ -0,0 +1,283 @@ +{ + "chapter": { + "id": 15, + "name": "Carcharodons", + "flavor": "Rumored to be Successors of the Raven Guard, these Astartes are known for their sudden attacks and shock assaults. Travelling through the Imperium via self-sufficient Nomad-Predation based fleets, no enemy is safe from the fury of these bloodthirsty Space Marines.", + "origin": 2, // 1 - Founding, 2 - Successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 100, + "founding": 9, // The id of the founding chapter, 0 for unknown or none, 10 for random + "splash": 99, // in \images\creation\chapters\splash folder, the img number, 1 being Dark Angels etc. + "icon": 15, // in \images\creation\chapters\icons folder, the icon number, 1 being Dark Angels etc. + "icon_name": "cd", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 2, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 8, // 1-10 + "stability": 4, // 1-10 + "cooperation": 5, // 1-10 + "homeworld_exists": 0, // 1 = true + "recruiting_exists": 0, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "", // Homeworld Planet name, leave blank to autogenerate + "recruiting": "Death", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", // Recruiting Planet name, leave blank to autogenerate + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "CHALLENGE", // one of "BLOODDUEL" "HUNTING" "SURVIVAL" "EXPOSURE" "KNOWLEDGE" "CHALLENGE" "APPRENTICESHIP" + "advantages": [ + "", // leave the first entry blank for now + "Assault Doctrine", + "Boarders", + "Kings of Space", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", // leave the first entry blank for now + "Splintered", + "Suspicious", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Codex Grey", + "secondary": "Codex Grey", + "pauldron_r": "Dark Grey", + "pauldron_l": "Dark Grey", + "trim": "Copper", + "lens": "Red", + "weapon": "Black", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + "trim_on": 1 // 0 no, 1 yes for pauldron trim colours. Trim colour will still be used for certain complex livery items + }, + "names": { + //Chapter Staff + "hchaplain": "Niko'manu", // Head Chaplain + "clibrarian": "Te Kahurangi", // Chief Librarian + "fmaster": "Uthulu", // Forge Master + "hapothecary": "Tamaron", // Head Apothecary + //Company Captains 1 - 10 + "honorcapt": "Tagaloa", + "watchmaster": "Akamu", + "arsenalmaster": "Akia", + "admiral": "Mannfor", + "marchmaster": "Fa'atiu", + "ritesmaster": "Mafui'e", + "victualler": "Aleki", + "lordexec": "Atonga", + "relmaster": "Enele", + "recruiter": "Bail Sharr" + }, + "battle_cry": "...", + "equal_specialists": 0, // 0 if no, 1 if yes. If yes, will distribute specialist roles like Assaults and Devastators equally between companies. Otherwise all Assaults go in Company 8 and all Devastators in Company 9 + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 1, // 0 no, 1 yes. If yes, splits scouts between companies equally. Otherwise all scouts are kept in 10th Company. + "split_vets": 1 // 0 no, 1 yes. If yes, all veterans are distrubuted equally between companies. Otherwise all veterans are kept in the 1st Company + }, + "successors": 0, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 1 + }, + "disposition": [ + 0, // nothing + 30, // Progenitor faction + 40, // Imperium + 40, // Admech + 40, //Inquisition + 30, // Ecclesiarchy + 30, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Tyberos", + "specialty": 2, //1 Leader, 2 Champion, 3 Psyker, + "melee": 2, // 1 twin power fists ... 8 force staff + "ranged": 1, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "melee_enthusiast", + "slow_and_purposeful", + "ancient" + ], + "gear": "", + "mobi": "", + "armour": "Terminator Armour" // default is Artificer armour, only needed to set if changing to something else. + }, + "artifact": [ + { + "name": "Hunger", + "description": "An artifact Lightning Claw of unknown origin that has an inner maw of adamantium toothed chainblades usually paired with Slake", + "base_weapon_type": "Lightning Claw", + "slot": "wep1" + }, + { + "name": "Hunger & Slake", + "description": "An artifact Lightning Claw of unknown origin that has an inner maw of adamantium toothed chainblades usually paired with Slake", + "base_weapon_type": "Lightning Claw", + "slot": "wep2" + } + ], + "company_titles": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "flagship_name": "Nicor", // leave blank to autogenerate + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + * * Stacks with advantages/disadvantages + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 0, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * * Stacks with strength for non-founding chapters only + */ + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * To affect an entire squad, see `custom_squads` below + */ + "custom_roles": { + "terminator": { + "name": "Red Brother" + }, + "captain": { + "name": "Company Master", + "wep1": "Eviscerator" + }, + "veteran_sergeant": { + "name": "Veteran Strike Leader", + "wep1": "Power Axe" + }, + "tactical": { + "name": "Void Brother", + "wep2": "Chainaxe" + }, + "assault": { + "name": "Devourer", + "wep1": "Chainaxe" + }, + "sergeant": { + "name": "Strike Leader", + "wep1": "Chainaxe" + } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/16.JSON b/datafiles/main/chapters/16.JSON new file mode 100644 index 000000000..cce6c71f9 --- /dev/null +++ b/datafiles/main/chapters/16.JSON @@ -0,0 +1,266 @@ +{ + "chapter": { + "id": 16, + "name": "Soul Drinkers", + "flavor": "Sharing ancestry of the Black Templars or Crimson fists. As proud sons of Dorn they share the strong void combat traditions, fielding a large amount of Battle Barges. As well as being fearsome in close combat. Whispers of the Ruinous Powers are however quite enticing.", + "origin": 2, // 1 - Founding, 2 - Successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 200, + "founding": 4, // The id of the founding chapter, 0 for unknown or none, 10 for random + "splash": 16, // in \images\creation\chapters\splash folder, the img number, 1 being Dark Angels etc. + "icon": 16, // in \images\creation\chapters\icons folder, the icon number, 1 being Dark Angels etc. + "icon_name": "sd", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 2, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 2, // 1-10 + "purity": 10, // 1-10 + "stability": 2, // 1-10 + "cooperation": 2, // 1-10 + "homeworld_exists": 0, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Dead", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "Entymion", // Homeworld Planet name, leave blank to autogenerate + "recruiting": "Death", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", // Recruiting Planet name, leave blank to autogenerate + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "CHALLENGE", // one of "BLOODDUEL" "HUNTING" "SURVIVAL" "EXPOSURE" "KNOWLEDGE" "CHALLENGE" "APPRENTICESHIP" + "advantages": [ + "", // leave the first entry blank for now + "Assault Doctrine", + "Boarders", + "Kings of Space", + "Daemon Binders", + "", + "", + "", + "" + ], + "disadvantages": [ + "", // leave the first entry blank for now + "Suspicious", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Purple", + "secondary": "Purple", + "pauldron_r": "Purple", + "pauldron_l": "Purple", + "trim": "Dark Gold", + "lens": "Red", + "weapon": "Purple", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + "trim_on": 1 // 0 no, 1 yes for pauldron trim colours. Trim colour will still be used for certain complex livery items + }, + "names": { + //Chapter Staff + "hchaplain": "Niko'manu", // Head Chaplain + "clibrarian": "Te Kahurangi", // Chief Librarian + "fmaster": "Uthulu", // Forge Master + "hapothecary": "Tamaron", // Head Apothecary + //Company Captains 1 - 10 + "honorcapt": "", + "watchmaster": "", + "arsenalmaster": "", + "admiral": "", + "marchmaster": "", + "ritesmaster": "", + "victualler": "", + "lordexec": "", + "relmaster": "", + "recruiter": "" + }, + "battle_cry": "Cold and Hard, Soul Drinkers!", + "equal_specialists": 0, // 0 if no, 1 if yes. If yes, will distribute specialist roles like Assaults and Devastators equally between companies. Otherwise all Assaults go in Company 8 and all Devastators in Company 9 + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes. If yes, splits scouts between companies equally. Otherwise all scouts are kept in 10th Company. + "split_vets": 0 // 0 no, 1 yes. If yes, all veterans are distrubuted equally between companies. Otherwise all veterans are kept in the 1st Company + }, + "successors": 0, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 1, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ + 0, // nothing + 60, // Progenitor faction + 15, // Imperium + 20, // Admech + 10, //Inquisition + 25, // Ecclesiarchy + 50, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Sarpedon", + "specialty": 3, //1 Leader, 2 Champion, 3 Psyker, + "melee": 8, // 1 twin power fists ... 8 force staff + "ranged": 3, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [], + "gear": "", + "mobi": "", + "armour": "" // default is Artificer armour, only needed to set if changing to something else. + }, + "artifact": [], + "company_titles": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "flagship_name": "Nicor", // leave blank to autogenerate + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + * * Stacks with advantages/disadvantages + */ + "extra_ships": { + "battle_barges": 0, + "gladius": -4, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 0, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": -5, + "assault": -10, + "veteran": -20, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * * Stacks with strength for non-founding chapters only + */ + "extra_marines": { + "second": -20, + "third": -20, + "fourth": -20, + "fifth": -20, + "sixth": -60, + "seventh": -100, + "eighth": 0, + "ninth": 0, + "tenth": -38 + }, + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * To affect an entire squad, see `custom_squads` below + */ + "custom_roles": { + "terminator": { + "name": "Red Brother" + }, + "captain": { + "name": "Company Master", + "wep1": "Eviscerator" + }, + "veteran_sergeant": { + "name": "Veteran Strike Leader", + "wep1": "Power Axe" + }, + "tactical": { + "name": "Void Brother", + "wep2": "Chainaxe" + }, + "assault": { + "name": "Devourer", + "wep1": "Chainaxe" + }, + "sergeant": { + "name": "Strike Leader", + "wep1": "Chainaxe" + } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations + */ + "squad_name": "Squad", + "custom_squads": {} + } +} diff --git a/datafiles/main/chapters/17.JSON b/datafiles/main/chapters/17.JSON new file mode 100644 index 000000000..b7788bdb5 --- /dev/null +++ b/datafiles/main/chapters/17.JSON @@ -0,0 +1,991 @@ +{ + "chapter": { + "id": 17, + "name": "Angry Marines", + "flavor": "Frothing with pathological rage since the day their Primarch emerged from his pod with naught but a dented copy of battletoads. Every last Angry Marine is a homicidal, suicidal berserker with a voice that projects, and are always angry, all the time. A /tg/ classic.", + "origin": 3, // 1 - Founding, 2 - Successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 100, + "founding": 0, // The id of the founding chapter, 0 for unknown or none, 10 for random + "splash": 17, // in \images\creation\chapters\splash folder, the img number, 1 being Dark Angels etc. + "icon": 17, // in \images\creation\chapters\icons folder, the icon number, 1 being Dark Angels etc. + "icon_name": "am", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 10, // 1-10 + "stability": 10, // 1-10 + "cooperation": 2, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Hive", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "", // Homeworld Planet name, leave blank to autogenerate + "recruiting": "Death", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", // Recruiting Planet name, leave blank to autogenerate + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "SURVIVAL", // one of "BLOODDUEL" "HUNTING" "SURVIVAL" "EXPOSURE" "KNOWLEDGE" "CHALLENGE" "APPRENTICESHIP" + "advantages": [ + "", // leave the first entry blank for now + "Assault Doctrine", + "Enemy: Eldar", + "Enemy: Fallen", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", // leave the first entry blank for now + "Black Rage", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Yellow", + "secondary": "Yellow", + "pauldron_r": "Red", + "pauldron_l": "Red", + "trim": "Black", + "lens": "Red", + "weapon": "Dark Red", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for pauldron trim colours. Trim colour will still be used for certain complex livery items + }, + "complex_livery_data": { + "vet_sgt": { + "helm_lens": 9.0, + "helm_pattern": 3.0, + "helm_primary": 19.0, + "helm_secondary": 9.0, + "helm_detail": 0.0 + }, + "captain": { + "helm_lens": 9.0, + "helm_pattern": 3.0, + "helm_primary": 9.0, + "helm_secondary": 19.0, + "helm_detail": 0.0 + }, + "veteran": { + "helm_lens": 9.0, + "helm_pattern": 2.0, + "helm_primary": 9.0, + "helm_secondary": 19.0, + "helm_detail": 0.0 + }, + "sgt": { + "helm_lens": 9.0, + "helm_pattern": 1.0, + "helm_primary": 19.0, + "helm_secondary": 9.0, + "helm_detail": 0.0 + } + }, + "names": { + //Chapter Staff + "hchaplain": "", // Head Chaplain + "clibrarian": "", // Chief Librarian + "fmaster": "", // Forge Master + "hapothecary": "", // Head Apothecary + //Company Captains 1 - 10 + "honorcapt": "", + "watchmaster": "Satchel", + "arsenalmaster": "", + "admiral": "", + "marchmaster": "", + "ritesmaster": "", + "victualler": "", + "lordexec": "", + "relmaster": "Mofo", + "recruiter": "" + }, + "battle_cry": "ALWAYS ANGRY!!! ALL THE TIME!!!", + "equal_specialists": 0, // 0 if no, 1 if yes. If yes, will distribute specialist roles like Assaults and Devastators equally between companies. Otherwise all Assaults go in Company 8 and all Devastators in Company 9 + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes. If yes, splits scouts between companies equally. Otherwise all scouts are kept in 10th Company. + "split_vets": 0 // 0 no, 1 yes. If yes, all veterans are distrubuted equally between companies. Otherwise all veterans are kept in the 1st Company + }, + "successors": 0, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ + 0, // nothing + 0, // Progenitor faction + 50, // Imperium + 50, // Admech + 50, //Inquisition + 50, // Ecclesiarchy + 50, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Temperus Maximus", + "specialty": 2, //1 Leader, 2 Champion, 3 Psyker, + "melee": 1, // 1 twin power fists ... 8 force staff + "ranged": 1, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "melee_enthusiast" + ], + "gear": "", + "mobi": "", + "armour": "" // default is Artificer armour, only needed to set if changing to something else. + }, + "artifact": [ + { + "name": "Rip", + "description": "Two ferocious, master-crafted Chainfists with built-in Assault Cannons that resemble the Gauntlets of Ultramar, only angrier", + "base_weapon_type": "Assault Chainfist", + "slot": "wep1" + }, + { + "name": "Tear", + "description": "Two ferocious, master-crafted Chainfists with built-in Assault Cannons that resemble the Gauntlets of Ultramar, only angrier", + "base_weapon_type": "Assault Chainfist", + "slot": "wep2" + } + ], + "company_titles": [ + "", + "1st Company", + "2nd Company", + "3rd Company", + "4th Company", + "5th Company", + "6th Company", + "7th Company", + "8th Company", + "9th Company", + "10th Company" + ], + "flagship_name": "Litany of Litany's Litany", // leave blank to autogenerate + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + * * Stacks with advantages/disadvantages + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 0, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * * Stacks with strength for non-founding chapters only + */ + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * To affect an entire squad, see `custom_squads` below + */ + "custom_roles": { + // "honour_guard": { + // "name": "Honour Guard", + // "wep1": "Power Sword", + // "wep2": "Bolter" + // }, + "veteran": { + "name": "Bale Guard", + "wep1": "Chainaxe" + }, + // "captain": { + // "name": "Captain", + // "wep1": "Power Sword" + // }, + "tactical": { + "name": "Angry Marine" + }, + "dreadnought": { + "name": "Belligerent Engine", + "wep2": "Inferno Cannon" + }, + "assault": { + "name": "Angrier Marine" + }, + // "scout": { + // "name": "Scout", + // "wep1": "Sniper Rifle" + // }, + // "chaplain": { + // "name": "Chaplain", + // }, + // "techmarine": { + // "name": "Techmarine", + // "wep1": "Power Axe" + // }, + // "apothecary": { + // "name": "Apothecary", + // "wep1": "Power Axe" + // }, + // "librarian": { + // "name": "Librarian", + // "wep1": "Force Staff" + // }, + // "sergeant": { + // "name": "Sergeant", + // "wep1": "Chainaxe" + // }, + // "veteran_sergeant": { + // "name": "Veteran Sergeant", + // "wep1": "Chainaxe" + // } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations + */ + "squad_name": "Squad", + "custom_squads": {}, + "full_liveries": [ + { //CM + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 8, + "left_leg_upper": 8, + "left_leg_knee": 8, + "right_leg_lower": 8, + "right_leg_upper": 8, + "right_leg_knee": 8, + "metallic_trim": 0.0, + "left_chest": 8, + "right_chest": 8, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 8, + "right_hand": 8, + "left_head": 8, + "right_head": 8, + "left_muzzle": 8, + "right_muzzle": 8, + "eye_lense": 9, + "right_backpack": 8, + "left_backpack": 8, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 8, + "left_pauldron": 9.0, + "left_arm": 8, + "right_arm": 8, + "left_trim": 0.0, + "right_trim": 0.0 + }, + { + "is_changed": true, + "left_leg_lower": 0, + "left_leg_upper": 0, + "left_leg_knee": 0, + "right_leg_lower": 0, + "right_leg_upper": 0, + "right_leg_knee": 0, + "metallic_trim": 0.0, + "left_chest": 0, + "right_chest": 0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 0, + "right_hand": 0, + "left_head": 0, + "right_head": 0, + "left_muzzle": 0, + "right_muzzle": 0, + "eye_lense": 9, + "right_backpack": 0, + "left_backpack": 0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 0, + "left_pauldron": 9.0, + "left_arm": 0, + "right_arm": 0, + "left_trim": 0.0, + "right_trim": 0.0 + }, + { + "is_changed": true, + "left_leg_lower": 9, + "left_leg_upper": 9, + "left_leg_knee": 9, + "right_leg_lower": 9, + "right_leg_upper": 9, + "right_leg_knee": 9, + "metallic_trim": 0.0, + "left_chest": 9, + "right_chest": 9, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 9, + "right_hand": 9, + "left_head": 9, + "right_head": 9, + "left_muzzle": 9, + "right_muzzle": 9, + "eye_lense": 23, + "right_backpack": 9, + "left_backpack": 9, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9, + "left_pauldron": 9.0, + "left_arm": 9, + "right_arm": 9, + "left_trim": 0.0, + "right_trim": 0.0 + }, + { + "is_changed": true, + "left_leg_lower": 34, + "left_leg_upper": 34, + "left_leg_knee": 34, + "right_leg_lower": 34, + "right_leg_upper": 34, + "right_leg_knee": 34, + "metallic_trim": 0.0, + "left_chest": 34, + "right_chest": 34, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 34, + "right_hand": 34, + "left_head": 34, + "right_head": 34, + "left_muzzle": 34, + "right_muzzle": 34, + "eye_lense": 28, + "right_backpack": 34, + "left_backpack": 34, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 34, + "left_pauldron": 9.0, + "left_arm": 34, + "right_arm": 34, + "left_trim": 0.0, + "right_trim": 0.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + }, + { + "is_changed": true, + "left_leg_lower": 19.0, + "left_leg_upper": 19.0, + "left_leg_knee": 19.0, + "right_leg_lower": 19.0, + "right_leg_upper": 19.0, + "right_leg_knee": 19.0, + "metallic_trim": 0.0, + "left_chest": 19.0, + "right_chest": 19.0, + "left_thorax": 0.0, + "right_thorax": 0.0, + "left_hand": 19.0, + "right_hand": 19.0, + "left_head": 19.0, + "right_head": 19.0, + "left_muzzle": 19.0, + "right_muzzle": 19.0, + "eye_lense": 9.0, + "right_backpack": 19.0, + "left_backpack": 19.0, + "weapon_primary": 8.0, + "weapon_secondary": 8.0, + "right_pauldron": 9.0, + "left_pauldron": 9.0, + "left_arm": 19.0, + "right_arm": 19.0, + "left_trim": 8.0, + "right_trim": 8.0 + } + ] + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/2.JSON b/datafiles/main/chapters/2.JSON new file mode 100644 index 000000000..35dadc247 --- /dev/null +++ b/datafiles/main/chapters/2.JSON @@ -0,0 +1,261 @@ +{ + "chapter": { + "id": 2, + "name": "White Scars", + "flavor": "Known and feared for their highly mobile way of war, the White Scars are the masters of lightning strikes and hit-and-run tactics. They are particularly adept in the use of Attack Bikes and field large numbers of them.", + "origin": 1, // 1 - Founding, 2 -successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 0, // The id of the founding chapter, 0 for unknown or none + "splash": 2, + "icon": 2, // in \images\creation\creation_icons.png, the index from the left, 0 being blank square and 1 being dark angels etc + "icon_name": "ws", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 10, // 1-10 + "stability": 8, // 1-10 + "cooperation": 5, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 0, // 1 = true + "homeworld_rule": 3, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Feudal", // "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "Chogoris", + "recruiting": "", //"Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", + "discipline": "rune Magick", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "SURVIVAL", // ? need to find the best way to do this + "advantages": [ //TODO something with these after rework of adv organisation + "", + "Lightning Warriors", + "Retinue of Renown", + "Assault Doctrine", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", + "Splintered", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "White", + "secondary": "White", + "pauldron_r": "White", + "pauldron_l": "White", + "trim": "Red", + "lens": "Red", + "weapon": "Black", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for special trim colours // todo update ref for new name + }, + "names": { + //Chapter Staff + "hchaplain": "Jaghorin", + "clibrarian": "Saghai", + "fmaster": "Khamkar", + "hapothecary": "Ogholei", + //Company Captains 1 - 10 + "honorcapt": "Jurga", + "watchmaster": "Khajog", + "arsenalmaster": "Kor'sarro", + "admiral": "Joghaten", + "marchmaster": "Suboden", + "ritesmaster": "Seglei", + "victualler": "Dorghai", + "lordexec": "Vorgha", + "relmaster": "Khadajei", + "recruiter": "Jodagha" + }, + "battle_cry": "For the Emperor and the Khan!", + "equal_specialists": 0, + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes + "split_vets": 0 // 0 no, 1 yes + }, + "successors": 12, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ // todo maybe convert to struct + 0, // nothing + 0, // Progenitor faction + 50, // Imperium + 50, // Admech + 50, //Inquisition + 50, // Ecclesiarchy + 65, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Jubal Khan", + "specialty": 1, //1 Leader, 2 Champion, 3 Psyker, + "melee": 5, // 1 twin power fists ... 8 force staff + "ranged": 3, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "old_guard" + ], + "gear": "", + "mobi": "" + }, + "artifact": {}, + "company_titles": [ + "", + "The Spearpoint Brotherhood", + "The Firefist Brotherhood", + "The Eagle Brotherhood", + "The Tulwar Brotherhood", + "The Stormwrath Brotherhood", + "The Hawkeye Brotherhood", + "The Plainstalker Brotherhood", + "The Bloodrider Brotherhood", + "The Stormbolt Brotherhood", + "The Windspeaker Brotherhood" + ], + "flagship_name": "", + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 0, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * Stacks with strength for non-founding chapters + */ + // * Not working yet + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + // * Not working yet + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * for combat roles, `custom_squads` should probably? be used instead + */ + "custom_roles": { + "honour_guard": { + "name": "Keshig", + "wep1": "Power Sword", + "wep2": "Bolter", + "armour": "Terminator Armour" + }, + "captain": { + "name": "Khan", + "wep1": "Power Sword" + }, + "apothecary": { + "name": "Emchi" + }, + "librarian": { + "name": "Stormseer" + } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations ? idk what that does yet + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/3.JSON b/datafiles/main/chapters/3.JSON new file mode 100644 index 000000000..dc927142b --- /dev/null +++ b/datafiles/main/chapters/3.JSON @@ -0,0 +1,306 @@ +{ + "chapter": { + "id": 3, + "name": "Space Wolves", + "flavor": "Brave sky warriors hailing from the icy deathworld of Fenris, the Space Wolves are a non-Codex compliant chapter, and deadly in close combat. They fight on their own terms and damn any who wish otherwise.", + "origin": 1, // 1 - Founding, 2 -successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 0, // The id of the founding chapter, 0 for unknown or none + "splash": 3, + "icon": 3, // in \images\creation\creation_icons.png, the index from the left, 0 being blank square and 1 being dark angels etc + "icon_name": "sw", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 10, // 1-10 + "purity": 8, // 1-10 + "stability": 5, // 1-10 + "cooperation": 4, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 0, // 1 = true + "homeworld_rule": 2, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Ice", // "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "Fenris", + "recruiting": "", //"Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", + "discipline": "rune Magick", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "EXPOSURE", // ? need to find the best way to do this + "advantages": [ //TODO something with these after rework of adv organisation + "", + "Assault Doctrine", + "Medicae Primacy", + "", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", + "Black Rage", + "Suspicious", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Fenrisian Grey", + "secondary": "Fenrisian Grey", + "pauldron_r": "Dark Gold", + "pauldron_l": "Dark Gold", + "trim": "Dark Gold", + "lens": "Red", + "weapon": "Dark Gold", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for special trim colours // todo update ref for new name + }, + "names": { + //Chapter Staff + "hchaplain": "Ulrik the Slayer", + "clibrarian": "Njal Stormcaller", + "fmaster": "Krom Dragongaze", + "hapothecary": "Ulstvan Morkaison", + //Company Captains 1 - 10 + "honorcapt": "Bran Redmaw", + "watchmaster": "Engir Krakendoom", + "arsenalmaster": "Erik Morkai", + "admiral": "Gunnar Red Moon", + "marchmaster": "Harald Deathwolf", + "ritesmaster": "Bjorn Stormwolf", + "victualler": "Vorek Gnarlfist", + "lordexec": "Krom Dragongaze", + "relmaster": "Ragnar Blackmane", + "recruiter": "Sven Bloodhowl" + }, + "battle_cry": "For Russ and the Allfather!", + "equal_specialists": 1, + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes + "split_vets": 0 // 0 no, 1 yes + }, + "successors": 1, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ // todo maybe convert to struct + 0, // nothing + 0, // Progenitor faction + 50, // Imperium + 40, // Admech + 15, //Inquisition + 15, // Ecclesiarchy + 40, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Logan Grimnar", + "specialty": 2, //1 Leader, 2 Champion, 3 Psyker, + "melee": 6, // 1 twin power fists ... 8 force staff + "ranged": 1, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "ancient", + "melee_enthusiast", + "feet_floor" + ], + "gear": "", + "mobi": "", + "armour": "Terminator Armour" + }, + "artifact": { + "name": "Axe of Morkai", + "description": "Once a Khornate axe of great power it was reforged in the image of the death wolf Morkai", + "base_weapon_type": "Executioner Power Axe" + }, + "company_titles": [ + "", + "The Bloodmaws", + "The Seawolves", + "The Sons of Morkai", + "The Red Moons", + "The Deathwolves", + "The Stormwolves", + "The Ironwolves", + "The Drakeslayers", + "The Blackmanes", + "" + ], + "flagship_name": "", + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": -20, + "techmarines": 0, + "apothecary": 4, + "apothecary_per_company": 0, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 40, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * Stacks with strength for non-founding chapters + */ + // * Not working yet + "extra_marines": { + "second": 40, + "third": 40, + "fourth": 40, + "fifth": 40, + "sixth": 40, + "seventh": 40, + "eighth": 40, + "ninth": 40, + "tenth": 60 + }, + // * Not working yet + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * for combat roles, `custom_squads` should probably? be used instead + */ + "custom_roles": { + "honour_guard": { + "name": "Wolf Guard", + "wep1": "Power Axe", + "wep2": "Bolter", + "armour": "Power Armour" + }, + "veteran": { + "name": "Veteran", + "wep1": "Chainaxe" + }, + "captain": { + "name": "Wolf Lord", + "wep1": "Power Sword" + }, + "tactical": { + "name": "Grey Hunter" + }, + "devastator": { + "name": "Long Fang" + }, + "assault": { + "name": "Blood Claw", + "wep1": "Chainaxe" + }, + "scout": { + "name": "Wolf Scout", + "wep1": "Sniper Rifle", + "wep2": "Chainaxe" + }, + "chaplain": { + "name": "Wolf Priest", + "wep1": "Power Axe" + }, + "techmarine": { + "name": "Iron Priest", + "wep1": "Power Axe" + }, + "apothecary": { + "name": "Wolf Priest", + "wep1": "Power Axe" + }, + "librarian": { + "name": "Rune Priest", + "wep1": "Force Staff" + }, + "sergeant": { + "name": "Pack Leader", + "wep1": "Chainaxe" + }, + "veteran_sergeant": { + "name": "Wolf Guard Pack Leader", + "wep1": "Chainaxe" + } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations ? idk what that does yet + */ + "squad_name": "Pack", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/31.JSON b/datafiles/main/chapters/31.JSON new file mode 100644 index 000000000..3a73c63f6 --- /dev/null +++ b/datafiles/main/chapters/31.JSON @@ -0,0 +1,235 @@ +{ + "chapter": { + "id": 31, + "name": "Red Scorpions", + "flavor": "No records remain of the chapter's founding or from which Space Marine Legion their geneseed was first taken. This secrecy has led to some of the Imperium's hierarchy questioning the loyalty of a chapter that keeps its history secret and holds itself answerable to the Emperor alone. Despite this, the chapter assists wherever it can, carrying out thousands of relief missions.", + "origin": 2, // 1 - Founding, 2 -successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 0, // The id of the founding chapter, 0 for unknown or none + "splash": 22, // this will get reworked + "icon": 21, // in \images\creation\creation_icons.png, the index from the left, 0 being blank square and 1 being dark angels etc + "icon_name": "rs", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 10, // 1-10 + "stability": 10, // 1-10 + "cooperation": 5, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 2, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "aspirant_trial": "APPRENTICESHIP", // ? need to find the best way to do this + "advantages": [ //TODO something with these after rework of adv organisation + "", //"Medicae Primacy", Must be merged following "adv-4" to actually work + "Enemy: Fallen", + "", + "", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Dark Grey", + "secondary": "Dark Grey", + "pauldron_r": "Black", // todo update refs for new names + "pauldron_l": "Black", + "trim": "Dark Gold", + "lens": "Red", + "weapon": "Black", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + "trim_on": 1 // 0 no, 1 yes for special trim colours // todo update ref for new name + }, + "names": { + "hchaplain": "Nalr", + "clibrarian": "Sevrin Loth", + "fmaster": "Sectus Raken", + "hapothecary": "Kregor Thann", + "honorcapt": "Casan Sabius", + "watchmaster": "Sirae Karagon", + "arsenalmaster": "Ainea", + "admiral": "Galateus", + "marchmaster": "Justinius", + "ritesmaster": "Haasan", + "victualler": "Gregor Desicus", + "lordexec": "Dricus Fenn", + "relmaster": "Ludael", + "recruiter": "Rammaeus" + }, + "battle_cry": "Strength in Purity", + "equal_specialists": 0, + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes + "split_vets": 0 // 0 no, 1 yes + }, + "successors": 0, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ // todo maybe convert to struct + 0, // nothing + 0, // Progenitor faction + 65, // Imperium + 60, // Admech + 60, //Inquisition + 60, // Ecclesiarchy + 50, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Carab Culln", + "specialty": 1, //1 Leader, 2 Champion, 3 Psyker, + "melee": 3, // 1 twin power fists ... 8 force staff + "ranged": 4, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "old_guard", + "still_standing", + "harshborn" + ], + "gear": "", + "mobi": "" + }, + "company_titles": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "flagship_name": "Auel's Bane", + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + */ + "extra_ships": { + "battle_barges": 1, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 10, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * Stacks with strength for non-founding chapters + */ + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * for combat roles, `custom_squads` should probably? be used instead + */ + // "custom_roles": {}, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations ? idk what that does yet + */ + // "custom_squads": [], + "squad_name": "Squad" + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/4.JSON b/datafiles/main/chapters/4.JSON new file mode 100644 index 000000000..76b27acc6 --- /dev/null +++ b/datafiles/main/chapters/4.JSON @@ -0,0 +1,252 @@ +{ + "chapter": { + "id": 4, + "name": "Imperial Fists", + "flavor": "Siege-masters of utmost excellence, the Imperial Fists stoicism has lead them to great victories and horrifying defeats. To them, the idea of a tactical retreat is utterly inconsiderable. They hold ground on Inwit vigilantly, refusing to back down from any fight.", + "origin": 1, // 1 - Founding, 2 -successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 0, // The id of the founding chapter, 0 for unknown or none + "splash": 4, + "icon": 4, // in \images\creation\creation_icons.png, the index from the left, 0 being blank square and 1 being dark angels etc + "icon_name": "if", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 6, // 1-10 + "purity": 7, // 1-10 + "stability": 10, // 1-10 + "cooperation": 8, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 2, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Ice", // "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "Inwit", + "recruiting": "Hive", //"Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "Necromunda", + "discipline": "telekinesis", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "SURVIVAL", // ? need to find the best way to do this + "advantages": [ //TODO something with these after rework of adv organisation + "", + "Bolter Drilling", + "Siege Masters", + "Boarders", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Gold", + "secondary": "Gold", + "pauldron_r": "Gold", + "pauldron_l": "Gold", + "trim": "Red", + "lens": "Red", + "weapon": "Black", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for special trim colours // todo update ref for new name + }, + "names": { + //Chapter Staff + "hchaplain": "Guaron", + "clibrarian": "Vidos Harn", + "fmaster": "Atornus Geis", + "hapothecary": "Dyserna", + //Company Captains 1 - 10 + "honorcapt": "Darnath Lysander", + "watchmaster": "Helion", + "arsenalmaster": "Tor Garadon", + "admiral": "Kyne Phasn", + "marchmaster": "Maluan", + "ritesmaster": "Antaros", + "victualler": "Jonas", + "lordexec": "Chalosa", + "relmaster": "Kaheron", + "recruiter": "Taelos" + }, + "battle_cry": "Primarch-Progenitor, to your glory and the glory of him on earth!", + "equal_specialists": 0, + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes + "split_vets": 0 // 0 no, 1 yes + }, + "successors": 21, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 1, + "zygote": 0, + "betchers": 1, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ // todo maybe convert to struct + 0, // nothing + 0, // Progenitor faction + 75, // Imperium + 60, // Admech + 50, //Inquisition + 60, // Ecclesiarchy + 60, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Vorn Hagen", + "specialty": 1, //1 Leader, 2 Champion, 3 Psyker, + "melee": 4, // 1 twin power fists ... 8 force staff + "ranged": 7, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "" + ], + "gear": "", + "mobi": "", + "armour": "" + }, + "artifact": {}, + "company_titles": [ + "", + "The Fists of Dorn", + "The Scions of Redemption", + "The Sentinels of Terra", + "The Reductors", + "The Heralds of Truth", + "The Siege Hammers", + "Guardians of Phalanx", + "Dorn's Huscarls", + "The Wardens", + "The Eyes of Dorn" + ], + "flagship_name": "Spear of Vengeance", + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + */ + "extra_ships": { + "battle_barges": 1, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 0, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * Stacks with strength for non-founding chapters + */ + // * Not working yet + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + // * Not working yet + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * for combat roles, `custom_squads` should probably? be used instead + */ + "custom_roles": { + "honour_guard": { + "name": "Huscarl", + "wep1": "Power Sword", + "wep2": "Storm Shield", + "armour": "Power Armour" + } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations ? idk what that does yet + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/5.JSON b/datafiles/main/chapters/5.JSON new file mode 100644 index 000000000..ec7dd90dc --- /dev/null +++ b/datafiles/main/chapters/5.JSON @@ -0,0 +1,263 @@ +{ + "chapter": { + "id": 5, + "name": "Blood Angels", + "flavor": "One of the most noble and renowned chapters, their combat record belies a dark flaw in their gene-seed caused by the death of their primarch. Their primarch had wings and a propensity for close combat, and this shows in their extensive use of jump packs and close quarters weapons.", + "origin": 1, // 1 - Founding, 2 -successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 0, // The id of the founding chapter, 0 for unknown or none + "splash": 5, + "icon": 5, // in \images\creation\creation_icons.png, the index from the left, 0 being blank square and 1 being dark angels etc + "icon_name": "ba", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 9, // 1-10 + "stability": 9, // 1-10 + "cooperation": 7, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 0, // 1 = true + "homeworld_rule": 3, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Desert", // "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "Baal", + "recruiting": "", //"Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "BLOODDUEL", // ? need to find the best way to do this + "advantages": [ //TODO something with these after rework of adv organisation + "", + "Assault Doctrine", + "Psyker Abundance", + "Reverent Guardians", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", + "Black Rage", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Sanguine Red", + "secondary": "Sanguine Red", + "pauldron_r": "Sanguine Red", + "pauldron_l": "Sanguine Red", + "trim": "Lighter Black", + "lens": "Lime", + "weapon": "Black", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for special trim colours // todo update ref for new name + }, + "names": { + //Chapter Staff + "hchaplain": "Astorath the Grim", + "clibrarian": "Mephiston", + "fmaster": "Incarael", + "hapothecary": "Corbulo", + //Company Captains 1 - 10 + "honorcapt": "Areno Karlaen", + "watchmaster": "Donatos Aphael", + "arsenalmaster": "Machiavi", + "admiral": "Castigon", + "marchmaster": "Sendini", + "ritesmaster": "Raxiatel", + "victualler": "Phaeton", + "lordexec": "Zedrenael", + "relmaster": "Sendroth", + "recruiter": "Borgio" + }, + "battle_cry": "For the Emperor and Sanguinius! Death! DEATH!", + "equal_specialists": 0, + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes + "split_vets": 0 // 0 no, 1 yes + }, + "successors": 3, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ // todo maybe convert to struct + 0, // nothing + 0, // Progenitor faction + 75, // Imperium + 60, // Admech + 50, //Inquisition + 60, // Ecclesiarchy + 60, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Dante", + "specialty": 2, //1 Leader, 2 Champion, 3 Psyker, + "melee": 6, // 1 twin power fists ... 8 force staff + "ranged": 2, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "ancient", + "old_guard", + "melee_enthusiast" + ], + "gear": "Iron Halo", + "mobi": "Jump Pack", + "armour": "" + }, + "artifact": { + "name": "Axe Mortalis", + "description": "An immensely powerful Power Axe, the Axe Mortalis, forged in the days immediately after the end of the Horus Heresy.", + "base_weapon_type": "Power Axe" + }, + "company_titles": [ + "", + "Archangels", + "The Blooded", + "Ironhelms", + "Knights of Baal", + "Daemonbanes", + "Eternals", + "Unconquerables", + "Bloodbanes", + "Sunderers", + "Redeemers" + ], + "flagship_name": "Spear of Vengeance", + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 4, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * Stacks with strength for non-founding chapters + */ + // * Not working yet + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + // * Not working yet + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * for combat roles, `custom_squads` should probably? be used instead + */ + "custom_roles": { + "honour_guard": { + "name": "Sanguinary Guard", + "wep1": "Power Axe", + "wep2": "Bolt Pistol", + "armour": "Artificer Armour", + "mobi": "Jump Pack" + }, + "apothecary": { + "name": "Sanguinary Priest", + "wep1": "Power Axe" + } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations ? idk what that does yet + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/6.JSON b/datafiles/main/chapters/6.JSON new file mode 100644 index 000000000..88b5b7a82 --- /dev/null +++ b/datafiles/main/chapters/6.JSON @@ -0,0 +1,260 @@ +{ + "chapter": { + "id": 6, + "name": "Iron Hands", + "flavor": "The flesh is weak, and the weak shall perish. Such is the creed of these mercilessly efficient cyborg warriors. A chapter with strong ties to the Mechanicum, they crush the foes of the Emperor and Machine God alike with a plethora of exotic technology and ancient weaponry.", + "origin": 1, // 1 - Founding, 2 -successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 0, // The id of the founding chapter, 0 for unknown or none + "splash": 6, + "icon": 6, // in \images\creation\creation_icons.png, the index from the left, 0 being blank square and 1 being dark angels etc + "icon_name": "ih", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 8, // 1-10 + "stability": 8, // 1-10 + "cooperation": 2, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 0, // 1 = true + "homeworld_rule": 3, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Lava", // "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "Medusa", + "recruiting": "", //"Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "KNOWLEDGE", // ? need to find the best way to do this + "advantages": [ //TODO something with these after rework of adv organisation + "", + "Tech-Brothers", + "Devastator Doctrine", + "", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", + "Splintered", + "Suspicious", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Black", + "secondary": "Black", + "pauldron_r": "Black", + "pauldron_l": "Black", + "trim": "Silver", + "lens": "Dark Red", + "weapon": "Silver", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for special trim colours // todo update ref for new name + }, + "names": { + //Chapter Staff + "hchaplain": "Jorggir Shidd", + "clibrarian": "Lydriik", + "fmaster": "Feirros", + "hapothecary": "Anaar Telech", + //Company Captains 1 - 10 + "honorcapt": "Caanok Var", + "watchmaster": "Eutuun Hes", + "arsenalmaster": "Sind Grolvoch", + "admiral": "Maarkul Rumann", + "marchmaster": "Tyrrod", + "ritesmaster": "Golloth", + "victualler": "Raan", + "lordexec": "Doroor Hesh", + "relmaster": "Verrox", + "recruiter": "Telavech" + }, + "battle_cry": "The flesh is weak!", + "equal_specialists": 1, + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes + "split_vets": 0 // 0 no, 1 yes + }, + "successors": 6, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ // todo maybe convert to struct + 0, // nothing + 0, // Progenitor faction + 30, // Imperium + 80, // Admech + 35, //Inquisition + 30, // Ecclesiarchy + 50, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Kardan Stronos", + "specialty": 2, //1 Leader, 2 Champion, 3 Psyker, + "melee": 4, // 1 twin power fists ... 8 force staff + "ranged": 3, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "flesh_is_weak", + "zealous_faith", + "tinkerer", + "old_guard" + ], + "gear": "", + "mobi": "", + "armour": "", + "bionics": 10 + }, + "artifact": {}, + "company_titles": [ + "", + "Clan Avernii", + "Clan Garrsak", + "Clan Raukaan", + "Clan Kaargul", + "Clan Haarmek", + "Clan Sorrgol", + "Clan Borrgos", + "Clan Morlaag", + "Clan Vurgaan", + "Clan Dorrvok" + ], + "flagship_name": "", + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": -20, + "chaplains_per_company": 0, + "techmarines": 0, + "techmarines_per_company": 1, + "apothecary": 0, + "apothecary_per_company": 0, + "epistolary": 0, + "epistolary_per_company": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": -20, + "assault": 0, + "veteran": 20, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * Stacks with strength for non-founding chapters + */ + // * Not working yet + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + // * Not working yet + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + [ + "Bionics", + 200 + ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * for combat roles, `custom_squads` should probably? be used instead + */ + "custom_roles": { + "chaplain": { + "name": "Iron Father" + }, + "techmarine": { + "name": "Iron Father" + } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations ? idk what that does yet + */ + "squad_name": "Clave", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/7.JSON b/datafiles/main/chapters/7.JSON new file mode 100644 index 000000000..b5e8d7f02 --- /dev/null +++ b/datafiles/main/chapters/7.JSON @@ -0,0 +1,270 @@ +{ + "chapter": { + "id": 7, + "name": "Ultramarines", + "flavor": "An honourable and venerated chapter, the Ultramarines are considered to be amongst the best of the best. Their Primarch was the author of the great tome of the “Codex Astartes”, and they are considered exemplars of what a perfect Space Marine Chapter should be like.", + "origin": 1, // 1 - Founding, 2 -successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 0, // The id of the founding chapter, 0 for unknown or none + "splash": 7, + "icon": 7, // in \images\creation\creation_icons.png, the index from the left, 0 being blank square and 1 being dark angels etc + "icon_name": "um", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 10, // 1-10 + "stability": 10, // 1-10 + "cooperation": 10, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 3, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Temperate", // "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "Macragge", + "recruiting": "Death", //"Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "Parmenio", + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "EXPOSURE", // ? need to find the best way to do this + "advantages": [ //TODO something with these after rework of adv organisation + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Dark Ultramarine", + "secondary": "Dark Ultramarine", + "pauldron_r": "Dark Ultramarine", + "pauldron_l": "Dark Ultramarine", + "trim": "Gold", + "lens": "Red", + "weapon": "Red", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for special trim colours + }, + "names": { + //Chapter Staff + "hchaplain": "Ortan Cassius", + "clibrarian": "Varro Tigurius", + "fmaster": "Fennias Maxim", + "hapothecary": "Corpus Helix", + //Company Captains 1 - 10 + "honorcapt": "Severus Agemman", + "watchmaster": "Cato Sicarius", + "arsenalmaster": "Mikael Fabian", + "admiral": "Uriel Ventris", + "marchmaster": "Caito Galenus", + "ritesmaster": "Maximus Epathus", + "victualler": "Gerad Ixion", + "lordexec": "Numitor", + "relmaster": "Sinon", + "recruiter": "Antilochus" + }, + "battle_cry": "Courage and honour!", + "equal_specialists": 0, + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes + "split_vets": 0 // 0 no, 1 yes + }, + "successors": 27, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ // todo maybe convert to struct + 0, // nothing + 0, // Progenitor faction + 80, // Imperium + 65, // Admech + 65, //Inquisition + 65, // Ecclesiarchy + 65, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Marneus Calgar", + "specialty": 1, //1 Leader, 2 Champion, 3 Psyker, + "melee": 1, // 1 twin power fists ... 8 force staff + "ranged": 1, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "still_standing", + "tyrannic_vet" + ], + "gear": "Iron Halo", + "mobi": "", + "armour": "", + "bionics": 4 + }, + "artifact": [ + { + "name": "Gauntlet of Ultramar", + "description": "A mighty Power Fist with an Integrated Bolter that was reclaimed from a fallen Chaos champion, slain during the Gamalia Reclusiam Massacre by the Primarch of the Ultramarines, Roboute Guilliman himself", + "base_weapon_type": "Boltstorm Gauntlet", + "slot": "wep1" + }, + { + "name": "Gauntlet of Ultramar", + "description": "A mighty Power Fist with an Integrated Bolter that was reclaimed from a fallen Chaos champion, slain during the Gamalia Reclusiam Massacre by the Primarch of the Ultramarines, Roboute Guilliman himself", + "base_weapon_type": "Boltstorm Gauntlet", + "slot": "wep2" + }, + { + "name": "Armour of Antilochus", + "description": "A masterwork suit of the standard Indomitus pattern Terminator Armour. It incorporates a Teleport Homer, allowing Terminator squads of the veteran First Company to deploy next to their Chapter Master's side.", + "base_weapon_type": "Terminator Armour", + "slot": "armour" + } + ], + "company_titles": [ + "", + "Warriors of Ultramar", + "Guardians of the Temple", + "Scourge of the Xenos", + "Defenders of Ultramar", + "Wardens of the Eastern Fringe", + "Brethren of the Forge", + "Defenders of Caeserean", + "Honourblades", + "Stormbringers", + "The Scions of Ultramar" + ], + "flagship_name": "Laurels of Victory", + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "chaplains_per_company": 0, + "techmarines": 0, + "techmarines_per_company": 0, + "apothecary": 0, + "apothecary_per_company": 0, + "epistolary": 0, + "epistolary_per_company": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * Stacks with strength for non-founding chapters + */ + // * Not working yet + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + // * Not working yet + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * for combat roles, `custom_squads` should probably? be used instead + */ + "custom_roles": {}, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations ? idk what that does yet + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/8.JSON b/datafiles/main/chapters/8.JSON new file mode 100644 index 000000000..5a53582db --- /dev/null +++ b/datafiles/main/chapters/8.JSON @@ -0,0 +1,273 @@ +{ + "chapter": { + "id": 8, + "name": "Salamanders", + "flavor": "Followers of the Promethean Cult, the jet-black skinned Salamanders are forgemasters of legend. They are armed with the best wargear available and prefer flame based weaponry. Their only drawback is their low numbers and slow recruiting.", + "origin": 1, // 1 - Founding, 2 -successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 0, // The id of the founding chapter, 0 for unknown or none + "splash": 8, + "icon": 8, // in \images\creation\creation_icons.png, the index from the left, 0 being blank square and 1 being dark angels etc + "icon_name": "sl", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 2, // 1-10 + "purity": 8, // 1-10 + "stability": 8, // 1-10 + "cooperation": 10, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 0, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Lava", // "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "Nocturne", + "recruiting": "", //"Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", + "discipline": "pyromancy", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "APPRENTICESHIP", // ? need to find the best way to do this + "advantages": [ //TODO something with these after rework of adv organisation + "", + "Crafters", + "Devastator Doctrine", + "", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Firedrake Green", + "secondary": "Firedrake Green", + "pauldron_r": "Black", + "pauldron_l": "Black", + "trim": "Dark Gold", + "lens": "Red", + "weapon": "Black", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for special trim colours + }, + "names": { + //Chapter Staff + "hchaplain": "Leotrak Esar", + "clibrarian": "Velcona", + "fmaster": "Argos", + "hapothecary": "Harath Shen", + //Company Captains 1 - 10 + "honorcapt": "", + "watchmaster": "Pellas Mir'San", + "arsenalmaster": "Adrax Agatone", + "admiral": "Dac'tyr", + "marchmaster": "Mulcebor", + "ritesmaster": "Ur'zan Draakgard", + "victualler": "", + "lordexec": "", + "relmaster": "", + "recruiter": "Sol Ba'ken" + }, + "battle_cry": "Courage and honour!", + "equal_specialists": 0, + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes + "split_vets": 0 // 0 no, 1 yes + }, + "successors": 2, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 1, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ // todo maybe convert to struct + 0, // nothing + 0, // Progenitor faction + 80, // Imperium + 65, // Admech + 65, //Inquisition + 60, // Ecclesiarchy + 60, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Tu'Shan", + "specialty": 2, //1 Leader, 2 Champion, 3 Psyker, + "melee": 4, // 1 twin power fists ... 8 force staff + "ranged": 2, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "old_guard", + "tinkerer", + "slow_and_purposeful" + ], + "gear": "", + "mobi": "", + "armour": "", + "bionics": 0 + }, + "artifact": [ + { + "name": "Stormbearer", + "description": "A masterwork Thunder Hammer, Stormbearer is thought to be made from the same material as that used to create Thunderhead, the Thunder Hammer of Vulkan.", + "base_weapon_type": "Thunder Hammer", + "slot": "wep1" + } + ], + "company_titles": [ + "", + "The Firedrakes", + "Defenders of Nocturne", + "The Pyroclasts", + "The Branded", + "The Drake Hunters", + "The Flamehammers", + "", + "", + "", + "Sons of Nocturne" + ], + "flagship_name": "Flamewrought", + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "chaplains_per_company": 0, + "techmarines": 0, + "techmarines_per_company": 0, + "apothecary": 0, + "apothecary_per_company": 0, + "epistolary": 0, + "epistolary_per_company": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 20, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * Stacks with strength for non-founding chapters + */ + // * Not working yet + "extra_marines": { + "second": 20, + "third": 20, + "fourth": 20, + "fifth": 20, + "sixth": 20, + "seventh": -200, + "eighth": -200, + "ninth": -200, + "tenth": -40 + }, + // * Not working yet + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * for combat roles, `custom_squads` should probably? be used instead + */ + "custom_roles": { + "veteran": { + "name": "Firedrake", + "wep1": "Power Sword" + }, + "veteran_sergeant": { + "name": "Firedrake Master" + }, + "terminator": { + "name": "Firedrake Terminator" + }, + "terminator_assault": { + "name": "Firedrake Terminator" + } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations ? idk what that does yet + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/9.JSON b/datafiles/main/chapters/9.JSON new file mode 100644 index 000000000..1ed6a316c --- /dev/null +++ b/datafiles/main/chapters/9.JSON @@ -0,0 +1,259 @@ +{ + "chapter": { + "id": 9, + "name": "Raven Guard", + "flavor": "Clinging to the shadows and riding the edge of lightning the Raven Guard strike out at the hated enemy with stealth and speed. Using lightning strikes, hit and run tactics, and guerrilla warfare, they are known for being there one second and gone the next.", + "origin": 1, // 1 - Founding, 2 -successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 0, // The id of the founding chapter, 0 for unknown or none + "splash": 9, + "icon": 9, // in \images\creation\creation_icons.png, the index from the left, 0 being blank square and 1 being dark angels etc + "icon_name": "rg", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 8, // 1-10 + "stability": 4, // 1-10 + "cooperation": 5, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Dead", // "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "Deliverance", + "recruiting": "Death", //"Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "EXPOSURE", // ? need to find the best way to do this + "advantages": [ //TODO something with these after rework of adv organisation + "", + "Ambushers", + "Assault Doctrine", + "", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", + "Splintered", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Black", + "secondary": "Black", + "pauldron_r": "Black", + "pauldron_l": "Black", + "trim": "Silver", + "lens": "Dark Red", + "weapon": "Black", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for special trim colours + }, + "names": { + //Chapter Staff + "hchaplain": "Jolaran Tael", + "clibrarian": "Taalis Shraek", + "fmaster": "Saar Laeron", + "hapothecary": "Vynda Aason", + //Company Captains 1 - 10 + "honorcapt": "Vykar Kaed", + "watchmaster": "Aaja Solari", + "arsenalmaster": "Vordin Krayn", + "admiral": "Aethon Shaan", + "marchmaster": "Kyrin Solaq", + "ritesmaster": "Syras Colfaen", + "victualler": "Aervar Qeld", + "lordexec": "Reszasz Krevaan", + "relmaster": "Vos Delorn", + "recruiter": "Kalae Korvydae" + }, + "battle_cry": "Victorus aut Mortis!", + "equal_specialists": 0, + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes + "split_vets": 0 // 0 no, 1 yes + }, + "successors": 8, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 1, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 1 + }, + "disposition": [ // todo maybe convert to struct + 0, // nothing + 0, // Progenitor faction + 80, // Imperium + 50, // Admech + 50, //Inquisition + 50, // Ecclesiarchy + 60, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "Kayvaan Shrike", + "specialty": 1, //1 Leader, 2 Champion, 3 Psyker, + "melee": 2, // 1 twin power fists ... 8 force staff + "ranged": 1, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "lightning_warriors", + "still_standing", + "seasoned" + ], + "gear": "Jump Pack", + "mobi": "", + "armour": "", + "bionics": 0 + }, + "artifact": [], + "company_titles": [ + "", + "The Blackwings", + "The Shadowborne", + "The Ghoststalkers", + "The Silent", + "The Watchful", + "The Darkened Blades", + "The Whisperclaws", + "The Unseen", + "The Dirgesingers", + "The Subtle" + ], + "flagship_name": "Avenger", + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "chaplains_per_company": 0, + "techmarines": 0, + "techmarines_per_company": 0, + "apothecary": 0, + "apothecary_per_company": 0, + "epistolary": 0, + "epistolary_per_company": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * Stacks with strength for non-founding chapters + */ + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * for combat roles, `custom_squads` should probably? be used instead + */ + "custom_roles": { + "captain": { + "name": "Shadow Captain", + "wep1": "Lightning Claw" + }, + "honour_guard": { + "name": "Shadow Warden", + "mobi": "Jump Pack" + } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations ? idk what that does yet + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/chapters/template.JSON b/datafiles/main/chapters/template.JSON new file mode 100644 index 000000000..264f516c8 --- /dev/null +++ b/datafiles/main/chapters/template.JSON @@ -0,0 +1,305 @@ +{ + "chapter": { + "id": 1, + "name": "Chapter Name", + "flavor": "Chapter Lore", + "origin": 3, // 1 - Founding, 2 - Successor, 3 - Other/non-canon/fanmade, 4 - Custom + "points": 150, + "founding": 0, // The id of the founding chapter, 0 for unknown or none, 10 for random + "splash": 1, // in \images\creation\chapters\splash folder, the img number, 1 being Dark Angels etc. + "icon": 1, // in \images\creation\chapters\icons folder, the icon number, 1 being Dark Angels etc. + "icon_name": "aa", // ? dunno what this is used for yet but the icon breaks if you dont use it + "fleet_type": 1, // 1= Homeworld, 2 = Fleet based, 3 = Penitent + "strength": 5, // 1-10 + "purity": 5, // 1-10 + "stability": 5, // 1-10 + "cooperation": 5, // 1-10 + "homeworld_exists": 1, // 1 = true + "recruiting_exists": 1, // 1 = true + "homeworld_rule": 1, // 1 = Govenor, 2 = Countries, 3 = Personal Rule + "homeworld": "Hive", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "homeworld_name": "", // Homeworld Planet name, leave blank to autogenerate + "recruiting": "Death", // one of "Lava" "Desert" "Forge" "Hive" "Death" "Agri" "Feudal" "Temperate" "Ice" "Dead" "Shrine" + "recruiting_name": "", // Recruiting Planet name, leave blank to autogenerate + "discipline": "default", // one of 'default' 'biomancy' 'pyromancy' 'telekinesis' 'rune Magick' + "aspirant_trial": "SURVIVAL", // one of "BLOODDUEL" "HUNTING" "SURVIVAL" "EXPOSURE" "KNOWLEDGE" "CHALLENGE" "APPRENTICESHIP" + "advantages": [ + "", // leave the first entry blank for now + "", + "", + "", + "", + "", + "", + "", + "" + ], + "disadvantages": [ + "", // leave the first entry blank for now + "", + "", + "", + "", + "", + "", + "", + "" + ], + "colors": { + "main": "Black", + "secondary": "Black", + "pauldron_r": "Black", + "pauldron_l": "Black", + "trim": "Silver", + "lens": "Red", + "weapon": "Dark Red", + "special": 0, // 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + //"trim_on": 0 // 0 no, 1 yes for pauldron trim colours. Trim colour will still be used for certain complex livery items + }, + "names": { + //Chapter Staff + "hchaplain": "", // Head Chaplain + "clibrarian": "", // Chief Librarian + "fmaster": "", // Forge Master + "hapothecary": "", // Head Apothecary + //Company Captains 1 - 10 + "honorcapt": "", + "watchmaster": "", + "arsenalmaster": "", + "admiral": "", + "marchmaster": "", + "ritesmaster": "", + "victualler": "", + "lordexec": "", + "relmaster": "", + "recruiter": "" + }, + "battle_cry": "For the Emperor!", + "equal_specialists": 0, // 0 if no, 1 if yes. If yes, will distribute specialist roles like Assaults and Devastators equally between companies. Otherwise all Assaults go in Company 8 and all Devastators in Company 9 + "load_to_ships": { + "escort_load": 2, // 0 no, 2 yes, 1 doesnt do anything :) + "split_scouts": 0, // 0 no, 1 yes. If yes, splits scouts between companies equally. Otherwise all scouts are kept in 10th Company. + "split_vets": 0 // 0 no, 1 yes. If yes, all veterans are distrubuted equally between companies. Otherwise all veterans are kept in the 1st Company + }, + "successors": 0, //total number of successor chapters + "mutations": { + "preomnor": 0, + "voice": 0, + "doomed": 0, + "lyman": 0, + "omophagea": 0, + "ossmodula": 0, + "membrane": 0, + "zygote": 0, + "betchers": 0, + "catalepsean": 0, + "secretions": 0, + "occulobe": 0, + "mucranoid": 0 + }, + "disposition": [ + 0, // nothing + 0, // Progenitor faction + 50, // Imperium + 50, // Admech + 50, //Inquisition + 50, // Ecclesiarchy + 50, // Astartes + 0 // nothing + ], + "chapter_master": { + "name": "", + "specialty": 1, //1 Leader, 2 Champion, 3 Psyker, + "melee": 1, // 1 twin power fists ... 8 force staff + "ranged": 1, // 1 boltstorm gauntlets ... 7 storm shield + // All chapter masters have the trait `Lead by Example` by default + "traits": [ + "" + ], + "gear": "", + "mobi": "", + "armour": "" // default is Artificer armour, only needed to set if changing to something else. + }, + "artifact": [ + { + "name": "Artifact Name", + "description": "Artefact Lore", + "base_weapon_type": "Power Sword", + "slot": "wep1" + } + ], + "company_titles": [ + "", + "1st Company", + "2nd Company", + "3rd Company", + "4th Company", + "5th Company", + "6th Company", + "7th Company", + "8th Company", + "9th Company", + "10th Company" + ], + "flagship_name": "Flagship Name", // leave blank to autogenerate + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + * + * use negative numbers to subtract ships + * * Stacks with advantages/disadvantages + */ + "extra_ships": { + "battle_barges": 0, + "gladius": 0, + "strike_cruisers": 0, + "hunters": 0 + }, + /** + * * Default HQ Layout (Does not include company specialists) + * - 8 Chaplains, 8 Techmarines, 8 Apothecary, 2 Epistolary (librarian), + * - 2 Codiciery, 4 Lexicanum + * * Default Company specialists (divided based on `load_to_ships.split_vets` setting) + * - 20 Terminators, 85 Veterans, 20 Devastators, 20 Assault + * Use negative numbers to subtract + * * Stacks with advantages/disadvantages + */ + "extra_specialists": { + "chaplains": 0, + "techmarines": 0, + "apothecary": 0, + "epistolary": 0, + "codiciery": 0, + "lexicanum": 0, + "terminator": 0, + "assault": 0, + "veteran": 0, + "devastator": 0 + }, + /** + * * Default Marine strength + * - 100 marines per company + * use negative numbers to subtract + * * Stacks with strength for non-founding chapters only + */ + "extra_marines": { + "second": 0, + "third": 0, + "fourth": 0, + "fifth": 0, + "sixth": 0, + "seventh": 0, + "eighth": 0, + "ninth": 0, + "tenth": 0 + }, + /** + * All vehicles are added to the 10th company at the start of the game + */ + "extra_vehicles": { + "rhino": 0, + "whirlwind": 0, + "predator": 0, + "land_raider": 0, + "land_speeder": 0 + }, + /** Add extra starting items ["Item Name", Number to add] */ + "extra_equipment": [ + // [ + // "Bolter", + // 20 + // ] + ], + /** + * Provide a place to change the default name and equipment preferences of roles for this chapter + * `custom_roles` should be used for specialist/leadership type roles, + * To affect an entire squad, see `custom_squads` below + */ + "custom_roles": { + // "honour_guard": { + // "name": "Honour Guard", + // "wep1": "Power Sword", + // "wep2": "Bolter" + // }, + // "veteran": { + // "name": "Veteran", + // "wep1": "Chainaxe" + // }, + // "captain": { + // "name": "Captain", + // "wep1": "Power Sword" + // }, + // "tactical": { + // "name": "Tactical" + // }, + // "devastator": { + // "name": "Devastator" + // }, + // "assault": { + // "name": "Assault", + // "wep1": "Chainsword" + // }, + // "scout": { + // "name": "Scout", + // "wep1": "Sniper Rifle" + // }, + // "chaplain": { + // "name": "Chaplain", + // }, + // "techmarine": { + // "name": "Techmarine", + // "wep1": "Power Axe" + // }, + // "apothecary": { + // "name": "Apothecary", + // "wep1": "Power Axe" + // }, + // "librarian": { + // "name": "Librarian", + // "wep1": "Force Staff" + // }, + // "sergeant": { + // "name": "Sergeant", + // "wep1": "Chainaxe" + // }, + // "veteran_sergeant": { + // "name": "Veteran Sergeant", + // "wep1": "Chainaxe" + // } + }, + /** + * * Custom squad roles, loadouts and formations + * When companies are made, squads are formed based on these rules: + * - squad name: one of captain, terminator, terminator_assault, sternguard_veteran, + vanguard_veteran, devastator, tactical, assault, scout, scout_sniper + * - squad array layout [Role, Role, ...Role, type_data] + * - each element of the array is a default Role, and their settings. + - if you changed the role using `custom_roles` you need to reference the role with this new name + - for non-leader roles it is better to change the name of the role in the squad layout instead + * - unit layout [Role Name, Settings Struct] + * - settings struct: + * - max: The most amount of this unit is allowed per squad + * - min: The squad can't be formed unless at least 1 of this unit is in it + * - role: The name of the unit when it is a member of the squad. This is where you rename roles e.g. + "Terminator" > "Deathwing Terminator" + ** - loadout: Struct containing Required and Optional weaponry this unit can equip + a required loadout always follows this syntax :[,] + so "wep1":["Bolter",4], will mean four marines are always equipped with 4 bolters in the wep1 slot + * option loadouts follow the following syntax :[[],] + for example [["Flamer", "Meltagun"],1], means the role can have a max of one flamer or meltagun + [["Plasma Pistol","Bolt Pistol"], 4] means the role can have a mix of 4 plasma pistols and bolt pistols on top + of all required loadout options + - wep1: right hand weapon + - wep2: left hand weapon + - mobi: Mobility item, e.g. Jump Packs. + - armour: required armour + - gear: special equipment needed for certain roles, like a Roasrius or Narthecium + * - type_data: names the squad, allows certain formations + */ + "squad_name": "Squad", + "custom_squads": {} + } +} \ No newline at end of file diff --git a/datafiles/main/version.json b/datafiles/main/version.json index 3996941bb..890828f24 100644 --- a/datafiles/main/version.json +++ b/datafiles/main/version.json @@ -1,5 +1,5 @@ { - "build_date": "2024-11-13-0915", - "version": "v0.9.9", - "commit_hash": "59933d6" + "build_date": "", + "version": "0.10", + "commit_hash": "" } \ No newline at end of file diff --git a/CHANGELOG.md b/docs/CHANGELOG.md similarity index 99% rename from CHANGELOG.md rename to docs/CHANGELOG.md index 92fa04c92..9590e8b98 100644 --- a/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -20,6 +20,8 @@ All notable changes to this project will be documented in this file. - here go changes that are important only to other collaborators. - everything that a normal player doesn't need to know. ---------------------------------- +## [0.10.0.0] + ## [0.9.6] @@ -253,6 +255,9 @@ Crashes: - Artifact screen text overlap, broken strings are fixed. - Some of the tooltip issues. +- new cheat "ruinspopulate" to put an ancient ruins on every planet + + ### Under The Hood: - `scr_has_adv` and `scr_has_disadv` functions. - New error handling method - `try_and_report_loop`, described [>here<](https://discord.com/channels/714022226810372107/1121959429546455050/1293597133093470269). diff --git a/docs/CHEATCODES.md b/docs/CHEATCODES.md index 2c99bbb52..477044e7e 100644 --- a/docs/CHEATCODES.md +++ b/docs/CHEATCODES.md @@ -33,6 +33,9 @@ Arguments with stars `(argument*)` can be omitted. - `flashgit (number*)` - spawns a Flash Git. - `chaosfleetspawn` - spawns a chaos fleet. - `neworkfleet` - spawns an ork fleet. +- `shiplostevent` - looses a random traveling player ship to the warp +- `recoverlostship` - recovers a random lost ship from the warp + ### Events and Quests: - `event (name*)` - triggers a random event if no name specified. - `crusade` - triggers the Crusade event. diff --git a/fonts/fnt_menu/fnt_menu.old.png b/fonts/fnt_menu/fnt_menu.old.png index c4702d902..5136b0e9e 100644 Binary files a/fonts/fnt_menu/fnt_menu.old.png and b/fonts/fnt_menu/fnt_menu.old.png differ diff --git a/fonts/fnt_menu/fnt_menu.old.yy b/fonts/fnt_menu/fnt_menu.old.yy index eaa95f71e..d0b4764bb 100644 --- a/fonts/fnt_menu/fnt_menu.old.yy +++ b/fonts/fnt_menu/fnt_menu.old.yy @@ -221,7 +221,7 @@ "ranges": [ {"lower":32,"upper":255,}, ], - "regenerateBitmap": true, + "regenerateBitmap": false, "sampleText": "abcdef ABCDEF\n0123456789 .,<>\"'&!?\nthe quick brown fox jumps over the lazy dog\nTHE QUICK BROWN FOX JUMPS OVER THE LAZY DOG\nDefault character: ▯ (9647)", "sdfSpread": 4, "size": 12.0, diff --git a/fonts/fnt_menu/fnt_menu.png b/fonts/fnt_menu/fnt_menu.png index 50ebc1c7c..2e723baae 100644 Binary files a/fonts/fnt_menu/fnt_menu.png and b/fonts/fnt_menu/fnt_menu.png differ diff --git a/objects/obj_bomb_select/Alarm_1.gml b/objects/obj_bomb_select/Alarm_1.gml index e8c28b17c..ed1ed23a2 100644 --- a/objects/obj_bomb_select/Alarm_1.gml +++ b/objects/obj_bomb_select/Alarm_1.gml @@ -4,15 +4,15 @@ for(var i=0; i<31; i++){ ship_all[i]=0; ship_use[i]=0; ship_max[i]=0; - ship_ide[i]=0; + ship_ide[i]=-1; } max_ships=sh_target.capital_number+sh_target.frigate_number+sh_target.escort_number; var tump=0; -var i=0; -for(var b=1; b<=sh_target.capital_number; b++){ +var i=-1; +for(var b=0; b35) then instance_deactivate_object(id); + if (point_distance(x,y,_select_x,_select_y)>20) then instance_deactivate_object(id); } -var bib=instance_nearest(obj_temp3.x,obj_temp3.y,obj_en_fleet); +var bib=instance_nearest(_select_x,_select_y,obj_en_fleet); if (instance_exists(bib)){ - if (point_distance(obj_temp3.x,obj_temp3.y,bib.x,bib.y)<=35){ + if (point_distance(_select_x,_select_y,bib.x,bib.y)<=35){ scr_popup("Cannot Bombard","Enemy fleets are preventing bombardment!","",""); - with(obj_temp3){instance_destroy();} instance_activate_object(obj_en_fleet); instance_destroy(); exit; } - with(obj_temp3){instance_destroy();} } instance_activate_object(obj_en_fleet); diff --git a/objects/obj_bomb_select/Mouse_56.gml b/objects/obj_bomb_select/Mouse_56.gml index a8355b93a..5976b7c54 100644 --- a/objects/obj_bomb_select/Mouse_56.gml +++ b/objects/obj_bomb_select/Mouse_56.gml @@ -11,7 +11,7 @@ if (__b__){ var why=0,onceh=0, ship=0; bomb_score=0; - for(var i=0; i<=25; i++){ + for(var i=0; i0) and (owner == eFACTION.Imperium) and (p_type[1]!="Dead"){ + if (is_dead_star() || planets==0){ + continue; + } + if (owner == eFACTION.Imperium){ //this object simply acts as a counter of ork owned planets - instance_create(x,y,obj_temp3); + array_push(_imperial_planets, id); } + } var ed2,n,i,orkz=choose(4,5,6)+5; @@ -527,22 +515,14 @@ if (did==1){ if (is_test_map==true) then orkz=4; for(var j=0; j0) and (owner == eFACTION.Imperium) and (p_type[1]!="Dead"){ - instance_create(x,y,obj_temp3); - } + current_system.planet[1]=1; + current_system.owner = eFACTION.Ork; + current_system.p_owner = array_create(5, current_system.owner) + array_delete(_imperial_planets, i, 1); } if (field=="tyranids"){ @@ -550,39 +530,42 @@ if (did==1){ if (obj_ini.fleet_type==ePlayerBase.penitent) then orkz+=2; for(var j=0; j0) and (owner<=5) and (p_type[1]!="Dead"){ - instance_create(x,y,obj_temp3); - } + if (is_dead_star() || planets==0){ + continue; + } + if (owner<=5) { + array_push(_non_xenos_chaos, id); + } } + + if (field=="both"){ if (obj_ini.fleet_type==ePlayerBase.penitent) then orkz+=3; orkz+=3; for(var j=0; j0){ recruit_count=scr_role_count(novice_type,""); - if (apothecary_points>=48){ + if (apothecary_recruit_points>=48){ if (recruit_count>0){ random_marine=scr_random_marine(novice_type,0); // show_message(marine_position); @@ -203,7 +203,7 @@ if (training_apothecary>0){ if (random_marine != "none"){ marine_position=random_marine[1]; marine_company=random_marine[0]; - apothecary_points-=48; + apothecary_recruit_points-=48; unit = fetch_unit(random_marine); scr_alert("green","recruitment",unit.name_role()+" has finished training.",0,0); unit.update_role(obj_ini.role[100][15]); @@ -228,9 +228,9 @@ if (training_apothecary>0){ with(obj_ini){scr_company_order(0);} } } else { - apothecary_points=0; + apothecary_recruit_points=0; } - }else if (apothecary_points>=4) and (recruit_count==0){ + }else if (apothecary_recruit_points>=4) and (recruit_count==0){ random_marine=scr_random_marine([obj_ini.role[100][8],obj_ini.role[100][18],obj_ini.role[100][10],obj_ini.role[100][9]],60,{"stat":[["technology", 30, "more"],["intelligence", 45, "more"]]}); if (random_marine != "none"){ @@ -267,6 +267,7 @@ if (training_apothecary>0){ // * Chaplain training * // TODO add functionality for Space Wolves and Iron Hands recruit_count=0; +var training_points_values = ARR_chaplain_training_tiers; if (global.chapter_name!="Space Wolves") and (global.chapter_name!="Iron Hands"){ chaplain_points += training_points_values[training_chaplain]; novice_type = string("{0} Aspirant",obj_ini.role[100][14]); @@ -480,13 +481,13 @@ if (training_techmarine>0){ unit.update_role(novice_type); // Remove from ship - if (unit.ship_location>0){ + if (unit.ship_location>-1){ var man_size=scr_unit_size(obj_ini.armour[0][g1],obj_ini.role[0][g1],true); obj_ini.ship_carrying[unit.ship_location]-=man_size; } obj_ini.loc[0][g1]="Terra"; unit.planet_location=4; - unit.ship_location=0; + unit.ship_location=-1; if (unit.weapon_one()!="Power Weapon"){ unit.update_weapon_one(""); } @@ -555,18 +556,6 @@ if (recruits_finished==1){ recruits=total_recruits; -// ** Gene-seed Test-Slaves ** -for(var i=1; i<=120; i++){ - if (obj_ini.slave_batch_num[i]>0){ - obj_ini.slave_batch_eta[i]-=1; - if (obj_ini.slave_batch_eta[i]==0){ - obj_ini.slave_batch_eta[i]=60; - obj_controller.gene_seed+=obj_ini.slave_batch_num[i]; - // color / type / text /x/y - scr_alert("green","test-slaves","Test-Slave Incubators Batch "+string(i)+" harvested for "+string(obj_ini.slave_batch_num[i])+" Gene-Seed.",0,0); - } - } -} /* TODO implement Lamenters get Black Rage and story if (turn=240) and (global.chapter_name="Lamenters"){ obj_ini.strin2+="Black Rage"; @@ -574,11 +563,11 @@ if (turn=240) and (global.chapter_name="Lamenters"){ } */ // ** Battlefield Loot ** -if (array_contains(obj_ini.adv,"Scavengers")){ +if (scr_has_adv("Tech-Scavengers")){ var lroll1,lroll2,loot=""; lroll1=floor(random(100))+1; lroll2=floor(random(100))+1; - if (array_contains(obj_ini.dis,"Shitty Luck")){ + if (scr_has_disadv("Shitty Luck")){ lroll1+=2; lroll2+=25; } @@ -729,9 +718,12 @@ for(var c=0; c<11; c++){ } // STC Bonuses if (obj_controller.stc_ships>=6){ - for(var v=1; v<=40; v++){ - if (obj_ini.ship_hp[v]obj_ini.ship_maxhp[v]) then obj_ini.ship_hp[v]=obj_ini.ship_maxhp[v]; + //self healing ships logic + for(var v=0; v0){ var ship_spawn = active_forges[irandom(array_length(active_forges)-1)]; - var new_defense_fleet=instance_create(ship_spawn.system.x,ship_spawn.system.y,obj_p_fleet); + var _new_player_fleet=instance_create(ship_spawn.system.x,ship_spawn.system.y,obj_p_fleet); // Creates the ship - var last_ship = new_player_ship(new_ship_event, ship_spawn.system.name); - if (obj_ini.ship_class[last_ship] =="Battle Barge"){ - new_defense_fleet.capital[1]=obj_ini.ship[last_ship]; - new_defense_fleet.capital_number=1; - new_defense_fleet.capital_num[1]=last_ship; - new_defense_fleet.capital_uid[1]=obj_ini.ship_uid[last_ship]; - } - else if (obj_ini.ship_class[last_ship] =="Strike Cruiser"){ - new_defense_fleet.frigate[1]=obj_ini.ship[last_ship]; - new_defense_fleet.frigate_number=1; - new_defense_fleet.frigate_num[1]=last_ship; - new_defense_fleet.frigate_uid[1]=obj_ini.ship_uid[last_ship]; - } - else if (obj_ini.ship_class[last_ship] =="Gladius"){ - new_defense_fleet.escort[1]=obj_ini.ship[last_ship]; - new_defense_fleet.escort_number=1; - new_defense_fleet.escort_num[1]=last_ship; - new_defense_fleet.escort_uid[1]=obj_ini.ship_uid[last_ship]; - } - else if (obj_ini.ship_class[last_ship] =="Hunter"){ - new_defense_fleet.escort[1]=obj_ini.ship[last_ship]; - new_defense_fleet.escort_number=1; - new_defense_fleet.escort_num[1]=last_ship; - new_defense_fleet.escort_uid[1]=obj_ini.ship_uid[last_ship]; - } + add_ship_to_fleet(last_ship, _new_player_fleet) // show_message(string(obj_ini.ship_class[last_ship])+":"+string(obj_ini.ship[last_ship])); @@ -1111,7 +1079,7 @@ for(var i=1; i<=99; i++){ if (string_count("inquisitor_spared",event[i])>0){ var diceh=floor(random(100))+1; - if (string_count("Shit",obj_ini.strin2)>0) then diceh-=25; + if (scr_has_disadv("Shitty Luck")) then diceh-=25; if (diceh<=25){ alarm[8]=1; @@ -1162,7 +1130,7 @@ for(var i=1; i<=99; i++){ last_artifact = scr_add_artifact("random_nodemon","",0,obj_ini.home_name,2); } else { if (obj_ini.fleet_type != ePlayerBase.home_world){ - last_artifact = scr_add_artifact("random_nodemon","",0,obj_ini.ship_location[1],501); + last_artifact = scr_add_artifact("random_nodemon","",0,obj_ini.ship_location[0],501); } } @@ -1292,10 +1260,11 @@ if (fest_scheduled>0) and (fest_repeats>0){ // } //research and forge related actions + research_end(); -apothecary_simple(); merge_ork_fleets(); //complex route plotting for player fleets +return_lost_ships_chance(); with (obj_p_fleet){ if (array_length(complex_route)>0 && action == ""){ set_new_player_fleet_course(complex_route); diff --git a/objects/obj_controller/Alarm_6.gml b/objects/obj_controller/Alarm_6.gml index 72b0d03aa..5bde36cb6 100644 --- a/objects/obj_controller/Alarm_6.gml +++ b/objects/obj_controller/Alarm_6.gml @@ -44,7 +44,7 @@ if (menu==1) and (managing>0){ else if (unit.role()==obj_ini.role[100][19]) { vet_sgt++;} else if (unit.role()=="Codiciery") { codi+=1;} else if (unit.role()=="Lexicanum") { lexi+=1;} - else if (unit.role()==obj_ini.role[100][Role.ANCIENT]) { champ+=1;} + else if (unit.role()==obj_ini.role[100][eROLE.Ancient]) { champ+=1;} } // sets up count for the vehicles // TODO This needs to be extended to accomodate the selection text like the man ones @@ -72,7 +72,7 @@ if (menu==1) and (managing>0){ selecting_dudes+=", "; } if (champ>0){ - selecting_dudes+=$"{champ} {obj_ini.role[100][Role.ANCIENT]}"; + selecting_dudes+=$"{champ} {obj_ini.role[100][eROLE.Ancient]}"; if (chap>1) then selecting_dudes+="s"; selecting_dudes+=", "; } @@ -132,7 +132,7 @@ if (menu==1) and (managing>0){ selecting_dudes+=", "; } if (assa>0){ - selecting_dudes+=string(assa)+" "+string(obj_ini.role[100][Role.ASSAULT]); + selecting_dudes+=string(assa)+" "+string(obj_ini.role[100][eROLE.Assault]); if (sgt>1) then selecting_dudes+="s"; selecting_dudes+=", "; } diff --git a/objects/obj_controller/Create_0.gml b/objects/obj_controller/Create_0.gml index 8fd2afa8a..5462e2898 100644 --- a/objects/obj_controller/Create_0.gml +++ b/objects/obj_controller/Create_0.gml @@ -483,7 +483,7 @@ sel_all=""; sel_promoting=0; drag_square=[]; rectangle_action = -1; -sel_loading=0; +sel_loading=-1; sel_uid=0; // ** Sets Chapter events and celebrations ** @@ -537,11 +537,12 @@ command_set[8]=1; command_set[9]=1; command_set[20]=1; command_set[24]=1; -blandify=0; +modest_livery=0; +progenitor_visuals=0; // ** Default menu items ** selecting_planet=0; -selecting_ship=0; +selecting_ship=-1; fleet_minimized=0; fleet_all=1; tolerant=0; @@ -564,7 +565,6 @@ forge_points = 0; master_craft_chance = 0; tech_status = "Cult Mechanicus"; forge_string=""; -forge_queue=[]; player_forge_data = { player_forges : 0, vehicle_hanger : [], @@ -577,6 +577,7 @@ production_research = { plasma : [0,{}], psi : [0,{}], melta : [0,{}], + grav : [0,{}], chasis : [0,{}], chain :[0,{}], power_fields:[1,{}], @@ -596,6 +597,7 @@ production_research_pathways ={ plasma : [[ "Plasma Coil Magnetization"],{}], psi : [["Psionic Resonance Valves"],{}], melta : [["Atomic Chamber Construction"],{}], + grav : [["Gravitic Reaction Principle"],{}], chasis : [[],{}], chain :[["Adamantine Links"],{}], power_fields:[["Power Field Cooling", "Mono-molecular Edge Sheathing"],{}], @@ -673,29 +675,8 @@ if (instance_exists(obj_ini)){ if (string_count(obj_ini.spe[0,1],"$")>0) then born_leader=1; } // ** Resets marines and other vars ** -for(var i=0; i<501; i++){ - man[i]=""; - ide[i]=0; - man_sel[i]=0; - ma_lid[i]=0; - ma_wid[i]=0; - ma_promote[i]=0; - ma_race[i]=0; - ma_loc[i]=""; - ma_name[i]=""; - ma_role[i]=""; - ma_wep1[i]=""; - ma_mobi[i]=""; - ma_wep2[i]=""; - ma_armour[i]=""; - ma_gear[i]=""; - ma_health[i]=100; - ma_chaos[i]=0; - ma_exp[i]=0; - ma_god[i]=0; - squad[i]=0; - display_unit[i]=0; +for(var i=0; i<501; i++){ if (i<=50){ penit_co[i]=0; @@ -717,6 +698,7 @@ sh_loc = [] sh_hp = [] sh_cargo = [] sh_cargo_max = [] +reset_manage_arrays(); alll=0; // popup=0;// 1: fleet, 2: other, 3: system @@ -931,7 +913,12 @@ trade_mnum[4]=0; // ** Sets up starting requisition ** requisition=500; if (instance_exists(obj_ini)){ - if (obj_ini.progenitor==0) /*and (obj_creation.custom=0)*/ and (global.chapter_name!="Doom Benefactors") then requisition=2000; + if ( + (obj_ini.progenitor == ePROGENITOR.NONE) && + (global.chapter_name != "Doom Benefactors") + ) { + requisition=2000; + } } if (is_test_map==true) then requisition=50000; // ** Sets income ** @@ -1117,7 +1104,6 @@ faction_status[eFACTION.Ecclesiarchy]="Allied"; faction_leader[eFACTION.Eldar]=global.name_generator.generate_eldar_name(2); faction_title[6]="Farseer"; faction_status[eFACTION.Eldar]="Antagonism";// If disposition = 0 then instead set it to "Antagonism" -if (instance_exists(obj_ini)){if (string_count("Eldar",obj_ini.strin)>0) then faction_status[eFACTION.Eldar]="War";} // Orkz faction faction_leader[eFACTION.Ork]=global.name_generator.generate_ork_name(); faction_title[7]="Warboss"; @@ -1263,9 +1249,9 @@ recruiting_type=""; // ** Sets up chapter colors ** main_color=0; secondary_color=0; -trim_color=0; -pauldron2_color=0; -pauldron_color=0; +main_trim=0; +left_pauldron=0; +right_pauldron=0; lens_color=0; weapon_color=0; col_special=0; @@ -1273,7 +1259,7 @@ trim=0; // ** Sets up names, progenitor, successors and mutations ** adept_name=""; recruiter_name=""; -progenitor=""; +progenitor=ePROGENITOR.NONE; successor_chapters=0; mutation=""; @@ -1295,14 +1281,17 @@ other1_disposition=0; other1=""; // ** Sets up bonuses once chapter is created ** if (instance_exists(obj_ini)){ - // Tolerant trait - if (global.load==0) and (string_count("Tolerant",obj_ini.strin2)>0){ - obj_controller.disposition[6]+=5; - obj_controller.disposition[7]+=5; - obj_controller.disposition[8]+=10; - } // General setup if (global.load==0){ + // Tolerant trait + if (scr_has_disadv("Tolerant")) { + obj_controller.disposition[6]+=5; + obj_controller.disposition[7]+=5; + obj_controller.disposition[8]+=10; + } + if (scr_has_adv("Enemy: Eldar")) { + faction_status[eFACTION.Eldar]="War"; + } // Founding Chapter STC Bonuses here if (global.chapter_name=="Salamanders"){ stc_wargear=4; @@ -1316,7 +1305,9 @@ if (instance_exists(obj_ini)){ stc_bonus[3]=3; } if (global.chapter_name=="Blood Ravens"){ - for(var i=0; i<3; i++){scr_add_artifact("random_nodemon","",0,obj_ini.ship[1],501);} + for(var i=0; i<3; i++){ + scr_add_artifact("random_nodemon","",0,obj_ini.ship[0],501); + } } // TODO should add special bonus to different chapters based on lore adept_name=global.name_generator.generate_space_marine_name(); @@ -1326,9 +1317,9 @@ if (instance_exists(obj_ini)){ mutation=""; main_color=obj_ini.main_color; secondary_color=obj_ini.secondary_color; - trim_color=obj_ini.trim_color; - pauldron2_color=obj_ini.pauldron2_color; - pauldron_color=obj_ini.pauldron_color; + main_trim=obj_ini.main_trim; + left_pauldron=obj_ini.left_pauldron; + right_pauldron=obj_ini.right_pauldron; lens_color=obj_ini.lens_color; weapon_color=obj_ini.weapon_color; col_special=obj_ini.col_special; @@ -1371,7 +1362,7 @@ global.custom=1; // ** Sets up base training level and trainees at game start ** training_apothecary=0; -apothecary_points=0; +apothecary_recruit_points=0; apothecary_aspirant=0; training_chaplain=0; chaplain_points=0; @@ -1387,7 +1378,7 @@ penitorium=0; end_turn_insights = {}; // Redefines training based on chapter if (instance_exists(obj_ini)){ - if (string_count("Intolerant",obj_ini.strin2)>0) then training_psyker=0; + if (scr_has_disadv("Psyker Intolerant")) then training_psyker=0; if (global.chapter_name="Space Wolves") then training_chaplain=0; } @@ -1445,18 +1436,21 @@ loyalty_hidden=100;// Updated when inquisitors do an inspection // ** Sets up gene seed ** gene_seed=20; if (scr_has_disadv("Sieged")) then gene_seed = floor(random_range(250, 400)); +if scr_has_disadv("Obliterated") then gene_seed=floor(random_range(50,200)); if (global.chapter_name=="Lamenters") then gene_seed=30; if (global.chapter_name=="Soul Drinkers") then gene_seed=60; // ** sets up the starting squads** squads = true; -game_start_squads() +game_start_squads(); squads = false; // **sets up starting forge_points -calculate_research_points() +specialist_point_handler = new SpecialistPointHandler(); +specialist_point_handler.calculate_research_points(); + -//** sets up marine_by_location view +//** sets up marine_by_location views location_viewer = new UnitQuickFindPanel(); // ** Sets up the number of marines per company ** @@ -1634,7 +1628,7 @@ temp[62]="##Your fleet contains "; var bb=0,sk=0,glad=0,hunt=0,ships=0,bb_names=[],sk_names=[],glad_names=[],hunt_names=[]; codex[0]="";codex_discovered[0]=0; -for(var mm=0; mm<=30; mm++){ +for(var mm=0; mm=5){ } } remov=string_length(string(temp[65])+string(temp[66])+string(temp[67])+string(temp[68])+string(temp[69]))+1; - action_set_alarm(2, 0); instance_create(0,0,obj_tooltip ); diff --git a/objects/obj_controller/Draw_64.gml b/objects/obj_controller/Draw_64.gml index e46f42052..4613a5b92 100644 --- a/objects/obj_controller/Draw_64.gml +++ b/objects/obj_controller/Draw_64.gml @@ -47,32 +47,24 @@ if (!zoomed && !zui){ draw_set_alpha(1); draw_sprite(spr_new_banner,0,1439+new_banner_x,62); draw_sprite(spr_new_ui_cover,0,0,(900-17)); - // Handles custom chapters - if (is_string(obj_ini.icon_name)){ - if (string_count("custom",obj_ini.icon_name)>0){ - var cusl=string_replace(obj_ini.icon_name,"custom",""); - cusl=real(cusl); - if (obj_cuicons.spr_custom[cusl]>0) and (obj_cuicons.spr_custom_icon[cusl]!=-1){ - draw_sprite_stretched(obj_cuicons.spr_custom_icon[cusl],0,1451+new_banner_x,73,141,141); - } - }else { - var icon_sprite=spr_icon,icc=obj_ini.icon; - if (icc<=20) then scr_image("creation",icc,1451+new_banner_x,73,141,141); - if (icc>20){ - icon_sprite=spr_icon_chapters; - icc-=19; - draw_sprite(icon_sprite,icc,1451+new_banner_x,73); - } - } + + var sprx = 1451+new_banner_x, + spry = 73, + sprw = 141, + sprh = 141; + + if (sprite_exists(global.chapter_icon_sprite)){ + draw_sprite_stretched(global.chapter_icon_sprite, global.chapter_icon_frame, sprx, spry, sprw, sprh); } - + draw_set_color(38144); draw_set_font(fnt_menu); draw_set_halign(fa_center); // Draws the sector name - draw_text(775,17,string_hash_to_newline("Sector "+string(obj_ini.sector_name))); - draw_text(775.5,17.5,string_hash_to_newline("Sector "+string(obj_ini.sector_name))); + var _sector_string = $"Sector {obj_ini.sector_name ?? "Terra Nova"}"; + draw_text(775,17,_sector_string); + draw_text(775.5,17.5,_sector_string); // Checks if you are penitent if (obj_controller.faction_status[eFACTION.Imperium]!="War"){ @@ -128,6 +120,10 @@ if (!zoomed && !zui){ draw_set_color(#af5a00) draw_text(180,16, string(forge_points)); draw_text(180.5,16.5, string(forge_points)); + // Draws apothecary points + var _apoth_string = ($"apothecary points : {specialist_point_handler.apothecary_points}"); + draw_text(180,32, _apoth_string); + draw_text(180.5,32.5, _apoth_string); // Draws the current loyalty draw_sprite(spr_new_resource,1,267,17); draw_set_color(1164001); diff --git a/objects/obj_controller/KeyPress_73.gml b/objects/obj_controller/KeyPress_73.gml index 89af2712a..c5aceeb6c 100644 --- a/objects/obj_controller/KeyPress_73.gml +++ b/objects/obj_controller/KeyPress_73.gml @@ -25,7 +25,7 @@ scr_dialogue("lol"); // loyalty=0;loyalty_hidden=0; -// show_message(string(obj_ini.ship[1])+" location: "+string(obj_ini.ship_location[1])); +// show_message(string(obj_ini.ship[0])+" location: "+string(obj_ini.ship_location[0])); // alarm[8]=1; diff --git a/objects/obj_controller/Mouse_50.gml b/objects/obj_controller/Mouse_50.gml index ad3549e33..4976f91cd 100644 --- a/objects/obj_controller/Mouse_50.gml +++ b/objects/obj_controller/Mouse_50.gml @@ -5,40 +5,6 @@ yy=__view_get( e__VW.YView, 0 ); if (trading>0) and (force_goodbye!=0) then trading=0; -// ** Gene seed countdown and production ** -if (menu==11) and (cooldown<=0){ - if (gene_seed>0) and (obj_ini.zygote==0) and (mouse_x>=xx+407) and (mouse_y>=yy+788) and (mouse_x=10) and (obj_ini.slave_batch_num[g]<50) then carpal=2; - if (obj_ini.slave_batch_num[g]>=50) then carpal=5;if (obj_ini.slave_batch_num[g]>=150) then carpal=10; - if (obj_controller.gene_seed0) and (mouse_x>=xx+659) and (mouse_y>=yy+788) and (mouse_x0){ var behav=0,r_eta=0,re=0; @@ -56,7 +22,9 @@ if (menu==12) and (cooldown<=0) and (penitorium>0){ // TODO Needs to be based on role kill_and_recover(c,e); diplo_char=c; - with(obj_ini){scr_company_order(obj_controller.diplo_char);} + with(obj_ini){ + scr_company_order(obj_controller.diplo_char); + } re=1; diplo_char=0; } @@ -390,8 +358,8 @@ if (menu==20) and (diplomacy>0) or ((diplomacy<-5) and (diplomacy>-6)) and (cool trade_disp[1]=30; trade_disp[2]=20; trade_disp[3]=40; - trade_disp[4]=30; - trade_disp[5]=60; + trade_disp[4]=25; + trade_disp[5]=55; } // Inquisition trade goods if (diplomacy==4){ @@ -405,7 +373,7 @@ if (menu==20) and (diplomacy>0) or ((diplomacy<-5) and (diplomacy>-6)) and (cool trade_disp[1]=20; trade_disp[2]=30; trade_disp[3]=20; - trade_disp[4]=30; + trade_disp[4]=25; trade_disp[5]=40; trade_disp[6]=60; } @@ -420,8 +388,8 @@ if (menu==20) and (diplomacy>0) or ((diplomacy<-5) and (diplomacy>-6)) and (cool trade_disp[1]=20; trade_disp[2]=30; trade_disp[3]=30; - trade_disp[4]=50; - trade_disp[5]=50; + trade_disp[4]=40; + trade_disp[5]=45; } // Eldar trade goods if (diplomacy==6){ diff --git a/objects/obj_controller/Step_0.gml b/objects/obj_controller/Step_0.gml index 05fcb096d..02c19a2fe 100644 --- a/objects/obj_controller/Step_0.gml +++ b/objects/obj_controller/Step_0.gml @@ -411,8 +411,10 @@ if (menu==0) and (repair_ships>0) and (instance_number(obj_turn_end)==0) and (in if (frigate_health<100) and (frigate_number>0) then acted=2; if (escort_health<100) and (escort_number>0) then acted=2; } - for(var i=1; i<=30; i++){ - if (obj_ini.ship_location[i]!="Warp") and (obj_ini.ship_location[i]!="Lost"){obj_ini.ship_hp[i]=obj_ini.ship_maxhp[i];} + for(var i=1; i0){ var unit,company, unit_id; for(var q=0; q0){ man_sel[i]=0; } obj_ini.ship_carrying[b]-=man_size; - sh_cargo[b]-=man_size; + reset_ship_manage_arrays(); cooldown=10; - sel_loading=0; + sel_loading=-1; man_size=0; unload=0; with(obj_star_select){instance_destroy();} } // Resets selections -if (managing>0) and (man_size==0) and ((selecting_location!="") or (selecting_types!="") or (selecting_planet!=0) or (selecting_ship!=0)){ +if (managing>0) and (man_size==0) and ((selecting_location!="") or (selecting_types!="") or (selecting_planet!=0) or (selecting_ship!=-1)){ selecting_location=""; selecting_types=""; selecting_planet=0; - selecting_ship=0; + selecting_ship=-1; } if (marines<=0) and (alarm[7]=-1) and (!instance_exists(obj_fleet_controller)) and (!instance_exists(obj_ncombat)) then alarm[7]=15; diff --git a/objects/obj_creation/Alarm_0.gml b/objects/obj_creation/Alarm_0.gml index e3c5ea40e..38915d1e7 100644 --- a/objects/obj_creation/Alarm_0.gml +++ b/objects/obj_creation/Alarm_0.gml @@ -26,9 +26,9 @@ shader_reset(); pauldron_colour_find=[255/255,255/255,0/255]; pauldron_colour_replace=[ - col_r[pauldron_color]/255, - col_g[pauldron_color]/255, - col_b[pauldron_color]/255, + col_r[right_pauldron]/255, + col_g[right_pauldron]/255, + col_b[right_pauldron]/255, ]; @@ -46,18 +46,18 @@ shader_reset(); colour_to_set5 = shader_get_uniform(sReplaceColor, "f_Replace5"); trim_colour_find=[255/255,0/255,255/255]; trim_colour_replace=[ - col_r[trim_color]/255, - col_g[trim_color]/255, - col_b[trim_color]/255, + col_r[main_trim]/255, + col_g[main_trim]/255, + col_b[main_trim]/255, ]; colour_to_find6 = shader_get_uniform(sReplaceColor, "f_Colour6"); colour_to_set6 = shader_get_uniform(sReplaceColor, "f_Replace6"); pauldron2_colour_find=[250/255,250/255,250/255]; pauldron2_colour_replace=[ - col_r[pauldron2_color]/255, - col_g[pauldron2_color]/255, - col_b[pauldron2_color]/255, + col_r[left_pauldron]/255, + col_g[left_pauldron]/255, + col_b[left_pauldron]/255, ]; diff --git a/objects/obj_creation/Create_0.gml b/objects/obj_creation/Create_0.gml index 1bf9b460e..9ba4ec85a 100644 --- a/objects/obj_creation/Create_0.gml +++ b/objects/obj_creation/Create_0.gml @@ -1,6 +1,10 @@ - +/** + * * obj_creation is used as part of the main menu new game and chapter creation logic + * It contains data and logic for setting up custom chapters as well as populating the new game menu with data for pre-existing chapters. + */ keyboard_string=""; +#region Global Settings: volume, fullscreen etc ini_open("saves.ini"); master_volume=ini_read_real("Settings","master_volume",1); effect_volume=ini_read_real("Settings","effect_volume",1); @@ -10,28 +14,112 @@ settings_heresy=ini_read_real("Settings","settings_heresy",0); settings_fullscreen=ini_read_real("Settings","fullscreen",1); settings_window_data=ini_read_string("Settings","window_data","fullscreen"); ini_close(); +#endregion + +#region Icon Grid settings for chapter selection +icon_width = 48; +icon_height = 48; +/// distance between 2 rows of icons in the grid +icon_row_gap = 60; +/// distance between section heading and icon grid row +icon_gap_y = 34; +/// distance between columns in icon grid +icon_gap_x = 53; +/// x coord of left edge of the icon grid +icon_grid_left_edge = 441; +/// Max number of columns of icons until a new row is made +max_cols = 10; +/// x coord of the right edge of the icon grid +icon_grid_right_edge = function() {return icon_grid_left_edge + (icon_gap_x * max_cols -1)}; // icon_gap_x * max number of desired columns - 1 +/// y coord of Founding section heading +founding_y = 133; +/// y coord of Successor section heading +successor_y = 250; +/// y coord of Custom section heading +custom_y = 463; +/// y coord of Other section heading +other_y = 593; + +var show_debug = false; +if(show_debug){ + show_debug_overlay(true); + dbg_view("obj_creation_dbg", true); + dbg_section("Icon Grid"); + ref_to_max_cols = ref_create(self, "max_cols"); + ref_to_icon_width = ref_create(self, "icon_width"); + ref_to_icon_height = ref_create(self, "icon_height"); + ref_to_icon_grid_left_edge = ref_create(self, "icon_grid_left_edge"); + ref_to_icon_gap_y = ref_create(self, "icon_gap_y"); + ref_to_icon_gap_x = ref_create(self, "icon_gap_x"); + ref_to_icon_row_gap = ref_create(self, "icon_row_gap"); + dbg_slider_int(ref_to_max_cols,1,15); + dbg_slider_int(ref_to_icon_width,1,100); + dbg_slider_int(ref_to_icon_height,1,100); + dbg_slider_int(ref_to_icon_grid_left_edge,1,1000); + dbg_slider_int(ref_to_icon_gap_y,1,300); + dbg_slider_int(ref_to_icon_gap_x,1,300); + dbg_slider_int(ref_to_icon_row_gap,1,300); + + dbg_section("Heading Positions") + ref_to_founding_y = ref_create(self, "founding_y"); + ref_to_successor_y = ref_create(self, "successor_y"); + ref_to_custom_y = ref_create(self, "custom_y"); + ref_to_other_y = ref_create(self, "other_y"); + dbg_slider_int(ref_to_founding_y,1,1000); + dbg_slider_int(ref_to_successor_y,1,1000); + dbg_slider_int(ref_to_custom_y,1,1000); + dbg_slider_int(ref_to_other_y,1,1000); +} +#endregion window_data=string(window_get_x())+"|"+string(window_get_y())+"|"+string(window_get_width())+"|"+string(window_get_height())+"|"; -window_old=window_data;if (window_get_fullscreen()=1){window_old="fullscreen";window_data="fullscreen";} -restarted=0;custom_icon=0; +window_old=window_data; +if (window_get_fullscreen()=1){ + window_old="fullscreen"; + window_data="fullscreen"; +} +restarted=0; +custom_icon=0; + +/// Stores the chapter icon in one spot so we dont have to keep checking whether we're using a custom image or not every time we wanna display it somewhere +global.chapter_icon_sprite = spr_icon_chapters; +global.chapter_icon_frame = 0; +global.chapter_icon_path = ""; +global.chapter_id = 0; audio_stop_all(); audio_play_sound(snd_diboz,0,true); audio_sound_gain(snd_diboz, 0, 0); -var nope;nope=0;if (master_volume=0) or (music_volume=0) then nope=1; -if (nope!=1){audio_sound_gain(snd_diboz,0.25*master_volume*music_volume,2000);} +var nope=0; +if (master_volume=0) or (music_volume=0) then nope=1; +if (nope!=1){ + audio_sound_gain(snd_diboz,0.25*master_volume*music_volume,2000); +} global.load=0; skip=false; premades=true; +/// Opt in/out of loading from json vs hardcoded for specific chapters, this way i dont have to do all in one go to test +use_chapter_object = false; + +livery_picker = new ColourItem(100,230); +livery_picker.scr_unit_draw_data(); +full_liveries = ""; complex_livery=false; complex_selection = "sgt"; complex_depth_selection = 0; //TODO probably make this array based at some point ot match other unit data complex_livery_data = complex_livery_default(); + +standard_livery_components = 0; +enum LiveryComponents{ + Body, + Helm, + Trim, +} test_sprite = 0; fade_in=50; slate1=80; @@ -47,6 +135,7 @@ goto_slide=1; highlight=0; highlighting=0; old_highlight=0; +/// 1 = select chap, 2 = name, strength, adv/disadv, 3 = homeworld, discipline, 4 = livery, 5 = mutations, disposition, 6 = chapter master slide=1; slide_show=1; cooldown=0; @@ -68,29 +157,33 @@ target_gear=0; tab=0; role_names_all=""; -chapter="Unnamed"; +// +chapter_name="Unnamed"; chapter_string="Unnamed"; chapter_year=0; -icon=1;icon_name="da";custom=0; +icon=1; +icon_name="da"; +/// @instancevar {Real} custom 0 if premade, 1 if random, 2 if custom +custom=0; +/// @instancevar {Enum.ePROGENITOR} founding founding=1; chapter_tooltip=""; -points=0;maxpoints=100; +points=0; +maxpoints=100; +/// @instancevar {Enum.eFLEET_TYPES} fleet_type fleet_type=1; -strength=5;cooperation=5; -purity=5;stability=5; -adv=[]; -adv_num=[]; -dis=[]; -dis_num=[]; -for(var i=0; i<16; i++){ - adv[i]=""; - adv_num[i]=0; - dis[i]=""; - dis_num[i]=0; -} -var i;i=-1;repeat(10){i+=1;} -homeworld="Temperate";homeworld_name=global.name_generator.generate_star_name(); -recruiting="Death";recruiting_name=global.name_generator.generate_star_name(); +strength=5; +cooperation=5; +purity=5; +stability=5; + + +var i = 9; + +homeworld="Temperate"; +homeworld_name=global.name_generator.generate_star_name(); +recruiting="Death"; +recruiting_name=global.name_generator.generate_star_name(); flagship_name=global.name_generator.generate_imperial_ship_name(); recruiting_exists=1; homeworld_exists=1; @@ -100,8 +193,8 @@ discipline="default"; battle_cry="For the Emperor"; -main_color=1;secondary_color=1;trim_color=1; -pauldron2_color=1;pauldron_color=1;// Left/Right pauldron +main_color=1;secondary_color=1;main_trim=1; +left_pauldron=1;right_pauldron=1;// Left/Right pauldron lens_color=1;weapon_color=1;col_special=0;trim=1; skin_color=0; @@ -131,8 +224,6 @@ recruiter=global.name_generator.generate_space_marine_name(); //10th - - equal_specialists=0; load_to_ships=[2,0,0]; @@ -156,679 +247,620 @@ chapter_master_melee=1; chapter_master_ranged=1; chapter_master_specialty=2; - - -var i;i=-1; -repeat(60){i+=1;chapter_id[i]="";chapter_tooltip[i]="Error: The tooltip is missing.";company_title[i]="";} -chapter_id[1]="Dark Angels"; -chapter_tooltip[1]="The Dark Angels claim complete allegiance and service to the Emperor of Mankind, though their actions and secret goals seem to run counter to this- above all other things they strive to atone for an ancient crime of betrayal."; - -chapter_id[2]="White Scars"; -chapter_tooltip[2]="Known and feared for their highly mobile way of war, the White Scars are the masters of lightning strikes and hit-and-run tactics. They are particularly adept in the use of Attack Bikes and field large numbers of them."; - -chapter_id[3]="Space Wolves"; -chapter_tooltip[3]="Brave sky warriors hailing from the icy deathworld of Fenris, the Space Wolves are a non-Codex compliant chapter, and deadly in close combat. They fight on their own terms and damn any who wish otherwise."; - -chapter_id[4]="Imperial Fists"; -chapter_tooltip[4]="Siege-masters of utmost excellence, the Imperial Fists stoicism has lead them to great victories and horrifying defeats. To them, the idea of a tactical retreat is utterly inconsiderable. They hold ground on Inwit vigilantly, refusing to back down from any fight."; - -chapter_id[5]="Blood Angels"; -chapter_tooltip[5]="One of the most noble and renowned chapters, their combat record belies a dark flaw in their gene-seed caused by the death of their primarch. Their primarch had wings and a propensity for close combat, and this shows in their extensive use of jump packs and close quarters weapons."; - -chapter_id[6]="Iron Hands"; -chapter_tooltip[6]="The flesh is weak, and the weak shall perish. Such is the creed of these mercilessly efficient cyborg warriors. A chapter with strong ties to the Mechanicum, they crush the foes of the Emperor and Machine God alike with a plethora of exotic technology and ancient weaponry."; - -chapter_id[7]="Ultramarines"; -chapter_tooltip[7]="An honourable and venerated chapter, the Ultramarines are considered to be amongst the best of the best. Their Primarch was the author of the great tome of the “Codex Astartes”, and they are considered exemplars of what a perfect Space Marine Chapter should be like."; - -chapter_id[8]="Salamanders"; -chapter_tooltip[8]="Followers of the Promethean Cult, the jet-black skinned Salamanders are forgemasters of legend. They are armed with the best wargear available and prefer flame based weaponry. Their only drawback is their low numbers and slow recruiting."; - -chapter_id[9]="Raven Guard"; -chapter_tooltip[9]="Clinging to the shadows and riding the edge of lightning the Raven Guard strike out at the hated enemy with stealth and speed. Using lightning strikes, hit and run tactics, and guerrilla warfare, they are known for being there one second and gone the next."; - -chapter_id[10]="Black Templars"; -chapter_tooltip[10]="Not adhering to the Codex Astartes, Black Templars are a Chapter on an Eternal Crusade with unique organization and high numbers. Masters of assault, they charge at the enemy with zeal unmatched. They hate psykers, and as such, have no Librarians."; - -chapter_id[11]="Minotaurs"; -chapter_tooltip[11]="Bronze-clad Astartes of unknown Founding, the Minotaurs prefer to channel their righteous fury in a massive storm of fire, with tanks and artillery. They could be considered the Inquisition’s attack dog, since they often attack fellow chapters suspected of heresy."; - -chapter_id[12]="Blood Ravens"; -chapter_tooltip[12]="Of unknown origins and Founding, the origins of the Blood Ravens are shrouded in mystery and are believed to be tied to a dark truth. This elusive Chapter is drawn to the pursuit of knowledge and ancient lore and produces an unusually high number of Librarians."; - -chapter_id[13]="Crimson Fists"; -chapter_tooltip[13]="An Imperial Fists descendant, the Crimson Fists are more level-minded than their Progenitor and brother chapters. They suffer the same lacking zygotes as their ancestors, and more resemble the Ultramarines in their balanced approach to combat. After surviving a devastating Ork WAAAGH! the chapter clings dearly to its future." - -chapter_id[14]="Lamenters"; -chapter_tooltip[14]="The Lamenter's accursed and haunted legacy seems to taint much of what they have achieved; their victories often become bitter ashes in their hands. Nearly extinct, they fight their last days on behalf of the common folk in a crusade of endless penitence."; - -chapter_id[15]="Carcharodons"; -chapter_tooltip[15]="Rumored to be Successors of the Raven Guard, these Astartes are known for their sudden attacks and shock assaults. Travelling through the Imperium via self-sufficient Nomad-Predation based fleets, no enemy is safe from the fury of these bloodthirsty Space Marines."; - -chapter_id[16]="Soul Drinkers"; -chapter_tooltip[16]="Sharing ancestry of the Black Templars or Crimson fists. As proud sons of Dorn they share the strong void combat traditions, fielding a large amount of Battle Barges. As well as being fearsome in close combat. Whispers of the Ruinous Powers are however quite enticing." - - -chapter_id[17]="Angry Marines"; -//chapter_tooltip[17]="Frothing with pathological rage since the day their Primarch emerged from his pod with naught but a dented copy of battletoads. Every last Angry Marine is a homicidal, suicidal berserker with a voice that projects, and are always angry, all the time. A /tg/ classic."; - -chapter_id[18]="Emperor's Nightmare"; -//chapter_tooltip[18]="The Emperor's Nightmare bear the curse of a bizarre mutation within their gene-seed. The Catalepsean Node is in a state of decay and thus do not sleep for months at a time until falling asleep suddenly. They prefer shock and awe tactics with stealth."; - -chapter_id[19]="Star Krakens"; -//chapter_tooltip[19]="In darkness, they dwell in The Deep. The Star Krakens stand divided in individual companies but united in the form of the Ten-Flag Council. They utilize boarding tactics and are the sole guardians of the ancient sensor array called “The Lighthouse”."; - -chapter_id[20]="Conservators"; -//chapter_tooltip[20]="Hailing from the Asharn Marches and having established their homeworld on the planet Dekara, these proud sons of Dorn suffer from an extreme lack of supplies, Ork raids, and more. Though under strength and lacking equipment, they managed to forge an interstellar kingdom loyal to both Emperor and Imperium."; - -chapter_id[21]= "Custom"; -chapter_tooltip[21]="Your Chapter"; - -//Stores info for custom chapter - - - - -chaptersave = "chaptersave#1.ini" - -chapter21 ="Custom"; -if(file_exists("chaptersave#1.ini")=true){ - chapter_made=1; +chapter_made = false; + + +enum eCHAPTERS { + UNKNOWN = 0, + DARK_ANGELS = 1, + WHITE_SCARS, + SPACE_WOLVES, + IMPERIAL_FISTS, + BLOOD_ANGELS, + IRON_HANDS, + ULTRAMARINES, + SALAMANDERS, + RAVEN_GUARD, + + BLACK_TEMPLARS = 10, + MINOTAURS, + BLOOD_RAVENS, + CRIMSON_FISTS, + LAMENTERS, + CARCHARODONS, + SOUL_DRINKERS, + + ANGRY_MARINES = 17, + EMPERORS_NIGHTMARE, + STAR_KRAKENS, + CONSERVATORS, + + CUSTOM_1 = 21, + CUSTOM_2 = 22, + CUSTOM_3 = 23, + CUSTOM_4 = 24, + CUSTOM_5 = 25, + CUSTOM_6 = 26, + CUSTOM_7 = 27, + CUSTOM_8 = 28, + CUSTOM_9 = 29, + CUSTOM_10 = 30 } -else if (file_exists("chaptersave#1.ini")=false){ - chapter_made=0; +enum eCHAPTER_ORIGINS { + NONE, + FOUNDING, + SUCCESSOR, + NON_CANON, + CUSTOM } +/** + * @description chapter constructor. This is just for the main menu bit, the full data comes in scr_chapter_new + * @param {Enum.eCHAPTERS} _id e.g. CHAPTERS.DARK_ANGELS + * @param {Enum.eCHAPTER_ORIGINS} _origin e.g. CHAPTER_ORIGIN.FOUNDING + * @param {Enum.eCHAPTERS} _progenitor This chapter's founding chapter, if one exits. Use 0 if none. + * @param {String} _name e.g. "Dark Angels" + * @param {String} _tooltip e.g. "Some extremely lore friendly backstory" + */ +function ChapterDataLite(_id, _origin,_progenitor, _name , _tooltip) constructor { + id = _id; + origin = _origin; + name = _name; + progenitor = _progenitor; + tooltip = _tooltip; + disabled = false; + json = false; + loaded = true; + icon = _id; + splash = _id; +} +// For new additions, as long as the order in the array is the same as the enum order, +//you will be able to index the array by using syntax like so: `var dark_angels = all_chapters[CHAPTERS.DARK_ANGELS]` +all_chapters = [ + new ChapterDataLite(eCHAPTERS.UNKNOWN, eCHAPTER_ORIGINS.NONE, 0, "Unknown", "Error: The tooltip is missing"), + new ChapterDataLite(eCHAPTERS.DARK_ANGELS, eCHAPTER_ORIGINS.FOUNDING, 0, "Dark Angels", + "The Dark Angels claim complete allegiance and service to the Emperor of Mankind, though their actions and secret goals seem to run counter to this- above all other things they strive to atone for an ancient crime of betrayal."), + new ChapterDataLite(eCHAPTERS.WHITE_SCARS, eCHAPTER_ORIGINS.FOUNDING, 0, "White Scars", "Known and feared for their highly mobile way of war, the White Scars are the masters of lightning strikes and hit-and-run tactics. They are particularly adept in the use of Attack Bikes and field large numbers of them."), + new ChapterDataLite(eCHAPTERS.SPACE_WOLVES, eCHAPTER_ORIGINS.FOUNDING, 0, "Space Wolves", "Brave sky warriors hailing from the icy deathworld of Fenris, the Space Wolves are a non-Codex compliant chapter, and deadly in close combat. They fight on their own terms and damn any who wish otherwise." ), + new ChapterDataLite(eCHAPTERS.IMPERIAL_FISTS, eCHAPTER_ORIGINS.FOUNDING, 0, "Imperial Fists", "Siege-masters of utmost excellence, the Imperial Fists stoicism has lead them to great victories and horrifying defeats. To them, the idea of a tactical retreat is utterly inconsiderable. They hold ground on Inwit vigilantly, refusing to back down from any fight."), + new ChapterDataLite(eCHAPTERS.BLOOD_ANGELS, eCHAPTER_ORIGINS.FOUNDING, 0,"Blood Angels", "One of the most noble and renowned chapters, their combat record belies a dark flaw in their gene-seed caused by the death of their primarch. Their primarch had wings and a propensity for close combat, and this shows in their extensive use of jump packs and close quarters weapons."), + new ChapterDataLite(eCHAPTERS.IRON_HANDS, eCHAPTER_ORIGINS.FOUNDING, 0,"Iron Hands","The flesh is weak, and the weak shall perish. Such is the creed of these mercilessly efficient cyborg warriors. A chapter with strong ties to the Mechanicum, they crush the foes of the Emperor and Machine God alike with a plethora of exotic technology and ancient weaponry."), + new ChapterDataLite(eCHAPTERS.ULTRAMARINES, eCHAPTER_ORIGINS.FOUNDING, 0,"Ultramarines","An honourable and venerated chapter, the Ultramarines are considered to be amongst the best of the best. Their Primarch was the author of the great tome of the “Codex Astartes”, and they are considered exemplars of what a perfect Space Marine Chapter should be like."), + new ChapterDataLite(eCHAPTERS.SALAMANDERS, eCHAPTER_ORIGINS.FOUNDING, 0,"Salamanders", "Followers of the Promethean Cult, the jet-black skinned Salamanders are forgemasters of legend. They are armed with the best wargear available and prefer flame based weaponry. Their only drawback is their low numbers and slow recruiting."), + new ChapterDataLite(eCHAPTERS.RAVEN_GUARD, eCHAPTER_ORIGINS.FOUNDING, 0,"Raven Guard","Clinging to the shadows and riding the edge of lightning the Raven Guard strike out at the hated enemy with stealth and speed. Using lightning strikes, hit and run tactics, and guerrilla warfare, they are known for being there one second and gone the next."), + new ChapterDataLite(eCHAPTERS.BLACK_TEMPLARS, eCHAPTER_ORIGINS.SUCCESSOR, eCHAPTERS.IMPERIAL_FISTS, "Black Templars","Not adhering to the Codex Astartes, Black Templars are a Chapter on an Eternal Crusade with unique organization and high numbers. Masters of assault, they charge at the enemy with zeal unmatched. They hate psykers, and as such, have no Librarians."), + new ChapterDataLite(eCHAPTERS.MINOTAURS, eCHAPTER_ORIGINS.SUCCESSOR, eCHAPTERS.IMPERIAL_FISTS, "Minotaurs","Bronze-clad Astartes of unknown Founding, the Minotaurs prefer to channel their righteous fury in a massive storm of fire, with tanks and artillery. They could be considered the Inquisition’s attack dog, since they often attack fellow chapters suspected of heresy."), + new ChapterDataLite(eCHAPTERS.BLOOD_RAVENS, eCHAPTER_ORIGINS.SUCCESSOR,0, "Blood Ravens","Of unknown origins and Founding, the origins of the Blood Ravens are shrouded in mystery and are believed to be tied to a dark truth. This elusive Chapter is drawn to the pursuit of knowledge and ancient lore and produces an unusually high number of Librarians."), + new ChapterDataLite(eCHAPTERS.CRIMSON_FISTS, eCHAPTER_ORIGINS.SUCCESSOR, eCHAPTERS.IMPERIAL_FISTS ,"Crimson Fists","An Imperial Fists descendant, the Crimson Fists are more level-minded than their Progenitor and brother chapters. They suffer the same lacking zygotes as their ancestors, and more resemble the Ultramarines in their balanced approach to combat. After surviving a devastating Ork WAAAGH! the chapter clings dearly to its future."), + new ChapterDataLite(eCHAPTERS.LAMENTERS, eCHAPTER_ORIGINS.SUCCESSOR, eCHAPTERS.BLOOD_ANGELS,"Lamenters","The Lamenter's accursed and haunted legacy seems to taint much of what they have achieved; their victories often become bitter ashes in their hands. Nearly extinct, they fight their last days on behalf of the common folk in a crusade of endless penitence."), + new ChapterDataLite(eCHAPTERS.CARCHARODONS, eCHAPTER_ORIGINS.SUCCESSOR, eCHAPTERS.RAVEN_GUARD, "Carcharodons","Rumored to be Successors of the Raven Guard, these Astartes are known for their sudden attacks and shock assaults. Travelling through the Imperium via self-sufficient Nomad-Predation based fleets, no enemy is safe from the fury of these bloodthirsty Space Marines."), + new ChapterDataLite(eCHAPTERS.SOUL_DRINKERS, eCHAPTER_ORIGINS.SUCCESSOR,eCHAPTERS.IMPERIAL_FISTS, "Soul Drinkers","Sharing ancestry of the Black Templars or Crimson fists. As proud sons of Dorn they share the strong void combat traditions, fielding a large amount of Battle Barges. As well as being fearsome in close combat. Whispers of the Ruinous Powers are however quite enticing."), + new ChapterDataLite(eCHAPTERS.ANGRY_MARINES, eCHAPTER_ORIGINS.NON_CANON,0, "Angry Marines","Frothing with pathological rage since the day their Primarch emerged from his pod with naught but a dented copy of battletoads. Every last Angry Marine is a homicidal, suicidal berserker with a voice that projects, and are always angry, all the time. A /tg/ classic."), + new ChapterDataLite(eCHAPTERS.EMPERORS_NIGHTMARE, eCHAPTER_ORIGINS.NON_CANON,0, "Emperor’s Nightmare","The Emperor's Nightmare bear the curse of a bizarre mutation within their gene-seed. The Catalepsean Node is in a state of decay and thus do not sleep for months at a time until falling asleep suddenly. They prefer shock and awe tactics with stealth."), + new ChapterDataLite(eCHAPTERS.STAR_KRAKENS, eCHAPTER_ORIGINS.NON_CANON,0, "Star Krakens","In darkness, they dwell in The Deep. The Star Krakens stand divided in individual companies but united in the form of the Ten-Flag Council. They utilize boarding tactics and are the sole guardians of the ancient sensor array called “The Lighthouse”."), + new ChapterDataLite(eCHAPTERS.CONSERVATORS, eCHAPTER_ORIGINS.NON_CANON,0, "Conservators","Hailing from the Asharn Marches and having established their homeworld on the planet Dekara, these proud sons of Dorn suffer from an extreme lack of supplies, Ork raids, and more. Though under strength and lacking equipment, they managed to forge an interstellar kingdom loyal to both Emperor and Imperium."), + new ChapterDataLite(eCHAPTERS.CUSTOM_1, eCHAPTER_ORIGINS.CUSTOM,0,"Custom","Your Chapter"), + new ChapterDataLite(eCHAPTERS.CUSTOM_2, eCHAPTER_ORIGINS.CUSTOM,0,"Custom","Your Chapter"), + new ChapterDataLite(eCHAPTERS.CUSTOM_3, eCHAPTER_ORIGINS.CUSTOM,0,"Custom","Your Chapter"), + new ChapterDataLite(eCHAPTERS.CUSTOM_4, eCHAPTER_ORIGINS.CUSTOM,0,"Custom","Your Chapter"), + new ChapterDataLite(eCHAPTERS.CUSTOM_5, eCHAPTER_ORIGINS.CUSTOM,0,"Custom","Your Chapter"), + new ChapterDataLite(eCHAPTERS.CUSTOM_6, eCHAPTER_ORIGINS.CUSTOM,0,"Custom","Your Chapter"), + new ChapterDataLite(eCHAPTERS.CUSTOM_7, eCHAPTER_ORIGINS.CUSTOM,0,"Custom","Your Chapter"), + new ChapterDataLite(eCHAPTERS.CUSTOM_8, eCHAPTER_ORIGINS.CUSTOM,0,"Custom","Your Chapter"), + new ChapterDataLite(eCHAPTERS.CUSTOM_9, eCHAPTER_ORIGINS.CUSTOM,0,"Custom","Your Chapter"), + new ChapterDataLite(eCHAPTERS.CUSTOM_10, eCHAPTER_ORIGINS.CUSTOM,0,"Custom","Your Chapter"), +] + +var missing_splash = 99; +var custom_splash = 97; +all_chapters[eCHAPTERS.EMPERORS_NIGHTMARE].splash = missing_splash; +all_chapters[eCHAPTERS.CONSERVATORS].splash = missing_splash; +all_chapters[eCHAPTERS.CUSTOM_1].splash = custom_splash; +all_chapters[eCHAPTERS.CUSTOM_1].loaded = false; +all_chapters[eCHAPTERS.CUSTOM_2].loaded = false; +all_chapters[eCHAPTERS.CUSTOM_3].loaded = false; +all_chapters[eCHAPTERS.CUSTOM_4].loaded = false; +all_chapters[eCHAPTERS.CUSTOM_5].loaded = false; +all_chapters[eCHAPTERS.CUSTOM_6].loaded = false; +all_chapters[eCHAPTERS.CUSTOM_7].loaded = false; +all_chapters[eCHAPTERS.CUSTOM_8].loaded = false; +all_chapters[eCHAPTERS.CUSTOM_9].loaded = false; +all_chapters[eCHAPTERS.CUSTOM_10].loaded = false; +all_chapters[eCHAPTERS.CUSTOM_2].splash = custom_splash; +all_chapters[eCHAPTERS.CUSTOM_3].splash = custom_splash; +all_chapters[eCHAPTERS.CUSTOM_4].splash = custom_splash; +all_chapters[eCHAPTERS.CUSTOM_5].splash = custom_splash; +all_chapters[eCHAPTERS.CUSTOM_6].splash = custom_splash; +all_chapters[eCHAPTERS.CUSTOM_7].splash = custom_splash; +all_chapters[eCHAPTERS.CUSTOM_8].splash = custom_splash; +all_chapters[eCHAPTERS.CUSTOM_9].splash = custom_splash; +all_chapters[eCHAPTERS.CUSTOM_10].splash = custom_splash; + + + +global.normal_icons_count = 0; +// Load from files to overwrite hardcoded ones +for(var c = 1; c < 40; c++){ + var use_app_data = false; + if(c < array_length(all_chapters) && all_chapters[c].origin == eCHAPTER_ORIGINS.CUSTOM){ + use_app_data = true; + } + var json_chapter = new ChapterData(); + var success = json_chapter.load_from_json(c, use_app_data); + if(success){ + all_chapters[c] = new ChapterDataLite( + json_chapter.id, + json_chapter.origin, + json_chapter.founding, + json_chapter.name, + json_chapter.flavor, + ); + all_chapters[c].json = true; + all_chapters[c].icon = json_chapter.icon; + all_chapters[c].icon_name = json_chapter.icon_name; + all_chapters[c].splash = json_chapter.splash; + all_chapters[c].loaded = true; + all_chapters[c].disabled = false; + } + + var icon = file_exists($"{working_directory}\\images\\creation\\chapters\\icons\\{c}.png"); + if(icon) { + // show_debug_message($"icon {c}.png exists"); + global.normal_icons_count += 1; + } +} +global.chapters_count = array_length(all_chapters); + +/** + * * Not all Chapters are implemented yet, disable the ones that arent, remove a line if the chapter gets made + */ +all_chapters[eCHAPTERS.UNKNOWN].disabled = true; //this should always be disabled, it exists for array indexing purposes for now +all_chapters[eCHAPTERS.EMPERORS_NIGHTMARE].disabled = true; +all_chapters[eCHAPTERS.STAR_KRAKENS].disabled = true; +all_chapters[eCHAPTERS.CONSERVATORS].disabled = true; + +founding_chapters = array_filter(all_chapters, function(item){ return item.origin == eCHAPTER_ORIGINS.FOUNDING}); +successor_chapters = array_filter(all_chapters, function(item){ return item.origin == eCHAPTER_ORIGINS.SUCCESSOR}); +custom_chapters = array_filter(all_chapters, function(item){ return item.origin == eCHAPTER_ORIGINS.CUSTOM}); +other_chapters = array_filter(all_chapters, function(item){ return item.origin == eCHAPTER_ORIGINS.NON_CANON}); +// show_debug_message($"founding: {founding_chapters}"); +// show_debug_message($"successor: {successor_chapters}"); +// show_debug_message($"custom: {custom_chapters}"); +// show_debug_message($"other: {other_chapters}"); + + +// TODO refactor into struct constructors stored in which are struct arrays + +// meta provides a universal way to control not having contradictory advatages and disadvantages +// the player can not have any two advantages or disadvatages taht have the same piece of meta thus removing clunky checks in the draw sequence +chapter_trait_meta = []; +function ChapterTrait(_id, _name, _description, _points_cost, _meta = []) constructor{ + + id = _id; + name = _name; + description = _description; + points = _points_cost; + disabled = false; + meta = _meta; + + static add_meta = function(){ + for (var i=0;i obj_creation.maxpoints){ + is_disabled = true; + } + return is_disabled; + } -else if (file_exists("chaptersave#1.ini")=false){ - adv21 = [1,2,3,4,5,6,7,8] - dis21 =[1,2,3,4,5,6,7,8] - disposition21 = [1,2,3,4,5,6,7] - founding21=4; - - icon21=4; -icon_name21="if"; - fleet_type21=1; -strength21=2; - purity21=5; - stability21=5; - cooperation21=2; - homeworld21=1 - homeworld_name21="World" - recruiting_world21=homeworld_name21 -recruiting_name21=homeworld_name21 -homeworld_exists21=1; -recruiting_exists21=1; -homeworld_rule21=2; - aspirant_trial21=2; -role_21= [] -race_21=[] -wep1_21=[] -wep2_21=[] -armour_21=[] -gear_21=[] -mobi_21=[]; - -// Pauldron2: Left, Pauldron: Right -color_to_main21="Red" -color_to_secondary21=""; -color_to_trim21="Red"; -color_to_pauldron21="Red"; - color_to_pauldron2_21="Red"; - color_to_lens21="Red"; - color_to_weapon21="Red"; - col_special21="Red"; - trim21=1; - hapothecary21="Doc"; - hchaplain21="Warg"; - clibrarian21="Witch"; - fmaster21="Smith"; - admiral21="Sailor"; - recruiter21="Sarge"; - battle_cry_21="WAAAGH"; - monastery_name21="Okay"; - master_name21="SHH"; - equal_specialists21=1; - - load_to_ships=[2,0,0]; - // load_to_ships=0; - - successors21=4; - mutations21=2; - mutations_selected21=2; - preomnor21=0; - voice21=0; - doomed21=0; - lyman21=0; - omophagea21=0; - ossmodula21=0; - membrane21=1; - zygote21=0; - betchers21=1; - catalepsean21=0; - secretions21=0; - occulobe21=0; - mucranoid21=0; - disposition21[1]=20;// Prog - disposition21[2]=20; - disposition21[3]=20; - disposition21[4]=20; - disposition21[5]=20; - disposition21[6]=20;// Astartes - disposition21[7]=20;// Reserved - chapter_master_name21="Git smacka"; - chapter_master_melee21=1; - chapter_master_ranged21=1; - chapter_master_specialty21=1; - - adv21[1]="Ambushers"; - adv21[2]="Boarders"; - adv21[3]="Crafters"; - adv21[4]="Enemy; Orks"; - - dis21[1]="Suspicious"; - dis21[2]="Tolerant"; - dis21[3]="Blood Debt"; - dis21[4]="Sieged"; - i=100 - repeat(3){i+=1;// First is for the correct slot, second is for default - race_21[i,2]=1; - role_21[i,2]="Honour Guard"; - wep1_21[i,2]="Power Sword"; - wep2_21[i,2]="Bolter"; - armour_21[i,2]="Artificer Armour"; - gear_21[i,2]="" - mobi_21[i,2]=""; - - race_21[i,3]=1; - role_21[i,3]="Veteran"; - wep1_21[i,3]="Chainsword"; - wep2_21[i,3]="Bolter"; - armour_21[i,3]="Power Armour"; - gear_21[i,3]="" - mobi_21[i,3]=""; - - race_21[i,4]=1; - role_21[i,4]="Terminator"; - wep1_21[i,4]="Power Fist"; - wep2_21[i,4]="Storm Bolter"; - armour_21[i,4]="Terminator Armour"; - gear_21[i,4]="" - mobi_21[i,4]=""; - - race_21[i,5]=1; - role_21[i,5]="Captain"; - wep1_21[i,5]="Power Sword"; - wep2_21[i,5]="Bolt Pistol"; - armour_21[i,5]="Power Armour"; - gear_21[i,5]="Iron Halo"; - mobi_21[i,15]=""; - - - race_21[i,6]=1; - role_21[i,6]="Dreadnought"; - wep1_21[i,6]="Close Combat Weapon"; - wep2_21[i,6]="Twin Linked Lascannon"; - armour_21[i,6]="Dreadnought"; - gear_21[i,6]="" - mobi_21[i,6]=""; - - race_21[i,7]=1; - role_21[i,7]="Champion"; - wep1_21[i,7]="Power Sword"; - wep2_21[i,7]="Bolt Pistol"; - armour_21[i,7]="Power Armour"; - gear_21[i,7]="Combat Shield" - mobi_21[i,7]=""; - - race_21[i,8]=1; - role_21[i,8]="Tactical Marine"; - wep1_21[i,8]="Bolter"; - wep2_21[i,8]="Combat Knife"; - armour_21[i,8]="Power Armour"; - gear_21[i,8]="" - mobi_21[i,8]=""; - - race_21[i,9]=1; - role_21[i,9]="Devastator Marine"; - wep1_21[i,9]=""; - wep2_21[i,9]="Combat Knife"; - armour_21[i,9]="Power Armour"; - gear_21[i,9]="" - mobi_21[i,9]=""; - - race_21[i,10]=1; - role_21[i,10]="Assault Marine"; - wep1_21[i,10]="Chainsword"; - wep2_21[i,10]="Bolt Pistol"; - armour_21[i,10]="Power Armour"; - gear_21[i,10]="" - mobi_21[i,10]="Jump Pack"; - - race_21[i,11]=1; - role_21[i,11]="Ancient"; - wep1_21[i,11]="Company Standard"; - wep2_21[i,11]="Power Sword"; - armour_21[i,11]="Power Armour"; - gear_21[i,11]="" - mobi_21[i,11]=""; - - race_21[i,12]=1; - role_21[i,12]="Scout"; - wep1_21[i,12]="Sniper Rifle"; - wep2_21[i,12]="Combat Knife"; - armour_21[i,12]="Scout Armour"; - gear_21[i,12]="" - mobi_21[i,12]=""; - - race_21[i,14]=1; - role_21[i,14]="Chaplain"; - wep1_21[i,14]="Crozius Arcanum"; - wep2_21[i,14]="Bolt Pistol"; - armour_21[i,14]="Power Armour"; - gear_21[i,14]="Rosarius"; - - race_21[i,15]=1; - role_21[i,15]="Apothecary"; - wep1_21[i,15]="Chainsword"; - wep2_21[i,15]="Bolt Pistol"; - armour_21[i,15]="Power Armour"; - gear_21[i,15]="Narthecium"; - - race_21[i,16]=1; - role_21[i,16]="Techmarine"; - wep1_21[i,16]="Power Axe"; - wep2_21[i,16]="Storm Bolter"; - armour_21[i,16]="Artificer Armour"; - mobi_21[i,16]="Servo-arm"; - gear_21[i,16]=""; - - race_21[i,17]=1; - role_21[i,17]="Librarian"; - wep1_21[i,17]="Force Staff"; - wep2_21[i,17]="Storm Bolter"; - armour_21[i,17]="Power Armour"; - gear_21[i,17]="Psychic Hood"; - - race_21[i,18]=1; - role_21[i,18]="Sergeant"; - wep1_21[i,18]="Chainsword"; - wep2_21[i,18]="Combiflamer"; - armour_21[i,18]="Power Armour"; - mobi_21[i,18]=""; - gear_21[i,18]=""; - - race_21[i,19]=1; - role_21[i,19]="Veteran Sergeant"; - wep1_21[i,19]="Chainsword"; - wep2_21[i,19]="Combiflamer"; - armour_21[i,19]="Power Armour"; - mobi_21[i,19]=""; - gear_21[i,19]=""; - } - stage = 6; +} +function Disadvantage(_id, _name, _description, _points_cost) : ChapterTrait(_id, _name, _description, _points_cost) constructor { + + static add = function(slot){ + show_debug_message($"Adding disadv {name} to slot {slot} for points {points}"); + obj_creation.dis[slot] = name; + obj_creation.dis_num[slot] = id; + obj_creation.points-=points; + add_meta(); + } + + static remove = function(slot){ + show_debug_message($"Removing disadv {name} from slot {slot} for points {points}"); + obj_creation.dis[slot] = ""; + obj_creation.points+=points; + obj_creation.dis_num[slot]=0; + remove_meta(); + } + + static disable = function(){ + var is_disabled= false; + for (var i=0;i} +obj_creation.all_advantages = []; +var all_advantages = [ + { + name : "", + description : "", + value : 0, + }, + { + name : "Ambushers", + description : "Your chapter is especially trained with ambushing foes; they have a bonus to attack during the start of a battle.", + value : 20, + }, + { + name : "Boarders", + description : "Boarding other ships is the specialty of your chapter. Your chapter is more lethal when boarding ships, have dedicated boarding squads, and two extra strike cruisers.", + value : 30, + }, + { + name : "Bolter Drilling", + description : "Bolter drills are sacred to your chapter; all marines have increased attack with Bolter weaponry.", + value : 25, + meta : ["Weapon Specialty"] + }, + { + name : "Retinue of Renown", + description : "Your chapter master is guarded by renown heroes of the chapter. You start with a larger well-equipped Honour Guard.", + value : 20, + }, + { + name : "Crafters", + description : "Your chapter views artifacts as sacred; you start with better gear and maintain all equipment with more ease.", + value : 35, + meta : ["Gear Quality"] + }, + { + name : "Daemon Binders", + description : "Powers are replaced with a more powerful Witchfire variant. Perils are also less likely to occur but are more disasterous when they do.", + value : 20, + }, + { + name : "Enemy: Eldar", + description : "Eldar are particularly hated by your chapter. When fighting Eldar damage is increased.", + value : 10, + meta : ["Main Enemy"], + }, + { + name : "Enemy: Fallen", + description : "Chaos Marines are particularly hated by your chapter. When fighting the traitors damage is increased.", + value : 15, + meta : ["Main Enemy"], + }, + { + name : "Enemy: Necrons", + description : "Necrons are particularly hated by your chapter. When fighting Necrons damage is increased.", + value : 15, + meta : ["Main Enemy"], + }, + { + name : "Enemy: Orks", + description : "Orks are particularly hated by your chapter. When fighting Orks damage is increased.", + value : 35, + meta : ["Main Enemy"] + }, + { + name : "Enemy: Tau", + description : "Tau are particularly hated by your chapter. When fighting Tau damage is increased.", + value : 20, + meta : ["Main Enemy"], + }, + { + name : "Enemy: Tyranids", + description : "Tyranids are particularly hated by your chapter. A large number of your veterans and marines are tyrannic war veterans and when fighting Tyranids damage is increased.", + value : 25, + meta : ["Main Enemy"], + }, + { + name : "Kings of Space", + description : "Veterans of naval combat, your chapter fleet has bonuses to offense, defence, an additional battle barge, and may always be controlled regardless of whether or not the Chapter Master is present.", + value : 40, + meta : ["Naval"], + }, + { + name : "Lightning Warriors", + description : "Your chapter's style of warfare is built around the speedy execution of battle. Infantry have boosted attack at the cost of defense as well as two additional Land speeders and Biker squads.", + value : 35, + meta : ["Doctrine"], + }, + { + name : "Paragon", + description : "You are a pale shadow of the primarchs. Larger, stronger, faster, your Chapter Master is on a higher level than most, gaining additional health and combat effectiveness.", + value : 10, + meta : ["Chapter Master"], + }, + { + name : "Psyker Abundance", + description : "The Psyker mutation runs rampant in your chapter. Librarians train in 60% the normal time and receive bonus experience.", + value : 30, + meta : ["Psyker Views","Specialists"], + }, + { + name : "Reverent Guardians", + description : "Your chapter places great faith in the Imperial Cult; you start with more Chaplains and any Ecclesiarchy disposition increases are enhanced.", + value : 10, + meta : ["Faith","Imperium Trust","Specialists"], + }, + { + name : "Tech-Brothers", + description : "Your chapter has better ties to the mechanicus; you have more techmarines and higher mechanicus disposition.", + value : 25, + meta : ["Mechanicus Faith","Specialists"], + }, + { + name : "Tech-Scavengers", + description : "Your Astartes have a knack for finding what has been lost. Items and wargear are periodically found and added to the Armamentarium.", + value : 30, + }, + { + name : "Siege Masters", + description : "Your chapter is familiar with the ins-and-outs of fortresses. They are better at defending and attacking fortifications. And better at garrisoning", + value : 15, + }, + { + name : "Devastator Doctrine", + description : "The steady advance of overwhelming firepower is your chapters combat doctrine each company has an additional Devastator squad, all infantry have boosted defence, and heavy weapons have increased attack.", + value : 30, + meta : ["Doctrine"], + }, + { + name : "Assault Doctrine", + description : "Your chapter prefers quick close quarter assaults on the enemy each Company has an additional Assault Squad and your marines are more skilled in melee.", + value : 20, + meta : ["Doctrine"], + }, + { + name : "Venerable Ancients", + description : "Even in death they still serve. Your chapter places a staunch reverence for its forebears and has a number of additional venerable dreadnoughts in service.", + value : 40, + meta : ["Doctrine"], + }, + { + name : "Medicae Primacy", + description : "Your chapter reveres its Apothecarion above all of it's specialist; You start with more Apothecaries.", + value : 25, + meta : ["Specialists"] + }, + { + name : "Ryzan Patronage", + description : "Your chapter has strong ties to the Forgeworld of Ryza as a result your Techmarines are privy to the secrets of their Techpriests enhancing your Plasma and Las weaponry.", + value : 25, + meta : ["Weapon Specialty"] + }, + ] + + +var new_adv,cur_adv; +for (var i=0;i} +var all_disadvantages = [ + { + name : "", + description : "", + value : 0, + }, + { + name : "Black Rage", + description : "Your marines are susceptible to Black Rage, having a chance each battle to become Death Company. These units are locked as Assault Marines and are fairly suicidal.", + value : 30, + }, + { + name : "Blood Debt", + description : "Prevents your Chapter from recruiting new Astartes until enough of your marines, or enemies, have been killed. Incompatible with Penitent chapter types.", + value : 50, + }, + { + name : "Fresh Blood", + description : "Due to being newly created your chapter has little special wargear or psykers.", + value : 30, + meta : ["Status"], + }, + { + name : "Never Forgive", + description : "In the past traitors broke off from your chapter. They harbor incriminating secrets or heritical beliefs, and as thus, must be hunted down whenever possible.", + value : 15, + }, + { + name : "Shitty Luck", + description: "This is actually really helpful and beneficial for your chapter. Trust me.", + value: 20, + }, + { + name : "Sieged", + description : "A recent siege has reduced the number of your marines greatly. You retain a normal amount of equipment but some is damaged.", + value : 30, + meta : ["Status"], + }, + { + name : "Splintered", + description : "Your marines are unorganized and splintered. You require greater time to respond to threats en masse.", + value : 10, + meta : ["Location"], + }, + { + name : "Suspicious", + description : "Some of your chapter's past actions or current practices make the inquisition suspicious. Their disposition is lowered.", + value : 10, + meta : ["Imperium Trust"], + }, + { + name : "Tech-Heresy", + description : "Your chapter does things that makes the Mechanicus upset. Mechanicus disposition is lowered and you have less Tech Marines. You start as a tech heretic tolerant chapter", + value : 15, + meta : ["Mechanicus Faith"], + }, + { + name : "Tolerant", + description : "Your chapter is more lenient with xenos. All xeno disposition is slightly increased and all Imperial disposition is lowered.", + value : 10, + }, + { + name : "Warp Touched", + description : "Demons seem attracted to your chapter; perils of the warp happen more frequently and with more disasterous results.", + value : 10, + }, + { + name : "Psyker Intolerant", + description : "Witches are hated by your chapter. You cannot create Librarians but gain a little bonus attack against psykers.", + value : 20, + meta : ["Psyker Views"], + }, + { + name : "Obliterated", + description : "A recent string of unfortunate events has left your chapter decimated. You have very little left, will your story continue?", + value : 60, + meta : ["Status"], + }, + { + name : "Poor Equipment", + description : "Whether due to being cut off from forge worlds or bad luck, your chapter no longer has enough high quality gear to go around. Your elite troops will have to make do with standard armour.", + value: 10, + meta : ["Gear Quality"] + } +] + +obj_creation.all_disadvantages = [] +var new_dis,cur_dis; +for (var i=0;i0){ global.restart=0; } - -if (skip=true){ - fade_in=-1; - slate1=-1; - slate=22; - slate3=22; - slate4=50; - - change_slide=0; - slide=6; - slide_show=slide; - - icon_name="ih"; - icon=6;founding=6; - - chapter="Sons of Duke"; - custom=2; - battle_cry="The flesh is weak! The flesh is weak! The flesh is weak! The flesh is weak! The flesh is weak"; - - purity=5; - - /*main_color=5;secondary_color=5;trim_color=2; - pauldron2_color=5;// Left pauldron - pauldron_color=5;// Right pauldron - lens_color=7;weapon_color=2;col_special=0;*/ - - main_color=7;secondary_color=5;trim_color=5; - pauldron2_color=5;// Left pauldron - pauldron_color=5;// Right pauldron - lens_color=6;weapon_color=4;col_special=0; - - scr_chapter_new("Doom Benefactors"); -} - /* */ - +col = []; +col_r = []; +col_g = []; +col_b = []; scr_colors_initialize(); - +/// todo turn this into an array of structs with dynamic access +/// todo change references to colours by number to use the Colours enum colour_to_find1 = shader_get_uniform(sReplaceColor, "f_Colour1"); colour_to_set1 = shader_get_uniform(sReplaceColor, "f_Replace1"); @@ -914,9 +916,9 @@ scr_colors_initialize(); pauldron_colour_find=[255/255,255/255,0/255]; pauldron_colour_replace=[ - col_r[pauldron_color]/255, - col_g[pauldron_color]/255, - col_b[pauldron_color]/255, + col_r[right_pauldron]/255, + col_g[right_pauldron]/255, + col_b[right_pauldron]/255, ]; @@ -934,18 +936,18 @@ scr_colors_initialize(); colour_to_set5 = shader_get_uniform(sReplaceColor, "f_Replace5"); trim_colour_find=[255/255,0/255,255/255]; trim_colour_replace=[ - col_r[trim_color]/255, - col_g[trim_color]/255, - col_b[trim_color]/255, + col_r[main_trim]/255, + col_g[main_trim]/255, + col_b[main_trim]/255, ]; colour_to_find6 = shader_get_uniform(sReplaceColor, "f_Colour6"); colour_to_set6 = shader_get_uniform(sReplaceColor, "f_Replace6"); pauldron2_colour_find=[250/255,250/255,250/255]; pauldron2_colour_replace=[ - col_r[pauldron2_color]/255, - col_g[pauldron2_color]/255, - col_b[pauldron2_color]/255, + col_r[left_pauldron]/255, + col_g[left_pauldron]/255, + col_b[left_pauldron]/255, ]; @@ -962,4 +964,3 @@ scr_colors_initialize(); action_set_alarm(30, 1); /* */ - diff --git a/objects/obj_creation/Draw_0.gml b/objects/obj_creation/Draw_0.gml index d4e4a4a21..a77962d74 100644 --- a/objects/obj_creation/Draw_0.gml +++ b/objects/obj_creation/Draw_0.gml @@ -1,2317 +1,2294 @@ +try { + //read + // 850,860 + + var xx, yy; + xx = 375; + yy = 10; + + tooltip = ""; + tooltip2 = ""; + draw_set_alpha(1); + // draw_sprite(spr_creation_slate,0,xx,yy); + scr_image("creation/slate", 1, xx, yy, 850, 860); + draw_set_alpha(1 - (slate1 / 30)); + // draw_sprite(spr_creation_slate,1,xx,yy); + scr_image("creation/slate", 2, xx, yy, 850, 860); + + draw_set_color(5998382); + if (slate2 > 0) { + if (slate2 <= 10) { + draw_set_alpha(slate2 / 10); + } + if (slate2 > 10) { + draw_set_alpha(1 - ((slate2 - 10) / 10)); + } + draw_line(xx + 30, yy + 70 + (slate2 * 36), xx + 790, yy + 70 + (slate2 * 36)); + } + if (slate3 > 0) { + if (slate3 <= 10) { + draw_set_alpha(slate3 / 10); + } + if (slate3 > 10) { + draw_set_alpha(1 - ((slate3 - 10) / 10)); + } + draw_line(xx + 30, yy + 70 + (slate3 * 36), xx + 790, yy + 70 + (slate3 * 36)); + } + allow_colour_click = (cooldown <= 0) && (mouse_left >= 1) && (custom > 1) && (!instance_exists(obj_creation_popup)); + + draw_set_alpha(slate4 / 30); + if (slate4 > 0) { + /* Chapter Selection grid */ + if (slide == 1) { + draw_set_color(38144); + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); + draw_text(800, 80, string_hash_to_newline("Select Chapter")); + + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_left); + + draw_text_transformed(440, founding_y, "Founding Chapters", 0.75, 0.75, 0); + draw_text_transformed(440, successor_y, "Existing Chapters", 0.75, 0.75, 0); + draw_text_transformed(440, custom_y, string_hash_to_newline("Custom Chapters"), 0.75, 0.75, 0); + draw_text_transformed(440, other_y, string_hash_to_newline("Other"), 0.75, 0.75, 0); + + /// @localvar grid object to keep track of where to draw icon boxes + var grid = { + count: 0, + x1: icon_grid_left_edge, + y1: founding_y + icon_gap_y, + w: icon_width, + h: icon_height, + x2: 0, + y2: 0, + left_edge: icon_grid_left_edge, + right_edge: icon_grid_right_edge(), + row_gap: icon_row_gap, + section_gap: icon_gap_y, + col_gap: icon_gap_x, + /// Updates coords to draw a new icon, creating new rows where needed + new_cell: function() { + if (count > 0) { + x1 = x1 + col_gap; + } else { + x2 = x1 + w; + y2 = y1 + h; + } + if (x1 > right_edge) { + x1 = left_edge; + y1 = y1 + row_gap; + } + x2 = x1 + w; + y2 = y1 + h; + count += 1; + }, + /// given a new y coord for a section heading resets cell drawing to start a new grid + new_section: function(new_y) { + count = 0; + x1 = left_edge; + y1 = new_y + section_gap; + x2 = x1 + w; + y2 = y1 + h; + }, + hover: function() { + return scr_hit(x1, y1, x2, y2); + }, + clicked: function() { + return point_and_click([x1, y1, x2, y2]); + }, + }; + + /** * Founding Chapters */ + var i, new_hover, tool; + i = 1; + new_hover = highlight; + tool = 0; + for (var c = 0; c < array_length(founding_chapters); c++) { + var chap = founding_chapters[c]; + i = chap.id; + + grid.new_cell(); + + draw_sprite(spr_creation_icon, 0, grid.x1, grid.y1); + scr_image("creation/chapters/icons", chap.icon, grid.x1, grid.y1, grid.w, grid.h); + + // Hover + if (grid.hover() && slate4 >= 30) { + if ((old_highlight != highlight) && (highlight != i) && (goto_slide != 2)) { + old_highlight = highlight; + highlighting = 1; + } + if (goto_slide != 2) { + highlight = i; + tool = 1; + } + // Highlight white on hover + draw_rectangle_color_simple(grid.x1, grid.y1, grid.x2, grid.y2, 0, c_white, 0.1); + // Click + if (grid.clicked()) { + cooldown = 8000; + chapter_name = chap.name; + if (!chap.disabled) { + if (scr_chapter_new(chapter_name)) { + global.chapter_icon_sprite = obj_img.image_cache[$ "creation/chapters/icons"][chap.icon]; + global.chapter_icon_frame = 0; + global.chapter_icon_path = $"creation/chapters/icons"; + global.chapter_icon_filename = chap.icon; + + icon = i; + custom = 0; + change_slide = 1; + goto_slide = 2; + chapter_string = chapter_name; + } else { + // Chapter is borked + } + } + } + } + // grid.x1 += icon_gap_x; + } -//read -// 850,860 + /** * Successor Chapters */ + grid.new_section(successor_y); + + new_hover = highlight; + for (var c = 0; c < array_length(successor_chapters); c++) { + var chap = successor_chapters[c]; + i = chap.id; + + grid.new_cell(); + + draw_sprite(spr_creation_icon, 0, grid.x1, grid.y1); + scr_image("creation/chapters/icons", chap.icon, grid.x1, grid.y1, grid.w, grid.h); + + // Hover + if (grid.hover() && slate4 >= 30) { + if ((old_highlight != highlight) && (highlight != i) && (goto_slide != 2)) { + old_highlight = highlight; + highlighting = 1; + } + if (goto_slide != 2) { + highlight = i; + tool = 1; + } + // Highlight on hover + draw_rectangle_color_simple(grid.x1, grid.y1, grid.x2, grid.y2, 0, c_white, 0.1); + //Click + if (grid.clicked()) { + cooldown = 8000; + chapter_name = chap.name; + if (!chap.disabled) { + if (scr_chapter_new(chapter_name)) { + global.chapter_icon_sprite = obj_img.image_cache[$ "creation/chapters/icons"][chap.icon]; + global.chapter_icon_frame = 0; + global.chapter_icon_path = $"creation/chapters/icons"; + global.chapter_icon_filename = chap.icon; + + icon = chap.icon; + custom = 0; + change_slide = 1; + goto_slide = 2; + chapter_string = chapter_name; + } else { + // borked + } + } + } + } + } + /** * Saved Custom Chapters */ + grid.new_section(custom_y); + new_hover = highlight; + for (var c = 0; c < array_length(custom_chapters); c++) { + var chap = custom_chapters[c]; + i = chap.id; + + grid.new_cell(); + + draw_sprite(spr_creation_icon, 0, grid.x1, grid.y1); + if (chap.loaded == false) { + // should be the icon that says 'custom' + draw_sprite_stretched(spr_icon_chapters, 31, grid.x1, grid.y1, grid.w, grid.h); + } else { + if (chap.icon > global.normal_icons_count) { + if (string_starts_with(chap.icon_name, "custom")) { + var cuicon = obj_cuicons.spr_custom_icon[chap.icon - normal_and_builtin]; + draw_sprite_stretched(cuicon, 0, grid.x1, grid.y1, grid.w, grid.h); + } else { + draw_sprite_stretched(spr_icon_chapters, chap.icon - global.normal_icons_count, grid.x1, grid.y1, grid.w, grid.h); + } + } else { + scr_image("creation/chapters/icons", chap.icon, grid.x1, grid.y1, grid.w, grid.h); + } + } + + // Hover + if (grid.hover() && slate4 >= 30) { + if ((old_highlight != highlight) && (highlight != i) && (goto_slide != 2)) { + old_highlight = highlight; + highlighting = 1; + } + if (goto_slide != 2) { + highlight = chap.id; + tool = 1; + } + // Highlight white on hover + draw_rectangle_color_simple(grid.x1, grid.y1, grid.x2, grid.y2, 0, c_white, 0.1); + + //Click + if (grid.clicked()) { + if (chap.loaded == true && chap.disabled == false) { + if (chap.icon > global.normal_icons_count) { + if (string_starts_with(chap.icon_name, "custom")) { + var cuicon = obj_cuicons.spr_custom_icon[chap.icon - normal_and_builtin]; + global.chapter_icon_sprite = sprite_duplicate(cuicon); + global.chapter_icon_frame = 0; + global.chapter_icon_filename = chap.icon_name; + } else { + global.chapter_icon_sprite = spr_icon_chapters; + global.chapter_icon_frame = chap.icon - global.normal_icons_count; + } + } else { + global.chapter_icon_sprite = obj_img.image_cache[$ "creation/chapters/icons"][chap.icon]; + global.chapter_icon_frame = 0; + global.chapter_icon_path = $"creation/chapters/icons"; + global.chapter_icon_filename = chap.icon; + } + cooldown = 8000; + chapter_name = chap.name; + global.chapter_id = chap.id; + change_slide = 1; + goto_slide = 2; + scr_chapter_new(chap.id); + } else { + global.chapter_id = chap.id; + cooldown = 8000; + change_slide = 1; + goto_slide = 2; + custom = 2; + scr_chapter_random(0); + } + } + } + } -var xx,yy; -xx=375;yy=10; + /** * Other Chapters */ + grid.new_section(other_y); + + new_hover = highlight; + for (var c = 0; c < array_length(other_chapters); c++) { + var chap = other_chapters[c]; + i = chap.id; + + grid.new_cell(); + draw_sprite(spr_creation_icon, 0, grid.x1, grid.y1); + // draw_sprite_stretched(spr_icon,i,x2,y2,48,48); + scr_image("creation/chapters/icons", chap.icon, grid.x1, grid.y1, grid.w, grid.h); + + // Hover + if (grid.hover() && slate4 >= 30) { + if ((old_highlight != highlight) && (highlight != i) && (goto_slide != 2)) { + old_highlight = highlight; + highlighting = 1; + } + if (goto_slide != 2) { + highlight = i; + tool = 1; + } + // Highlight white on hover + draw_rectangle_color_simple(grid.x1, grid.y1, grid.x2, grid.y2, 0, c_white, 0.1); + //Click + if (grid.clicked()) { + cooldown = 8000; + chapter_name = chap.name; + if (!chap.disabled) { + if (scr_chapter_new(chapter_name)) { + global.chapter_icon_sprite = obj_img.image_cache[$ "creation/chapters/icons"][chap.icon]; + global.chapter_icon_frame = 0; + global.chapter_icon_path = $"creation/chapters/icons"; + global.chapter_icon_filename = chap.icon; + global.chapter_id = chap.id; + + icon = i; + custom = 0; + change_slide = 1; + goto_slide = 2; + chapter_string = chapter_name; + } else { + // borked + } + } + } + } + } -tooltip="";tooltip2=""; -draw_set_alpha(1); -// draw_sprite(spr_creation_slate,0,xx,yy); -scr_image("slate",0,xx,yy,850,860); -draw_set_alpha(1-(slate1/30)); -// draw_sprite(spr_creation_slate,1,xx,yy); -scr_image("slate",1,xx,yy,850,860); + /* Blank Custom + Random*/ + grid.new_cell(); + + i = 1001; + repeat (2) { + grid.new_cell(); + + draw_sprite(spr_creation_icon, 0, grid.x1, grid.y1); + draw_sprite_stretched(spr_icon_chapters, i - 1001, grid.x1, grid.y1, grid.w, grid.h); + + if (grid.hover() && slate4 >= 30) { + if ((old_highlight != highlight) && (highlight != i) && (goto_slide != 2)) { + old_highlight = highlight; + highlighting = 1; + } + if (goto_slide != 2) { + highlight = i; + tool = 1; + } + draw_rectangle_color_simple(grid.x1, grid.y1, grid.x2, grid.y2, 0, c_white, 0.1); + if (grid.clicked()) { + cooldown = 8000; + icon = 1; + icon_name = "da"; + change_slide = 1; + goto_slide = 2; + if (i == 1001) { + custom = 2; + scr_chapter_random(0); + } + if (i == 1002) { + custom = 1; + scr_chapter_random(1); + } + } + } + i += 1; + } -draw_set_color(5998382); -if (slate2>0){ - if (slate2<=10) then draw_set_alpha(slate2/10); - if (slate2>10) then draw_set_alpha(1-((slate2-10)/10)); - draw_line(xx+30,yy+70+(slate2*36),xx+790,yy+70+(slate2*36)); -} -if (slate3>0){ - if (slate3<=10) then draw_set_alpha(slate3/10); - if (slate3>10) then draw_set_alpha(1-((slate3-10)/10)); - draw_line(xx+30,yy+70+(slate3*36),xx+790,yy+70+(slate3*36)); -} + if ((tool == 1) && (highlighting < 30)) { + highlighting += 1; + } + if ((tool == 0) && (highlighting > 0)) { + highlighting -= 1; + } + // if (new_hover=0) then highlight=0; + + if (((highlight > 0) && (highlighting > 0)) || ((change_slide > 0) && (goto_slide != 1))) { + draw_set_alpha(min(slate4 / 30, highlighting / 30)); + if (change_slide > 0) { + draw_set_alpha(1); + } + + if (highlight == 1001) { + scr_image("creation/chapters/splash", 97, 0, 68, 374, 713); + } + if (highlight == 1002) { + scr_image("creation/chapters/splash", 98, 0, 68, 374, 713); + } + if (highlight <= array_length(all_chapters)) { + var splash_chapter = all_chapters[highlight]; + //show_debug_message($"highlight {highlight} splash chapter {splash_chapter.id} splash icon {splash_chapter.splash}"); + scr_image("creation/chapters/splash", splash_chapter.splash, 0, 68, 374, 713); + } + + draw_set_alpha(slate4 / 30); + draw_set_color(38144); + draw_rectangle(0, 68, 374, 781, 1); + } + draw_set_alpha(slate4 / 30); -var allow_colour_click = (cooldown<=0) and (mouse_left>=1) and (custom>1) and (!instance_exists(obj_creation_popup)); - -draw_set_alpha(slate4/30); -if (slate4>0){ - if (slide=1){ - draw_set_color(38144); - draw_set_font(fnt_40k_30b); - draw_set_halign(fa_center); - draw_text(800,80,string_hash_to_newline("Select Chapter")); - - draw_set_font(fnt_40k_30b); - draw_set_halign(fa_left); - draw_text_transformed(440,133,"Founding Chapters",0.75,0.75,0); - draw_text_transformed(440,363,"Existing Chapters",0.75,0.75,0); - draw_text_transformed(440,593,string_hash_to_newline("Other"),0.75,0.75,0); - draw_text_transformed(440,463,string_hash_to_newline("Custom Chapters"),0.75,0.75,0); - - var x2,y2,i,new_hover,tool; - x2=441;y2=167;i=1;new_hover=highlight;tool=0; - - repeat(9){ - - draw_sprite(spr_creation_icon,0,x2,167); - scr_image("creation",i,x2,167,48,48); - // draw_sprite_stretched(spr_icon,i,x2,167,48,48); - - if (mouse_x>=x2) and (mouse_y>=167) and (mouse_x=30){ - if (old_highlight!=highlight) and (highlight!=i) and (goto_slide!=2){old_highlight=highlight;highlighting=1;} - if (goto_slide!=2){highlight=i;tool=1;} - draw_set_alpha(0.1);draw_set_color(c_white); - draw_rectangle(x2,167,x2+48,167+48,0); - draw_set_alpha(slate4/30); - if (mouse_left>=1) and (cooldown<=0) and (change_slide<=0) and (premades){ - cooldown=8000;chapter=chapter_id[i];scr_chapter_new(chapter); - if (chapter!="nopw_nopw"){icon=i;custom=0;change_slide=1;goto_slide=2;chapter_string=chapter;} - } - } - i+=1;x2+=53; - } - - x2=441;y2=397;i=10;new_hover=highlight; - repeat(7){ - - draw_sprite(spr_creation_icon,0,x2,397); - // draw_sprite_stretched(spr_icon,i,x2,397,48,48); - scr_image("creation",i,x2,397,48,48); - - if (mouse_x>=x2) and (mouse_y>=397) and (mouse_x=30){ - if (old_highlight!=highlight) and (highlight!=i) and (goto_slide!=2){old_highlight=highlight;highlighting=1;} - if (goto_slide!=2){highlight=i;tool=1;} - draw_set_alpha(0.1);draw_set_color(c_white); - draw_rectangle(x2,397,x2+48,397+48,0); - draw_set_alpha(slate4/30); - if (mouse_left>=1) and (cooldown<=0) and (change_slide<=0) and (premades){ - cooldown=8000;chapter=chapter_id[i];scr_chapter_new(chapter); - if (chapter!="nopw_nopw"){icon=i;custom=0;change_slide=1;goto_slide=2;chapter_string=chapter;} - } - } - i+=1;x2+=53; - } - - x2=441;y2=497;i=21;new_hover=highlight; - - repeat(1){ - draw_sprite(spr_creation_icon,0,x2,497); - // draw_sprite_stretched(spr_icon,i,x2,397,48,48); - if(file_exists("chaptersave#1.ini")){ - ini_open("chaptersave#1.ini") - icon21=ini_read_real("Save","icon",1); - ini_close(); - } - else{ icon21=1 - } - scr_image("creation",icon21,x2,497,48,48); - - if (mouse_x>=x2) and (mouse_y>=497) and (mouse_x=30){ - - if (old_highlight!=highlight) and (highlight!=i) and (goto_slide!=2){old_highlight=highlight;highlighting=1;} - if (goto_slide!=2){highlight=i;tool=1;} - draw_set_alpha(0.1);draw_set_color(c_white); - draw_rectangle(x2,497,x2+48,497+48,0); - draw_set_alpha(slate4/30); - if (mouse_left>=1) and (cooldown<=0) and (change_slide<=0){ - if(chapter_made=1){ - - cooldown=8000;chapter = chapter_id[21]; - change_slide=1;goto_slide=2; - scr_chapter_new(chapter21)}; - - if (chapter_made = 0 ){ - cooldown=8000; - change_slide=1;goto_slide=2; - custom=2;scr_chapter_random(0);} - - } - } - i+=1;x2+=53; - } - - x2=441;y2=627;i=17;new_hover=highlight; - repeat(4){ - - draw_sprite(spr_creation_icon,0,x2,y2); - // draw_sprite_stretched(spr_icon,i,x2,y2,48,48); - scr_image("creation",i,x2,y2,48,48); - - if (mouse_x>=x2) and (mouse_y>=y2) and (mouse_x=30){ - if (old_highlight!=highlight) and (highlight!=i) and (goto_slide!=2){old_highlight=highlight;highlighting=1;} - if (goto_slide!=2){highlight=i;tool=1;} - draw_set_alpha(0.1);draw_set_color(c_white); - draw_rectangle(x2,y2,x2+48,y2+48,0); - draw_set_alpha(slate4/30); - if (mouse_left>=1) and (cooldown<=0) and (change_slide<=0) and (premades){ - cooldown=8000;chapter=chapter_id[i];scr_chapter_new(chapter); - if (chapter!="nopw_nopw"){icon=i;custom=0;change_slide=1;goto_slide=2;chapter_string=chapter;} - } - } - i+=1;x2+=53; - } - - x2+=53;i=1001; - repeat(2){ - - draw_sprite(spr_creation_icon,0,x2,y2); - draw_sprite_stretched(spr_icon_chapters,i-1001,x2,y2,48,48); - - if (mouse_x>=x2) and (mouse_y>=y2) and (mouse_x=30){ - if (old_highlight!=highlight) and (highlight!=i) and (goto_slide!=2){old_highlight=highlight;highlighting=1;} - if (goto_slide!=2){highlight=i;tool=1;} - draw_set_alpha(0.1);draw_set_color(c_white); - draw_rectangle(x2,y2,x2+48,y2+48,0); - draw_set_alpha(slate4/30); - if (mouse_left>=1) and (cooldown<=0) and (change_slide<=0){ - cooldown=8000;icon=1;icon_name="da";change_slide=1;goto_slide=2; - if (i=1001){custom=2;scr_chapter_random(0);} - if (i=1002){custom=1;scr_chapter_random(1);} - } - } - i+=1;x2+=53; - } - - if (tool=1) and (highlighting<30) then highlighting+=1; - if (tool=0) and (highlighting>0) then highlighting-=1; - // if (new_hover=0) then highlight=0; - - if ((highlight>0) and (highlighting>0)) or ((change_slide>0) and (goto_slide!=1)){ - draw_set_alpha(min(slate4/30,highlighting/30)); - if (change_slide>0) then draw_set_alpha(1); - - - if (highlight<=9) then scr_image("main_splash",highlight-1,0,68,374,713); - if (highlight>9) and (highlight<=16) and (highlight!=15) then scr_image("existing_splash",highlight-10,0,68,374,713); - if (highlight=15) then scr_image("other_splash",6,0,68,374,713); - if (highlight=17) then scr_image("other_splash",0,0,68,374,713); - if (highlight=18) then scr_image("other_splash",6,0,68,374,713); - if (highlight=19) then scr_image("other_splash",2,0,68,374,713); - if (highlight=20) then scr_image("other_splash",6,0,68,374,713); - - if (highlight=1001) then scr_image("other_splash",4,0,68,374,713); - if (highlight=1002) then scr_image("other_splash",5,0,68,374,713); - - /*if (highlight<=9) then draw_sprite(spr_creation_founding,highlight-1,0,68); - if (highlight>9) and (highlight<=16) and (highlight!=15) then draw_sprite(spr_creation_existing,highlight-10,0,68); - if (highlight=15) then draw_sprite(spr_creation_nosplash,0,0,68); - if (highlight=17) then draw_sprite(spr_creation_other,0,0,68); - if (highlight=18) then draw_sprite(spr_creation_nosplash,0,0,68); - if (highlight=19) then draw_sprite(spr_creation_other,2,0,68); - if (highlight=20) then draw_sprite(spr_creation_nosplash,0,0,68); - - if (highlight=1001) then draw_sprite(spr_creation_other,4,0,68); - if (highlight=1002) then draw_sprite(spr_creation_other,5,0,68);*/ - - draw_set_alpha(slate4/30); - draw_set_color(38144); - draw_rectangle(0,68,374,781,1); - } - draw_set_alpha(slate4/30); - - - - - if (instance_exists(obj_cursor)){obj_cursor.image_index=0;} - if (tool=1) and (change_slide<=0){ - if (instance_exists(obj_cursor)){obj_cursor.image_index=1;} - - draw_set_alpha(1); - draw_set_color(0); - draw_set_halign(fa_left); - - if (highlight<=25){ - tooltip=chapter_id[highlight]; - tooltip2=chapter_tooltip[highlight]; - } - if (highlight=1001) then tooltip="Custom"; - if (highlight=1002) then tooltip="Randomize"; - if (highlight=1001) then tooltip2="Create your own customized Chapter, deciding the origins, strength, and weaknesses. Custom Chapters are weaker than Founding Chapters."; - if (highlight=1002) then tooltip2="Randomly generate a Chapter to play. The origins, strength, and weaknesses are all random. Random Chapters are normally weaker than Founding Chapters. "; - } - - - - } -} + if (instance_exists(obj_cursor)) { + obj_cursor.image_index = 0; + } + if ((tool == 1) && (change_slide <= 0)) { + if (instance_exists(obj_cursor)) { + obj_cursor.image_index = 1; + } + + draw_set_alpha(1); + draw_set_color(0); + draw_set_halign(fa_left); + + if (highlight <= array_length(all_chapters)) { + var chap = all_chapters[highlight]; + tooltip = chap.name; + if (chap.progenitor != 0 && chap.progenitor < 10) { + tooltip += " - Progenitor: " + all_chapters[chap.progenitor].name; + } + tooltip2 = chap.tooltip; + } + if (highlight == 1001) { + tooltip = "Custom"; + } + if (highlight == 1002) { + tooltip = "Randomize"; + } + if (highlight == 1001) { + tooltip2 = "Create your own customized Chapter, deciding the origins, strength, and weaknesses. Custom Chapters are weaker than Founding Chapters."; + } + if (highlight == 1002) { + tooltip2 = "Randomly generate a Chapter to play. The origins, strength, and weaknesses are all random. Random Chapters are normally weaker than Founding Chapters. "; + } + } + } + } + + var yar; + yar = 0; + + if (slide >= 2) { + tooltip = ""; + tooltip2 = ""; + + if (goto_slide != 1) { + if (custom == 2) { + draw_sprite(spr_creation_other, 4, 0, 68); + } + if (custom == 1) { + draw_sprite(spr_creation_other, 5, 0, 68); + } + + draw_set_color(38144); + draw_rectangle(0, 68, 374, 781, 1); + } + + draw_set_color(0); + // draw_rectangle(436,74,436+128,74+128,0); + // if (icon<=20) then draw_sprite_stretched(spr_icon,icon,436,74,128,128); + var sprx = 436, spry = 74, sprw = 128, sprh = 128; + draw_sprite_stretched(global.chapter_icon_sprite, global.chapter_icon_frame, sprx, spry, sprw, sprh); -var yar;yar=0; - - -if (slide>=2){ - tooltip="";tooltip2=""; - - if (goto_slide!=1){ - if (icon<=9) then draw_sprite(spr_creation_founding,icon-1,0,68); - if (icon>9) and (icon<=16) and (icon!=15) then draw_sprite(spr_creation_existing,icon-10,0,68); - if (icon=15) then draw_sprite(spr_creation_nosplash,0,0,68); - if (icon=17) then draw_sprite(spr_creation_other,0,0,68); - if (icon=18) then draw_sprite(spr_creation_nosplash,0,0,68); - if (icon=19) then draw_sprite(spr_creation_other,2,0,68); - if (icon=20) then draw_sprite(spr_creation_nosplash,0,0,68); - - if (custom=2) then draw_sprite(spr_creation_other,4,0,68); - if (custom=1) then draw_sprite(spr_creation_other,5,0,68); - - draw_set_color(38144); - draw_rectangle(0,68,374,781,1); - } - - draw_set_color(0); - // draw_rectangle(436,74,436+128,74+128,0); - // if (icon<=20) then draw_sprite_stretched(spr_icon,icon,436,74,128,128); - if (icon<=20) then scr_image("creation",icon,436,74,128,128); - if (icon>20) then draw_sprite_stretched(spr_icon_chapters,icon-19,436,74,128,128); - - obj_cursor.image_index=0; - if (scr_hit(436,74,436+128,74+128)) and (popup=""){obj_cursor.image_index=1; - tooltip="Chapter Icon";tooltip2="Your Chapter's icon. Click to edit."; - - /*if (cooldown<=0) and (mouse_left=1){ + obj_cursor.image_index = 0; + if (scr_hit(436, 74, 436 + 128, 74 + 128) && (popup == "")) { + obj_cursor.image_index = 1; + tooltip = "Chapter Icon"; + tooltip2 = "Your Chapter's icon. Click to edit."; + + /*if (cooldown<=0) and (mouse_left=1){ popup="icons";cooldown=8000; }*/ - } - - var i;i=0; - repeat(290){i+=1; - if (icon_name="custom"+string(i)) and (obj_cuicons.spr_custom[i]>0){ - if (sprite_exists(obj_cuicons.spr_custom_icon[i])){ - draw_sprite_stretched(obj_cuicons.spr_custom_icon[i],0,436,74,128,128); - - - // obj_cuicons.spr_custom_icon[ic-78] - } - } - } - - // draw_set_color(c_orange); - // draw_text(436+64,74-30,string(icon_name)); - - - if (slide=2){ - /*if (scr_hit(548,149,584,193)){obj_cursor.image_index=1; + } + + var i; + i = 0; + repeat (290) { + i += 1; + if ((icon_name == "custom" + string(i)) && (obj_cuicons.spr_custom[i] > 0)) { + if (sprite_exists(obj_cuicons.spr_custom_icon[i])) { + draw_sprite_stretched(obj_cuicons.spr_custom_icon[i], 0, 436, 74, 128, 128); + + // obj_cuicons.spr_custom_icon[ic-78] + } + } + } + + // draw_set_color(c_orange); + // draw_text(436+64,74-30,string(icon_name)); + + if (slide == 2) { + /*if (scr_hit(548,149,584,193)){obj_cursor.image_index=1; if (cooldown<=0) and (mouse_left>=1){cooldown=8000;scr_icon("-");} } if (scr_hit(595,149,634,193)){obj_cursor.image_index=1; if (cooldown<=0) and (mouse_left>=1){cooldown=8000;scr_icon("+");} }*/ - - - if (founding!=0){ - draw_set_font(fnt_40k_30b); - // draw_text_transformed( - - draw_set_alpha(0.33); - // if (founding<10) then draw_sprite_stretched(spr_icon,founding,1164-128,74,128,128); - if (founding<10) then scr_image("creation",founding,1164-128,74,128,128); - if (founding=10) then draw_sprite_stretched(spr_icon_chapters,0,1164-128,74,128,128); - draw_set_alpha(1); - - if (scr_hit(1164-128,74,1164,74+128)){tooltip="Founding Chapter";tooltip2="The parent Chapter whos Gene-Seed your own originates from.";} - - if (custom>1){ - draw_sprite_stretched(spr_creation_arrow,0,1164-194,160,32,32); - draw_sprite_stretched(spr_creation_arrow,1,1164-144,160,32,32); - - if (scr_hit(1164-194,149,1164-162,193)){obj_cursor.image_index=1; - if (cooldown<=0) and (mouse_left>=1){cooldown=8000;founding-=1; - if (founding=0) then founding=10;} - } - if (scr_hit(1164-144,149,1164-112,193)){obj_cursor.image_index=1; - if (cooldown<=0) and (mouse_left>=1){cooldown=8000;founding+=1; - if (founding=11) then founding=1;} - } - } - - - } - - - - } - - -} -/* Chapter Naming, Points assignment, advantages/disadvantages */ -if (slide=2){ - draw_set_color(38144); - draw_set_font(fnt_40k_30b); - draw_set_halign(fa_center); - - obj_cursor.image_index=0; - - if (name_bad=1) then draw_set_color(c_red); - if (text_selected!="chapter") or (custom!=2) then draw_text(800,80,string_hash_to_newline(string(chapter))); - if (custom=2){ - if (text_selected="chapter") and (text_bar>30) then draw_text(800,80,string_hash_to_newline(string(chapter))); - if (text_selected="chapter") and (text_bar<=30) then draw_text(805,80,string_hash_to_newline(string(chapter)+"|")); - if (scr_text_hit(800,80,true,chapter)){ - obj_cursor.image_index=2; - if (cooldown<=0) and (mouse_left>=1){text_selected="chapter";cooldown=8000;keyboard_string=chapter;} - } - if (text_selected="chapter") then chapter=keyboard_string; - draw_set_alpha(0.75);draw_rectangle(580,80,1020,118,1);draw_set_alpha(1); - } - - draw_set_color(38144); - draw_text_transformed(800,120,string_hash_to_newline("Points: "+string(points)+"/"+string(maxpoints)),0.6,0.6,0); - - - obj_cursor.image_index=0; - if (custom>0) and (restarted=0){ - if (scr_hit(436,74,436+128,74+128)) and (popup=""){obj_cursor.image_index=1; - if (cooldown<=0) and (mouse_left=1){ - popup="icons";cooldown=8000; - } - } - } - - /*if (custom>0) and (restarted=0){ + if (founding != 0) { + draw_set_font(fnt_40k_30b); + // draw_text_transformed( + + draw_set_alpha(0.33); + // if (founding<10) then draw_sprite_stretched(spr_icon,founding,1164-128,74,128,128); + if (founding < 10) { + scr_image("creation/chapters/icons", founding, 1164 - 128, 74, 128, 128); + } + if (founding == 10) { + draw_sprite_stretched(spr_icon_chapters, 0, 1164 - 128, 74, 128, 128); + } + draw_set_alpha(1); + + if (scr_hit(1164 - 128, 74, 1164, 74 + 128)) { + tooltip = "Founding Chapter"; + tooltip2 = "The parent Chapter whos Gene-Seed your own originates from."; + } + + if (custom > 1) { + draw_sprite_stretched(spr_creation_arrow, 0, 1164 - 194, 160, 32, 32); + draw_sprite_stretched(spr_creation_arrow, 1, 1164 - 144, 160, 32, 32); + + if (scr_hit(1164 - 194, 149, 1164 - 162, 193)) { + obj_cursor.image_index = 1; + if ((cooldown <= 0) && (mouse_left >= 1)) { + cooldown = 8000; + founding -= 1; + if (founding == 0) { + founding = 10; + } + } + } + if (scr_hit(1164 - 144, 149, 1164 - 112, 193)) { + obj_cursor.image_index = 1; + if ((cooldown <= 0) && (mouse_left >= 1)) { + cooldown = 8000; + founding += 1; + if (founding == 11) { + founding = 1; + } + } + } + } + } + } + } + + /* Chapter Naming, Points assignment, advantages/disadvantages */ + if (slide == 2) { + draw_set_color(38144); + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); + + obj_cursor.image_index = 0; + + if (name_bad == 1) { + draw_set_color(c_red); + } + if ((text_selected != "chapter") || (custom != 2)) { + draw_text(800, 80, string_hash_to_newline(string(chapter_name))); + } + if (custom == 2) { + if ((text_selected == "chapter") && (text_bar > 30)) { + draw_text(800, 80, string_hash_to_newline(string(chapter_name))); + } + if ((text_selected == "chapter") && (text_bar <= 30)) { + draw_text(805, 80, string_hash_to_newline(string(chapter_name) + "|")); + } + if (scr_text_hit(800, 80, true, chapter_name)) { + obj_cursor.image_index = 2; + if ((cooldown <= 0) && (mouse_left >= 1)) { + text_selected = "chapter"; + cooldown = 8000; + keyboard_string = chapter_name; + } + } + if (text_selected == "chapter") { + chapter_name = keyboard_string; + } + draw_set_alpha(0.75); + draw_rectangle(580, 80, 1020, 118, 1); + draw_set_alpha(1); + } + + draw_set_color(38144); + draw_text_transformed(800, 120, string_hash_to_newline("Points: " + string(points) + "/" + string(maxpoints)), 0.6, 0.6, 0); + + obj_cursor.image_index = 0; + if ((custom > 0) && (restarted == 0)) { + if (scr_hit(436, 74, 436 + 128, 74 + 128) && (popup == "")) { + obj_cursor.image_index = 1; + if ((cooldown <= 0) && (mouse_left == 1)) { + popup = "icons"; + cooldown = 8000; + } + } + } + + /*if (custom>0) and (restarted=0){ draw_sprite_stretched(spr_creation_arrow,0,550,160,32,32); draw_sprite_stretched(spr_creation_arrow,1,597,160,32,32); }*/ - - draw_set_color(38144); - draw_line(445,200,1125,200); - draw_line(445,201,1125,201); - draw_line(445,202,1125,202); - - if (popup=""){ - if (custom<2) then draw_set_alpha(0.5); - draw_text_transformed(800,211,string_hash_to_newline("Chapter Type"),0.6,0.6,0); - draw_set_halign(fa_left); - - if (scr_hit(516,242,674,266)){tooltip="Homeworld";tooltip2="Your chapter has a homeworld that they base on. Contained upon it is a massive Fortress Monastery, which provides high levels of defense and automated weapons.";} - if (scr_hit(768,242,866,266)){tooltip="Fleet Based";tooltip2="Rather than a homeworld your chapter begins near their recruiting world. The fleet includes a Battle Barge, which serves as a mobile base, and powerful ship.";} - if (scr_hit(952,242,1084,266)){tooltip="Penitent";tooltip2="As with Fleet Based, but you must crusade and fight until your penitence meter runs out. Note that recruiting is disabled until then.";}// Avoiding fights will result in excomunicatus traitorus. - - if (custom<2) then draw_set_alpha(0.5); - yar=0;if (fleet_type=1) then yar=1;draw_sprite(spr_creation_check,yar,519,239);yar=0; - if (scr_hit(519,239,519+32,239+32)) and (cooldown<=0) and (mouse_left>=1) and (custom=2){cooldown=8000; - if (points+20<=maxpoints) and (fleet_type=3){points+=20;fleet_type=1;} - if (fleet_type=2){fleet_type=1;} - } - draw_text_transformed(551,239,string_hash_to_newline("Homeworld"),0.6,0.6,0); - - yar=0;if (fleet_type=2) then yar=1;draw_sprite(spr_creation_check,yar,771,239);yar=0; - if (scr_hit(771,239,771+32,239+32)) and (cooldown<=0) and (mouse_left>=1) and (custom=2){cooldown=8000; - if (points+20<=maxpoints) and (fleet_type=3){points+=20;fleet_type=2;} - if (fleet_type=1){fleet_type=2;} - } - draw_text_transformed(804,239,string_hash_to_newline("Fleet Based"),0.6,0.6,0); - - yar=0;if (fleet_type=3) then yar=1;draw_sprite(spr_creation_check,yar,958,239);yar=0; - if (scr_hit(958,239,958+32,239+32)) and (cooldown<=0) and (mouse_left>=1) and (custom=2){if (fleet_type!=3) then points-=20;fleet_type=3;cooldown=8000;} - draw_text_transformed(990,239,string_hash_to_newline("Penitent"),0.6,0.6,0); - draw_set_alpha(1); - - draw_line(445,289,1125,289); - draw_line(445,290,1125,290); - draw_line(445,291,1125,291); - - draw_set_halign(fa_center); - draw_text_transformed(800,301,string_hash_to_newline("Chapter Stats"),0.6,0.6,0); - draw_set_halign(fa_right); - - draw_text_transformed(617,332,string_hash_to_newline("Strength ("+string(strength)+")"),0.5,0.5,0); - draw_text_transformed(617,387,string_hash_to_newline("Cooperation ("+string(cooperation)+")"),0.5,0.5,0); - draw_text_transformed(617,442,string_hash_to_newline("GeneSeed Purity ("+string(purity)+")"),0.5,0.5,0); - draw_text_transformed(617,497,string_hash_to_newline("GeneSeed Stability ("+string(stability)+")"),0.5,0.5,0); - var arrow_buttons_controls = [strength, cooperation, purity, stability] - for (var i=0;i<4;i++){ - if (custom=2) then draw_sprite_stretched(spr_arrow,0,625,325+(i*55),32,32); - if (scr_hit(625,325+(i*55),657,357+(i*55))){ - obj_cursor.image_index=1; - if (cooldown<=0) and (custom=2) and (arrow_buttons_controls[i]>1) and (mouse_left>=1){ - arrow_buttons_controls[i]-=1; - points-=10; - cooldown=8000; - } - } - if (custom=2) then draw_sprite_stretched(spr_arrow,1,1135,325+(i*55),32,32); - if (scr_hit(1135,325+(i*55),1167,357+(i*55))){ - obj_cursor.image_index=1; - if (cooldown<=0) and (custom=2) and (arrow_buttons_controls[i]<10) and (points+10<=maxpoints) and (mouse_left>=1){ - arrow_buttons_controls[i]+=1; - points+=10; - cooldown=8000; - } - } - draw_rectangle(668,330+(i*55),1125,351+(i*55),1); - draw_rectangle(668,330+(i*55),668+(arrow_buttons_controls[i]*45.7),351+(i*55),0); - } - strength = arrow_buttons_controls[0]; - cooperation = arrow_buttons_controls[1]; - purity = arrow_buttons_controls[2]; - stability = arrow_buttons_controls[3]; - - if (scr_hit(532,325,1166,357)){tooltip="Strength";tooltip2="How many companies your chapter begins with. For every score below five a company will be removed; conversely, each score higher grants 50 additional astartes.";} - if (scr_hit(486,380,1166,412)){tooltip="Cooperation";tooltip2="How diplomatic your chapter is. A low score will lower starting dispositions of Imperial factions and make disposition increases less likely to occur.";} - if (scr_hit(442,435,1166,467)){tooltip="Purity";tooltip2="A measure of how pure and mutation-free your chapter's gene-seed is. A perfect score means no mutations must be chosen. The lower the score, the more mutations.";} - if (scr_hit(423,490,1166,522)){tooltip="Stability";tooltip2="A measure of how easily new mutations and corruption can occur with your chapter-gene seed. A perfect score makes the gene-seed almost perfectly stable.";} - } - - if (popup!="icons"){ - draw_line(445,551,1125,551); - draw_line(445,552,1125,552); - draw_line(445,553,1125,553); - } - - if (popup!="") or (custom<2) then draw_set_alpha(0.5); - - - if (popup!="icons"){ - var advantage_click = (mouse_left>=1 && cooldown<=0 && custom>1); - draw_set_halign(fa_left); - draw_set_font(fnt_40k_30b); - draw_text_transformed(436,564,"Chapter Advantages",0.5,0.5,0);draw_set_font(fnt_40k_14); - var adv_txt = { - x1: 436, - y1: 570, - w: 204, - h: 20, - } - adv_txt.x2 = adv_txt.x1 + adv_txt.w; - adv_txt.y2 = adv_txt.y1 + adv_txt.h; - var max_advantage_count = 8; - for (i=1;i<=max_advantage_count;i++){ - var draw_string = adv_num[i]==0?"[+]":"[-] "+adv[i]; - draw_text(adv_txt.x1,adv_txt.y1+(i*adv_txt.h), draw_string); - if (scr_hit(adv_txt.x1,adv_txt.y1+(i*adv_txt.h),adv_txt.x2,adv_txt.y2+(i*adv_txt.h))){ - if (points+20>maxpoints) and (adv_num[i]=0) and (popup=""){ - tooltip="Insufficient Points"; - tooltip2="Add disadvantages or decrease Chapter Stats"; - } - - if (adv_num[i]!=0){ - tooltip=advantage[adv_num[i]]; - tooltip2=advantage_tooltip[adv_num[i]]; - } - if (advantage_click){ - if (points+20<=maxpoints) and (adv_num[i]=0) and (popup=""){ - popup="advantages"; - cooldown=8000; - temp=i; - } - var removable=false; - if (i==max_advantage_count && adv_num[i]>0){ - removable=true; - } else if (adv_num[i]>0 && adv_num[i+1]=0){ - removable=true; - } - if (mouse_x<=456) and (removable){ - points-=20; - adv[i]=""; - adv_num[i]=0; - cooldown=8000; - } - } - } - } - draw_set_font(fnt_40k_30b); - draw_text_transformed(810,564,"Chapter Disadvantages",0.5,0.5,0); - draw_set_font(fnt_40k_14); - - var dis_txt = { - x1: 810, - y1: 570, - w: 204, - h: 20, - } - dis_txt.x2 = dis_txt.x1 + dis_txt.w; - dis_txt.y2 = dis_txt.y1 + dis_txt.h; - var max_disadvantage_count = 8; - for (i=1;i<=max_disadvantage_count;i++){ - var draw_string = dis_num[i]==0?"[+]":"[-] "+dis[i]; - draw_text(dis_txt.x1,dis_txt.y1+(i*dis_txt.h), draw_string); - if (scr_hit(dis_txt.x1,dis_txt.y1+(i*dis_txt.h),dis_txt.x2,dis_txt.y2+(i*dis_txt.h))){ - if (dis_num[i]!=0){ - tooltip=disadvantage[dis_num[i]]; - tooltip2=dis_tooltip[dis_num[i]]; - } - if (advantage_click){ - if ((dis_num[i]=0) and (popup="")){ - popup="disadvantages"; - cooldown=8000; - temp=i; - } - var removable=false; - if (i==max_disadvantage_count && dis_num[i]>0){ - removable=true; - } else if (dis_num[i]>0 && dis_num[i+1]==0){ - removable=true; - } - if (mouse_x<=830) and (removable) and (points+20<=maxpoints) { - points+=20; - dis[i]=""; - dis_num[i]=0; - cooldown=8000; - } - } - } - } - draw_set_alpha(1); - if (scr_hit(436,564,631,583)){ - tooltip="Chapter Advantages"; - tooltip2="Advantages cost 20 points, and improve the performance of your chapter in a specific domain."; - } - if (scr_hit(810,564,1030,583)){ - tooltip="Chapter Disadvantages"; - tooltip2="Disadvantages Grant 20 additional points, and penalize the performance of your chapter."; - } - }else if (popup="icons"){ - draw_set_alpha(1); - draw_set_color(0); - draw_rectangle(450,206,1144,711,0); - - draw_set_color(38144); - draw_line(445,727,1125,727); - draw_line(445,728,1125,728); - draw_line(445,729,1125,729); - - draw_set_font(fnt_40k_30b); - draw_set_halign(fa_center); - draw_text_transformed(800,211,"Select an Icon",0.6,0.6,0); - draw_text_transformed(800,687,"Cancel",0.6,0.6,0); - - var cw,ch; - cw=string_width(string_hash_to_newline("Cancel"))*0.6; - ch=string_height(string_hash_to_newline("Cancel"))*0.6; - - if (scr_hit(800,687,800+cw,687+ch)){ - draw_set_color(c_white); - draw_set_alpha(0.25); - draw_text_transformed(800,687,string_hash_to_newline("Cancel"),0.6,0.6,0); - draw_set_color(38144); - draw_set_alpha(1); - - if (mouse_left=1) and (cooldown<=0){ - cooldown=8000; - popup=""; - } - } - - draw_set_font(fnt_40k_14b);draw_set_halign(fa_left); - - // repeat here - - var i,ic,x3,y3,row; - i=0;ic=icons_top-1;x3=445-110;y3=245;row=0; - - repeat(24){ - i+=1;ic+=1;row+=1; - - if (row=7){ - row=1;x3=445-110;y3+=110; - } - - x3+=110; - - if (ic<=(76+global.custom_icons)){ - // if (ic=21) then ic=23; - - // draw_rectangle(x3,y3,x3+96,y3+96,0); - // if (ic<=20) then draw_sprite_stretched(spr_icon,ic,x3,y3,96,96); - if (ic<=20) then scr_image("creation",ic,x3,y3,96,96); - if (ic>20) and (ic<=76) then draw_sprite_stretched(spr_icon_chapters,ic-19,x3,y3,96,96); - if (ic>76) and (obj_cuicons.spr_custom[ic-76]>0) and (obj_cuicons.spr_custom_icon[ic-76]!=-1){ - draw_sprite_stretched(obj_cuicons.spr_custom_icon[ic-76],0,x3,y3,96,96); - } - - if (scr_hit(x3,y3,x3+96,y3+96)){ - draw_set_blend_mode(bm_add);draw_set_alpha(0.25);draw_set_color(16119285); - // if (ic<=20) then draw_sprite_stretched(spr_icon,ic,x3,y3,96,96); - if (ic<=20) then scr_image("creation",ic,x3,y3,96,96); - if (ic>20) and (ic<=76) then draw_sprite_stretched(spr_icon_chapters,ic-19,x3,y3,96,96); - if (ic>76) and (obj_cuicons.spr_custom[ic-76]>0) and (obj_cuicons.spr_custom_icon[ic-76]!=-1){ - draw_sprite_stretched(obj_cuicons.spr_custom_icon[ic-76],0,x3,y3,96,96); - } - draw_set_blend_mode(bm_normal); - draw_set_alpha(1);draw_set_color(38144); - - if (mouse_left=1) and (cooldown<=0){ - cooldown=8000;popup="";icon=ic;icon_name="";scr_icon(""); - if (ic>76) then custom_icon=ic-76; - // show_message(string(icon_name)); - } - - } - - // draw_set_color(c_orange); - // draw_text(x3+48,y3+64,string(ic)); - draw_set_color(38144); - } - - } - - - var x1,x2,x3,x4,x6,y1,y2,y3,y4,y6,bs,see_size,total_max,current,top; - - x1=1111;y1=245;x2=1131;y2=671;bs=245; - draw_rectangle(x1,y1,x2,y2,1); - - total_max=77+global.custom_icons; - see_size=(671-245)/total_max; - - x3=1111;x4=1131; - current=icons_top; - top=current*see_size; - y3=top;y4=y3+(24*see_size)-see_size; - - - if (scrollbar_engaged=0) then draw_rectangle(x3,y3+bs,x4,y4+bs,0); - - if (scrollbar_engaged>0){ - y3=mouse_y-scrollbar_engaged; - // y3=mouse_y-scrollbar_engaged - y4=y3+(24*see_size); - - if (y3y2){y4=y2;y3=y2-(24*see_size);} - - draw_rectangle(x3,y3,x4,y4,0); - } - - - if (scr_hit(x3,y3+bs,x4,y4+bs)) and (cooldown<=0) and (scrollbar_engaged<=0) and (mouse_left=1){// Click within the scrollbar grip area - scrollbar_engaged=mouse_y-(y3+bs);cooldown=8000; - } - - - - } - - - - - if (popup="advantages"){ - draw_set_font(fnt_40k_30b);draw_set_halign(fa_center); - draw_text_transformed(800,211,string_hash_to_newline("Select an Advantage"),0.6,0.6,0); - draw_set_font(fnt_40k_14b);draw_set_halign(fa_left); - - for(var i = 0; i < array_length(advantage); i++){ - var column = { - x1: 436, - y1: 250, - w: 100, - h: 20, - } - column.x2 = column.x1 + column.w; - column.y2 = column.y1 + column.h; - var disable = 0; - if (advantage[i]!=""){ - var adv_name = advantage[i]; - //columns of 14, shift the left boarder across - if(i >= 15 && i <29) {column.x1 = 670; column.x2 = column.x1 + column.w;}; - if(i >= 29 && i <42) {column.x1 = 904; column.x2 = column.x1 + column.w;}; - draw_set_color(38144);draw_set_alpha(1); - if (array_contains(adv, adv_name)) then draw_set_alpha(0.5); - if (adv_name="Psyker Abundance" && array_contains(dis, "Psyker Intolerant")){disable=1;draw_set_alpha(0.5);} - if (adv_name="Reverent Guardians"&& array_contains(dis, "Suspicious")){disable=1;draw_set_alpha(0.5);} - if (adv_name="Tech-Brothers" && array_contains(dis, "Tech-Heresy")){disable=1;draw_set_alpha(0.5);} - - var gap = (((i-1)%14) * column.h); - draw_text(column.x1,column.y1+gap,string_hash_to_newline(adv_name)); - - // Cancel button - if (scr_hit(column.x1,column.y1+gap,column.x1+string_width(string_hash_to_newline(adv_name)),column.y1+column.h+gap)) and (cooldown<=0) and (mouse_left>=1) and (adv_name="Cancel"){ - cooldown=8000;popup=""; - } - // Tooltips - if (scr_hit(column.x1,column.y1+gap,column.x1+string_width(string_hash_to_newline(adv_name)),column.y1+column.h+gap)){ - tooltip=adv_name;tooltip2=advantage_tooltip[i];draw_set_color(c_white);draw_set_alpha(0.2); - draw_text(column.x1,column.y1+gap,string_hash_to_newline(adv_name)); - } - //Click on advantage - if (scr_hit(column.x1,column.y1+gap,column.x1+string_width(string_hash_to_newline(adv_name)),column.y1+column.h+gap)) and (cooldown<=0) and (mouse_left>=1) and (array_contains(adv, adv_name) == false){ - if (disable=0){ - cooldown=8000; - adv[temp]=adv_name; - adv_num[temp]=i; - popup=""; - points+=20; - } - }} - }} - - if (popup="disadvantages"){ - draw_set_font(fnt_40k_30b);draw_set_halign(fa_center); - draw_text_transformed(800,211,string_hash_to_newline("Select a Disadvantage"),0.6,0.6,0); - draw_set_font(fnt_40k_14b);draw_set_halign(fa_left); - for(var i = 0; i < array_length(disadvantage); i++){ - var column = { - x1: 436, - y1: 250, - w: 100, - h: 20, - } - column.x2 = column.x1 + column.w; - column.y2 = column.y1 + column.h; - var disable = 0; - if (disadvantage[i]!=""){ - var dis_name = disadvantage[i]; - //columns of 14, shift the left boarder across and leave a gap at the top on cols 2 & 3 - if(i >= 15 && i <29) {column.x1 = 670; column.x2 = column.x1 + column.w;}; - if(i >= 29 && i <42) {column.x1 = 904; column.x2 = column.x1 + column.w;}; - draw_set_color(38144);draw_set_alpha(1); - if (array_contains(dis, dis_name)) then draw_set_alpha(0.5); - - if (dis_name="Psyker Intolerant") and (array_contains(adv, "Psyker Abundance")){disable=1;draw_set_alpha(0.5);} - if (dis_name="Suspicious") and (array_contains(adv, "Reverent Guardians")){disable=1;draw_set_alpha(0.5);} - if (dis_name="Tech-Heresy") and (array_contains(adv, "Tech-Brothers")){disable=1;draw_set_alpha(0.5);} - if (dis_name="Blood Debt") and (fleet_type=3){disable=1;draw_set_alpha(0.5);} - - var gap = (((i-1)%14) * column.h); - - draw_text(column.x1,column.y1+gap,string_hash_to_newline(dis_name)); - - // Cancel button - if (scr_hit(column.x1,column.y1+gap,column.x1+string_width(string_hash_to_newline(dis_name)),column.y1+column.h+gap)) and (cooldown<=0) and (mouse_left>=1) and (dis_name="Cancel"){ - cooldown=8000;popup=""; - } - //Tooltip - if (scr_hit(column.x1,column.y1+gap,column.x1+string_width(string_hash_to_newline(dis_name)),column.y1+column.h+gap)){tooltip=dis_name;tooltip2=dis_tooltip[i];draw_set_color(c_white);draw_set_alpha(0.2);draw_text(column.x1,column.y1+gap,string_hash_to_newline(dis_name));} - //Click on disadvantage - if (scr_hit(column.x1,column.y1+gap,column.x1+string_width(string_hash_to_newline(dis_name)),column.y1+column.h+gap)) and (cooldown<=0) and (mouse_left>=1) and (array_contains(dis, dis_name) == false){ - if (disable=0){ - cooldown=8000; - dis[temp]=dis_name; - dis_num[temp]=i; - popup=""; - points-=20; - } - }}} - } - if (popup!="") and ((mouse_left>=1) or (mouse_right=1)) and (cooldown<=0){ - if ((mouse_x<445) or (mouse_x>1125) or (mouse_y<200) or (mouse_y>552)) and (popup!="icons"){ - cooldown=8000;popup=""; - } - if ((mouse_x<445) or (mouse_x>1125) or (mouse_y<200) or (mouse_y>719)) and (popup="icons"){ - cooldown=8000;popup=""; - } - } - -} -/* Homeworld, Flagship, Psychic discipline, Aspirant Trial */ - -var yar;yar=0; - -if (slide=3){ - draw_set_color(38144); - draw_set_font(fnt_40k_30b); - draw_set_halign(fa_center); - - tooltip="";tooltip2=""; - obj_cursor.image_index=0; - - draw_text(800,80,string_hash_to_newline(string(chapter))); - - draw_set_color(38144); - draw_line(445,200,1125,200); - draw_line(445,201,1125,201); - draw_line(445,202,1125,202); - - - - - var fleet_type_text = fleet_type==1?"Homeworld":"Flagship"; - draw_text_transformed(644,218,fleet_type_text,0.6,0.6,0); - - var eh,eh2;eh=0;eh2=0;name_bad=0; - - if (homeworld="Lava") then eh=0; - if (homeworld="Desert") then eh=2; - if (homeworld="Forge") then eh=3; - if (homeworld="Hive") then eh=4; - if (homeworld="Death") then eh=5; - if (homeworld="Agri") then eh=6; - if (homeworld="Feudal") then eh=7; - if (homeworld="Temperate") then eh=8; - if (homeworld="Ice") then eh=9; - if (homeworld="Dead") then eh=10; - if (homeworld="Shrine") then eh=16; - if (fleet_type!=1) then eh=15; - - if (fleet_type=1){ - scr_image("planet",eh,580,244,128,128); - // draw_sprite(spr_planet_splash,eh,580,244); - - draw_text_transformed(644,378,string_hash_to_newline(string(homeworld)),0.5,0.5,0); - // draw_text_transformed(644,398,string(homeworld_name),0.5,0.5,0); - if (text_selected!="home_name") or (custom<2) then draw_text_transformed(644,398,string_hash_to_newline(string(homeworld_name)),0.5,0.5,0); - if (custom>1){ - if (text_selected="home_name") and (text_bar>30) then draw_text_transformed(644,398,string_hash_to_newline(string(homeworld_name)),0.5,0.5,0); - if (text_selected="home_name") and (text_bar<=30) then draw_text_transformed(644,398,string_hash_to_newline(string(homeworld_name)+"|"),0.5,0.5,0); - if (scr_text_hit(644,398,true,homeworld_name)){ - obj_cursor.image_index=2; - if (cooldown<=0) and (mouse_left>=1){text_selected="home_name";cooldown=8000;keyboard_string=homeworld_name;} - } - if (text_selected="home_name") then homeworld_name=keyboard_string; - draw_set_alpha(0.75); - draw_rectangle(525,398,760,418,1); - draw_set_alpha(1); - } - - if (custom>1) then draw_sprite_stretched(spr_creation_arrow,0,525,285,32,32);// Left Arrow - if (custom>1) then draw_sprite_stretched(spr_creation_arrow,1,725,285,32,32);// Right Arrow - var planet_types = ["Dead","Ice", "Temperate","Feudal","Shrine","Agri","Death","Hive","Forge","Desert","Lava"]; - var planet_change_allow = (mouse_left>=1) and (cooldown<=0) and (custom>1); - for (var i=0;i1){ - if (text_selected="flagship_name") and (text_bar>30) then draw_text_transformed(644,398,string_hash_to_newline(string(flagship_name)),0.5,0.5,0); - if (text_selected="flagship_name") and (text_bar<=30) then draw_text_transformed(644,398,string_hash_to_newline(string(flagship_name)+"|"),0.5,0.5,0); - if (scr_text_hit(644,398,true,flagship_name)){ - obj_cursor.image_index=2; - if (cooldown<=0) and (mouse_left>=1){ - text_selected="flagship_name"; - cooldown=8000; - keyboard_string=flagship_name; - } - } - if (text_selected="flagship_name") then flagship_name=keyboard_string; - draw_set_alpha(0.75);draw_rectangle(525,398,760,418,1);draw_set_alpha(1); - } - } - - - - - - if (fleet_type!=3){ - if (fleet_type!=1) or (custom<2) then draw_set_alpha(0.5); - yar=0;if (recruiting_exists=1) then yar=1;draw_sprite(spr_creation_check,yar,858,221);yar=0; - if (scr_hit(858,221,858+32,221+32)) and (cooldown<=0) and (mouse_left>=1) and (custom>1) and (fleet_type=1){cooldown=8000;var onceh;onceh=0; - if (recruiting_exists=1) and (onceh=0){recruiting_exists=0;onceh=1;} - if (recruiting_exists=0) and (onceh=0){recruiting_exists=1;onceh=1;} - } - draw_set_alpha(1);draw_text_transformed(644+333,218,string_hash_to_newline("Recruiting World"),0.6,0.6,0); - - if (recruiting_exists=1){ - if (recruiting="Lava") then eh2=0; - if (recruiting="Desert") then eh2=2; - if (recruiting="Forge") then eh2=3; - if (recruiting="Hive") then eh2=4; - if (recruiting="Death") then eh2=5; - if (recruiting="Agri") then eh2=6; - if (recruiting="Feudal") then eh2=7; - if (recruiting="Temperate") then eh2=8; - if (recruiting="Ice") then eh2=9; - if (recruiting="Dead") then eh2=10; - if (recruiting="Shrine") then eh2=16; - - if (custom>1) then draw_sprite_stretched(spr_creation_arrow,0,865,285,32,32);// Left Arrow - if (scr_hit(865,285,865+32,285+32)) and (mouse_left>=1) and (cooldown<=0) and (custom>1){ - var onceh;onceh=0;cooldown=8000; - if (recruiting="Dead") and (onceh=0){recruiting="Ice";onceh=1;} - if (recruiting="Ice") and (onceh=0){recruiting="Temperate";onceh=1;} - if (recruiting="Temperate") and (onceh=0){recruiting="Feudal";onceh=1;} - if (recruiting="Feudal") and (onceh=0){recruiting="Shrine";onceh=1;} - if (recruiting="Shrine") and (onceh=0){recruiting="Agri";onceh=1;} - if (recruiting="Agri") and (onceh=0){recruiting="Death";onceh=1;} - if (recruiting="Death") and (onceh=0){recruiting="Hive";onceh=1;} - if (recruiting="Hive") and (onceh=0){recruiting="Forge";onceh=1;} - if (recruiting="Forge") and (onceh=0){recruiting="Desert";onceh=1;} - if (recruiting="Desert") and (onceh=0){recruiting="Lava";onceh=1;} - if (recruiting="Lava") and (onceh=0){recruiting="Dead";onceh=1;} - } - if (custom>1) then draw_sprite_stretched(spr_creation_arrow,1,1055,285,32,32);// Right Arrow - if (scr_hit(1055,285,1055+32,285+32)) and (mouse_left>=1) and (cooldown<=0) and (custom>1){ - var onceh;onceh=0;cooldown=8000; - if (recruiting="Dead") and (onceh=0){recruiting="Lava";onceh=1;} - if (recruiting="Lava") and (onceh=0){recruiting="Desert";onceh=1;} - if (recruiting="Desert") and (onceh=0){recruiting="Forge";onceh=1;} - if (recruiting="Forge") and (onceh=0){recruiting="Hive";onceh=1;} - if (recruiting="Hive") and (onceh=0){recruiting="Death";onceh=1;} - if (recruiting="Death") and (onceh=0){recruiting="Agri";onceh=1;} - if (recruiting="Agri") and (onceh=0){recruiting="Shrine";onceh=1;} - if (recruiting="Shrine") and (onceh=0){recruiting="Feudal";onceh=1;} - if (recruiting="Feudal") and (onceh=0){recruiting="Temperate";onceh=1;} - if (recruiting="Temperate") and (onceh=0){recruiting="Ice";onceh=1;} - if (recruiting="Ice") and (onceh=0){recruiting="Dead";onceh=1;} - } - - // draw_sprite(spr_planet_splash,eh2,580+333,244); - scr_image("planet",eh2,580+333,244,128,128); - - draw_text_transformed(644+333,378,string_hash_to_newline(string(recruiting)),0.5,0.5,0); - // draw_text_transformed(644+333,398,string(recruiting_name),0.5,0.5,0); - - if (fleet_type=1) and (homeworld_name=recruiting_name) then name_bad=1; - - if (name_bad=1) then draw_set_color(c_red); - if (text_selected!="recruiting_name") or (custom<2) then draw_text_transformed(644+333,398,string_hash_to_newline(string(recruiting_name)),0.5,0.5,0); - if (custom>1){ - if (text_selected="recruiting_name") and (text_bar>30) then draw_text_transformed(644+333,398,string_hash_to_newline(string(recruiting_name)),0.5,0.5,0); - if (text_selected="recruiting_name") and (text_bar<=30) then draw_text_transformed(644+333,398,string_hash_to_newline(string(recruiting_name)+"|"),0.5,0.5,0); - if (scr_text_hit(644+333,398,true,recruiting_name)){ - obj_cursor.image_index=2; - if (cooldown<=0) and (mouse_left>=1){text_selected="recruiting_name";cooldown=8000;keyboard_string=recruiting_name;} - } - if (text_selected="recruiting_name") then recruiting_name=keyboard_string; - draw_set_alpha(0.75);draw_rectangle(525+333,398,760+333,418,1);draw_set_alpha(1); - } - } - } - - if (recruiting_exists=0) and (homeworld_exists=1){ - // draw_sprite(spr_planet_splash,eh,580+333,244); - scr_image("planet",eh,580+333,244,128,128); - - draw_set_alpha(0.5); - draw_text_transformed(644+333,378,string_hash_to_newline(string(homeworld)),0.5,0.5,0); - draw_text_transformed(644+333,398,string_hash_to_newline(string(homeworld_name)),0.5,0.5,0); - draw_set_alpha(1); - } - - - if (scr_hit(575,216,710,242)){ - if (fleet_type!=1){tooltip="Battle Barge";tooltip2="The name of your Flagship Battle Barge.";} - if (fleet_type=1){tooltip="Homeworld";tooltip2="The world that your Chapter's Fortress Monastery is located upon. More civilized worlds are more easily defensible but the citizens may pose a risk or be a nuisance.";} - } - if (scr_hit(895,216,1075,242)){ - tooltip="Recruiting World";tooltip2="The world that your Chapter selects recruits from. More harsh worlds provide recruits with more grit and warrior mentality. If you are a homeworld-based Chapter, you may uncheck 'Recruiting World' to recruit from your homeworld instead."; - } - - draw_line(445,455,1125,455); - draw_line(445,456,1125,456); - draw_line(445,457,1125,457); - - // homeworld_rule=0; - // aspirant_trial=eTrials.BLOODDUEL; - - draw_set_halign(fa_left); - - if (fleet_type=1){ - if (custom<2) then draw_set_alpha(0.5); - draw_text_transformed(445,480,"Homeworld Rule",0.6,0.6,0); - draw_text_transformed(485,512,"Planetary Governer",0.5,0.5,0); - draw_text_transformed(485,544,"Passive Supervision",0.5,0.5,0); - draw_text_transformed(485,576,"Personal Rule",0.5,0.5,0); - - yar=homeworld_rule==1; - draw_sprite(spr_creation_check,yar,445,512); - if (scr_hit(445,512,445+32,512+32)) and (cooldown<=0) and (mouse_left>=1) and (custom>1) and (homeworld_rule!=1){cooldown=8000;homeworld_rule=1;} - if (scr_hit(445,512,670,512+32)){ - tooltip="Planetary Governer"; - tooltip2="Your Chapter's homeworld is ruled by a single Planetary Governer, who does with the planet mostly as they see fit. While heavily influenced by your Astartes the planet is sovereign."; - } - - yar=homeworld_rule==2; - draw_sprite(spr_creation_check,yar,445,544); - if (scr_hit(445,544,445+32,544+32)) and (cooldown<=0) and (mouse_left>=1) and (custom>1) and (homeworld_rule!=2){cooldown=8000;homeworld_rule=2;} - if (scr_hit(445,544,620,544+32)){ - tooltip="Passive Supervision"; - tooltip2="Instead of a Planetary Governer the planet is broken up into many countries or clans. The people are less united but happier, and see your illusive Astartes as semi-divine beings."; - } - - yar=homeworld_rule==3; - draw_sprite(spr_creation_check,yar,445,576); - if (point_and_click([445,576,445+32,576+32])) and (custom>1) and (homeworld_rule!=3){cooldown=8000;homeworld_rule=3;} - if (scr_hit(445,576,670,576+32)){ - tooltip="Planetary Governer"; - tooltip2="You personally take the rule of the Planetary Governer, ruling over your homeworld with an iron fist. Your every word and directive, be they good or bad, are absolute law."; - } - } - - var trial_data = scr_trial_data(); - var current_trial = trial_data[aspirant_trial]; - draw_text_transformed(80,180,"Aspirant Trial",0.6,0.6,0); - draw_text_transformed(110,210,current_trial.name,0.5,0.5,0); - - var asp_info; - asp_info = scr_compile_trial_bonus_string(current_trial); - - draw_text_ext_transformed(100,244,asp_info,64,950,0.5,0.5,0); - - if (scr_hit(50,480,950,510)){ - tooltip="Aspirant Trial"; - tooltip2="A special challenge is needed for Aspirants to be judged worthy of becoming Astartes. After completing the Trial they then become a Neophyte, beginning implantation and training (This can be changed once in game but the chosen trial here will effect the spawn characteristics of your starting marines)."; - } - - if (custom>1){ - draw_sprite_stretched(spr_creation_arrow,0,00,200,32,32); - if (point_and_click([00,200,00+32,200+32]) and (cooldown<=0)){ - var onceh=0;cooldown=8000; - aspirant_trial++; - if (aspirant_trial>=array_length(trial_data)){ - aspirant_trial=0 - } - } - draw_sprite_stretched(spr_creation_arrow,1,38,200,32,32); - - if (point_and_click([38,200,38+32,200+32]) and (mouse_left>=1) and (cooldown<=0)){ - var onceh=0;cooldown=8000; - aspirant_trial--; - if (aspirant_trial<0){ - aspirant_trial = array_length(trial_data)-1; - } - } - } - - - draw_line(445,640,1125,640); - draw_line(445,641,1125,641); - draw_line(445,642,1125,642); - - if (race[100,17]!=0){ - draw_text_transformed(445,665,string_hash_to_newline("Psychic Discipline"),0.6,0.6,0); - if (scr_hit(445,665,620,690)){tooltip="Psychic Discipline";tooltip2="The Psychic Discipline that your psykers will use by default.";} - - var fug,fug2;fug=string_delete(discipline,2,string_length(discipline)); - fug2=string_delete(discipline,1,1);draw_text_transformed(513,697,string_hash_to_newline(string_upper(fug)+string(fug2)),0.5,0.5,0); - - var psy_info;psy_info=""; - if (discipline="default") then psy_info="-Psychic Blasts and Barriers"; - if (discipline="biomancy") then psy_info="-Manipulates Biology to Buff or Heal"; - if (discipline="pyromancy") then psy_info="-Unleashes Blasts and Walls of Flame"; - if (discipline="telekinesis") then psy_info="-Manipulates Gravity to Throw or Shield"; - if (discipline="rune Magick") then psy_info="-Summons Deadly Elements and Feral Spirits"; - draw_text_transformed(533,729,string_hash_to_newline(string(psy_info)),0.5,0.5,0); - - if (custom<2) then draw_set_alpha(0.5); - if (custom=2) then draw_sprite_stretched(spr_creation_arrow,0,437,688,32,32); - if (custom=2) then draw_sprite_stretched(spr_creation_arrow,1,475,688,32,32); - draw_set_alpha(1); - - if (scr_hit(437,688,437+32,688+32)) and (mouse_left>=1) and (cooldown<=0) and (custom>1){ - var onceh;onceh=0;cooldown=8000; - if (discipline="default") and (onceh=0){discipline="rune Magick";onceh=1;} - if (discipline="rune Magick") and (onceh=0){discipline="telekinesis";onceh=1;} - if (discipline="telekinesis") and (onceh=0){discipline="pyromancy";onceh=1;} - if (discipline="pyromancy") and (onceh=0){discipline="biomancy";onceh=1;} - if (discipline="biomancy") and (onceh=0){discipline="default";onceh=1;} - } - if (scr_hit(475,688,475+32,688+32)) and (mouse_left>=1) and (cooldown<=0) and (custom>1){ - var onceh;onceh=0;cooldown=8000; - if (discipline="default") and (onceh=0){discipline="biomancy";onceh=1;} - if (discipline="biomancy") and (onceh=0){discipline="pyromancy";onceh=1;} - if (discipline="pyromancy") and (onceh=0){discipline="telekinesis";onceh=1;} - if (discipline="telekinesis") and (onceh=0){discipline="rune Magick";onceh=1;} - if (discipline="rune Magick") and (onceh=0){discipline="default";onceh=1;} - } - - } -} + draw_set_color(38144); + draw_line(445, 200, 1125, 200); + draw_line(445, 201, 1125, 201); + draw_line(445, 202, 1125, 202); + if (popup == "") { + if (custom < 2) { + draw_set_alpha(0.5); + } + draw_text_transformed(800, 211, string_hash_to_newline("Chapter Type"), 0.6, 0.6, 0); + draw_set_halign(fa_left); + if (scr_hit(516, 242, 674, 266)) { + tooltip = "Homeworld"; + tooltip2 = "Your chapter has a homeworld that they base on. Contained upon it is a massive Fortress Monastery, which provides high levels of defense and automated weapons."; + } + if (scr_hit(768, 242, 866, 266)) { + tooltip = "Fleet Based"; + tooltip2 = "Rather than a homeworld your chapter begins near their recruiting world. The fleet includes a Battle Barge, which serves as a mobile base, and powerful ship."; + } + if (scr_hit(952, 242, 1084, 266)) { + tooltip = "Penitent"; + tooltip2 = "As with Fleet Based, but you must crusade and fight until your penitence meter runs out. Note that recruiting is disabled until then."; + } // Avoiding fights will result in excomunicatus traitorus. + if (custom < 2) { + draw_set_alpha(0.5); + } + yar = 0; + if (fleet_type == 1) { + yar = 1; + } + draw_sprite(spr_creation_check, yar, 519, 239); + yar = 0; + if (scr_hit(519, 239, 519 + 32, 239 + 32) && (cooldown <= 0) && (mouse_left >= 1) && (custom == 2)) { + cooldown = 8000; + if ((points + 20 <= maxpoints) && (fleet_type == 3)) { + points += 20; + fleet_type = 1; + } + if (fleet_type == 2) { + fleet_type = 1; + } + } + draw_text_transformed(551, 239, string_hash_to_newline("Homeworld"), 0.6, 0.6, 0); -/* Livery, Roles */ - - -if (slide=4){ - draw_set_font(fnt_40k_30b); - draw_set_halign(fa_center); - draw_set_alpha(1); - draw_set_color(38144); - - - tooltip="";tooltip2=""; - obj_cursor.image_index=0; - - draw_text_color_simple(800,80,string_hash_to_newline(string(chapter)),38144); - var draw_sprites = [spr_mk7_colors, spr_mk4_colors,spr_mk5_colors,spr_beakie_colors,spr_mk8_colors,spr_mk3_colors, spr_terminator3_colors]; - var draw_hem = [spr_generic_sgt_mk7, spr_generic_sgt_mk4,spr_generic_sgt_mk5,spr_generic_sgt_mk6,spr_generic_sgt_mk8,spr_generic_sgt_mk3, spr_generic_terminator_sgt]; - - var preview_box = { - x1: 444, - y1: 252, - w: 167, - h: 232, - } - preview_box.x2 = preview_box.x1 + preview_box.w; - preview_box.y2 = preview_box.y1 + preview_box.h; - - draw_sprite_stretched(spr_creation_arrow,0,preview_box.x1,preview_box.y1,32,32);// Left Arrow - draw_sprite_stretched(spr_creation_arrow,1,preview_box.x2-32,preview_box.y1,32,32);// Right Arrow - if (point_and_click([preview_box.x1,preview_box.y1,preview_box.x1+32,preview_box.y1+32])){ - test_sprite++; - if (test_sprite==array_length(draw_sprites)) then test_sprite=0; - } - if (point_and_click([preview_box.x2-32,preview_box.y1,preview_box.x2, preview_box.y1+32])){ - test_sprite--; - if (test_sprite<0) then test_sprite=(array_length(draw_sprites)-1); - } - draw_rectangle_color_simple(preview_box.x1,preview_box.y1,preview_box.x2,preview_box.y2,1,38144); - if( shader_is_compiled(sReplaceColor)){ - shader_set(sReplaceColor); - - shader_set_uniform_f_array(colour_to_find1, body_colour_find ); - shader_set_uniform_f_array(colour_to_set1, body_colour_replace ); - shader_set_uniform_f_array(colour_to_find2, secondary_colour_find ); - shader_set_uniform_f_array(colour_to_set2, secondary_colour_replace ); - shader_set_uniform_f_array(colour_to_find3, pauldron_colour_find ); - shader_set_uniform_f_array(colour_to_set3, pauldron_colour_replace ); - shader_set_uniform_f_array(colour_to_find4, lens_colour_find ); - shader_set_uniform_f_array(colour_to_set4, lens_colour_replace ); - shader_set_uniform_f_array(colour_to_find5, trim_colour_find ); - shader_set_uniform_f_array(colour_to_set5, trim_colour_replace ); - shader_set_uniform_f_array(colour_to_find6, pauldron2_colour_find ); - shader_set_uniform_f_array(colour_to_set6, pauldron2_colour_replace ); - shader_set_uniform_f_array(colour_to_find7, weapon_colour_find ); - shader_set_uniform_f_array(colour_to_set7, weapon_colour_replace ); - - //Rejoice! - tester_sprite = draw_sprites[test_sprite]; - tester_helm = draw_hem[test_sprite]; - if (col_special=0) then draw_sprite(tester_sprite,10,preview_box.x1,preview_box.y1 + 8); - if (col_special=1) then draw_sprite(tester_sprite,11,preview_box.x1,preview_box.y1 + 8); - if (col_special>=2) then draw_sprite(tester_sprite,12,preview_box.x1,preview_box.y1 + 8); - - draw_sprite(tester_sprite,col_special,preview_box.x1,preview_box.y1 + 8); - if (col_special<=1){ - draw_sprite(tester_sprite,6,preview_box.x1,preview_box.y1 + 8); - draw_sprite(tester_sprite,8,preview_box.x1,preview_box.y1 + 8); - } - if (col_special>=2){ - draw_sprite(tester_sprite,6,preview_box.x1,preview_box.y1 + 8); - draw_sprite(tester_sprite,9,preview_box.x1,preview_box.y1 + 8); - } - if (trim=0) and (col_special<=1) then draw_sprite(tester_sprite,4,preview_box.x1,preview_box.y1 + 8); - if (trim=0) and (col_special>=2) then draw_sprite(tester_sprite,5,preview_box.x1,preview_box.y1 + 8); - //TODO this can be imprved but for now it's fit for purpose - if (complex_selection=="Sergeant Markers" && complex_livery){ - var sgt_col_1 = complex_livery_data.sgt.helm_primary; - var sgt_col_2 = complex_livery_data.sgt.helm_secondary; - var lens_col = complex_livery_data.sgt.helm_lens; - shader_set_uniform_f_array(colour_to_find1, [30/255,30/255,30/255]); - shader_set_uniform_f(colour_to_set1, col_r[sgt_col_1]/255, col_g[sgt_col_1]/255, col_b[sgt_col_1]/255); - shader_set_uniform_f_array(colour_to_find2, [200/255,0/255,0/255]); - shader_set_uniform_f(colour_to_set2, col_r[sgt_col_2]/255, col_g[sgt_col_2]/255, col_b[sgt_col_2]/255); - shader_set_uniform_f(colour_to_set4, col_r[lens_col]/255, col_g[lens_col]/255, col_b[lens_col]/255); - draw_sprite(tester_helm, complex_depth_selection, preview_box.x1,preview_box.y1 + 8); - } - else if (complex_selection=="Veteran Sergeant Markers" && complex_livery){ - var sgt_col_1 = complex_livery_data.vet_sgt.helm_primary; - var sgt_col_2 = complex_livery_data.vet_sgt.helm_secondary; - var lens_col = complex_livery_data.vet_sgt.helm_lens; - shader_set_uniform_f_array(colour_to_find1, [30/255,30/255,30/255]); - shader_set_uniform_f(colour_to_set1, col_r[sgt_col_1]/255, col_g[sgt_col_1]/255, col_b[sgt_col_1]/255); - shader_set_uniform_f_array(colour_to_find2, [200/255,0/255,0/255]); - shader_set_uniform_f(colour_to_set2, col_r[sgt_col_2]/255, col_g[sgt_col_2]/255, col_b[sgt_col_2]/255); - shader_set_uniform_f(colour_to_set4, col_r[lens_col]/255, col_g[lens_col]/255, col_b[lens_col]/255); - draw_sprite(tester_helm, complex_depth_selection, preview_box.x1,preview_box.y1 + 8); - } - else if (complex_selection=="Captain Markers" && complex_livery){ - var sgt_col_1 = complex_livery_data.captain.helm_primary; - var sgt_col_2 = complex_livery_data.captain.helm_secondary; - var lens_col = complex_livery_data.captain.helm_lens; - shader_set_uniform_f_array(colour_to_find1, [30/255,30/255,30/255]); - shader_set_uniform_f(colour_to_set1, col_r[sgt_col_1]/255, col_g[sgt_col_1]/255, col_b[sgt_col_1]/255); - shader_set_uniform_f_array(colour_to_find2, [200/255,0/255,0/255]); - shader_set_uniform_f(colour_to_set2, col_r[sgt_col_2]/255, col_g[sgt_col_2]/255, col_b[sgt_col_2]/255); - shader_set_uniform_f(colour_to_set4, col_r[lens_col]/255, col_g[lens_col]/255, col_b[lens_col]/255); - draw_sprite(tester_helm, complex_depth_selection, preview_box.x1,preview_box.y1 + 8); - } else if (complex_selection=="Veteran Markers" && complex_livery){ - var sgt_col_1 = complex_livery_data.veteran.helm_primary; - var sgt_col_2 = complex_livery_data.veteran.helm_secondary; - var lens_col = complex_livery_data.veteran.helm_lens; - shader_set_uniform_f_array(colour_to_find1, [30/255,30/255,30/255]); - shader_set_uniform_f(colour_to_set1, col_r[sgt_col_1]/255, col_g[sgt_col_1]/255, col_b[sgt_col_1]/255); - shader_set_uniform_f_array(colour_to_find2, [200/255,0/255,0/255]); - shader_set_uniform_f(colour_to_set2, col_r[sgt_col_2]/255, col_g[sgt_col_2]/255, col_b[sgt_col_2]/255); - shader_set_uniform_f(colour_to_set4, col_r[lens_col]/255, col_g[lens_col]/255, col_b[lens_col]/255); - draw_sprite(tester_helm, complex_depth_selection, preview_box.x1,preview_box.y1 + 8); - } - shader_set_uniform_f_array(colour_to_find1, body_colour_find ); - shader_set_uniform_f_array(colour_to_set1, body_colour_replace ); - shader_set_uniform_f_array(colour_to_find2, secondary_colour_find ); - shader_set_uniform_f_array(colour_to_set2, secondary_colour_replace ); - shader_set_uniform_f_array(colour_to_set4, lens_colour_replace ); - if(tester_sprite == spr_terminator3_colors){ - draw_sprite(spr_weapon_colors,0,444 - 12,252 + 5); - } else { - draw_sprite(spr_weapon_colors,0,444,252); - } - shader_reset(); - - }else{ - draw_text(444,252,string_hash_to_newline("Color swap shader#did not compile")); - } - - draw_set_color(38144);draw_set_halign(fa_left); - draw_text_transformed(580,118,string_hash_to_newline("Battle Cry:"),0.6,0.6,0);draw_set_font(fnt_40k_14b); - if (text_selected!="battle_cry") or (custom<2) then draw_text_ext(580,144,string_hash_to_newline(string(battle_cry)+"!"),-1,580); - if (custom>1){ - if (text_selected="battle_cry") and (text_bar>30) then draw_text_ext(580,144,string_hash_to_newline(string(battle_cry)+"!"),-1,580); - if (text_selected="battle_cry") and (text_bar<=30) then draw_text_ext(580,144,string_hash_to_newline(string(battle_cry)+"|!"),-1,580); - var str_width=max(580,string_width_ext(string_hash_to_newline(battle_cry),-1,580)); - var hei=string_height_ext(string_hash_to_newline(battle_cry),-1,580); - if (scr_hit(580-2,144-2,582+str_width,146+hei)){obj_cursor.image_index=2; - if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="battle_cry";cooldown=8000;keyboard_string=battle_cry;} - } - if (text_selected="battle_cry") then battle_cry=keyboard_string; - draw_rectangle(580-2,144-2,582+580,146+hei,1); - } - - - - - draw_line(445,200,1125,200); - draw_line(445,201,1125,201); - draw_line(445,202,1125,202); - - draw_set_font(fnt_40k_30b); - draw_text_transformed(444,215,string_hash_to_newline("Livelry"),0.6,0.6,0); - var button_alpha = custom < 2 ? 0.5 : 1; - var livery_swap_button = draw_unit_buttons([544,215], complex_livery? "Simple Livery":"Complex Livery",[1,1], 38144,, fnt_40k_14b, button_alpha); - if (point_and_click(livery_swap_button) && custom >= 2){ - complex_livery=!complex_livery; - } - var str,str_width,hei,x8,y8;x8=0;y8=0; - //Dont ask why the pauldron colours are switched i guess duke got confused between left and right at some point - //TODO extract this function somewhere - /*function draw_checkbox (cords, text, main_alpha, checked){ - draw_set_alpha(main_alpha); - yar = col_special==(i+1) ?1:0; - if (custom<2) then draw_set_alpha(0.5); - draw_sprite(spr_creation_check,yar,cur_button.cords[0],cur_button.cords[1]); - if (scr_hit(cur_button.cords[0],cur_button.cords[1],cur_button.cords[0]+32,cur_button.cords[1]+32) and allow_colour_click){ - cooldown=8000; - var onceh=0; - if (col_special=i+1) and (onceh=0){col_special=0;onceh=1;} - if (col_special!=i+1) and (onceh=0){col_special=i+1;onceh=1;} - } - draw_text_transformed(cur_button.cords[0]+30,cur_button.cords[1]+4,cur_button.text,0.4,0.4,0); - }*/ - if (!complex_livery){ - var button_data = [ - { - text : $"Primary : {col[main_color]}", - tooltip:"Primary", - tooltip2:"The main color of your Astartes and their vehicles.", - cords : [620, 252], - }, - { - text : $"Secondary: {col[secondary_color]}", - tooltip:"Secondary", - tooltip2:"The secondary color of your Astartes and their vehicles.", - cords : [620, 287], - }, - { - text : $"Pauldron 1: {col[pauldron2_color]}", - tooltip:"First Pauldron", - tooltip2:"The color of your Astartes' right Pauldron. Normally this Pauldron displays their rank and designation.", - cords : [620, 322], - }, - { - text : $"Pauldron 2: {col[pauldron_color]}", - tooltip:"Second Pauldron", - tooltip2:"The color of your Astartes' left Pauldron. Normally this Pauldron contains the Chapter Insignia.", - cords : [620, 357], - }, - { - text : $"Trim: {col[trim_color]}", - tooltip:"Trim", - tooltip2:"The trim color that appears on the Pauldrons, armour plating, and any decorations.", - cords : [620, 392], - }, - { - text : $"Lens: {col[lens_color]}", - tooltip:"Lens", - tooltip2:"The color of your Astartes' lenss. Most of the time this will be the visor color.", - cords : [620, 427], - }, - { - text : $"Weapon: {col[weapon_color]}", - tooltip:"Weapon", - tooltip2:"The primary color of your Astartes' weapons.", - cords : [620, 462], - } - ] - var button_cords, cur_button; - for (var i=0;i= 2){ - cooldown=8000; - instance_destroy(obj_creation_popup); - var pp=instance_create(0,0,obj_creation_popup); - pp.type=i+1; - } - } - draw_set_color(38144); - var livery_type_options = [ - { - cords : [437,500], - text : $"Breastplate", - }, - { - cords : [554,500], - text : $"Vertical", - }, - { - cords : [662,500], - text : $"Quadrant", - }, - { - cords : [770,500], - text : $"Trim", - } - ] - var yar; - for (var i=0;i=1) and (custom>0) and (cooldown<=0) and (custom=2){ - instance_destroy(obj_creation_popup); - var pp=instance_create(0,0,obj_creation_popup); - pp.type=role_id+100; - cooldown=8000; - } - } - } - } - } else { - var complex_livery_options = ["Sergeant Markers","Veteran Sergeant Markers", "Captain Markers", "Veteran Markers"]; - for (var i=0;i=1) and (!instance_exists(obj_creation_popup))){ - cooldown=8000;var onceh;onceh=0; - if (load_to_ships[0]=1) and (onceh=0){load_to_ships[0]=0;onceh=1;} - if (load_to_ships[0]!=1) and (onceh=0){load_to_ships[0]=1;onceh=1;} - }draw_text_transformed(860+30,645+4+40,string_hash_to_newline("Load to Ships"),0.4,0.4,0); - - yar=0;if (load_to_ships[0]=2) then yar=1;draw_sprite(spr_creation_check,yar,1010,645+40);yar=0; - if (scr_hit(1010,645+40,1150,645+32+40)) and (!instance_exists(obj_creation_popup)){tooltip="Load (Sans Escorts)";tooltip2="Check to have your Astartes automatically loaded into ships, except for Escorts, when the game starts.";} - if (scr_hit(1010,645+40,1020+32,645+32+40)) and (cooldown<=0) and (mouse_left>=1) and (!instance_exists(obj_creation_popup)){ - cooldown=8000;var onceh;onceh=0; - if (load_to_ships[0]=2) and (onceh=0){load_to_ships[0]=0;onceh=1;} - if (load_to_ships[0]!=2) and (onceh=0){load_to_ships[0]=2;onceh=1;} - }draw_text_transformed(1010+30,645+4+40,string_hash_to_newline("Load (Sans Escorts)"),0.4,0.4,0); - - yar=0; - if (load_to_ships[0] > 0){ - if (load_to_ships[1] == 1){ - yar=1; - } - draw_sprite(spr_creation_check,yar,860,645+80);yar=0; - if (scr_hit(860,645+80,1005,645+32+80)) and (!instance_exists(obj_creation_popup)){tooltip="Distribute Scouts";tooltip2="Check to have your Scouts split across ships in the fleet.";} - if (scr_hit(860,645+80,860+32,645+32+80)) and (cooldown<=0) and (mouse_left>=1) and (!instance_exists(obj_creation_popup)){ - cooldown=8000; - var onceh;onceh=0; - load_to_ships[1] = !load_to_ships[1]; - } - draw_text_transformed(860+30,645+4+80,string_hash_to_newline("Distribute Scouts"),0.4,0.4,0); - - yar=0; - if (load_to_ships[2] == 1){ - yar=1; - } - draw_sprite(spr_creation_check,yar,1010,645+80);yar=0; - if (scr_hit(1010,645+80,1150,645+32+80)) and (!instance_exists(obj_creation_popup)){tooltip="Distribute Veterans";tooltip2="Check to have your Veterans split across the fleet.";} - if (scr_hit(1010,645+80,1020+32,645+32+80)) and (cooldown<=0) and (mouse_left>=1) and (!instance_exists(obj_creation_popup)){ - cooldown=8000;var onceh;onceh=0; - if (load_to_ships[2]=0) and (onceh=0){load_to_ships[2]=1;onceh=1;} - if (load_to_ships[2]=1) and (onceh=0){load_to_ships[2]=0;onceh=1;} - } - draw_text_transformed(1010+30,645+4+80,string_hash_to_newline("Distribute Veterans"),0.4,0.4,0); - } - - - - - draw_line(433,535,844,535); - draw_line(433,536,844,536); - draw_line(433,537,844,537); - - if (!instance_exists(obj_creation_popup)){ - - if (scr_hit(540,547,800,725)){tooltip="Advisor Names";tooltip2="The names of your main Advisors. They provide useful information and reports on the divisions of your Chapter.";} - - draw_text_transformed(444,550,string_hash_to_newline("Advisor Names"),0.6,0.6,0); - draw_set_font(fnt_40k_14b); - draw_set_halign(fa_right); - if (race[100,15]!=0) then draw_text(594,575,string_hash_to_newline("Chief Apothecary: ")); - if (race[100,14]!=0) then draw_text(594,597,string_hash_to_newline("High Chaplain: ")); - if (race[100,17]!=0) then draw_text(594,619,string_hash_to_newline("Chief Librarian: ")); - if (race[100,16]!=0) then draw_text(594,641,string_hash_to_newline("Forge Master: ")); - draw_text(594,663,string_hash_to_newline("Master of Recruits: ")); - draw_text(594,685,string_hash_to_newline("Master of the Fleet: ")); - draw_set_halign(fa_left); - - if (race[100,15]!=0){ - draw_set_color(38144);if (hapothecary="") then draw_set_color(c_red); - if (text_selected!="apoth") or (custom<2) then draw_text_ext(600,575,string_hash_to_newline(string(hapothecary)),-1,580); - if (custom>1){ - if (text_selected="capoth") and (text_bar>30) then draw_text_ext(600,575,string_hash_to_newline(string(hapothecary)),-1,580); - if (text_selected="capoth") and (text_bar<=30) then draw_text_ext(600,575,string_hash_to_newline(string(hapothecary)+"|"),-1,580); - var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(hapothecary),-2,580); - if (scr_hit(600,575,785,575+hei)){obj_cursor.image_index=2; - if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="capoth";cooldown=8000;keyboard_string=hapothecary;} - } - if (text_selected="capoth") then hapothecary=keyboard_string; - draw_rectangle(600-1,575-1,785,575+hei,1); - } - } - - if (race[100,14]!=0){ - draw_set_color(38144);if (hchaplain="") then draw_set_color(c_red); - if (text_selected!="chap") or (custom<2) then draw_text_ext(600,597,string_hash_to_newline(string(hchaplain)),-1,580); - if (custom>1){ - if (text_selected="chap") and (text_bar>30) then draw_text_ext(600,597,string_hash_to_newline(string(hchaplain)),-1,580); - if (text_selected="chap") and (text_bar<=30) then draw_text_ext(600,597,string_hash_to_newline(string(hchaplain)+"|"),-1,580); - var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(hchaplain),-2,580); - if (scr_hit(600,597,785,597+hei)){obj_cursor.image_index=2; - if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="chap";cooldown=8000;keyboard_string=hchaplain;} - } - if (text_selected="chap") then hchaplain=keyboard_string; - draw_rectangle(600-1,597-1,785,597+hei,1); - } - } - - if (race[100,17]!=0){ - draw_set_color(38144);if (clibrarian="") then draw_set_color(c_red); - if (text_selected!="libra") or (custom<2) then draw_text_ext(600,619,string_hash_to_newline(string(clibrarian)),-1,580); - if (custom>1){ - if (text_selected="libra") and (text_bar>30) then draw_text_ext(600,619,string_hash_to_newline(string(clibrarian)),-1,580); - if (text_selected="libra") and (text_bar<=30) then draw_text_ext(600,619,string_hash_to_newline(string(clibrarian)+"|"),-1,580); - var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(clibrarian),-2,580); - if (scr_hit(600,619,785,619+hei)){obj_cursor.image_index=2; - if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="libra";cooldown=8000;keyboard_string=clibrarian;} - } - if (text_selected="libra") then clibrarian=keyboard_string; - draw_rectangle(600-1,619-1,785,619+hei,1); - } - } - - if (race[100,16]!=0){ - draw_set_color(38144);if (fmaster="") then draw_set_color(c_red); - if (text_selected!="forge") or (custom<2) then draw_text_ext(600,641,string_hash_to_newline(string(fmaster)),-1,580); - if (custom>1){ - if (text_selected="forge") and (text_bar>30) then draw_text_ext(600,641,string_hash_to_newline(string(fmaster)),-1,580); - if (text_selected="forge") and (text_bar<=30) then draw_text_ext(600,641,string_hash_to_newline(string(fmaster)+"|"),-1,580); - var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(fmaster),-2,580); - if (scr_hit(600,641,785,641+hei)){obj_cursor.image_index=2; - if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="forge";cooldown=8000;keyboard_string=fmaster;} - } - if (text_selected="forge") then fmaster=keyboard_string; - draw_rectangle(600-1,641-1,785,641+hei,1); - } - } - - draw_set_color(38144);if (recruiter="") then draw_set_color(c_red); - if (text_selected!="recr") or (custom<2) then draw_text_ext(600,663,string_hash_to_newline(string(recruiter)),-1,580); - if (custom>1){ - if (text_selected="recr") and (text_bar>30) then draw_text_ext(600,663,string_hash_to_newline(string(recruiter)),-1,580); - if (text_selected="recr") and (text_bar<=30) then draw_text_ext(600,663,string_hash_to_newline(string(recruiter)+"|"),-1,580); - var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(recruiter),-2,580); - if (scr_hit(600,663,785,663+hei)){obj_cursor.image_index=2; - if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="recr";cooldown=8000;keyboard_string=recruiter;} - } - if (text_selected="recr") then recruiter=keyboard_string; - draw_rectangle(600-1,663-1,785,663+hei,1); - } - - draw_set_color(38144);if (admiral="") then draw_set_color(c_red); - if (text_selected!="admi") or (custom<2) then draw_text_ext(600,685,string_hash_to_newline(string(admiral)),-1,580); - if (custom>1){ - if (text_selected="admi") and (text_bar>30) then draw_text_ext(600,685,string_hash_to_newline(string(admiral)),-1,580); - if (text_selected="admi") and (text_bar<=30) then draw_text_ext(600,685,string_hash_to_newline(string(admiral)+"|"),-1,580); - var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(admiral),-2,580); - if (scr_hit(600,685,785,685+hei)){obj_cursor.image_index=2; - if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="admi";cooldown=8000;keyboard_string=admiral;} - } - if (text_selected="admi") then admiral=keyboard_string; - draw_rectangle(600-1,685-1,785,685+hei,1); - } - - - - } - - -} + yar = 0; + if (fleet_type == 2) { + yar = 1; + } + draw_sprite(spr_creation_check, yar, 771, 239); + yar = 0; + if (scr_hit(771, 239, 771 + 32, 239 + 32) && (cooldown <= 0) && (mouse_left >= 1) && (custom == 2)) { + cooldown = 8000; + if ((points + 20 <= maxpoints) && (fleet_type == 3)) { + points += 20; + fleet_type = 2; + } + if (fleet_type == 1) { + fleet_type = 2; + } + } + draw_text_transformed(804, 239, string_hash_to_newline("Fleet Based"), 0.6, 0.6, 0); -/* Gene Seed Mutations, Disposition */ - - -if (slide=5){ - draw_set_color(38144); - draw_set_font(fnt_40k_30b); - draw_set_halign(fa_center); - draw_set_alpha(1); - - tooltip="";tooltip2=""; - obj_cursor.image_index=0; - - draw_text(800,80,string_hash_to_newline(string(chapter))); - - - draw_set_color(38144);draw_set_halign(fa_left); - draw_text_transformed(580,118,string_hash_to_newline("Successor Chapters: "+string(successors)),0.6,0.6,0); - draw_set_font(fnt_40k_14b); - - draw_rectangle(445, 200, 1125, 202, true); - - draw_set_font(fnt_40k_30b); - draw_text_transformed(503,210,string_hash_to_newline("Gene-Seed Mutations"),0.6,0.6,0); - if (mutations>mutations_selected) then draw_text_transformed(585,230,$"Select {mutations-mutations_selected} More",0.5,0.5,0); - - var x1,y1,spac=34; - - if (custom<2) then draw_set_alpha(0.5); - var mutations_defects = [ - { - t_tip :"Anemic Preomnor", - t_tip2: "Your Astartes lack the detoxifying gland called the Preomnor- they are more susceptible to poisons and toxins.", - data : preomnor, - mutation_points : 1, - }, - { - t_tip :"Disturbing Voice", - t_tip2: "Your Astartes have a voice like a creaking door or a rumble. Decreases Imperium and Imperial Guard disposition.", - data : voice, - mutation_points : 1, - disposition:[[eFACTION.Imperium,-8]], - }, - { - t_tip :"Doomed", - t_tip2: "Your Chapter cannot make more Astartes until enough research is generated. Counts as four mutations.", - data : doomed, - mutation_points : 4, - disposition:[[eFACTION.Imperium,-8],[6,8]], - }, - { - t_tip :"Faulty Lyman's Ear", - t_tip2: "Lacking a working Lyman's ear, all deep-striked Astartes recieve moderate penalties to both attack and defense.", - data : lyman, - mutation_points : 1, - }, - { - t_tip :"Hyper-Stimulated Omophagea", - t_tip2: "After every battle the Astartes have a chance to feast upon their fallen enemies, or seldom, their allies.", - data : omophagea, - mutation_points : 1, - }, - { - t_tip :"Hyperactive Ossmodula", - t_tip2: "Instead of wound tissue bone is generated; Apothecaries must spend twice the normal time healing your Astartes.", - data : ossmodula, - mutation_points : 1, - }, - { - t_tip :"Lost Zygote", - t_tip2: "One of the Zygotes is faulty or missing. The Astartes only have one each and generate half the normal Gene-Seed.", - data : zygote, - mutation_points : 2, - }, - { - t_tip :"Inactive Sus-an Membrane", - t_tip2: "Your Astartes do not have a Sus-an Membrane; they cannot enter suspended animation and recieve more casualties as a result.", - data : membrane, - mutation_points : 1, - }, - { - t_tip :"Missing Betchers Gland", - t_tip2: "Your Astartes cannot spit acid, and as a result, have slightly less attack in melee combat.", - data : betchers, - mutation_points : 1, - }, - { - t_tip :"Mutated Catalepsean Node", - t_tip2: "Your Astartes have reduced awareness when tired. Slightly less attack in ranged and melee combat.", - data : catalepsean, - mutation_points : 1, - }, - { - t_tip :"Oolitic Secretions", - t_tip2: "Either by secretions or radiation, your Astartes have an unusual or strange skin color. Decreases disposition.", - data : secretions, - mutation_points : 1, - disposition:[[eFACTION.Imperium,-8]], - }, - { - t_tip :"Oversensitive Occulobe", - t_tip2: "Your Astartes are no longer immune to stun grenades, bright lights, and have a massive penalty during morning battles.", - data : occulobe, - mutation_points : 1, - disposition:[[eFACTION.Imperium,-8]], - }, - { - t_tip :"Rampant Mucranoid", - t_tip2: "Your Astartes' Mucranoid cannot be turned off; the slime lowers most dispositions and occasionally damages their armour.", - data : mucranoid, - mutation_points : 1, - disposition:[[1,-4],[eFACTION.Imperium,-8],[3,-4],[4,-4],[5,-4],[6,-4]], - }, - ] - x1=450; - y1=260; - for (var i=0;imutations_selected){ - mutation_data.data=1; - mutations_selected+=mutation_data.mutation_points; - if (struct_exists(mutation_data, "disposition")){ - for (var s=0;s0) then draw_rectangle(655,552,655+(disposition[2]*4.95),567,0); - if (disposition[3]>0) then draw_rectangle(655,552+25,655+(disposition[3]*4.95),567+25,0); - if (disposition[5]>0) then draw_rectangle(655,552+50,655+(disposition[5]*4.95),567+50,0); - if (disposition[4]>0) then draw_rectangle(655,552+75,655+(disposition[4]*4.95),567+75,0); - if (disposition[1]>0) and (founding!=0) then draw_rectangle(655,552+100,655+(disposition[1]*4.95),567+100,0); - if (disposition[6]>0) then draw_rectangle(655,552+125,655+(disposition[6]*4.95),567+125,0); - - -} + yar = 0; + if (fleet_type == 3) { + yar = 1; + } + draw_sprite(spr_creation_check, yar, 958, 239); + yar = 0; + if (scr_hit(958, 239, 958 + 32, 239 + 32) && (cooldown <= 0) && (mouse_left >= 1) && (custom == 2)) { + if (fleet_type != 3) { + points -= 20; + } + fleet_type = 3; + cooldown = 8000; + } + draw_text_transformed(990, 239, string_hash_to_newline("Penitent"), 0.6, 0.6, 0); + draw_set_alpha(1); + + draw_line(445, 289, 1125, 289); + draw_line(445, 290, 1125, 290); + draw_line(445, 291, 1125, 291); + + draw_set_halign(fa_center); + draw_text_transformed(800, 301, string_hash_to_newline("Chapter Stats"), 0.6, 0.6, 0); + draw_set_halign(fa_right); + + draw_text_transformed(617, 332, $"Strength ({strength})", 0.5, 0.5, 0); + draw_text_transformed(617, 387, $"Cooperation ({cooperation})", 0.5, 0.5, 0); + draw_text_transformed(617, 442, $"GeneSeed Purity ({purity})", 0.5, 0.5, 0); + draw_text_transformed(617, 497, $"GeneSeed Stability ({stability})", 0.5, 0.5, 0); + var arrow_buttons_controls = [strength, cooperation, purity, stability]; + for (var i = 0; i < 4; i++) { + if (custom == 2) { + draw_sprite_stretched(spr_arrow, 0, 625, 325 + (i * 55), 32, 32); + } + if (scr_hit(625, 325 + (i * 55), 657, 357 + (i * 55))) { + obj_cursor.image_index = 1; + if ((cooldown <= 0) && (custom == 2) && (arrow_buttons_controls[i] > 1) && (mouse_left >= 1)) { + arrow_buttons_controls[i] -= 1; + points -= 10; + cooldown = 8000; + } + } + if (custom == 2) { + draw_sprite_stretched(spr_arrow, 1, 1135, 325 + (i * 55), 32, 32); + } + if (scr_hit(1135, 325 + (i * 55), 1167, 357 + (i * 55))) { + obj_cursor.image_index = 1; + if ((cooldown <= 0) && (custom == 2) && (arrow_buttons_controls[i] < 10) && (points + 10 <= maxpoints) && (mouse_left >= 1)) { + arrow_buttons_controls[i] += 1; + points += 10; + cooldown = 8000; + } + } + draw_rectangle(668, 330 + (i * 55), 1125, 351 + (i * 55), 1); + draw_rectangle(668, 330 + (i * 55), 668 + (arrow_buttons_controls[i] * 45.7), 351 + (i * 55), 0); + } + strength = arrow_buttons_controls[0]; + cooperation = arrow_buttons_controls[1]; + purity = arrow_buttons_controls[2]; + stability = arrow_buttons_controls[3]; + + if (scr_hit(532, 325, 1166, 357)) { + tooltip = "Strength"; + tooltip2 = "How many companies your chapter begins with. For every score below five a company will be removed; conversely, each score higher grants 50 additional astartes."; + } + if (scr_hit(486, 380, 1166, 412)) { + tooltip = "Cooperation"; + tooltip2 = "How diplomatic your chapter is. A low score will lower starting dispositions of Imperial factions and make disposition increases less likely to occur."; + } + if (scr_hit(442, 435, 1166, 467)) { + tooltip = "Purity"; + tooltip2 = "A measure of how pure and mutation-free your chapter's gene-seed is. A perfect score means no mutations must be chosen. The lower the score, the more mutations."; + } + if (scr_hit(423, 490, 1166, 522)) { + tooltip = "Stability"; + tooltip2 = "A measure of how easily new mutations and corruption can occur with your chapter-gene seed. A perfect score makes the gene-seed almost perfectly stable."; + } + } -/* Chapter Master */ - -if (slide=6){ - draw_set_color(38144); - draw_set_font(fnt_40k_30b); - draw_set_halign(fa_center); - draw_set_alpha(1);var yar;yar=0; - - tooltip="";tooltip2=""; - obj_cursor.image_index=0; - - - - draw_set_color(38144);draw_set_halign(fa_left); - draw_text_transformed(580,100,string_hash_to_newline("Chapter Master Name: "),0.9,0.9,0);draw_set_font(fnt_40k_14b); - - - if (text_selected!="cm") or (custom=0) then draw_text_ext(580,144,string_hash_to_newline(string(chapter_master_name)),-1,580); - if (custom>0) and (restarted=0){ - if (text_selected="cm") and (text_bar>30) then draw_text(580,144,string_hash_to_newline(string(chapter_master_name))); - if (text_selected="cm") and (text_bar<=30) then draw_text(580,144,string_hash_to_newline(string(chapter_master_name)+"|")); - var str_width,hei;str_width=max(400,string_width(string_hash_to_newline(chapter_master_name)));hei=string_height(string_hash_to_newline(chapter_master_name)); - if (scr_hit(580-2,144-2,582+str_width,146+hei)){obj_cursor.image_index=2; - if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="cm";cooldown=8000;keyboard_string=chapter_master_name;} - } - if (text_selected="cm") then chapter_master_name=keyboard_string; - draw_rectangle(580-2,144-2,582+400,146+hei,1); - } - - draw_line(445,200,1125,200); - draw_line(445,201,1125,201); - draw_line(445,202,1125,202); - - draw_set_font(fnt_40k_30b); - draw_text_transformed(444,215,string_hash_to_newline("Select Two Weapons"),0.6,0.6,0); - draw_text_transformed(444,240,string_hash_to_newline("Melee"),0.6,0.6,0); - draw_text_transformed(800,240,string_hash_to_newline("Ranged"),0.6,0.6,0); - - - var x6,y6,spac; - var melee_choice_order = 0; - var melee_choice_weapon = ""; - x6=444;y6=265;spac=25; - if (custom=0) or (restarted>0) then draw_set_alpha(0.5); - - repeat(8){ - melee_choice_order+=1; - if (melee_choice_order=1) then melee_choice_weapon="Twin Power Fists"; - if (melee_choice_order=2) then melee_choice_weapon="Twin Lightning Claws"; - if (melee_choice_order=3) then melee_choice_weapon="Relic Blade"; - if (melee_choice_order=4) then melee_choice_weapon="Thunder Hammer"; - if (melee_choice_order=5) then melee_choice_weapon="Power Sword"; - if (melee_choice_order=6) then melee_choice_weapon="Power Axe"; - if (melee_choice_order=7) then melee_choice_weapon="Eviscerator"; - if (melee_choice_order=8) then melee_choice_weapon="Force Staff"; - - yar=0;if (chapter_master_melee=melee_choice_order) then yar=1;draw_sprite(spr_creation_check,yar,x6,y6);yar=0; - if (scr_hit(x6,y6,x6+32,y6+32)) and (cooldown<=0) and (mouse_left>=1) and (custom>0) and (restarted=0) and (!instance_exists(obj_creation_popup)){ - cooldown=8000;var onceh;onceh=0; - if (chapter_master_melee=melee_choice_order) and (onceh=0){chapter_master_melee=0;onceh=1;} - if (chapter_master_melee!=melee_choice_order) and (onceh=0){chapter_master_melee=melee_choice_order;onceh=1;} - } - draw_text_transformed(x6+30,y6+4,string_hash_to_newline(melee_choice_weapon),0.4,0.4,0); - y6+=spac; - } - - x6=800;y6=265; - var ranged_choice_order = 0; - var ranged_choice_weapon = ""; - var ranged_options = ["","Boltstorm Gauntlet","Infernus Pistol","Plasma Pistol","Plasma Gun","Master Crafted Heavy Bolter","Master Crafted Meltagun","Storm Shield",""]; - if (array_contains([1, 2, 7], chapter_master_melee)){ - draw_set_alpha(0.5); - chapter_master_ranged = 1; - } - repeat(7){ - ranged_choice_order += 1; - yar=0; - if (chapter_master_ranged=ranged_choice_order) then yar=1; - draw_sprite(spr_creation_check,yar,x6,y6); - yar=0; - if point_and_click([x6,y6,x6+32,y6+32]) and (custom>0) and (restarted=0) and (!instance_exists(obj_creation_popup)) and (!array_contains([1, 2, 7], chapter_master_melee)){ - cooldown=8000; - var onceh=0; - if (chapter_master_ranged=ranged_choice_order) {chapter_master_ranged=0;} - else if (chapter_master_ranged!=ranged_choice_order) {chapter_master_ranged=ranged_choice_order;} - } - draw_text_transformed(x6+30,y6+4,ranged_options[ranged_choice_order],0.4,0.4,0); - y6+=spac; - } - - draw_set_alpha(1); - - draw_line(445,490,1125,490); - draw_line(445,491,1125,491); - draw_line(445,492,1125,492); - - draw_set_font(fnt_40k_30b); - // draw_text_transformed(444,505,"Select Speciality",0.6,0.6,0); - draw_set_halign(fa_center); - - var psy_intolerance = array_contains(dis, "Psyker Intolerant"); - if (chapter_master_specialty=3) and ((race[100,17]=0) or (psy_intolerance)) then chapter_master_speciality=choose(1,2); - x6=474;y6=500;h=0;it=""; - var leader_types = [ - ["",""], - ["Born Leader","You always know the right words to inspire your men or strike doubt in the hearts of the enemy. Increases Disposition and Grants a +10% Requisition Income Bonus."], - ["Champion","Even before your rise to Chapter Master you were a renowned warrior, nearly without compare. Increases Chapter Master Experience, Melee Damage, and Ranged Damage."], - ["Psyker","The impossible is nothing to you; despite being a Psyker you have slowly risen to lead a Chapter. Chapter Master gains every Power within the chosen Discipline."], - ] - repeat(3){h+=1; - var cur_leader_type = leader_types[h]; - draw_set_alpha(1); - var nope = (h=3) and ((race[100,17]=0) or (psy_intolerance)); - if (nope) then draw_set_alpha(0.5); - if (custom<2) or (restarted>0) then draw_set_alpha(0.5); - - // draw_sprite(spr_cm_specialty,h-1,x6,y6); - scr_image("commander",h-1,x6,y6,162,208); - - draw_text_transformed(x6+81,y6+214,cur_leader_type[0],0.5,0.5,0); - - draw_sprite(spr_creation_check,chapter_master_specialty==h,x6,y6+214); - - - if (scr_hit(x6,y6+214,x6+32,y6+32+214)) and (cooldown<=0) and (mouse_left>=1) and (custom>1) and (restarted=0) and (nope=0){ - cooldown=8000; - var onceh=0; - if (chapter_master_specialty!=h) and (onceh=0){chapter_master_specialty=h;onceh=1;} - } - if (scr_hit(x6,y6+214,x6+162,y6+234)) and (nope=0){ - tooltip = cur_leader_type[0]; - tooltip2= cur_leader_type[1] - } - - x6+=240;draw_set_alpha(1); - - } - - - //adds "Save Chapter" button if custom chapter - - if(custom>0){ - - draw_rectangle(1000,135,1180,170,1) - draw_text_transformed(1090,140,string("Save Chapter"),0.6,0.6,0);draw_set_font(fnt_40k_14b); - if (scr_hit(1000,135,1180,170)) { - tooltip2="Click to save your chapter"; - tooltip= "Do you want to save your chapter?" - - if (mouse_left>=1){ - savechapter(); - - - tooltip2="Chapter Saved!"; - tooltip= "Do you want to save your chapter?"} - } - - - - - - - + if (popup != "icons") { + draw_rectangle(445, 551, 1125, 553, 0); + } + + if ((popup != "") || (custom < 2)) { + draw_set_alpha(0.5); + } + + if (popup != "icons") { + var advantage_click = mouse_left >= 1 && cooldown <= 0 && custom > 1; + draw_set_halign(fa_left); + draw_set_font(fnt_40k_30b); + draw_text_transformed(436, 564, "Chapter Advantages", 0.5, 0.5, 0); + draw_set_font(fnt_40k_14); + var adv_txt = {x1: 436, y1: 570, w: 204, h: 20}; + adv_txt.x2 = adv_txt.x1 + adv_txt.w; + adv_txt.y2 = adv_txt.y1 + adv_txt.h; + var max_advantage_count = 8; + for (i = 1; i <= max_advantage_count; i++) { + var draw_string = adv_num[i] == 0 ? "[+]" : "[-] " + adv[i]; + draw_text(adv_txt.x1, adv_txt.y1 + (i * adv_txt.h), draw_string); + if (scr_hit(adv_txt.x1, adv_txt.y1 + (i * adv_txt.h), adv_txt.x2, adv_txt.y2 + (i * adv_txt.h))) { + if ((points >= maxpoints) && (adv_num[i] == 0) && (popup == "") && (custom > 1)) { + tooltip = "Insufficient Points"; + tooltip2 = "Add disadvantages or decrease Chapter Stats"; + } + + if (adv_num[i] != 0) { + var cur_adv = obj_creation.all_advantages[adv_num[i]]; + tooltip = $"{cur_adv.name} ({cur_adv.points} Points)"; + tooltip2 = cur_adv.description; + } + if (advantage_click) { + if ((points < maxpoints) && (adv_num[i] == 0) && (popup == "")) { + popup = "advantages"; + cooldown = 8000; + temp = i; + } + var removable = false; + if (i == max_advantage_count && adv_num[i] > 0) { + removable = true; + } else if (adv_num[i] > 0 && adv_num[i + 1] == 0) { + removable = true; + } + if ((mouse_x <= 456) && removable) { + var cur_ad = obj_creation.all_advantages[adv_num[i]]; + cur_ad.remove(i); + + cooldown = 8000; + } + } + } + } + draw_set_font(fnt_40k_30b); + draw_text_transformed(810, 564, "Chapter Disadvantages", 0.5, 0.5, 0); + draw_set_font(fnt_40k_14); + + var dis_txt = {x1: 810, y1: 570, w: 204, h: 20}; + dis_txt.x2 = dis_txt.x1 + dis_txt.w; + dis_txt.y2 = dis_txt.y1 + dis_txt.h; + var max_disadvantage_count = 8; + for (var slot = 1; slot <= max_disadvantage_count; slot++) { + var draw_string = dis_num[slot] == 0 ? "[+]" : "[-] " + dis[slot]; + draw_text(dis_txt.x1, dis_txt.y1 + (slot * dis_txt.h), draw_string); + if (scr_hit(dis_txt.x1, dis_txt.y1 + (slot * dis_txt.h), dis_txt.x2, dis_txt.y2 + (slot * dis_txt.h))) { + if (dis_num[slot] != 0) { + tooltip = obj_creation.all_disadvantages[dis_num[slot]].name; + tooltip2 = obj_creation.all_disadvantages[dis_num[slot]].description; + } + if (advantage_click) { + if ((dis_num[slot] == 0) && (popup == "")) { + popup = "disadvantages"; + cooldown = 8000; + temp = slot; + } + var removable = false; + if (slot == max_disadvantage_count && dis_num[slot] > 0) { + removable = true; + } else if (dis_num[slot] > 0 && dis_num[slot + 1] == 0) { + removable = true; + } + var cur_dis = obj_creation.all_disadvantages[dis_num[slot]]; + if ((mouse_x <= 830) && removable && (points + cur_dis.points <= maxpoints)) { + var cur_dis = obj_creation.all_disadvantages[dis_num[slot]]; + cur_dis.remove(slot); + + cooldown = 8000; + } + } + } + } + draw_set_alpha(1); + if (scr_hit(436, 564, 631, 583)) { + tooltip = "Chapter Advantages"; + tooltip2 = "Advantages cost points, and improve the performance of your chapter in a specific domain. You can only have 1 trait of the same category, shown in brackets."; + } + if (scr_hit(810, 564, 1030, 583)) { + tooltip = "Chapter Disadvantages"; + tooltip2 = "Disadvantages grant additional points, and penalize the performance of your chapter. You can only have 1 trait of the same category, shown in brackets."; + } + } else if (popup == "icons") { + draw_set_alpha(1); + draw_set_color(0); + draw_rectangle(450, 206, 1144, 711, 0); + + draw_set_color(38144); + draw_line(445, 727, 1125, 727); + draw_line(445, 728, 1125, 728); + draw_line(445, 729, 1125, 729); + + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); + draw_text_transformed(800, 211, "Select an Icon", 0.6, 0.6, 0); + draw_text_transformed(800, 687, "Cancel", 0.6, 0.6, 0); + + var cw, ch; + cw = string_width("Cancel") * 0.6; + ch = string_height("Cancel") * 0.6; + + if (scr_hit(800, 687, 800 + cw, 687 + ch)) { + draw_set_color(c_white); + draw_set_alpha(0.25); + draw_text_transformed(800, 687, string_hash_to_newline("Cancel"), 0.6, 0.6, 0); + draw_set_color(38144); + draw_set_alpha(1); + + if ((mouse_left == 1) && (cooldown <= 0)) { + cooldown = 8000; + popup = ""; + } + } + + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_left); + + // repeat here + + var i, ic, x3, y3, row; + i = 0; + ic = icons_top - 1; + x3 = 445 - 110; + y3 = 245; + row = 0; + + repeat (24) { + i += 1; + ic += 1; + row += 1; + + if (row == 7) { + row = 1; + x3 = 445 - 110; + y3 += 110; + } + + x3 += 110; + if (ic <= total_icons) { + //ic starts at 1, normal icons = 22 + if (ic < global.normal_icons_count) { + scr_image("creation/chapters/icons", ic, x3, y3, 96, 96); + } + if ((ic >= global.normal_icons_count) && (ic < normal_and_builtin)) { + draw_sprite_stretched(spr_icon_chapters, ic - global.normal_icons_count, x3, y3, 96, 96); + } + if ((ic >= normal_and_builtin) && (obj_cuicons.spr_custom[ic - normal_and_builtin] > 0) && (obj_cuicons.spr_custom_icon[ic - normal_and_builtin] != -1)) { + draw_sprite_stretched(obj_cuicons.spr_custom_icon[ic - normal_and_builtin], 0, x3, y3, 96, 96); + } + + // highlight on hover + if (scr_hit(x3, y3, x3 + 96, y3 + 96)) { + draw_set_blend_mode(bm_add); + draw_set_alpha(0.25); + draw_set_color(16119285); + // if (ic<=20) then draw_sprite_stretched(spr_icon,ic,x3,y3,96,96); + if (ic < global.normal_icons_count) { + scr_image("creation/chapters/icons", ic, x3, y3, 96, 96); + } + if ((ic >= global.normal_icons_count) && (ic < normal_and_builtin)) { + draw_sprite_stretched(spr_icon_chapters, ic - global.normal_icons_count, x3, y3, 96, 96); + } + if ((ic >= normal_and_builtin) && (obj_cuicons.spr_custom[ic - normal_and_builtin] > 0) && (obj_cuicons.spr_custom_icon[ic - normal_and_builtin] != -1)) { + draw_sprite_stretched(obj_cuicons.spr_custom_icon[ic - normal_and_builtin], 0, x3, y3, 96, 96); + } + draw_set_blend_mode(bm_normal); + draw_set_alpha(1); + draw_set_color(38144); + + if ((mouse_left == 1) && (cooldown <= 0)) { + cooldown = 8000; + popup = ""; + icon = ic; + icon_name = ""; + scr_icon(""); + if (ic <= global.normal_icons_count) { + global.chapter_icon_sprite = obj_img.image_cache[$ "creation/chapters/icons"][ic]; + global.chapter_icon_frame = 0; + global.chapter_icon_path = $"creation/chapters/icons"; + global.chapter_icon_filename = ic; + } + if (ic > normal_and_builtin) { + var cuicon_idx = ic - normal_and_builtin; + global.chapter_icon_sprite = sprite_duplicate(obj_cuicons.spr_custom_icon[cuicon_idx]); + global.chapter_icon_frame = 0; + obj_creation.icon_name = string_concat("custom", cuicon_idx); + } + if (ic > global.normal_icons_count && ic <= normal_and_builtin) { + global.chapter_icon_sprite = spr_icon_chapters; + global.chapter_icon_frame = ic - global.normal_icons_count; + custom_icon = ic - global.normal_icons_count; + } + // show_debug_message($"ic {ic} custom_icon {custom_icon} icon {icon}") + // show_message(string(icon_name)); + } + } + + // draw_set_color(c_orange); + // draw_text(x3+48,y3+64,string(ic)); + draw_set_color(38144); + } + } + + var x1, x2, x3, x4, x6, y1, y2, y3, y4, y6, bs, see_size, total_max, current, top; + + x1 = 1111; + y1 = 245; + x2 = 1131; + y2 = 671; + bs = 245; + draw_rectangle(x1, y1, x2, y2, 1); + + total_max = 77 + global.custom_icons; + see_size = (671 - 245) / total_max; + + x3 = 1111; + x4 = 1131; + current = icons_top; + top = current * see_size; + y3 = top; + y4 = y3 + (24 * see_size) - see_size; + + if (scrollbar_engaged == 0) { + draw_rectangle(x3, y3 + bs, x4, y4 + bs, 0); + } + + if (scrollbar_engaged > 0) { + y3 = mouse_y - scrollbar_engaged; + // y3=mouse_y-scrollbar_engaged + y4 = y3 + (24 * see_size); + + if (y3 < y1) { + y3 = y1; + y4 = y3 + (24 * see_size); + } + if (y4 > y2) { + y4 = y2; + y3 = y2 - (24 * see_size); + } + + draw_rectangle(x3, y3, x4, y4, 0); + } + + if (scr_hit(x3, y3 + bs, x4, y4 + bs) && (cooldown <= 0) && (scrollbar_engaged <= 0) && (mouse_left == 1)) { + // Click within the scrollbar grip area + scrollbar_engaged = mouse_y - (y3 + bs); + cooldown = 8000; + } + } + + if (popup == "advantages") { + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); + draw_text_transformed(800, 211, "Select an Advantage", 0.6, 0.6, 0); + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_left); + + for (var slot = 0; slot < array_length(obj_creation.all_advantages); slot++) { + var advantage_local_var = obj_creation.all_advantages[slot]; + var column = {x1: 436, y1: 250, w: 100, h: 20}; + column.x2 = column.x1 + column.w; + column.y2 = column.y1 + column.h; + var disable = 0; + if (advantage_local_var.name != "") { + var adv_name = advantage_local_var.name; + //columns of 14, shift the left boarder across + + if (slot >= 15 && slot < 29) { + column.x1 = 670; + column.x2 = column.x1 + column.w; + } + if (slot >= 29 && slot < 42) { + column.x1 = 904; + column.x2 = column.x1 + column.w; + } + draw_set_color(38144); + draw_set_alpha(1); + disable = array_contains(adv, adv_name); + if (!disable) { + disable = advantage_local_var.disable(); + } + if (disable) { + draw_set_alpha(0.5); + } + + var gap = ((slot - 1) % 14) * column.h; + var adv_width = string_width(adv_name); + draw_text(column.x1, column.y1 + gap, adv_name); + + // Cancel button + var coords = [column.x1, column.y1 + gap, column.x1 + adv_width, column.y1 + column.h + gap]; + if (point_and_click(coords) && (cooldown <= 0) && (adv_name == "Cancel")) { + cooldown = 8000; + popup = ""; + } + // Tooltips + if (scr_hit(coords)) { + tooltip = $"{adv_name} ({advantage_local_var.points})"; + tooltip2 = $"{advantage_local_var.description} \nCategories: {advantage_local_var.print_meta()}"; + draw_set_color(c_white); + draw_set_alpha(0.2); + draw_text(column.x1, column.y1 + gap, adv_name); + } + //Click on advantage + if (point_and_click(coords) && (cooldown <= 0) && (array_contains(adv, adv_name) == false)) { + if (disable == 0) { + cooldown = 8000; + advantage_local_var.add(temp); + popup = ""; + } + } + } + } + } else if (popup == "disadvantages") { + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); + draw_text_transformed(800, 211, "Select a Disadvantage", 0.6, 0.6, 0); + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_left); + for (var slot = 0; slot < array_length(obj_creation.all_disadvantages); slot++) { + var disadvantage_local_var = obj_creation.all_disadvantages[slot]; + var column = {x1: 436, y1: 250, w: 100, h: 20}; + column.x2 = column.x1 + column.w; + column.y2 = column.y1 + column.h; + var disable = 0; + if (disadvantage_local_var.name != "") { + var dis_name = disadvantage_local_var.name; + //columns of 14, shift the left boarder across and leave a gap at the top on cols 2 & 3 + if (slot >= 15 && slot < 29) { + column.x1 = 670; + column.x2 = column.x1 + column.w; + } + if (slot >= 29 && slot < 42) { + column.x1 = 904; + column.x2 = column.x1 + column.w; + } + draw_set_color(38144); + + disable = disadvantage_local_var.disable() || array_contains(dis, dis_name); + + if (!disable) { + disable = dis_name == "Blood Debt" && fleet_type == 3; + } + + draw_set_alpha(disable ? 0.5 : 1); + + var gap = ((slot - 1) % 14) * column.h; + + draw_text(column.x1, column.y1 + gap, dis_name); + + var dis_width = string_width(dis_name); + // Cancel button + var coords = [column.x1, column.y1 + gap, column.x1 + dis_width, column.y1 + column.h + gap]; + + if (point_and_click(coords) && (cooldown <= 0) && (dis_name == "Cancel")) { + cooldown = 8000; + popup = ""; + } + //Tooltip + if (scr_hit(coords)) { + tooltip = $"{dis_name} ({disadvantage_local_var.points})"; + tooltip2 = $"{disadvantage_local_var.description} \nCategories: {disadvantage_local_var.print_meta()}"; + draw_set_color(c_white); + draw_set_alpha(0.2); + draw_text(column.x1, column.y1 + gap, dis_name); + } + //Click on disadvantage + if (point_and_click(coords) && (cooldown <= 0) && (array_contains(dis, dis_name) == false)) { + if (disable == false) { + cooldown = 8000; + popup = ""; + disadvantage_local_var.add(temp); + } + } + } + } + } + if ((popup != "") && ((mouse_left >= 1) || (mouse_right == 1)) && (cooldown <= 0)) { + if (((mouse_x < 445) || (mouse_x > 1125) || (mouse_y < 200) || (mouse_y > 552)) && (popup != "icons")) { + cooldown = 8000; + popup = ""; + } + if (((mouse_x < 445) || (mouse_x > 1125) || (mouse_y < 200) || (mouse_y > 719)) && (popup == "icons")) { + cooldown = 8000; + popup = ""; + } + } } - - -} -/* */ + /* Homeworld, Flagship, Psychic discipline, Aspirant Trial */ + var yar = 0; -// 850,860 + if (slide == 3) { + draw_set_color(38144); + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); -var xx,yy; -xx=375;yy=10; + tooltip = ""; + tooltip2 = ""; + obj_cursor.image_index = 0; + draw_text(800, 80, string_hash_to_newline(string(chapter_name))); -if (change_slide>0){ - draw_set_color(c_black); - if (change_slide=3){ - if (slate5<=0) then slate5=1; - if (slate5>=5) and (slate6=0) then slate6=1; - } - if (change_slide<=30) then draw_set_alpha(change_slide/30); - if (change_slide>40) then draw_set_alpha(2.33-(change_slide/30)); - draw_rectangle(430,66,702,750,0); - draw_rectangle(703,80,1171,750,0); - draw_rectangle(518,750,1075,820,0); -} + draw_set_color(38144); + draw_line(445, 200, 1125, 200); + draw_line(445, 201, 1125, 201); + draw_line(445, 202, 1125, 202); + var fleet_type_text = fleet_type == eFLEET_TYPES.HOMEWORLD ? "Homeworld" : "Flagship"; + draw_text_transformed(644, 218, fleet_type_text, 0.6, 0.6, 0); -draw_set_color(5998382); -if (slate5>0){ - if (slate5<=30) then draw_set_alpha(slate5/30); - if (slate5>30) then draw_set_alpha(1-((slate5-30)/30)); - draw_line(xx+30,yy+70+(slate5*12),xx+790,yy+70+(slate5*12)); -} -if (slate6>0){ - if (slate6<=30) then draw_set_alpha(slate6/30); - if (slate6>30) then draw_set_alpha(1-((slate6-30)/30)); - draw_line(xx+30,yy+70+(slate6*12),xx+790,yy+70+(slate6*12)); -} + var eh, eh2; + eh = 0; + eh2 = 0; + name_bad = 0; -if (fade_in>0){ - draw_set_alpha(fade_in/50); - draw_set_color(0); - draw_rectangle(0,0,room_width,room_height,0); -} -draw_set_alpha(1); -// draw_set_color(c_red); -// draw_text(mouse_x+20,mouse_y+20,string(change_slide)); - - - - -if (slide=1){ - draw_set_alpha(slate4/30); - if (slide=1) then draw_sprite(spr_creation_arrow,2,607,761); - if (slide!=1) then draw_sprite(spr_creation_arrow,0,607,761); - draw_sprite(spr_creation_arrow,3,927,761); - - var q,x3,y3;q=1;x3=(room_width/2)-65;y3=790; - draw_set_color(38144); - repeat(6){ - draw_circle(x3,y3,10,1); - draw_circle(x3,y3,9.5,1); - draw_circle(x3,y3,9,1); - - if (slide=q) then draw_circle(x3,y3,8.5,0); - if (slide!=q) then draw_circle(x3,y3,8.5,1); - x3+=25;q+=1; - } -} + if (homeworld == "Lava") { + eh = 2; + } + if (homeworld == "Desert") { + eh = 3; + } + if (homeworld == "Forge") { + eh = 4; + } + if (homeworld == "Hive") { + eh = 5; + } + if (homeworld == "Death") { + eh = 6; + } + if (homeworld == "Agri") { + eh = 7; + } + if (homeworld == "Feudal") { + eh = 8; + } + if (homeworld == "Temperate") { + eh = 9; + } + if (homeworld == "Ice") { + eh = 10; + } + if (homeworld == "Dead") { + eh = 11; + } + if (homeworld == "Shrine") { + eh = 17; + } + if (fleet_type != 1) { + eh = 16; + } + if (fleet_type == eFLEET_TYPES.HOMEWORLD) { + scr_image("ui/planet", eh, 580, 244, 128, 128); + // draw_sprite(spr_planet_splash,eh,580,244); + draw_text_transformed(644, 378, string_hash_to_newline(string(homeworld)), 0.5, 0.5, 0); + // draw_text_transformed(644,398,string(homeworld_name),0.5,0.5,0); + if ((text_selected != "home_name") || (custom < 2)) { + draw_text_transformed(644, 398, string_hash_to_newline(string(homeworld_name)), 0.5, 0.5, 0); + } + if (custom > 1) { + if ((text_selected == "home_name") && (text_bar > 30)) { + draw_text_transformed(644, 398, string_hash_to_newline(string(homeworld_name)), 0.5, 0.5, 0); + } + if ((text_selected == "home_name") && (text_bar <= 30)) { + draw_text_transformed(644, 398, string_hash_to_newline(string(homeworld_name) + "|"), 0.5, 0.5, 0); + } + if (scr_text_hit(644, 398, true, homeworld_name)) { + obj_cursor.image_index = 2; + if ((cooldown <= 0) && (mouse_left >= 1)) { + text_selected = "home_name"; + cooldown = 8000; + keyboard_string = homeworld_name; + } + } + if (text_selected == "home_name") { + homeworld_name = keyboard_string; + } + draw_set_alpha(0.75); + draw_rectangle(525, 398, 760, 418, 1); + draw_set_alpha(1); + var _refresh_hw_name_btn = [770, 398, 790, 418]; + draw_unit_buttons(_refresh_hw_name_btn, "?", [1, 1], 38144, , fnt_40k_14b); + if (point_and_click(_refresh_hw_name_btn)) { + var _new_hw_name = global.name_generator.generate_star_name(); + show_debug_message($"regen name of homeworld from {homeworld_name} to {_new_hw_name}"); + homeworld_name = _new_hw_name; + } + } -if (slide>=2) or (goto_slide>=2){ - draw_set_alpha(1); - draw_sprite(spr_creation_arrow,0,607,761); - draw_sprite(spr_creation_arrow,1,927,761); - if (slide=1) then draw_sprite(spr_creation_arrow,2,607,761); - - - if (slide>=2) and (slide<6) and (custom!=2){ - draw_set_alpha(0.8); - if (popup="") and ((change_slide>=70) or (change_slide<=0)) and (scr_hit(927+64+12,761+12,927+128-12,761+64-12)) then draw_set_alpha(1); - draw_sprite(spr_creation_arrow,4,927+64,761); - if (popup="") and ((change_slide>=70) or (change_slide<=0)) and (cooldown<=0) and (mouse_left>=1){ - if (scr_hit(927+64+12,761+12,927+128-12,761+64-12)){ - scr_creation(2);scr_creation(3.5);scr_creation(4); - scr_creation(5);scr_creation(6); - } - } - } - draw_set_alpha(1); - - - var q,x3,y3;q=1;x3=(room_width/2)-65;y3=790; - draw_set_color(38144); - repeat(6){ - draw_circle(x3,y3,10,1); - draw_circle(x3,y3,9.5,1); - draw_circle(x3,y3,9,1); - - if (slide_show=q) then draw_circle(x3,y3,8.5,0); - if (slide_show!=q) then draw_circle(x3,y3,8.5,1); - x3+=25;q+=1; - } - - - - if (popup="") and ((change_slide>=70) or (change_slide<=0)) and (cooldown<=0){ - if (mouse_x>925) and (mouse_y>756) and (mouse_x<997) and (mouse_y<824) and (mouse_left>=1) and (!instance_exists(obj_creation_popup)){// Next slide - if (slide>=2 && slide<=6) then scr_creation(slide); - } - - - if (mouse_x>604) and (mouse_y>756) and (mouse_x<675) and (mouse_y<824) and (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){// Previous slide - cooldown=8000;change_slide=1;goto_slide=slide-1;popup=""; - if (goto_slide=1){ - highlight=0;highlighting=0;old_highlight=0; - } - } - } - -} + if (custom > 1) { + draw_sprite_stretched(spr_creation_arrow, 0, 525, 285, 32, 32); + } // Left Arrow + if (custom > 1) { + draw_sprite_stretched(spr_creation_arrow, 1, 725, 285, 32, 32); + } // Right Arrow + var planet_types = ["Dead", "Ice", "Temperate", "Feudal", "Shrine", "Agri", "Death", "Hive", "Forge", "Desert", "Lava"]; + var planet_change_allow = (mouse_left >= 1) && (cooldown <= 0) && (custom > 1); + for (var i = 0; i < array_length(planet_types); i++) { + if (homeworld == planet_types[i] && planet_change_allow) { + if (point_and_click([525, 285, 525 + 32, 285 + 32])) { + if (i == array_length(planet_types) - 1) { + homeworld = planet_types[0]; + } else { + homeworld = planet_types[i + 1]; + } + break; + } else if (point_and_click([725, 285, 725 + 32, 285 + 32])) { + if (i == 0) { + homeworld = planet_types[array_length(planet_types) - 1]; + } else { + homeworld = planet_types[i - 1]; + } + break; + } + } + } + } + if (fleet_type != eFLEET_TYPES.HOMEWORLD) { + // draw_sprite(spr_planet_splash,eh,580,244); + scr_image("ui/planet", eh, 580, 244, 128, 128); + + draw_text_transformed(644, 378, string_hash_to_newline("Battle Barge"), 0.5, 0.5, 0); + // draw_text_transformed(644,398,string(homeworld_name),0.5,0.5,0); + if ((text_selected != "flagship_name") || (custom == 0)) { + draw_text_transformed(644, 398, string_hash_to_newline(string(flagship_name)), 0.5, 0.5, 0); + } + if (custom > 1) { + if ((text_selected == "flagship_name") && (text_bar > 30)) { + draw_text_transformed(644, 398, string_hash_to_newline(string(flagship_name)), 0.5, 0.5, 0); + } + if ((text_selected == "flagship_name") && (text_bar <= 30)) { + draw_text_transformed(644, 398, string_hash_to_newline(string(flagship_name) + "|"), 0.5, 0.5, 0); + } + if (scr_text_hit(644, 398, true, flagship_name)) { + obj_cursor.image_index = 2; + if ((cooldown <= 0) && (mouse_left >= 1)) { + text_selected = "flagship_name"; + cooldown = 8000; + keyboard_string = flagship_name; + } + } + if (text_selected == "flagship_name") { + flagship_name = keyboard_string; + } + draw_set_alpha(0.75); + draw_rectangle(525, 398, 760, 418, 1); + draw_set_alpha(1); + var _refresh_fs_name_btn = [770, 398, 790, 418]; + draw_unit_buttons(_refresh_fs_name_btn, "?", [1, 1], 38144, , fnt_40k_14b); + if (point_and_click(_refresh_fs_name_btn)) { + var _new_fs_name = global.name_generator.generate_imperial_ship_name(); + show_debug_message($"regen name of flagship_name from {flagship_name} to {_new_fs_name}"); + flagship_name = _new_fs_name; + } + } + } + if (fleet_type != eFLEET_TYPES.PENITENCE) { + if ((fleet_type != 1) || (custom < 2)) { + draw_set_alpha(0.5); + } + yar = 0; + if (recruiting_exists == 1) { + yar = 1; + } + draw_sprite(spr_creation_check, yar, 858, 221); + yar = 0; + if (scr_hit(858, 221, 858 + 32, 221 + 32) && (cooldown <= 0) && (mouse_left >= 1) && (custom > 1) && (fleet_type == 1)) { + cooldown = 8000; + var onceh; + onceh = 0; + if ((recruiting_exists == 1) && (onceh == 0)) { + recruiting_exists = 0; + onceh = 1; + } + if ((recruiting_exists == 0) && (onceh == 0)) { + recruiting_exists = 1; + onceh = 1; + } + } + draw_set_alpha(1); + draw_text_transformed(644 + 333, 218, string_hash_to_newline("Recruiting World"), 0.6, 0.6, 0); + + if (recruiting_exists == 1) { + if (recruiting == "Lava") { + eh2 = 2; + } + if (recruiting == "Desert") { + eh2 = 3; + } + if (recruiting == "Forge") { + eh2 = 4; + } + if (recruiting == "Hive") { + eh2 = 5; + } + if (recruiting == "Death") { + eh2 = 6; + } + if (recruiting == "Agri") { + eh2 = 7; + } + if (recruiting == "Feudal") { + eh2 = 8; + } + if (recruiting == "Temperate") { + eh2 = 9; + } + if (recruiting == "Ice") { + eh2 = 10; + } + if (recruiting == "Dead") { + eh2 = 11; + } + if (recruiting == "Shrine") { + eh2 = 17; + } + + if (custom > 1) { + draw_sprite_stretched(spr_creation_arrow, 0, 865, 285, 32, 32); + } // Left Arrow + if (scr_hit(865, 285, 865 + 32, 285 + 32) && (mouse_left >= 1) && (cooldown <= 0) && (custom > 1)) { + var onceh; + onceh = 0; + cooldown = 8000; + if ((recruiting == "Dead") && (onceh == 0)) { + recruiting = "Ice"; + onceh = 1; + } + if ((recruiting == "Ice") && (onceh == 0)) { + recruiting = "Temperate"; + onceh = 1; + } + if ((recruiting == "Temperate") && (onceh == 0)) { + recruiting = "Feudal"; + onceh = 1; + } + if ((recruiting == "Feudal") && (onceh == 0)) { + recruiting = "Shrine"; + onceh = 1; + } + if ((recruiting == "Shrine") && (onceh == 0)) { + recruiting = "Agri"; + onceh = 1; + } + if ((recruiting == "Agri") && (onceh == 0)) { + recruiting = "Death"; + onceh = 1; + } + if ((recruiting == "Death") && (onceh == 0)) { + recruiting = "Hive"; + onceh = 1; + } + if ((recruiting == "Hive") && (onceh == 0)) { + recruiting = "Forge"; + onceh = 1; + } + if ((recruiting == "Forge") && (onceh == 0)) { + recruiting = "Desert"; + onceh = 1; + } + if ((recruiting == "Desert") && (onceh == 0)) { + recruiting = "Lava"; + onceh = 1; + } + if ((recruiting == "Lava") && (onceh == 0)) { + recruiting = "Dead"; + onceh = 1; + } + } + if (custom > 1) { + draw_sprite_stretched(spr_creation_arrow, 1, 1055, 285, 32, 32); + } // Right Arrow + if (scr_hit(1055, 285, 1055 + 32, 285 + 32) && (mouse_left >= 1) && (cooldown <= 0) && (custom > 1)) { + var onceh; + onceh = 0; + cooldown = 8000; + if ((recruiting == "Dead") && (onceh == 0)) { + recruiting = "Lava"; + onceh = 1; + } + if ((recruiting == "Lava") && (onceh == 0)) { + recruiting = "Desert"; + onceh = 1; + } + if ((recruiting == "Desert") && (onceh == 0)) { + recruiting = "Forge"; + onceh = 1; + } + if ((recruiting == "Forge") && (onceh == 0)) { + recruiting = "Hive"; + onceh = 1; + } + if ((recruiting == "Hive") && (onceh == 0)) { + recruiting = "Death"; + onceh = 1; + } + if ((recruiting == "Death") && (onceh == 0)) { + recruiting = "Agri"; + onceh = 1; + } + if ((recruiting == "Agri") && (onceh == 0)) { + recruiting = "Shrine"; + onceh = 1; + } + if ((recruiting == "Shrine") && (onceh == 0)) { + recruiting = "Feudal"; + onceh = 1; + } + if ((recruiting == "Feudal") && (onceh == 0)) { + recruiting = "Temperate"; + onceh = 1; + } + if ((recruiting == "Temperate") && (onceh == 0)) { + recruiting = "Ice"; + onceh = 1; + } + if ((recruiting == "Ice") && (onceh == 0)) { + recruiting = "Dead"; + onceh = 1; + } + } + + // draw_sprite(spr_planet_splash,eh2,580+333,244); + scr_image("ui/planet", eh2, 580 + 333, 244, 128, 128); + + draw_text_transformed(644 + 333, 378, string_hash_to_newline(string(recruiting)), 0.5, 0.5, 0); + // draw_text_transformed(644+333,398,string(recruiting_name),0.5,0.5,0); + + if ((fleet_type == 1) && (homeworld_name == recruiting_name)) { + name_bad = 1; + } + + if (name_bad == 1) { + draw_set_color(c_red); + } + if ((text_selected != "recruiting_name") || (custom < 2)) { + draw_text_transformed(644 + 333, 398, string_hash_to_newline(string(recruiting_name)), 0.5, 0.5, 0); + } + if (custom > 1) { + if ((text_selected == "recruiting_name") && (text_bar > 30)) { + draw_text_transformed(644 + 333, 398, string_hash_to_newline(string(recruiting_name)), 0.5, 0.5, 0); + } + if ((text_selected == "recruiting_name") && (text_bar <= 30)) { + draw_text_transformed(644 + 333, 398, string_hash_to_newline(string(recruiting_name) + "|"), 0.5, 0.5, 0); + } + if (scr_text_hit(644 + 333, 398, true, recruiting_name)) { + obj_cursor.image_index = 2; + if ((cooldown <= 0) && (mouse_left >= 1)) { + text_selected = "recruiting_name"; + cooldown = 8000; + keyboard_string = recruiting_name; + } + } + if (text_selected == "recruiting_name") { + recruiting_name = keyboard_string; + } + draw_set_alpha(0.75); + draw_rectangle(525 + 333, 398, 760 + 333, 418, 1); + draw_set_alpha(1); + + var _refresh_rec_name_btn = [1103, 398, 1103 + 20, 398 + 20]; + draw_unit_buttons(_refresh_rec_name_btn, "?", [1, 1], 38144, , fnt_40k_14b); + if (point_and_click(_refresh_rec_name_btn)) { + var _new_rec_name = global.name_generator.generate_star_name(); + show_debug_message($"regen name of recruiting_name from {recruiting_name} to {_new_rec_name}"); + recruiting_name = _new_rec_name; + } + } + } + } + if (recruiting_exists == 0 && homeworld_exists == 1) { + // draw_sprite(spr_planet_splash,eh,580+333,244); + scr_image("ui/planet", eh, 580 + 333, 244, 128, 128); + draw_set_alpha(0.5); + draw_text_transformed(644 + 333, 378, string_hash_to_newline(string(homeworld)), 0.5, 0.5, 0); + draw_text_transformed(644 + 333, 398, string_hash_to_newline(string(homeworld_name)), 0.5, 0.5, 0); + draw_set_alpha(1); + } -if (tooltip!="") and (tooltip2!="") and (change_slide<=0){ - draw_set_alpha(1); - draw_set_font(fnt_40k_14);draw_set_halign(fa_left);draw_set_color(0); - draw_rectangle(mouse_x+18,mouse_y+20,mouse_x+string_width_ext(string_hash_to_newline(tooltip2),-1,500)+24,mouse_y+44+string_height_ext(string_hash_to_newline(tooltip2),-1,500),0); - draw_set_color(38144); - draw_rectangle(mouse_x+18,mouse_y+20,mouse_x+string_width_ext(string_hash_to_newline(tooltip2),-1,500)+24,mouse_y+44+string_height_ext(string_hash_to_newline(tooltip2),-1,500),1); - draw_set_font(fnt_40k_14b);draw_text(mouse_x+22,mouse_y+22,string_hash_to_newline(string(tooltip))); - draw_set_font(fnt_40k_14);draw_text_ext(mouse_x+22,mouse_y+42,string_hash_to_newline(string(tooltip2)),-1,500); -} + if (scr_hit(575, 216, 710, 242)) { + if (fleet_type != eFLEET_TYPES.HOMEWORLD) { + tooltip = "Battle Barge"; + tooltip2 = "The name of your Flagship Battle Barge."; + } + if (fleet_type == eFLEET_TYPES.HOMEWORLD) { + tooltip = "Homeworld"; + tooltip2 = "The world that your Chapter's Fortress Monastery is located upon. More civilized worlds are more easily defensible but the citizens may pose a risk or be a nuisance."; + } + } + if (scr_hit(895, 216, 1075, 242)) { + tooltip = "Recruiting World"; + tooltip2 = "The world that your Chapter selects recruits from. More harsh worlds provide recruits with more grit and warrior mentality. If you are a homeworld-based Chapter, you may uncheck 'Recruiting World' to recruit from your homeworld instead."; + } + + draw_line(445, 455, 1125, 455); + draw_line(445, 456, 1125, 456); + draw_line(445, 457, 1125, 457); + + // homeworld_rule=0; + // aspirant_trial=eTrials.BLOODDUEL; + + draw_set_halign(fa_left); + + if (fleet_type == eFLEET_TYPES.HOMEWORLD) { + if (custom < 2) { + draw_set_alpha(0.5); + } + draw_text_transformed(445, 480, "Homeworld Rule", 0.6, 0.6, 0); + draw_text_transformed(485, 512, "Planetary Governer", 0.5, 0.5, 0); + draw_text_transformed(485, 544, "Passive Supervision", 0.5, 0.5, 0); + draw_text_transformed(485, 576, "Personal Rule", 0.5, 0.5, 0); + + yar = homeworld_rule == 1; + draw_sprite(spr_creation_check, yar, 445, 512); + if (scr_hit(445, 512, 445 + 32, 512 + 32) && (cooldown <= 0) && (mouse_left >= 1) && (custom > 1) && (homeworld_rule != 1)) { + cooldown = 8000; + homeworld_rule = 1; + } + if (scr_hit(445, 512, 670, 512 + 32)) { + tooltip = "Planetary Governer"; + tooltip2 = "Your Chapter's homeworld is ruled by a single Planetary Governer, who does with the planet mostly as they see fit. While heavily influenced by your Astartes the planet is sovereign."; + } + + yar = homeworld_rule == 2; + draw_sprite(spr_creation_check, yar, 445, 544); + if (scr_hit(445, 544, 445 + 32, 544 + 32) && (cooldown <= 0) && (mouse_left >= 1) && (custom > 1) && (homeworld_rule != 2)) { + cooldown = 8000; + homeworld_rule = 2; + } + if (scr_hit(445, 544, 620, 544 + 32)) { + tooltip = "Passive Supervision"; + tooltip2 = "Instead of a Planetary Governer the planet is broken up into many countries or clans. The people are less united but happier, and see your illusive Astartes as semi-divine beings."; + } + + yar = homeworld_rule == 3; + draw_sprite(spr_creation_check, yar, 445, 576); + if (point_and_click([445, 576, 445 + 32, 576 + 32]) && (custom > 1) && (homeworld_rule != 3)) { + cooldown = 8000; + homeworld_rule = 3; + } + if (scr_hit(445, 576, 670, 576 + 32)) { + tooltip = "Personal Rule"; + tooltip2 = "You personally take the rule of the Planetary Governer, ruling over your homeworld with an iron fist. Your every word and directive, be they good or bad, are absolute law."; + } + } + + var trial_data = scr_trial_data(); + var current_trial = trial_data[aspirant_trial]; + draw_text_transformed(80, 80, "Aspirant Trial", 0.6, 0.6, 0); + draw_text_transformed(10, 130, current_trial.name, 0.5, 0.5, 0); + + var asp_info; + asp_info = scr_compile_trial_bonus_string(current_trial); + + draw_text_ext_transformed(10, 160, asp_info, 64, 750, 0.5, 0.5, 0); + + if (scr_hit(80, 80, 80 + string_width("Aspirant Trial"), 80 + string_height("Aspirant Trial"))) { + tooltip = "Aspirant Trial"; + tooltip2 = "A special challenge is needed for Aspirants to be judged worthy of becoming Astartes. After completing the Trial they then become a Neophyte, beginning implantation and training (This can be changed once in game but the chosen trial here will effect the spawn characteristics of your starting marines)."; + } + + if (custom > 1) { + draw_sprite_stretched(spr_creation_arrow, 0, 0, 80, 32, 32); + if (point_and_click([0, 80, 0 + 32, 80 + 32]) && (cooldown <= 0)) { + var onceh = 0; + cooldown = 8000; + aspirant_trial++; + if (aspirant_trial >= array_length(trial_data)) { + aspirant_trial = 0; + } + } + draw_sprite_stretched(spr_creation_arrow, 1, 38, 80, 32, 32); + + if (point_and_click([38, 80, 38 + 32, 80 + 32]) && (mouse_left >= 1) && (cooldown <= 0)) { + var onceh = 0; + cooldown = 8000; + aspirant_trial--; + if (aspirant_trial < 0) { + aspirant_trial = array_length(trial_data) - 1; + } + } + } + + draw_line(445, 640, 1125, 640); + draw_line(445, 641, 1125, 641); + draw_line(445, 642, 1125, 642); + + if (race[100, 17] != 0) { + draw_text_transformed(445, 665, string_hash_to_newline("Psychic Discipline"), 0.6, 0.6, 0); + if (scr_hit(445, 665, 620, 690)) { + tooltip = "Psychic Discipline"; + tooltip2 = "The Psychic Discipline that your psykers will use by default."; + } + + var fug, fug2; + fug = string_delete(discipline, 2, string_length(discipline)); + fug2 = string_delete(discipline, 1, 1); + draw_text_transformed(513, 697, string_hash_to_newline(string_upper(fug) + string(fug2)), 0.5, 0.5, 0); + + var psy_info; + psy_info = ""; + if (discipline == "default") { + psy_info = "-Psychic Blasts and Barriers"; + } + if (discipline == "biomancy") { + psy_info = "-Manipulates Biology to Buff or Heal"; + } + if (discipline == "pyromancy") { + psy_info = "-Unleashes Blasts and Walls of Flame"; + } + if (discipline == "telekinesis") { + psy_info = "-Manipulates Gravity to Throw or Shield"; + } + if (discipline == "rune Magick") { + psy_info = "-Summons Deadly Elements and Feral Spirits"; + } + draw_text_transformed(533, 729, string_hash_to_newline(string(psy_info)), 0.5, 0.5, 0); + + if (custom < 2) { + draw_set_alpha(0.5); + } + if (custom == 2) { + draw_sprite_stretched(spr_creation_arrow, 0, 437, 688, 32, 32); + } + if (custom == 2) { + draw_sprite_stretched(spr_creation_arrow, 1, 475, 688, 32, 32); + } + draw_set_alpha(1); + + if (scr_hit(437, 688, 437 + 32, 688 + 32) && (mouse_left >= 1) && (cooldown <= 0) && (custom > 1)) { + var onceh; + onceh = 0; + cooldown = 8000; + if ((discipline == "default") && (onceh == 0)) { + discipline = "rune Magick"; + onceh = 1; + } + if ((discipline == "rune Magick") && (onceh == 0)) { + discipline = "telekinesis"; + onceh = 1; + } + if ((discipline == "telekinesis") && (onceh == 0)) { + discipline = "pyromancy"; + onceh = 1; + } + if ((discipline == "pyromancy") && (onceh == 0)) { + discipline = "biomancy"; + onceh = 1; + } + if ((discipline == "biomancy") && (onceh == 0)) { + discipline = "default"; + onceh = 1; + } + } + if (scr_hit(475, 688, 475 + 32, 688 + 32) && (mouse_left >= 1) && (cooldown <= 0) && (custom > 1)) { + var onceh; + onceh = 0; + cooldown = 8000; + if ((discipline == "default") && (onceh == 0)) { + discipline = "biomancy"; + onceh = 1; + } + if ((discipline == "biomancy") && (onceh == 0)) { + discipline = "pyromancy"; + onceh = 1; + } + if ((discipline == "pyromancy") && (onceh == 0)) { + discipline = "telekinesis"; + onceh = 1; + } + if ((discipline == "telekinesis") && (onceh == 0)) { + discipline = "rune Magick"; + onceh = 1; + } + if ((discipline == "rune Magick") && (onceh == 0)) { + discipline = "default"; + onceh = 1; + } + } + } + } + + /* Livery, Roles */ + + if (slide == 4) { + scr_livery_setup(); + } + + /* Gene Seed Mutations, Disposition */ + + if (slide == 5) { + draw_set_color(38144); + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); + draw_set_alpha(1); + + tooltip = ""; + tooltip2 = ""; + obj_cursor.image_index = 0; + + draw_text(800, 80, string_hash_to_newline(string(chapter_name))); + + draw_set_color(38144); + draw_set_halign(fa_left); + draw_text_transformed(580, 118, string_hash_to_newline("Successor Chapters: " + string(successors)), 0.6, 0.6, 0); + draw_set_font(fnt_40k_14b); + + draw_rectangle(445, 200, 1125, 202, true); + + draw_set_font(fnt_40k_30b); + draw_text_transformed(503, 210, string_hash_to_newline("Gene-Seed Mutations"), 0.6, 0.6, 0); + if (mutations > mutations_selected) { + draw_text_transformed(585, 230, $"Select {mutations - mutations_selected} More", 0.5, 0.5, 0); + } + + var x1, y1, spac = 34; + + if (custom < 2) { + draw_set_alpha(0.5); + } + var mutations_defects = [{t_tip: "Anemic Preomnor", t_tip2: "Your Astartes lack the detoxifying gland called the Preomnor- they are more susceptible to poisons and toxins.", data: preomnor, mutation_points: 1}, {t_tip: "Disturbing Voice", t_tip2: "Your Astartes have a voice like a creaking door or a rumble. Decreases Imperium and Imperial Guard disposition.", data: voice, mutation_points: 1, disposition: [[eFACTION.Imperium, -8]]}, {t_tip: "Doomed", t_tip2: "Your Chapter cannot make more Astartes until enough research is generated. Counts as four mutations.", data: doomed, mutation_points: 4, disposition: [[eFACTION.Imperium, -8], [6, 8]]}, {t_tip: "Faulty Lyman's Ear", t_tip2: "Lacking a working Lyman's ear, all deep-striked Astartes recieve moderate penalties to both attack and defense.", data: lyman, mutation_points: 1}, {t_tip: "Hyper-Stimulated Omophagea", t_tip2: "After every battle the Astartes have a chance to feast upon their fallen enemies, or seldom, their allies.", data: omophagea, mutation_points: 1}, {t_tip: "Hyperactive Ossmodula", t_tip2: "Instead of wound tissue bone is generated; Apothecaries must spend twice the normal time healing your Astartes.", data: ossmodula, mutation_points: 1}, {t_tip: "Lost Zygote", t_tip2: "One of the Zygotes is faulty or missing. The Astartes only have one each and generate half the normal Gene-Seed.", data: zygote, mutation_points: 2}, {t_tip: "Inactive Sus-an Membrane", t_tip2: "Your Astartes do not have a Sus-an Membrane; they cannot enter suspended animation and recieve more casualties as a result.", data: membrane, mutation_points: 1}, {t_tip: "Missing Betchers Gland", t_tip2: "Your Astartes cannot spit acid, and as a result, have slightly less attack in melee combat.", data: betchers, mutation_points: 1}, {t_tip: "Mutated Catalepsean Node", t_tip2: "Your Astartes have reduced awareness when tired. Slightly less attack in ranged and melee combat.", data: catalepsean, mutation_points: 1}, {t_tip: "Oolitic Secretions", t_tip2: "Either by secretions or radiation, your Astartes have an unusual or strange skin color. Decreases disposition.", data: secretions, mutation_points: 1, disposition: [[eFACTION.Imperium, -8]]}, {t_tip: "Oversensitive Occulobe", t_tip2: "Your Astartes are no longer immune to stun grenades, bright lights, and have a massive penalty during morning battles.", data: occulobe, mutation_points: 1, disposition: [[eFACTION.Imperium, -8]]}, {t_tip: "Rampant Mucranoid", t_tip2: "Your Astartes' Mucranoid cannot be turned off; the slime lowers most dispositions and occasionally damages their armour.", data: mucranoid, mutation_points: 1, disposition: [[1, -4], [eFACTION.Imperium, -8], [3, -4], [4, -4], [5, -4], [6, -4]]}]; + x1 = 450; + y1 = 260; + for (var i = 0; i < array_length(mutations_defects); i++) { + mutation_data = mutations_defects[i]; + draw_sprite(spr_creation_check, mutation_data.data, x1, y1); + if (point_and_click([x1, y1, x1 + 32, y1 + 32]) && allow_colour_click) { + cooldown = 8000; + var onceh = 0; + if (mutation_data.data) { + mutation_data.data = 0; + mutations_selected -= mutation_data.mutation_points; + if (struct_exists(mutation_data, "disposition")) { + for (var s = 0; s < array_length(mutation_data.disposition); s++) { + disposition[mutation_data.disposition[s][0]] -= mutation_data.disposition[s][1]; + } + } + } else if ((!mutation_data.data) && (mutations > mutations_selected)) { + mutation_data.data = 1; + mutations_selected += mutation_data.mutation_points; + if (struct_exists(mutation_data, "disposition")) { + for (var s = 0; s < array_length(mutation_data.disposition); s++) { + disposition[mutation_data.disposition[s][0]] += mutation_data.disposition[s][1]; + } + } + } + } + draw_text_transformed(x1 + 30, y1 + 4, mutation_data.t_tip, 0.4, 0.4, 0); + if (scr_hit(x1, y1, x1 + 250, y1 + 20)) { + tooltip = mutation_data.t_tip; + tooltip2 = mutation_data.t_tip2; + } + y1 += spac; + if (i == 6) { + x1 = 750; + y1 = 260; + } + } + preomnor = mutations_defects[0].data; + voice = mutations_defects[1].data; + doomed = mutations_defects[2].data; + lyman = mutations_defects[3].data; + omophagea = mutations_defects[4].data; + ossmodula = mutations_defects[5].data; + zygote = mutations_defects[6].data; + membrane = mutations_defects[7].data; + betchers = mutations_defects[8].data; + catalepsean = mutations_defects[9].data; + secretions = mutations_defects[10].data; + occulobe = mutations_defects[11].data; + mucranoid = mutations_defects[12].data; + + draw_set_alpha(1); + + draw_line(445, 505, 1125, 505); + draw_line(445, 506, 1125, 505); + draw_line(445, 507, 1125, 507); + + draw_set_font(fnt_40k_30b); + draw_text_transformed(444, 515, string_hash_to_newline("Starting Disposition"), 0.6, 0.6, 0); + + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_right); + + draw_text(650, 550, string_hash_to_newline("Imperium (" + string(disposition[2]) + ")")); + draw_text(650, 575, string_hash_to_newline("Adeptus Mechanicus (" + string(disposition[3]) + ")")); + draw_text(650, 600, string_hash_to_newline("Ecclesiarchy (" + string(disposition[5]) + ")")); + draw_text(650, 625, string_hash_to_newline("Inquisition (" + string(disposition[4]) + ")")); + if (founding != 0) { + draw_text(650, 650, string_hash_to_newline("Progenitor (" + string(disposition[1]) + ")")); + } + draw_text(650, 675, "Adeptus Astartes (" + string(disposition[6]) + ")"); + + draw_rectangle(655, 552, 1150, 567, 1); + draw_rectangle(655, 552 + 25, 1150, 567 + 25, 1); + draw_rectangle(655, 552 + 50, 1150, 567 + 50, 1); + draw_rectangle(655, 552 + 75, 1150, 567 + 75, 1); + if (founding != 0) { + draw_rectangle(655, 552 + 100, 1150, 567 + 100, 1); + } + draw_rectangle(655, 552 + 125, 1150, 567 + 125, 1); + if (disposition[2] > 0) { + draw_rectangle(655, 552, 655 + (disposition[2] * 4.95), 567, 0); + } + if (disposition[3] > 0) { + draw_rectangle(655, 552 + 25, 655 + (disposition[3] * 4.95), 567 + 25, 0); + } + if (disposition[5] > 0) { + draw_rectangle(655, 552 + 50, 655 + (disposition[5] * 4.95), 567 + 50, 0); + } + if (disposition[4] > 0) { + draw_rectangle(655, 552 + 75, 655 + (disposition[4] * 4.95), 567 + 75, 0); + } + if ((disposition[1] > 0) && (founding != 0)) { + draw_rectangle(655, 552 + 100, 655 + (disposition[1] * 4.95), 567 + 100, 0); + } + if (disposition[6] > 0) { + draw_rectangle(655, 552 + 125, 655 + (disposition[6] * 4.95), 567 + 125, 0); + } + } + + /* Chapter Master */ + + if (slide == 6) { + draw_set_color(38144); + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); + draw_set_alpha(1); + var yar; + yar = 0; + tooltip = ""; + tooltip2 = ""; + obj_cursor.image_index = 0; -/* */ -/* */ + draw_set_color(38144); + draw_set_halign(fa_left); + draw_text_transformed(580, 100, string_hash_to_newline("Chapter Master Name: "), 0.9, 0.9, 0); + draw_set_font(fnt_40k_14b); + + if ((text_selected != "cm") || (custom == 0)) { + draw_text_ext(580, 144, string_hash_to_newline(string(chapter_master_name)), -1, 580); + } + if ((custom > 0) && (restarted == 0)) { + if ((text_selected == "cm") && (text_bar > 30)) { + draw_text(580, 144, string_hash_to_newline(string(chapter_master_name))); + } + if ((text_selected == "cm") && (text_bar <= 30)) { + draw_text(580, 144, string_hash_to_newline(string(chapter_master_name) + "|")); + } + var str_width, hei; + str_width = max(400, string_width(string_hash_to_newline(chapter_master_name))); + hei = string_height(string_hash_to_newline(chapter_master_name)); + if (scr_hit(580 - 2, 144 - 2, 582 + str_width, 146 + hei)) { + obj_cursor.image_index = 2; + if ((mouse_left >= 1) && (cooldown <= 0) && (!instance_exists(obj_creation_popup))) { + text_selected = "cm"; + cooldown = 8000; + keyboard_string = chapter_master_name; + } + } + if (text_selected == "cm") { + chapter_master_name = keyboard_string; + } + draw_rectangle(580 - 2, 144 - 2, 582 + 400, 146 + hei, 1); + + var _refresh_cm_name_btn = [993, 142, 997 + hei, 146 + hei]; + draw_unit_buttons(_refresh_cm_name_btn, "?", [1, 1], 38144, , fnt_40k_14b); + if (point_and_click(_refresh_cm_name_btn)) { + var _new_cm_name = global.name_generator.generate_space_marine_name(); + show_debug_message($"regen name of chapter_master_name from {chapter_master_name} to {_new_cm_name}"); + chapter_master_name = _new_cm_name; + } + } + + draw_line(445, 200, 1125, 200); + draw_line(445, 201, 1125, 201); + draw_line(445, 202, 1125, 202); + + draw_set_font(fnt_40k_30b); + draw_text_transformed(444, 215, string_hash_to_newline("Select Two Weapons"), 0.6, 0.6, 0); + draw_text_transformed(444, 240, string_hash_to_newline("Melee"), 0.6, 0.6, 0); + draw_text_transformed(800, 240, string_hash_to_newline("Ranged"), 0.6, 0.6, 0); + + var x6, y6, spac; + var melee_choice_order = 0; + var melee_choice_weapon = ""; + x6 = 444; + y6 = 265; + spac = 25; + if ((custom == 0) || (restarted > 0)) { + draw_set_alpha(0.5); + } + + repeat (8) { + melee_choice_order += 1; + if (melee_choice_order == 1) { + melee_choice_weapon = "Twin Power Fists"; + } + if (melee_choice_order == 2) { + melee_choice_weapon = "Twin Lightning Claws"; + } + if (melee_choice_order == 3) { + melee_choice_weapon = "Relic Blade"; + } + if (melee_choice_order == 4) { + melee_choice_weapon = "Thunder Hammer"; + } + if (melee_choice_order == 5) { + melee_choice_weapon = "Power Sword"; + } + if (melee_choice_order == 6) { + melee_choice_weapon = "Power Axe"; + } + if (melee_choice_order == 7) { + melee_choice_weapon = "Eviscerator"; + } + if (melee_choice_order == 8) { + melee_choice_weapon = "Force Staff"; + } + + yar = 0; + if (chapter_master_melee == melee_choice_order) { + yar = 1; + } + draw_sprite(spr_creation_check, yar, x6, y6); + yar = 0; + if (scr_hit(x6, y6, x6 + 32, y6 + 32) && (cooldown <= 0) && (mouse_left >= 1) && (custom > 0) && (restarted == 0) && (!instance_exists(obj_creation_popup))) { + cooldown = 8000; + var onceh; + onceh = 0; + if ((chapter_master_melee == melee_choice_order) && (onceh == 0)) { + chapter_master_melee = 0; + onceh = 1; + } + if ((chapter_master_melee != melee_choice_order) && (onceh == 0)) { + chapter_master_melee = melee_choice_order; + onceh = 1; + } + } + draw_text_transformed(x6 + 30, y6 + 4, string_hash_to_newline(melee_choice_weapon), 0.4, 0.4, 0); + y6 += spac; + } + + x6 = 800; + y6 = 265; + var ranged_choice_order = 0; + var ranged_choice_weapon = ""; + var ranged_options = ["", "Boltstorm Gauntlet", "Infernus Pistol", "Plasma Pistol", "Plasma Gun", "Master Crafted Heavy Bolter", "Master Crafted Meltagun", "Storm Shield", ""]; + if (array_contains([1, 2, 7], chapter_master_melee)) { + draw_set_alpha(0.5); + chapter_master_ranged = 1; + } + repeat (7) { + ranged_choice_order += 1; + yar = 0; + if (chapter_master_ranged == ranged_choice_order) { + yar = 1; + } + draw_sprite(spr_creation_check, yar, x6, y6); + yar = 0; + if (point_and_click([x6, y6, x6 + 32, y6 + 32]) && (custom > 0) && (restarted == 0) && (!instance_exists(obj_creation_popup)) && (!array_contains([1, 2, 7], chapter_master_melee))) { + cooldown = 8000; + var onceh = 0; + if (chapter_master_ranged == ranged_choice_order) { + chapter_master_ranged = 0; + } else if (chapter_master_ranged != ranged_choice_order) { + chapter_master_ranged = ranged_choice_order; + } + } + draw_text_transformed(x6 + 30, y6 + 4, ranged_options[ranged_choice_order], 0.4, 0.4, 0); + y6 += spac; + } + + draw_set_alpha(1); + + draw_line(445, 490, 1125, 490); + draw_line(445, 491, 1125, 491); + draw_line(445, 492, 1125, 492); + + draw_set_font(fnt_40k_30b); + // draw_text_transformed(444,505,"Select Speciality",0.6,0.6,0); + draw_set_halign(fa_center); + + var psy_intolerance = array_contains(dis, "Psyker Intolerant"); + if ((chapter_master_specialty == 3) && ((race[100, 17] == 0) || psy_intolerance)) { + chapter_master_speciality = choose(1, 2); + } + x6 = 474; + y6 = 500; + h = 0; + it = ""; + var leader_types = [["", ""], ["Born Leader", "You always know the right words to inspire your men or strike doubt in the hearts of the enemy. Increases Disposition and Grants a +10% Requisition Income Bonus."], ["Champion", "Even before your rise to Chapter Master you were a renowned warrior, nearly without compare. Increases Chapter Master Experience, Melee Damage, and Ranged Damage."], ["Psyker", "The impossible is nothing to you; despite being a Psyker you have slowly risen to lead a Chapter. Chapter Master gains every Power within the chosen Discipline."]]; + repeat (3) { + h += 1; + var cur_leader_type = leader_types[h]; + draw_set_alpha(1); + var nope = (h == 3) && ((race[100, 17] == 0) || psy_intolerance); + if (nope) { + draw_set_alpha(0.5); + } + if ((custom < 2) || (restarted > 0)) { + draw_set_alpha(0.5); + } + + // draw_sprite(spr_cm_specialty,h-1,x6,y6); + scr_image("commander", h - 1, x6, y6, 162, 208); + + draw_text_transformed(x6 + 81, y6 + 214, cur_leader_type[0], 0.5, 0.5, 0); + + draw_sprite(spr_creation_check, chapter_master_specialty == h, x6, y6 + 214); + + if (scr_hit(x6, y6 + 214, x6 + 32, y6 + 32 + 214) && (cooldown <= 0) && (mouse_left >= 1) && (custom > 1) && (restarted == 0) && (nope == 0)) { + cooldown = 8000; + var onceh = 0; + if ((chapter_master_specialty != h) && (onceh == 0)) { + chapter_master_specialty = h; + onceh = 1; + } + } + if (scr_hit(x6, y6 + 214, x6 + 162, y6 + 234) && (nope == 0)) { + tooltip = cur_leader_type[0]; + tooltip2 = cur_leader_type[1]; + } + + x6 += 240; + draw_set_alpha(1); + } + + //adds "Save Chapter" button if custom chapter in a save slot + + if (custom > 0 && global.chapter_id != eCHAPTERS.UNKNOWN) { + draw_rectangle(1000, 135, 1180, 170, 1); + draw_text_transformed(1090, 140, string("Save Chapter"), 0.6, 0.6, 0); + draw_set_font(fnt_40k_14b); + if (scr_hit(1000, 135, 1180, 170)) { + tooltip = "Do you want to save your chapter?"; + tooltip2 = "Click to save your chapter"; + if (mouse_left >= 1) { + scr_save_chapter(global.chapter_id); + + tooltip = "Do you want to save your chapter?"; + tooltip2 = "Chapter Saved!"; + } + } + } + } + + /* */ + + // 850,860 + + var xx, yy; + xx = 375; + yy = 10; + + if (change_slide > 0) { + draw_set_color(c_black); + if (change_slide == 3) { + if (slate5 <= 0) { + slate5 = 1; + } + if ((slate5 >= 5) && (slate6 == 0)) { + slate6 = 1; + } + } + if (change_slide <= 30) { + draw_set_alpha(change_slide / 30); + } + if (change_slide > 40) { + draw_set_alpha(2.33 - (change_slide / 30)); + } + draw_rectangle(430, 66, 702, 750, 0); + draw_rectangle(703, 80, 1171, 750, 0); + draw_rectangle(518, 750, 1075, 820, 0); + } + + draw_set_color(5998382); + if (slate5 > 0) { + if (slate5 <= 30) { + draw_set_alpha(slate5 / 30); + } + if (slate5 > 30) { + draw_set_alpha(1 - ((slate5 - 30) / 30)); + } + draw_line(xx + 30, yy + 70 + (slate5 * 12), xx + 790, yy + 70 + (slate5 * 12)); + } + if (slate6 > 0) { + if (slate6 <= 30) { + draw_set_alpha(slate6 / 30); + } + if (slate6 > 30) { + draw_set_alpha(1 - ((slate6 - 30) / 30)); + } + draw_line(xx + 30, yy + 70 + (slate6 * 12), xx + 790, yy + 70 + (slate6 * 12)); + } + + if (fade_in > 0) { + draw_set_alpha(fade_in / 50); + draw_set_color(0); + draw_rectangle(0, 0, room_width, room_height, 0); + } + draw_set_alpha(1); + // draw_set_color(c_red); + // draw_text(mouse_x+20,mouse_y+20,string(change_slide)); + + if (slide == 1) { + draw_set_alpha(slate4 / 30); + if (slide == 1) { + draw_sprite(spr_creation_arrow, 2, 607, 761); + } + if (slide != 1) { + draw_sprite(spr_creation_arrow, 0, 607, 761); + } + draw_sprite(spr_creation_arrow, 3, 927, 761); + + var q, x3, y3; + q = 1; + x3 = (room_width / 2) - 65; + y3 = 790; + draw_set_color(38144); + repeat (6) { + draw_circle(x3, y3, 10, 1); + draw_circle(x3, y3, 9.5, 1); + draw_circle(x3, y3, 9, 1); + + if (slide == q) { + draw_circle(x3, y3, 8.5, 0); + } + if (slide != q) { + draw_circle(x3, y3, 8.5, 1); + } + x3 += 25; + q += 1; + } + } + + if ((slide >= 2) || (goto_slide >= 2)) { + draw_set_alpha(1); + draw_sprite(spr_creation_arrow, 0, 607, 761); + draw_sprite(spr_creation_arrow, 1, 927, 761); + if (slide == 1) { + draw_sprite(spr_creation_arrow, 2, 607, 761); + } + + // skip to end >> button + if ((slide >= 2) && (slide < 6) && (custom != 2)) { + draw_set_alpha(0.8); + if ((popup == "") && ((change_slide >= 70) || (change_slide <= 0)) && scr_hit(927 + 64 + 12, 761 + 12, 927 + 128 - 12, 761 + 64 - 12)) { + draw_set_alpha(1); + } + draw_sprite(spr_creation_arrow, 4, 927 + 64, 761); + if ((popup == "") && ((change_slide >= 70) || (change_slide <= 0)) && (cooldown <= 0) && (mouse_left >= 1)) { + if (scr_hit(927 + 64 + 12, 761 + 12, 927 + 128 - 12, 761 + 64 - 12)) { + scr_creation(2); + scr_creation(3.5); + scr_creation(4); + scr_creation(5); + scr_creation(6); + } + } + } + draw_set_alpha(1); + + var q = 1, x3 = (room_width / 2) - 65, y3 = 790; + draw_set_color(38144); + repeat (6) { + draw_circle(x3, y3, 10, 1); + draw_circle(x3, y3, 9.5, 1); + draw_circle(x3, y3, 9, 1); + + if (slide_show == q) { + draw_circle(x3, y3, 8.5, 0); + } + if (slide_show != q) { + draw_circle(x3, y3, 8.5, 1); + } + x3 += 25; + q += 1; + } + + if ((popup == "") && ((change_slide >= 70) || (change_slide <= 0)) && (cooldown <= 0)) { + if ((mouse_x > 925) && (mouse_y > 756) && (mouse_x < 997) && (mouse_y < 824) && (mouse_left >= 1) && (!instance_exists(obj_creation_popup))) { + // Next slide + if (slide >= 2 && slide <= 6) { + scr_creation(slide); + } + } + + if (point_and_click([604, 756, 675, 824]) && (cooldown <= 0) && (!instance_exists(obj_creation_popup))) { + // Previous slide + cooldown = 8000; + change_slide = 1; + goto_slide = slide - 1; + popup = ""; + if (goto_slide == 1) { + highlight = 0; + highlighting = 0; + old_highlight = 0; + } + } + } + } + + if (tooltip != "" && tooltip2 != "" && change_slide <= 0) { + draw_set_alpha(1); + draw_set_color(0); + draw_set_halign(fa_left); + draw_set_font(fnt_40k_14b); + var _width1 = string_width_ext(string_hash_to_newline(tooltip), -1, 500); + draw_set_font(fnt_40k_14); + var _width2 = string_width_ext(string_hash_to_newline(tooltip2), -1, 500); + var _height = string_height_ext(string_hash_to_newline(tooltip2), -1, 500); + + draw_rectangle(mouse_x + 18, mouse_y + 20, mouse_x + max(_width1, _width2) + 24, mouse_y + 44 + _height, 0); + draw_set_color(38144); + draw_rectangle(mouse_x + 18, mouse_y + 20, mouse_x + max(_width1, _width2) + 24, mouse_y + 44 + _height, 1); + draw_set_font(fnt_40k_14b); + draw_text(mouse_x + 22, mouse_y + 22, string_hash_to_newline(string(tooltip))); + draw_set_font(fnt_40k_14); + draw_text_ext(mouse_x + 22, mouse_y + 42, string_hash_to_newline(string(tooltip2)), -1, 500); + } +} catch (_exception) { + handle_exception(_exception); + room_goto(Main_Menu); +} diff --git a/objects/obj_creation/Step_0.gml b/objects/obj_creation/Step_0.gml index a8fdbd44b..4d3acc619 100644 --- a/objects/obj_creation/Step_0.gml +++ b/objects/obj_creation/Step_0.gml @@ -24,15 +24,15 @@ if (slide==1){ if (keyboard_string=="137"){ highlight=18; cooldown=8000; - chapter="Doom Benefactors"; - scr_chapter_new(chapter); + chapter_name="Doom Benefactors"; + scr_chapter_new(chapter_name); keyboard_string=""; - if (chapter!="nopw_nopw"){ + if (chapter_name!="nopw_nopw"){ icon=25; custom=0; change_slide=1; goto_slide=2; - chapter_string=chapter; + chapter_string=chapter_name; } scr_creation(2); scr_creation(3.5); @@ -72,7 +72,7 @@ if (change_slide>0){change_slide+=1;} if (change_slide>=100) then change_slide=-1; if (change_slide>=100) then change_slide=-1; // Sets up a new chapter with default options -if (change_slide==35) or (change_slide==36) or (chapter=="Doom Benefactors") or (chapter_string=="Doom Benefactors"){ +if (change_slide==35) or (change_slide==36) or (chapter_name=="Doom Benefactors") or (chapter_string=="Doom Benefactors"){ if (goto_slide==1){ mouse_left=0; mouse_right=0; @@ -89,7 +89,7 @@ if (change_slide==35) or (change_slide==36) or (chapter=="Doom Benefactors") or target_gear=0; tab=0; - chapter="Unnamed"; + chapter_name="Unnamed"; chapter_string="Unnamed"; icon=1; icon_name="da"; @@ -120,10 +120,10 @@ if (change_slide==35) or (change_slide==36) or (chapter=="Doom Benefactors") or battle_cry="For the Emperor"; main_color=1; secondary_color=1; - trim_color=1; + main_trim=1; // Left/Right pauldron - pauldron2_color=1; - pauldron_color=1; + left_pauldron=1; + right_pauldron=1; lens_color=1; weapon_color=1; col_special=0; @@ -185,93 +185,76 @@ if (cooldown>0) and (cooldown<=5000) then cooldown-=1; // Checks if the name already exists if (custom==2){ name_bad=0; - if (chapter=="") then name_bad=1; - if (chapter=="Dark Angels") then name_bad=1; - if (chapter=="White Scars") then name_bad=1; - if (chapter=="Space Wolves") then name_bad=1; - if (chapter=="Imperial Fists") then name_bad=1; - if (chapter=="Blood Angels") then name_bad=1; - if (chapter=="Iron Hands") then name_bad=1; - if (chapter=="Ultramarines") then name_bad=1; - if (chapter=="Salamanders") then name_bad=1; - if (chapter=="Raven Guard") then name_bad=1; - if (chapter=="Blood Ravens") then name_bad=1; - if (chapter=="Doom Benefactors") then name_bad=1; - if (chapter=="Crimson Fists") then name_bad=1; - if (chapter=="Minotaurs") then name_bad=1; - if (chapter=="Black Templars") then name_bad=1; - if (chapter=="Soul Drinkers") then name_bad=1; + if (chapter_name=="") then name_bad=1; + if (chapter_name=="Dark Angels") then name_bad=1; + if (chapter_name=="White Scars") then name_bad=1; + if (chapter_name=="Space Wolves") then name_bad=1; + if (chapter_name=="Imperial Fists") then name_bad=1; + if (chapter_name=="Blood Angels") then name_bad=1; + if (chapter_name=="Iron Hands") then name_bad=1; + if (chapter_name=="Ultramarines") then name_bad=1; + if (chapter_name=="Salamanders") then name_bad=1; + if (chapter_name=="Raven Guard") then name_bad=1; + if (chapter_name=="Blood Ravens") then name_bad=1; + if (chapter_name=="Doom Benefactors") then name_bad=1; + if (chapter_name=="Crimson Fists") then name_bad=1; + if (chapter_name=="Minotaurs") then name_bad=1; + if (chapter_name=="Black Templars") then name_bad=1; + if (chapter_name=="Soul Drinkers") then name_bad=1; } var good=0; -if (color_to_main!=""){ - good=0; - for(var q=0; q0){ + if (color_to_main!=""){ + main_color = max(array_find_value(col,color_to_main),0); + color_to_main = ""; } -} -if (color_to_secondary!=""){ - good=0; - for(var q=0; q 0 ? 0.5 : 1; confirm_gear_button.rects = draw_unit_buttons([614,716], "CONFIRM",[1,1], 38144,, fnt_40k_14b, confirm_gear_button.alpha); if (point_and_click(confirm_gear_button.rects) and (target_gear = 0)) { + var possible_custom_roles = [ + ["chapter_master", eROLE.ChapterMaster], + ["honour_guard",eROLE.HonourGuard], + ["veteran",eROLE.Veteran], + ["terminator",eROLE.Terminator], + ["captain",eROLE.Captain], + ["dreadnought",eROLE.Dreadnought], + ["champion",eROLE.Champion], + ["tactical",eROLE.Tactical], + ["devastator",eROLE.Devastator], + ["assault",eROLE.Assault], + ["ancient",eROLE.Ancient], + ["scout",eROLE.Scout], + ["chaplain",eROLE.Chaplain], + ["apothecary",eROLE.Apothecary], + ["techmarine",eROLE.Techmarine], + ["librarian",eROLE.Librarian], + ["sergeant",eROLE.Sergeant], + ["veteran_sergeant",eROLE.VeteranSergeant], + ]; + + var _role_id = ide; + for(var i = 0; i < array_length(possible_custom_roles); i++){ + if(possible_custom_roles[i][1] == _role_id){ + var c_role = { + name: obj_creation.role[100][_role_id], + wep1: obj_creation.wep1[100][_role_id], + wep2: obj_creation.wep2[100][_role_id], + gear: obj_creation.gear[100][_role_id], + mobi: obj_creation.mobi[100][_role_id], + armour: obj_creation.armour[100][_role_id] + } + show_debug_message($"Updating role {_role_id} from {obj_creation.custom_roles}"); + variable_struct_set(obj_creation.custom_roles, possible_custom_roles[i][0], c_role); + } + } + show_debug_message($"New obj_creation.custom_roles {obj_creation.custom_roles}"); + obj_creation.cooldown = 8000; instance_destroy(); } - + draw_set_halign(fa_left); if (scr_hit(434,591,594,709)=true){ tooltip="Gear";tooltip2="The equipment this Astartes Role defaults to. Note that if defaults are set to expensive items the Astartes may instead be provided with more usual equipment."; @@ -184,96 +234,108 @@ if (col_shift){ -if (target_gear>0){ - var i;i=-1;repeat(50){i+=1;item_name[i]="";} - tab=1;scr_weapons_equip(); +if (target_gear > 0) { + tab = 1; + item_name = []; + scr_get_item_names( + item_name, + type - 100, // eROLE + target_gear, // slot + tab, // eEngagement + false, // no company standard + false // don't limit to available items + ); draw_set_color(0); - draw_rectangle(851,210,1168,749,0); + draw_rectangle(851, 210, 1168, 749, 0); draw_set_color(38144); - draw_rectangle(844,200,1166,748,1); - draw_rectangle(845,201,1165,747,1); - draw_rectangle(846,202,1164,746,1); + draw_rectangle(844, 200, 1166, 748, 1); + draw_rectangle(845, 201, 1165, 747, 1); + draw_rectangle(846, 202, 1164, 746, 1); draw_set_font(fnt_40k_30b); - if (target_gear=1) then draw_text_transformed(862,215,string_hash_to_newline("Select First Weapon"),0.6,0.6,0); - if (target_gear=2) then draw_text_transformed(862,215,string_hash_to_newline("Select Second Weapon"),0.6,0.6,0); - if (target_gear=3) then draw_text_transformed(862,215,string_hash_to_newline("Select Armour"),0.6,0.6,0); - if (target_gear=4) then draw_text_transformed(862,215,string_hash_to_newline("Select Mobility Item"),0.6,0.6,0); - if (target_gear=5) then draw_text_transformed(862,215,string_hash_to_newline("Select Special Item"),0.6,0.6,0); + var slot_name = get_slot_name(type - 100, target_gear); + draw_text_transformed(862, 215, string_hash_to_newline($"Select {slot_name}"), 0.6, 0.6, 0); draw_set_font(fnt_40k_14b); - var x3,y3,space,h;h=0;x3=862;y3=245;space=18; - repeat(23){h+=1;draw_set_color(38144); - if (item_name[h]!=""){ - if (string_width(string_hash_to_newline(item_name[h]))>=140) then draw_text_transformed(x3,y3,string_hash_to_newline(item_name[h]),0.75,1,0); - if (string_width(string_hash_to_newline(item_name[h]))<140) then draw_text_transformed(x3,y3,string_hash_to_newline(item_name[h]),1,1,0);y3+=space; + var x3 = 862; + var y3 = 245; + var space = 18; + + for (var h = 0; h < array_length(item_name); h++) { + draw_set_color(38144); + var scale = string_width(string_hash_to_newline(item_name[h])) >= 140 ? 0.75 : 1; + draw_text_transformed(x3, y3, string_hash_to_newline(item_name[h]), scale, 1, 0); + y3 += space; + + if (scr_hit(x3, y3 - space, x3 + 143, y3 + 17 - space)) { + draw_set_color(c_white); + draw_set_alpha(0.2); + draw_text_transformed(x3, y3 - space, string_hash_to_newline(item_name[h]), scale, 1, 0); + draw_set_alpha(1); - // x2 was 1150 - if (scr_hit(x3,y3-space,x3+143,y3+17-space)=true){ - if (string_width(string_hash_to_newline(item_name[h]))<140){ - draw_set_color(c_white);draw_set_alpha(0.2); - draw_text_transformed(x3,y3-space,string_hash_to_newline(item_name[h]),1,1,0);draw_set_alpha(1); - } - if (string_width(string_hash_to_newline(item_name[h]))>=140){ - draw_set_color(c_white);draw_set_alpha(0.2); - draw_text_transformed(x3,y3-space,string_hash_to_newline(item_name[h]),0.75,1,0);draw_set_alpha(1); - } - - if (obj_creation.mouse_left=1) and (obj_creation.cooldown<=0){ - var buh;buh=item_name[h];obj_creation.cooldown=8000; - if (item_name[h]="(None)") then buh=""; - if (target_gear=1) then obj_creation.wep1[co,ide]=buh; - if (target_gear=2) then obj_creation.wep2[co,ide]=buh; - if (target_gear=3) then obj_creation.armour[co,ide]=buh; - if (target_gear=4) then obj_creation.gear[co,ide]=buh; - if (target_gear=5) then obj_creation.mobi[co,ide]=buh; - target_gear=0; + if (obj_creation.mouse_left && obj_creation.cooldown <= 0) { + var buh = item_name[h] == ITEM_NAME_NONE ? "" : item_name[h]; + obj_creation.cooldown = 8000; + switch (target_gear) { + case 1: obj_creation.wep1[co, ide] = buh; break; + case 2: obj_creation.wep2[co, ide] = buh; break; + case 3: obj_creation.armour[co, ide] = buh; break; + case 4: obj_creation.gear[co, ide] = buh; break; + case 5: obj_creation.mobi[co, ide] = buh; break; } + target_gear = 0; } } } - if (target_gear=1) or (target_gear=2){ - var i;i=-1;repeat(50){i+=1;item_name[i]="";} - tab=2;scr_weapons_equip(); + if (target_gear == 1 || target_gear == 2) { + tab = 2; + item_name = []; + scr_get_item_names( + item_name, + type - 100, // eROLE + target_gear, // slot + tab, // eEngagement + false, // no company standard + false // don't limit to available items + ); - var x3,y3,h,space;h=0;x3=862+146;y3=245;space=18; - repeat(23){h+=1;draw_set_color(38144); - if (item_name[h]!=""){ - if (string_width(string_hash_to_newline(item_name[h]))>=140) then draw_text_transformed(x3,y3,string_hash_to_newline(item_name[h]),0.75,1,0); - if (string_width(string_hash_to_newline(item_name[h]))<140) then draw_text_transformed(x3,y3,string_hash_to_newline(item_name[h]),1,1,0);y3+=space; - - if (scr_hit(x3,y3-space,x3+143,y3+17-space)=true){ - - if (string_width(string_hash_to_newline(item_name[h]))<140){ - draw_set_color(c_white);draw_set_alpha(0.2); - draw_text_transformed(x3,y3-space,string_hash_to_newline(item_name[h]),1,1,0);draw_set_alpha(1); - } - if (string_width(string_hash_to_newline(item_name[h]))>=140){ - draw_set_color(c_white);draw_set_alpha(0.2); - draw_text_transformed(x3,y3-space,string_hash_to_newline(item_name[h]),0.75,1,0);draw_set_alpha(1); - } - - if (obj_creation.mouse_left=1) and (obj_creation.cooldown<=0){ - var buh;buh=item_name[h];obj_creation.cooldown=8000; - if (item_name[h]="(None)") then buh=""; - if (target_gear=1) then obj_creation.wep1[co,ide]=buh; - if (target_gear=2) then obj_creation.wep2[co,ide]=buh; - if (target_gear=3) then obj_creation.armour[co,ide]=buh; - if (target_gear=4) then obj_creation.gear[co,ide]=buh; - if (target_gear=5) then obj_creation.mobi[co,ide]=buh; - target_gear=0; + x3 = 862 + 146; + y3 = 245; + + for (var h = 0; h < array_length(item_name); h++) { + draw_set_color(38144); + var scale = string_width(string_hash_to_newline(item_name[h])) >= 140 ? 0.75 : 1; + draw_text_transformed(x3, y3, string_hash_to_newline(item_name[h]), scale, 1, 0); + y3 += space; + + if (scr_hit(x3, y3 - space, x3 + 143, y3 + 17 - space)) { + draw_set_color(c_white); + draw_set_alpha(0.2); + draw_text_transformed(x3, y3 - space, string_hash_to_newline(item_name[h]), scale, 1, 0); + draw_set_alpha(1); + + if (obj_creation.mouse_left && obj_creation.cooldown <= 0) { + var buh = item_name[h] == ITEM_NAME_NONE ? "" : item_name[h]; + obj_creation.cooldown = 8000; + switch (target_gear) { + case 1: obj_creation.wep1[co, ide] = buh; break; + case 2: obj_creation.wep2[co, ide] = buh; break; + case 3: obj_creation.armour[co, ide] = buh; break; + case 4: obj_creation.gear[co, ide] = buh; break; + case 5: obj_creation.mobi[co, ide] = buh; break; } + target_gear = 0; } } } - tab=1; + tab = 1; } - - + + if (point_and_click(draw_unit_buttons([980,716], "CANCEL",[1,1], 38144,, fnt_40k_14b, 1))){ target_gear=0; obj_creation.cooldown=8000 diff --git a/objects/obj_defeat/Draw_0.gml b/objects/obj_defeat/Draw_0.gml index 70a9082db..caa9085cc 100644 --- a/objects/obj_defeat/Draw_0.gml +++ b/objects/obj_defeat/Draw_0.gml @@ -7,19 +7,13 @@ var xx,yy,cus; xx=331;yy=93; cus=false; -if (string_count("custom",global.icon_name)>0) then cus=true; -if (cus=true){ - var cusl;cusl=string_replace(global.icon_name,"custom","");cusl=real(cusl); - if (obj_cuicons.spr_custom[cusl]>0) and (obj_cuicons.spr_custom_icon[cusl]!=-1){ - draw_sprite_stretched(obj_cuicons.spr_custom_icon[cusl],0,728,83,135,135); - } -} -if (cus=false){ - // if (global.icon<=20) then draw_sprite_stretched(spr_icon,global.icon,728,83,135,135); - if (global.icon<=20) then scr_image("creation",global.icon,728,83,135,135); - if (global.icon>20) then draw_sprite_stretched(spr_icon_chapters,global.icon-19,728,83,135,135); -} -// 728,103 +var sprx = 728, + spry = 83, + sprw = 135, + sprh = 135 + +draw_sprite_stretched(global.chapter_icon_sprite, global.chapter_icon_frame, sprx, spry, sprw, sprh); + draw_set_color(c_black); draw_set_alpha(fade/faded); diff --git a/objects/obj_drop_select/Alarm_1.gml b/objects/obj_drop_select/Alarm_1.gml index 980b7217a..8b1378917 100644 --- a/objects/obj_drop_select/Alarm_1.gml +++ b/objects/obj_drop_select/Alarm_1.gml @@ -1,311 +1 @@ - -l_master=0; -l_honor=0; -l_capts=0; -l_mahreens=0; -l_veterans=0; -l_terminators=0; -l_dreads=0; -l_chaplains=0; -l_psykers=0; -l_apothecaries=0; -l_techmarines=0; -l_champions=0; -l_size=0; -// Attack -l_bikes=0; -l_rhinos=0; -l_whirls=0; -l_predators=0; -l_raiders=0; -l_speeders=0; - -max_ships=0; - - -q=500; - - - - -// Formation check -var i,is,arright;i=0;formation_current=0;is=0;arright=false; -repeat(12){i+=1;formation_possible[i]=0; - if (obj_controller.bat_formation[i]!="") and (attack=1) and (obj_controller.bat_formation_type[i]=1){ - is+=1;formation_possible[is]=i; - } - if (obj_controller.bat_formation[i]!="") and (attack=0) and (obj_controller.bat_formation_type[i]=2){ - is+=1;formation_possible[is]=i;// show_message("formation possible "+string(is)+" is set to "+string(i)); - } -} - - -if (attack=0){formation_current=obj_controller.last_raid_form; - i=0;repeat(12){i+=1;if (formation_possible[i]=formation_current) and (arright=false){arright=true;formation_current=i;}} -} -if (attack=1){formation_current=obj_controller.last_attack_form; - i=0;repeat(12){i+=1;if (formation_possible[i]=formation_current) and (arright=false){arright=true;formation_current=i;}} -} -if (arright=false) then formation_current=formation_possible[1]; - - - -// show_message("Star: "+string(p_target.name)+", Planet: "+string(planet_number)); - -var unit; -for (var co = 0; co <= 10; co++) { - for (var i = 0; i <= 300; i++) { - if (i <= 100) { - if (obj_ini.veh_loc[co][i] = p_target.name) && (obj_ini.veh_wid[co][i] = planet_number) && (attack = 1) { - if (obj_ini.veh_role[co][i] = "Land Speeder") then l_speeders += 1; - if (obj_ini.veh_role[co][i] = "Rhino") then l_rhinos += 1; - if (obj_ini.veh_role[co][i] = "Whirlwind") then l_whirls += 1; - if (obj_ini.veh_role[co][i] = "Predator") then l_predators += 1; - if (obj_ini.veh_role[co][i] = "Land Raider") then l_raiders += 1; - } - } - unit = obj_ini.TTRPG[co][i]; - if (unit.name() == "") then - continue; - if (obj_ini.loc[co][i] = p_target.name) && (unit.planet_location == planet_number) { - if ((attack = 0) && (string_count("Bike", obj_ini.role[co][i]) = 0)) || (attack = 1) { - if (unit.role() = "Chapter Master") then l_master += 1; - if (unit.role() = obj_ini.role[100][2]) then l_honor += 1; - if (unit.role() = obj_ini.role[100][5]) then l_capts += 1; - if (unit.role() = "Champion") then l_champions += 1; - - if (string_count("Bike", obj_ini.role[co][i]) = 0) || (attack = 0) { - if (obj_ini.role[co][i] = obj_ini.role[100][11]) then l_mahreens += 1; - if (unit.IsSpecialist("rank_and_file")) then l_mahreens++ - if (obj_ini.role[co][i] = obj_ini.role[100][3]) then l_veterans += 1; - } - if (string_count("Bike", obj_ini.role[co][i]) > 0) && (attack = 1) { - if (obj_ini.role[co][i] = obj_ini.role[100][11]) then l_bikes += 1; - if (unit.IsSpecialist("rank_and_file")) then l_bikes++ - if (obj_ini.role[co][i] = obj_ini.role[100][3]) then l_bikes += 1; - } - - if (unit.role() = obj_ini.role[100][4]) then l_terminators += 1; - if (unit.role() = obj_ini.role[100][6]) then l_dreads += 1; - if (unit.IsSpecialist("chap", true)) then l_chaplains += 1; - if (unit.IsSpecialist("libs", true)) then l_psykers += 1; - if (unit.IsSpecialist("apoth", true)) then l_apothecaries += 1; - if (unit.IsSpecialist("forge", true)) then l_techmarines += 1; - } - } - } -} - - -l_size+=l_master; -l_size+=l_honor; -l_size+=l_capts; -l_size+=l_mahreens; -l_size+=l_veterans; -l_size+=l_terminators; -l_size+=l_dreads; -l_size+=l_chaplains; -l_size+=l_psykers; -l_size+=l_apothecaries; -l_size+=l_techmarines; -l_size+=l_champions; - -l_size+=l_bikes; -l_size+=(rhinos+predators+whirls)*10; -l_size+=l_speeders*6; -l_size+=l_raiders*20; - -ship_use[500]=0; -ship_max[500]=l_size; -purge_d=ship_max[500]; - - - -var __b__; -__b__ = action_if_variable(purge, 0, 0); -if __b__ -{ - -if (sh_target!=-50){ - max_ships=sh_target.capital_number+sh_target.frigate_number+sh_target.escort_number; - - if (sh_target.acted>1) then instance_destroy(); - - var tump;tump=0; - - var i, q, b;i=0;q=0;b=0; - repeat(sh_target.capital_number){ - b+=1; - if (sh_target.capital[b]!="") and (obj_ini.ship_carrying[sh_target.capital_num[b]]>0){ - i+=1; - ship[i]=sh_target.capital[i]; - - ship_use[i]=0; - tump=sh_target.capital_num[i]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - } - } - q=0; - repeat(sh_target.frigate_number){ - q+=1; - if (sh_target.frigate[q]!="") and (obj_ini.ship_carrying[sh_target.frigate_num[q]]>0){ - i+=1; - ship[i]=sh_target.frigate[q]; - - ship_use[i]=0; - tump=sh_target.frigate_num[q]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - } - } - q=0; - repeat(sh_target.escort_number){ - q+=1; - if (sh_target.escort[q]!="") and (obj_ini.ship_carrying[sh_target.escort_num[q]]>0){ - i+=1; - ship[i]=sh_target.escort[q]; - - ship_use[i]=0; - tump=sh_target.escort_num[q]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - } - } - -} - - -sisters=p_target.p_sisters[planet_number]; -eldar=p_target.p_eldar[planet_number]; -ork=p_target.p_orks[planet_number]; -tau=p_target.p_tau[planet_number]; -tyranids=p_target.p_tyranids[planet_number]; -csm=p_target.p_chaos[planet_number]; -traitors=p_target.p_traitors[planet_number]; -necrons=p_target.p_necrons[planet_number]; -demons=p_target.p_demons[planet_number]; - -if (p_target.p_player[planet_number]>0) then max_ships+=1; - -var bes,bes_score;bes=0;bes_score=0; -if (sisters>0) and (obj_controller.faction_status[eFACTION.Ecclesiarchy]="War"){bes=5;bes_score=sisters;} -if (eldar>bes_score){bes=6;bes_score=eldar;} -if (ork>bes_score){bes=7;bes_score=ork;} -if (tau>bes_score){bes=8;bes_score=tau;} -if (tyranids>bes_score){bes=9;bes_score=tyranids;} -if (traitors>bes_score){bes=10;bes_score=traitors;} -if (csm>bes_score){bes=11;bes_score=csm;} -if (necrons>bes_score){bes=13;bes_score=necrons;} -if (demons>0){bes=12;bes_score=demons;} -if (bes_score>0) then attacking=bes; - -var spesh;spesh=false; -if (planet_feature_bool(p_target.p_feature[planet_number],P_features.Warlord10)==1) and (obj_controller.faction_defeated[10]=0) and (obj_controller.faction_gender[10]=1) and (obj_controller.known[eFACTION.Chaos]>0) and (obj_controller.turn>=obj_controller.chaos_turn) then spesh=true; - - -if (has_problem_planet(planet_number, "tyranid_org", p_target)){ - tyranids=2; - attacking=9; -} - -var forces,t_attack;forces=0;t_attack=0; -if (sisters>0){forces+=1;force_present[forces]=5;} -if (eldar>0){forces+=1;force_present[forces]=6;} -if (ork>0){forces+=1;force_present[forces]=7;} -if (tau>0){forces+=1;force_present[forces]=8;} -if (tyranids>0){forces+=1;force_present[forces]=9;} -if (traitors>0) or ((traitors=0) and (spesh=true)){forces+=1;force_present[forces]=10;} -if (csm>0){forces+=1;force_present[forces]=11;} -if (demons>0){forces+=1;force_present[forces]=12;} -if (necrons>0){forces+=1;force_present[forces]=13;} - - -} -__b__ = action_if_variable(purge, 1, 0); -if __b__ -{ - - - - -if (sh_target!=-50){ - - max_ships=sh_target.capital_number+sh_target.frigate_number+sh_target.escort_number; - - - if (sh_target.acted>=1) then instance_destroy(); - - var tump;tump=0; - - var i, q, b;i=0;q=0;b=0; - repeat(sh_target.capital_number){ - b+=1; - if (sh_target.capital[b]!=""){ - i+=1; - ship[i]=sh_target.capital[i]; - - ship_use[i]=0; - tump=sh_target.capital_num[i]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - - ship_size[i]=3; - - purge_a+=3; - purge_b+=ship_max[i];purge_c+=ship_max[i];purge_d+=ship_max[i]; - } - } - q=0; - repeat(sh_target.frigate_number){ - q+=1; - if (sh_target.frigate[q]!=""){ - i+=1; - ship[i]=sh_target.frigate[q]; - - ship_use[i]=0; - tump=sh_target.frigate_num[q]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - - ship_size[i]=2; - - purge_a+=1; - purge_b+=ship_max[i];purge_c+=ship_max[i];purge_d+=ship_max[i]; - } - } - q=0; - repeat(sh_target.escort_number){ - q+=1; - if (sh_target.escort[q]!="") and (obj_ini.ship_carrying[sh_target.escort_num[q]]>0){ - i+=1; - ship[i]=sh_target.escort[q]; - - ship_use[i]=0; - tump=sh_target.escort_num[q]; - ship_max[i]=obj_ini.ship_carrying[tump]; - ship_ide[i]=tump; - - ship_size[i]=1; - - purge_b+=ship_max[i];purge_c+=ship_max[i];purge_d+=ship_max[i]; - } - } - -} - -if (p_target.p_player[planet_number]>0) then max_ships+=1; -var pp=planet_number; -purge_d = p_target.p_type[pp]!="Dead"; - -if (has_problem_planet(pp,"succession",p_target)) then purge_d=0 - -if (p_target.dispo[pp]<-2000) then purge_d=0; - -if (planet_feature_bool(p_target.p_feature[pp],P_features.Monastery)==1) and (obj_controller.homeworld_rule!=1) then purge_d=0; - -if (p_target.p_type[pp]="Dead") then purge_d=0; - - -} diff --git a/objects/obj_drop_select/Alarm_2.gml b/objects/obj_drop_select/Alarm_2.gml index 0879ecee8..f58e7404d 100644 --- a/objects/obj_drop_select/Alarm_2.gml +++ b/objects/obj_drop_select/Alarm_2.gml @@ -6,7 +6,7 @@ repeat(31){ ship_all[i]=0; ship_use[i]=0; ship_max[i]=0; - ship_ide[i]=0; + ship_ide[i]=-1; } max_ships=0; @@ -24,50 +24,39 @@ if (l_size>0) then l_size=l_size*-1; if (sh_target!=-50){ - var tump;tump=0; - var i, q, b;i=0;q=0;b=0; - repeat(sh_target.capital_number){ - b+=1; - if (sh_target.capital[b]!="") and (obj_ini.ship_carrying[sh_target.capital_num[b]]>0){ - i+=1; + var tump = 0; + var i = 0; + for (var q = 0; q < sh_target.capital_number; q++){ + if (sh_target.capital[q]!="") and (obj_ini.ship_carrying[sh_target.capital_num[q]]>0){ ship[i]=sh_target.capital[i]; - ship_use[i]=0; tump=sh_target.capital_num[i]; ship_max[i]=obj_ini.ship_carrying[tump]; ship_ide[i]=tump; ship_size[i]=3; + i+=1; } } - q=0; - repeat(sh_target.frigate_number){ - q+=1; + for (var q = 0; q < sh_target.frigate_number; q++) { if (sh_target.frigate[q]!="") and (obj_ini.ship_carrying[sh_target.frigate_num[q]]>0){ - i+=1; - ship[i]=sh_target.frigate[q]; - + ship[i]=sh_target.frigate[q]; ship_use[i]=0; tump=sh_target.frigate_num[q]; ship_max[i]=obj_ini.ship_carrying[tump]; ship_ide[i]=tump; ship_size[i]=2; + i+=1; } } - q=0; - repeat(sh_target.escort_number){ - q+=1; + for (var q = 0; q < sh_target.escort_number; q++) { if (sh_target.escort[q]!="") and (obj_ini.ship_carrying[sh_target.escort_num[q]]>0){ - i+=1; ship[i]=sh_target.escort[q]; - ship_use[i]=0; tump=sh_target.escort_num[q]; ship_max[i]=obj_ini.ship_carrying[tump]; ship_ide[i]=tump; ship_size[i]=1; + i+=1; } } - } - - diff --git a/objects/obj_drop_select/Alarm_3.gml b/objects/obj_drop_select/Alarm_3.gml index d10938ccc..7b04af3c2 100644 --- a/objects/obj_drop_select/Alarm_3.gml +++ b/objects/obj_drop_select/Alarm_3.gml @@ -5,7 +5,7 @@ repeat(61){ ship_all[i]=0; ship_use[i]=0; ship_max[i]=0; - ship_ide[i]=0; + ship_ide[i]=-1; } max_ships=0; diff --git a/objects/obj_drop_select/Alarm_4.gml b/objects/obj_drop_select/Alarm_4.gml index 3c69557fc..9236122bd 100644 --- a/objects/obj_drop_select/Alarm_4.gml +++ b/objects/obj_drop_select/Alarm_4.gml @@ -9,7 +9,7 @@ repeat(61){ ship_all[i]=0; ship_use[i]=0; ship_max[i]=0; - ship_ide[i]=0; + ship_ide[i]=-1; } max_ships=0; @@ -35,7 +35,8 @@ if (sh_target!=-50){ ship_size[i]=3; purge_a+=3; - purge_b+=ship_max[i];purge_c+=ship_max[i]; + purge_b+=ship_max[i]; + purge_c+=ship_max[i]; } } q=0; diff --git a/objects/obj_drop_select/Alarm_5.gml b/objects/obj_drop_select/Alarm_5.gml index 8b88ab675..e69de29bb 100644 --- a/objects/obj_drop_select/Alarm_5.gml +++ b/objects/obj_drop_select/Alarm_5.gml @@ -1,111 +0,0 @@ -// This script sets up the selected forces to drop into a planet and initiates combat -attacking=10; - -// Local Forces here -var add_ground=0; -var w=-1,smin=0,smax=0; - -// Sets up the ground forces -if (add_ground==1){ - ships_selected+=1; - remove_local=-1; - bikes+=l_bikes; - rhinos+=l_rhinos; - whirls+=l_whirls; - predators+=l_predators; - raiders+=l_raiders; - speeders+=l_speeders; - - refresh_raid=1; - ship_all[500]=1; - ship_use[500]=ship_max[500]; -} -if (add_ground==-1){ - ships_selected-=1; - remove_local=1; - bikes-=l_bikes; - rhinos-=l_rhinos; - whirls-=l_whirls; - predators-=l_predators; - raiders-=l_raiders; - speeders-=l_speeders; - - refresh_raid=1; - ship_all[500]=0; - ship_use[500]=0; -} -add_ground=0; - -obj_controller.cooldown=30; -// ** Starts the battle ** -is_in_combat=true; - -instance_deactivate_all(true); -instance_activate_object(obj_controller); -instance_activate_object(obj_ini); -instance_activate_object(obj_drop_select); - -instance_create(0,0,obj_ncombat); -obj_ncombat.battle_object=p_target; -obj_ncombat.battle_loc=p_target.name; -obj_ncombat.battle_id=obj_controller.selecting_planet; -obj_ncombat.dropping=0; -obj_ncombat.attacking=10; -obj_ncombat.enemy=10; -obj_ncombat.formation_set=2; - -/* -obj_ncombat.battle_object=p_target; -obj_ncombat.battle_loc=p_target.name; -obj_ncombat.battle_id=obj_controller.selecting_planet; -obj_ncombat.dropping=1-attack; -obj_ncombat.attacking=attack; -obj_ncombat.enemy=attacking; -obj_ncombat.formation_set=formation_possible[formation_current]; -*/ - -if (ship_all[500]=1) then obj_ncombat.local_forces=1; - -obj_ncombat.leader=1; -obj_ncombat.threat=5; -obj_ncombat.battle_special="WL10_reveal"; - -/* -argument0.p_heresy[argument1]+=floor(random_range(20,50)); -argument0.p_traitors[argument1]=5; -argument0.p_chaos[argument1]=4; -argument0.p_owner[argument1]=10; -*/ - -var company=0,unit_index=0,stop=false; -for (var i=0; i<3600; i++) { - if (company<11){ - unit_index+=1; - if (unit_index>300){ - company+=1; - unit_index=1; - } - if (company>10) then stop=true; - if (stop=false){ - if (fighting[company][unit_index]!=0) then obj_ncombat.fighting[company][unit_index]=1;// show_message(string(company)+":"+string(v)+" is fighting"); - if (attack=1) and (v<=100){ - if (veh_fighting[company][unit_index]!=0) then obj_ncombat.veh_fighting[company][unit_index]=1; - } - if (attack==1) and (ship_all[500]=1){ - if (obj_ini.loc[company][unit_index]=p_target.name) and (obj_ini.TTRPG[company][unit_index].planet_location=obj_controller.selecting_planet) and (fighting[company][unit_index]=1) then obj_ncombat.fighting[company][unit_index]=1; - if (unit_index<=100){ - if (obj_ini.veh_loc[company][unit_index]=p_target.name) and (obj_ini.veh_wid[company][unit_index]=obj_controller.selecting_planet) then obj_ncombat.veh_fighting[company][unit_index]=1; - } - } - } - } -} - -var ships_selected=0; -var ships_len = array_length(ship_all); -for (var i = 0; i < ships_len; i++) { - if (ship_all[i]!=0) then scr_battle_roster(ship[i],ship_ide[i],false); -} -if (ship_all[500]=1) and (attack=1) then scr_battle_roster(p_target.name,obj_controller.selecting_planet,true); - -instance_destroy(); diff --git a/objects/obj_drop_select/Alarm_6.gml b/objects/obj_drop_select/Alarm_6.gml index 8567e8fb6..e69de29bb 100644 --- a/objects/obj_drop_select/Alarm_6.gml +++ b/objects/obj_drop_select/Alarm_6.gml @@ -1,94 +0,0 @@ - -attacking=10; - -var add_ground;add_ground=0; // Local Forces here -var smin,smax,w;w=-1;smin=0;smax=0; - -if (add_ground=1){ships_selected+=1;remove_local=-1; - bikes+=l_bikes;rhinos+=l_rhinos; - whirls+=l_whirls;predators+=l_predators; - raiders+=l_raiders;speeders+=l_speeders; - - refresh_raid=1;ship_all[500]=1;ship_use[500]=ship_max[500]; -} -if (add_ground=-1){ships_selected-=1;remove_local=1; - bikes-=l_bikes;rhinos-=l_rhinos; - whirls-=l_whirls;predators-=l_predators; - raiders-=l_raiders;speeders-=l_speeders; - - refresh_raid=1;ship_all[500]=0;ship_use[500]=0; -}add_ground=0; - - -obj_controller.cooldown=30;combating=1;// Start battle here - -instance_deactivate_all(true); -instance_activate_object(obj_controller); -instance_activate_object(obj_ini); -instance_activate_object(obj_drop_select); - -instance_create(0,0,obj_ncombat); -obj_ncombat.battle_object=p_target; -obj_ncombat.battle_loc=p_target.name; -obj_ncombat.battle_id=obj_controller.selecting_planet; -obj_ncombat.dropping=0;obj_ncombat.attacking=10; -obj_ncombat.enemy=10;obj_ncombat.formation_set=1; - -/* -obj_ncombat.battle_object=p_target; -obj_ncombat.battle_loc=p_target.name; -obj_ncombat.battle_id=obj_controller.selecting_planet; -obj_ncombat.dropping=1-attack; -obj_ncombat.attacking=attack; -obj_ncombat.enemy=attacking; -obj_ncombat.formation_set=formation_possible[formation_current]; -*/ - -if (ship_all[500]=1) then obj_ncombat.local_forces=1; - -obj_ncombat.leader=1;obj_ncombat.threat=5; -obj_ncombat.battle_special="WL10_later"; - -/* -argument0.p_heresy[argument1]+=floor(random_range(20,50)); -argument0.p_traitors[argument1]=5; -argument0.p_chaos[argument1]=4; -argument0.p_owner[argument1]=10; -*/ - -var co, v, stop; -co=0;v=0;stop=0; -repeat(3600){ - if (co<11){v+=1; - if (v>300){co+=1;v=1;} - if (co>10) then stop=1; - if (stop=0){ - if (fighting[co][v]!=0){obj_ncombat.fighting[co][v]=1;}// show_message(string(co)+":"+string(v)+" is fighting"); - if (attack=1) and (v<=100){ - if (veh_fighting[co][v]!=0) then obj_ncombat.veh_fighting[co][v]=1; - } - if (attack=1) and (ship_all[500]=1){ - if (obj_ini.loc[co][v]=p_target.name) and (obj_ini.TTRPG[co][v].planet_location==obj_controller.selecting_planet) and (fighting[co][v]=1) then obj_ncombat.fighting[co][v]=1; - if (v<=100){if (obj_ini.veh_loc[co][v]=p_target.name) and (obj_ini.veh_wid[co][v]=obj_controller.selecting_planet) then obj_ncombat.veh_fighting[co][v]=1;} - } - } - } -} - -// Iterates through all selected "ships" (max 30), including the planet (Local on the drop menu), -// and fills the battle roster with any marines found. -ships_selected=0; -var ships_len = array_length(ship_all); -for (var i = 0; i < ships_len; i++) { - if (ship_all[i]!=0) then scr_battle_roster(ship[i],ship_ide[i],false); -} -//ship_all[500] equals "Local" status on the drop menu -if (ship_all[500]=1) and (attack=1) then scr_battle_roster(p_target.name,obj_controller.selecting_planet,true); - - -instance_destroy(); - - - -/* */ -/* */ diff --git a/objects/obj_drop_select/Create_0.gml b/objects/obj_drop_select/Create_0.gml index 9c43f57a3..5d2276ecd 100644 --- a/objects/obj_drop_select/Create_0.gml +++ b/objects/obj_drop_select/Create_0.gml @@ -1,6 +1,8 @@ mouse_left=1; -attack=0; +if !(variable_instance_exists(self, "attack")){ + attack = 0; +} once_only=0; raid_tact=1; @@ -16,11 +18,16 @@ remove_local=1; // -var i;i=-1;formation_current=0; -repeat(100){i+=1;via[i]=0; - if (i<=50) then force_present[i]=0; - if (i<=12){formation_possible[i]=0;} -} +main_slate = new DataSlate(); +draw = drop_select_draw; +main_slate.inside_method = draw; +roster_slate = new DataSlate(); +local_content_slate = new DataSlate(); +var i=-1; +formation_current=-1; +via = array_create(100, 0); +formation_possible = []; +force_present = array_create(51, 0); r_master=0; r_honor=0; @@ -37,128 +44,209 @@ r_techmarines=0; // Attack r_bikes=0; -var __b__; -__b__ = action_if_number(obj_saveload, 0, 0); -if __b__ -{ - -ship_names=""; -sh_target=0; -p_target=0; -max_ships=0; -ships_selected=0; - -purge=0; -purge_method=0; -purge_score=0; -purge_a=0; -purge_b=0; -purge_c=0; -purge_d=0; -tooltip=""; -tooltip2=""; -all_sel=0; - - -var i;i=-1; -repeat(61){ - i+=1; - ship[i]=""; + +if (action_if_number(obj_saveload, 0, 0)){ + + ship_names=""; + max_ships=0; + ships_selected=0; + + purge_method=0; + purge_score=0; + purge_a=0; + purge_b=0; + purge_c=0; + purge_d=0; + tooltip=""; + tooltip2=""; + all_sel=0; + + + var i=-1; + var _ship_index = array_length(obj_ini.ship); + ship=array_create(_ship_index, ""); + ship_size=array_create(_ship_index, 0); + ship_all=array_create(_ship_index, 0); + ship_use=array_create(_ship_index, 0); + ship_max=array_create(_ship_index, 0); + ship_ide=array_create(_ship_index, -1); + + i=500; + ship[i]="Local"; ship_size[i]=0; ship_all[i]=0; ship_use[i]=0; ship_max[i]=0; - ship_ide[i]=0; -} -i=500; -ship[i]="Local"; -ship_size[i]=0; -ship_all[i]=0; -ship_use[i]=0; -ship_max[i]=0; -ship_ide[i]=-42; - - -menu=0; - - - -master=0; -honor=0; -capts=0; -mahreens=0; -veterans=0; -terminators=0; -dreads=0; -chaplains=0; -champions=0; -psykers=0; -apothecaries=0; -techmarines=0; -// Attack -bikes=0; -rhinos=0; -whirls=0; -predators=0; -raiders=0; -speeders=0; - -// These should be set to a negative value; that is, effectively, how much when it is selected (i.e. *-1) -l_master=0; -l_honor=0; -l_capts=0; -l_mahreens=0; -l_veterans=0; -l_terminators=0; -l_dreads=0; -l_chaplains=0; -l_champions=0; -l_psykers=0; -l_apothecaries=0; -l_techmarines=0; -l_size=0; -// Attack -l_bikes=0; -l_rhinos=0; -l_whirls=0; -l_predators=0; -l_raiders=0; -l_speeders=0; - - - - - -attacking=0; -sisters=0; -eldar=0; -ork=0; -tau=0; -traitors=0; -tyranids=0; -csm=0; -necrons=0; -demons=0; - - -var j;j=-1; -repeat(501){j+=1; - fighting[0,j]=0;veh_fighting[0,j]=0; - fighting[1,j]=0;veh_fighting[1,j]=0; - fighting[2,j]=0;veh_fighting[2,j]=0; - fighting[3,j]=0;veh_fighting[3,j]=0; - fighting[4,j]=0;veh_fighting[4,j]=0; - fighting[5,j]=0;veh_fighting[5,j]=0; - fighting[6,j]=0;veh_fighting[6,j]=0; - fighting[7,j]=0;veh_fighting[7,j]=0; - fighting[8,j]=0;veh_fighting[8,j]=0; - fighting[9,j]=0;veh_fighting[9,j]=0; - fighting[10,j]=0;veh_fighting[10,j]=0; + ship_ide[i]=-42; + + + menu=0; + + + + roster = new Roster(); + if (instance_exists(p_target)){ + roster.roster_location = p_target.name; + } + + roster.roster_planet = planet_number; + roster.attack_type = attack; + roster.determine_full_roster(); + + + // These should be set to a negative value; that is, effectively, how much when it is selected (i.e. *-1) + + attacking=0; + sisters=0; + eldar=0; + ork=0; + tau=0; + traitors=0; + tyranids=0; + csm=0; + necrons=0; + demons=0; + + // Formation check + var i=0,is=0,arright=false; + var _formations = obj_controller.bat_formation; + var _formation_types = obj_controller.bat_formation_type; + + for (var i=0;i0) then max_ships+=1; + + var bes=0,bes_score=0; + if (sisters>0) and (obj_controller.faction_status[eFACTION.Ecclesiarchy]="War"){bes=5;bes_score=sisters;} + if (eldar>bes_score){bes=6;bes_score=eldar;} + if (ork>bes_score){bes=7;bes_score=ork;} + if (tau>bes_score){bes=8;bes_score=tau;} + if (tyranids>bes_score){bes=9;bes_score=tyranids;} + if (traitors>bes_score){bes=10;bes_score=traitors;} + if (csm>bes_score){bes=11;bes_score=csm;} + if (necrons>bes_score){bes=13;bes_score=necrons;} + if (demons>0){bes=12;bes_score=demons;} + if (bes_score>0) then attacking=bes; + + var spesh=false; + if (planet_feature_bool(p_target.p_feature[planet_number],P_features.Warlord10)==1) and (obj_controller.faction_defeated[10]=0) and (obj_controller.faction_gender[10]=1) and (obj_controller.known[eFACTION.Chaos]>0) and (obj_controller.turn>=obj_controller.chaos_turn) then spesh=true; + + + if (has_problem_planet(planet_number, "tyranid_org", p_target)){ + tyranids=2; + attacking=9; + } + + var forces,t_attack;forces=0;t_attack=0; + if (sisters>0){forces+=1;force_present[forces]=5;} + if (eldar>0){forces+=1;force_present[forces]=6;} + if (ork>0){forces+=1;force_present[forces]=7;} + if (tau>0){forces+=1;force_present[forces]=8;} + if (tyranids>0){ + forces+=1; + force_present[forces]=9; + } + if (traitors>0) or ((traitors=0) and (spesh=true)){ + forces+=1; + force_present[forces]=10; + } + if (csm>0){ + forces+=1; + force_present[forces]=11; + } + if (demons>0){ + forces+=1; + force_present[forces]=12; + } + if (necrons>0){ + forces+=1; + force_present[forces]=13; + } +} else { + var _viable_ground_forces = roster.marines_total(); + bombard_purge = new PurgeButton(4, 631,231,DropType.PurgeBombard); + bombard_purge.active = roster.purge_bombard_score() ? 1:0; + bombard_purge.description = "The final sanction for worlds where there is no other economic means for rooting out heresy corruption or the xenos, Your chapters reputation amoung the planets populace may will be damaged, any residing governor (providing they are fit to rule and survive) will be displeased, collaterals will be huge but it's effects will surely be great"; + + fire_purge = new PurgeButton(5,631,304,DropType.PurgeFire); + fire_purge.active = _viable_ground_forces; + fire_purge.description = "Large swathes of the worst affected areas will be put to the torch the heretics and xenos will be found, the planets populace will not thanks you but most governors will be content to allow the work they were to weak to do to be done"; + + selective_purge = new PurgeButton(6,631,377,DropType.PurgeSelective); + selective_purge.active = _viable_ground_forces; + selective_purge.description = "The nodes of corruption will be saught out and killed, often in such cases the rot resides in the higher reaches of society such methids are perfect for these instances, cut the head off the snake and the rest will wither, the populations of the oppressed planets are generaly pleased even if the nobles and governors chaffe at the censorship or if neccassary execution"; + + assasinate_purge = new PurgeButton(7,631,450,DropType.PurgeAssassinate); + assasinate_purge.active = _viable_ground_forces; + assasinate_purge.description = "Often the simplest solution is a single bolt shell or the swift knife the heart. Kill the Leader."; + + purge_options = [bombard_purge, fire_purge, selective_purge, assasinate_purge]; } -set_zoom_to_defualt(); diff --git a/objects/obj_drop_select/Draw_0.gml b/objects/obj_drop_select/Draw_0.gml deleted file mode 100644 index 16923fbbe..000000000 --- a/objects/obj_drop_select/Draw_0.gml +++ /dev/null @@ -1,919 +0,0 @@ -set_zoom_to_defualt(); - -var __b__; -__b__ = action_if_number(obj_ncombat, 0, 0); -if __b__ -{ -__b__ = action_if_number(obj_popup, 0, 0); -if __b__ -{ -__b__ = action_if_variable(purge, 0, 0); -if __b__ -{ - - -var xx, yy; -xx=__view_get( e__VW.XView, 0 ); -yy=__view_get( e__VW.YView, 0 ); - - -draw_sprite(spr_popup_large,1,xx+534,yy+201); -draw_set_halign(fa_center); -draw_set_font(fnt_40k_30b); - -// var xx,yy; -// xx=view_xview[0]+545;yy=view_yview[0]+212; -draw_set_halign(fa_left);draw_set_color(c_gray); -var attack_type = attack ? "Attacking" : "Raiding" -draw_text_transformed(xx+545,yy+212,$"{attack_type} ({planet_numeral_name(planet_number, p_target)} )",0.6,0.6,0); - - -draw_set_color(c_gray); -draw_set_font(fnt_40k_14); -draw_set_halign(fa_left); - -// Planet icon here -draw_rectangle(xx+1084,yy+215,xx+1142,yy+273,0); - -// Target -var tt1,tt2,fork;tt1="";tt2="";fork=0; -if (attacking=5){fork=sisters;tt1="Ecclesiarchy (";} -if (attacking=6){fork=eldar;tt1="Eldar (";} -if (attacking=7){fork=ork;tt1="Orks (";} -if (attacking=8){fork=tau;tt1="Tau (";} -if (attacking=9){fork=tyranids;tt1="Tyranids (";} -if (attacking=10){fork=traitors;tt1="Heretics (";} -if (attacking=11){fork=csm;tt1="CSMs (";} -if (attacking=12){fork=demons;tt1="Daemons (";} -if (attacking=13){fork=necrons;tt1="Necrons (";} -if (fork=0) then tt2=""; -if (fork=1) then tt2="Negligible"; -if (fork=2) then tt2="Minor"; -if (fork=3) then tt2="Moderate"; -if (fork=4) then tt2="High"; -if (fork=5) then tt2="Very High"; -if (fork>=6) then tt2="Overwhelming"; -tt1+=string(tt2)+")"; -draw_text(xx+550,yy+245,string_hash_to_newline(string(tt1))); - - -// Formation -// draw_set_alpha(1);draw_text(xx+872,yy+212,"Formation:"); -draw_set_alpha(1);draw_text(xx+873,yy+207,string_hash_to_newline("Formation:")); -var x9,y9;x9=xx+954;y9=yy+214;if (scr_hit(x9,y9,x9+120,y9+16)=true) then draw_set_alpha(0.8); -draw_set_color(c_gray);draw_rectangle(x9,y9,x9+120,y9+16,0);draw_set_alpha(1);// 160 -draw_set_color(c_black);draw_text_transformed(x9+2,y9,string_hash_to_newline(obj_controller.bat_formation[formation_possible[formation_current]]),0.8,0.8,0); -if (point_and_click([x9,y9,x9+120,y9+16])) { - formation_current+=1; - if (formation_possible[formation_current]=0) then formation_current=1; -} - - - - - - - - - - - -// Ships Are Up, Fuck Me -draw_text(xx+550,yy+273,string_hash_to_newline("Available Forces:")); - - - -var column,row,e,x8,y8,sigh,sip;e=0;sigh=0;sip=1; -column=1;row=1;x8=xx+552;y8=yy+299;e=500; - - -var add_ground;add_ground=0; // Local Forces here - -if (ship_max[500]>0) and (attack=1){ - if (ship_all[e]=0) then draw_set_alpha(0.35); - draw_set_color(c_gray);draw_rectangle(x8,y8,x8+160,y8+16,0); - draw_set_color(c_black);draw_text(x8+2,y8,string_hash_to_newline("Local ("+string(ship_use[e])+"/"+string(ship_max[e])+")")) - if (point_and_click([x8, y8, x8+160, y8+16])) { - var onceh;onceh=0; - refresh_raid=1; - if (ship_all[e]=0){add_ground=1;} - if (ship_all[e]=1){add_ground=-1;} - } - y8+=16;sip+=1; -} -e=1; - - -repeat(50){ // Ship Forces here - if (ship[e]!="") and (ship_max[e]>0){ - draw_set_alpha(1);if (ship_all[e]=0) then draw_set_alpha(0.35); - draw_set_color(c_gray);draw_rectangle(x8,y8,x8+160,y8+16,0);// 160 - draw_set_color(c_black);draw_text_transformed(x8+2,y8,string_hash_to_newline(string(ship[e])+" ("+string(ship_use[e])+"/"+string(ship_max[e])+")"),0.8,0.8,0); - if (point_and_click([x8, y8, x8+160, y8+16])) { - if (ship_all[e]>-1 && ship_all[e]<2){ - scr_drop_fiddle(ship_ide[e],!ship_all[e],e,attack); - refresh_raid=true; - } - } - y8+=18;sip+=1; - if (y8>=yy+299+180){y8=yy+299;x8+=168;} - } - e+=1; -} - - -draw_set_font(fnt_40k_14);draw_set_color(c_gray);draw_set_alpha(1); - - - -var sel;sel=""; -if (master=1) then sel+="Chapter Master "+string(obj_ini.master_name)+", "; -if (honor>1) then sel+=string(honor)+" Honour Guard, "; -if (honor=1) then sel+="1 Honour Guard, "; -if (capts>1) then sel+=string(capts)+" Captains, "; -if (capts=1) then sel+="1 Captain, "; -if (champions>1) then sel+=string(champions)+" Champions, "; -if (champions=1) then sel+="1 Champion, "; -if (chaplains>1) then sel+=string(chaplains)+" Chaplains, "; -if (chaplains=1) then sel+="1 Chaplain, "; -if (apothecaries>1) then sel+=string(apothecaries)+" Apothecaries, "; -if (apothecaries=1) then sel+="1 Apothecary, "; -if (psykers>1) then sel+=string(psykers)+" Psykers, "; -if (psykers=1) then sel+="1 Psyker, "; -if (techmarines>1) then sel+=string(techmarines)+" Techmarines, "; -if (techmarines=1) then sel+="1 Techmarine, "; -if (terminators>1) then sel+=string(terminators)+" Terminators, "; -if (terminators=1) then sel+="1 Terminator, "; -if (veterans>1) then sel+=string(veterans)+" Veteran, "; -if (veterans=1) then sel+="1 Veteran, "; -if (mahreens>1) then sel+=string(mahreens)+" Marines, "; -if (mahreens=1) then sel+="1 Marine, "; -if (dreads>1) then sel+=string(dreads)+" Dreadnought, "; -if (dreads=1) then sel+="1 Dreadnought, "; -// Attacking -if (bikes>1) then sel+=string(bikes)+" Bikes, "; -if (bikes=1) then sel+="1 Bike, "; -if (speeders>1) then sel+=string(speeders)+" Land Speeders, "; -if (speeders=1) then sel+="1 Land Speeder, "; -if (rhinos>1) then sel+=string(rhinos)+" Rhinos, "; -if (rhinos=1) then sel+="1 Rhino, "; -if (whirls>1) then sel+=string(whirls)+" Whirlwinds, "; -if (whirls=1) then sel+="1 Whirlwind, "; -if (predators>1) then sel+=string(predators)+" Predators, "; -if (predators=1) then sel+="1 Predator, "; -if (raiders>1) then sel+=string(raiders)+" Land Raider, "; -if (raiders=1) then sel+="1 Land Raider, "; -draw_text_ext(xx+550,yy+486,string_hash_to_newline(string(sel)),-1,590); - - - -var caption;caption="";e=0;x8=xx+553;y8=yy+555; -draw_set_halign(fa_center); -repeat(8){e+=1; - if (e=6){x8=xx+553;y8=yy+585;} - if (e=8) then x8=xx+826; - - var onceh;onceh=0; - draw_set_alpha(1); - - if (e=1) and (raid_tact=0) then draw_set_alpha(0.35);if (e=1) then caption="Tacticals"; - if (e=2) and (raid_vet=0) then draw_set_alpha(0.35);if (e=2) then caption="Veterans"; - if (e=3) and (raid_assa=0) then draw_set_alpha(0.35);if (e=3) then caption="Assault Marines"; - if (e=4) and (raid_deva=0) then draw_set_alpha(0.35);if (e=4) then caption="Devastators"; - if (e=5) and (raid_scou=0) then draw_set_alpha(0.35);if (e=5) then caption="Scouts"; - if (e=6) and (raid_term=0) then draw_set_alpha(0.35);if (e=6) then caption="Terminators"; - if (e=7) and (raid_spec=0) then draw_set_alpha(0.35);if (e=7) then caption="Specialists"; - if (e=8) and (raid_wounded=0) then draw_set_alpha(0.35);if (e=8) then caption="Wounded"; - - draw_set_color(c_gray);draw_rectangle(x8,y8,x8+105,y8+16,0); - draw_set_alpha(1);draw_set_color(0);draw_text(x8+52,y8,string_hash_to_newline(string(caption))); - - if (scr_hit(x8,y8,x8+105,y8+16)=true){ - draw_set_alpha(0.2);draw_rectangle(x8,y8,x8+105,y8+16,0);draw_set_alpha(1); - if (scr_click_left()){ - if (e=1){if (raid_tact=1) and (onceh=0){onceh=1;raid_tact=0;refresh_raid=1;}if (raid_tact=0) and (onceh=0){onceh=1;raid_tact=1;refresh_raid=1;}} - if (e=2){if (raid_vet=1) and (onceh=0){onceh=1;raid_vet=0;refresh_raid=1;}if (raid_vet=0) and (onceh=0){onceh=1;raid_vet=1;refresh_raid=1;}} - if (e=3){if (raid_assa=1) and (onceh=0){onceh=1;raid_assa=0;refresh_raid=1;}if (raid_assa=0) and (onceh=0){onceh=1;raid_assa=1;refresh_raid=1;}} - if (e=4){if (raid_deva=1) and (onceh=0){onceh=1;raid_deva=0;refresh_raid=1;}if (raid_deva=0) and (onceh=0){onceh=1;raid_deva=1;refresh_raid=1;}} - if (e=5){if (raid_scou=1) and (onceh=0){onceh=1;raid_scou=0;refresh_raid=1;}if (raid_scou=0) and (onceh=0){onceh=1;raid_scou=1;refresh_raid=1;}} - if (e=6){if (raid_term=1) and (onceh=0){onceh=1;raid_term=0;refresh_raid=1;}if (raid_term=0) and (onceh=0){onceh=1;raid_term=1;refresh_raid=1;}} - if (e=7){if (raid_spec=1) and (onceh=0){onceh=1;raid_spec=0;refresh_raid=1;}if (raid_spec=0) and (onceh=0){onceh=1;raid_spec=1;refresh_raid=1;}} - if (e=8){if (raid_wounded=1) and (onceh=0){onceh=1;raid_wounded=0;refresh_raid=1;}if (raid_wounded=0) and (onceh=0){onceh=1;raid_wounded=1;refresh_raid=1;}} - - if (e=8) and (onceh=1) then obj_controller.select_wounded=raid_wounded; - } - } - x8+=117; -} - - -draw_set_color(c_gray);draw_set_alpha(1); -yar=2;if (all_sel=1) then yar=3;draw_sprite(spr_creation_check,yar,xx+770,yy+270);yar=0; -if (point_and_click([xx+770, yy+270, xx+770+32, yy+270+32])) { -var onceh;onceh=0; -var onceh;once=0;i=0; -if (all_sel=0) and (onceh=0){ - repeat(60){i+=1; - if (ship[i]!="") and (ship_all[i]=0){ship_all[i]=1;scr_drop_fiddle(ship_ide[i],true,i,attack);} - if (attack=1){ - if (ship_all[500]=0) then add_ground=1; - if (ship_all[500]=1) then add_ground=-1; - } - } - onceh=1;all_sel=1;refresh_raid=1; -} -if (all_sel=1) and (onceh=0){ - repeat(60){i+=1; - if (ship[i]!="") and (ship_all[i]=1){ship_all[i]=0;scr_drop_fiddle(ship_ide[i],false,i,attack);} - if (attack=1){ - if (ship_all[500]=0) then add_ground=1; - if (ship_all[500]=1) then add_ground=-1; - } - } - onceh=1;all_sel=0;refresh_raid=1; - } -} -draw_set_halign(fa_left); -draw_text_transformed(xx+770+30,yy+270+4,string_hash_to_newline("Select All"),1,1,0); - - - - - - -var smin,smax; -var w;w=-1;smin=0;smax=0; - -// if (purge=2){repeat(61){w+=1;if (ship[w]!="") and (ship_size[w]>1){smax+=1;if (ship_all[w]>0) then smin+=1;}}} - - - - -if (add_ground=1){ships_selected+=1;remove_local=-1; - /*master+=l_master;honor+=l_honor; - capts+=l_capts;mahreens+=l_mahreens; - veterans+=l_veterans;terminators+=l_terminators; - dreads+=l_dreads;chaplains+=l_chaplains; - psykers+=l_psykers;apothecaries+=l_apothecaries; - techmarines+=l_techmarines;champions+=l_champions;*/ - - bikes+=l_bikes;rhinos+=l_rhinos; - whirls+=l_whirls;predators+=l_predators; - raiders+=l_raiders;speeders+=l_speeders; - - refresh_raid=1;ship_all[500]=1;ship_use[500]=ship_max[500]; -} -if (add_ground=-1){ships_selected-=1;remove_local=1; - /*master-=l_master;honor-=l_honor; - capts-=l_capts;mahreens-=l_mahreens; - veterans-=l_veterans;terminators-=l_terminators; - dreads-=l_dreads;chaplains-=l_chaplains; - psykers-=l_psykers;apothecaries-=l_apothecaries; - techmarines-=l_techmarines;champions-=l_champions;*/ - - // Fuck me - - bikes-=l_bikes;rhinos-=l_rhinos; - whirls-=l_whirls;predators-=l_predators; - raiders-=l_raiders;speeders-=l_speeders; - - refresh_raid=1;ship_all[500]=0;ship_use[500]=0; -}add_ground=0; - - - - - - - -repeat(61){w+=1;if (ship[w]!=""){smax+=ship_max[w];if (ship_all[w]>0) then smin+=ship_use[w];}} -if (ship_max[500]>0) and (ship_all[500]>0){smax+=ship_max[500];smin+=ship_max[500];} - - - - - - - -var q;q=0; -repeat(20){q+=1; - draw_set_alpha(0.4);if (attacking=force_present[q]) and (attacking>0){draw_set_alpha(1);} - if (force_present[q]>0) then draw_sprite(spr_force_icon,force_present[q],xx+700+(q*50),yy+250); - if (attacking=force_present[q]) and (attacking>0) then draw_sprite(spr_force_icon,15,xx+700+(q*50),yy+250); - - if (scr_hit(xx+700-8+(q*50),yy+250-16,xx+750+8+(q*50),yy+250+16)=true) and (force_present[q]!=0){ - var tt1,tt2,fork;tt1="";tt2="";fork=0; - - if (force_present[q]=5){fork=sisters;tt1="Ecclesiarchy ("+string(fork)+")";} - if (force_present[q]=6){fork=eldar;tt1="Eldar ("+string(fork)+")";} - if (force_present[q]=7){fork=ork;tt1="Orks ("+string(fork)+")";} - if (force_present[q]=8){fork=tau;tt1="Tau ("+string(fork)+")";} - if (force_present[q]=9){fork=tyranids;tt1="Tyranids ("+string(fork)+")";} - if (force_present[q]=10){fork=traitors;tt1="Heretics ("+string(fork)+")";} - if (force_present[q]=11){fork=csm;tt1="CSMs ("+string(fork)+")";} - if (force_present[q]=12){fork=demons;tt1="Daemons ("+string(fork)+")";} - if (force_present[q]=13){fork=necrons;tt1="Necrons ("+string(fork)+")";} - - if (fork=0) then tt2=""; - if (fork=1) then tt2="Negligible"; - if (fork=2) then tt2="Minor"; - if (fork=3) then tt2="Moderate"; - if (fork=4) then tt2="High"; - if (fork=5) then tt2="Very High"; - if (fork>=6) then tt2="Overwhelming"; - tt2+=" Threat Rating"; - - draw_set_alpha(1); - draw_set_font(fnt_40k_14);draw_set_halign(fa_left);draw_set_color(0); - draw_rectangle(mouse_x+18,mouse_y+20,mouse_x+string_width_ext(string_hash_to_newline(tt2),-1,500)+24,mouse_y+44+string_height_ext(string_hash_to_newline(tt2),-1,500),0); - draw_set_color(c_gray); - draw_rectangle(mouse_x+18,mouse_y+20,mouse_x+string_width_ext(string_hash_to_newline(tt2),-1,500)+24,mouse_y+44+string_height_ext(string_hash_to_newline(tt2),-1,500),1); - draw_set_font(fnt_40k_14b);draw_text(mouse_x+22,mouse_y+22,string_hash_to_newline(string(tt1))); - draw_set_font(fnt_40k_14);draw_text_ext(mouse_x+22,mouse_y+42,string_hash_to_newline(string(tt2)),-1,500); - - if(scr_click_left()){ - if (attacking!=force_present[q]) and (force_present[q]>0){attacking=force_present[q];} - } - } -} -draw_set_alpha(1); - - - - -// draw_text(xx+14,yy+352,"Selection: "+string(smin)+"/"+string(smax)); - - - - - - - -// Back / Purge buttons -xx+=100;yy+=38; -draw_set_halign(fa_center); - -draw_set_color(c_gray);draw_rectangle(xx+852,yy+556,xx+921,yy+579,0); -draw_set_color(0);draw_text_transformed(xx+887,yy+559,string_hash_to_newline("BACK"),1.25,1.25,0); -if (scr_hit(xx+852,yy+556,xx+921,yy+579)=true){ - draw_set_alpha(0.2);draw_rectangle(xx+852,yy+556,xx+921,yy+579,0);draw_set_alpha(1); - if (scr_click_left()) {menu=0;purge=0;instance_destroy();} -} - -draw_set_color(c_gray);draw_rectangle(xx+952,yy+556,xx+1043,yy+579,0); -draw_set_color(0); -if (attack=0) then draw_text_transformed(xx+999,yy+559,string_hash_to_newline("RAID!"),1.25,1.25,0); -if (attack=1) then draw_text_transformed(xx+999,yy+559,string_hash_to_newline("ATTACK!"),0.7,1.25,0); - -if (scr_hit(xx+954,yy+556,xx+1043,yy+579)=true){ - draw_set_alpha(0.2);draw_rectangle(xx+954,yy+556,xx+1043,yy+579,0);draw_set_alpha(1); - if (scr_click_left()) and (string_length(sel)>1){ - combating=1;// Start battle here - - if (attack=1) then obj_controller.last_attack_form=formation_possible[formation_current]; - if (attack=0) then obj_controller.last_raid_form=formation_possible[formation_current]; - - instance_deactivate_all(true); - instance_activate_object(obj_controller); - instance_activate_object(obj_ini); - instance_activate_object(obj_drop_select); - - // 135 ; temporary balancing - if (sh_target!=-50){sh_target.acted+=1;} - - if (attacking==10) or (attacking==11){ - remove_planet_problem(planet_number, "meeting", p_target); - remove_planet_problem(planet_number, "meeting_trap", p_target); - } - - instance_create(0,0,obj_ncombat); - obj_ncombat.battle_object=p_target; - obj_ncombat.battle_loc=p_target.name; - obj_ncombat.battle_id=planet_number; - obj_ncombat.dropping=1-attack; - obj_ncombat.attacking=attack; - obj_ncombat.enemy=attacking; - obj_ncombat.formation_set=formation_possible[formation_current]; - obj_ncombat.defending=false; - if (ship_all[500]=1) then obj_ncombat.local_forces=1; - var _planet = obj_ncombat.battle_object.p_feature[obj_ncombat.battle_id] - if (obj_ncombat.battle_object.space_hulk=1) then obj_ncombat.battle_special="space_hulk"; - if (planet_feature_bool(_planet,P_features.Warlord6) == 1) and (obj_ncombat.enemy=6) and (obj_controller.faction_defeated[6]=0) then obj_ncombat.leader=1; - if (obj_ncombat.enemy=7) and (obj_controller.faction_defeated[7]<=0){ - - if ( planet_feature_bool(_planet,P_features.OrkWarboss)==1){ - obj_ncombat.leader=1; - obj_ncombat.Warlord = _planet[search_planet_features(_planet,P_features.OrkWarboss)[0]] - } - } - - - if (obj_ncombat.enemy=9) and (obj_ncombat.battle_object.space_hulk=0){ - if (has_problem_planet(planet_number, "tyranid_org", p_target)) then obj_ncombat.battle_special="tyranid_org"; - } - - if (obj_ncombat.enemy=11){ - if ( planet_feature_bool(obj_ncombat.battle_object.p_feature[obj_ncombat.battle_id],P_features.World_Eaters)==1){ - obj_ncombat.battle_special="world_eaters";obj_ncombat.leader=1; - } - } - - if (obj_ncombat.enemy=5) then obj_ncombat.threat=sisters; - if (obj_ncombat.enemy=6) then obj_ncombat.threat=eldar; - if (obj_ncombat.enemy=7) then obj_ncombat.threat=ork; - if (obj_ncombat.enemy=8) then obj_ncombat.threat=tau; - if (obj_ncombat.enemy=9) then obj_ncombat.threat=tyranids; - if (obj_ncombat.enemy=10) then obj_ncombat.threat=traitors; - if (obj_ncombat.enemy=11) then obj_ncombat.threat=csm; - if (obj_ncombat.enemy=12) then obj_ncombat.threat=demons; - if (obj_ncombat.enemy=13) then obj_ncombat.threat=necrons; - - if (obj_ncombat.enemy=8){ - var eth;eth=0;eth=scr_quest(4,"ethereal_capture",8,0); - if (eth>0) and (obj_ncombat.battle_object.p_owner[obj_ncombat.battle_id]=8){ - var rolli;rolli=floor(random(100))+1; - if (obj_ncombat.threat=6) and (rolli<=80) then obj_ncombat.ethereal=1; - if (obj_ncombat.threat=5) and (rolli<=65) then obj_ncombat.ethereal=1; - if (obj_ncombat.threat=4) and (rolli<=50) then obj_ncombat.ethereal=1; - if (obj_ncombat.threat=3) and (rolli<=35) then obj_ncombat.ethereal=1; - } - // show_message("Ethereal Quest?: "+string(eth)+"#Ethereal?: "+string(obj_ncombat.ethereal)); - } - - // if (obj_ncombat.threat>1) and (obj_ncombat.enemy!=13) then obj_ncombat.threat-=1; - if (obj_ncombat.threat>1) and (obj_ncombat.battle_special!="world_eaters") and (attack=0) then obj_ncombat.threat-=1; - if (obj_ncombat.threat<1) then obj_ncombat.threat=1; - if (obj_ncombat.enemy=10) and (obj_ncombat.battle_object.p_type[obj_ncombat.battle_id]="Daemon") then obj_ncombat.threat=7; - - - if ((attacking=0) or (attacking=10) or (attacking=11)) and (obj_ncombat.battle_object.p_traitors[obj_ncombat.battle_id]=0) and (obj_ncombat.battle_object.p_chaos[obj_ncombat.battle_id]=0){ - if ( planet_feature_bool(obj_ncombat.battle_object.p_feature[obj_ncombat.battle_id],P_features.Warlord10)==1) and (obj_controller.known[eFACTION.Chaos]=0) and (obj_controller.faction_gender[10]=1) and (obj_controller.turn>=obj_controller.chaos_turn){ - var pop;pop=instance_create(0,0,obj_popup); - pop.image="chaos_symbol"; - pop.title="Concealed Heresy"; - pop.text="Your astartes set out and begin to cleanse "+string(obj_ncombat.battle_object.name)+" "+scr_roman(obj_ncombat.battle_id)+" of possible heresy. The general populace appears to be devout in their faith, but a disturbing trend appears- the odd citizen cursing your forces, frothing at the mouth, and screaming out heresy most foul. One week into the cleansing a large hostile force is detected approaching and encircling your forces."; - with(obj_pnunit){instance_destroy();} - with(obj_enunit){instance_destroy();} - with(obj_nfort){instance_destroy();} - with(obj_ncombat){instance_destroy();} - obj_controller.cooldown=8;combating=0; - instance_activate_all();exit;exit; - } - if ( planet_feature_bool(obj_ncombat.battle_object.p_feature[obj_ncombat.battle_id],P_features.Warlord10)==1) and (obj_controller.known[eFACTION.Chaos]>=2) and (obj_controller.faction_gender[10]=1) and (obj_controller.turn>=obj_controller.chaos_turn) then with(obj_drop_select){ - obj_ncombat.enemy=11;obj_ncombat.threat=0;alarm[6]=1; - with(obj_pnunit){instance_destroy();} - with(obj_enunit){instance_destroy();} - with(obj_nfort){instance_destroy();} - with(obj_ncombat){instance_destroy();} - obj_controller.cooldown=8;combating=0; - instance_activate_all();exit;exit; - } - } - - - - - scr_battle_allies(); - - var co, v, stop; - co=0;v=0;stop=0; - repeat(3600){ - if (co<11){v+=1; - if (v>300){co+=1;v=1;} - if (co>10) then stop=1; - if (stop=0){ - if (fighting[co][v]!=0){obj_ncombat.fighting[co][v]=1;}// show_message(string(co)+":"+string(v)+" is fighting"); - if (attack=1) and (v<=100){ - if (veh_fighting[co][v]!=0) then obj_ncombat.veh_fighting[co][v]=1; - } - if (attack=1) and (ship_all[500]=1){ - if (obj_ini.loc[co][v]=p_target.name) and (obj_ini.TTRPG[co][v].planet_location=planet_number) and (fighting[co][v]=1) then obj_ncombat.fighting[co][v]=1; - if (v<=100){if (obj_ini.veh_loc[co][v]=p_target.name) and (obj_ini.veh_wid[co][v]=planet_number) then obj_ncombat.veh_fighting[co][v]=1;} - } - } - } - } - - // Iterates through all selected "ships" (max 30), including the planet (Local on the drop menu), - // and fills the battle roster with any marines found. - ships_selected=0; - var ships_len = array_length(ship_all); - for (var i = 0; i < ships_len; i++) { - if (ship_all[i]!=0) then scr_battle_roster(ship[i],ship_ide[i],false); - } - //ship_all[500] equals "Local" status on the drop menu - if (ship_all[500]=1) and (attack=1) then scr_battle_roster(p_target.name,planet_number,true); - } -} - - - -/* */ -} -} -} -__b__ = action_if_number(obj_popup, 0, 0); -if __b__ -{ -__b__ = action_if_number(obj_ncombat, 0, 0); -if __b__ -{ - -var xx, yy; -xx=__view_get( e__VW.XView, 0 ); -yy=__view_get( e__VW.YView, 0 ); - - -if (menu=0) and (purge=1){ - draw_sprite(spr_purge_panel,0,xx+535,yy+200); - draw_set_halign(fa_center); - draw_set_font(fnt_40k_30b); - - draw_set_color(c_gray); - draw_rectangle(xx + 740, yy + 558, xx + 860, yy + 585, 0); - draw_set_color(0); - draw_text_transformed(xx + 800, yy + 559, string_hash_to_newline("Cancel"), 0.75, 0.75, 0); - if (scr_hit(xx + 740, yy + 558, xx + 860, yy + 585)) { - draw_set_alpha(0.2); - draw_set_color(0); - draw_rectangle(xx + 740, yy + 558, xx + 860, yy + 585, 0); - draw_set_alpha(1); - if (scr_click_left()) { - instance_destroy(); - } - } - - var hih,x5,y5,iy,r,nup; - hih=0;r=0;iy=0;nup=false; - - x5=xx+535;y5=yy+200; - x5+=89;y5+=31; - - if (instance_exists(p_target)){ - if (p_target.p_type[planet_number]="Shrine") then nup=true; - } - - // 89,31 - - repeat(4){iy+=1;r=0; - draw_set_alpha(1); - if (iy=1) and (purge_a<=0) then draw_set_alpha(0.35); - if (iy=2) and (purge_b<=0) and (purge_d=0) then draw_set_alpha(0.35); - if (iy=3) and (purge_c<=0) and (purge_d=0) then draw_set_alpha(0.35); - if (iy=4) and ((purge_d+purge_b=0) or (p_target.dispo[planet_number]<0)) then draw_set_alpha(0.35); - if (iy=4) and (nup=true) then draw_set_alpha(0.35); - - if (scr_hit(x5,y5+((iy-1)*73),x5+351,y5+((iy-1)*73)+63)=true){ - r=4; - if (scr_click_left()) { - if (iy=1) and (purge_a>0){ - purge=2;obj_controller.cooldown=8;alarm[4]=1; - purge_score=0; - ships_selected=0; - all_sel=0; - } - if (iy=2) and ((purge_b>0) or (purge_d!=0)){ - purge=3;obj_controller.cooldown=8;alarm[2]=1; - purge_score=0; - ships_selected=0; - all_sel=0; - } - if (iy=3) and ((purge_c>0) or (purge_d!=0)){ - purge=4;obj_controller.cooldown=8;alarm[2]=1; - purge_score=0; - ships_selected=0; - all_sel=0; - } - if (iy=4) and (purge_d+purge_b!=0) and (p_target.dispo[planet_number]>=0) and (nup=false){ - purge=5;obj_controller.cooldown=8;alarm[2]=1; - purge_score=0; - ships_selected=0; - all_sel=0; - } - - } - } - - // draw_sprite(spr_purge_buttons,(iy-1)+r,x5,y5+((iy-1)*73)); - scr_image("purge",(iy-1)+r,x5,y5+((iy-1)*73),351,63); - } -} - - - - - - - - -if (menu=0) and (purge>=2){ - draw_sprite(spr_purge_panel,0,xx+535,yy+200); - draw_set_halign(fa_center); - draw_set_font(fnt_40k_30b); - - - // 2 is bombardment - - - - - - var x2,y2; - x2=__view_get( e__VW.XView, 0 )+535;y2=__view_get( e__VW.YView, 0 )+200; - draw_set_halign(fa_left);draw_set_color(c_gray); - if (purge=2) then draw_text_transformed(x2+14,y2+12,string_hash_to_newline("Bombard Purging "+string(p_target.name)+" "+scr_roman(planet_number)),0.6,0.6,0); - if (purge=3) then draw_text_transformed(x2+14,y2+12,string_hash_to_newline("Fire Cleansing "+string(p_target.name)+" "+scr_roman(planet_number)),0.6,0.6,0); - if (purge=4) then draw_text_transformed(x2+14,y2+12,string_hash_to_newline("Selective Purging "+string(p_target.name)+" "+scr_roman(planet_number)),0.6,0.6,0); - if (purge=5) then draw_text_transformed(x2+14,y2+12,string_hash_to_newline("Assassinate Governor ("+string(p_target.name)+" "+scr_roman(planet_number)+")"),0.6,0.6,0); - - - - // Disposition here - var succession=0,pp=planet_number - - var succession = has_problem_planet(pp,"succession",p_target); - - if ((p_target.dispo[pp]>=0) and (p_target.p_owner[pp]<=5) and (p_target.p_population[pp]>0)) and (succession=0){ - var wack;wack=0; - draw_set_color(c_blue); - draw_rectangle(x2+12,y2+53,x2+12+max(0,(min(100,p_target.dispo[pp])*4.37)),y2+71,0); - } - draw_set_color(c_gray); - draw_rectangle(x2+12,y2+53,x2+449,y2+71,1); - draw_set_color(c_white); - - draw_set_font(fnt_40k_14b);draw_set_halign(fa_center); - if (succession=0){ - if (p_target.dispo[pp]>=0) and (p_target.p_first[pp]<=5) and (p_target.p_owner[pp]<=5) and (p_target.p_population[pp]>0) then draw_text(x2+231,y2+54,string_hash_to_newline("Disposition: "+string(min(100,p_target.dispo[pp]))+"/100")); - if (p_target.dispo[pp]>-30) and (p_target.dispo[pp]<0) and (p_target.p_owner[pp]<=5) and (p_target.p_population[pp]>0) then draw_text(x2+231,y2+54,string_hash_to_newline("Disposition: ???/100")); - if ((p_target.dispo[pp]>=0) and (p_target.p_first[pp]<=5) and (p_target.p_owner[pp]>5)) or (p_target.p_population[pp]<=0) then draw_text(x2+231,y2+54,string_hash_to_newline("-------------")); - if (p_target.dispo[pp]<=-3000) then draw_text(x2+231,y2+54,"Chapter Rule"); - } - if (succession=1) then draw_text(x2+231,y2+54,string_hash_to_newline("War of Succession")); - - draw_set_color(c_gray); - draw_set_font(fnt_40k_14); - draw_set_halign(fa_left); - - - // Planet icon here - draw_rectangle(x2+459,y2+14,x2+516,y2+71,0); - - // Ships Are Up, Fuck Me - draw_text(x2+13,y2+80,string_hash_to_newline("Available Forces:")); - - var column,row,e,x8,y8,sigh,sip;e=0;sigh=0;sip=1; - column=1;row=1;x8=x2+17;y8=y2+105;e=500; - - - var add_ground;add_ground=0; - - if (purge_d>0) and (purge!=2){ - if (ship_all[e]=0) then draw_set_alpha(0.35); - draw_set_color(c_gray);draw_rectangle(x8,y8,x8+160,y8+16,0); - draw_set_color(c_black);draw_text(x8+2,y8,string_hash_to_newline("Local ("+string(ship_use[e])+"/"+string(ship_max[e])+")")) - if (point_and_click([x8, y8, x8+160, y8+16])) { - var onceh;onceh=0; - if (ship_all[e]=0) then add_ground=1; - if (ship_all[e]=1) then add_ground=-1; - } - y8+=16;sip+=1; - } - e=1; - - - - if (purge=2){ // Bombard - repeat(50){ - if (ship[e]!="") and (ship_size[e]>1){ - draw_set_alpha(1);if (ship_all[e]=0) then draw_set_alpha(0.35); - draw_set_color(c_gray);draw_rectangle(x8,y8,x8+160,y8+16,0);// 160 - draw_set_color(c_black);draw_text_transformed(x8+2,y8,string_hash_to_newline(string(ship[e])+" ("+string(ship_size[e])+")"),0.8,0.8,0); - if (point_and_click([x8, y8, x8+160, y8+16])) { - var onceh;onceh=0; - if (onceh=0) and (ship_all[e]=0){onceh=1;ship_all[e]=1;ships_selected+=1;} - if (onceh=0) and (ship_all[e]=1){onceh=1;ship_all[e]=0;ships_selected-=1;} - } - y8+=18;sip+=1; - - if (y8>=y2+105+180){y8=y2+105;x8+=168;} - } - e+=1; - } - } - - - if (purge>=3){ // Anything not bombardment - repeat(50){ - if (ship[e]!="") and (ship_max[e]>0){ - draw_set_alpha(1);if (ship_all[e]=0) then draw_set_alpha(0.35); - draw_set_color(c_gray);draw_rectangle(x8,y8,x8+160,y8+16,0);// 160 - draw_set_color(c_black);draw_text_transformed(x8+2,y8,string_hash_to_newline(string(ship[e])+" ("+string(ship_use[e])+"/"+string(ship_max[e])+")"),0.8,0.8,0); - if (point_and_click([x8, y8, x8+160, y8+16])) { - var onceh;onceh=0; - if (onceh=0) and (ship_all[e]=0){onceh=1;scr_drop_fiddle(ship_ide[e],true,e,attack);} - if (onceh=0) and (ship_all[e]=1){onceh=1;scr_drop_fiddle(ship_ide[e],false,e,attack);} - } - y8+=18;sip+=1; - - if (y8>=y2+105+180){y8=y2+105;x8+=168;} - } - e+=1; - } - } - - - - - - - draw_set_font(fnt_40k_14);draw_set_color(c_gray);draw_set_alpha(1); - - var hers,influ,poppy; - hers=p_target.p_heresy[planet_number]+p_target.p_heresy_secret[planet_number]; - influ=p_target.p_influence[planet_number]; - if (p_target.p_large[planet_number]=1) then poppy=string(p_target.p_population[planet_number])+"B"; - if (p_target.p_large[planet_number]=0) then poppy=string(scr_display_number(p_target.p_population[planet_number])); - draw_text(x2+14,y2+312,"Heresy: "+string(max(hers,influ[eFACTION.Tau]))+"%"); - draw_text(x2+14,y2+332,"Population: "+string(poppy)); - - - - - - - if (purge=2){// Bombardment select all - draw_set_alpha(1); - yar=2;if (all_sel=1) then yar=3;draw_sprite(spr_creation_check,yar,x2+233,y2+75);yar=0; - if (point_and_click([x2+233, y2+75, x2+233+32, y2+75+32])) { - var onceh;onceh=0; - var onceh;once=0;i=0; - if (all_sel=0) and (onceh=0){ - repeat(60){i+=1;if (ship[i]!="") and (ship_all[i]=0){ship_all[i]=1;ships_selected+=1;}} - onceh=1;all_sel=1; - } - if (all_sel=1) and (onceh=0){ - repeat(60){i+=1;if (ship[i]!="") and (ship_all[i]=1){ship_all[i]=0;ships_selected-=1;}} - onceh=1;all_sel=0; - } - } - draw_text_transformed(x2+233+30,y2+75+4,string_hash_to_newline("Select All"),1,1,0); - } - - - if (purge>=3){// Anything not bombardment, select all - draw_set_alpha(1); - yar=2;if (all_sel=1) then yar=3;draw_sprite(spr_creation_check,yar,x2+233,y2+75);yar=0; - if (point_and_click([x2+233, y2+75, x2+233+32, y2+75+32])) { - var onceh;onceh=0; - var onceh;once=0;i=0; - if (all_sel=0) and (onceh=0){ - repeat(60){i+=1; - if (ship[i]!="") and (ship_all[i]=0){ship_all[i]=1;scr_drop_fiddle(ship_ide[i],true,i,attack);} - if (ship_all[500]=0) then add_ground=1; - if (ship_all[500]=1) then add_ground=-1; - } - onceh=1;all_sel=1; - } - if (all_sel=1) and (onceh=0){ - repeat(60){i+=1; - if (ship[i]!="") and (ship_all[i]=1){ship_all[i]=0;scr_drop_fiddle(ship_ide[i],false,i,attack);} - if (ship_all[500]=0) then add_ground=1; - if (ship_all[500]=1) then add_ground=-1; - } - onceh=1;all_sel=0; - } - } - draw_text_transformed(x2+233+30,y2+75+4,string_hash_to_newline("Select All"),1,1,0); - } - - var smin,smax; - var w;w=-1;smin=0;smax=0; - - if (purge=2){repeat(61){w+=1;if (ship[w]!="") and (ship_size[w]>1){smax+=1;if (ship_all[w]>0) then smin+=1;}}} - - if (purge>=3){ - repeat(61){w+=1;if (ship[w]!=""){smax+=ship_max[w];if (ship_all[w]>0) then smin+=ship_use[w];}} - if (ship_max[500]>0) and (ship_all[500]>0){smax+=ship_max[500];smin+=ship_max[500];} - - if (add_ground=1){ - master+=l_master;honor+=l_honor; - capts+=l_capts;mahreens+=l_mahreens; - veterans+=l_veterans;terminators+=l_terminators; - dreads+=l_dreads;chaplains+=l_chaplains; - psykers+=l_psykers;apothecaries+=l_apothecaries; - techmarines+=l_techmarines;champions+=l_champions; - } - if (add_ground=-1){ - master-=l_master;honor-=l_honor; - capts-=l_capts;mahreens-=l_mahreens; - veterans-=l_veterans;terminators-=l_terminators; - dreads-=l_dreads;chaplains-=l_chaplains; - psykers-=l_psykers;apothecaries-=l_apothecaries; - techmarines-=l_techmarines;champions-=l_champions; - } - } - - - - - - draw_text(x2+14,y2+352,string_hash_to_newline("Selection: "+string(smin)+"/"+string(smax))); - - - - - - - var sel;sel=""; - if (purge>2){ - if (master=1) then sel+="Chapter Master "+string(obj_ini.master_name)+", "; - if (honor>1) then sel+=string(honor)+" "+string(obj_ini.role[100][2])+"s, "; - if (honor=1) then sel+="1 "+string(obj_ini.role[100][2])+", "; - if (capts>1) then sel+=string(capts)+" "+string(obj_ini.role[100][5])+"s, "; - if (champions>1) then sel+=string(capts)+" Champions, "; - if (champions=1) then sel+="1 Champion, "; - if (capts=1) then sel+="1 "+string(obj_ini.role[100][5])+", "; - if (chaplains>1) then sel+=string(chaplains)+" "+string(obj_ini.role[100][14])+"s, "; - if (chaplains=1) then sel+="1 "+string(obj_ini.role[100][14])+", "; - if (apothecaries>1) then sel+=string(apothecaries)+" "+string(obj_ini.role[100][15])+"s, "; - if (apothecaries=1) then sel+="1 "+string(obj_ini.role[100][15])+", "; - if (psykers>1) then sel+=string(psykers)+" Psykers, "; - if (psykers=1) then sel+="1 Psyker, "; - if (techmarines>1) then sel+=string(techmarines)+" "+string(obj_ini.role[100][16])+"s, "; - if (techmarines=1) then sel+="1 "+string(obj_ini.role[100][16])+", "; - if (terminators>1) then sel+=string(terminators)+" "+string(obj_ini.role[100][4])+"s, "; - if (terminators=1) then sel+="1 "+string(obj_ini.role[100][4])+", "; - if (veterans>1) then sel+=string(veterans)+" "+string(obj_ini.role[100][3])+"s, "; - if (veterans=1) then sel+="1 "+string(obj_ini.role[100][3])+", "; - if (mahreens>1) then sel+=string(mahreens)+" Marines, "; - if (mahreens=1) then sel+="1 Marine, "; - if (dreads>1) then sel+=string(dreads)+" "+string(obj_ini.role[100][6])+", "; - if (dreads=1) then sel+="1 "+string(obj_ini.role[100][6])+", "; - sel=string_delete(sel,string_length(sel)-1,2); - } - // draw_text_ext(xx+310,yy+234,string(sel),-1,206); - - - - - // Back / Purge buttons - - - draw_set_color(c_gray);draw_rectangle(xx+852,yy+556,xx+921,yy+579,0); - draw_set_color(0);draw_text_transformed(x2+320,y2+358,string_hash_to_newline("BACK"),1.25,1.25,0); - if (scr_hit(xx+852,yy+556,xx+921,yy+579)=true){ - draw_set_alpha(0.2);draw_rectangle(xx+852,yy+556,xx+921,yy+579,0);draw_set_alpha(1); - if (scr_click_left()) { - purge=1; - } - } - - draw_set_color(c_gray); - draw_rectangle(xx+954,yy+556,xx+1043,yy+579,0); - draw_set_color(0); - draw_text_transformed(x2+423,y2+358,"PURGE!",1.25,1.25,0); - if (scr_hit(xx+954,yy+556,xx+1043,yy+579)=true){ - draw_set_alpha(0.2); - draw_rectangle(xx+954,yy+556,xx+1043,yy+579,0);draw_set_alpha(1); - if (scr_click_left()) { - // Start purge here - if (purge=2){var i;i=0; - repeat(50){i+=1; - if (ship[i]!="") and (ship_all[i]>0){ - if (obj_ini.ship_class[ship_ide[i]]="Slaughtersong") then purge_score+=3; - if (obj_ini.ship_class[ship_ide[i]]="Battle Barge") then purge_score+=3; - if (obj_ini.ship_class[ship_ide[i]]="Strike Cruiser") then purge_score+=1; - } - } - } - if (purge>=3){ - var i;i=-1;purge_score=0; - repeat(51){i+=1; - if (ship_all[i]!=0) then purge_score+=ship_use[i]; - } - } - - scr_purge_world(p_target,planet_number,purge-1,purge_score); - } - } - - - if (scr_hit(x2+14,y2+351,x2+300,y2+373)=true) and (string_length(sel)>0) and (purge>2){ - // if (scr_hit(xx+546,yy+551,xx+680,yy+570)=true){ - draw_set_alpha(1); - draw_set_font(fnt_40k_14);draw_set_halign(fa_left);draw_set_color(0); - draw_rectangle(mouse_x+18,mouse_y+20,mouse_x+string_width_ext(string_hash_to_newline(sel),-1,500)+24,mouse_y+24+string_height_ext(string_hash_to_newline(sel),-1,500),0); - draw_set_color(c_gray); - draw_set_font(fnt_40k_14);draw_text_ext(mouse_x+22,mouse_y+22,string_hash_to_newline(string(sel)),-1,500); - draw_rectangle(mouse_x+18,mouse_y+20,mouse_x+string_width_ext(string_hash_to_newline(sel),-1,500)+24,mouse_y+24+string_height_ext(string_hash_to_newline(sel),-1,500),1); - } - -} - - - -/* */ -} -} -/* */ diff --git a/objects/obj_drop_select/Draw_64.gml b/objects/obj_drop_select/Draw_64.gml new file mode 100644 index 000000000..1e946516b --- /dev/null +++ b/objects/obj_drop_select/Draw_64.gml @@ -0,0 +1,124 @@ +try { + if (instance_number(obj_ncombat) || instance_number(obj_popup)) { + exit; + } + + w = 660; + h = 520; + // Center of the screen + //setup + var _x_center = (display_get_gui_width() / 2) - (w / 2); + var _y_center = (display_get_gui_height() / 2) - (h / 2); + //draw main_slate + if (purge != DropType.PurgeSelect && (local_content_slate.XX <= _x_center - local_content_slate.width)) { + main_slate.inside_method = drop_select_draw; + main_slate.draw(_x_center, _y_center, (660 / 860), (520 / 850)); + } + + //left hand slate + local_content_slate.inside_method = function() { + var _xx = local_content_slate.XX; + var _yy = local_content_slate.YY + 40; + var _width = local_content_slate.width; + var _heigth = local_content_slate.height; + if (purge == 0) { + draw_set_halign(fa_left); + draw_text_ext(_xx + 15, _yy, roster.roster_local_string, -1, local_content_slate.width - 30); + draw_text_ext(_xx + 15.1, _yy + 0.1, roster.roster_local_string, -1, local_content_slate.width - 30); + } + if (purge != DropType.RaidAttack) { + if (purge == DropType.PurgeSelect) { + draw_set_halign(fa_center); + draw_set_font(fnt_40k_30b); + + draw_set_color(c_gray); + var _exit = draw_unit_buttons([_xx + (_width / 2) - 40, 559], "Cancel"); + if (point_and_click(_exit)) { + instance_destroy(); + } + } + var _xx = local_content_slate.XX; + + /*if (instance_exists(p_target)) { + if (p_target.p_type[planet_number] = "Shrine") then nup = true; + } + */ + // 89,31 + draw_set_halign(fa_left); + for (var i = 0; i < array_length(purge_options); i++) { + var _purge_button = purge_options[i]; + _purge_button.x1 = _xx + 10; + _purge_button.width = local_content_slate.width - 20; + _purge_button.draw(); + if (_purge_button.clicked()) { + purge_score = 0; + purge = _purge_button.purge_type; + } + } + } + }; + + draw_set_halign(fa_center); + if (purge == DropType.RaidAttack) { + local_content_slate.draw(_x_center - local_content_slate.width, _y_center, (300 / 860), (520 / 850)); + } else if (purge == 1) { + local_content_slate.draw((camera_width / 2) - (local_content_slate.width / 2), _y_center, (300 / 860), (520 / 850)); + } else { + if (local_content_slate.XX > _x_center - local_content_slate.width) { + var _draw_x = max(local_content_slate.XX - 15, _x_center - local_content_slate.width); + local_content_slate.draw(_draw_x, _y_center, (300 / 860), (520 / 850)); + } else { + local_content_slate.draw(local_content_slate.XX, _y_center, (300 / 860), (520 / 850)); + } + } + draw_set_halign(fa_center); + draw_set_font(fnt_40k_14b); + roster_slate.inside_method = function() { + var _xx = roster_slate.XX + (roster_slate.width / 2); + var _yy = roster_slate.YY + 40; + if (purge == 0) { + draw_text_transformed(_xx, _yy, "Battle Roster", 2, 2, 0); + _yy += 30; + draw_text_ext(_xx, _yy, roster.roster_string, -1, roster_slate.width - 30); + draw_text_ext(_xx + 0.1, _yy + 0.1, roster.roster_string, -1, roster_slate.width - 30); + } else if (purge > DropType.PurgeSelect) { + draw_text_transformed(_xx, _yy, "Purge Insight", 2, 2, 0); + _yy += 30; + var hers, influ, poppy; + var hers = p_target.p_heresy[planet_number] + p_target.p_heresy_secret[planet_number]; + var influ = p_target.p_influence[planet_number]; + if (p_target.p_large[planet_number] == 1) { + poppy = string(p_target.p_population[planet_number]) + "B"; + } + if (p_target.p_large[planet_number] == 0) { + poppy = string(scr_display_number(p_target.p_population[planet_number])); + } + draw_text(_xx + 14, _yy + 10, $"Heresy: {max(hers, influ[eFACTION.Tau])}%"); + draw_text(_xx + 14, _yy + 20, $"Population: {poppy}"); + } else if (purge == DropType.PurgeSelect) { + draw_text_transformed(_xx, _yy, "Purge", 2, 2, 0); + _yy += 30; + for (var i = 0; i < array_length(purge_options); i++) { + if (purge_options[i].hover()) { + draw_text_ext(_xx, _yy, purge_options[i].description, -1, roster_slate.width - 30); + } + } + } + }; + var _draw_x = _x_center + main_slate.width; + var _draw_y = _y_center; + if (purge > DropType.PurgeSelect) { + if (roster_slate.XX < _x_center + 660) { + var _draw_x = min(roster_slate.XX + 15, _x_center + 660); + } else { + _draw_x = roster_slate.XX; + } + } else if (purge == DropType.PurgeSelect) { + _draw_x = local_content_slate.XX + local_content_slate.width; + } + + roster_slate.draw(_draw_x, _draw_y, (300 / 860), (520 / 850)); +} catch (_exception) { + handle_exception(_exception); + instance_destroy(); +} diff --git a/objects/obj_drop_select/KeyPress_68.gml b/objects/obj_drop_select/KeyPress_68.gml index b162b7b57..e69de29bb 100644 --- a/objects/obj_drop_select/KeyPress_68.gml +++ b/objects/obj_drop_select/KeyPress_68.gml @@ -1,19 +0,0 @@ -if (global.cheat_debug) { - var i,comp,good,unit,chick;i=0;comp=0;good=1; - refresh_raid=0;chick=1; - - repeat(3500){ - if (good=1){ - i+=1;if (i>300){i=1;comp+=1;} - if (comp>10) then good=0; - } - if (good=1){ - unit = fetch_unit([comp, i]); - if (unit.ship_location>0) and (via[unit.ship_location]!=1) then chick=0; - } - - if (good=1){ - if (fighting[comp][i]=1) then show_message(string(comp)+":"+string(i)+", "+string(obj_ini.role[comp][i])+" is 'fighting'"); - } - } -} \ No newline at end of file diff --git a/objects/obj_drop_select/Mouse_56.gml b/objects/obj_drop_select/Mouse_56.gml index 1bd69aa5c..0c66b087d 100644 --- a/objects/obj_drop_select/Mouse_56.gml +++ b/objects/obj_drop_select/Mouse_56.gml @@ -13,8 +13,13 @@ yy=__view_get( e__VW.YView, 0 ); var i;i=-1;ships_selected=0; -repeat(31){i+=1;if (ship_all[i]!=0) and (ship[i]!="") then ships_selected+=1; -}if (ship_all[500]!=0) then ships_selected+=1; +repeat(31){ + i+=1; + if (ship_all[i]!=0) and (ship[i]!=""){ + ships_selected+=1; + } +} +if (ship_all[500]!=0) then ships_selected+=1; @@ -112,9 +117,9 @@ if (obj_controller.cooldown <= 0) { if (add_ground = 1) { ships_selected += 1; - master += l_master; - honor += l_honor; - capts += l_capts; + master += local_forces.master; + honor += local_forces.honor; + capts += local_forces.captains; mahreens += l_mahreens; veterans += l_veterans; terminators += l_terminators; @@ -134,9 +139,9 @@ if (add_ground = 1) { } if (add_ground = -1) { ships_selected -= 1; - master -= l_master; - honor -= l_honor; - capts -= l_capts; + master -= local_forces.master; + honor -= local_forces.honor; + capts -= local_forces.captains; mahreens -= l_mahreens; veterans -= l_veterans; terminators -= l_terminators; @@ -156,120 +161,4 @@ if (add_ground = -1) { } - - - - - -// -if (obj_controller.cooldown<=0) and (once_only=0){// Need to change max_ships to something more meaningful to make sure that SOMETHING is dropping - if (ships_selected>0) and (mouse_x>=xx+310) and (mouse_y>=yy+378) and (mouse_x0) and (obj_ncombat.battle_object.p_owner[obj_ncombat.battle_id]=8){ - var rolli;rolli=floor(random(100))+1; - if (obj_ncombat.threat=6) and (rolli<=80) then obj_ncombat.ethereal=1; - if (obj_ncombat.threat=5) and (rolli<=65) then obj_ncombat.ethereal=1; - if (obj_ncombat.threat=4) and (rolli<=50) then obj_ncombat.ethereal=1; - if (obj_ncombat.threat=3) and (rolli<=35) then obj_ncombat.ethereal=1; - } - // show_message("Ethereal Quest?: "+string(eth)+"#Ethereal?: "+string(obj_ncombat.ethereal)); - } - - // if (obj_ncombat.threat>1) and (obj_ncombat.enemy!=13) then obj_ncombat.threat-=1; - if (obj_ncombat.threat>1) then obj_ncombat.threat-=1; - if (obj_ncombat.threat<1) then obj_ncombat.threat=1; - if (obj_ncombat.enemy=10) and (obj_ncombat.battle_object.p_type[obj_ncombat.battle_id]="Daemon") then obj_ncombat.threat=7; - - scr_battle_allies(); - - var co, v, stop; - co=0;v=0;stop=0; - repeat(3600){ - if (co<11){v+=1; - if (v>300){co+=1;v=1;} - if (co>10) then stop=1; - if (stop=0){ - if (fighting[co][v]!=0) then obj_ncombat.fighting[co][v]=1; - if (attack=1) and (v<=100){ - if (veh_fighting[co][v]!=0) then obj_ncombat.veh_fighting[co][v]=1; - } - if (attack=1) and (ship_all[500]=1){ - if (obj_ini.loc[co][v]=p_target.name) and (obj_ini.TTRPG[co][v].planet_location=planet_number) then obj_ncombat.fighting[co][v]=1; - if (v<=100){if (obj_ini.veh_loc[co][v]=p_target.name) and (obj_ini.veh_wid[co][v]=planet_number) then obj_ncombat.veh_fighting[co][v]=1;} - } - } - } - } - - ships_selected=0; - var ships_len = array_length(ship_all); - for (var i = 0; i < ships_len; i++) { - if (ship_all[i]!=0) then scr_battle_roster(ship[i],ship_ide[i],false); - } - if (ship_all[500]=1) then scr_battle_roster(p_target.name,planet_number,true); - - - } -} - } diff --git a/objects/obj_drop_select/Step_0.gml b/objects/obj_drop_select/Step_0.gml index c7f7ad66c..e69de29bb 100644 --- a/objects/obj_drop_select/Step_0.gml +++ b/objects/obj_drop_select/Step_0.gml @@ -1,167 +0,0 @@ - -// exit; - -// if (mahreens<0) then mahreens=0; - -if (refresh_raid!=0){ - var i,comp,good,unit,chick,remove;i=0;comp=0;good=1;remove=0; - refresh_raid=0;chick=1; - - for (comp=0;comp<=10;comp++){ - for (i=0;i0) and (via[unit.ship_location]<=0) then chick=0;} - - remove=0; - - // just added the ship part - if (good=1) and ((unit.ship_location>0) or ((attack=1) and (unit.planet_location=obj_controller.selecting_planet) and (obj_ini.loc[comp][i]=p_target.name) and (remove_local!=0))){ - - if (attack=1) and (unit.planet_location=obj_controller.selecting_planet) and (remove_local=1) then remove=1; - - // Fight wounded - var on_bike = unit.mobility_item()=="Bike"; - if (unit.hp()<=10) and (fighting[comp][i]=0) and (raid_wounded=1) and (via[unit.ship_location]>0){ - if (!on_bike) or (attack=1) then fighting[comp][i]=1; - - if (unit.role()=obj_ini.role[100][11]){ - if (on_bike) and (attack=1) then bikes+=1; - if (!on_bike) then mahreens+=1; - } - if (!on_bike){ - if (unit.IsSpecialist("rank_and_file")) then mahreens++; - if (unit.role()=obj_ini.role[100][3]) then veterans+=1; - }else if (on_bike) and (attack=1){ - if (unit.role()=obj_ini.role[100][3]) then bikes+=1; - if (unit.IsSpecialist("rank_and_file")) then bikes++; - } - - if (unit.role()="Champion"){ - champions+=1; - }else if (unit.role()=obj_ini.role[100][2]) { honor+=1;} - else if (unit.role()=obj_ini.role[100][4]) { terminators+=1;} - else if (unit.role()=obj_ini.role[100][5]) { capts+=1;} - - else if (unit.IsSpecialist("chap", true)){ - chaplains++; - }else if (unit.IsSpecialist("apoth", true)){ - apothecaries++; - }else if (unit.IsSpecialist("libs", true)){ - psykers++; - }else if (unit.IsSpecialist("forge", true)){ - techmarines++; - } - if (unit.role()="Chapter Master") then master=1; - } - - - if (obj_ini.race[comp][i]=1) and ((fighting[comp][i]=1) or (remove=1)){// Case 1; check for marines that need to be removed - if (unit.role()=obj_ini.role[100][11]) and ((raid_tact+raid_vet+raid_deva+raid_assa=0) or (remove=1)){ - if (on_bike) then bikes-=1; - if (!on_bike) then mahreens-=1; - fighting[comp][i]=0; - } - if (!on_bike){ - if (unit.role()=obj_ini.role[100][3]) and ((raid_vet=0) or (remove=1)){fighting[comp][i]=0;veterans-=1;} - if (unit.role()=obj_ini.role[100][8]) and ((raid_tact=0) or (remove=1)){fighting[comp][i]=0;mahreens-=1;} - if (unit.role()=obj_ini.role[100][9]) and ((raid_deva=0) or (remove=1)){fighting[comp][i]=0;mahreens-=1;} - if (unit.role()=obj_ini.role[100][10]) and ((raid_assa=0) or (remove=1)){fighting[comp][i]=0;mahreens-=1;} - if (unit.role()=obj_ini.role[100][12]) and ((raid_scou=0) or (remove=1)){fighting[comp][i]=0;mahreens-=1;} - } - if (on_bike){ - if (unit.role()=obj_ini.role[100][3]) and ((raid_vet=0) or (remove=1)){fighting[comp][i]=0;bikes-=1;} - if (unit.role()=obj_ini.role[100][8]) and ((raid_tact=0) or (remove=1)){fighting[comp][i]=0;bikes-=1;} - if (unit.role()=obj_ini.role[100][9]) and ((raid_deva=0) or (remove=1)){fighting[comp][i]=0;bikes-=1;} - if (unit.role()=obj_ini.role[100][10]) and ((raid_assa=0) or (remove=1)){fighting[comp][i]=0;bikes-=1;} - if (unit.role()=obj_ini.role[100][12]) and ((raid_scou=0) or (remove=1)){fighting[comp][i]=0;bikes-=1;} - } - - if (unit.role()=obj_ini.role[100][2]) and ((raid_vet=0) or (remove=1)){fighting[comp][i]=0;honor-=1;} - if (unit.role()=obj_ini.role[100][4]) and ((raid_term=0) or (remove=1)){fighting[comp][i]=0;terminators-=1;} - if (unit.role()=obj_ini.role[100][5]) and ((raid_vet=0) or (remove=1)){fighting[comp][i]=0;capts-=1;} - if (unit.role()="Champion") and ((raid_vet=0) or (remove=1)){fighting[comp][i]=0;champions-=1;} - - if (unit.role()="Chapter Master") and ((raid_spec=0) or (remove=1)){fighting[comp][i]=0;master=0;} - if (unit.IsSpecialist("chap", true)) and ((raid_spec=0) or (remove=1)){fighting[comp][i]=0;chaplains-=1} - if (unit.IsSpecialist("apoth", true)) and ((raid_spec=0) or (remove=1)){fighting[comp][i]=0;apothecaries-=1;} - if (unit.IsSpecialist("libs", true)) and ((raid_spec=0) or (remove=1)){fighting[comp][i]=0;psykers-=1;} - if (unit.IsSpecialist("forge", true)) and ((raid_spec=0) or (remove=1)){fighting[comp][i]=0;techmarines-=1;} - } - - - if (obj_ini.race[comp][i]=1) and (fighting[comp][i]=0) and (chick>0) and (remove=0){// Case 2; check for marines that need to be added - if (unit.role()=obj_ini.role[100][11]) and (raid_tact+raid_vet+raid_deva+raid_assa>0){ - if (on_bike) and (attack=1) then bikes+=1; - if (!on_bike) then mahreens+=1; - if (!on_bike) or (attack=1) then fighting[comp][i]=1; - } - if (!on_bike){ - if (unit.role()=obj_ini.role[100][3]) and (raid_vet=1){fighting[comp][i]=1;veterans+=1;} - if (unit.role()=obj_ini.role[100][8]) and (raid_tact=1){fighting[comp][i]=1;mahreens+=1;} - if (unit.role()=obj_ini.role[100][9]) and (raid_deva=1){fighting[comp][i]=1;mahreens+=1;} - if (unit.role()=obj_ini.role[100][10]) and (raid_assa=1){fighting[comp][i]=1;mahreens+=1;} - if (unit.role()=obj_ini.role[100][12]) and (raid_scou=1){fighting[comp][i]=1;mahreens+=1;} - } - if (on_bike) and (attack=1){ - if (unit.role()=obj_ini.role[100][3]) and (raid_vet=1){fighting[comp][i]=1;bikes+=1;} - if (unit.role()=obj_ini.role[100][8]) and (raid_tact=1){fighting[comp][i]=1;bikes+=1;} - if (unit.role()=obj_ini.role[100][9]) and (raid_deva=1){fighting[comp][i]=1;bikes+=1;} - if (unit.role()=obj_ini.role[100][10]) and (raid_assa=1){fighting[comp][i]=1;bikes+=1;} - if (unit.role()=obj_ini.role[100][12]) and (raid_scou=1){fighting[comp][i]=1;bikes+=1;} - } - - if (unit.role()=obj_ini.role[100][2]) and (raid_vet=1){fighting[comp][i]=1;honor+=1;} - if (unit.role()=obj_ini.role[100][4]) and (raid_term=1){fighting[comp][i]=1;terminators+=1;} - if (unit.role()=obj_ini.role[100][5]) and (raid_vet=1){fighting[comp][i]=1;capts+=1;} - if (unit.role()="Champion") and (raid_vet=1){fighting[comp][i]=1;champions+=1;} - - if (unit.role()="Chapter Master") and (raid_spec=1){fighting[comp][i]=1;master=1;} - if (unit.IsSpecialist("chap", true)) and (raid_spec=1){fighting[comp][i]=1;chaplains+=1} - if (unit.IsSpecialist("apoth", true)) and (raid_spec=1){fighting[comp][i]=1;apothecaries+=1;} - if (unit.IsSpecialist("libs", true)) and (raid_spec=1){fighting[comp][i]=1;psykers+=1;} - if (unit.IsSpecialist("forge", true)) and (raid_spec=1){fighting[comp][i]=1;techmarines+=1;} - } - - - // Remove wounded - - - if (unit.hp()<=10) and (fighting[comp][i]=1) and (raid_wounded=0){ - fighting[comp][i]=0; - if (unit.role()=obj_ini.role[100][11]){ - if (obj_ini.mobi[comp][i]="Bike") then bikes-=1; - if (obj_ini.mobi[comp][i]!="Bike") then mahreens-=1; - } - if (!on_bike){ - if (unit.role()=obj_ini.role[100][3]) then veterans-=1; - if (unit.role()=obj_ini.role[100][8]) then mahreens-=1; - if (unit.role()=obj_ini.role[100][9]) then mahreens-=1; - if (unit.role()=obj_ini.role[100][10]) then mahreens-=1; - if (unit.role()=obj_ini.role[100][12]) then mahreens-=1; - } - if (on_bike){ - if (unit.role()=obj_ini.role[100][3]) then bikes-=1; - if (unit.role()=obj_ini.role[100][8]) then bikes-=1; - if (unit.role()=obj_ini.role[100][9]) then bikes-=1; - if (unit.role()=obj_ini.role[100][10]) then bikes-=1; - if (unit.role()=obj_ini.role[100][12]) then bikes-=1; - } - - if (unit.role()="Champion") then champions-=1; - if (unit.role()=obj_ini.role[100][2]) then honor-=1; - if (unit.role()=obj_ini.role[100][4]) then terminators-=1; - if (unit.role()=obj_ini.role[100][5]) then capts-=1; - - if (unit.role()="Chapter Master") then master=0; - if (unit.IsSpecialist("chap", true)) then chaplains-=1 - if (unit.IsSpecialist("apoth", true)) then apothecaries-=1; - if (unit.IsSpecialist("libs", true)) then psykers-=1; - if (unit.IsSpecialist("forge", true)) then techmarines-=1; - } - } - } - } -} - - diff --git a/objects/obj_drop_select/obj_drop_select.yy b/objects/obj_drop_select/obj_drop_select.yy index c0da15312..0bfdfdf18 100644 --- a/objects/obj_drop_select/obj_drop_select.yy +++ b/objects/obj_drop_select/obj_drop_select.yy @@ -13,8 +13,8 @@ {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":56,"eventType":6,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":50,"eventType":6,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":68,"eventType":9,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, ], "managed": true, "overriddenProperties": [], diff --git a/objects/obj_dropdown_sel/Draw_0.gml b/objects/obj_dropdown_sel/Draw_0.gml index e2d14f060..78aa618af 100644 --- a/objects/obj_dropdown_sel/Draw_0.gml +++ b/objects/obj_dropdown_sel/Draw_0.gml @@ -100,7 +100,8 @@ if (opened=1){ } if (target="event_loc"){ if (obj_controller.fest_planet=0){ - obj_controller.fest_sid=option_id[ii];obj_controller.fest_wid=0; + obj_controller.fest_sid=option_id[ii]; + obj_controller.fest_wid=0; if (option_id[ii]>0){ if (obj_controller.fest_warp=0) and (obj_ini.ship_location[option_id[ii]]="Warp") then obj_controller.fest_warp=1; if (obj_controller.fest_warp=1) and (obj_ini.ship_location[option_id[ii]]!="Warp") then obj_controller.fest_warp=0; diff --git a/objects/obj_en_fleet/Alarm_1.gml b/objects/obj_en_fleet/Alarm_1.gml index 5e7fbfa0a..3ce279078 100644 --- a/objects/obj_en_fleet/Alarm_1.gml +++ b/objects/obj_en_fleet/Alarm_1.gml @@ -107,7 +107,7 @@ if (navy && action=="") { var bombard=0,deaths=0,hurss=0,onceh=0,wob=0,kill=0; - for (var o=1;o<=planets;o++){ + for (var o=1;o<=orbiting.planets;o++){ if (orbiting.p_owner[o]==eFACTION.Player){ if (orbiting.p_population[o]+orbiting.p_pdf[o]>0) || (orbiting.p_player[o]>0){ bombard=o; @@ -627,8 +627,8 @@ if (action=="" && _is_orbiting){ var whom=-1; whom = inquisitor; - - var inquis_string = $"Inquisitor {obj_controller.inquisitor[whom]}"; + var inquisitors = obj_controller.inquisitor; + var inquis_string = $"Inquisitor {whom>-1 ? inquisitors[whom] : inquisitors[0]}"; // INVESTIGATE DEAD HERE 137 ; INVESTIGATE DEAD HERE 137 ; INVESTIGATE DEAD HERE 137 ; INVESTIGATE DEAD HERE 137 ; var cur_star,t,type,cha,dem,tem1,tem1_base,perc,popup; diff --git a/objects/obj_en_husk/Draw_0.gml b/objects/obj_en_husk/Draw_0.gml index 01b7557f2..3a1a9e770 100644 --- a/objects/obj_en_husk/Draw_0.gml +++ b/objects/obj_en_husk/Draw_0.gml @@ -1,7 +1,9 @@ +if (sprite_exists(sprite_index)){ + draw_self(); + draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,direction,c_black,0.4); +} -draw_self(); -draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,direction,c_black,0.4); diff --git a/objects/obj_en_ship/Alarm_0.gml b/objects/obj_en_ship/Alarm_0.gml index 7209c2bce..ce2ca6378 100644 --- a/objects/obj_en_ship/Alarm_0.gml +++ b/objects/obj_en_ship/Alarm_0.gml @@ -1,98 +1,309 @@ cooldown[1]=0; -cooldown[2]=0; -cooldown[3]=0; -cooldown[4]=0; -cooldown[5]=0; - - - - - -/*weapon1=obj_fleet_controller.ship_wep1[self.ship_id];weapon1_facing="";weapon1_cooldown=0; -weapon1_hp=hp/4;weapon1_dam=0;weapon1_ammo=999;weapon1_range=0;weapon1_minrange=0; - -weapon2=obj_fleet_controller.ship_wep2[self.ship_id];weapon2_facing="";weapon2_cooldown=0; -weapon2_hp=hp/4;weapon2_dam=0;weapon2_ammo=999;weapon2_range=0;weapon2_minrange=0; - -weapon3=obj_fleet_controller.ship_wep3[self.ship_id];weapon3_facing="";weapon3_cooldown=0; -weapon3_hp=hp/4;weapon3_dam=0;weapon3_ammo=999;weapon3_range=0;weapon3_minrange=0; - -weapon4=obj_fleet_controller.ship_wep4[self.ship_id];weapon4_facing="";weapon4_cooldown=0; -weapon4_hp=hp/4;weapon4_dam=0;weapon4_ammo=999;weapon4_range=0;weapon4_minrange=0; -weapon5=obj_fleet_controller.ship_wep5[self.ship_id];weapon5_facing="";weapon5_cooldown=0; -weapon5_hp=hp/4;weapon1_dam=0;weapon5_ammo=999;weapon5_range=0;weapon5_minrange=0;*/ +cooldown[2]=0; +cooldown[3]=0; +cooldown[4]=0; +cooldown[5]=0; -if (class="Apocalypse Class Battleship"){sprite_index=spr_ship_apoc;ship_size=3; - name="";hp=1200;maxhp=1200;conditions="";shields=400;maxshields=400;leadership=90; - armour_front=6;armour_other=5;weapons=4;turrets=4;capacity=150;carrying=0; - weapon[1]="Lance Battery";weapon_facing[1]="left";weapon_dam[1]=14;weapon_range[1]=300;weapon_cooldown[1]=30; - weapon[2]="Lance Battery";weapon_facing[2]="right";weapon_dam[2]=14;weapon_range[2]=300;weapon_cooldown[2]=30; - weapon[3]="Nova Cannon";weapon_facing[3]="front";weapon_dam[3]=34;weapon_range[3]=1500;weapon_minrange[3]=300;weapon_cooldown[3]=120; - weapon[4]="Weapons Battery";weapon_facing[4]="most";weapon_dam[4]=14;weapon_range[4]=600;weapon_cooldown[4]=20; +if (class="Apocalypse Class Battleship"){sprite_index=spr_ship_apoc; + ship_size=3; + + name=""; + hp=1200; + maxhp=1200; + conditions=""; + shields=400; + maxshields=400; + leadership=90; + + armour_front=6; + armour_other=5; + weapons=4; + turrets=4; + capacity=150; + carrying=0; + + weapon[1]="Lance Battery"; + weapon_facing[1]="left"; + weapon_dam[1]=14; + weapon_range[1]=300; + weapon_cooldown[1]=30; + + weapon[2]="Lance Battery"; + weapon_facing[2]="right"; + weapon_dam[2]=14; + weapon_range[2]=300; + weapon_cooldown[2]=30; + + weapon[3]="Nova Cannon"; + weapon_facing[3]="front"; + weapon_dam[3]=34; + weapon_range[3]=1500; + weapon_minrange[3]=300; + weapon_cooldown[3]=120; + + weapon[4]="Weapons Battery"; + weapon_facing[4]="most"; + weapon_dam[4]=14; + weapon_range[4]=600; + weapon_cooldown[4]=20; + } -if (class="Nemesis Class Fleet Carrier"){sprite_index=spr_ship_nem;ship_size=3; - name="";hp=1000;maxhp=1000;conditions="";shields=400;maxshields=400;leadership=85; - armour_front=5;armour_other=5;weapons=3;turrets=5;capacity=100;carrying=24; - weapon[1]="Interceptor Launch Bays";weapon_facing[1]="special";weapon_range[1]=9999;weapon_ammo[1]=6;weapon_cooldown[1]=120; - weapon[2]="Interceptor Launch Bays";weapon_facing[2]="special";weapon_range[2]=9999;weapon_ammo[2]=6;weapon_cooldown[2]=120;cooldown[2]=30; - weapon[3]="Lance Battery";weapon_facing[3]="front";weapon_dam[3]=14;weapon_range[3]=300;weapon_cooldown[3]=30; +if (class="Nemesis Class Fleet Carrier"){sprite_index=spr_ship_nem; + ship_size=3; + + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=400; + maxshields=400; + leadership=85; + + armour_front=5; + armour_other=5; + weapons=3; + turrets=5; + capacity=100; + carrying=24; + + weapon[1]="Interceptor Launch Bays"; + weapon_facing[1]="special"; + weapon_range[1]=9999; + weapon_ammo[1]=6; + weapon_cooldown[1]=120; + + weapon[2]="Interceptor Launch Bays"; + weapon_facing[2]="special"; + weapon_range[2]=9999; + weapon_ammo[2]=6; + weapon_cooldown[2]=120; + cooldown[2]=30; + + weapon[3]="Lance Battery"; + weapon_facing[3]="front"; + weapon_dam[3]=14; + weapon_range[3]=300; + weapon_cooldown[3]=30; + } -if (class="Avenger Class Grand Cruiser"){sprite_index=spr_ship_aven;ship_size=2; - name="";hp=1000;maxhp=1000;conditions="";shields=300;maxshields=300;leadership=85; - armour_front=5;armour_other=5;weapons=2;turrets=3;capacity=50;carrying=0; - weapon[1]="Lance Battery";weapon_facing[1]="most";weapon_dam[1]=14;weapon_range[1]=300;weapon_cooldown[1]=25; - // weapon[1]="Lance Battery";weapon_facing[1]="left";weapon_dam[1]=14;weapon_range[1]=300;weapon_cooldown[1]=25; - // weapon[2]="Lance Battery";weapon_facing[2]="right";weapon_dam[2]=14;weapon_range[2]=300;weapon_cooldown[2]=25; +if (class="Avenger Class Grand Cruiser"){sprite_index=spr_ship_aven; + ship_size=2; + + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=300; + maxshields=300; + leadership=85; + + armour_front=5; + armour_other=5; + weapons=2; + turrets=3; + capacity=50; + carrying=0; + + weapon[1]="Lance Battery"; + weapon_facing[1]="most"; + weapon_dam[1]=14; + weapon_range[1]=300; + weapon_cooldown[1]=25; + + // weapon[1]="Lance Battery"; + weapon_facing[1]="left"; + weapon_dam[1]=14; + weapon_range[1]=300; + weapon_cooldown[1]=25; + + // weapon[2]="Lance Battery"; + weapon_facing[2]="right"; + weapon_dam[2]=14; + weapon_range[2]=300; + weapon_cooldown[2]=25; + } -if (class="Sword Class Frigate"){sprite_index=spr_ship_sword;ship_size=1; - name="";hp=100;maxhp=100;conditions="";shields=100;maxshields=100;leadership=80; - armour_front=5;armour_other=5;weapons=1;turrets=2;capacity=50;carrying=0; - weapon[1]="Weapons Battery";weapon_facing[1]="most";weapon_dam[1]=8;weapon_range[1]=300;weapon_cooldown[1]=20; +if (class="Sword Class Frigate"){sprite_index=spr_ship_sword; + ship_size=1; + + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=80; + + armour_front=5; + armour_other=5; + weapons=1; + turrets=2; + capacity=50; + carrying=0; + + weapon[1]="Weapons Battery"; + weapon_facing[1]="most"; + weapon_dam[1]=8; + weapon_range[1]=300; + weapon_cooldown[1]=20; + } // Eldar -if (class="Void Stalker"){sprite_index=spr_ship_void;ship_size=3; - name="";hp=1000;maxhp=1000;conditions="";shields=300;maxshields=300;leadership=100; - armour_front=5;armour_other=4;weapons=3;turrets=4;capacity=150;carrying=0; - weapon[1]="Eldar Launch Bay";weapon_facing[1]="special";weapon_dam[1]=0;weapon_range[1]=9999;weapon_cooldown[1]=90;weapon_ammo[1]=4; - weapon[2]="Weapons Battery";weapon_facing[2]="most";weapon_dam[2]=14;weapon_range[2]=600;weapon_cooldown[2]=30; - weapon[3]="Pulsar Lances";weapon_facing[3]="most";weapon_dam[3]=10;weapon_range[3]=600;weapon_cooldown[3]=10; - // weapon[4]="Torpedoes";weapon_facing[4]="front";weapon_dam[4]=12;weapon_range[4]=450;weapon_cooldown[4]=90; +if (class="Void Stalker"){sprite_index=spr_ship_void; + ship_size=3; + + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=300; + maxshields=300; + leadership=100; + + armour_front=5; + armour_other=4; + weapons=3; + turrets=4; + capacity=150; + carrying=0; + + weapon[1]="Eldar Launch Bay"; + weapon_facing[1]="special"; + weapon_dam[1]=0; + weapon_range[1]=9999; + weapon_cooldown[1]=90; + weapon_ammo[1]=4; + + weapon[2]="Weapons Battery"; + weapon_facing[2]="most"; + weapon_dam[2]=14; + weapon_range[2]=600; + weapon_cooldown[2]=30; + + weapon[3]="Pulsar Lances"; + weapon_facing[3]="most"; + weapon_dam[3]=10; + weapon_range[3]=600; + weapon_cooldown[3]=10; + + // weapon[4]="Torpedoes"; + weapon_facing[4]="front"; + weapon_dam[4]=12; + weapon_range[4]=450; + weapon_cooldown[4]=90; + } -if (class="Shadow Class"){sprite_index=spr_ship_shadow;ship_size=3; - name="";hp=600;maxhp=600;conditions="";shields=200;maxshields=200;leadership=90; - armour_front=5;armour_other=4;weapons=2;turrets=3;capacity=100;carrying=0; - weapon[1]="Torpedoes";weapon_facing[1]="front";weapon_dam[1]=12;weapon_range[1]=450;weapon_cooldown[1]=90; - weapon[2]="Weapons Battery";weapon_facing[2]="front";weapon_dam[2]=10;weapon_range[2]=450;weapon_cooldown[2]=30; +if (class="Shadow Class"){sprite_index=spr_ship_shadow; + ship_size=3; + + name=""; + hp=600; + maxhp=600; + conditions=""; + shields=200; + maxshields=200; + leadership=90; + + armour_front=5; + armour_other=4; + weapons=2; + turrets=3; + capacity=100; + carrying=0; + + weapon[1]="Torpedoes"; + weapon_facing[1]="front"; + weapon_dam[1]=12; + weapon_range[1]=450; + weapon_cooldown[1]=90; + + weapon[2]="Weapons Battery"; + weapon_facing[2]="front"; + weapon_dam[2]=10; + weapon_range[2]=450; + weapon_cooldown[2]=30; + } -if (class="Hellebore"){sprite_index=spr_ship_hellebore;ship_size=1; - name="";hp=200;maxhp=200;conditions="";shields=200;maxshields=200;leadership=90; - armour_front=5;armour_other=4;weapons=3;turrets=2;capacity=50;carrying=0; - weapon[1]="Pulsar Lances";weapon_facing[1]="front";weapon_dam[1]=10;weapon_range[1]=450;weapon_cooldown[1]=20; - weapon[2]="Weapons Battery";weapon_facing[2]="front";weapon_dam[2]=8;weapon_range[2]=450;weapon_cooldown[2]=30; - weapon[3]="Eldar Launch Bay";weapon_facing[3]="special";weapon_dam[3]=0;weapon_range[3]=9999;weapon_cooldown[3]=90;weapon_ammo[1]=1; +if (class="Hellebore"){sprite_index=spr_ship_hellebore; + ship_size=1; + + name=""; + hp=200; + maxhp=200; + conditions=""; + shields=200; + maxshields=200; + leadership=90; + + armour_front=5; + armour_other=4; + weapons=3; + turrets=2; + capacity=50; + carrying=0; + + weapon[1]="Pulsar Lances"; + weapon_facing[1]="front"; + weapon_dam[1]=10; + weapon_range[1]=450; + weapon_cooldown[1]=20; + + weapon[2]="Weapons Battery"; + weapon_facing[2]="front"; + weapon_dam[2]=8; + weapon_range[2]=450; + weapon_cooldown[2]=30; + + weapon[3]="Eldar Launch Bay"; + weapon_facing[3]="special"; + weapon_dam[3]=0; + weapon_range[3]=9999; + weapon_cooldown[3]=90; + weapon_ammo[1]=1; + } -if (class="Aconite"){sprite_index=spr_ship_aconite;ship_size=1; - name="";hp=200;maxhp=200;conditions="";shields=200;maxshields=200;leadership=90; - armour_front=5;armour_other=4;weapons=3;turrets=2;capacity=50;carrying=0; - weapon[1]="Weapons Battery";weapon_facing[1]="front";weapon_dam[1]=8;weapon_range[1]=450;weapon_cooldown[1]=30; +if (class="Aconite"){sprite_index=spr_ship_aconite; + ship_size=1; + + name=""; + hp=200; + maxhp=200; + conditions=""; + shields=200; + maxshields=200; + leadership=90; + + armour_front=5; + armour_other=4; + weapons=3; + turrets=2; + capacity=50; + carrying=0; + + weapon[1]="Weapons Battery"; + weapon_facing[1]="front"; + weapon_dam[1]=8; + weapon_range[1]=450; + weapon_cooldown[1]=30; + } @@ -100,177 +311,770 @@ if (class="Aconite"){sprite_index=spr_ship_aconite;ship_size=1; // Orks -if (class="Dethdeala"){sprite_index=spr_ship_deth;ship_size=3; - name="";hp=1200;maxhp=1200;conditions="";shields=200;maxshields=200;leadership=100; - armour_front=6;armour_other=5;weapons=5;turrets=3;capacity=250;carrying=0; - weapon[1]="Gunz Battery";weapon_facing[1]="left";weapon_dam[1]=8;weapon_range[1]=300;weapon_cooldown[1]=30; - weapon[2]="Gunz Battery";weapon_facing[2]="right";weapon_dam[2]=8;weapon_range[2]=300;weapon_cooldown[2]=30; - weapon[3]="Bombardment Cannon";weapon_facing[3]="front";weapon_dam[3]=12;weapon_range[3]=450;weapon_cooldown[3]=120; - weapon[4]="Heavy Gunz";weapon_facing[4]="most";weapon_dam[4]=12;weapon_range[4]=200;weapon_cooldown[4]=40; - weapon[5]="Fighta Bommerz";weapon_facing[5]="special";weapon_dam[5]=0;weapon_range[5]=9999;weapon_cooldown[5]=90; +if (class="Dethdeala"){sprite_index=spr_ship_deth; + ship_size=3; + + name=""; + hp=1200; + maxhp=1200; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + + armour_front=6; + armour_other=5; + weapons=5; + turrets=3; + capacity=250; + carrying=0; + + weapon[1]="Gunz Battery"; + weapon_facing[1]="left"; + weapon_dam[1]=8; + weapon_range[1]=300; + weapon_cooldown[1]=30; + + weapon[2]="Gunz Battery"; + weapon_facing[2]="right"; + weapon_dam[2]=8; + weapon_range[2]=300; + weapon_cooldown[2]=30; + + weapon[3]="Bombardment Cannon"; + weapon_facing[3]="front"; + weapon_dam[3]=12; + weapon_range[3]=450; + weapon_cooldown[3]=120; + + weapon[4]="Heavy Gunz"; + weapon_facing[4]="most"; + weapon_dam[4]=12; + weapon_range[4]=200; + weapon_cooldown[4]=40; + + weapon[5]="Fighta Bommerz"; + weapon_facing[5]="special"; + weapon_dam[5]=0; + weapon_range[5]=9999; + weapon_cooldown[5]=90; + } -if (class="Gorbag's Revenge"){sprite_index=spr_ship_gorbag;ship_size=3; - name="";hp=1200;maxhp=1200;conditions="";shields=200;maxshields=200;leadership=100; - armour_front=6;armour_other=5;weapons=5;turrets=3;capacity=250;carrying=0; - weapon[1]="Gunz Battery";weapon_facing[1]="front";weapon_dam[1]=8;weapon_range[1]=450;weapon_cooldown[1]=30; - weapon[2]="Torpedoes";weapon_facing[2]="front";weapon_dam[2]=12;weapon_range[2]=300;weapon_cooldown[2]=120; - weapon[3]="Heavy Gunz";weapon_facing[3]="most";weapon_dam[3]=12;weapon_range[3]=200;weapon_cooldown[3]=40; - weapon[4]="Fighta Bommerz";weapon_facing[4]="special";weapon_dam[4]=0;weapon_ammo[4]=3;weapon_range[4]=9999;weapon_cooldown[4]=90; - weapon[5]="Fighta Bommerz";weapon_facing[5]="special";weapon_dam[5]=0;weapon_ammo[5]=3;weapon_range[5]=9999;weapon_cooldown[5]=90;cooldown[5]=30; +if (class="Gorbag's Revenge"){sprite_index=spr_ship_gorbag; + ship_size=3; + + name=""; + hp=1200; + maxhp=1200; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + + armour_front=6; + armour_other=5; + weapons=5; + turrets=3; + capacity=250; + carrying=0; + + weapon[1]="Gunz Battery"; + weapon_facing[1]="front"; + weapon_dam[1]=8; + weapon_range[1]=450; + weapon_cooldown[1]=30; + + weapon[2]="Torpedoes"; + weapon_facing[2]="front"; + weapon_dam[2]=12; + weapon_range[2]=300; + weapon_cooldown[2]=120; + + weapon[3]="Heavy Gunz"; + weapon_facing[3]="most"; + weapon_dam[3]=12; + weapon_range[3]=200; + weapon_cooldown[3]=40; + + weapon[4]="Fighta Bommerz"; + weapon_facing[4]="special"; + weapon_dam[4]=0; + weapon_ammo[4]=3; + weapon_range[4]=9999; + weapon_cooldown[4]=90; + + weapon[5]="Fighta Bommerz"; + weapon_facing[5]="special"; + weapon_dam[5]=0; + weapon_ammo[5]=3; + weapon_range[5]=9999; + weapon_cooldown[5]=90; + cooldown[5]=30; + } -if (class="Kroolboy") or (class="Slamblasta"){ship_size=3;sprite_index=spr_ship_krool; +if (class="Kroolboy") or (class="Slamblasta"){ship_size=3; + sprite_index=spr_ship_krool; + if (class="Kroolboy") then sprite_index=spr_ship_krool; + if (class="Slamblasta") then sprite_index=spr_ship_slam; - name="";hp=1200;maxhp=1200;conditions="";shields=200;maxshields=200;leadership=100; - armour_front=6;armour_other=5;weapons=3;turrets=3;capacity=250;carrying=0; - weapon[1]="Fighta Bommerz";weapon_facing[1]="special";weapon_dam[1]=0;weapon_ammo[1]=3;weapon_range[1]=9999;weapon_cooldown[1]=120; - weapon[2]="Gunz Battery";weapon_facing[2]="most";weapon_dam[2]=8;weapon_range[2]=300;weapon_cooldown[2]=30; - weapon[3]="Heavy Gunz";weapon_facing[3]="most";weapon_dam[3]=12;weapon_range[3]=200;weapon_cooldown[3]=40; + + name=""; + hp=1200; + maxhp=1200; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + + armour_front=6; + armour_other=5; + weapons=3; + turrets=3; + capacity=250; + carrying=0; + + weapon[1]="Fighta Bommerz"; + weapon_facing[1]="special"; + weapon_dam[1]=0; + weapon_ammo[1]=3; + weapon_range[1]=9999; + weapon_cooldown[1]=120; + + weapon[2]="Gunz Battery"; + weapon_facing[2]="most"; + weapon_dam[2]=8; + weapon_range[2]=300; + weapon_cooldown[2]=30; + + weapon[3]="Heavy Gunz"; + weapon_facing[3]="most"; + weapon_dam[3]=12; + weapon_range[3]=200; + weapon_cooldown[3]=40; + } -if (class="Battlekroozer"){sprite_index=spr_ship_kroozer;ship_size=3; - name="";hp=1000;maxhp=1000;conditions="";shields=200;maxshields=200;leadership=100; - armour_front=6;armour_other=5;weapons=5;turrets=3;capacity=250;carrying=0; - weapon[1]="Gunz Battery";weapon_facing[1]="most";weapon_dam[1]=8;weapon_range[1]=450;weapon_cooldown[1]=30; - weapon[2]="Heavy Gunz";weapon_facing[2]="left";weapon_dam[2]=12;weapon_range[2]=200;weapon_cooldown[2]=40; - weapon[3]="Heavy Gunz";weapon_facing[3]="right";weapon_dam[3]=12;weapon_range[3]=200;weapon_cooldown[3]=40; - weapon[4]="Fighta Bommerz";weapon_facing[4]="special";weapon_dam[4]=0;weapon_ammo[4]=3;weapon_range[4]=9999;weapon_cooldown[4]=90; - weapon[5]="Fighta Bommerz";weapon_facing[5]="special";weapon_dam[5]=0;weapon_ammo[5]=3;weapon_range[5]=9999;weapon_cooldown[5]=90;cooldown[5]=30; +if (class="Battlekroozer"){sprite_index=spr_ship_kroozer; + ship_size=3; + + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + + armour_front=6; + armour_other=5; + weapons=5; + turrets=3; + capacity=250; + carrying=0; + + weapon[1]="Gunz Battery"; + weapon_facing[1]="most"; + weapon_dam[1]=8; + weapon_range[1]=450; + weapon_cooldown[1]=30; + + weapon[2]="Heavy Gunz"; + weapon_facing[2]="left"; + weapon_dam[2]=12; + weapon_range[2]=200; + weapon_cooldown[2]=40; + + weapon[3]="Heavy Gunz"; + weapon_facing[3]="right"; + weapon_dam[3]=12; + weapon_range[3]=200; + weapon_cooldown[3]=40; + + weapon[4]="Fighta Bommerz"; + weapon_facing[4]="special"; + weapon_dam[4]=0; + weapon_ammo[4]=3; + weapon_range[4]=9999; + weapon_cooldown[4]=90; + + weapon[5]="Fighta Bommerz"; + weapon_facing[5]="special"; + weapon_dam[5]=0; + weapon_ammo[5]=3; + weapon_range[5]=9999; + weapon_cooldown[5]=90; + cooldown[5]=30; + } -if (class="Ravager"){sprite_index=spr_ship_ravager;ship_size=1; - name="";hp=100;maxhp=100;conditions="";shields=100;maxshields=100;leadership=80; - armour_front=6;armour_other=4;weapons=2;turrets=2;capacity=50;carrying=0; - weapon[1]="Gunz Battery";weapon_facing[1]="front";weapon_dam[1]=8;weapon_range[1]=300;weapon_cooldown[1]=30; - weapon[2]="Torpedoes";weapon_facing[2]="front";weapon_dam[2]=12;weapon_range[2]=300;weapon_cooldown[2]=120; +if (class="Ravager"){sprite_index=spr_ship_ravager; + ship_size=1; + + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=80; + + armour_front=6; + armour_other=4; + weapons=2; + turrets=2; + capacity=50; + carrying=0; + + weapon[1]="Gunz Battery"; + weapon_facing[1]="front"; + weapon_dam[1]=8; + weapon_range[1]=300; + weapon_cooldown[1]=30; + + weapon[2]="Torpedoes"; + weapon_facing[2]="front"; + weapon_dam[2]=12; + weapon_range[2]=300; + weapon_cooldown[2]=120; + } // Tau -if (class="Custodian"){sprite_index=spr_ship_custodian;ship_size=3; - name="";hp=1000;maxhp=1000;conditions="";shields=200;maxshields=200;leadership=100; - armour_front=6;armour_other=5;weapons=4;turrets=5;capacity=1000;carrying=0; - weapon[1]="Gravitic launcher";weapon_facing[1]="front";weapon_dam[1]=12;weapon_range[1]=400;weapon_minrange[1]=200;weapon_cooldown[1]=30; - weapon[2]="Railgun Battery";weapon_facing[2]="most";weapon_dam[2]=12;weapon_range[2]=450;weapon_cooldown[2]=30; - weapon[3]="Ion Cannons";weapon_facing[3]="most";weapon_dam[3]=8;weapon_range[3]=300;weapon_cooldown[3]=15; - weapon[4]="Manta Launch Bay";weapon_facing[4]="special";weapon_dam[4]=0;weapon_range[4]=9999;weapon_cooldown[4]=90;weapon_ammo[4]=4; +if (class="Custodian"){sprite_index=spr_ship_custodian; + ship_size=3; + + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + + armour_front=6; + armour_other=5; + weapons=4; + turrets=5; + capacity=1000; + carrying=0; + + weapon[1]="Gravitic launcher"; + weapon_facing[1]="front"; + weapon_dam[1]=12; + weapon_range[1]=400; + weapon_minrange[1]=200; + weapon_cooldown[1]=30; + + weapon[2]="Railgun Battery"; + weapon_facing[2]="most"; + weapon_dam[2]=12; + weapon_range[2]=450; + weapon_cooldown[2]=30; + + weapon[3]="Ion Cannons"; + weapon_facing[3]="most"; + weapon_dam[3]=8; + weapon_range[3]=300; + weapon_cooldown[3]=15; + + weapon[4]="Manta Launch Bay"; + weapon_facing[4]="special"; + weapon_dam[4]=0; + weapon_range[4]=9999; + weapon_cooldown[4]=90; + weapon_ammo[4]=4; + } -if (class="Protector"){sprite_index=spr_ship_protector;ship_size=2; - name="";hp=600;maxhp=600;conditions="";shields=200;maxshields=200;leadership=90; - armour_front=6;armour_other=5;weapons=4;turrets=3;capacity=250;carrying=0; - weapon[1]="Gravitic launcher";weapon_facing[1]="front";weapon_dam[1]=12;weapon_range[1]=400;weapon_minrange[1]=200;weapon_cooldown[1]=30; - weapon[2]="Railgun Battery";weapon_facing[2]="most";weapon_dam[2]=10;weapon_range[2]=450;weapon_cooldown[2]=30; - weapon[3]="Ion Cannons";weapon_facing[3]="most";weapon_dam[3]=8;weapon_range[3]=300;weapon_cooldown[3]=15; - weapon[4]="Manta Launch Bay";weapon_facing[4]="special";weapon_dam[4]=0;weapon_range[4]=9999;weapon_cooldown[4]=90;weapon_ammo[4]=2; +if (class="Protector"){sprite_index=spr_ship_protector; + ship_size=2; + + name=""; + hp=600; + maxhp=600; + conditions=""; + shields=200; + maxshields=200; + leadership=90; + + armour_front=6; + armour_other=5; + weapons=4; + turrets=3; + capacity=250; + carrying=0; + + weapon[1]="Gravitic launcher"; + weapon_facing[1]="front"; + weapon_dam[1]=12; + weapon_range[1]=400; + weapon_minrange[1]=200; + weapon_cooldown[1]=30; + + weapon[2]="Railgun Battery"; + weapon_facing[2]="most"; + weapon_dam[2]=10; + weapon_range[2]=450; + weapon_cooldown[2]=30; + + weapon[3]="Ion Cannons"; + weapon_facing[3]="most"; + weapon_dam[3]=8; + weapon_range[3]=300; + weapon_cooldown[3]=15; + + weapon[4]="Manta Launch Bay"; + weapon_facing[4]="special"; + weapon_dam[4]=0; + weapon_range[4]=9999; + weapon_cooldown[4]=90; + weapon_ammo[4]=2; + } -if (class="Emissary"){sprite_index=spr_ship_emissary;ship_size=2; - name="";hp=400;maxhp=400;conditions="";shields=100;maxshields=100;leadership=100; - armour_front=6;armour_other=5;weapons=4;turrets=2;capacity=100;carrying=0; - weapon[1]="Gravitic launcher";weapon_facing[1]="front";weapon_dam[1]=12;weapon_range[1]=400;weapon_minrange[1]=200;weapon_cooldown[1]=30; - weapon[2]="Railgun Battery";weapon_facing[2]="most";weapon_dam[2]=10;weapon_range[2]=450;weapon_cooldown[2]=30; - weapon[3]="Ion Cannons";weapon_facing[3]="most";weapon_dam[3]=8;weapon_range[3]=300;weapon_cooldown[3]=15; - weapon[4]="Manta Launch Bay";weapon_facing[4]="special";weapon_dam[4]=0;weapon_range[4]=9999;weapon_cooldown[4]=90;weapon_ammo[4]=1; +if (class="Emissary"){sprite_index=spr_ship_emissary; + ship_size=2; + + name=""; + hp=400; + maxhp=400; + conditions=""; + shields=100; + maxshields=100; + leadership=100; + + armour_front=6; + armour_other=5; + weapons=4; + turrets=2; + capacity=100; + carrying=0; + + weapon[1]="Gravitic launcher"; + weapon_facing[1]="front"; + weapon_dam[1]=12; + weapon_range[1]=400; + weapon_minrange[1]=200; + weapon_cooldown[1]=30; + + weapon[2]="Railgun Battery"; + weapon_facing[2]="most"; + weapon_dam[2]=10; + weapon_range[2]=450; + weapon_cooldown[2]=30; + + weapon[3]="Ion Cannons"; + weapon_facing[3]="most"; + weapon_dam[3]=8; + weapon_range[3]=300; + weapon_cooldown[3]=15; + + weapon[4]="Manta Launch Bay"; + weapon_facing[4]="special"; + weapon_dam[4]=0; + weapon_range[4]=9999; + weapon_cooldown[4]=90; + weapon_ammo[4]=1; + } -if (class="Warden"){sprite_index=spr_ship_warden;ship_size=1; - name="";hp=100;maxhp=100;conditions="";shields=100;maxshields=100;leadership=80; - armour_front=5;armour_other=4;weapons=2;turrets=1;capacity=50;carrying=0; - weapon[1]="Ion Cannon";weapon_facing[1]="most";weapon_dam[1]=8;weapon_range[1]=300;weapon_cooldown[1]=50; - weapon[2]="Railgun Battery";weapon_facing[2]="front";weapon_dam[2]=10;weapon_range[2]=300;weapon_cooldown[2]=60; +if (class="Warden"){sprite_index=spr_ship_warden; + ship_size=1; + + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=80; + + armour_front=5; + armour_other=4; + weapons=2; + turrets=1; + capacity=50; + carrying=0; + + weapon[1]="Ion Cannon"; + weapon_facing[1]="most"; + weapon_dam[1]=8; + weapon_range[1]=300; + weapon_cooldown[1]=50; + + weapon[2]="Railgun Battery"; + weapon_facing[2]="front"; + weapon_dam[2]=10; + weapon_range[2]=300; + weapon_cooldown[2]=60; + } -if (class="Castellan"){sprite_index=spr_ship_castellan;ship_size=1; - name="";hp=100;maxhp=100;conditions="";shields=100;maxshields=100;leadership=80; - armour_front=5;armour_other=4;weapons=2;turrets=2;capacity=50;carrying=0; - weapon[1]="Gravitic launcher";weapon_facing[1]="front";weapon_dam[1]=12;weapon_range[1]=400;weapon_minrange[1]=200;weapon_cooldown[1]=40; - weapon[2]="Railgun Battery";weapon_facing[2]="front";weapon_dam[2]=10;weapon_range[2]=300;weapon_cooldown[2]=40; +if (class="Castellan"){sprite_index=spr_ship_castellan; + ship_size=1; + + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=80; + + armour_front=5; + armour_other=4; + weapons=2; + turrets=2; + capacity=50; + carrying=0; + + weapon[1]="Gravitic launcher"; + weapon_facing[1]="front"; + weapon_dam[1]=12; + weapon_range[1]=400; + weapon_minrange[1]=200; + weapon_cooldown[1]=40; + + weapon[2]="Railgun Battery"; + weapon_facing[2]="front"; + weapon_dam[2]=10; + weapon_range[2]=300; + weapon_cooldown[2]=40; + } // Chaos -if (class="Desecrator"){sprite_index=spr_ship_dese;ship_size=3; - name="";hp=1200;maxhp=1200;conditions="";shields=400;maxshields=400;leadership=90; - armour_front=7;armour_other=5;weapons=5;turrets=4;capacity=150;carrying=0; - weapon[1]="Lance Battery";weapon_facing[1]="left";weapon_dam[1]=12;weapon_range[1]=300;weapon_cooldown[1]=30; - weapon[2]="Lance Battery";weapon_facing[2]="right";weapon_dam[2]=12;weapon_range[2]=300;weapon_cooldown[2]=30; - weapon[3]="Weapons Battery";weapon_facing[3]="front";weapon_dam[3]=18;weapon_range[3]=600;weapon_cooldown[3]=60; - weapon[4]="Torpedoes";weapon_facing[4]="front";weapon_dam[4]=18;weapon_range[4]=450;weapon_cooldown[4]=120; - weapon[5]="Fighta Bommerz";weapon_facing[5]="special";weapon_dam[5]=0;weapon_range[5]=9999;weapon_cooldown[5]=90; +if (class="Desecrator"){sprite_index=spr_ship_dese; + ship_size=3; + + name=""; + hp=1200; + maxhp=1200; + conditions=""; + shields=400; + maxshields=400; + leadership=90; + + armour_front=7; + armour_other=5; + weapons=5; + turrets=4; + capacity=150; + carrying=0; + + weapon[1]="Lance Battery"; + weapon_facing[1]="left"; + weapon_dam[1]=12; + weapon_range[1]=300; + weapon_cooldown[1]=30; + + weapon[2]="Lance Battery"; + weapon_facing[2]="right"; + weapon_dam[2]=12; + weapon_range[2]=300; + weapon_cooldown[2]=30; + + weapon[3]="Weapons Battery"; + weapon_facing[3]="front"; + weapon_dam[3]=18; + weapon_range[3]=600; + weapon_cooldown[3]=60; + + weapon[4]="Torpedoes"; + weapon_facing[4]="front"; + weapon_dam[4]=18; + weapon_range[4]=450; + weapon_cooldown[4]=120; + + weapon[5]="Fighta Bommerz"; + weapon_facing[5]="special"; + weapon_dam[5]=0; + weapon_range[5]=9999; + weapon_cooldown[5]=90; + } -if (class="Avenger"){sprite_index=spr_ship_veng;ship_size=2; - name="";hp=1000;maxhp=1000;conditions="";shields=300;maxshields=300;leadership=85; - armour_front=5;armour_other=5;weapons=2;turrets=3;capacity=50;carrying=0; - weapon[1]="Lance Battery";weapon_facing[1]="left";weapon_dam[1]=12;weapon_range[1]=300;weapon_cooldown[1]=30; - weapon[2]="Lance Battery";weapon_facing[2]="right";weapon_dam[2]=12;weapon_range[2]=300;weapon_cooldown[2]=30; +if (class="Avenger"){sprite_index=spr_ship_veng; + ship_size=2; + + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=300; + maxshields=300; + leadership=85; + + armour_front=5; + armour_other=5; + weapons=2; + turrets=3; + capacity=50; + carrying=0; + + weapon[1]="Lance Battery"; + weapon_facing[1]="left"; + weapon_dam[1]=12; + weapon_range[1]=300; + weapon_cooldown[1]=30; + + weapon[2]="Lance Battery"; + weapon_facing[2]="right"; + weapon_dam[2]=12; + weapon_range[2]=300; + weapon_cooldown[2]=30; + } -if (class="Carnage") or (class="Daemon"){sprite_index=spr_ship_carnage;ship_size=2; - name="";hp=1000;maxhp=1000;conditions="";shields=300;maxshields=300;leadership=85; - armour_front=5;armour_other=5;weapons=3;turrets=3;capacity=50;carrying=0; - weapon[1]="Lance Battery";weapon_facing[1]="most";weapon_dam[1]=12;weapon_range[1]=450;weapon_cooldown[1]=30; - weapon[2]="Weapons Battery";weapon_facing[2]="left";weapon_dam[2]=12;weapon_range[2]=300;weapon_cooldown[2]=45; - weapon[3]="Weapons Battery";weapon_facing[3]="right";weapon_dam[3]=12;weapon_range[3]=300;weapon_cooldown[3]=45; - if (class="Daemon"){sprite_index=spr_ship_daemon;image_alpha=0.1;} +if (class="Carnage") or (class="Daemon"){sprite_index=spr_ship_carnage; + ship_size=2; + + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=300; + maxshields=300; + leadership=85; + + armour_front=5; + armour_other=5; + weapons=3; + turrets=3; + capacity=50; + carrying=0; + + weapon[1]="Lance Battery"; + weapon_facing[1]="most"; + weapon_dam[1]=12; + weapon_range[1]=450; + weapon_cooldown[1]=30; + + weapon[2]="Weapons Battery"; + weapon_facing[2]="left"; + weapon_dam[2]=12; + weapon_range[2]=300; + weapon_cooldown[2]=45; + + weapon[3]="Weapons Battery"; + weapon_facing[3]="right"; + weapon_dam[3]=12; + weapon_range[3]=300; + weapon_cooldown[3]=45; + + if (class="Daemon"){sprite_index=spr_ship_daemon; + image_alpha=0.1; +} } -if (class="Iconoclast"){sprite_index=spr_ship_icono;ship_size=1; - name="";hp=100;maxhp=100;conditions="";shields=100;maxshields=100;leadership=80; - armour_front=7;armour_other=4;weapons=1;turrets=2;capacity=50;carrying=0; - weapon[1]="Weapons Battery";weapon_facing[1]="most";weapon_dam[1]=8;weapon_range[1]=300;weapon_cooldown[1]=30; +if (class="Iconoclast"){sprite_index=spr_ship_icono; + ship_size=1; + + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=80; + + armour_front=7; + armour_other=4; + weapons=1; + turrets=2; + capacity=50; + carrying=0; + + weapon[1]="Weapons Battery"; + weapon_facing[1]="most"; + weapon_dam[1]=8; + weapon_range[1]=300; + weapon_cooldown[1]=30; + } // Tyranids -if (class="Leviathan"){sprite_index=spr_ship_leviathan;ship_size=3; - name="";hp=1000;maxhp=1000;conditions="";shields=300;maxshields=300;leadership=100; - armour_front=7;armour_other=5;weapons=5;turrets=3;capacity=0;carrying=0; - weapon[1]="Feeder Tendrils";weapon_facing[1]="most";weapon_dam[1]=12;weapon_range[1]=160;weapon_cooldown[1]=30; - weapon[2]="Bio-Plasma Discharge";weapon_facing[2]="most";weapon_dam[2]=10;weapon_range[2]=260;weapon_cooldown[2]=30; - weapon[3]="Pyro-Acid Battery";weapon_facing[3]="front";weapon_dam[3]=18;weapon_range[3]=500;weapon_cooldown[3]=40; - weapon[4]="Launch Glands";weapon_facing[4]="special";weapon_range[4]=9999;weapon_ammo[4]=6;weapon_cooldown[4]=120; +if (class="Leviathan"){sprite_index=spr_ship_leviathan; + ship_size=3; + + name=""; + hp=1000; + maxhp=1000; + conditions=""; + shields=300; + maxshields=300; + leadership=100; + + armour_front=7; + armour_other=5; + weapons=5; + turrets=3; + capacity=0; + carrying=0; + + weapon[1]="Feeder Tendrils"; + weapon_facing[1]="most"; + weapon_dam[1]=12; + weapon_range[1]=160; + weapon_cooldown[1]=30; + + weapon[2]="Bio-Plasma Discharge"; + weapon_facing[2]="most"; + weapon_dam[2]=10; + weapon_range[2]=260; + weapon_cooldown[2]=30; + + weapon[3]="Pyro-Acid Battery"; + weapon_facing[3]="front"; + weapon_dam[3]=18; + weapon_range[3]=500; + weapon_cooldown[3]=40; + + weapon[4]="Launch Glands"; + weapon_facing[4]="special"; + weapon_range[4]=9999; + weapon_ammo[4]=6; + weapon_cooldown[4]=120; + } -if (class="Razorfiend"){sprite_index=spr_ship_razorfiend;ship_size=2; - name="";hp=600;maxhp=600;conditions="";shields=200;maxshields=200;leadership=100; - armour_front=5;armour_other=4;weapons=3;turrets=2;capacity=0;carrying=0; - weapon[1]="Pyro-Acid Battery";weapon_facing[1]="front";weapon_dam[1]=12;weapon_range[1]=300;weapon_cooldown[1]=30; - weapon[2]="Feeder Tendrils";weapon_facing[2]="most";weapon_dam[2]=8;weapon_range[2]=100;weapon_cooldown[2]=30; - weapon[3]="Massive Claws";weapon_facing[3]="most";weapon_dam[3]=20;weapon_range[3]=64;weapon_cooldown[3]=60; +if (class="Razorfiend"){sprite_index=spr_ship_razorfiend; + ship_size=2; + + name=""; + hp=600; + maxhp=600; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + + armour_front=5; + armour_other=4; + weapons=3; + turrets=2; + capacity=0; + carrying=0; + + weapon[1]="Pyro-Acid Battery"; + weapon_facing[1]="front"; + weapon_dam[1]=12; + weapon_range[1]=300; + weapon_cooldown[1]=30; + + weapon[2]="Feeder Tendrils"; + weapon_facing[2]="most"; + weapon_dam[2]=8; + weapon_range[2]=100; + weapon_cooldown[2]=30; + + weapon[3]="Massive Claws"; + weapon_facing[3]="most"; + weapon_dam[3]=20; + weapon_range[3]=64; + weapon_cooldown[3]=60; + } -if (class="Stalker"){sprite_index=spr_ship_stalker;ship_size=1; - name="";hp=100;maxhp=100;conditions="";shields=100;maxshields=100;leadership=100; - armour_front=5;armour_other=4;weapons=1;turrets=0;capacity=0;carrying=0; - weapon[1]="Pyro-Acid Battery";weapon_facing[1]="front";weapon_dam[1]=8;weapon_range[1]=300;weapon_cooldown[1]=60; - weapon[2]="Feeder Tendrils";weapon_facing[2]="most";weapon_dam[2]=8;weapon_range[2]=100;weapon_cooldown[2]=30; - weapon[3]="Bio-Plasma Discharge";weapon_facing[3]="front";weapon_dam[3]=6;weapon_range[3]=200;weapon_cooldown[3]=60; +if (class="Stalker"){sprite_index=spr_ship_stalker; + ship_size=1; + + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=100; + + armour_front=5; + armour_other=4; + weapons=1; + turrets=0; + capacity=0; + carrying=0; + + weapon[1]="Pyro-Acid Battery"; + weapon_facing[1]="front"; + weapon_dam[1]=8; + weapon_range[1]=300; + weapon_cooldown[1]=60; + + weapon[2]="Feeder Tendrils"; + weapon_facing[2]="most"; + weapon_dam[2]=8; + weapon_range[2]=100; + weapon_cooldown[2]=30; + + weapon[3]="Bio-Plasma Discharge"; + weapon_facing[3]="front"; + weapon_dam[3]=6; + weapon_range[3]=200; + weapon_cooldown[3]=60; + } -if (class="Prowler"){sprite_index=spr_ship_prowler;ship_size=1; - name="";hp=100;maxhp=100;conditions="";shields=100;maxshields=100;leadership=100; - armour_front=5;armour_other=4;weapons=1;turrets=0;capacity=0;carrying=0; - weapon[1]="Pyro-acid Battery";weapon_facing[1]="most";weapon_dam[1]=8;weapon_range[1]=300;weapon_cooldown[1]=30; - weapon[2]="Feeder Tendrils";weapon_facing[2]="most";weapon_dam[2]=8;weapon_range[2]=100;weapon_cooldown[1]=30; +if (class="Prowler"){sprite_index=spr_ship_prowler; + ship_size=1; + + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=100; + + armour_front=5; + armour_other=4; + weapons=1; + turrets=0; + capacity=0; + carrying=0; + + weapon[1]="Pyro-acid Battery"; + weapon_facing[1]="most"; + weapon_dam[1]=8; + weapon_range[1]=300; + weapon_cooldown[1]=30; + + weapon[2]="Feeder Tendrils"; + weapon_facing[2]="most"; + weapon_dam[2]=8; + weapon_range[2]=100; + weapon_cooldown[1]=30; + } if (owner = eFACTION.Tyranids){ - var i;i=0; + var i; + i=0; + repeat(2){ i+=1; + if (obj_fleet.en_mutation[i]="Spore Clouds") then shields=shields+100; - if (obj_fleet.en_mutation[i]="Health"){hp=floor(hp*1.1);maxhp=hp;} + + if (obj_fleet.en_mutation[i]="Health"){hp=floor(hp*1.1); + maxhp=hp; + } if (obj_fleet.en_mutation[i]="Armour") then armour_front+=1; + if (obj_fleet.en_mutation[i]="Speed") then speed_bonus=speed_bonus*1.1; + if (obj_fleet.en_mutation[i]="Turn") then turn_bonus=1.2; + if (obj_fleet.en_mutation[i]="Turret") then turrets+=1; + } } @@ -280,38 +1084,158 @@ if (owner = eFACTION.Tyranids){ // Necrons -if (class="Cairn Class"){sprite_index=spr_ship_cairn;ship_size=3; - name="";hp=1100;maxhp=1100;conditions="";shields=550;maxshields=550;leadership=100; - armour_front=5;armour_other=5;weapons=3;turrets=5;capacity=800;carrying=0; - weapon[1]="Lightning Arc";weapon_facing[1]="most";weapon_dam[1]=0;weapon_range[1]=300;weapon_cooldown[1]=15; - weapon[2]="Star Pulse Generator";weapon_facing[2]="front";weapon_dam[2]=0;weapon_range[2]=220;weapon_cooldown[2]=210; - weapon[3]="Gauss Particle Whip";weapon_facing[3]="front";weapon_dam[3]=30;weapon_range[3]=450;weapon_cooldown[3]=90; +if (class="Cairn Class"){sprite_index=spr_ship_cairn; + ship_size=3; + + name=""; + hp=1100; + maxhp=1100; + conditions=""; + shields=550; + maxshields=550; + leadership=100; + + armour_front=5; + armour_other=5; + weapons=3; + turrets=5; + capacity=800; + carrying=0; + + weapon[1]="Lightning Arc"; + weapon_facing[1]="most"; + weapon_dam[1]=0; + weapon_range[1]=300; + weapon_cooldown[1]=15; + + weapon[2]="Star Pulse Generator"; + weapon_facing[2]="front"; + weapon_dam[2]=0; + weapon_range[2]=220; + weapon_cooldown[2]=210; + + weapon[3]="Gauss Particle Whip"; + weapon_facing[3]="front"; + weapon_dam[3]=30; + weapon_range[3]=450; + weapon_cooldown[3]=90; + } -if (class="Reaper Class"){sprite_index=spr_ship_reaper;ship_size=3; - name="";hp=900;maxhp=900;conditions="";shields=450;maxshields=450;leadership=100; - armour_front=5;armour_other=5;weapons=3;turrets=4;capacity=500;carrying=0; - weapon[1]="Lightning Arc";weapon_facing[1]="most";weapon_dam[1]=0;weapon_range[1]=300;weapon_cooldown[1]=15; - weapon[2]="Star Pulse Generator";weapon_facing[2]="front";weapon_dam[2]=0;weapon_range[2]=220;weapon_cooldown[2]=210; - weapon[3]="Gauss Particle Whip";weapon_facing[3]="front";weapon_dam[3]=30;weapon_range[3]=450;weapon_cooldown[3]=90; +if (class="Reaper Class"){sprite_index=spr_ship_reaper; + ship_size=3; + + name=""; + hp=900; + maxhp=900; + conditions=""; + shields=450; + maxshields=450; + leadership=100; + + armour_front=5; + armour_other=5; + weapons=3; + turrets=4; + capacity=500; + carrying=0; + + weapon[1]="Lightning Arc"; + weapon_facing[1]="most"; + weapon_dam[1]=0; + weapon_range[1]=300; + weapon_cooldown[1]=15; + + weapon[2]="Star Pulse Generator"; + weapon_facing[2]="front"; + weapon_dam[2]=0; + weapon_range[2]=220; + weapon_cooldown[2]=210; + + weapon[3]="Gauss Particle Whip"; + weapon_facing[3]="front"; + weapon_dam[3]=30; + weapon_range[3]=450; + weapon_cooldown[3]=90; + } -if (class="Shroud Class"){ship_size=2;sprite_index=spr_ship_shroud; - name="";hp=400;maxhp=400;conditions="";shields=200;maxshields=200;leadership=100; - armour_front=5;armour_other=5;weapons=1;turrets=2;capacity=250;carrying=0; - weapon[1]="Lightning Arc";weapon_facing[1]="most";weapon_dam[1]=0;weapon_range[1]=300;weapon_cooldown[1]=15; +if (class="Shroud Class"){ship_size=2; + sprite_index=spr_ship_shroud; + + name=""; + hp=400; + maxhp=400; + conditions=""; + shields=200; + maxshields=200; + leadership=100; + + armour_front=5; + armour_other=5; + weapons=1; + turrets=2; + capacity=250; + carrying=0; + + weapon[1]="Lightning Arc"; + weapon_facing[1]="most"; + weapon_dam[1]=0; + weapon_range[1]=300; + weapon_cooldown[1]=15; + } -if (class="Jackal Class"){ship_size=2;sprite_index=spr_ship_jackal; - name="";hp=100;maxhp=100;conditions="";shields=100;maxshields=100;leadership=100; - armour_front=4;armour_other=4;weapons=1;turrets=2;capacity=25;carrying=0; - weapon[1]="Lightning Arc";weapon_facing[1]="most";weapon_dam[1]=0;weapon_range[1]=250;weapon_cooldown[1]=15; +if (class="Jackal Class"){ship_size=2; + sprite_index=spr_ship_jackal; + + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=100; + + armour_front=4; + armour_other=4; + weapons=1; + turrets=2; + capacity=25; + carrying=0; + + weapon[1]="Lightning Arc"; + weapon_facing[1]="most"; + weapon_dam[1]=0; + weapon_range[1]=250; + weapon_cooldown[1]=15; + } -if (class="Dirge Class"){ship_size=2;sprite_index=spr_ship_dirge; - name="";hp=100;maxhp=100;conditions="";shields=100;maxshields=100;leadership=100; - armour_front=4;armour_other=4;weapons=1;turrets=2;capacity=25;carrying=0; - weapon[1]="Lightning Arc";weapon_facing[1]="most";weapon_dam[1]=0;weapon_range[1]=250;weapon_cooldown[1]=15; +if (class="Dirge Class"){ship_size=2; + sprite_index=spr_ship_dirge; + + name=""; + hp=100; + maxhp=100; + conditions=""; + shields=100; + maxshields=100; + leadership=100; + + armour_front=4; + armour_other=4; + weapons=1; + turrets=2; + capacity=25; + carrying=0; + + weapon[1]="Lightning Arc"; + weapon_facing[1]="most"; + weapon_dam[1]=0; + weapon_range[1]=250; + weapon_cooldown[1]=15; + } @@ -327,21 +1251,36 @@ if (class="Dirge Class"){ship_size=2;sprite_index=spr_ship_dirge; if (owner != eFACTION.Eldar) and (owner != eFACTION.Necrons){ - hp=hp/2;maxhp=hp;shields=shields/2;maxshields=shields; + hp=hp/2; + maxhp=hp; + shields=shields/2; + maxshields=shields; + } bridge=maxhp; -// if (obj_fleet.enemy=2){hp=hp*0.75;maxhp=hp;shields=shields*0.75;maxshields=shields;} +/* +if (obj_fleet.enemy == 2) { + hp = hp * 0.75; + maxhp = hp; + shields = shields * 0.75; + maxshields = shields; +} + */ +// hp=1; +shields=1; -// hp=1;shields=1; // if (obj_fleet.enemy="orks") then name=global.name_generator.generate_ork_ship_name(); + name="sdagdsagdasg"; + // show_message(string(class)); + /* */ /* */ diff --git a/objects/obj_event/Alarm_0.gml b/objects/obj_event/Alarm_0.gml index bd875426b..38f4b5dc9 100644 --- a/objects/obj_event/Alarm_0.gml +++ b/objects/obj_event/Alarm_0.gml @@ -39,10 +39,18 @@ if (obj_controller.fest_type="Great Feast"){ } - if (obj_controller.fest_feature2=1){ - var boozer_type;boozer_type=1; - if (global.chapter_name="Space Wolves") or (obj_ini.progenitor=3) then boozer_type=2; - if (global.chapter_name="Blood Angels") or (obj_ini.progenitor=5) then boozer_type=3; + if (obj_controller.fest_feature2 == 1){ + var boozer_type = 1; + if ( + (global.chapter_name="Space Wolves") || (obj_ini.progenitor == ePROGENITOR.SPACE_WOLVES) + ) { + boozer_type = 2; + } + if ( + (global.chapter_name="Blood Angels") || (obj_ini.progenitor == ePROGENITOR.BLOOD_ANGELS) + ) { + boozer_type = 3; + } if (boozer_type=1) then intro+=" Also provided is well-aged, finely distilled Amasec."; if (boozer_type=2) and (global.chapter_name!="Space Wolves") then intro+=" Also provided is Fenrir-imported Mjod, favored by the sons of Russ."; diff --git a/objects/obj_event/Create_0.gml b/objects/obj_event/Create_0.gml index a2bfba5b8..b668b807b 100644 --- a/objects/obj_event/Create_0.gml +++ b/objects/obj_event/Create_0.gml @@ -29,9 +29,9 @@ lines=0; main_color=obj_ini.main_color; secondary_color=obj_ini.secondary_color; -trim_color=obj_ini.trim_color; -pauldron2_color=obj_ini.pauldron2_color; -pauldron_color=obj_ini.pauldron_color; +main_trim=obj_ini.main_trim; +left_pauldron=obj_ini.left_pauldron; +right_pauldron=obj_ini.right_pauldron; lens_color=obj_ini.lens_color; weapon_color=obj_ini.weapon_color; col_special=obj_ini.col_special; diff --git a/objects/obj_event/Step_0.gml b/objects/obj_event/Step_0.gml index a12be8df0..3f0a3347a 100644 --- a/objects/obj_event/Step_0.gml +++ b/objects/obj_event/Step_0.gml @@ -42,7 +42,10 @@ if (closing=true) and (fading=-1) and (fade_alpha<=0){ scr_event_log("green",string(p1)+" on "+string(p3)+" ends.", p3); } - with(obj_popup){if (number!=0) then obj_turn_end.alarm[1]=10;instance_destroy();} + with(obj_popup){ + if (number!=0) then obj_turn_end.alarm[1]=10; + instance_destroy(); + } obj_controller.cooldown=30; instance_destroy(); } @@ -163,8 +166,16 @@ if (ticked=1){// Select a random marine and have them perform an action if (dice3<=min(75,(((obj_controller.fest_drugses*10)-10)+mod3)/rep3)) and (obj_controller.fest_feature3>0) then activity="drugs"; if (dice2<=min(75,(((obj_controller.fest_boozes*20)-10)+mod2)/rep2)) and (obj_controller.fest_feature2>0) then activity="drink"; if (dice1<=min(75,(((obj_controller.fest_feasts*30))+mod1)/rep1)) and (obj_controller.fest_feature1>0) then activity="eat"; - if ((global.chapter_name="Space Wolves") or (obj_ini.progenitor=3)) and (obj_controller.fest_feature2>0) and (activity!="drink"){ - rando=choose(1,1,2);if (rando=2) then activity="drink"; + if ( + ( + (global.chapter_name="Space Wolves") || + (obj_ini.progenitor == ePROGENITOR.SPACE_WOLVES) + ) && + (obj_controller.fest_feature2 > 0) && + activity != "drink" + ) { + rando=choose(1,1,2); + if (rando=2) { activity="drink"; } } rando=choose(1,2,3,4,5,6,7,8,9,10); if (rando>=8) then activity="talk"; @@ -190,7 +201,7 @@ if (ticked=1){// Select a random marine and have them perform an action } if (activity="eat"){ var eater_type=1; - if (global.chapter_name="Space Wolves") or (obj_ini.progenitor=3) then eater_type=2; + if (global.chapter_name="Space Wolves" || obj_ini.progenitor == ePROGENITOR.SPACE_WOLVES) { eater_type=2; } if (stage=5) and (eater_type=1){rando=choose(1,2,3); if (rando=1) then textt=unit.name_role()+" digs into the food and begins to eat."; @@ -231,8 +242,8 @@ if (ticked=1){// Select a random marine and have them perform an action } if (activity="drink"){ var eater_type;eater_type=1; - if (global.chapter_name="Space Wolves") or (obj_ini.progenitor=3) then eater_type=2; - if (global.chapter_name="Blood Angels") or (obj_ini.progenitor=5) then eater_type=3; + if (global.chapter_name="Space Wolves" || obj_ini.progenitor == ePROGENITOR.SPACE_WOLVES) then eater_type=2; + if (global.chapter_name="Blood Angels" || obj_ini.progenitor == ePROGENITOR.BLOOD_ANGELS) then eater_type=3; if (eater_type=1){ if (attend_drunk[ide]<=0) then textt=unit.name_role()+" hails a serf and has "+choose("him","her")+" pour some Amasec."; diff --git a/objects/obj_fleet/Alarm_0.gml b/objects/obj_fleet/Alarm_0.gml index 3ff648ea2..a5c46ed6e 100644 --- a/objects/obj_fleet/Alarm_0.gml +++ b/objects/obj_fleet/Alarm_0.gml @@ -1,5 +1,5 @@ -scr_dead_marines(1); +//scr_dead_marines(1); start=7; diff --git a/objects/obj_fleet/Alarm_1.gml b/objects/obj_fleet/Alarm_1.gml index e04eaf05a..8a1f4a4ff 100644 --- a/objects/obj_fleet/Alarm_1.gml +++ b/objects/obj_fleet/Alarm_1.gml @@ -215,26 +215,6 @@ if (betchers=1) then global_melee=global_melee*0.95; if (catalepsean=1){global_attack=global_attack*0.95;} // if (occulobe=1){if (time=5) or (time=6) then global_attack=global_attack*0.7;global_defense=global_defense*0.9;} -/*if (global.chapter_name="Dark Angels") or (obj_ini.main_color="Dark Green") then color_index=0; -if (global.chapter_name="White Scars") or (obj_ini.main_color="White") then color_index=1; -if (global.chapter_name="Space Wolves") or (obj_ini.main_color="Light Blue") then color_index=2; -if (global.chapter_name="Imperial Fists") or (obj_ini.main_color="Yellow") then color_index=3; -if (global.chapter_name="Blood Angels") or (obj_ini.main_color="Red") or (obj_ini.main_color="Dark Red") then color_index=4; -if (global.chapter_name="Iron Hands") then color_index=5; -if (global.chapter_name="Ultramarines") or (obj_ini.main_color="Blue") then color_index=6; -if (global.chapter_name="Salamanders") or (obj_ini.main_color="Green") then color_index=7; -if (global.chapter_name="Iron Hands") then color_index=7; -if (global.chapter_name="Black Templars") or (obj_ini.main_color="Black") then color_index=8; -if (global.chapter_name="Minotaurs") or (obj_ini.main_color="Brown") then color_index=9; -if (global.chapter_name="Soul Drinkers") or (obj_ini.main_color="Purple") then color_index=10; -if (global.chapter_name="Lamenters") then color_index=11; -if (global.chapter_name="Emperor's Nightmares") then color_index=12; -if (global.chapter_name="Angry Marines") then color_index=13; -if (global.chapter_name="Star Krakens") then color_index=14; -if (obj_ini.main_color="Pink") then color_index=15;*/ - - - /* global.chapter_name=5; obj_ini.main_color=obj_creation.main_color; @@ -243,46 +223,6 @@ obj_ini.lens_color=obj_creation.lens_color; obj_ini.weapon_color=obj_creation.weapon_color; */ - - -/* */ -var i, k, onceh;i=0;k=0;onceh=0; - -// instance_activate_object(obj_combat_info); - -repeat(100){i+=1; - if (fighting[i]=1) and (obj_ini.ship_class[i]!="") then ships_max+=1; -} - - - - -i=0; -repeat(100){i+=1; - if (fighting[i]=1) and (obj_ini.ship[i]!="") and (obj_ini.ship_hp[i]>0){onceh=0; - if (obj_ini.ship_size[i]=3) then capital+=1; - if (obj_ini.ship_size[i]=2) then frigate+=1; - if (obj_ini.ship_size[i]=1) then escort+=1; - - ship_class[i]=obj_ini.ship_class[i]; - ship[i]=obj_ini.ship[i];ship_id[i]=i;ship_size[i]=obj_ini.ship_size[i]; - ship_leadership[i]=100;ship_hp[i]=obj_ini.ship_hp[i];ship_maxhp[i]=obj_ini.ship_maxhp[i]; - ship_conditions[i]=obj_ini.ship_conditions[i];ship_speed[i]=obj_ini.ship_speed[i];ship_turning[i]=obj_ini.ship_turning[i]; - ship_front_armour[i]=obj_ini.ship_front_armour[i];ship_other_armour[i]=obj_ini.ship_other_armour[i];ship_weapons[i]=obj_ini.ship_weapons[i]; - - var t;t=0; - t+=1;ship_wep[i,t]=obj_ini.ship_wep[i,t];ship_wep_facing[i,t]=obj_ini.ship_wep_facing[i,t];ship_wep_condition[i,t]=obj_ini.ship_wep_condition[i,t]; - t+=1;ship_wep[i,t]=obj_ini.ship_wep[i,t];ship_wep_facing[i,t]=obj_ini.ship_wep_facing[i,t];ship_wep_condition[i,t]=obj_ini.ship_wep_condition[i,t]; - t+=1;ship_wep[i,t]=obj_ini.ship_wep[i,t];ship_wep_facing[i,t]=obj_ini.ship_wep_facing[i,t];ship_wep_condition[i,t]=obj_ini.ship_wep_condition[i,t]; - t+=1;ship_wep[i,t]=obj_ini.ship_wep[i,t];ship_wep_facing[i,t]=obj_ini.ship_wep_facing[i,t];ship_wep_condition[i,t]=obj_ini.ship_wep_condition[i,t]; - t+=1;ship_wep[i,t]=obj_ini.ship_wep[i,t];ship_wep_facing[i,t]=obj_ini.ship_wep_facing[i,t];ship_wep_condition[i,t]=obj_ini.ship_wep_condition[i,t]; - - ship_capacity[i]=obj_ini.ship_capacity[i];ship_carrying[i]=obj_ini.ship_carrying[i]; - ship_contents[i]=obj_ini.ship_contents[i];ship_turrets[i]=obj_ini.ship_turrets[i]; - } -} - - alarm[2]=1; diff --git a/objects/obj_fleet/Alarm_2.gml b/objects/obj_fleet/Alarm_2.gml index 6a262b8b9..c4cd3fd76 100644 --- a/objects/obj_fleet/Alarm_2.gml +++ b/objects/obj_fleet/Alarm_2.gml @@ -4,87 +4,17 @@ frigate_max=frigate; escort_max=escort; +var i, k, temp1, temp2, x2, hei, man, sizz; +i=0;k=0;temp1=0;temp2=0;x2=224;hei=0;man=0;sizz=0; -// create blocks of infantry -var i, k, col, temp1, temp2, x2, hei, man, sizz; -i=0;k=0;col=5;temp1=0;temp2=0;x2=224;hei=0;man=0;sizz=0; +sort_ships_into_columns(self); - -repeat(100){// This determines the number of ships in each column - k+=1; - - - if (fighting[k]=1){ - if ((column[col]="Capital") and (ship_size[k]=3)) then column_num[col]+=1; - if ((column[col-1]="Capital") and (ship_size[k]=3)) then column_num[col-1]+=1; - if ((column[col-2]="Capital") and (ship_size[k]=3)) then column_num[col-2]+=1; - if ((column[col-3]="Capital") and (ship_size[k]=3)) then column_num[col-3]+=1; - if ((column[col-4]="Capital") and (ship_size[k]=3)) then column_num[col-4]+=1; - - if (ship_class[k]=column[col]) then column_num[col]+=1; - if (ship_class[k]=column[col-1]) then column_num[col-1]+=1; - if (ship_class[k]=column[col-2]) then column_num[col-2]+=1; - if (ship_class[k]=column[col-3]) then column_num[col-3]+=1; - if (ship_class[k]=column[col-4]) then column_num[col-4]+=1; - - if ((column[col]="Escort") and (ship_size[k]=1)) then column_num[col]+=1; - if ((column[col-1]="Escort") and (ship_size[k]=1)) then column_num[col-1]+=1; - if ((column[col-2]="Escort") and (ship_size[k]=1)) then column_num[col-2]+=1; - if ((column[col-3]="Escort") and (ship_size[k]=1)) then column_num[col-3]+=1; - if ((column[col-4]="Escort") and (ship_size[k]=1)) then column_num[col-4]+=1; - } - - -} - - - -col=6; -repeat(5){// Start repeat - temp1=0;temp2=0; - - col-=1; - if (col<5) then x2-=column_width[col]; - - -if (column_num[col]>0){// Start ship creation - if (column[col]="Capital"){hei=160;sizz=3;} - // if (column[col]="Slaughtersong"){hei=200;sizz=3;} - if (column[col]="Strike Cruiser"){hei=96;sizz=2;} - if (column[col]="Gladius"){hei=64;sizz=1;} - if (column[col]="Hunter"){hei=64;sizz=1;} - if (column[col]="Escort"){hei=64;sizz=1;} - - temp1=column_num[col]*hei; - temp2=((room_height/2)-(temp1/2))+64; - if (column_num[col]=1) then temp2+=20; - - // show_message(string(column_num[col])+" "+string(column[col])+" X:"+string(x2)); - - k=0; - repeat(100){k+=1; - if (ship_class[k]=column[col]) or ((column[col]="Escort") and (ship_size[k]=1))or ((column[col]="Capital") and (ship_size[k]=3)){ - if (sizz=3) and (ship_class[k]!="") and (fighting[k]=1){man=instance_create(x2,temp2,obj_p_capital);man.ship_id=k;man.class=column[col];temp2+=hei;} - if (sizz=2) and (ship_class[k]!="") and (fighting[k]=1){man=instance_create(x2,temp2,obj_p_cruiser);man.ship_id=k;man.class=column[col];temp2+=hei;} - if (sizz=1) and (ship_class[k]!="") and (fighting[k]=1){man=instance_create(x2,temp2,obj_p_escort);man.ship_id=k;man.class=column[col];temp2+=hei;} - } - } - - -}// End ship creation - - - - -}// End repeat - - - +player_fleet_ship_spawner(); if (enemy=2){// This is an orderly Tau ship formation diff --git a/objects/obj_fleet/Alarm_6.gml b/objects/obj_fleet/Alarm_6.gml index 0a7d778e0..1d2846a7d 100644 --- a/objects/obj_fleet/Alarm_6.gml +++ b/objects/obj_fleet/Alarm_6.gml @@ -96,100 +96,12 @@ if (betchers=1) then global_melee=global_melee*0.95; if (catalepsean=1){global_attack=global_attack*0.95;} // if (occulobe=1){if (time=5) or (time=6) then global_attack=global_attack*0.7;global_defense=global_defense*0.9;} -/*if (global.chapter_name="Dark Angels") or (obj_ini.main_color="Dark Green") then color_index=0; -if (global.chapter_name="White Scars") or (obj_ini.main_color="White") then color_index=1; -if (global.chapter_name="Space Wolves") or (obj_ini.main_color="Light Blue") then color_index=2; -if (global.chapter_name="Imperial Fists") or (obj_ini.main_color="Yellow") then color_index=3; -if (global.chapter_name="Blood Angels") or (obj_ini.main_color="Red") or (obj_ini.main_color="Dark Red") then color_index=4; -if (global.chapter_name="Iron Hands") then color_index=5; -if (global.chapter_name="Ultramarines") or (obj_ini.main_color="Blue") then color_index=6; -if (global.chapter_name="Salamanders") or (obj_ini.main_color="Green") then color_index=7; -if (global.chapter_name="Iron Hands") then color_index=7; -if (global.chapter_name="Black Templars") or (obj_ini.main_color="Black") then color_index=8; -if (global.chapter_name="Minotaurs") or (obj_ini.main_color="Brown") then color_index=9; -if (global.chapter_name="Soul Drinkers") or (obj_ini.main_color="Purple") then color_index=10; -if (global.chapter_name="Lamenters") then color_index=11; -if (global.chapter_name="Emperor's Nightmares") then color_index=12; -if (global.chapter_name="Angry Marines") then color_index=13; -if (global.chapter_name="Star Krakens") then color_index=14; -if (obj_ini.main_color="Pink") then color_index=15;*/ - - - - - -/* -global.chapter_name=5; -obj_ini.main_color=obj_creation.main_color; -obj_ini.secondary_color=obj_creation.secondary_color; -obj_ini.lens_color=obj_creation.lens_color; -obj_ini.weapon_color=obj_creation.weapon_color; -*/ - - - // More prep for player -var i, k, onceh;i=0;k=0;onceh=0; +var i=0,k=0,onceh=0; // instance_activate_object(obj_combat_info); -repeat(100){i+=1; - if (fighting[i]=1) and (obj_ini.ship_class[i]!="") then ships_max+=1; -} - - - -i=0; -repeat(100){i+=1; - if (fighting[i]=1) and (obj_ini.ship[i]!="") and (obj_ini.ship_hp[i]>0){onceh=0; - if (obj_ini.ship_size[i]=3) then capital+=1; - if (obj_ini.ship_size[i]=2) then frigate+=1; - if (obj_ini.ship_size[i]=1) then escort+=1; - - ship_class[i]=obj_ini.ship_class[i]; - ship[i]=obj_ini.ship[i]; - ship_id[i]=i; - ship_size[i]=obj_ini.ship_size[i]; - ship_leadership[i]=100; - ship_hp[i]=obj_ini.ship_hp[i]; - ship_maxhp[i]=obj_ini.ship_maxhp[i]; - ship_conditions[i]=obj_ini.ship_conditions[i]; - ship_speed[i]=obj_ini.ship_speed[i]; - ship_turning[i]=obj_ini.ship_turning[i]; - ship_front_armour[i]=obj_ini.ship_front_armour[i]; - ship_other_armour[i]=obj_ini.ship_other_armour[i]; - ship_weapons[i]=obj_ini.ship_weapons[i]; - - var t=0; - t+=1; - ship_wep[i,t]=obj_ini.ship_wep[i,t]; - ship_wep_facing[i,t]=obj_ini.ship_wep_facing[i,t]; - ship_wep_condition[i,t]=obj_ini.ship_wep_condition[i,t]; - t+=1; - ship_wep[i,t]=obj_ini.ship_wep[i,t]; - ship_wep_facing[i,t]=obj_ini.ship_wep_facing[i,t]; - ship_wep_condition[i,t]=obj_ini.ship_wep_condition[i,t]; - t+=1; - ship_wep[i,t]=obj_ini.ship_wep[i,t]; - ship_wep_facing[i,t]=obj_ini.ship_wep_facing[i,t]; - ship_wep_condition[i,t]=obj_ini.ship_wep_condition[i,t]; - t+=1; - ship_wep[i,t]=obj_ini.ship_wep[i,t]; - ship_wep_facing[i,t]=obj_ini.ship_wep_facing[i,t]; - ship_wep_condition[i,t]=obj_ini.ship_wep_condition[i,t]; - t+=1; - ship_wep[i,t]=obj_ini.ship_wep[i,t]; - ship_wep_facing[i,t]=obj_ini.ship_wep_facing[i,t]; - ship_wep_condition[i,t]=obj_ini.ship_wep_condition[i,t]; - - ship_capacity[i]=obj_ini.ship_capacity[i]; - ship_carrying[i]=obj_ini.ship_carrying[i]; - ship_contents[i]=obj_ini.ship_contents[i]; - ship_turrets[i]=obj_ini.ship_turrets[i]; - } -} - capital_max=capital; frigate_max=frigate; escort_max=escort; diff --git a/objects/obj_fleet/Alarm_7.gml b/objects/obj_fleet/Alarm_7.gml index 6c59e5e18..2cd61ecc7 100644 --- a/objects/obj_fleet/Alarm_7.gml +++ b/objects/obj_fleet/Alarm_7.gml @@ -1,11 +1,14 @@ try { - var yeehaw1, yeehaw2, tstar; - yeehaw1=0;yeehaw2=0;tstar=0; + var _player_battle_fleet, yeehaw2, tstar; + _player_battle_fleet=0;yeehaw2=0;tstar=0; - if (player_started=1){yeehaw1=pla_fleet;yeehaw2=ene_fleet;} + if (player_started=1){ + _player_battle_fleet=pla_fleet; + yeehaw2=ene_fleet; + } if (player_started=0) and (instance_exists(obj_turn_end)){ - yeehaw1=obj_turn_end.battle_pobject[obj_turn_end.current_battle]; + _player_battle_fleet=obj_turn_end.battle_pobject[obj_turn_end.current_battle]; } @@ -18,14 +21,11 @@ try { } } - - - - - yeehaw1.capital_number=max(capital,0); - yeehaw1.frigate_number=max(frigate,0); - yeehaw1.escort_number=max(escort,0); - yeehaw1.alarm[6]=1;// Check for low health ships + with (_player_battle_fleet){ + scr_ini_ship_cleanup() + + if (player_fleet_ship_count() == 0) then instance_destroy(); + } var op,ii,killer,killer_tg;op=0;killer=0;killer_tg=0;ii=-50; diff --git a/objects/obj_fleet/Create_0.gml b/objects/obj_fleet/Create_0.gml index 397ca92cf..6c9775c68 100644 --- a/objects/obj_fleet/Create_0.gml +++ b/objects/obj_fleet/Create_0.gml @@ -1,4 +1,5 @@ + instance_activate_object(obj_controller); debugl("Fleet Combat Started"); @@ -42,12 +43,18 @@ instance_activate_object(obj_ini); instance_activate_object(obj_cursor); instance_activate_object(obj_img); -column[0]="";column_width[0]=0;// This is determined at the pre-battle screen -column[1]="";column_width[1]=0; -column[2]="";column_width[2]=0; -column[3]="";column_width[3]=0; -column[4]="";column_width[4]=0; -column[5]="";column_width[5]=0;// Furthest right +column[0]=""; +column_width[0]=0;// This is determined at the pre-battle screen +column[1]=""; +column_width[1]=0; +column[2]=""; +column_width[2]=0; +column[3]=""; +column_width[3]=0; +column[4]=""; +column_width[4]=0; +column[5]=""; +column_width[5]=0;// Furthest right threat=4; @@ -65,9 +72,15 @@ repeat(6){k+=1;j=-1; en_width[j,k]=0;en_height[j,k]=0; en_num[j,k]=0;en_size[j,k]=0;*/ - en_capital[j]=0;en_capital_max[j]=0;en_capital_lost[j]=0; - en_frigate[j]=0;en_frigate_max[j]=0;en_frigate_lost[j]=0; - en_escort[j]=0;en_escort_max[j]=0;en_escort_lost[j]=0; + en_capital[j]=0; + en_capital_max[j]=0; + en_capital_lost[j]=0; + en_frigate[j]=0; + en_frigate_max[j]=0; + en_frigate_lost[j]=0; + en_escort[j]=0; + en_escort_max[j]=0; + en_escort_lost[j]=0; en_ships_max[j]=0; } } @@ -86,25 +99,26 @@ ships_damaged=0; marines_lost=0; +en_mutation=[]; en_mutation[0]=""; en_mutation[1]=""; en_mutation[2]=""; // -ambushers=0;if (string_count("Ambushers",obj_ini.strin)>0) then ambushers=1; -bolter_drilling=0;if (string_count("Bolter",obj_ini.strin)>0) then bolter_drilling=1; -enemy_eldar=0;if (string_count("Enemy: Eldar",obj_ini.strin)>0) then enemy_eldar=1; -enemy_fallen=0;if (string_count("Enemy: Fallen",obj_ini.strin)>0) then enemy_fallen=1; -enemy_orks=0;if (string_count("Enemy: Orks",obj_ini.strin)>0) then enemy_orks=1; -enemy_tau=0;if (string_count("Enemy: Tau",obj_ini.strin)>0) then enemy_tau=1; -enemy_tyranids=0;if (string_count("Enemy: Tyraninids",obj_ini.strin)>0) then enemy_tyranids=1; -siege=0;if (string_count("Siege",obj_ini.strin)>0) then siege=1; -slow=0;if (string_count("Purposeful",obj_ini.strin)>0) then slow=1; -melee=0;if (string_count("Melee Enthus",obj_ini.strin)>0) then melee=1; +ambushers = scr_has_adv("Ambushers"); +bolter_drilling = scr_has_adv("Bolter Drilling"); +enemy_eldar= scr_has_adv("Enemy: Eldar"); +enemy_fallen=scr_has_adv("Enemy: Fallen"); +enemy_orks=scr_has_adv("Enemy: Orks"); +enemy_tau = scr_has_adv("Enemy: Tau"); +enemy_tyranids= scr_has_adv("Enemy: Tyranids"); +siege=scr_has_adv("Siege Masters"); +slow=scr_has_adv("Devastator Doctrine"); +melee=scr_has_adv("Assault Doctrine"); // -black_rage=0;if (string_count("Black Rage",obj_ini.strin2)>0) then black_rage=1; -shitty_luck=0;if (string_count("Shitty",obj_ini.strin2)>0) then shitty_luck=1; -warp_touched=0;if (string_count("Warp Touched",obj_ini.strin2)>0) then warp_touched=1; +black_rage=scr_has_disadv("Black Rage"); +shitty_luck=scr_has_disadv("Shitty Luck"); +warp_touched=scr_has_disadv("Warp Touched"); lyman=obj_ini.lyman;// drop pod penalties omophagea=obj_ini.omophagea;// feast ossmodula=obj_ini.ossmodula;// small penalty to all @@ -125,7 +139,11 @@ if (obj_controller.stc_bonus[5]=2) then global_attack=1.05; if (obj_controller.stc_bonus[6]=1) then global_defense+=0.1; // Kings of Space Bonus -if (string_count("Kings of Space",obj_ini.strin)>0){control=1;global_defense+=0.1;global_attack+=0.1;} +if (scr_has_adv("Kings of Space")){ + control=1; + global_defense+=0.1; + global_attack+=0.1; +} @@ -134,34 +152,8 @@ master=0; time=0; - - - - - - - - -var i;i=-1; -repeat(110){i+=1; - fighting[i]=0; - - ship[i]="";ship_id[i]=0;ship_class[i]=obj_ini.ship_class[i];ship_size[i]=0; - ship_leadership[i]=100;ship_hp[i]=9999;ship_maxhp[i]=9999; - ship_conditions[i]="";ship_speed[i]=20;ship_turning[i]=0; - ship_front_armour[i]=0;ship_other_armour[i]=0;ship_weapons[i]=0;ship_shields=0; - - ship_wep[i,1]="";ship_wep_facing[i,1]="";ship_wep_condition[i,1]=""; - ship_wep[i,2]="";ship_wep_facing[i,2]="";ship_wep_condition[i,2]=""; - ship_wep[i,3]="";ship_wep_facing[i,3]="";ship_wep_condition[i,3]=""; - ship_wep[i,4]="";ship_wep_facing[i,4]="";ship_wep_condition[i,4]=""; - ship_wep[i,5]="";ship_wep_facing[i,5]="";ship_wep_condition[i,5]=""; - - - ship_capacity[i]=0;ship_carrying[i]=0;ship_contents[i]="";ship_turrets[i]=0; - - if (i<=80) then ship_lost[i]=0; -} +init_player_fleet_arrays(); +ship_id = []; // screwing around below here @@ -170,12 +162,24 @@ alarm[6]=2; // waiting at this point- show loading screen // in this time the obj_controller passes over which units will be fighting, similar to the below code -column[0]="";column_width[0]=0;column_num[0]=0;// This is determined at the pre-battle screen -column[1]="";column_width[1]=0;column_num[1]=0; -column[2]="";column_width[2]=0;column_num[3]=0; -column[3]="Capital";column_width[3]=270;column_num[3]=0; -column[4]="Strike Cruiser";column_width[4]=140;column_num[4]=0; -column[5]="Escort";column_width[5]=76;column_num[5]=0;// Furthest right +column[0]=""; +column_width[0]=0; +column_num[0]=0;// This is determined at the pre-battle screen +column[1]=""; +column_width[1]=0; +column_num[1]=0; +column[2]=""; +column_width[2]=0; +column_num[3]=0; +column[3]="capital"; +column_width[3]=270; +column_num[3]=0; +column[4]="frigate"; +column_width[4]=140; +column_num[4]=0; +column[5]="escort"; +column_width[5]=76; +column_num[5]=0;// Furthest right color_index=0; diff --git a/objects/obj_fleet_select/Create_0.gml b/objects/obj_fleet_select/Create_0.gml index 6793d0a2f..bab1ac646 100644 --- a/objects/obj_fleet_select/Create_0.gml +++ b/objects/obj_fleet_select/Create_0.gml @@ -30,7 +30,7 @@ selection_window.inside_method = function(){ // draw_text(view_xview[0]+46,view_yview[0]+117,"Title"); // draw_text(view_xview[0]+46,view_yview[0]+142,"1#2#3#4#5#6#7#8#9#10#11#1#13#14#15#16#17#18#19#20#21#22#23#24#25"); - var type="capital",lines=0,posi=0,colu=1,x3=48,y3=60,escorts,frigates,capitals,ty=0,current_ship=0,current_fleet=0,name="",sal=0,selection_box,scale=1,void_h=122,shew,ship_health=0; + var type="capital",lines=0,posi=-1,colu=1,x3=48,y3=60,escorts,frigates,capitals,ty=0,current_ship=0,current_fleet=0,name="",sal=0,selection_box,scale=1,void_h=122,shew,ship_health=0; escorts=escort; frigates=frigate; capitals=capital; @@ -66,14 +66,14 @@ selection_window.inside_method = function(){ ship_health=100; if (colu==1) then void_h=min(void_h+20,560); - if (posi==1){ + if (posi==0){ if (mnz=0) then draw_text(center_draw,yy+y3,string_hash_to_newline("=Capital Ships=")); y3+=20; if (y3>height-50) then break; set = "capitol"; } - if (posi==capitals+1) and (frigates>0){ + if (posi==capitals) and (frigates>0){ y3+=20; if (y3>height-50) then break; if (mnz=0) then draw_text(center_draw,yy+y3,string_hash_to_newline("=Frigates=")); @@ -82,7 +82,7 @@ selection_window.inside_method = function(){ set = "frigate"; } - if (posi==capitals+frigates+1) and (escorts>0){ + if (posi==capitals+frigates) and (escorts>0){ y3+=20; if (y3>height-50) then break; if (mnz=0) then draw_text(center_draw,yy+y3,string_hash_to_newline("=Escorts=")); @@ -92,22 +92,28 @@ selection_window.inside_method = function(){ } switch(set){ case "capitol": - ship_type = current_fleet.capital; current_ship=posi; - ship_select = current_fleet.capital_sel[current_ship]; - full_id = current_fleet.capital_num[current_ship]; + if (current_ship179){ - for (i=0;i<9;i++){ + for (var i=0;i<9;i++){ if (string_width(name)*scale>179) then scale-=0.05; } } if (scr_hit(xx+10,yy+y3,xx+width-10,yy+y3+18)){ if (string_width(name)*scale>135){ - for (i=0;i<9;i++){ + for (var i=0;i<9;i++){ if (string_width(name)*scale>135) then scale-=0.05; } } diff --git a/objects/obj_fleet_select/Draw_64.gml b/objects/obj_fleet_select/Draw_64.gml index 41fe8ac2a..e60038a76 100644 --- a/objects/obj_fleet_select/Draw_64.gml +++ b/objects/obj_fleet_select/Draw_64.gml @@ -1,63 +1,54 @@ -/// @description Insert description here -// You can write your code in this editor //TODO centralise draw logi - -if (!obj_controller.zoomed){ - var zm=1,tit="",mnz=0; - - //if (fleet_minimized=0){ - // draw_set_color(c_black); - // draw_rectangle(__view_get( e__VW.XView, 0 )+44,__view_get( e__VW.YView, 0 )+110,__view_get( e__VW.XView, 0 )+267,__view_get( e__VW.YView, 0 )+110+void_hei,0); - // draw_set_color(c_gray); - // draw_rectangle(__view_get( e__VW.XView, 0 )+44,__view_get( e__VW.YView, 0 )+110,__view_get( e__VW.XView, 0 )+267,__view_get( e__VW.YView, 0 )+110+void_hei,1); - //} - draw_set_color(c_gray); - - fleet_min_button = "-" - if (fleet_minimized || screen_expansion<20){ - fleet_min_button = "+"; - selection_window.draw_cut(60, 110, 0.35, 0.8, screen_expansion*5); - if (fleet_minimized && screen_expansion>1){ - screen_expansion--; - } else if (!fleet_minimized && screen_expansion<20){ - screen_expansion++; +try { + if (!obj_controller.zoomed) { + var zm = 1, tit = "", mnz = 0; + + //if (fleet_minimized=0){ + // draw_set_color(c_black); + // draw_rectangle(__view_get( e__VW.XView, 0 )+44,__view_get( e__VW.YView, 0 )+110,__view_get( e__VW.XView, 0 )+267,__view_get( e__VW.YView, 0 )+110+void_hei,0); + // draw_set_color(c_gray); + // draw_rectangle(__view_get( e__VW.XView, 0 )+44,__view_get( e__VW.YView, 0 )+110,__view_get( e__VW.XView, 0 )+267,__view_get( e__VW.YView, 0 )+110+void_hei,1); + //} + draw_set_color(c_gray); + + fleet_min_button = "-"; + if (fleet_minimized || screen_expansion < 20) { + fleet_min_button = "+"; + selection_window.draw_cut(60, 110, 0.35, 0.8, screen_expansion * 5); + if (fleet_minimized && screen_expansion > 1) { + screen_expansion--; + } else if (!fleet_minimized && screen_expansion < 20) { + screen_expansion++; + } + } else { + selection_window.draw(60, 110, 0.35, 0.8); } - } else { - selection_window.draw(60, 110, 0.35, 0.8); - } - var xx = selection_window.XX; - var yy = selection_window.YY; - var center_draw = xx + (selection_window.width/2); - var width = selection_window.width; - draw_set_halign(fa_center); - draw_text(center_draw,yy+50,string_hash_to_newline(string(global.chapter_name)+" Fleet")); - draw_set_halign(fa_left); - - draw_set_color(c_gray); - //draw_rectangle(xx+18+void_wid,yy+116,xx+36+void_wid,yy+134,0); - - draw_set_color(c_red); - - draw_set_color(c_gray); - draw_line(xx+10,yy+75,xx+width-10,yy+75); - if (point_and_click(draw_unit_buttons([xx+25,yy+40], fleet_min_button,[1,1],c_red))){ - if (fleet_minimized){ - screen_expansion--; - fleet_minimized=false; - } else { - screen_expansion++; - fleet_minimized=true; - } - } - - + var xx = selection_window.XX; + var yy = selection_window.YY; + var center_draw = xx + (selection_window.width / 2); + var width = selection_window.width; + draw_set_halign(fa_center); + draw_text(center_draw, yy + 50, string_hash_to_newline(string(global.chapter_name) + " Fleet")); + draw_set_halign(fa_left); + + draw_set_color(c_gray); + //draw_rectangle(xx+18+void_wid,yy+116,xx+36+void_wid,yy+134,0); + + draw_set_color(c_red); + + draw_set_color(c_gray); + draw_line(xx + 10, yy + 75, xx + width - 10, yy + 75); + if (point_and_click(draw_unit_buttons([xx + 25, yy + 40], fleet_min_button, [1, 1], c_red))) { + if (fleet_minimized) { + screen_expansion--; + fleet_minimized = false; + } else { + screen_expansion++; + fleet_minimized = true; + } + } + } +} catch (_exception) { + handle_exception(_exception); + instance_destroy(); } - - - - - - - - - diff --git a/objects/obj_fleet_spawner/Alarm_0.gml b/objects/obj_fleet_spawner/Alarm_0.gml index ab72f2b29..3d952708c 100644 --- a/objects/obj_fleet_spawner/Alarm_0.gml +++ b/objects/obj_fleet_spawner/Alarm_0.gml @@ -6,94 +6,15 @@ if (number=1){ // create blocks of infantry - var i, k, col, temp1, temp2, x2, hei, man, sizz; - i=0;k=0;col=5;temp1=0;temp2=0;x2=224;hei=0;man=0;sizz=0; + var i=0,k=0,x2=224,hei=0,man=0,sizz=0; - - - - - repeat(100){// This determines the number of ships in each column - k+=1; - - - if (obj_fleet.fighting[k]=1){ - if ((obj_fleet.column[col]="Capital") and (obj_fleet.ship_size[k]=3)) then obj_fleet.column_num[col]+=1; - if ((obj_fleet.column[col-1]="Capital") and (obj_fleet.ship_size[k]=3)) then obj_fleet.column_num[col-1]+=1; - if ((obj_fleet.column[col-2]="Capital") and (obj_fleet.ship_size[k]=3)) then obj_fleet.column_num[col-2]+=1; - if ((obj_fleet.column[col-3]="Capital") and (obj_fleet.ship_size[k]=3)) then obj_fleet.column_num[col-3]+=1; - if ((obj_fleet.column[col-4]="Capital") and (obj_fleet.ship_size[k]=3)) then obj_fleet.column_num[col-4]+=1; - - if (obj_fleet.ship_class[k]=obj_fleet.column[col]) then obj_fleet.column_num[col]+=1; - if (obj_fleet.ship_class[k]=obj_fleet.column[col-1]) then obj_fleet.column_num[col-1]+=1; - if (obj_fleet.ship_class[k]=obj_fleet.column[col-2]) then obj_fleet.column_num[col-2]+=1; - if (obj_fleet.ship_class[k]=obj_fleet.column[col-3]) then obj_fleet.column_num[col-3]+=1; - if (obj_fleet.ship_class[k]=obj_fleet.column[col-4]) then obj_fleet.column_num[col-4]+=1; - - if ((obj_fleet.column[col]="Escort") and (obj_fleet.ship_size[k]=1)) then obj_fleet.column_num[col]+=1; - if ((obj_fleet.column[col-1]="Escort") and (obj_fleet.ship_size[k]=1)) then obj_fleet.column_num[col-1]+=1; - if ((obj_fleet.column[col-2]="Escort") and (obj_fleet.ship_size[k]=1)) then obj_fleet.column_num[col-2]+=1; - if ((obj_fleet.column[col-3]="Escort") and (obj_fleet.ship_size[k]=1)) then obj_fleet.column_num[col-3]+=1; - if ((obj_fleet.column[col-4]="Escort") and (obj_fleet.ship_size[k]=1)) then obj_fleet.column_num[col-4]+=1; - } - - - } - - - - col=6; - repeat(5){// Start repeat - temp1=0;temp2=0; - - col-=1; - if (col<5) then x2-=obj_fleet.column_width[col]; - - - if (obj_fleet.column_num[col]>0){// Start ship creation - if (obj_fleet.column[col]="Capital"){hei=160;sizz=3;} - // if (column[col]="Slaughtersong"){hei=200;sizz=3;} - if (obj_fleet.column[col]="Strike Cruiser"){hei=96;sizz=2;} - if (obj_fleet.column[col]="Gladius"){hei=64;sizz=1;} - if (obj_fleet.column[col]="Hunter"){hei=64;sizz=1;} - if (obj_fleet.column[col]="Escort"){hei=64;sizz=1;} - - temp1=obj_fleet.column_num[col]*hei; - // temp2=((y-(height/2))-(temp1/2))+64; - temp2=y-(temp1/2)+64; - if (obj_fleet.column_num[col]=1) then temp2+=20; - - // show_message(string(column_num[col])+" "+string(column[col])+" X:"+string(x2)); - - k=0; - repeat(100){k+=1; - if (obj_fleet.ship_class[k]=obj_fleet.column[col]) or ((obj_fleet.column[col]="Escort") and (obj_fleet.ship_size[k]=1)) or ((obj_fleet.column[col]="Capital") and (obj_fleet.ship_size[k]=3)){ - if (sizz=3) and (obj_fleet.ship_class[k]!="") and (obj_fleet.fighting[k]=1){man=instance_create(x2,temp2,obj_p_capital);man.ship_id=k;man.class=obj_fleet.column[col];temp2+=hei;} - if (sizz=2) and (obj_fleet.ship_class[k]!="") and (obj_fleet.fighting[k]=1){man=instance_create(x2,temp2,obj_p_cruiser);man.ship_id=k;man.class=obj_fleet.column[col];temp2+=hei;} - if (sizz=1) and (obj_fleet.ship_class[k]!="") and (obj_fleet.fighting[k]=1){man=instance_create(x2,temp2,obj_p_escort);man.ship_id=k;man.class=obj_fleet.column[col];temp2+=hei;} - } - } - - - }// End ship creation - - - - - }// End repeat - - - - - - - - - - - + sort_ships_into_columns(obj_fleet); + with (obj_fleet){ + player_fleet_ship_spawner(); + } + } @@ -107,7 +28,11 @@ if (number>0) and (owner!=1){ if (owner = eFACTION.Imperium){ - if (en_escort>0){en_column[4]="Sword Class Frigate";en_num[4]=en_escort;en_size[4]=1;} + if (en_escort>0){ + en_column[4]="Sword Class Frigate"; + en_num[4]=en_escort; + en_size[4]=1; + } if (en_frigate>0){en_column[3]="Avenger Class Grand Cruiser";en_num[3]=en_frigate;en_size[3]=2;} diff --git a/objects/obj_ground_mission/Alarm_4.gml b/objects/obj_ground_mission/Alarm_4.gml index c1109c00f..8dd567946 100644 --- a/objects/obj_ground_mission/Alarm_4.gml +++ b/objects/obj_ground_mission/Alarm_4.gml @@ -15,7 +15,7 @@ var i=0; var mission,mission_roll; mission="bad";mission_roll=floor(random(100))+1; -if (string_count("Ambusher",obj_ini.strin)=1) then mission_roll-=15; +if (scr_has_adv("Ambushers")) then mission_roll-=15; if (mission_roll<=60) then mission="good";// 135 if (planet.p_type[num]="Dead") then mission="good"; // mission="bad"; @@ -58,7 +58,7 @@ if (mission="bad"){ } -if (scr_has_adv("Scavengers")){ +if (scr_has_adv("Tech-Scavengers")){ var ex1,ex1_num,ex2,ex2_num,ex3,ex3_num; ex1="";ex1_num=0;ex2="";ex2_num=0;ex3="";ex3_num=0; diff --git a/objects/obj_ground_mission/Alarm_5.gml b/objects/obj_ground_mission/Alarm_5.gml index 8d9ca35c5..4658f5198 100644 --- a/objects/obj_ground_mission/Alarm_5.gml +++ b/objects/obj_ground_mission/Alarm_5.gml @@ -4,7 +4,7 @@ plan=instance_nearest(x,y,obj_star); var mission,mission_roll; mission="bad";mission_roll=floor(random(100))+1; -if (string_count("Ambusher",obj_ini.strin)=1) then mission_roll-=15; +if (scr_has_adv("Ambushers")) then mission_roll-=15; if (plan.p_owner[num]=3) then mission_roll+=20; if (mission_roll<=60) then mission="good";// 135 if (plan.p_type[num]="Dead") then mission="good"; @@ -69,7 +69,7 @@ if (mission="bad") and (plan.p_first[num]=3) and (plan.p_type[num]="Forge"){ } -if (scr_has_adv("Scavengers")){ +if (scr_has_adv("Tech-Scavengers")){ var ex1,ex1_num,ex2,ex2_num,ex3,ex3_num; ex1="";ex1_num=0;ex2="";ex2_num=0;ex3="";ex3_num=0; diff --git a/objects/obj_ground_mission/Alarm_6.gml b/objects/obj_ground_mission/Alarm_6.gml index 7e3c1aaa4..380e9286d 100644 --- a/objects/obj_ground_mission/Alarm_6.gml +++ b/objects/obj_ground_mission/Alarm_6.gml @@ -18,7 +18,6 @@ if (obj_controller.disposition[3]>50) then obj_controller.disposition[3]+=11; with(obj_controller){scr_dialogue("stc_thanks");} with(obj_temp2){instance_destroy();} -with(obj_temp3){instance_destroy();} with(obj_temp7){instance_destroy();} if (obj_ini.fleet_type=ePlayerBase.home_world) then with(obj_star){ @@ -33,27 +32,32 @@ if (obj_ini.fleet_type != ePlayerBase.home_world) then with(obj_p_fleet){// Get if (obj_ini.fleet_type != ePlayerBase.home_world){ with(obj_p_fleet){if (action="") then instance_deactivate_object(instance_nearest(x,y,obj_star));} } -with(obj_star){// Get origin star system for enemy fleet - if (owner=obj_controller.diplomacy) and ((p_owner[1]=obj_controller.diplomacy) or (p_owner[2]=obj_controller.diplomacy) - or (p_owner[3]=obj_controller.diplomacy) or (p_owner[4]=obj_controller.diplomacy)){ - instance_create(x,y,obj_temp3); - } + +var flit, i,chasing;chasing=0;// Set target +var targ +if (instance_exists(obj_temp2)){ + targ = nearest_star_with_ownership(obj_temp2.x, obj_temp2.y,obj_controller.diplomacy ); +} else if (instance_exists(obj_temp7)){ + targ = nearest_star_with_ownership(obj_temp7.x, obj_temp7.y,obj_controller.diplomacy ); } -var targ, flit, i,chasing;chasing=0;// Set target -if (instance_exists(obj_temp2)) then targ=instance_nearest(obj_temp2.x,obj_temp2.y,obj_temp3); -if (!instance_exists(obj_temp2)) and (instance_exists(obj_temp7)) then targ=instance_nearest(obj_temp7.x,obj_temp7.y,obj_temp3); // If player fleet is flying about then get their target for new target -if (!instance_exists(obj_temp2)) and (!instance_exists(obj_temp7)) and (instance_exists(obj_p_fleet)) and (obj_ini.fleet_type = ePlayerBase.home_world){chasing=1; +else if (!instance_exists(obj_temp2)) and (!instance_exists(obj_temp7)) and (instance_exists(obj_p_fleet)) and (obj_ini.fleet_type = ePlayerBase.home_world){ + chasing=1; with(obj_p_fleet){var pop; - if (capital_number>0) and (action!=""){pop=instance_create(action_x,action_y,obj_temp2);pop.action_eta=action_eta;} - if (frigate_number>0) and (action!=""){pop=instance_create(action_x,action_y,obj_temp7);pop.action_eta=action_eta;} + if (capital_number>0) and (action!=""){ + pop=instance_create(action_x,action_y,obj_temp2); + pop.action_eta=action_eta; + } + if (frigate_number>0) and (action!=""){ + pop=instance_create(action_x,action_y,obj_temp7); + pop.action_eta=action_eta; + } } } -if (instance_exists(obj_temp2)) then targ=instance_nearest(obj_temp2.x,obj_temp2.y,obj_temp3); -if (!instance_exists(obj_temp2)) and (instance_exists(obj_temp7)) then targ=instance_nearest(obj_temp7.x,obj_temp7.y,obj_temp3); + flit=instance_create(targ.x,targ.y,obj_en_fleet); @@ -78,7 +82,6 @@ flit.alarm[4]=1; instance_activate_all(); with(obj_temp2){instance_destroy();} -with(obj_temp3){instance_destroy();} with(obj_temp7){instance_destroy();} instance_destroy(); diff --git a/objects/obj_img/Create_0.gml b/objects/obj_img/Create_0.gml index 2de362295..f54fbb9b6 100644 --- a/objects/obj_img/Create_0.gml +++ b/objects/obj_img/Create_0.gml @@ -1,4 +1,16 @@ +// should end up a struct of arrays, +// e.g. +/* +img_cache: { + "creation/chapters": [somesprite1, somesprite2, ...]; +} + */ +show_debug_message("obj_img spawned"); + +image_cache = {}; + + var i;i=-1; repeat(301){i+=1; creation[i]=0;creation_exists[i]=-1; diff --git a/objects/obj_ini/Create_0.gml b/objects/obj_ini/Create_0.gml index e5aa3dfdc..5227725cb 100644 --- a/objects/obj_ini/Create_0.gml +++ b/objects/obj_ini/Create_0.gml @@ -1,5 +1,6 @@ // // Global singletons // global.NameGenerator = new NameGenerator(); +show_debug_message("Creating obj_ini"); // // normal stuff use_custom_icon=0; @@ -10,13 +11,16 @@ sixths=0;sevenths=0;eighths=0;ninths=0;tenths=0;commands=0; heh1=0;heh2=0; -strin=""; -strin2=""; +// strin=""; +// strin2=""; tolerant=0; companies=10; -progenitor=0; +progenitor=ePROGENITOR.NONE; aspirant_trial = 0; +//default sector name to prevent potential crash +sector_name = "Terra Nova"; +//default load_to_ships=[2,0,0]; if (instance_exists(obj_creation)){load_to_ships=obj_creation.load_to_ships;} @@ -47,38 +51,11 @@ repeat(200){i+=1; } var i=-1; -repeat(210){i+=1; - ship[i]=""; - ship_uid[i]=0; - ship_owner[i]=0; - ship_class[i]=""; - ship_size[i]=0; - ship_uid[i]=0; - ship_leadership[i]=0; - ship_hp[i]=0; - ship_maxhp[i]=0; - ship_location[i]=""; - ship_shields[i]=0; - ship_conditions[i]=""; - ship_speed[i]=0; - ship_turning[i]=0; - ship_front_armour[i]=0; - ship_other_armour[i]=0; - ship_weapons[i]=0; - ship_shields[i]=0; - for (var s=0;s<6;s++){ - ship_wep[i,s]=""; - ship_wep_facing[i,s]=""; - ship_wep_condition[i,s]=""; - } - ship_capacity[i]=0; - ship_carrying[i]=0; - ship_contents[i]=""; - ship_turrets[i]=0; -} +init_player_fleet_arrays(); +ship_id = []; -var company,v; -company=-1; +var v; +var company=-1; repeat(11){ company+=1;v=-1;// show_message("v company: "+string(company)); repeat(205){v+=1;// show_message(string(company)+"."+string(v)); @@ -94,7 +71,7 @@ repeat(11){ veh_hp[company,v]=100; veh_chaos[company,v]=0; veh_pilots[company,v]=0; - veh_lid[company,v]=0; + veh_lid[company,v]=-1; veh_wid[company,v]=2; veh_uid[company,v]=0; } @@ -117,6 +94,7 @@ previous_forge_masters = []; recruit_trial = 0; recruiting_type="Death"; +gene_slaves = []; /* if (global.load=0){ if (obj_creation.custom>0) then scr_initialize_custom(); if (obj_creation.custom=0) then scr_initialize_standard(); diff --git a/objects/obj_lol_version/Draw_0.gml b/objects/obj_lol_version/Draw_0.gml index fb19062f3..7a1b8d34f 100644 --- a/objects/obj_lol_version/Draw_0.gml +++ b/objects/obj_lol_version/Draw_0.gml @@ -1,14 +1,17 @@ -if (obj_main_menu.stage>2){ - var _build_date_line = $"Build: {global.build_date}"; - var _version_line = $"Version: {global.game_version}"; - +if (obj_main_menu.stage>2){ draw_set_alpha(0.6); draw_set_font(fnt_cul_14); draw_set_color(c_gray); draw_set_halign(fa_right); - draw_text(1598, 858, _version_line); - draw_text(1598, 878, _build_date_line); + if (global.build_date != "") { + var _build_date_line = $"Build: {global.build_date}"; + draw_text(1598, 878, _build_date_line); + } + if (global.game_version != "") { + var _version_line = $"Version: {global.game_version}"; + draw_text(1598, 858, _version_line); + } draw_set_halign(fa_left); draw_set_alpha(1); if (point_and_click([1400, 830, 1600, 900])) { diff --git a/objects/obj_main_menu/Step_0.gml b/objects/obj_main_menu/Step_0.gml index d630b53f1..7bc1274a7 100644 --- a/objects/obj_main_menu/Step_0.gml +++ b/objects/obj_main_menu/Step_0.gml @@ -79,13 +79,3 @@ if (fade<=20){ } if (mouse_x<552) or (mouse_y<441) or (mouse_x>608) or (mouse_y>457) and (browser=1) then browser=0; - - - -if (string_count("dukedecrypt",keyboard_string)>0){ - var which;which=get_integer("Which save?",1); - file_copy("save"+string(which)+".ini","dec_save"+string(which)+".ini"); - file_decrypt("dec_save"+string(which)+".ini","p"); - game_end(); -} - diff --git a/objects/obj_managment_panel/Draw_64.gml b/objects/obj_managment_panel/Draw_64.gml index 686a0d6ee..e2cc7ac37 100644 --- a/objects/obj_managment_panel/Draw_64.gml +++ b/objects/obj_managment_panel/Draw_64.gml @@ -1,7 +1,11 @@ slate_panel.inside_method = function(){ draw_set_color(#50a076); - var cus,draw_func; - cus=false; + var cus = false; + var draw_func; + var sprx = 0; + var spry = 0; + var sprw = 0; + var sprh = 0; switch(header){ case 3: @@ -34,16 +38,13 @@ slate_panel.inside_method = function(){ icon_sprite=spr_icon_chapters; icc-=19; } - if (string_pos("custom",obj_ini.icon_name)>0) then cus=true; - if (cus=false) and (icc<=20) then scr_image("creation",icc,x+(panel_width/2)-50,y-10,141*0.7,141*0.7); - if (cus=false) and (icc>20) then draw_sprite_ext(icon_sprite,icc,x+(panel_width/2)-50,y-10,0.7,0.7,0,c_white,1); - if (cus=true){ - var cusl=string_replace(obj_ini.icon_name,"custom",""); - cusl=real(cusl); - if (obj_cuicons.spr_custom[cusl]>0) and (sprite_exists(obj_cuicons.spr_custom_icon[cusl])){ - draw_sprite_ext(obj_cuicons.spr_custom_icon[cusl],0,x+(panel_width/2)-50,y-10,0.7,0.7,0,c_white,1); - } - } + + sprx = x+(panel_width/2)-50; + spry = y-10; + sprw = 141*0.7; + sprh = 141*0.7; + + draw_sprite_stretched(global.chapter_icon_sprite, global.chapter_icon_frame, sprx, spry, sprw, sprh); draw_set_font(fnt_cul_14); draw_text(x+(panel_width/2),y+89,string_hash_to_newline(title)); if (line[1]!=""){ @@ -67,18 +68,18 @@ slate_panel.inside_method = function(){ } else if (title=="LIBRARIUM"){ draw_sprite_ext(spr_lib_area_pad, 0, x+(panel_width/2)-((0.3*180)/2),y-30,0.3,0.3,0,c_white,1) }else { - var icon_sprite,icc;icon_sprite=spr_icon;icc=obj_ini.icon; - if (icc>20){icon_sprite=spr_icon_chapters;icc-=19;} - - if (string_pos("custom",obj_ini.icon_name)>0) then cus=true; - if (cus=false) and (icc<=20) then scr_image("creation",icc,x+(panel_width/2)-16,y-16,141*0.23,141*0.23); - if (cus=false) and (icc>20) then draw_sprite_ext(icon_sprite,icc,x+(panel_width/2)-16,y-16,0.23,0.23,0,c_white,1); - if (cus=true){ - var cusl;cusl=string_replace(obj_ini.icon_name,"custom","");cusl=real(cusl); - if (obj_cuicons.spr_custom[cusl]>0) and (sprite_exists(obj_cuicons.spr_custom_icon[cusl])){ - draw_sprite_ext(obj_cuicons.spr_custom_icon[cusl],0,x+(panel_width/2)-16,y-16,0.23,0.23,0,c_white,1); - } + var icon_sprite, icc; + icon_sprite = spr_icon; + icc = obj_ini.icon; + if (icc > global.normal_icons_count) { + icon_sprite = spr_icon_chapters; + icc -= global.normal_icons_count - 1; } + sprx = x + (wid / 2) - 16; + spry = y - 16; + sprw = 141 * 0.23; + sprh = 141 * 0.23; + draw_sprite_stretched(global.chapter_icon_sprite, global.chapter_icon_frame, sprx, spry, sprw, sprh); } // draw_sprite_ext(icon_sprite,icc,x+(panel_width/2)-16,y-16,0.23,0.23,0,c_white,1); draw_set_font(fnt_cul_14); diff --git a/objects/obj_marine/Create_0.gml b/objects/obj_marine/Create_0.gml index e81676f8c..02dab24cc 100644 --- a/objects/obj_marine/Create_0.gml +++ b/objects/obj_marine/Create_0.gml @@ -16,10 +16,10 @@ scr_colors_initialize(); main_color=8; secondary_color=6; -pauldron_color=6; +right_pauldron=6; lens_color=7; -trim_color=15; -pauldron2_color=6; +main_trim=15; +left_pauldron=6; weapon_color=6; col_special=0; trim=1;firing=0; diff --git a/objects/obj_mass_equip/Create_0.gml b/objects/obj_mass_equip/Create_0.gml index d181bf495..04f992a48 100644 --- a/objects/obj_mass_equip/Create_0.gml +++ b/objects/obj_mass_equip/Create_0.gml @@ -48,5 +48,5 @@ good3=0; good4=0; good5=0; - +item_name = []; diff --git a/objects/obj_mass_equip/Draw_0.gml b/objects/obj_mass_equip/Draw_0.gml index 60a550ccd..513cd4a67 100644 --- a/objects/obj_mass_equip/Draw_0.gml +++ b/objects/obj_mass_equip/Draw_0.gml @@ -60,122 +60,147 @@ if (total_role_number>0){ -if (total_role_number>0) and (tab>0){ - var i=-1,told;repeat(50){i+=1;item_name[i]="";} - - if (tab<=2){told=tab;tab=1;} - if (tab>2){told=tab;tab=tab;} - scr_weapons_equip();tab=told; +if (total_role_number > 0 && tab > 0) { + item_name = []; + var infanty_roles = [ + eROLE.ChapterMaster, + eROLE.HonourGuard, + eROLE.Veteran, + eROLE.Terminator, + eROLE.Captain, + eROLE.Champion, + eROLE.Tactical, + eROLE.Devastator, + eROLE.Assault, + eROLE.Ancient, + eROLE.Scout, + eROLE.Chaplain, + eROLE.Apothecary, + eROLE.Techmarine, + eROLE.Librarian, + eROLE.Sergeant, + eROLE.VeteranSergeant, + ]; + if ( + // hand slots + (tab == 1 || tab ==2) && + array_get_index(infanty_roles, obj_controller.settings) >= 0 + ) { + // Get all available hand weapons + scr_get_item_names( + item_name, + obj_controller.settings, // eROLE + 1, // slot + eENGAGEMENT.Any, + true, // include the company standard + false, // do not limit to available items + ); + scr_get_item_names( + item_name, + obj_controller.settings, // eROLE + 2, // slot + eENGAGEMENT.Any, + false, // include the company standard + false, // do not limit to available items + false, // not only mastercrafted + true // put none in the list only once + ); + array_resize(item_name, array_unique_ext(item_name)); + } else { + scr_get_item_names( + item_name, + obj_controller.settings, // eROLE + tab, // slot + eENGAGEMENT.None, // doesn't matter to non infantry/non hand slots + true, // include the company standard + false, // do not limit to available items + ); + } draw_set_color(0); - draw_rectangle(xx+1183,yy+160,xx+1506,yy+747,0); + draw_rectangle(xx + 1183, yy + 160, xx + 1506, yy + 747, 0); draw_set_color(c_gray); - draw_rectangle(xx+1184,yy+161,xx+1505,yy+746,1); - draw_rectangle(xx+1185,yy+162,xx+1504,yy+745,1); - draw_rectangle(xx+1186,yy+163,xx+1503,yy+744,1); + draw_rectangle(xx + 1184, yy + 161, xx + 1505, yy + 746, 1); + draw_rectangle(xx + 1185, yy + 162, xx + 1504, yy + 745, 1); + draw_rectangle(xx + 1186, yy + 163, xx + 1503, yy + 744, 1); draw_set_font(fnt_40k_30b); - if (tab=1) then draw_text_transformed(xx+1203,yy+174,string_hash_to_newline("Select First Weapon"),0.6,0.6,0); - if (tab=2) then draw_text_transformed(xx+1203,yy+174,string_hash_to_newline("Select Second Weapon"),0.6,0.6,0); - if (tab=3) then draw_text_transformed(xx+1203,yy+174,string_hash_to_newline("Select Armour"),0.6,0.6,0); - if (tab=4) then draw_text_transformed(xx+1203,yy+174,string_hash_to_newline("Select Special Item"),0.6,0.6,0); - if (tab=5) then draw_text_transformed(xx+1203,yy+174,string_hash_to_newline("Select Mobility Item"),0.6,0.6,0); + var slot_name = get_slot_name(obj_controller.settings, tab); + draw_text_transformed(xx + 1203, yy + 174, string_hash_to_newline($"Select {slot_name}"), 0.6, 0.6, 0); draw_set_font(fnt_40k_14b); - - - var x3,y3,space,h;h=0;x3=xx+1205;y3=yy+205;space=18; - repeat(23){ - h+=1;draw_set_color(c_gray); - if (item_name[h]!=""){ - if (string_width(string_hash_to_newline(item_name[h]))>=140) then draw_text_transformed(x3,y3,string_hash_to_newline(item_name[h]),0.75,1,0); - if (string_width(string_hash_to_newline(item_name[h]))<140) then draw_text_transformed(x3,y3,string_hash_to_newline(item_name[h]),1,1,0);y3+=space; - - // x2 was 1150 - if (scr_hit(x3,y3-space,x3+143,y3+17-space)=true){ - if (string_width(string_hash_to_newline(item_name[h]))<140){ - draw_set_color(c_white);draw_set_alpha(0.2); - draw_text_transformed(x3,y3-space,string_hash_to_newline(item_name[h]),1,1,0);draw_set_alpha(1); - } - if (string_width(string_hash_to_newline(item_name[h]))>=140){ - draw_set_color(c_white);draw_set_alpha(0.2); - draw_text_transformed(x3,y3-space,string_hash_to_newline(item_name[h]),0.75,1,0);draw_set_alpha(1); - } - - if (obj_controller.mouse_left=1) and (obj_controller.cooldown<=0){ - var buh;buh=item_name[h];obj_controller.cooldown=8000; - if (item_name[h]="(None)") then buh=""; - if (tab=1) then obj_ini.wep1[100][role]=buh; - if (tab=2) then obj_ini.wep2[100][role]=buh; - if (tab=3){ - obj_ini.armour[100,role]=buh; - if (buh="Terminator Armour") then obj_ini.mobi[100,role]=""; - } - if (tab=4) then obj_ini.gear[100,role]=buh; - if (tab=5) then obj_ini.mobi[100,role]=buh; - tab=0;refresh=true; - } - } + + var x3 = xx + 1205; // Starting x position for the first column + var y3 = yy + 205; // Starting y position + var space = 18; // Amount to move down for each item + var items_per_column = 24; + var column_width = 146; + var column_gap = 3; + + for (var h = 0; h < array_length(item_name); h++) { + if (h > 0 && h % items_per_column == 0) { + x3 += column_width; + y3 = yy + 205; } - } - if (tab=1) or (tab=2){ - var i,told;i=-1;repeat(50){i+=1;item_name[i]="";} - if (tab<=2){told=tab;tab=2;} - if (tab>2){told=tab;tab=tab;} - scr_weapons_equip();tab=told; - - var x3,y3,h,space;h=0;x3=xx+1205+146;y3=yy+205;space=18; - repeat(23){h+=1;draw_set_color(c_gray); - if (item_name[h]!=""){ - if (string_width(string_hash_to_newline(item_name[h]))>=140) then draw_text_transformed(x3,y3,string_hash_to_newline(item_name[h]),0.75,1,0); - if (string_width(string_hash_to_newline(item_name[h]))<140) then draw_text_transformed(x3,y3,string_hash_to_newline(item_name[h]),1,1,0);y3+=space; - - if (scr_hit(x3,y3-space,x3+143,y3+17-space)=true){ - - if (string_width(string_hash_to_newline(item_name[h]))<140){ - draw_set_color(c_white);draw_set_alpha(0.2); - draw_text_transformed(x3,y3-space,string_hash_to_newline(item_name[h]),1,1,0);draw_set_alpha(1); - } - if (string_width(string_hash_to_newline(item_name[h]))>=140){ - draw_set_color(c_white);draw_set_alpha(0.2); - draw_text_transformed(x3,y3-space,string_hash_to_newline(item_name[h]),0.75,1,0);draw_set_alpha(1); - } - - if (obj_controller.mouse_left=1) and (obj_controller.cooldown<=0){ - var buh;buh=item_name[h];obj_controller.cooldown=8000; - if (item_name[h]="(None)") then buh=""; - if (tab=1) then obj_ini.wep1[100,role]=buh; - if (tab=2) then obj_ini.wep2[100,role]=buh; - if (tab=3){ - obj_ini.armour[100,role]=buh; - if (buh="Terminator Armour") then obj_ini.mobi[100,role]=""; + + draw_set_color(c_gray); + var scale = string_width(string_hash_to_newline(item_name[h])) >= 140 ? 0.75 : 1; + draw_text_transformed(x3, y3, string_hash_to_newline(item_name[h]), scale, 1, 0); + + // keep track of the item's bottom right corner + var item_x2 = x3 + (column_width - column_gap); + var item_y2 = y3 + space - 1; + + if (scr_hit(x3, y3, item_x2, item_y2)) { + draw_set_color(c_white); + draw_set_alpha(0.2); + draw_text_transformed(x3, y3, string_hash_to_newline(item_name[h]), scale, 1, 0); + draw_set_alpha(1); + + if (obj_controller.mouse_left == 1 && obj_controller.cooldown <= 0) { + var buh = item_name[h] == ITEM_NAME_NONE ? "" : item_name[h]; + obj_controller.cooldown = 8000; + + switch (tab) { + // slots + case 1: obj_ini.wep1[100, role] = buh; break; + case 2: obj_ini.wep2[100, role] = buh; break; + case 3: + obj_ini.armour[100, role] = buh; + // No bikes or jump packs for Terminators + if (buh == "Terminator Armour") { + obj_ini.mobi[100, role] = ""; } - if (tab=4) then obj_ini.gear[100,role]=buh; - if (tab=5) then obj_ini.mobi[100,role]=buh; - tab=0;refresh=true; - } + break; + case 4: obj_ini.gear[100, role] = buh; break; + case 5: obj_ini.mobi[100, role] = buh; break; } + tab = 0; + refresh = true; } } - - // tab=told; + y3 += space; } - - - - draw_set_halign(fa_center);draw_set_font(fnt_40k_14b); - draw_set_color(c_gray);draw_rectangle(xx+1347-(string_width(string_hash_to_newline("CANCEL"))/2),yy+720,xx+1347+(string_width(string_hash_to_newline("CANCEL"))/2),yy+741,0); - draw_set_color(0);draw_text(xx+1347,yy+721,string_hash_to_newline("CANCEL")); - if (scr_hit(xx+1347-(string_width(string_hash_to_newline("CANCEL"))/2),yy+720,xx+1347+(string_width(string_hash_to_newline("CANCEL"))/2),yy+741)=true){ - draw_set_color(c_white);draw_set_alpha(0.2); - draw_rectangle(xx+1347-(string_width(string_hash_to_newline("CANCEL"))/2),yy+720,xx+1347+(string_width(string_hash_to_newline("CANCEL"))/2),yy+741,0);draw_set_alpha(1); - if (obj_controller.mouse_left=1){obj_controller.cooldown=8000;tab=0;} - }draw_set_alpha(1); - - - - + + draw_set_halign(fa_center); + draw_set_font(fnt_40k_14b); + draw_set_color(c_gray); + draw_rectangle(xx + 1347 - (string_width(string_hash_to_newline("CANCEL")) / 2), yy + 720, xx + 1347 + (string_width(string_hash_to_newline("CANCEL")) / 2), yy + 741, 0); + draw_set_color(0); + draw_text(xx + 1347, yy + 721, string_hash_to_newline("CANCEL")); + if (scr_hit(xx + 1347 - (string_width(string_hash_to_newline("CANCEL")) / 2), yy + 720, xx + 1347 + (string_width(string_hash_to_newline("CANCEL")) / 2), yy + 741)) { + draw_set_color(c_white); + draw_set_alpha(0.2); + draw_rectangle(xx + 1347 - (string_width(string_hash_to_newline("CANCEL")) / 2), yy + 720, xx + 1347 + (string_width(string_hash_to_newline("CANCEL")) / 2), yy + 741, 0); + draw_set_alpha(1); + if (obj_controller.mouse_left == 1) { + obj_controller.cooldown = 8000; + tab = 0; + } + } + draw_set_alpha(1); } + /* */ /* */ diff --git a/objects/obj_mass_equip/Step_0.gml b/objects/obj_mass_equip/Step_0.gml index 3b37f0f17..852fd11c3 100644 --- a/objects/obj_mass_equip/Step_0.gml +++ b/objects/obj_mass_equip/Step_0.gml @@ -5,12 +5,18 @@ var romanNumerals= scr_roman_numerals(); var unit; var unit_armour,complete; if (engage=true){ - for(var co=0; co<11; co++){ + for(var co=0; co<=obj_ini.companies; co++){ var i=0; if (role_number[co]>0){ - for(i=1; i<=500; i++){ + for(i=0; i0){ refresh=false; - if (tab>0) then scr_weapons_equip(); + if (tab > 0) { + item_name = []; + var is_hand_slot = (tab == 1 || tab == 2); + scr_get_item_names( + item_name, + obj_controller.settings, // eROLE + tab, // slot + is_hand_slot ? eENGAGEMENT.Any : eENGAGEMENT.None, + true, // include company standard + false, // show all regardless of inventory + ); + } good1=0; good2=0; diff --git a/objects/obj_ncombat/Alarm_1.gml b/objects/obj_ncombat/Alarm_1.gml index a44e1acb3..5a0995591 100644 --- a/objects/obj_ncombat/Alarm_1.gml +++ b/objects/obj_ncombat/Alarm_1.gml @@ -469,7 +469,7 @@ if (temp>=100) and (threat>1) and (big_mofo>0) and (big_mofo<10) and (dropping=0 newline=p4;scr_newtext(); newline=p5;scr_newtext(); } - if (global.chapter_name="Carcharodons"){standard_cry=1; + if (obj_ini.battle_cry == "..."){standard_cry=1; var rand;rand=choose(1,2,3); if (rand=1) and (big_mofo!=1){p2="remains silent as the Chapter forms for battle-";}if (rand=1) and (big_mofo=1){p2="remain silent as the Chapter forms for battle-";} if (rand=2) and (big_mofo!=1){p2="remains silent and issues orders to the Chapter for battle-";}if (rand=2) and (big_mofo=1){p2="remain silent and issues orders to the Chapter for battle-";} diff --git a/objects/obj_ncombat/Alarm_5.gml b/objects/obj_ncombat/Alarm_5.gml index 3e75e54fc..296ab80c2 100644 --- a/objects/obj_ncombat/Alarm_5.gml +++ b/objects/obj_ncombat/Alarm_5.gml @@ -5,7 +5,7 @@ var part5="",part6="",part7="",part8="",part10=""; battle_over=1; alarm[8]=999999; - var line_break = "------------------------------------------------------------------------------"; +var line_break = "------------------------------------------------------------------------------"; // show_message("Final Deaths: "+string(final_deaths)); @@ -18,7 +18,7 @@ var ground_mission = (instance_exists(obj_ground_mission)); if (final_deaths+final_command_deaths>0){ part1+=$"Marines Lost: {final_deaths+final_command_deaths}"; if (units_saved > 0){ - part1+=$" ({roles[Role.APOTHECARY]}{apothecaries_alive>1?"s":""} prevented the death of {units_saved})"; + part1+=$" ({roles[eROLE.Apothecary]}{apothecaries_alive>1?"s":""} prevented the death of {units_saved})"; } if (injured>0) then part8=$"Marines Critically Injured: {injured}"; @@ -51,20 +51,20 @@ if (ground_mission){ }; seed_saved=(min(seed_max,apothecaries_alive*40))-gene_penalty; -if (string_count("Doom",obj_ini.strin2)>0) then seed_saved=0; +if (obj_ini.doomed) then seed_saved=0; if (seed_saved>0) then obj_controller.gene_seed+=seed_saved; -if (string_count("Doom",obj_ini.strin2)>0) && (!apothecaries_alive){ +if (obj_ini.doomed && !apothecaries_alive){ part3=$"Chapter Mutation prevents retrieving Gene-Seed. {seed_max} Gene-Seed lost."; newline=part3; scr_newtext(); newline=" "; scr_newtext(); -}else if (!apothecaries_alive) and (string_count("Doom",obj_ini.strin2)=0){ - part3=$"No able-bodied {roles[Role.APOTHECARY]}. {seed_max} Gene-Seed lost."; +}else if (!apothecaries_alive && !obj_ini.doomed){ + part3=$"No able-bodied {roles[eROLE.Apothecary]}. {seed_max} Gene-Seed lost."; newline=part3;scr_newtext(); newline=" ";scr_newtext(); -}else if (apothecaries_alive>0) and (final_deaths+final_command_deaths>0) and (string_count("Doom",obj_ini.strin2)=0){ +}else if (apothecaries_alive>0 && final_deaths+final_command_deaths>0 && !obj_ini.doomed){ part3=$"Gene-Seed Recovered: {seed_saved}("; part3 += seed_saved ? $"{round((seed_saved/seed_max)*100)}" : "0"; part3 += "%)"; @@ -127,11 +127,26 @@ if (post_equipment_lost[1]!=""){ scr_newtext(); } if (total_battle_exp_gain>0){ - newline=" "; + average_battle_exp_gain = distribute_experience(end_alive_units, total_battle_exp_gain); // Due to cool alarm timer shitshow, I couldn't think of anything but to put it here. + newline = $"Each marine gained {average_battle_exp_gain} experience, reduced by their total experience."; scr_newtext(); - newline = $"Marines gained a total of {total_battle_exp_gain} experience"; + + var _upgraded_librarians_count = array_length(upgraded_librarians); + if (_upgraded_librarians_count > 0) { + for (var i = 0; i < _upgraded_librarians_count; i++) { + if (i > 0) { + newline += ", "; + } + newline += $"{upgraded_librarians[i].name()}"; + } + newline += " learned new psychic powers after gaining enough experience." + scr_newtext(); + } + + newline=" "; scr_newtext(); } + if (ground_mission){ obj_ground_mission.post_equipment_lost = post_equipment_lost obj_ground_mission.post_equipments_lost = post_equipments_lost @@ -231,7 +246,7 @@ if (defeat=0) and (battle_special="space_hulk"){ if (ex=100) then newline_color="red"; scr_newtext(); - if (string_count("Shitty",obj_ini.strin2)>0) then dicey=dicey*1.5; + if (scr_has_disadv("Shitty Luck")) then dicey=dicey*1.5; // show_message("Roll Under: "+string(enemy_power*10)+", Roll: "+string(dicey)); if (dicey<=(enemy_power*10)){ @@ -413,9 +428,11 @@ if (defeat=0) and (reduce_power=true){ part10+=$" were reduced to {new_power} after this battle. Previous power: { enemy_power}. Reduction: {power_reduction}."; } - newline=part10;scr_newtext(); + newline=part10; + scr_newtext(); part10 = $"Received {requisition_reward} requisition points as a reward for slaying enemies of the Imperium."; - newline=part10;scr_newtext(); + newline=part10; + scr_newtext(); if (new_power<=0) and (enemy_power>0) then battle_object.p_raided[battle_id]=1; } @@ -560,7 +577,7 @@ if (obj_ini.omophagea){ if (red_thirst=3) then thirsty=1;if (red_thirst>3) then thirsty=red_thirst-2; if (thirsty>0) then eatme-=(thirsty*6);if (really_thirsty>0) then eatme-=(really_thirsty*15); - if (string_count("Shitty",obj_ini.strin2)=1) then eatme-=10; + if (scr_has_disadv("Shitty Luck")) then eatme-=10; if (allies>0){ obj_controller.disposition[2]-=choose(1,0,0); @@ -592,7 +609,7 @@ if (obj_ini.omophagea){ // check for pdf/guardsmen eatme=floor(random(100))+1; - if (array_contains(obj_ini.dis,"Shitty Luck")) then eatme-=10; + if (scr_has_disadv("Shitty Luck")) then eatme-=10; if (eatme<=10) and (allies>0){ obj_controller.disposition[2]-=2; if (allies=1){ @@ -608,7 +625,7 @@ if (obj_ini.omophagea){ // check for inquisitor eatme=floor(random(100))+1; - if (array_contains(obj_ini.dis,"Shitty Luck")) then eatme-=5; + if (scr_has_disadv("Shitty Luck")) then eatme-=5; if (eatme<=40) and (present_inquisitor=1){ var thatta=0,remove=0,i=0; obj_controller.disposition[4]-=10; @@ -672,7 +689,6 @@ if (obj_ini.omophagea){ instance_deactivate_object(obj_turn_end); with(inquisitor_ship){instance_destroy();} - with(obj_temp3){instance_destroy();} with(obj_ground_mission){instance_destroy();} } instance_deactivate_object(obj_star); @@ -759,13 +775,8 @@ if (obj_ini.fleet_type != ePlayerBase.home_world) and (defeat==1) and (dropping= endline=0; if (obj_controller.und_gene_vaults=0){ - obj_controller.gene_seed=0; - for (var w=0;w0){ - obj_ini.slave_batch_num[w]=0; - obj_ini.slave_batch_eta[w]=0; - } - } + //all Gene Pod Incubators and gene seed are lost + destroy_all_gene_slaves(false); } if (obj_controller.und_gene_vaults>0) then obj_controller.gene_seed-=floor(obj_controller.gene_seed/10); } @@ -789,6 +800,8 @@ if (defeat=1){ } +gene_slaves = []; + instance_deactivate_object(obj_star); instance_deactivate_object(obj_ground_mission); diff --git a/objects/obj_ncombat/Alarm_7.gml b/objects/obj_ncombat/Alarm_7.gml index 822bf8188..8a0c84fee 100644 --- a/objects/obj_ncombat/Alarm_7.gml +++ b/objects/obj_ncombat/Alarm_7.gml @@ -486,25 +486,28 @@ try { if (enemy=1) and (on_ship=true) and (defeat=0){ - var diceh;diceh=floor(random(100))+1; + var diceh=floor(random(100))+1; if(scr_has_disadv("Shitty Luck")) then diceh-=15; if (diceh<=15){ - var ship,ship_hp,i;i=-1; - repeat(51){i+=1; - ship[i]=obj_ini.ship[i];ship_hp[i]=obj_ini.ship_hp[i]; - if (i=battle_id){obj_ini.ship_hp[i]=-50;scr_recent("ship_destroyed",obj_ini.ship[i],i);} + var ship,ship_hp,i=-1; + for (var i=0;i0){ - var shiyp,shi,d,loc; - shiyp=0;shi=0;d=0; - - with(obj_p_fleet){if (action!="") then instance_deactivate_object(id);} - shiyp=instance_nearest(battle_object.x,battle_object.y,obj_p_fleet); - if (shi=0) and (shiyp.capital_number>0) then shi=shiyp.capital_num[1]; - if (shi=0) and (shiyp.frigate_number>0) then shi=shiyp.frigate_num[1]; - if (shi=0) and (shiyp.escort_number>0) then shi=shiyp.escort_num[1]; - loc=obj_ini.ship[shi];instance_activate_object(obj_p_fleet); + var shi=0,loc=""; + + var shiyp=instance_nearest(battle_object.x,battle_object.y,obj_p_fleet); + if (shiyp.x == battle_object.x && shiyp.y ==battle_object.y){ + shi = fleet_full_ship_array(shiyp)[0]; + loc = obj_ini.ship[shi]; + } if (hulk_treasure=1){// Requisition - var reqi;reqi=round(random_range(30,60)+1)*10; + var reqi=round(random_range(30,60)+1)*10; obj_controller.requisition+=reqi; var pop;pop=instance_create(0,0,obj_popup); @@ -622,14 +622,14 @@ try { pop.title="Space Hulk: Resources"; pop.text="Your battle brothers have located several luxury goods and coginators within the Space Hulk. They are salvaged and returned to the ship, granting "+string(reqi)+" Requisition."; }else if (hulk_treasure=2){// Artifact - scr_add_artifact("random","random",4,loc,shi+500); - var i,last_artifact;i=0;last_artifact=0; - repeat(100){ - if (last_artifact=0){i+=1;if (obj_ini.artifact[i]="") then last_artifact=i-1;}} - var pop;pop=instance_create(0,0,obj_popup); + //TODO this will eeroniously put artifacts in the wrong place but will resolve crashes + var last_artifact = scr_add_artifact("random","random",4,loc,shi+500); + var i=0; + + var pop=instance_create(0,0,obj_popup); pop.image="space_hulk_done"; pop.title="Space Hulk: Artifact"; - pop.text="An Artifact has been retrieved from the Space Hulk and stowed upon "+string(loc)+". It appears to be a "+string(obj_ini.artifact[last_artifact])+" but should be brought home and identified posthaste."; + pop.text=$"An Artifact has been retrieved from the Space Hulk and stowed upon {loc}. It appears to be a {obj_ini.artifact[last_artifact]} but should be brought home and identified posthaste."; scr_event_log("","Artifact recovered from the Space Hulk."); }else if (hulk_treasure=3){// STC scr_add_stc_fragment();// STC here diff --git a/objects/obj_ncombat/Create_0.gml b/objects/obj_ncombat/Create_0.gml index 57cedd8c9..9ee793a02 100644 --- a/objects/obj_ncombat/Create_0.gml +++ b/objects/obj_ncombat/Create_0.gml @@ -1,6 +1,6 @@ if (instance_number(obj_ncombat)>1) then instance_destroy(); -set_zoom_to_defualt(); +set_zoom_to_default(); var co,i;co=-1; repeat(15){co+=1;i=-1; repeat(401){i+=1; @@ -21,6 +21,8 @@ if (nope!=1){audio_sound_gain(snd_battle,0.25*obj_controller.master_volume*obj_c //limit on the size of the players forces allowed man_size_limit = 0; +man_limit_reached = false; +man_size_count = 0; fack=0; cd=0; owner = eFACTION.Player; @@ -32,6 +34,9 @@ on_ship=false; alpha_strike=0; Warlord = 0; total_battle_exp_gain=0; +end_alive_units = []; +average_battle_exp_gain=0; +upgraded_librarians=[]; view_x=obj_controller.x;view_y=obj_controller.y; obj_controller.x=0;obj_controller.y=0; @@ -230,22 +235,22 @@ time=floor(random(24))+1; terrain=""; weather=""; -ambushers=0;if (string_count("Ambushers",obj_ini.strin)>0) then ambushers=1; -bolter_drilling=0;if (string_count("Bolter",obj_ini.strin)>0) then bolter_drilling=1; -enemy_eldar=0;if (string_count("Enemy: Eldar",obj_ini.strin)>0) then enemy_eldar=1; -enemy_fallen=0;if (string_count("Enemy: Fallen",obj_ini.strin)>0) then enemy_fallen=1; -enemy_orks=0;if (string_count("Enemy: Orks",obj_ini.strin)>0) then enemy_orks=1; -enemy_tau=0;if (string_count("Enemy: Tau",obj_ini.strin)>0) then enemy_tau=1; -enemy_tyranids=0;if (string_count("Enemy: Tyranids",obj_ini.strin)>0) then enemy_tyranids=1; -enemy_necrons=0;if (string_count("Enemy: Necrons",obj_ini.strin)>0) then enemy_necrons=1; -lightning=0;if (string_count("Lightning",obj_ini.strin)>0) then lightning=1; -siege=0;if (string_count("Siege",obj_ini.strin)>0) then siege=1; -slow=0;if (string_count("Purposeful",obj_ini.strin)>0) then slow=1; -melee=0;if (string_count("Melee Enthus",obj_ini.strin)>0) then melee=1; +ambushers=0;if (scr_has_adv("Ambushers")) then ambushers=1; +bolter_drilling=0;if (scr_has_adv("Bolter Drilling")) then bolter_drilling=1; +enemy_eldar=0;if (scr_has_adv("Enemy: Eldar")) then enemy_eldar=1; +enemy_fallen=0;if (scr_has_adv("Enemy: Fallen")) then enemy_fallen=1; +enemy_orks=0;if (scr_has_adv("Enemy: Orks")) then enemy_orks=1; +enemy_tau=0;if (scr_has_adv("Enemy: Tau")) then enemy_tau=1; +enemy_tyranids=0;if (scr_has_adv("Enemy: Tyranids")) then enemy_tyranids=1; +enemy_necrons=0;if (scr_has_adv("Enemy: Necrons")) then enemy_necrons=1; +lightning=0;if (scr_has_adv("Lightning Warriors")) then lightning=1; +siege=0;if (scr_has_adv("Siege Masters")) then siege=1; +slow=0;if (scr_has_adv("Devastator Doctrine")) then slow=1; +melee=0;if (scr_has_adv("Assault Doctrine")) then melee=1; // -black_rage=0;if (string_count("Black Rage",obj_ini.strin2)>0){black_rage=1;red_thirst=1;} -shitty_luck=0;if (string_count("Shitty",obj_ini.strin2)>0) then shitty_luck=1; -warp_touched=0;if (string_count("Warp Touched",obj_ini.strin2)>0) then warp_touched=1; +black_rage=0;if (scr_has_disadv("Black Rage")){black_rage=1;red_thirst=1;} +shitty_luck=0;if (scr_has_disadv("Shitty Luck")) then shitty_luck=1; +warp_touched=0;if (scr_has_disadv("Warp Touched")) then warp_touched=1; lyman=obj_ini.lyman;// drop pod penalties diff --git a/objects/obj_ncombat/KeyPress_13.gml b/objects/obj_ncombat/KeyPress_13.gml index 6c80120e0..5b81e982d 100644 --- a/objects/obj_ncombat/KeyPress_13.gml +++ b/objects/obj_ncombat/KeyPress_13.gml @@ -51,6 +51,7 @@ if ((started=2) or (started=4)){ obj_pnunit.alarm[4]=2; obj_pnunit.alarm[5]=3; } + total_battle_exp_gain = threat * 50; if (instance_exists(obj_enunit)){obj_enunit.alarm[1]=1;} instance_activate_object(obj_star); instance_activate_object(obj_event_log); diff --git a/objects/obj_p_assra/Alarm_0.gml b/objects/obj_p_assra/Alarm_0.gml index 23ae34189..409ca9048 100644 --- a/objects/obj_p_assra/Alarm_0.gml +++ b/objects/obj_p_assra/Alarm_0.gml @@ -1,10 +1,10 @@ var co=0,i=0,o=0, unit; -for (o=1;o<=20;o++){ +for (o=0;o=0) and (instance_exists(target)) and (in o=firstest-1;difficulty=50;challenge=0;roll1=0;roll2=0;attack=0;arp=0;wep="";hits=0;hurt=0;damaged_ship=0; co=0;i=0;ac=0;dr=1; - repeat(boarders){ - o+=1; + for (var o=0;o=0) and (instance_exists(target)) and (in if (array_contains(["Chainfist","Meltagun","Lascutter","Boarding Shield"], unit.weapon_one())) then difficulty+=3; if (array_contains(["Chainfist","Meltagun","Lascutter","Boarding Shield"], unit.weapon_two())) then difficulty+=3; - if (array_contains(obj_ini.adv, "Boarders")) then difficulty+=7; - if (array_contains(obj_ini.adv, "Melee Enthusiasts")) then difficulty+=3; - if (array_contains(obj_ini.adv, "Lightning Warriors")) then difficulty+=3; + if (scr_has_adv("Boarders")) then difficulty+=7; + if (scr_has_adv("Assault Doctrine")) then difficulty+=3; + if (scr_has_adv("Lightning Warriors")) then difficulty+=3; // Penalties if (unit.weapon_one()=="")then difficulty-=10; diff --git a/objects/obj_p_fleet/Alarm_1.gml b/objects/obj_p_fleet/Alarm_1.gml index 83e96d0e9..a3e972f9d 100644 --- a/objects/obj_p_fleet/Alarm_1.gml +++ b/objects/obj_p_fleet/Alarm_1.gml @@ -3,7 +3,7 @@ try_and_report_loop("player alarm 1",function(){ acted=0; - if (action="lost"){ + if (action=="Lost"){ set_fleet_location("Lost"); exit; @@ -118,7 +118,9 @@ try_and_report_loop("player alarm 1",function(){ instance_activate_object(obj_star);// Kind of half-ass band-aiding that bug, might need to remove this later; this might cause problems later - with(obj_star){if (p_type[1]!="Craftworld") then instance_deactivate_object(id);} + with(obj_star){ + if (p_type[1]!="Craftworld") then instance_deactivate_object(id); + } var steh;steh=instance_nearest(x,y,obj_star); if (instance_exists(steh)) and (steh!=0){ diff --git a/objects/obj_p_fleet/Alarm_5.gml b/objects/obj_p_fleet/Alarm_5.gml index ac8f27d63..92f5e1126 100644 --- a/objects/obj_p_fleet/Alarm_5.gml +++ b/objects/obj_p_fleet/Alarm_5.gml @@ -5,8 +5,11 @@ var i, minhp, maxhp; if (capital_number>0){ i=0;minhp=0;maxhp=0; - repeat(8){i+=1; - if (capital[i]!="") and (capital_num[i]>0){minhp+=obj_ini.ship_hp[i];maxhp+=obj_ini.ship_maxhp[i];} + for (var i=0;i-1){ + minhp+=obj_ini.ship_hp[i]; + maxhp+=obj_ini.ship_maxhp[i]; + } } if (maxhp>0) then capital_health=round((minhp/maxhp)*100); else capital_health=0; @@ -14,8 +17,11 @@ if (capital_number>0){ if (frigate_number>0){ i=0;minhp=0;maxhp=0; - repeat(30){i+=1; - if (frigate[i]!="") and (frigate_num[i]>0){minhp+=obj_ini.ship_hp[i];maxhp+=obj_ini.ship_maxhp[i];} + for (var i=0;i-1){ + minhp+=obj_ini.ship_hp[i]; + maxhp+=obj_ini.ship_maxhp[i]; + } } if (maxhp>0) then frigate_health=round((minhp/maxhp)*100); else frigate_health=0; @@ -23,8 +29,11 @@ if (frigate_number>0){ if (escort_number>0){ i=0;minhp=0;maxhp=0; - repeat(30){i+=1; - if (escort[i]!="") and (escort_num[i]>0){minhp+=obj_ini.ship_hp[i];maxhp+=obj_ini.ship_maxhp[i];} + for (var i=0;i-1){ + minhp+=obj_ini.ship_hp[i]; + maxhp+=obj_ini.ship_maxhp[i]; + } } if (maxhp>0) then escort_health=round((minhp/maxhp)*100); else escort_health=0; diff --git a/objects/obj_p_fleet/Alarm_6.gml b/objects/obj_p_fleet/Alarm_6.gml index 295783563..a578e46c9 100644 --- a/objects/obj_p_fleet/Alarm_6.gml +++ b/objects/obj_p_fleet/Alarm_6.gml @@ -1,107 +1,11 @@ -// show_message("Post-combat cleanup at obj_p_fleet.alarm[1]"); - -/*with(obj_ini){ - scr_dead_marines(2); -} - -with(obj_ini){scr_ini_ship_cleanup();}*/ - - -with(obj_fleet){ - repeat(2){scr_dead_marines(2);} -} - - - -with(obj_ini){scr_ini_ship_cleanup();} - - - -var i,t,yep; - -i=0;repeat(8){i+=1;t=0;yep=0; - if (capital[i]!="") and (capital_uid[i]>0){ - repeat(40){t+=1; - if (obj_ini.ship_uid[t]=capital_uid[i]){yep=t;capital_num[i]=t;}// That ship is to stay - } - if (yep=0){capital[i]="";capital_num[i]=0;capital_sel[i]=0;capital_uid[i]=0;capital_number-=1;}// That ship no longer exists - } -} - -i=0;repeat(30){i+=1;t=0;yep=0; - if (frigate[i]!="") and (frigate_uid[i]>0){ - repeat(40){t+=1; - if (obj_ini.ship_uid[t]=frigate_uid[i]){yep=t;frigate_num[i]=t;}// That ship is to stay - } - if (yep=0){frigate[i]="";frigate_num[i]=0;frigate_sel[i]=0;frigate_uid[i]=0;frigate_number-=1;}// That ship no longer exists - } +with(obj_ini){ + scr_ini_ship_cleanup(); } -i=0;repeat(30){i+=1;t=0;yep=0; - if (escort[i]!="") and (escort_uid[i]>0){ - repeat(40){t+=1; - if (obj_ini.ship_uid[t]=escort_uid[i]){yep=t;escort_num[i]=t;}// That ship is to stay - } - if (yep=0){escort[i]="";escort_num[i]=0;escort_sel[i]=0;escort_uid[i]=0;escort_number-=1;}// That ship no longer exists - } -} - - - - -if (capital_number<0) then capital_number=0; -if (frigate_number<0) then frigate_number=0; -if (escort_number<0) then escort_number=0; - - -// } - - - -repeat(5){ - -/*repeat(5){ - i=0;repeat(8){i+=1;if (capital[i]!="") and (obj_ini.ship[capital_num[i]]=""){capital[i]="";capital_num[i]=0;capital_sel[i]=0;}} - i=0;repeat(30){i+=1;if (frigate[i]!="") and (obj_ini.ship[frigate_num[i]]=""){frigate[i]="";frigate_num[i]=0;frigate_sel[i]=0;}} - i=0;repeat(30){i+=1;if (escort[i]!="") and (obj_ini.ship[escort_num[i]]=""){escort[i]="";escort_num[i]=0;escort_sel[i]=0;}} - - */ - - - - - - - - - - - i=0;repeat(8){i+=1; - if (capital[i]="") and (capital[i+1]!=""){ - capital[i]=capital[i+1];capital_num[i]=capital_num[i+1];capital_sel[i]=capital_sel[i+1];capital_uid[i]=capital_uid[i+1]; - capital[i+1]="";capital_num[i+1]=0;capital_sel[i+1]=0;capital_uid[i+1]=0; - } - } - i=0;repeat(30){i+=1; - if (frigate[i]="") and (frigate[i+1]!=""){ - frigate[i]=frigate[i+1];frigate_num[i]=frigate_num[i+1];frigate_sel[i]=frigate_sel[i+1];frigate_uid[i]=frigate_uid[i+1]; - frigate[i+1]="";frigate_num[i+1]=0;frigate_sel[i+1]=0;frigate_uid[i+1]=0; - } - if (escort[i]="") and (escort[i+1]!=""){ - escort[i]=escort[i+1];escort_num[i]=escort_num[i+1];escort_sel[i]=escort_sel[i+1];escort_uid[i]=escort_uid[i+1]; - escort[i+1]="";escort_num[i+1]=0;escort_sel[i+1]=0;escort_uid[i+1]=0; - } - } - -} - - - -if (capital_uid[1]=0) and (frigate_uid[1]=0) and (escort_uid[1]=0) then instance_destroy(); +if (player_fleet_ship_count() == 0) then instance_destroy(); -// if ((capital_number+frigate_number+escort_number)<=0) then instance_destroy(); /* */ diff --git a/objects/obj_p_fleet/Collision_obj_p_fleet.gml b/objects/obj_p_fleet/Collision_obj_p_fleet.gml index a0b5d47ca..e997ef4a5 100644 --- a/objects/obj_p_fleet/Collision_obj_p_fleet.gml +++ b/objects/obj_p_fleet/Collision_obj_p_fleet.gml @@ -4,52 +4,8 @@ if (other.x=self.x) and (other.y=self.y) and (action="") and (other.action="") and (other.owner = eFACTION.Player){ if (other.id>self.id){ - - var w, new_fleet, cap, fri, esc, tempp; - - cap=other.capital_number; - fri=other.frigate_number; - esc=other.escort_number; - - - w=0; - repeat(capital_number){ - cap+=1;w+=1; - other.capital_num[cap]=capital_num[w]; - other.capital_uid[cap]=capital_uid[w]; - other.capital[cap]=capital[w]; - other.capital_number+=1; - } - - w=0; - repeat(frigate_number){ - fri+=1;w+=1; - other.frigate_num[fri]=frigate_num[w]; - other.frigate_uid[fri]=frigate_uid[w]; - other.frigate[fri]=frigate[w]; - other.frigate_number+=1; - } - - w=0; - repeat(escort_number){ - esc+=1;w+=1; - other.escort_num[esc]=escort_num[w]; - other.escort_uid[esc]=escort_uid[w]; - other.escort[esc]=escort[w]; - other.escort_number+=1; - } - - other.alarm[7]=1; - - if (instance_exists(obj_fleet_select)){ - if (obj_fleet_select.x=self.x) and (obj_fleet_select.y=self.y){ - with(obj_fleet_select){instance_destroy();} - other.alarm[3]=1; - } - } - - - instance_destroy(); + merge_player_fleets(other.id, self.id); + } } diff --git a/objects/obj_p_fleet/Create_0.gml b/objects/obj_p_fleet/Create_0.gml index 6e48904d2..a58d024ec 100644 --- a/objects/obj_p_fleet/Create_0.gml +++ b/objects/obj_p_fleet/Create_0.gml @@ -11,28 +11,30 @@ ii_check=choose(8,9,10,11,12); var wop=instance_nearest(x,y,obj_star); if (instance_exists(wop)) and (y>0) and (x>0){ if (point_distance(x,y,wop.x,wop.y)<=40){ - orbiting=wop;wop.present_fleet[1]+=1; + orbiting=wop; + wop.present_fleet[1]+=1; } } - -image_xscale=1.25;image_yscale=1.25; +point_breakdown = single_loc_point_data(); +image_xscale=1.25; +image_yscale=1.25; var i=-1; -capital = array_create(50, ""); -capital_num = array_create(50, 0); -capital_sel = array_create(50, 1); -capital_uid = array_create(50, 0); - -frigate = array_create(100, ""); -frigate_num = array_create(100, 0); -frigate_sel = array_create(100, 1); -frigate_uid = array_create(100, 0); - -escort = array_create(100, ""); -escort_num = array_create(100, 0); -escort_sel = array_create(100, 1); -escort_uid = array_create(100, 0); +capital = []; +capital_num = []; +capital_sel = []; +capital_uid = []; + +frigate = []; +frigate_num = []; +frigate_sel = []; +frigate_uid = []; + +escort = []; +escort_num = []; +escort_sel = []; +escort_uid = []; image_speed=0; diff --git a/objects/obj_p_fleet/Draw_0.gml b/objects/obj_p_fleet/Draw_0.gml index 0d4f1ebc0..067bee529 100644 --- a/objects/obj_p_fleet/Draw_0.gml +++ b/objects/obj_p_fleet/Draw_0.gml @@ -93,9 +93,9 @@ if (action!=""){ if (within=1) or (selected>0){ var ppp; if (owner = eFACTION.Player) then ppp=global.chapter_name; - if (capital_number=1) and (frigate_number=0) and (escort_number=0) then ppp=capital[1]; - if (capital_number=0) and (frigate_number=1) and (escort_number=0) then ppp=frigate[1]; - if (capital_number=0) and (frigate_number=0) and (escort_number=1) then ppp=escort[1]; + if (capital_number=1) and (frigate_number=0) and (escort_number=0) then ppp=capital[0]; + if (capital_number=0) and (frigate_number=1) and (escort_number=0) then ppp=frigate[0]; + if (capital_number=0) and (frigate_number=0) and (escort_number=1) then ppp=escort[0]; // ppp=acted; // draw_set_color(38144); @@ -106,7 +106,7 @@ if (within=1) or (selected>0){ draw_circle(x+(coords[0]*scale),y+(coords[1]*scale),12*scale,0); } else { - draw_set_color(#3385ff); + draw_set_color(global.star_name_colors[eFACTION.Player]); draw_set_alpha(0.5); draw_circle(x+(coords[0]*scale),y+(coords[1]*scale),12*scale,0); draw_set_alpha(1); diff --git a/objects/obj_p_fleet/Step_0.gml b/objects/obj_p_fleet/Step_0.gml index 0afa70aef..c88b0ea47 100644 --- a/objects/obj_p_fleet/Step_0.gml +++ b/objects/obj_p_fleet/Step_0.gml @@ -1,5 +1,5 @@ ii_check-=1; - +if (action=="Lost") then exit; if (action!="") and (orbiting!=0){ orbiting = instance_nearest(x,y,obj_star) orbiting.present_fleet[1]-=1; @@ -13,7 +13,7 @@ if (ii_check=0){set_player_fleet_image()} if (global.load>0) and (sprite_index!=spr_fleet_tiny) then sprite_index=spr_fleet_tiny; if (fix>-1) then fix-=1; -if (fix=0) and (action=""){ +if (fix=0) and (action==""){ set_fleet_location(instance_nearest(x,y,obj_star).name); } diff --git a/objects/obj_p_ship/Alarm_0.gml b/objects/obj_p_ship/Alarm_0.gml index 126a2c5fd..d84ce2c12 100644 --- a/objects/obj_p_ship/Alarm_0.gml +++ b/objects/obj_p_ship/Alarm_0.gml @@ -1,119 +1,155 @@ -action=""; -direction=0; - - -cooldown1=0; -cooldown2=0; -cooldown3=0; -cooldown4=0; -cooldown5=0; - - -name=obj_ini.ship[ship_id]; -class=obj_ini.ship_class[ship_id]; -hp=obj_ini.ship_hp[ship_id]*1; -maxhp=obj_ini.ship_hp[ship_id]*1; -conditions=obj_ini.ship_conditions[ship_id]; -shields=obj_ini.ship_shields[ship_id]*100; -maxshields=shields; -armour_front=obj_ini.ship_front_armour[ship_id]; -armour_other=obj_ini.ship_other_armour[ship_id]; -weapons=obj_ini.ship_weapons[ship_id];turrets=0; -ship_colour=obj_controller.body_colour_replace; - -weapon[1]=obj_ini.ship_wep[ship_id,1];weapon_facing[1]="";weapon_cooldown[1]=0; -weapon_hp[1]=hp/4;weapon_dam[1]=0;weapon_ammo[1]=999;weapon_range[1]=0;weapon_minrange[1]=0; - -weapon[2]=obj_ini.ship_wep[ship_id,2];weapon_facing[2]="";weapon_cooldown[2]=0; -weapon_hp[2]=hp/4;weapon_dam[2]=0;weapon_ammo[2]=999;weapon_range[2]=0;weapon_minrange[2]=0; - -weapon[3]=obj_ini.ship_wep[ship_id,3];weapon_facing[3]="";weapon_cooldown[3]=0; -weapon_hp[3]=hp/4;weapon_dam[3]=0;weapon_ammo[3]=999;weapon_range[3]=0;weapon_minrange[3]=0; - -weapon[4]=obj_ini.ship_wep[ship_id,4];weapon_facing[4]="";weapon_cooldown[4]=0; -weapon_hp[4]=hp/4;weapon_dam[4]=0;weapon_ammo[4]=999;weapon_range[4]=0;weapon_minrange[4]=0; - -weapon[5]=obj_ini.ship_wep[ship_id,5];weapon_facing[5]="";weapon_cooldown[5]=0; -weapon_hp[5]=hp/4;weapon_dam[5]=0;weapon_ammo[5]=999;weapon_range[5]=0;weapon_minrange[5]=0; - - +action=""; + direction=0; + + + cooldown1=0; + cooldown2=0; + cooldown3=0; + cooldown4=0; + cooldown5=0; + + + name=obj_ini.ship[ship_id]; + class=obj_ini.ship_class[ship_id]; + hp=obj_ini.ship_hp[ship_id]*1; + maxhp=obj_ini.ship_hp[ship_id]*1; + conditions=obj_ini.ship_conditions[ship_id]; + shields=obj_ini.ship_shields[ship_id]*100; + maxshields=shields; + armour_front=obj_ini.ship_front_armour[ship_id]; + armour_other=obj_ini.ship_other_armour[ship_id]; + weapons=obj_ini.ship_weapons[ship_id]; + turrets=0; + ship_colour=obj_controller.body_colour_replace; + weapon = obj_ini.ship_wep[ship_id] + + weapon_facing[1]=""; + weapon_cooldown[1]=0; + weapon_hp[1]=hp/4; + weapon_dam[1]=0; + weapon_ammo[1]=999; + weapon_range[1]=0; + weapon_minrange[1]=0; + weapon_facing[2]=""; + weapon_cooldown[2]=0; + weapon_hp[2]=hp/4; + weapon_dam[2]=0; + weapon_ammo[2]=999; + weapon_range[2]=0; + weapon_minrange[2]=0; + + weapon_facing[3]=""; + weapon_cooldown[3]=0; + weapon_hp[3]=hp/4; + weapon_dam[3]=0; + weapon_ammo[3]=999; + weapon_range[3]=0; + weapon_minrange[3]=0; + + weapon_facing[4]=""; + weapon_cooldown[4]=0; + weapon_hp[4]=hp/4; + weapon_dam[4]=0; + weapon_ammo[4]=999; + weapon_range[4]=0; + weapon_minrange[4]=0; + + weapon_facing[5]=""; + weapon_cooldown[5]=0; + weapon_hp[5]=hp/4; + weapon_dam[5]=0; + weapon_ammo[5]=999; + weapon_range[5]=0; + weapon_minrange[5]=0; + + + + + + if (class="Battle Barge"){ + turrets=3; + weapons=5; + shield_size=3; + sprite_index=spr_ship_bb; + weapon_facing[1]="left";weapon_dam[1]=15;weapon_range[1]=450;weapon_cooldown[1]=30; + weapon_facing[2]="right";weapon_dam[2]=15;weapon_range[2]=450;weapon_cooldown[2]=30; + weapon_facing[3]="special";weapon_cooldown[3]=90;weapon_ammo[3]=3;weapon_range[3]=9999; + weapon_facing[4]="front";weapon_dam[4]=12;weapon_range[4]=1000;weapon_cooldown[4]=120;// volley several + weapon_facing[5]="most";weapon_dam[5]=16;weapon_range[5]=300;weapon_cooldown[5]=30; + } + if (class="Slaughtersong"){turrets=3;weapons=5;shield_size=3;sprite_index=spr_ship_song; + weapon_facing[1]="most";weapon_dam[1]=16;weapon_range[1]=550;weapon_cooldown[1]=26; + weapon_facing[2]="most";weapon_dam[2]=16;weapon_range[2]=550;weapon_cooldown[2]=26; + weapon_facing[3]="most";weapon_dam[3]=16;weapon_range[3]=550;weapon_cooldown[3]=26; + weapon_facing[4]="front";weapon_dam[4]=32;weapon_range[4]=1000;weapon_cooldown[4]=90; + } -if (class="Battle Barge"){turrets=3;weapons=5;shield_size=3;sprite_index=spr_ship_bb; - weapon_facing[1]="left";weapon_dam[1]=15;weapon_range[1]=450;weapon_cooldown[1]=30; - weapon_facing[2]="right";weapon_dam[2]=15;weapon_range[2]=450;weapon_cooldown[2]=30; - weapon_facing[3]="special";weapon_cooldown[3]=90;weapon_ammo[3]=3;weapon_range[3]=9999; - weapon_facing[4]="front";weapon_dam[4]=12;weapon_range[4]=1000;weapon_cooldown[4]=120;// volley several - weapon_facing[5]="most";weapon_dam[5]=16;weapon_range[5]=300;weapon_cooldown[5]=30; -} -if (class="Slaughtersong"){turrets=3;weapons=5;shield_size=3;sprite_index=spr_ship_song; +if (class="Gloriana"){turrets=3;weapons=5;shield_size=3;sprite_index=spr_ship_song; weapon_facing[1]="most";weapon_dam[1]=16;weapon_range[1]=550;weapon_cooldown[1]=26; weapon_facing[2]="most";weapon_dam[2]=16;weapon_range[2]=550;weapon_cooldown[2]=26; weapon_facing[3]="most";weapon_dam[3]=16;weapon_range[3]=550;weapon_cooldown[3]=26; weapon_facing[4]="front";weapon_dam[4]=32;weapon_range[4]=1000;weapon_cooldown[4]=90; } + if (class="Strike Cruiser"){turrets=1;weapons=4;shield_size=1;sprite_index=spr_ship_stri; + weapon_facing[1]="left";weapon_dam[1]=8;weapon_range[1]=300;weapon_cooldown[1]=30; + weapon_facing[2]="right";weapon_dam[2]=8;weapon_range[2]=300;weapon_cooldown[2]=30; + weapon_facing[3]="special";weapon_cooldown[3]=90;weapon_ammo[3]=3;weapon_range[3]=9999; + weapon_facing[4]="most";weapon_dam[4]=12;weapon_range[4]=300;weapon_cooldown[4]=30; + } + if (class="Hunter"){turrets=1;weapons=2;shield_size=1;sprite_index=spr_ship_hunt; + weapon_facing[1]="front";weapon_dam[1]=8;weapon_range[1]=450;weapon_cooldown[1]=60; + weapon_facing[2]="most";weapon_dam[2]=8;weapon_range[2]=300;weapon_cooldown[2]=60; + } -if (class="Strike Cruiser"){turrets=1;weapons=4;shield_size=1;sprite_index=spr_ship_stri; - weapon_facing[1]="left";weapon_dam[1]=8;weapon_range[1]=300;weapon_cooldown[1]=30; - weapon_facing[2]="right";weapon_dam[2]=8;weapon_range[2]=300;weapon_cooldown[2]=30; - weapon_facing[3]="special";weapon_cooldown[3]=90;weapon_ammo[3]=3;weapon_range[3]=9999; - weapon_facing[4]="most";weapon_dam[4]=12;weapon_range[4]=300;weapon_cooldown[4]=30; -} - -if (class="Hunter"){turrets=1;weapons=2;shield_size=1;sprite_index=spr_ship_hunt; - weapon_facing[1]="front";weapon_dam[1]=8;weapon_range[1]=450;weapon_cooldown[1]=60; - weapon_facing[2]="most";weapon_dam[2]=8;weapon_range[2]=300;weapon_cooldown[2]=60; -} - -if (class="Gladius"){turrets=1;weapons=2;shield_size=1;sprite_index=spr_ship_glad; - weapon_facing[1]="most";weapon_dam[1]=8;weapon_range[1]=300;weapon_cooldown[1]=30; -} - - -// STC Bonuses -if (obj_controller.stc_bonus[5]=5){armour_front=round(armour_front*1.1);armour_other=round(armour_other*1.1);} -if (obj_controller.stc_bonus[6]=2){armour_front=round(armour_front*1.1);armour_other=round(armour_other*1.1);} - + if (class="Gladius"){turrets=1;weapons=2;shield_size=1;sprite_index=spr_ship_glad; + weapon_facing[1]="most";weapon_dam[1]=8;weapon_range[1]=300;weapon_cooldown[1]=30; + } -var i=0, unit, b=0; -for (var co=0;co<=10;co++){ - for (i=1;i<500;i++){ - if (obj_ini.name[co][i]=="") then continue; - unit=fetch_unit([co,i]); - if (unit.ship_location==ship_id){ - if (unit.is_boarder && unit.hp()>(unit.max_health()/10)){ - b+=1; - board_co[b]=co; - board_id[b]=i; - board_location[b]=0; - boarders+=1; - } - // Loc 0: on origin ship - // Loc 1: in transit - // Loc >1: (instance_id), on enemy vessel - if (co==0 && master_present==0 && i<100){ - if (unit.role()=="Chapter Master") and (unit.ship_location==ship_id){ - master_present=1; - obj_fleet.control=1; + // STC Bonuses + if (obj_controller.stc_bonus[5]=5){armour_front=round(armour_front*1.1);armour_other=round(armour_other*1.1);} + if (obj_controller.stc_bonus[6]=2){armour_front=round(armour_front*1.1);armour_other=round(armour_other*1.1);} + + + var i=0, unit, b=0; + + for (var co=0;co<=obj_ini.companies;co++){ + for (i=0;i(unit.max_health()/10)){ + array_push(board_co, co); + array_push(board_id, i); + array_push(board_location, 0); + array_push(board_raft, 0); + boarders+=1; + } + // Loc 0: on origin ship + // Loc 1: in transit + // Loc >1: (instance_id), on enemy vessel + if (co==0 && master_present==0 && i<100){ + if (unit.role()=="Chapter Master" && unit.ship_location==ship_id){ + master_present=1; + obj_fleet.control=1; + } } - } + } } } -} - -if (boarders>0){ - if (obj_controller.command_set[25]=1) then board_capital=true; - if (obj_controller.command_set[26]=1) then board_frigate=true; -} - -if (hp<=0){ - x=-1000;y=room_height/2; - if (ship_id=0) then instance_destroy(); -} + if (boarders>0){ + if (obj_controller.command_set[25]=1) then board_capital=true; + if (obj_controller.command_set[26]=1) then board_frigate=true; + } + if (hp<=0){ + x=-1000; + y=room_height/2; + if (ship_id=0) then instance_destroy(); + } \ No newline at end of file diff --git a/objects/obj_p_ship/Alarm_3.gml b/objects/obj_p_ship/Alarm_3.gml index c984305a3..eeee677d2 100644 --- a/objects/obj_p_ship/Alarm_3.gml +++ b/objects/obj_p_ship/Alarm_3.gml @@ -8,7 +8,8 @@ if (hp0){obj_ini.slave_batch_num[w]=0;obj_ini.slave_batch_eta[w]=0;}} + obj_controller.gene_seed=0; + destroy_all_gene_slaves(false); } if (obj_controller.und_gene_vaults>0){ obj_controller.gene_seed-=floor(obj_controller.gene_seed/10); diff --git a/objects/obj_p_ship/Create_0.gml b/objects/obj_p_ship/Create_0.gml index 2a92b80f8..16db03170 100644 --- a/objects/obj_p_ship/Create_0.gml +++ b/objects/obj_p_ship/Create_0.gml @@ -17,19 +17,16 @@ action_dir=0; action_fac=0; direction=0; target=-50; -if (instance_exists(obj_en_ship)){target=instance_nearest(x,y,obj_en_ship);} +if (instance_exists(obj_en_ship)){ + target=instance_nearest(x,y,obj_en_ship); +} target_l=0; target_r=0; target_x=0; target_y=0; -cooldown[0]=0; -cooldown[1]=0; -cooldown[2]=0; -cooldown[3]=0; -cooldown[4]=0; -cooldown[5]=0; +cooldown = array_create(6, 0); turret_cool=0; shield_size=0; @@ -50,16 +47,20 @@ turrets=0; fighters=0; bombers=0; thunderhawks=0; -boarders=0;board_cooldown=0; - -var i;i=-1; -repeat(8){i+=1; - weapon[i]="";weapon_facing[i]="";weapon_cooldown[i]=0;weapon_hp[i]=0;weapon_dam[i]=0;weapon_ammo[i]=999;weapon_range[i]=0;weapon_minrange[i]=0; -} +boarders=0; +board_cooldown=0; -i=-1; -repeat(2001){i+=1; - board_co[i]=0;board_id[i]=0;board_location[i]=0;board_raft[i]=0; -} +weapon = array_create(8, ""); +weapon_facing=array_create(8, ""); +weapon_cooldown=array_create(8, 0); +weapon_hp=array_create(8, 0); +weapon_dam=array_create(8, 0); +weapon_ammo=array_create(8, 0); +weapon_range=array_create(8, 0); +weapon_minrange=array_create(8, 0); -action_set_alarm(1, 0); +board_co=[]; +board_id=[]; +board_location=[]; +board_raft=[]; +//action_set_alarm(1, 0); diff --git a/objects/obj_p_ship/Draw_0.gml b/objects/obj_p_ship/Draw_0.gml index 121afd5ad..0a961c5e5 100644 --- a/objects/obj_p_ship/Draw_0.gml +++ b/objects/obj_p_ship/Draw_0.gml @@ -45,7 +45,7 @@ draw_set_halign(fa_center); if (boarders>0){ // draw_sprite(spr_force_icon,0,x-16,y+12); - scr_image("force",0,x-16-32,y+12-32,64,64); + scr_image("ui/force",1,x-16-32,y+12-32,64,64); draw_set_color(0); draw_text(x-16,y+12,string_hash_to_newline(string(boarders))); diff --git a/objects/obj_p_ship/Step_0.gml b/objects/obj_p_ship/Step_0.gml index 935c038ac..e48c62af0 100644 --- a/objects/obj_p_ship/Step_0.gml +++ b/objects/obj_p_ship/Step_0.gml @@ -27,8 +27,8 @@ if (instance_exists(obj_en_ship)){ } if (hp<=0) and (x>-5000){ - // obj_fleet.fighting[self.ship_id]=-5; - if (class="Battle Barge") or (class="Slaughtersong"){ + + if (class="Battle Barge") or (class="Gloriana"){ obj_fleet.capital-=1; obj_fleet.capital_lost+=1; } @@ -44,7 +44,7 @@ if (hp<=0) and (x>-5000){ obj_fleet.escort-=1; obj_fleet.escort_lost+=1; } - // obj_ini.ship_hp[self.ship_id]=-100; + obj_fleet.ship_lost[ship_id]=1;// show_message("obj_fleet.ship_lost["+string(ship_id)+"] = 1"); @@ -68,28 +68,29 @@ if (hp<=0) and (x>-5000){ x=-7000;y=room_height/2; } if (hp>0) and (instance_exists(target)){ - if (cooldown[1]>0) then cooldown[1]-=1; - if (cooldown[2]>0) then cooldown[2]-=1; - if (cooldown[3]>0) then cooldown[3]-=1; - if (cooldown[4]>0) then cooldown[4]-=1; + for (var i=0;i0){ + cooldown[i]--; + } + } - if (class="Apocalypse Class Battleship") or (class="Slaughtersong"){ + if (class="Apocalypse Class Battleship") or (class="Gloriana"){ o_dist=500; action="attack"; } - if (class="Nemesis Class Fleet Carrier"){ + else if (class="Nemesis Class Fleet Carrier"){ o_dist=1000; action="attack"; } - if (class="Avenger Class Grand Cruiser"){ + else if (class="Avenger Class Grand Cruiser"){ o_dist=64; action="broadside"; } - if (class="Battle Barge") or (class="Strike Cruiser"){ + else if (class="Battle Barge") or (class="Strike Cruiser"){ o_dist=300; action="attack"; } - if (class="Hunter") or (class="Gladius"){ + else if (class="Hunter") or (class="Gladius"){ o_dist=64; action="flank"; } @@ -139,15 +140,15 @@ if (hp>0) and (instance_exists(target)){ if (paction!="move") and (paction!="turn") and (paction!="attack_move") and (paction!="attack_turn"){ if (action="attack"){ - if (dist>o_dist) and (speed<(obj_fleet.ship_speed[self.ship_id]/10)) then speed+=speed_up; + if (dist>o_dist) and (speed<(max_speed)) then speed+=speed_up; if (dist0) then speed-=speed_down; } if (action="broadside"){ - if (dist>o_dist) and (speed<(obj_fleet.ship_speed[self.ship_id]/10)) then speed+=speed_up; + if (dist>o_dist) and (speed<(max_speed)) then speed+=speed_up; if (dist0) then speed-=speed_down; } if (action="flank"){// flank here - if (dist>o_dist) and (speed<(obj_fleet.ship_speed[self.ship_id]/10)) then speed+=speed_up; + if (dist>o_dist) and (speed<(max_speed)) then speed+=speed_up; if (dist0) then speed-=speed_down; } } @@ -165,7 +166,7 @@ if (hp>0) and (instance_exists(target)){ } } - if (dist>20) and (speed<(obj_fleet.ship_speed[self.ship_id]/10)) then speed+=speed_up; + if (dist>20) and (speed<(max_speed)) then speed+=speed_up; if (dist<=20) and (speed>0){ paction=""; action="attack"; @@ -212,10 +213,9 @@ if (hp>0) and (instance_exists(target)){ if (collision_line(x,y,x+lengthdir_x(2000,direction),y+lengthdir_y(2000,direction),obj_en_ship,0,1)) then front=1; - var f=0,facing="",ammo=0,range=0,wep="",dam=0,gg=0; + var f=0,facing="",ammo=0,range=0,wep="",dam=0; - repeat(weapons){ - gg+=1; + for (var gg=1;gg0) then cooldown[gg]-=1; @@ -230,6 +230,7 @@ if (hp>0) and (instance_exists(target)){ } targe=target; + if (facing="right") then targe=target_r; if (facing="left") then targe=target_l; if ((facing="front") or (facing="most")) and (front=1) then ok=2; @@ -311,9 +312,12 @@ if (hp>0) and (instance_exists(target)){ /* */ + +//Deploy boarding craft logic if (instance_exists(obj_en_ship)) and (boarders>0) and (board_cooldown<=0) and ((board_capital=true) or (board_frigate=true)){ var eh=0,te=0; - repeat(2){eh+=1;te=0; + repeat(2){ + eh+=1;te=0; if (eh=1) and (board_capital=true){if (instance_exists(obj_en_capital)) then te=instance_nearest(x,y,obj_en_capital);} if (eh=2) and (board_frigate=true){if (instance_exists(obj_en_cruiser)) then te=instance_nearest(x,y,obj_en_cruiser);} if (te!=0) and (instance_exists(te)){ diff --git a/objects/obj_pnunit/Alarm_5.gml b/objects/obj_pnunit/Alarm_5.gml index bc7b098da..398c3c287 100644 --- a/objects/obj_pnunit/Alarm_5.gml +++ b/objects/obj_pnunit/Alarm_5.gml @@ -1,96 +1,77 @@ +var _unit; -var i=0,new_exp, cur_exp, unit; -total_battle_exp_gain = 0; -if (obj_ncombat.defeat=0){ - for (i=0;i=40) then new_exp+=choose(0,0,1); - if (cur_exp>=20) and (cur_exp<40) then new_exp+=choose(0,1); - if (cur_exp<20) then new_exp+=1; - - if (obj_ncombat.enemy=10) and (obj_ncombat.threat=7){ - if (cur_exp>=40) then new_exp+=choose(2,3,4); - if (cur_exp>=20) and (cur_exp<40) then new_exp+=choose(4,6,8); - if (cur_exp<20) then new_exp+=10; - } - if (new_exp>0){ - unit.add_exp(new_exp); - obj_ncombat.total_battle_exp_gain+=new_exp; - } - if (unit.IsSpecialist("libs")) then unit.update_powers(); - // Need some kind of report here - } +if (obj_ncombat.defeat == 0) { + var _current_exp; + var _exp_mod = 1; + var _unit_xp_data = []; + var _unit_recovery_score = obj_ncombat.unit_recovery_score; + + for (var i = 0; i < array_length(unit_struct); i++) { + _unit = unit_struct[i]; + if (is_struct(_unit) && ally[i] == false) { + if (marine_dead[i] == 1 && marine_type[i] != "" && _unit_recovery_score > 0) { // Apothecaries saving marines + obj_ncombat.unit_recovery_score -= 1; + _unit.update_health(irandom(20) - 10); + marine_dead[i] = false; + obj_ncombat.units_saved += 1; + } - if (marine_type[i]!="") and (marine_dead[i]==1) and (ally[i]=false){ - if (marine_type[i]=="Chapter Master"){ - if (obj_ncombat.unit_recovery_score>0){ - obj_ncombat.unit_recovery_score-=1; - unit.update_health(irandom(20)-10); - marine_dead[i]=0; - obj_ncombat.units_saved+=1; - } - }else if (marine_type[i]!=""){ - if (obj_ncombat.unit_recovery_score>0){ - obj_ncombat.unit_recovery_score-=1; - unit.update_health(irandom(20)-10); - marine_dead[i]=0; - obj_ncombat.units_saved+=1; - // show_message(string(marine_type[i])+" is saved by an apothecary"); - } - } + if (!marine_dead[i]) { // EXP allocation + _current_exp = _unit.experience; + + _exp_mod = max(1 - (_current_exp / 200), 0.03); + + _unit_xp_data = [_unit, _exp_mod]; + array_push(obj_ncombat.end_alive_units, _unit_xp_data); } } } - for (i=0;i0) { - obj_ncombat.vehicle_recovery_score-=1; - veh_hp[i]=10; - veh_dead[i]=0; - obj_ncombat.vehicles_saved+=1; + } + if (veh_dead[i] == 1 && obj_ncombat.vehicle_recovery_score > 0) { + obj_ncombat.vehicle_recovery_score -= 1; + veh_hp[i] = 10; + veh_dead[i] = 0; + obj_ncombat.vehicles_saved += 1; } } } } -i=0; - - for (i=0;i0) or (obj_ncombat.defeat!=0)) and (marine_type[i]!="") and (ally[i]=false){ var comm=false; - if (unit.IsSpecialist("standard",true)){ + if (_unit.IsSpecialist("standard",true)){ obj_ncombat.final_command_deaths+=1; var recent=true; - if (is_specialist(unit.role, "trainee")){ + if (is_specialist(_unit.role, "trainee")){ recent=false - } else if (array_contains([string("Venerable {0}",obj_ini.role[100][6]), "Codiciery", "Lexicanum"], unit.role())){ + } else if (array_contains([string("Venerable {0}",obj_ini.role[100][6]), "Codiciery", "Lexicanum"], _unit.role())){ recent=false } if (recent=true) then scr_recent("death_"+string(marine_type[i]),string(obj_ini.name[marine_co[i],marine_id[i]]),marine_co[i]); @@ -127,26 +108,26 @@ i=0; obj_ncombat.final_deaths+=1; } // obj_ncombat.final_deaths+=1; - + // show_message("ded; increase final deaths"); - + if (obj_controller.blood_debt=1){ - if (unit.role()==obj_ini.role[100][12]){ + if (_unit.role()==obj_ini.role[100][12]){ obj_controller.penitent_current+=2 } else {obj_controller.penitent_current+=4;} obj_controller.penitent_turn=0; obj_controller.penitent_turnly=0; } - + if (obj_ini.race[marine_co[i],marine_id[i]]=1){ var age=obj_ini.age[marine_co[i],marine_id[i]]; if (age<=((obj_controller.millenium*1000)+obj_controller.year)-10) and (obj_ini.zygote=0) then obj_ncombat.seed_max+=1; if (age<=((obj_controller.millenium*1000)+obj_controller.year)-5) then obj_ncombat.seed_max+=1; } - + var last=0; for (var o=1;o0) and (marine_type[i]!="") and (ally[i]=false){// 135 var wah=0,artif=false; repeat(5){ @@ -176,10 +157,10 @@ i=0; if (obj_ncombat.dropping=1) and (obj_ncombat.defeat=1) then dece=9999; if (marine_dead[i]=2) or (destroy=2) then dece=9999; if (obj_ini.race[marine_co[i],marine_id[i]]!=1) then dece=9999; - + // if (wah=1){show_message(obj_ini.armour[marine_co[i],marine_id[i]]);} - arti=!is_string(unit.armour(true)); - var arm_data = unit.get_armour_data(); + arti=!is_string(_unit.armour(true)); + var arm_data = _unit.get_armour_data(); if (wah=1) and (is_struct(arm_data)){ if (arm_data.has_tag("terminator")) then eqp_chance+=30; if (string_count("&",marine_armour[i])>0){ @@ -202,7 +183,7 @@ i=0; artif=true; } if (artif=true) then obj_ncombat.post_equipment_lost[o]=clean_tags(obj_ncombat.post_equipment_lost[o]); - + obj_ini.armour[marine_co[i],marine_id[i]]=""; // wep2[0,i]="";armour[0,i]="";gear[0,i]="";mobi[0,i]=""; } @@ -215,15 +196,15 @@ i=0; if (marine_wep1[i]="Company Standard") then eqp_chance=99; if (marine_dead[i]=2) or (destroy=2) then dece=9999; if (obj_ini.race[marine_co[i],marine_id[i]]!=1) then dece=9999; - + if (dece>eqp_chance){ var last,o;last=0;o=0; repeat(50){ if (last=0){ o+=1;artif=false; - + // show_message(string(o)+"]"+string(obj_ncombat.post_equipment_lost[o])+" "+string(i)+"]"+string(marine_wep1[i])); - + if (string(obj_ncombat.post_equipment_lost[o])=marine_wep1[i]){last=1;obj_ncombat.post_equipments_lost[o]+=1;artif=true;} if (string(obj_ncombat.post_equipment_lost[o])="") and (last=0){last=o;obj_ncombat.post_equipment_lost[o]=marine_wep1[i];obj_ncombat.post_equipments_lost[o]=1;artif=true;} if (artif=true) then obj_ncombat.post_equipment_lost[o]=clean_tags(obj_ncombat.post_equipment_lost[o]); @@ -239,7 +220,7 @@ i=0; if (marine_wep2[i]="Company Standard") then eqp_chance=99; if (marine_dead[i]=2) or (destroy=2) then dece=9999; if (obj_ini.race[marine_co[i],marine_id[i]]!=1) then dece=9999; - + if (dece>eqp_chance){ var last,o;last=0;o=0; repeat(50){ @@ -259,7 +240,7 @@ i=0; if (string_count("&",marine_gear[i])>0){eqp_chance=90;artif=true;} if (marine_dead[i]=2) or (destroy=2) then dece=9999; if (obj_ini.race[marine_co[i],marine_id[i]]!=1) then dece=9999; - + if (obj_ini.gear[marine_co[i],marine_id[i]]="Exterminatus"){ if (obj_ncombat.defeat=0){ dece=0; @@ -267,7 +248,7 @@ i=0; } if (obj_ncombat.defeat!=0) then dece=9999; } - + if (dece>eqp_chance){ var last,o;last=0;o=0; repeat(50){ @@ -290,7 +271,7 @@ i=0; } if (marine_dead[i]=2) or (destroy=2) then dece=9999; if (obj_ini.race[marine_co[i],marine_id[i]]!=1) then dece=9999; - + if (dece>eqp_chance){ var last,o;last=0;o=0; repeat(50){ @@ -314,14 +295,14 @@ i=0; } - + } } -for (i=0;i0) then obj_ncombat.world_size+=man_size; - if (unit.ship_location>0) then obj_ini.ship_carrying[unit.ship_location]-=man_size; + if (unit.ship_location>-1) then obj_ini.ship_carrying[unit.ship_location]-=man_size; // scr_kill_unit(unit.company,unit.marine_number); } @@ -37,27 +37,14 @@ for (var i=0;i0) then obj_ncombat.world_size+=man_size; - if (obj_ini.veh_lid[veh_co[i],veh_id[i]]>0) then obj_ini.ship_carrying[obj_ini.veh_lid[veh_co[i],veh_id[i]]]-=man_size; + if (obj_ini.veh_wid[veh_co[i],veh_id[i]]>-1) then obj_ncombat.world_size+=man_size; + if (obj_ini.veh_lid[veh_co[i],veh_id[i]]>-1) then obj_ini.ship_carrying[obj_ini.veh_lid[veh_co[i],veh_id[i]]]-=man_size; // show_message(string(veh_type[i])+" ("+string(veh_co[i])+"."+string(veh_id[i])+") dead"); // - obj_ini.veh_race[veh_co[i],veh_id[i]]=0; - obj_ini.veh_loc[veh_co[i],veh_id[i]]=""; - obj_ini.veh_name[veh_co[i],veh_id[i]]=""; - obj_ini.veh_role[veh_co[i],veh_id[i]]=""; - obj_ini.veh_wep1[veh_co[i],veh_id[i]]=""; - obj_ini.veh_wep2[veh_co[i],veh_id[i]]=""; - obj_ini.veh_wep3[veh_co[i],veh_id[i]]=""; - obj_ini.veh_upgrade[veh_co[i],veh_id[i]]=""; - obj_ini.veh_acc[veh_co[i],veh_id[i]]=""; - obj_ini.veh_hp[veh_co[i],veh_id[i]]=0; - obj_ini.veh_chaos[veh_co[i],veh_id[i]]=0; - obj_ini.veh_pilots[veh_co[i],veh_id[i]]=0; - obj_ini.veh_lid[veh_co[i],veh_id[i]]=0; - obj_ini.veh_wid[veh_co[i],veh_id[i]]=2; + destroy_vehicle(veh_co[i],veh_id[i]); } if (veh_dead[i]=0) and (veh_type[i]!="") and (veh_ally[i]=false){obj_ini.veh_hp[veh_co[i],veh_id[i]]=veh_hp[i]/veh_hp_multiplier[i];} } diff --git a/objects/obj_popup/Create_0.gml b/objects/obj_popup/Create_0.gml index f01d097e4..3fbaea4db 100644 --- a/objects/obj_popup/Create_0.gml +++ b/objects/obj_popup/Create_0.gml @@ -1,4 +1,4 @@ -set_zoom_to_defualt(); +set_zoom_to_default(); type=0;size=2;y_scale=1; if (size=1) then sprite_index=spr_popup_small; if (size=2) then sprite_index=spr_popup_medium; @@ -230,10 +230,7 @@ a_wep1="";a_wep2="";a_armour="";a_gear="";a_mobi=""; n_good1=1;n_good2=1;n_good3=1;n_good4=1;n_good5=1; sel1=0;sel2=0;sel3=0;sel4=0;sel5=0; vehicle_equipment=0;warning=""; -var i;i=-1; -repeat(51){ - i+=1;item_name[i]=""; -} +item_name = []; move_to_next_stage = function(){ return (scr_hit(0,0, room_width, room_height) || diff --git a/objects/obj_popup/Destroy_0.gml b/objects/obj_popup/Destroy_0.gml index 544e60678..9cee85c07 100644 --- a/objects/obj_popup/Destroy_0.gml +++ b/objects/obj_popup/Destroy_0.gml @@ -1,7 +1,31 @@ if (image="debug_banshee") then obj_controller.cooldown=8; if (image="chaos_symbol") and (title="Concealed Heresy") and (instance_exists(obj_drop_select)){ - obj_drop_select.alarm[5]=1; + with (obj_drop_select){ + obj_controller.cooldown=30; + // ** Starts the battle ** + is_in_combat=true; + + instance_deactivate_all(true); + instance_activate_object(obj_controller); + instance_activate_object(obj_ini); + instance_activate_object(obj_drop_select); + + instance_create(0,0,obj_ncombat); + obj_ncombat.battle_object=p_target; + obj_ncombat.battle_loc=p_target.name; + obj_ncombat.battle_id=obj_controller.selecting_planet; + obj_ncombat.dropping=0; + obj_ncombat.attacking=10; + obj_ncombat.enemy=10; + obj_ncombat.formation_set=2; + obj_ncombat.leader=1; + obj_ncombat.threat=5; + obj_ncombat.battle_special="WL10_reveal"; + scr_battle_allies(); + setup_battle_formations(); + roster.add_to_battle(); + } } if (instance_exists(obj_controller)){ diff --git a/objects/obj_popup/Draw_0.gml b/objects/obj_popup/Draw_0.gml index db6f0a918..7a7b96de1 100644 --- a/objects/obj_popup/Draw_0.gml +++ b/objects/obj_popup/Draw_0.gml @@ -1,548 +1,803 @@ - - -//TODO refactor this entire turd of a construct -if (hide=true) then exit; -if (image=="debug"){ - size=3; -} - -var romanNumerals=scr_roman_numerals(); -var xx,yy; -xx=__view_get( e__VW.XView, 0 ); -yy=__view_get( e__VW.YView, 0 ); - -if (instance_exists(obj_fleet)) then exit; - -if (type=99){ - draw_set_font(fnt_large); - draw_set_halign(fa_center); - draw_set_color(38144); - - if (!obj_controller.zoomed){ - draw_text_transformed(__view_get( e__VW.XView, 0 )+320,__view_get( e__VW.YView, 0 )+60,"SELECT DESTINATION",0.5,0.5,0); - } - else { - draw_text_transformed(room_width/2,60*3,"SELECT DESTINATION",1.5,1.5,0); - } - - draw_set_halign(fa_left); -}else if (type=10){ - target_comp+=1; - draw_set_color(0); - draw_set_alpha(target_comp/60); - draw_rectangle(0,0,room_width,room_height,0); - draw_set_alpha(1); - exit; -}else if ((type=9) or (type=9.1)) and (instance_exists(obj_controller)){ - draw_sprite(spr_planet_screen,0,xx+231+314,yy+112); - draw_set_font(fnt_40k_14); - draw_set_halign(fa_center); - draw_set_color(c_gray); - - var ch="",inq_hide=0; - if (type==9){ - if (array_contains(obj_ini.artifact_tags[obj_controller.menu_artifact], "inq")){ - if (array_contains(obj_controller.quest, "artifact_loan")) then inq_hide=1; - if (array_contains(obj_controller.quest, "artifact_return")) then inq_hide=2; - } - } - var iter=0, spacer=0;; - for (var i=2;i<=8;i++){ - draw_set_font(fnt_40k_14); - draw_set_halign(fa_center); - draw_set_color(c_gray); - draw_set_alpha(0.33); - if (i==7) then continue; - if (obj_controller.known[i]) then draw_set_alpha(1); - spacer =(iter*40); - ch = obj_controller.disposition[i] > 0?"+":"-"; - if (obj_controller.known[i]>1){ - draw_text(xx+740,yy+140+spacer,$"{scr_faction_string_name(i)} ({ch}{obj_controller.disposition[2]})"); - // draw_text(xx+740,yy+140+spacer,$"{obj_controller.faction_title[i]}"); - iter++; - } else { - continue; - } - draw_line(xx+239+420,yy+162+spacer,xx+398+420,yy+162+spacer); - if (mouse_x>=xx+240+420) and (mouse_x<=xx+387+420){ - if (mouse_y>=yy+131+spacer) and (mouse_y<=yy+159+spacer) and (obj_controller.known[i]>1){ - if (i==eFACTION.Inquisition){ - if ((inq_hide!=2) and (inq_hide==1)) then continue; - } - draw_set_alpha(0.33); - draw_set_color(c_gray); - draw_rectangle(xx+240+420,yy+135+spacer,xx+398+420,yy+160+spacer,0); - if( mouse_check_button_pressed(mb_left)){ - giveto=i; - } - } - } - } - draw_set_alpha(1); - draw_set_color(38144); - if (point_and_click(draw_unit_buttons([xx+700,yy+370],"Cancel",[1,1],c_red))){ - obj_controller.cooldown=8000; - instance_destroy(); - exit; - } - if (giveto>0) and (type=9){ - var arti_index = obj_controller.menu_artifact; - - - var artifact_struct = obj_ini.artifact_struct[arti_index]; - var cur_tags = obj_ini.artifact_tags[arti_index]; - - // obj_controller.artifacts-=1; // this is done by delete_artifact() that is run later; - - obj_controller.cooldown=10; - if (obj_controller.menu_artifact>obj_controller.artifacts) then obj_controller.menu_artifact=obj_controller.artifacts; - - obj_controller.menu=20; - obj_controller.diplomacy=giveto; - obj_controller.force_goodbye=-1; - var the=""; - - if (giveto!=7) and (giveto!=10) then the="the "; - - scr_event_log("",$"Artifact gifted to {the} {obj_controller.faction[giveto]}."); - var is_daemon = artifact_struct.has_tag("daemonic"); - var is_chaos = artifact_struct.has_tag("chaos"); - if (inq_hide!=2) then with(obj_controller){ - if (!is_daemon) or ((diplomacy!=4) and (diplomacy!=5) and (diplomacy!=2)) then scr_dialogue("artifact_thanks"); - if (is_daemon) and ((diplomacy=4) or (diplomacy=5) or (diplomacy=2)) then scr_dialogue("artifact_daemon"); - } - if (inq_hide=2) and (obj_controller.diplomacy=4) then with(obj_controller){scr_dialogue("artifact_returned");} - - if (artifact_struct.has_tag("MINOR")){ - if (giveto=eFACTION.Imperium) then obj_controller.disposition[eFACTION.Imperium]+=6; - if (giveto=3) then obj_controller.disposition[3]+=4; - if (giveto=4) and (inq_hide!=2) then obj_controller.disposition[4]+=4; - - if (giveto=4) and (inq_hide=2) then obj_controller.disposition[4]+=2; - - if (giveto=5) and (!is_daemon){ - obj_controller.disposition[5]+=4; - var o=0 - if (array_contains(obj_ini.adv, "Reverent Guardians")) then obj_controller.disposition[5]+=2; - } - if (giveto=6) then obj_controller.disposition[6]+=3; - if (giveto=8) then obj_controller.disposition[8]+=4; - } - - // Need to modify ^^^^ based on if it is chaos or daemonic - - if (giveto=2){ - if (is_daemon){ - var v=0,ev=0; - for (var v=1;v0) then p_heresy[i]+=10; - } - } - } - obj_controller.disposition[2]+=4; - } - else if (giveto=8){ - if (is_daemon){ - with(obj_star){ - for(var i=1;i<=planets;i++){ - if (p_owner[i]=8) then p_heresy[i]+=40; - } - } - } - } - delete_artifact(arti_index); - instance_destroy(); - exit; - } -} - -var zoom=0; -if (instance_exists(obj_controller)) then zoom=obj_controller.zoomed; -if ((zoom=0) and (type<=4)) or (type=98){ - - var widd,image_bot,y_scale_mod; - image_bot=0; - y_scale_mod = 1; - - if (size=0) or (size=2){ - sprite_index=spr_popup_medium; - image_alpha=0; - widd=sprite_width-50; - draw_sprite_ext(spr_popup_medium,type,xx+((1600-sprite_width)/2),yy+((900-sprite_height)/2),1,y_scale,0,c_white,1); - if (image!=""){image_wid=100;image_hei=100;} - } - else if (size=1){ - sprite_index=spr_popup_small; - image_alpha=0; - widd=sprite_width-10; - draw_sprite_ext(spr_popup_small,type,xx+((1600-sprite_width)/2),yy+((900-sprite_height)/2),1,y_scale,0,c_white,1); - if (image!=""){image_wid=150;image_hei=150;} - } - else if (size=3){ - var draw_y_scale = y_scale; - sprite_index=spr_popup_large; - image_alpha=0; - widd=sprite_width-50; - if (image == "debug"){ - y_scale_mod = 1.5; - draw_y_scale = y_scale*y_scale_mod; - } - draw_sprite_ext(spr_popup_large,type,xx+((1600-sprite_width)/2),yy+((900-sprite_height*y_scale_mod)/2),1,draw_y_scale,0,c_white,1); - if (image!=""){image_wid=200;image_hei=200;} - } - - if (image_wid>0) then widd-=(image_wid+10); - - var x1,y1; - x1=xx+((1600-sprite_width)/2); - y1=yy+((900-sprite_height*y_scale_mod)/2); - - draw_set_font(fnt_40k_14b); - draw_set_halign(fa_center); - draw_set_color(38144); - - if (fancy_title=1){ - draw_set_font(fnt_fancy); - if (type=1) then draw_set_color(255); - } - draw_text_transformed(x1+(sprite_width/2),y1+(sprite_height*0.07),string_hash_to_newline(string(title)), 1.1, 1.1, 0); - // draw_text(xx+320.5,yy+123.5,string(title)); - - draw_set_font(fnt_40k_14); - draw_set_halign(fa_left); - draw_set_color(38144); - - if (instance_exists(obj_turn_end)){ - if (obj_turn_end.popups>0) then draw_text(x1+20,y1+(sprite_height*0.07),string_hash_to_newline(string(obj_turn_end.current_popup)+"/"+string(obj_turn_end.popups))); - } - if (image=="debug"){ - draw_text_ext(x1+20,y1+(sprite_height*0.18),string_hash_to_newline(string(text)),-1,sprite_width-40); - } - else if (image=""){ - if (size=1) then draw_text_ext(x1+5,y1+(sprite_height*0.18),string_hash_to_newline(string(text)),-1,widd); - if (size!=1) then draw_text_ext(x1+25,y1+(sprite_height*0.18),string_hash_to_newline(string(text)),-1,widd); - str_h=string_height_ext(string_hash_to_newline(string(text)),-1,widd)+(sprite_height*0.18); - } - else if (image!=""){ - if (size=1) then draw_text_ext(x1+15+image_wid,y1+(sprite_height*0.18),string_hash_to_newline(string(text)),-1,widd); - if (size!=1) then draw_text_ext(x1+35+image_wid,y1+(sprite_height*0.18),string_hash_to_newline(string(text)),-1,widd); - str_h=string_height_ext(string_hash_to_newline(string(text)),-1,widd)+(sprite_height*0.18); - } - - // if (image!="") then draw_text_ext(x1+126+150,y1+152,string(text),-1,384-150); - // if (text2!="") then draw_text_ext(x1+126,y1+309,string(text2),-1,384); - // TODO change this into an array in a function (like romanNumerals does in here) - var img=-1; - if (image="") then img=-1; - if (image="orks") then img=0; - if (image="tau") then img=1; - if (image="chaos") then img=2; - if (image="shadow") then img=3; - if (image="distinguished") then img=4; - if (image="tech_build") then img=5; - if (image="sororitas") then img=6; - if (image="angry") then img=7; - if (image="gene_bad") then img=8; - if (image="lost_warp") then img=10; - if (image="warp") then img=11; - if (image="crusade") then img=12; - if (image="fuklaw") then img=13; - if (image="artifact") or (image="artifact2") then img=14; - if (image="artifact_recovered") then img=15; - if (image="artifact_given") then img=15; - if (image="waaagh") then img=16; - if (image="shipyard") then img=17; - if (image="inquisition") then img=18; - if (image="succession") then img=19; - if (image="rogue_trader") then img=20; - if (image="necron_tomb") then img=21; - if (image="webber") then img=22; - if (image="spyrer") then img=23; - if (image="fortress") then img=24; - if (image="fortress_hive") then img=25; - if (image="fortress_death") then img=26; - if (image="fortress_ice") then img=27; - if (image="fortress_lava") then img=28; - if (image="fortress_dorf") then img=29; - if (image="exploding_ship") then img=30; - if (image="necron_cave") then img=31; - if (image="exterminatus_new") then img=32; - if (image="necron_tunnels_1") then img=33; - if (image="necron_tunnels_2") then img=34; - if (image="necron_tunnels_3") then img=35; - if (image="necron_army") then img=36; - if (image="harlequin") then img=37; - if (image="black_rage") then img=39; - if (image="exterminatus") then img=40; - if (image="stc") then img=41; - if (image="thallax") then img=42; - if (image="space_hulk_done") then img=44; - if (image="ancient_ruins") then img=45; - if (image="geneseed_lab") then img=47; - if (image="ruins_bunker") then img=48; - if (image="ruins_fort") then img=49; - if (image="ruins_ship") then img=50; - if (image="fallen") then img=51; - if (image="debug_banshee") then img=52; - if (image="mechanicus") then img=53; - if (image="chaos_cultist") then img=54; - if (image="chaos_symbol") then img=55; - if (image="chaos_messenger") then img=56; - if (image="event_feast") then img=57; - if (image="event_tournament") then img=58; - if (image="event_deathmatch") then img=59; - if (image="event_mass") then img=60; - if (image="event_ccult") then img=61; - if (image="event_crelic") then img=62; - if (image="event_march") then img=63; - - if (img!=-1) and (image!="") and (image_wid>0){ - var sh=999; - if (size=1){sh=24;scr_image("popup",img,x1+5,y1+sh+24,image_wid,image_hei);} - if (size>=2){sh=24;scr_image("popup",img,x1+25,y1+sh+24,image_wid,image_hei);} - - image_bot=(sprite_height*0.07)+image_hei+5; - } - - if (option1 != "") and(string_count("Servitors and Skitarii", option1) = 0) { - var tox = "1. " + string(option1); - if (option2 != "") then tox += "#2. " + string(option2); - if (option3 != "") then tox += "#3. " + string(option3); - - var top = y1 + 0.5 + (sprite_height * 0.6); - if (str_h != 0) then top = y1 + str_h + 20; - if (image != "") then top = max(top, y1 + image_bot); - - draw_text_ext(x1 + 25.5, top, string_hash_to_newline(" Choices:"), -1, widd); - draw_text_ext(x1 + 25, top + 0.5, string_hash_to_newline(" Choices:"), -1, widd); - - var sz = 0, - sz2 = 0, - oy = y1, - t8 = 0; - if (str_h != 0) { - y1 += str_h + 20; - y1 -= (sprite_height * 0.6); - } - - y1 = top; - - if (option1 != "") then draw_text_ext(x1 + 25.5, y1 + 20, string_hash_to_newline("1. " + string(option1)), -1, widd); - - sz = string_height_ext(string_hash_to_newline("1. " + string(option1)), -1, widd); - if (option2 != "") then draw_text_ext(x1 + 25.5, y1 + 20 + sz, string_hash_to_newline("2. " + string(option2)), -1, widd); - - sz2 = string_height_ext(string_hash_to_newline("1. " + string(option1)), -1, widd); - sz2 += string_height_ext(string_hash_to_newline("2. " + string(option2)), -1, widd); - if (option3 != "") then draw_text_ext(x1 + 25.5, y1 + 20 + sz2, string_hash_to_newline("3. " + string(option3)), -1, widd); - - if (option1 != "") then t8 = (y1 + 20) + 5; - if (option2 != "") then t8 = (y1 + 20 + sz) + 5; - if (option3 = "") then t8 = (y1 + 20 + sz2 + string_height_ext(string_hash_to_newline("3. " + string(option3)), -1, widd)) + 5; - - - if (option1 != "") and(mouse_x >= x1) and(mouse_y >= y1 + 21) and(mouse_x <= x1 + 30 + string_width_ext(string_hash_to_newline("1. " + string(option1)), -1, widd)) and(mouse_y < y1 + 39) { - option1enter=true; - draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21); - if (mouse_check_button(mb_left)) then press = 1; - } else { - option1enter=false; - } - if (option2 != "") and(mouse_x >= x1) and(mouse_y >= y1 + 21 + sz) and(mouse_x <= x1 + 30 + string_width_ext(string_hash_to_newline("2. " + string(option2)), -1, widd)) and(mouse_y < y1 + 39 + sz) { - option2enter=true; - draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21 + sz); - if (mouse_check_button(mb_left)) then press = 2; - }else { - option2enter=false; - } - if (option3 != "") and(mouse_x >= x1) and(mouse_y >= y1 + 21 + sz2) and(mouse_x <= x1 + 30 + string_width_ext(string_hash_to_newline("3. " + string(option3)), -1, widd)) and(mouse_y < y1 + 39 + sz2) { - option3enter=true; - draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21 + sz2); - if (mouse_check_button(mb_left)) then press = 3; - }else { - option3enter=false; - } - if (image=="new_forge_master"){ - var new_master_image = false; - if (pathway="selection_options"){ - if (option1enter){ - new_master_image = techs[charisma_pick].draw_unit_image(); - techs[charisma_pick].stat_display(); - } else if (option2enter){ - new_master_image=techs[talent_pick].draw_unit_image(); - techs[talent_pick].stat_display(); - }else if (option3enter){ - new_master_image =techs[experience_pick].draw_unit_image(); - techs[experience_pick].stat_display(); - } - if (is_struct(new_master_image)){ - new_master_image.draw(xx+1208, yy+210, true); - } - } - } - if (t8 < (oy + sprite_height)) { - y_scale = (t8 / (oy + sprite_height)); - } - if (t8 > (oy + sprite_height)) { - y_scale = (t8 / (oy + sprite_height)); - } - } -} - -// ** Equip Artifact ** -if (type = 8) and (instance_exists(obj_controller)) { - var x2 = xx + 951; - var y2 = yy + 48; - var before = target_comp; - var temp_alpha = 1; - arti = obj_ini.artifact_struct[obj_controller.menu_artifact]; - - // draw_sprite(spr_popup_large,0,x2,y2); - - draw_set_font(fnt_40k_14b); - draw_set_halign(fa_center); - draw_set_color(c_gray); - - draw_text(x2 + 312, y2 + 26, $"Equip Artifact ({obj_ini.artifact[obj_controller.menu_artifact]})"); - // draw_text(x2+320.5,yy+123.5,"Equip Artifact ("+string(obj_ini.artifact[obj_controller.menu_artifact])+")"); - - draw_set_font(fnt_40k_12); - draw_set_halign(fa_left); - draw_text(x2 + 31, y2 + 35, "Select Company:"); - - // Draw HQ button - temp_alpha = (target_comp == 0) ? 1 : 0.5; - var hq_text = $"HQ"; - var hq_button = draw_unit_buttons([x2 + 60, y2 + 75, x2 + 60 + 60, y2 + 75 + 20], hq_text, [1, 1], , , fnt_40k_12, temp_alpha); // Position for HQ - if (point_and_click(hq_button)) { - target_comp = 0; - } - - // Draw other company buttons - for (var i = 1; i < 11; i++) { - temp_alpha = (target_comp == i) ? 1 : 0.5; - var item_text = $"{romanNumerals[i - 1]}"; - var x_offset = x2 + 141 + (81 * (i - (i < 6 ? 1 : 6))); - var y_offset = y2 + (i < 6 ? 60 : 90); - var company_button = draw_unit_buttons([x_offset, y_offset, x_offset+60, y_offset+20], item_text, [1, 1], , , fnt_40k_12, temp_alpha); - if (point_and_click(company_button)) { - target_comp = i; - } - } - - if (before != target_comp) { - units = 0; - with(obj_controller) { - if (obj_popup.target_comp > 0) then scr_company_view(obj_popup.target_comp); - if (obj_popup.target_comp = 0) then scr_special_view(0); - } - var i; - i = -1; - repeat(array_length(obj_controller.display_unit)) { - i += 1; - obj_controller.man_sel[i] = 0; - } - i = -1; - } - - // Weapon slot buttons - if (arti.determine_base_type() == "weapon") { - draw_text(x2 + 30, y2 + 128, ("Replace:")); - - temp_alpha = (target_role == 1) ? 1 : 0.5; - if (point_and_click(draw_unit_buttons([x2 + 150, y2 + 120, x2 + 150 + 120, y2 + 120 + 20], ($"1st Weapon"), [1,1],,,fnt_40k_12,temp_alpha))){ - target_role = 1; - } - - temp_alpha = (target_role == 2) ? 1 : 0.5; - if (point_and_click(draw_unit_buttons([x2 + 300, y2 + 120, x2 + 300 + 120, y2 + 120 + 20], ($"2nd Weapon"), [1,1],,,fnt_40k_12,temp_alpha))){ - target_role = 2; - } - } else { - target_role = 3 - } - - - // Soldier list - draw_set_font(fnt_40k_12); - draw_rectangle(x2+29,y2+160,x2+569,y2+363+356,1);// Main rectangle? - scr_scrollbar(1520,220,1543,761,23,obj_controller.man_max,obj_controller.man_current); - draw_rectangle(x2+569,y2+171,x2+592,y2+357+356,1);// Inside of scroll - draw_rectangle(x2+569,y2+150,x2+592,y2+378+356,1);// Outside of scroll - draw_sprite_stretched(spr_arrow,2,x2+569,y2+150,23,22); - draw_sprite_stretched(spr_arrow,3,x2+569,y2+357+356,23,22); - - if (target_comp!=-1){ - var top,sel,temp1,temp2,temp3,temp4,temp5;temp1="";temp2="";temp3="";temp4="";temp5=""; - top=obj_controller.man_current;sel=top; - var unit_x = x2; - var unit_y = y2; - var ma_ar,ma_we1,ma_we2,ma_ge,ma_mb,ttt; - ma_ar="";ma_we1="";ma_we2="";ma_ge="";ma_mb="";ttt=0; - - repeat(min(obj_controller.man_max,23)){ - if (sel >= array_length(obj_controller.man)) then break; - if (obj_controller.man[sel]=="man"){ - var unit=obj_controller.display_unit[sel]; - temp1=unit.name_role(); - temp2=obj_controller.ma_loc[sel]; - if (obj_controller.ma_wid[sel]!=0){ - temp2 += scr_roman_numerals()[obj_controller.ma_wid[sel]-1]; - } - if (obj_controller.ma_health[sel]>=100) then temp3="Unwounded"; - if (obj_controller.ma_health[sel]>=70) and (obj_controller.ma_health[sel]<100) then temp3="Lightly Wounded"; - if (obj_controller.ma_health[sel]>=40) and (obj_controller.ma_health[sel]<70) then temp3="Wounded"; - if (obj_controller.ma_health[sel]>=8) and (obj_controller.ma_health[sel]<40) then temp3="Badly Wounded"; - if (obj_controller.ma_health[sel]<8) then temp3="CRITICAL"; - temp4=string(obj_controller.ma_exp[sel])+" exp"; - - ma_ar=unit.armour(); - ma_we1=unit.weapon_two(); - ma_we2=unit.weapon_one(); - ma_ge=unit.gear(); - ma_mb=unit.mobility_item();ttt=0; - - - if (obj_controller.ma_gear[sel]!="") then temp5="(("+string(ma_ar)+" + "+string(ma_mb)+")) | "+string(ma_we1)+" | "+string(ma_we2)+" + ("+string(ma_ge)+")"; - if (obj_controller.ma_gear[sel]="") then temp5="(("+string(ma_ar)+" + "+string(ma_mb)+")) | "+string(ma_we1)+" | "+string(ma_we2)+""; - } - if (obj_controller.man[sel]="vehicle"){ - temp1=string(obj_controller.ma_role[sel]); - temp2=string(obj_controller.ma_loc[sel]); - if (obj_controller.ma_wid[sel]!=0){ - temp2 += scr_roman_numerals()[obj_controller.ma_wid[sel]-1]; - } - temp3="Undamaged"; - temp4=""; - temp5="("+string(obj_controller.ma_wep1[sel])+" | "+string(obj_controller.ma_wep2[sel])+" | "+string(obj_controller.ma_gear[sel])+")"; - } - - - if (obj_controller.man_sel[sel]=0) then draw_set_color(c_black); - if (obj_controller.man_sel[sel]!=0) then draw_set_color(6052956); - draw_rectangle(unit_x+29,unit_y+150,unit_x+569,unit_y+175.4,0); - draw_set_color(c_gray); - draw_rectangle(unit_x+29,unit_y+150,unit_x+569,unit_y+175.4,1); - - // if (obj_controller.man[sel]="man") and (obj_controller.ma_promote[sel]>0) then draw_set_color(c_yellow); - if (ma_ar="") then draw_set_alpha(0.5); - draw_text_transformed(unit_x+32,unit_y+151,string_hash_to_newline(string(temp1)),1,1,0);draw_text_transformed(unit_x+32.5,unit_y+151.5,string_hash_to_newline(string(temp1)),1,1,0); - draw_set_color(c_gray);draw_set_alpha(1); - - /* +try { + //TODO refactor this entire turd of a construct + if (hide == true) { + exit; + } + if (image == "debug") { + size = 3; + } + + var romanNumerals = scr_roman_numerals(); + var xx, yy; + xx = __view_get(e__VW.XView, 0); + yy = __view_get(e__VW.YView, 0); + + if (instance_exists(obj_fleet)) { + exit; + } + + if (type == 99) { + draw_set_font(fnt_large); + draw_set_halign(fa_center); + draw_set_color(38144); + + if (!obj_controller.zoomed) { + draw_text_transformed(__view_get(e__VW.XView, 0) + 320, __view_get(e__VW.YView, 0) + 60, "SELECT DESTINATION", 0.5, 0.5, 0); + } else { + draw_text_transformed(room_width / 2, 60 * 3, "SELECT DESTINATION", 1.5, 1.5, 0); + } + + draw_set_halign(fa_left); + } else if (type == 10) { + target_comp += 1; + draw_set_color(0); + draw_set_alpha(target_comp / 60); + draw_rectangle(0, 0, room_width, room_height, 0); + draw_set_alpha(1); + exit; + } else if (((type == 9) || (type == 9.1)) && instance_exists(obj_controller)) { + draw_sprite(spr_planet_screen, 0, xx + 231 + 314, yy + 112); + draw_set_font(fnt_40k_14); + draw_set_halign(fa_center); + draw_set_color(c_gray); + + var ch = "", inq_hide = 0; + if (type == 9) { + if (array_contains(obj_ini.artifact_tags[obj_controller.menu_artifact], "inq")) { + if (array_contains(obj_controller.quest, "artifact_loan")) { + inq_hide = 1; + } + if (array_contains(obj_controller.quest, "artifact_return")) { + inq_hide = 2; + } + } + } + var iter = 0, spacer = 0; + for (var i = 2; i <= 8; i++) { + draw_set_font(fnt_40k_14); + draw_set_halign(fa_center); + draw_set_color(c_gray); + draw_set_alpha(0.33); + if (i == 7) { + continue; + } + if (obj_controller.known[i]) { + draw_set_alpha(1); + } + spacer = iter * 40; + ch = obj_controller.disposition[i] > 0 ? "+" : "-"; + if (obj_controller.known[i] > 1) { + draw_text(xx + 740, yy + 140 + spacer, $"{scr_faction_string_name(i)} ({ch}{obj_controller.disposition[2]})"); + // draw_text(xx+740,yy+140+spacer,$"{obj_controller.faction_title[i]}"); + iter++; + } else { + continue; + } + draw_line(xx + 239 + 420, yy + 162 + spacer, xx + 398 + 420, yy + 162 + spacer); + if ((mouse_x >= xx + 240 + 420) && (mouse_x <= xx + 387 + 420)) { + if ((mouse_y >= yy + 131 + spacer) && (mouse_y <= yy + 159 + spacer) && (obj_controller.known[i] > 1)) { + if (i == eFACTION.Inquisition) { + if ((inq_hide != 2) && (inq_hide == 1)) { + continue; + } + } + draw_set_alpha(0.33); + draw_set_color(c_gray); + draw_rectangle(xx + 240 + 420, yy + 135 + spacer, xx + 398 + 420, yy + 160 + spacer, 0); + if (mouse_check_button_pressed(mb_left)) { + giveto = i; + } + } + } + } + draw_set_alpha(1); + draw_set_color(38144); + if (point_and_click(draw_unit_buttons([xx + 700, yy + 370], "Cancel", [1, 1], c_red))) { + obj_controller.cooldown = 8000; + instance_destroy(); + exit; + } + if ((giveto > 0) && (type == 9)) { + var arti_index = obj_controller.menu_artifact; + + var artifact_struct = obj_ini.artifact_struct[arti_index]; + var cur_tags = obj_ini.artifact_tags[arti_index]; + + // obj_controller.artifacts-=1; // this is done by delete_artifact() that is run later; + + obj_controller.cooldown = 10; + if (obj_controller.menu_artifact > obj_controller.artifacts) { + obj_controller.menu_artifact = obj_controller.artifacts; + } + + obj_controller.menu = 20; + obj_controller.diplomacy = giveto; + obj_controller.force_goodbye = -1; + var the = ""; + + if ((giveto != 7) && (giveto != 10)) { + the = "the "; + } + + scr_event_log("", $"Artifact gifted to {the} {obj_controller.faction[giveto]}."); + var is_daemon = artifact_struct.has_tag("daemonic"); + var is_chaos = artifact_struct.has_tag("chaos"); + if (inq_hide != 2) { + with (obj_controller) { + if ((!is_daemon) || ((diplomacy != 4) && (diplomacy != 5) && (diplomacy != 2))) { + scr_dialogue("artifact_thanks"); + } + if (is_daemon && ((diplomacy == 4) || (diplomacy == 5) || (diplomacy == 2))) { + scr_dialogue("artifact_daemon"); + } + } + } + if ((inq_hide == 2) && (obj_controller.diplomacy == 4)) { + with (obj_controller) { + scr_dialogue("artifact_returned"); + } + } + + if (artifact_struct.has_tag("MINOR")) { + if (giveto == eFACTION.Imperium) { + obj_controller.disposition[eFACTION.Imperium] += 6; + } + if (giveto == 3) { + obj_controller.disposition[3] += 4; + } + if ((giveto == 4) && (inq_hide != 2)) { + obj_controller.disposition[4] += 4; + } + + if ((giveto == 4) && (inq_hide == 2)) { + obj_controller.disposition[4] += 2; + } + + if ((giveto == 5) && (!is_daemon)) { + obj_controller.disposition[5] += 4; + var o = 0; + if (scr_has_adv("Reverent Guardians")) { + obj_controller.disposition[5] += 2; + } + } + if (giveto == 6) { + obj_controller.disposition[6] += 3; + } + if (giveto == 8) { + obj_controller.disposition[8] += 4; + } + } + + // Need to modify ^^^^ based on if it is chaos or daemonic + + if (giveto == 2) { + if (is_daemon) { + var v = 0, ev = 0; + for (var v = 1; v < array_length(obj_controller.event); v++) { + if ((ev == 0) && (obj_controller.event[v] == "")) { + ev = v; + } + } + obj_controller.event[ev] = "imperium_daemon"; + obj_controller.event_duration[ev] = 1; + with (obj_star) { + for (var i = 1; i <= planets; i++) { + if (p_owner[i] == 2) { + p_heresy[i] += choose(30, 40, 50, 60); + } + } + } + } + if (is_chaos) { + with (obj_star) { + for (var i = 1; i <= planets; i++) { + if ((p_owner[i] == 2) && (p_heresy[i] > 0)) { + p_heresy[i] += 10; + } + } + } + } + obj_controller.disposition[2] += 4; + } else if (giveto == 8) { + if (is_daemon) { + with (obj_star) { + for (var i = 1; i <= planets; i++) { + if (p_owner[i] == 8) { + p_heresy[i] += 40; + } + } + } + } + } + delete_artifact(arti_index); + instance_destroy(); + exit; + } + } + + var zoom = 0; + if (instance_exists(obj_controller)) { + zoom = obj_controller.zoomed; + } + if (((zoom == 0) && (type <= 4)) || (type == 98)) { + var widd, image_bot, y_scale_mod; + image_bot = 0; + y_scale_mod = 1; + + if ((size == 0) || (size == 2)) { + sprite_index = spr_popup_medium; + image_alpha = 0; + widd = sprite_width - 50; + draw_sprite_ext(spr_popup_medium, type, xx + ((1600 - sprite_width) / 2), yy + ((900 - sprite_height) / 2), 1, y_scale, 0, c_white, 1); + if (image != "") { + image_wid = 100; + image_hei = 100; + } + } else if (size == 1) { + sprite_index = spr_popup_small; + image_alpha = 0; + widd = sprite_width - 10; + draw_sprite_ext(spr_popup_small, type, xx + ((1600 - sprite_width) / 2), yy + ((900 - sprite_height) / 2), 1, y_scale, 0, c_white, 1); + if (image != "") { + image_wid = 150; + image_hei = 150; + } + } else if (size == 3) { + var draw_y_scale = y_scale; + sprite_index = spr_popup_large; + image_alpha = 0; + widd = sprite_width - 50; + if (image == "debug") { + y_scale_mod = 1.5; + draw_y_scale = y_scale * y_scale_mod; + } + draw_sprite_ext(spr_popup_large, type, xx + ((1600 - sprite_width) / 2), yy + ((900 - sprite_height * y_scale_mod) / 2), 1, draw_y_scale, 0, c_white, 1); + if (image != "") { + image_wid = 200; + image_hei = 200; + } + } + + if (image_wid > 0) { + widd -= image_wid + 10; + } + + var x1, y1; + x1 = xx + ((1600 - sprite_width) / 2); + y1 = yy + ((900 - sprite_height * y_scale_mod) / 2); + + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_center); + draw_set_color(38144); + + if (fancy_title == 1) { + draw_set_font(fnt_fancy); + if (type == 1) { + draw_set_color(255); + } + } + draw_text_transformed(x1 + (sprite_width / 2), y1 + (sprite_height * 0.07), string_hash_to_newline(string(title)), 1.1, 1.1, 0); + // draw_text(xx+320.5,yy+123.5,string(title)); + + draw_set_font(fnt_40k_14); + draw_set_halign(fa_left); + draw_set_color(38144); + + if (instance_exists(obj_turn_end)) { + if (obj_turn_end.popups > 0) { + draw_text(x1 + 20, y1 + (sprite_height * 0.07), string_hash_to_newline(string(obj_turn_end.current_popup) + "/" + string(obj_turn_end.popups))); + } + } + if (image == "debug") { + draw_text_ext(x1 + 20, y1 + (sprite_height * 0.18), string_hash_to_newline(string(text)), -1, sprite_width - 40); + } else if (image == "") { + if (size == 1) { + draw_text_ext(x1 + 5, y1 + (sprite_height * 0.18), string_hash_to_newline(string(text)), -1, widd); + } + if (size != 1) { + draw_text_ext(x1 + 25, y1 + (sprite_height * 0.18), string_hash_to_newline(string(text)), -1, widd); + } + str_h = string_height_ext(string_hash_to_newline(string(text)), -1, widd) + (sprite_height * 0.18); + } else if (image != "") { + if (size == 1) { + draw_text_ext(x1 + 15 + image_wid, y1 + (sprite_height * 0.18), string_hash_to_newline(string(text)), -1, widd); + } + if (size != 1) { + draw_text_ext(x1 + 35 + image_wid, y1 + (sprite_height * 0.18), string_hash_to_newline(string(text)), -1, widd); + } + str_h = string_height_ext(string_hash_to_newline(string(text)), -1, widd) + (sprite_height * 0.18); + } + + // if (image!="") then draw_text_ext(x1+126+150,y1+152,string(text),-1,384-150); + // if (text2!="") then draw_text_ext(x1+126,y1+309,string(text2),-1,384); + // TODO change this into an array in a function (like romanNumerals does in here) + var img = -1; + if (image == "") { + img = -1; + } + if (image == "orks") { + img = 0; + } + if (image == "tau") { + img = 1; + } + if (image == "chaos") { + img = 2; + } + if (image == "shadow") { + img = 3; + } + if (image == "distinguished") { + img = 4; + } + if (image == "tech_build") { + img = 5; + } + if (image == "sororitas") { + img = 6; + } + if (image == "angry") { + img = 7; + } + if (image == "gene_bad") { + img = 8; + } + if (image == "lost_warp") { + img = 10; + } + if (image == "Warp") { + img = 11; + } + if (image == "crusade") { + img = 12; + } + if (image == "fuklaw") { + img = 13; + } + if ((image == "artifact") || (image == "artifact2")) { + img = 14; + } + if (image == "artifact_recovered") { + img = 15; + } + if (image == "artifact_given") { + img = 15; + } + if (image == "waaagh") { + img = 16; + } + if (image == "shipyard") { + img = 17; + } + if (image == "inquisition") { + img = 18; + } + if (image == "succession") { + img = 19; + } + if (image == "rogue_trader") { + img = 20; + } + if (image == "necron_tomb") { + img = 21; + } + if (image == "webber") { + img = 22; + } + if (image == "spyrer") { + img = 23; + } + if (image == "fortress") { + img = 24; + } + if (image == "fortress_hive") { + img = 25; + } + if (image == "fortress_death") { + img = 26; + } + if (image == "fortress_ice") { + img = 27; + } + if (image == "fortress_lava") { + img = 28; + } + if (image == "fortress_dorf") { + img = 29; + } + if (image == "exploding_ship") { + img = 30; + } + if (image == "necron_cave") { + img = 31; + } + if (image == "exterminatus_new") { + img = 32; + } + if (image == "necron_tunnels_1") { + img = 33; + } + if (image == "necron_tunnels_2") { + img = 34; + } + if (image == "necron_tunnels_3") { + img = 35; + } + if (image == "necron_army") { + img = 36; + } + if (image == "harlequin") { + img = 37; + } + if (image == "black_rage") { + img = 39; + } + if (image == "exterminatus") { + img = 40; + } + if (image == "stc") { + img = 41; + } + if (image == "thallax") { + img = 42; + } + if (image == "space_hulk_done") { + img = 44; + } + if (image == "ancient_ruins") { + img = 45; + } + if (image == "geneseed_lab") { + img = 47; + } + if (image == "ruins_bunker") { + img = 48; + } + if (image == "ruins_fort") { + img = 49; + } + if (image == "ruins_ship") { + img = 50; + } + if (image == "fallen") { + img = 51; + } + if (image == "debug_banshee") { + img = 52; + } + if (image == "mechanicus") { + img = 53; + } + if (image == "chaos_cultist") { + img = 54; + } + if (image == "chaos_symbol") { + img = 55; + } + if (image == "chaos_messenger") { + img = 56; + } + if (image == "event_feast") { + img = 57; + } + if (image == "event_tournament") { + img = 58; + } + if (image == "event_deathmatch") { + img = 59; + } + if (image == "event_mass") { + img = 60; + } + if (image == "event_ccult") { + img = 61; + } + if (image == "event_crelic") { + img = 62; + } + if (image == "event_march") { + img = 63; + } + + if ((img != -1) && (image != "") && (image_wid > 0)) { + var sh = 999; + if (size == 1) { + sh = 24; + scr_image("popup", img, x1 + 5, y1 + sh + 24, image_wid, image_hei); + } + if (size >= 2) { + sh = 24; + scr_image("popup", img, x1 + 25, y1 + sh + 24, image_wid, image_hei); + } + + image_bot = (sprite_height * 0.07) + image_hei + 5; + } + + if ((option1 != "") && (string_count("Servitors and Skitarii", option1) == 0)) { + var tox = "1. " + string(option1); + if (option2 != "") { + tox += "#2. " + string(option2); + } + if (option3 != "") { + tox += "#3. " + string(option3); + } + + var top = y1 + 0.5 + (sprite_height * 0.6); + if (str_h != 0) { + top = y1 + str_h + 20; + } + if (image != "") { + top = max(top, y1 + image_bot); + } + + draw_text_ext(x1 + 25.5, top, string_hash_to_newline(" Choices:"), -1, widd); + draw_text_ext(x1 + 25, top + 0.5, string_hash_to_newline(" Choices:"), -1, widd); + + var sz = 0, sz2 = 0, oy = y1, t8 = 0; + if (str_h != 0) { + y1 += str_h + 20; + y1 -= sprite_height * 0.6; + } + + y1 = top; + + if (option1 != "") { + draw_text_ext(x1 + 25.5, y1 + 20, string_hash_to_newline("1. " + string(option1)), -1, widd); + } + + sz = string_height_ext(string_hash_to_newline("1. " + string(option1)), -1, widd); + if (option2 != "") { + draw_text_ext(x1 + 25.5, y1 + 20 + sz, string_hash_to_newline("2. " + string(option2)), -1, widd); + } + + sz2 = string_height_ext(string_hash_to_newline("1. " + string(option1)), -1, widd); + sz2 += string_height_ext(string_hash_to_newline("2. " + string(option2)), -1, widd); + if (option3 != "") { + draw_text_ext(x1 + 25.5, y1 + 20 + sz2, string_hash_to_newline("3. " + string(option3)), -1, widd); + } + + if (option1 != "") { + t8 = (y1 + 20) + 5; + } + if (option2 != "") { + t8 = (y1 + 20 + sz) + 5; + } + if (option3 == "") { + t8 = (y1 + 20 + sz2 + string_height_ext(string_hash_to_newline("3. " + string(option3)), -1, widd)) + 5; + } + + if ((option1 != "") && (mouse_x >= x1) && (mouse_y >= y1 + 21) && (mouse_x <= x1 + 30 + string_width_ext(string_hash_to_newline("1. " + string(option1)), -1, widd)) && (mouse_y < y1 + 39)) { + option1enter = true; + draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21); + if (mouse_check_button(mb_left)) { + press = 1; + } + } else { + option1enter = false; + } + if ((option2 != "") && (mouse_x >= x1) && (mouse_y >= y1 + 21 + sz) && (mouse_x <= x1 + 30 + string_width_ext(string_hash_to_newline("2. " + string(option2)), -1, widd)) && (mouse_y < y1 + 39 + sz)) { + option2enter = true; + draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21 + sz); + if (mouse_check_button(mb_left)) { + press = 2; + } + } else { + option2enter = false; + } + if ((option3 != "") && (mouse_x >= x1) && (mouse_y >= y1 + 21 + sz2) && (mouse_x <= x1 + 30 + string_width_ext(string_hash_to_newline("3. " + string(option3)), -1, widd)) && (mouse_y < y1 + 39 + sz2)) { + option3enter = true; + draw_sprite(spr_popup_select, 0, x1 + 8.5, y1 + 21 + sz2); + if (mouse_check_button(mb_left)) { + press = 3; + } + } else { + option3enter = false; + } + if (image == "new_forge_master") { + var new_master_image = false; + if (pathway == "selection_options") { + if (option1enter) { + new_master_image = techs[charisma_pick].draw_unit_image(); + techs[charisma_pick].stat_display(); + } else if (option2enter) { + new_master_image = techs[talent_pick].draw_unit_image(); + techs[talent_pick].stat_display(); + } else if (option3enter) { + new_master_image = techs[experience_pick].draw_unit_image(); + techs[experience_pick].stat_display(); + } + if (is_struct(new_master_image)) { + new_master_image.draw(xx + 1208, yy + 210, true); + } + } + } + if (t8 < (oy + sprite_height)) { + y_scale = t8 / (oy + sprite_height); + } + if (t8 > (oy + sprite_height)) { + y_scale = t8 / (oy + sprite_height); + } + } + } + + // ** Equip Artifact ** + if ((type == 8) && instance_exists(obj_controller)) { + var x2 = xx + 951; + var y2 = yy + 48; + var before = target_comp; + var temp_alpha = 1; + arti = obj_ini.artifact_struct[obj_controller.menu_artifact]; + + // draw_sprite(spr_popup_large,0,x2,y2); + + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_center); + draw_set_color(c_gray); + + draw_text(x2 + 312, y2 + 26, $"Equip Artifact ({obj_ini.artifact[obj_controller.menu_artifact]})"); + // draw_text(x2+320.5,yy+123.5,"Equip Artifact ("+string(obj_ini.artifact[obj_controller.menu_artifact])+")"); + + draw_set_font(fnt_40k_12); + draw_set_halign(fa_left); + draw_text(x2 + 31, y2 + 35, "Select Company:"); + + // Draw HQ button + temp_alpha = (target_comp == 0) ? 1 : 0.5; + var hq_text = $"HQ"; + var hq_button = draw_unit_buttons([x2 + 60, y2 + 75, x2 + 60 + 60, y2 + 75 + 20], hq_text, [1, 1], , , fnt_40k_12, temp_alpha); // Position for HQ + if (point_and_click(hq_button)) { + target_comp = 0; + } + + // Draw other company buttons + for (var i = 1; i < 11; i++) { + temp_alpha = (target_comp == i) ? 1 : 0.5; + var item_text = $"{romanNumerals[i - 1]}"; + var x_offset = x2 + 141 + (81 * (i - (i < 6 ? 1 : 6))); + var y_offset = y2 + (i < 6 ? 60 : 90); + var company_button = draw_unit_buttons([x_offset, y_offset, x_offset + 60, y_offset + 20], item_text, [1, 1], , , fnt_40k_12, temp_alpha); + if (point_and_click(company_button)) { + target_comp = i; + } + } + + if (before != target_comp) { + units = 0; + with (obj_controller) { + if (obj_popup.target_comp > 0) { + scr_company_view(obj_popup.target_comp); + } + if (obj_popup.target_comp == 0) { + scr_special_view(0); + } + } + var i; + i = -1; + repeat (array_length(obj_controller.display_unit)) { + i += 1; + obj_controller.man_sel[i] = 0; + } + i = -1; + } + + // Weapon slot buttons + if (arti.determine_base_type() == "weapon") { + draw_text(x2 + 30, y2 + 128, "Replace:"); + + temp_alpha = (target_role == 1) ? 1 : 0.5; + if (point_and_click(draw_unit_buttons([x2 + 150, y2 + 120, x2 + 150 + 120, y2 + 120 + 20], $"1st Weapon", [1, 1], , , fnt_40k_12, temp_alpha))) { + target_role = 1; + } + + temp_alpha = (target_role == 2) ? 1 : 0.5; + if (point_and_click(draw_unit_buttons([x2 + 300, y2 + 120, x2 + 300 + 120, y2 + 120 + 20], $"2nd Weapon", [1, 1], , , fnt_40k_12, temp_alpha))) { + target_role = 2; + } + } else { + target_role = 3; + } + + // Soldier list + draw_set_font(fnt_40k_12); + draw_rectangle(x2 + 29, y2 + 160, x2 + 569, y2 + 363 + 356, 1); // Main rectangle? + scr_scrollbar(1520, 220, 1543, 761, 23, obj_controller.man_max, obj_controller.man_current); + draw_rectangle(x2 + 569, y2 + 171, x2 + 592, y2 + 357 + 356, 1); // Inside of scroll + draw_rectangle(x2 + 569, y2 + 150, x2 + 592, y2 + 378 + 356, 1); // Outside of scroll + draw_sprite_stretched(spr_arrow, 2, x2 + 569, y2 + 150, 23, 22); + draw_sprite_stretched(spr_arrow, 3, x2 + 569, y2 + 357 + 356, 23, 22); + + if (target_comp != -1) { + var top, sel, temp1, temp2, temp3, temp4, temp5; + temp1 = ""; + temp2 = ""; + temp3 = ""; + temp4 = ""; + temp5 = ""; + top = obj_controller.man_current; + sel = top; + var unit_x = x2; + var unit_y = y2; + var ma_ar, ma_we1, ma_we2, ma_ge, ma_mb, ttt; + ma_ar = ""; + ma_we1 = ""; + ma_we2 = ""; + ma_ge = ""; + ma_mb = ""; + ttt = 0; + + repeat (min(obj_controller.man_max, 23)) { + if (sel >= array_length(obj_controller.man)) { + break; + } + if (obj_controller.man[sel] == "man") { + var unit = obj_controller.display_unit[sel]; + temp1 = unit.name_role(); + temp2 = obj_controller.ma_loc[sel]; + if (obj_controller.ma_wid[sel] != 0) { + temp2 += scr_roman_numerals()[obj_controller.ma_wid[sel] - 1]; + } + if (obj_controller.ma_health[sel] >= 100) { + temp3 = "Unwounded"; + } + if ((obj_controller.ma_health[sel] >= 70) && (obj_controller.ma_health[sel] < 100)) { + temp3 = "Lightly Wounded"; + } + if ((obj_controller.ma_health[sel] >= 40) && (obj_controller.ma_health[sel] < 70)) { + temp3 = "Wounded"; + } + if ((obj_controller.ma_health[sel] >= 8) && (obj_controller.ma_health[sel] < 40)) { + temp3 = "Badly Wounded"; + } + if (obj_controller.ma_health[sel] < 8) { + temp3 = "CRITICAL"; + } + temp4 = string(obj_controller.ma_exp[sel]) + " exp"; + + ma_ar = unit.armour(); + ma_we1 = unit.weapon_two(); + ma_we2 = unit.weapon_one(); + ma_ge = unit.gear(); + ma_mb = unit.mobility_item(); + ttt = 0; + + if (obj_controller.ma_gear[sel] != "") { + temp5 = "((" + string(ma_ar) + " + " + string(ma_mb) + ")) | " + string(ma_we1) + " | " + string(ma_we2) + " + (" + string(ma_ge) + ")"; + } + if (obj_controller.ma_gear[sel] == "") { + temp5 = "((" + string(ma_ar) + " + " + string(ma_mb) + ")) | " + string(ma_we1) + " | " + string(ma_we2) + ""; + } + } + if (obj_controller.man[sel] == "vehicle") { + temp1 = string(obj_controller.ma_role[sel]); + temp2 = string(obj_controller.ma_loc[sel]); + if (obj_controller.ma_wid[sel] != 0) { + temp2 += scr_roman_numerals()[obj_controller.ma_wid[sel] - 1]; + } + temp3 = "Undamaged"; + temp4 = ""; + temp5 = "(" + string(obj_controller.ma_wep1[sel]) + " | " + string(obj_controller.ma_wep2[sel]) + " | " + string(obj_controller.ma_gear[sel]) + ")"; + } + + if (obj_controller.man_sel[sel] == 0) { + draw_set_color(c_black); + } + if (obj_controller.man_sel[sel] != 0) { + draw_set_color(6052956); + } + draw_rectangle(unit_x + 29, unit_y + 150, unit_x + 569, unit_y + 175.4, 0); + draw_set_color(c_gray); + draw_rectangle(unit_x + 29, unit_y + 150, unit_x + 569, unit_y + 175.4, 1); + + // if (obj_controller.man[sel]="man") and (obj_controller.ma_promote[sel]>0) then draw_set_color(c_yellow); + if (ma_ar == "") { + draw_set_alpha(0.5); + } + draw_text_transformed(unit_x + 32, unit_y + 151, string_hash_to_newline(string(temp1)), 1, 1, 0); + draw_text_transformed(unit_x + 32.5, unit_y + 151.5, string_hash_to_newline(string(temp1)), 1, 1, 0); + draw_set_color(c_gray); + draw_set_alpha(1); + + /* if (string_count("Chapter Master",temp1)>0){ draw_text_transformed(xx+27+16,unit_y+64,string(temp1),0.7,0.7,0);draw_text_transformed(xx+28+16,unit_y+64,string(temp1),0.7,0.7,0); draw_text_transformed(xx+27+16,unit_y+65,string(temp1),0.7,0.7,0);draw_text_transformed(xx+28+16,unit_y+65,string(temp1),0.7,0.7,0); @@ -550,834 +805,1034 @@ if (type = 8) and (instance_exists(obj_controller)) { draw_sprite(spr_inspect_small,0,xx+27,unit_y+68); } */ - - draw_text_transformed(unit_x+271,unit_y+151,string_hash_to_newline(string(temp2)),1,1,0); - if (obj_controller.man[sel]="man") and (obj_controller.ma_lid[sel]=0) then draw_text_transformed(unit_x+271,unit_y+151,string_hash_to_newline(string(temp2)),1,1,0); - if (obj_controller.man[sel]="vehicle") and (obj_controller.ma_lid[sel]=0) then draw_text_transformed(unit_x+271,unit_y+151,string_hash_to_newline(string(temp2)),1,1,0); - - if (temp3="CRITICAL") then draw_set_color(c_red); - draw_text_transformed(unit_x+400,unit_y+151,string_hash_to_newline(string(temp3)),1,1,0); - draw_set_color(c_gray); - - draw_text_transformed(unit_x+506,unit_y+151,string_hash_to_newline(string(temp4)),1,1,0); - - draw_set_color(c_gray); - if (string_count("Artifact",temp5)>0) then draw_set_color(881503); - draw_text_transformed(unit_x+38,unit_y+164,string_hash_to_newline(string(temp5)),1,1,0);draw_set_color(38144); - - if (point_and_click([unit_x+29,unit_y+150,unit_x+569,unit_y+175.4])) { - if (obj_controller.man_sel[sel] = 0) { - units = 1; - if (prev_selected != 0) { - obj_controller.man_sel[prev_selected] = 0; - } - obj_controller.man_sel[sel] = 1; - prev_selected = sel; - } else if (obj_controller.man_sel[sel] = 1) { - units = 0; - obj_controller.man_sel[sel] = 0; - } - } - unit_y+=25.4; - sel+=1; - } - } - - if (target_role > 0) and (target_comp != -1) and (units = 1) then all_good = 1 - else all_good = 0; - if (arti.determine_base_type() == "weapon" && target_role > 2) then all_good = 0; - - // Screen bottom buttons and shit - // - var screen_bottom_x = x2; - var screen_bottom_y = y2 + 350; - draw_set_alpha(1); - draw_set_font(fnt_small); - draw_set_color(c_gray); - draw_rectangle(screen_bottom_x+121,screen_bottom_y+393,screen_bottom_x+231,screen_bottom_y+414,1); - draw_set_alpha(0.5); - draw_rectangle(screen_bottom_x+122,screen_bottom_y+394,screen_bottom_x+230,screen_bottom_y+413,1); - - if (all_good=1){ - draw_set_alpha(1); - draw_rectangle(screen_bottom_x+408,screen_bottom_y+393,screen_bottom_x+518,screen_bottom_y+414,1); - draw_set_alpha(0.5); - draw_rectangle(screen_bottom_x+409,screen_bottom_y+394,screen_bottom_x+517,screen_bottom_y+413,1); - } - if (all_good!=1){ - draw_set_alpha(0.25); - draw_rectangle(screen_bottom_x+408,screen_bottom_y+393,screen_bottom_x+518,screen_bottom_y+414,1); - draw_rectangle(screen_bottom_x+409,screen_bottom_y+394,screen_bottom_x+517,screen_bottom_y+413,1); - } - - draw_set_alpha(1); - - draw_set_halign(fa_center); - draw_text(screen_bottom_x+173,screen_bottom_y+397,string_hash_to_newline("Cancel"));draw_text(screen_bottom_x+173.5,screen_bottom_y+397.5,string_hash_to_newline("Cancel")); - - if (all_good=1){ - draw_text(screen_bottom_x+464,screen_bottom_y+397,string_hash_to_newline("Equip!")); - draw_text(screen_bottom_x+464.5,screen_bottom_y+397.5,string_hash_to_newline("Equip!")); - if point_and_click([screen_bottom_x+430, screen_bottom_y+393,screen_bottom_x+518,screen_bottom_y+414]){ - obj_controller.cooldown=8000; - - var i=-1,this=0,dwarn=false,unit; - var arti_index = obj_controller.menu_artifact; - var arti = obj_ini.artifact_struct[arti_index]; - var arti_base = arti.type(); - repeat(min(obj_controller.man_max,23)){ - i+=1; - if (this=0) and (obj_controller.man_sel[i]=1) then this=i; - } - i=this; - - if (obj_controller.man[i]!="") and (obj_controller.man_sel[i]){ - var replace=""; - - if (target_role=1) then replace="weapon1"; - if (target_role=2) then replace="weapon2"; - if (target_role>2){ - if (gear_weapon_data("armour", arti_base)!=false){ - replace="armour"; - } else if (gear_weapon_data("gear", arti_base)!=false){ - replace="gear"; - } else if (gear_weapon_data("mobility", arti_base)!=false){ - replace="mobility"; - } - } - if (replace="armour") and (obj_controller.ma_race[i]>5){ - cooldown=8; - obj_controller.cooldown=8; - exit; - } - - if (target_comp>10) then target_comp=0; - - unit=obj_ini.TTRPG[target_comp][obj_controller.ide[i]]; - if (arti.has_tag("Daemonic") || arti.has_tag("Chaos")){ - unit.corruption+=irandom(10+2); - if (unit.role()=="Chapter Master"){ - dwarn=true; - } - } - - if (replace="armour"){ - unit.update_armour(arti_index); - }else if (replace="gear"){ - unit.update_gear(arti_index); - } - if (replace="mobility"){ - unit.update_mobility_item(arti_index); - } - if (replace="weapon1"){ - unit.update_weapon_one(arti_index); - } - if (replace="weapon2"){ - unit.update_weapon_two(arti_index); - } - var g=arti_index; - obj_controller.cooldown=10; - - //if (obj_controller.menu_artifact>obj_controller.artifacts) then obj_controller.menu_artifact=obj_controller.artifacts; - if (dwarn=true){ - var pip=instance_create(0,0,obj_popup); - pip.title="Daemon Artifacts"; - pip.text="Some artifacts, like the one you now wield, are a blasphemous union of the Materium's matter and the Immaterium's spirit, containing the essence of a bound daemon. While they may offer great power, and enhanced perception, they are known to whisper poisonous lies to the wielder. The path to damnation begins with good intentions, and many times artifacts such as these have been the cause."; - pip.image=""; - pip.cooldown=8; - obj_controller.cooldown=8; - } - - - instance_destroy();exit; - } - } - } - if (all_good!=1){ - draw_set_alpha(0.25); - draw_text(screen_bottom_x+464,screen_bottom_y+397,"Equip!"); - draw_text(screen_bottom_x+464.5,screen_bottom_y+397.5,"Equip!"); - } - draw_set_alpha(1); - -} - -var xx,yy; -xx=__view_get( e__VW.XView, 0 ); -yy=__view_get( e__VW.YView, 0 ); - -// Changing Equipment -if (zoom=0) and (type=6) and (instance_exists(obj_controller)){ - draw_set_color(0);draw_rectangle(xx+1006,yy+143,xx+1577,yy+518,0); - - draw_set_font(fnt_40k_14b); - draw_set_halign(fa_center); - draw_set_color(c_gray); - - draw_text(xx+1292,yy+145,"Change Equipment"); - - draw_set_font(fnt_40k_12); - var comp=""; - if (company <= 10 and company > 0) { - comp=romanNumerals[company-1]; - } - else if (company>10) then comp="HQ"; - - if (vehicle_equipment=0) then draw_text(xx+1292,yy+170,$"{comp} Company, {units} Marines"); - if (vehicle_equipment=1) then draw_text(xx+1292,yy+170,$"{comp} Company, {units} Vehicles"); - - draw_set_halign(fa_left); - draw_set_color(c_gray); - - draw_rectangle(xx+1010,yy+215,xx+1288,yy+315,1); - draw_rectangle(xx+1574,yy+215,xx+1296,yy+315,1); - - - var show_name=""; - // Need to not show the artifact tags here somehow - - draw_text(xx+1010,yy+195,"Before"); - draw_text(xx+1010.5,yy+195.5,"Before"); - - show_name=o_wep1; - if (a_wep1!="") then show_name=a_wep1; - if (o_wep1!="") then draw_text(xx+1014,yy+215,string_hash_to_newline(show_name)); - else draw_text(xx+1014,yy+215,"(None)"); - - show_name=o_wep2; - if (a_wep2!="") then show_name=a_wep2; - if (o_wep2!="") then draw_text(xx+1014,yy+235,string_hash_to_newline(string(show_name))); - else draw_text(xx+1014,yy+235,"(None)"); - - show_name=o_armour; - if (a_armour!="") then show_name=a_armour; - if (o_armour!="") then draw_text(xx+1014,yy+255,string_hash_to_newline(string(show_name))); - else draw_text(xx+1014,yy+255,"(None)"); - - show_name=o_gear; - if (a_gear!="") then show_name=a_gear; - if (o_gear!="") then draw_text(xx+1014,yy+275,string_hash_to_newline(string(show_name))); - else draw_text(xx+1014,yy+275,"(None)"); - - show_name=o_mobi; - if (a_mobi!="") then show_name=a_mobi; - if (o_mobi!="") then draw_text(xx+1014,yy+295,string_hash_to_newline(string(show_name))); - else draw_text(xx+1014,yy+295,"(None)"); - - draw_text(xx+1296,yy+195,string_hash_to_newline("After")); - draw_text(xx+1296.5,yy+195.5,"After"); - - draw_set_color(c_gray); - if (n_good1=0) then draw_set_color(255); - show_name=n_wep1; - if (a_wep1!="") and (n_wep1=o_wep1) then show_name=a_wep1; - if (n_wep1!="") then draw_text(xx+1300,yy+215,string_hash_to_newline(string(show_name))); - else draw_text(xx+1300,yy+215,string_hash_to_newline("(None)")); - - draw_set_color(c_gray); - if (n_good2=0) then draw_set_color(255); - show_name=n_wep2; - if (a_wep2!="") and (n_wep2=o_wep2) then show_name=a_wep2; - if (n_wep2!="") then draw_text(xx+1300,yy+235,string_hash_to_newline(string(show_name))); - else draw_text(xx+1300,yy+235,string_hash_to_newline("(None)")); - - draw_set_color(c_gray); - if (n_good3=0) then draw_set_color(255); - show_name=n_armour; - if (a_armour!="") and (n_armour=o_armour) then show_name=a_armour; - if (n_armour!="") then draw_text(xx+1300,yy+255,string_hash_to_newline(string(show_name))); - else draw_text(xx+1300,yy+255,string_hash_to_newline("(None)")); - - draw_set_color(c_gray); - if (n_good4=0) then draw_set_color(255); - show_name=n_gear; - if (a_gear!="") and (n_gear=o_gear) then show_name=a_gear; - if (n_gear!="") then draw_text(xx+1300,yy+275,string_hash_to_newline(string(show_name))); - else draw_text(xx+1300,yy+275,string_hash_to_newline("(None)")); - - draw_set_color(c_gray); - if (n_good5=0) then draw_set_color(255); - show_name=n_mobi; - if (a_mobi!="") and (n_mobi=o_mobi) then show_name=a_mobi; - if (n_mobi!="") then draw_text(xx+1300,yy+295,string_hash_to_newline(string(show_name))); - else draw_text(xx+1300,yy+295,string_hash_to_newline("(None)")); - - draw_set_color(c_gray); - - for (var i=1;i<=5;i++){ - if (target_comp==i){ - draw_text(xx+1292,yy+195+(20*i),"->"); - break; - } - } - - - if (mouse_x>=xx+1296) and (mouse_x=yy+215) and (mouse_y=yy+235) and (mouse_y=yy+255) and (mouse_y=yy+275) and (mouse_y=yy+295) and (mouse_y6){ - column=0; - row++; - } - } - - if (top!=0){ - warning="";// Add have right here? - if (target_comp=1){n_wep1=item_name[top];sel1=top;} - if (target_comp=2){n_wep2=item_name[top];sel2=top;} - if (target_comp=3){n_armour=item_name[top];sel3=top;} - if (target_comp=4){n_gear=item_name[top];sel4=top;} - if (target_comp=5){n_mobi=item_name[top];sel5=top;} - } - - if (target_comp=1) and ((n_wep1="(None)") or (n_wep1="")){n_good1=1;} - if (target_comp=2) and ((n_wep2="(None)") or (n_wep2="")){n_good2=1;} - if (target_comp=3) and ((n_armour="(None)") or (n_armour="")){n_good3=1;} - if (target_comp=4) and ((n_gear="(None)") or (n_gear="")){n_good4=1;} - if (target_comp=5) and ((n_mobi="(None)") or (n_mobi="")){n_good5=1;} - // Removed EXIT; from each of these - - - // if (n_wep1=n_wep2){if (o_wep1=n_wep1) and (o_wep2!=n_wep2) then have_wep2_num-=1;if (o_wep2=n_wep2) and (o_wep1!=n_wep1) then have_wep1_num-=1;} - var weapon_one_data = gear_weapon_data("weapon",n_wep1); - var weapon_two_data = gear_weapon_data("weapon",n_wep2); - var armour_data = gear_weapon_data("armour",n_armour); - - - if (target_comp=1) and (is_struct(weapon_one_data)){// Check numbers - req_wep1_num=units;have_wep1_num=0; - var i=-1; - repeat(array_length(obj_controller.display_unit)){i+=1; - if (vehicle_equipment!=-1) and (obj_controller.ma_wep1[i]=n_wep1) then have_wep1_num+=1; - } - // req_wep1_num+=scr_item_count(n_wep1); - have_wep1_num+=scr_item_count(n_wep1); - // req_wep1_num=units; - if (have_wep1_num>=req_wep1_num) or (n_wep1="(None") then n_good1=1; - if (have_wep1_num0){ - var g=-1,exp_check=0; - for (var g=0;g=req_wep2_num) or (n_wep2="(None") then n_good2=1; - if (have_wep2_num0){ - var g,exp_check;g=-1;exp_check=0; - for (var g=0;g 0) or(string_count("Tartaros", n_armour) > 0) or(string_count("Dreadnought", n_armour) > 0)) and(n_mobi != "") then n_good2 = 0; - if ((string_count("Terminator", o_armour) > 0) or(string_count("Tartaros", o_armour) > 0) or(string_count("Dreadnought", o_armour) > 0)) and(n_mobi != "") then n_good2 = 0; - } - } - if (target_comp=3) and (is_struct(armour_data)){// Check numbers - req_armour_num=units; - have_armour_num=0; - var i;i=-1; - repeat(array_length(obj_controller.display_unit)){i+=1; - if (vehicle_equipment!=-1) and (obj_controller.man_sel[i]=1) and (obj_controller.ma_armour[i]=n_armour) then have_armour_num+=1; - } - have_armour_num+=scr_item_count(n_armour); - - if (have_armour_num>=req_armour_num) or (n_armour="(None") then n_good3=1; - if (have_armour_num0){ - var g,exp_check;g=-1;exp_check=0; - for (var g=0;g0) and (string_count("Dread",n_armour)=0){ - n_good4=0; - warning="Marines may not exit Dreadnoughts."; - } - - } - if (target_comp=4) and (n_gear!="Assortment") and (n_gear!="(None)"){// Check numbers - req_gear_num=units;have_gear_num=0; - var i;i=-1; - repeat(array_length(obj_controller.display_unit)){i+=1; - if (vehicle_equipment!=-1) and (obj_controller.man_sel[i]=1) and (obj_controller.ma_gear[i]=n_gear) then have_gear_num+=1; - } - have_gear_num+=scr_item_count(n_gear); - - if (have_gear_num>=req_gear_num) or (n_gear="(None") then n_good4=1; - if (have_gear_num0){ - n_good4=0; - warning="Dreadnoughts may not use infantry equipment."; - } - } - if (target_comp=5) and (n_mobi!="Assortment") and (n_mobi!="(None)"){// Check numbers - req_mobi_num=units;have_mobi_num=0; - var i;i=-1; - repeat(array_length(obj_controller.display_unit)){i+=1; - if (vehicle_equipment!=-1) and (obj_controller.man_sel[i]=1) and (obj_controller.ma_mobi[i]=n_mobi) then have_mobi_num+=1; - } - have_mobi_num+=scr_item_count(n_mobi); - - if (have_mobi_num>=req_mobi_num) or (n_mobi="(None") then n_good5=1; - if (have_mobi_num 0) { - comp=romanNumerals[company-1]; - } - else if (company>10) then comp="HQ"; - draw_text(xx+1292,yy+170,string_hash_to_newline(string(comp)+" Company "+string(unit_role))); - - draw_set_halign(fa_left); - draw_set_color(c_gray); - draw_text(xx+1014,yy+210,string_hash_to_newline("Target Company:")); - - var check=" "; - draw_set_alpha(1); - - // HQ Company - if (target_comp=0) or (target_comp>10) then check="x"; - draw_text(xx+1470,yy+210,string_hash_to_newline("HQ ["+string(check)+"]")); - check=" "; - // if (obj_controller.command_set[1]!=0 && !is_specialist(unit_role, "libs")){ - for (i=1;i<=10;i++){ - var comp_data = company_promote_data[i-1]; - if (obj_controller.command_set[2]==1){//cecks if exp requirements are activated - if (min_exp=role_exp[r]){ - target_role=r; - calculate_equipment_needs(); - all_good=1; - cooldown=8; - } - } - if (r%3==0){ - role_y+=20 - role_x=0; - } else { - role_x+=170; - } - } - } - } - - draw_set_alpha(1); - - draw_text(xx+1014,yy+370,string_hash_to_newline("Required Gear:")); - var gr=0,tox=""; - - if (target_role>0){ - if (req_armour!=""){ - gr=req_armour_num-have_armour_num; - tox=""; - if (gr>0){ - draw_set_color(c_red); - } else { - draw_set_color(c_gray); - } - draw_text(xx+1030,yy+390, $"{req_armour_num} {req_armour} (Have {have_armour_num})"); - } - if (req_gear!=""){ - gr=req_gear_num-have_gear_num; - tox=""; - if (gr>0){ - draw_set_color(c_red); - } else { - draw_set_color(c_gray); - } - draw_text(xx+1030,yy+410, $"{req_gear_num} {req_gear} (Have {have_gear_num})"); - } - if (req_mobi!=""){ - gr=req_mobi_num-have_mobi_num; - tox=""; - if (gr>0){ - draw_set_color(c_red); - } else { - draw_set_color(c_gray); - } - draw_text(xx+1030,yy+430, $"{req_mobi_num} {req_mobi} (Have {have_mobi_num})"); - } - if (req_wep1!=""){ - gr=req_wep1_num-have_wep1_num; - tox=""; - if (gr>0){ - draw_set_color(c_red); - } else { - draw_set_color(c_gray); - } - draw_text(xx+1260,yy+390, $"{req_wep1_num} {req_wep1} (Have {have_wep1_num})"); - } - if (req_wep2!=""){ - gr=req_wep2_num-have_wep2_num; - tox=""; - if (gr>0){ - draw_set_color(c_red); - } else { - draw_set_color(c_gray); - } - draw_text(xx+1260,yy+410, $"{req_wep2_num} {req_wep2} (Have {have_wep2_num})"); - } - } - - draw_set_alpha(1); - - draw_set_color(c_gray); - draw_set_halign(fa_left); - draw_rectangle(xx+1006,yy+499,xx+1115,yy+518,1); - draw_set_alpha(0.5); - draw_rectangle(xx+1007,yy+500,xx+1114,yy+517,1); - - if (all_good=1){ - draw_set_alpha(1); - draw_rectangle(xx+1465,yy+499,xx+1576,yy+518,1); - draw_set_alpha(0.5); - draw_rectangle(xx+1466,yy+500,xx+1575,yy+517,1); - } - if (all_good!=1){ - draw_set_alpha(0.25); - draw_rectangle(xx+1465,yy+499,xx+1576,yy+518,1); - draw_rectangle(xx+1466,yy+500,xx+1575,yy+517,1); - } - - draw_set_alpha(1); - draw_set_halign(fa_center); - draw_text(xx+1061,yy+501,string_hash_to_newline("Cancel")); - draw_text(xx+1061.5,yy+501.5,string_hash_to_newline("Cancel")); - - if (all_good=1){ - draw_text(xx+1521,yy+501,string_hash_to_newline("Promote!")); - draw_text(xx+1521.5,yy+501.5,string_hash_to_newline("Promote!")); - } - if (all_good!=1){ - draw_set_alpha(0.25); - draw_text(xx+1521,yy+501,string_hash_to_newline("Promote!")); - draw_text(xx+1521.5,yy+501.5,string_hash_to_newline("Promote!")); - } - draw_set_alpha(1); -} - -// ** Transfering ** -if (zoom=0) and (type=5.1) and (instance_exists(obj_controller)){ - draw_set_color(0); - draw_rectangle(xx+1006,yy+143,xx+1577,yy+518,0); - - draw_set_font(fnt_40k_14b); - draw_set_halign(fa_center); - draw_set_color(c_gray); - draw_text(xx+1292,yy+145,string_hash_to_newline("Transfering")); - - draw_set_font(fnt_40k_12); - var comp=""; - if (company <=10 and company > 0) { - comp=romanNumerals[company-1]; - } - else if (company>10) then comp="HQ"; - draw_text(xx+1292,yy+170,string_hash_to_newline(string(comp)+" Company "+string(unit_role))); - - draw_set_halign(fa_left); - draw_set_color(c_gray); - draw_text(xx+1014,yy+210,string_hash_to_newline("Target Company:")); - - var check=" "; - // HQ Company - if (target_comp=0) or (target_comp>10) then check="x"; - draw_text(xx+1470,yy+210,string_hash_to_newline("HQ ["+string(check)+"]")); - check=" "; - - if ((unit_role!=obj_ini.role[100,17]) or (obj_controller.command_set[1]!=0)) and (unit_role!="Lexicanum") and (unit_role!="Codiciery"){ - // I Company - if (target_comp==1) then check="x"; - draw_text(xx+1030,yy+230,string_hash_to_newline(romanNumerals[0]+" ["+string(check)+"]")); - check=" "; - // II Company - if (target_comp==2) then check="x"; - draw_text(xx+1140,yy+230,string_hash_to_newline(romanNumerals[1]+" ["+string(check)+"]")); - check=" "; - // III Company - if (target_comp==3) then check="x"; - draw_text(xx+1250,yy+230,string_hash_to_newline(romanNumerals[2]+" ["+string(check)+"]")); - check=" "; - // IV Company - if (target_comp==4) then check="x"; - draw_text(xx+1360,yy+230,string_hash_to_newline(romanNumerals[3]+" ["+string(check)+"]")); - check=" "; - // V Company - if (target_comp==5) then check="x"; - draw_text(xx+1470,yy+230,string_hash_to_newline(romanNumerals[4]+" ["+string(check)+"]")); - check=" "; - // VI Company - if (target_comp==6) then check="x"; - draw_text(xx+1030,yy+250,string_hash_to_newline(romanNumerals[5]+" ["+string(check)+"]")); - check=" "; - // VII Company - if (target_comp==7) then check="x"; - draw_text(xx+1140,yy+250,string_hash_to_newline(romanNumerals[6]+" ["+string(check)+"]")); - check=" "; - // VIII Company - if (target_comp==8) then check="x"; - draw_text(xx+1250,yy+250,string_hash_to_newline(romanNumerals[7]+" ["+string(check)+"]")); - check=" "; - // IX Company - if (target_comp==9) then check="x"; - draw_text(xx+1360,yy+250,string_hash_to_newline(romanNumerals[8]+" ["+string(check)+"]")); - check=" "; - // X Company - if (target_comp==10) then check="x"; - draw_text(xx+1470,yy+250,string_hash_to_newline(romanNumerals[9]+" ["+string(check)+"]")); - check=" "; - } - - draw_set_alpha(1); - - draw_set_color(c_gray); - draw_set_halign(fa_left); - draw_rectangle(xx+1006,yy+499,xx+1115,yy+518,1); - draw_set_alpha(0.5); - draw_rectangle(xx+1007,yy+500,xx+1114,yy+517,1); - - if (company!=target_comp) and (target_comp>=0){ - draw_set_alpha(1); - draw_rectangle(xx+1465,yy+499,xx+1576,yy+518,1); - draw_set_alpha(0.5); - draw_rectangle(xx+1466,yy+500,xx+1575,yy+517,1); - } - if (company==target_comp) or (target_comp<0){ - draw_set_alpha(0.25); - draw_rectangle(xx+1465,yy+499,xx+1576,yy+518,1); - draw_rectangle(xx+1466,yy+500,xx+1575,yy+517,1); - } - - draw_set_alpha(1); - draw_set_halign(fa_center); - draw_text(xx+1061,yy+501,"Cancel"); - draw_text(xx+1061.5,yy+501.5,"Cancel"); - - if (company!=target_comp) and (target_comp>=0){ - draw_text(xx+1521,yy+501,"Transfer!"); - draw_text(xx+1521.5,yy+501.5,"Transfer!"); - } - if (company==target_comp) or (target_comp<0){ - draw_set_alpha(0.25); - draw_text(xx+1521,yy+501,"Transfer!"); - draw_text(xx+1521.5,yy+501.5,"Transfer!"); - } - draw_set_alpha(1); -} -if (type == "duel"){ - + draw_text_transformed(unit_x + 271, unit_y + 151, string_hash_to_newline(string(temp2)), 1, 1, 0); + if ((obj_controller.man[sel] == "man") && (obj_controller.ma_lid[sel] == -1)) { + draw_text_transformed(unit_x + 271, unit_y + 151, string_hash_to_newline(string(temp2)), 1, 1, 0); + } + if ((obj_controller.man[sel] == "vehicle") && (obj_controller.ma_lid[sel] == -1)) { + draw_text_transformed(unit_x + 271, unit_y + 151, string_hash_to_newline(string(temp2)), 1, 1, 0); + } + + if (temp3 == "CRITICAL") { + draw_set_color(c_red); + } + draw_text_transformed(unit_x + 400, unit_y + 151, string_hash_to_newline(string(temp3)), 1, 1, 0); + draw_set_color(c_gray); + + draw_text_transformed(unit_x + 506, unit_y + 151, string_hash_to_newline(string(temp4)), 1, 1, 0); + + draw_set_color(c_gray); + if (string_count("Artifact", temp5) > 0) { + draw_set_color(881503); + } + draw_text_transformed(unit_x + 38, unit_y + 164, string_hash_to_newline(string(temp5)), 1, 1, 0); + draw_set_color(38144); + + if (point_and_click([unit_x + 29, unit_y + 150, unit_x + 569, unit_y + 175.4])) { + if (obj_controller.man_sel[sel] == 0) { + units = 1; + if (prev_selected != 0) { + obj_controller.man_sel[prev_selected] = 0; + } + obj_controller.man_sel[sel] = 1; + prev_selected = sel; + } else if (obj_controller.man_sel[sel] == 1) { + units = 0; + obj_controller.man_sel[sel] = 0; + } + } + unit_y += 25.4; + sel += 1; + } + } + + if ((target_role > 0) && (target_comp != -1) && (units == 1)) { + all_good = 1; + } else { + all_good = 0; + } + if (arti.determine_base_type() == "weapon" && target_role > 2) { + all_good = 0; + } + + // Screen bottom buttons and shit + // + var screen_bottom_x = x2; + var screen_bottom_y = y2 + 350; + draw_set_alpha(1); + draw_set_font(fnt_small); + draw_set_color(c_gray); + draw_rectangle(screen_bottom_x + 121, screen_bottom_y + 393, screen_bottom_x + 231, screen_bottom_y + 414, 1); + draw_set_alpha(0.5); + draw_rectangle(screen_bottom_x + 122, screen_bottom_y + 394, screen_bottom_x + 230, screen_bottom_y + 413, 1); + + if (all_good == 1) { + draw_set_alpha(1); + draw_rectangle(screen_bottom_x + 408, screen_bottom_y + 393, screen_bottom_x + 518, screen_bottom_y + 414, 1); + draw_set_alpha(0.5); + draw_rectangle(screen_bottom_x + 409, screen_bottom_y + 394, screen_bottom_x + 517, screen_bottom_y + 413, 1); + } + if (all_good != 1) { + draw_set_alpha(0.25); + draw_rectangle(screen_bottom_x + 408, screen_bottom_y + 393, screen_bottom_x + 518, screen_bottom_y + 414, 1); + draw_rectangle(screen_bottom_x + 409, screen_bottom_y + 394, screen_bottom_x + 517, screen_bottom_y + 413, 1); + } + + draw_set_alpha(1); + + draw_set_halign(fa_center); + draw_text(screen_bottom_x + 173, screen_bottom_y + 397, string_hash_to_newline("Cancel")); + draw_text(screen_bottom_x + 173.5, screen_bottom_y + 397.5, string_hash_to_newline("Cancel")); + + if (all_good == 1) { + draw_text(screen_bottom_x + 464, screen_bottom_y + 397, string_hash_to_newline("Equip!")); + draw_text(screen_bottom_x + 464.5, screen_bottom_y + 397.5, string_hash_to_newline("Equip!")); + if (point_and_click([screen_bottom_x + 430, screen_bottom_y + 393, screen_bottom_x + 518, screen_bottom_y + 414])) { + obj_controller.cooldown = 8000; + + var i = -1, this = 0, dwarn = false, unit; + var arti_index = obj_controller.menu_artifact; + var arti = obj_ini.artifact_struct[arti_index]; + var arti_base = arti.type(); + repeat (min(obj_controller.man_max, 23)) { + i += 1; + if ((this == 0) && (obj_controller.man_sel[i] == 1)) { + this = i; + } + } + i = this; + + if ((obj_controller.man[i] != "") && obj_controller.man_sel[i]) { + var replace = ""; + + if (target_role == 1) { + replace = "weapon1"; + } + if (target_role == 2) { + replace = "weapon2"; + } + if (target_role > 2) { + if (gear_weapon_data("armour", arti_base) != false) { + replace = "armour"; + } else if (gear_weapon_data("gear", arti_base) != false) { + replace = "gear"; + } else if (gear_weapon_data("mobility", arti_base) != false) { + replace = "mobility"; + } + } + if ((replace == "armour") && (obj_controller.ma_race[i] > 5)) { + cooldown = 8; + obj_controller.cooldown = 8; + exit; + } + + if (target_comp > 10) { + target_comp = 0; + } + + unit = obj_ini.TTRPG[target_comp][obj_controller.ide[i]]; + if (arti.has_tag("Daemonic") || arti.has_tag("Chaos")) { + unit.corruption += irandom(10 + 2); + if (unit.role() == "Chapter Master") { + dwarn = true; + } + } + + if (replace == "armour") { + unit.update_armour(arti_index); + } else if (replace == "gear") { + unit.update_gear(arti_index); + } + if (replace == "mobility") { + unit.update_mobility_item(arti_index); + } + if (replace == "weapon1") { + unit.update_weapon_one(arti_index); + } + if (replace == "weapon2") { + unit.update_weapon_two(arti_index); + } + var g = arti_index; + obj_controller.cooldown = 10; + + //if (obj_controller.menu_artifact>obj_controller.artifacts) then obj_controller.menu_artifact=obj_controller.artifacts; + if (dwarn == true) { + var pip = instance_create(0, 0, obj_popup); + pip.title = "Daemon Artifacts"; + pip.text = "Some artifacts, like the one you now wield, are a blasphemous union of the Materium's matter and the Immaterium's spirit, containing the essence of a bound daemon. While they may offer great power, and enhanced perception, they are known to whisper poisonous lies to the wielder. The path to damnation begins with good intentions, and many times artifacts such as these have been the cause."; + pip.image = ""; + pip.cooldown = 8; + obj_controller.cooldown = 8; + } + + instance_destroy(); + exit; + } + } + } + if (all_good != 1) { + draw_set_alpha(0.25); + draw_text(screen_bottom_x + 464, screen_bottom_y + 397, "Equip!"); + draw_text(screen_bottom_x + 464.5, screen_bottom_y + 397.5, "Equip!"); + } + draw_set_alpha(1); + } + + var xx, yy; + xx = __view_get(e__VW.XView, 0); + yy = __view_get(e__VW.YView, 0); + + // Changing Equipment + if ((zoom == 0) && (type == 6) && instance_exists(obj_controller)) { + draw_set_color(0); + draw_rectangle(xx + 1006, yy + 143, xx + 1577, yy + 518, 0); + + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_center); + draw_set_color(c_gray); + + draw_text(xx + 1292, yy + 145, "Change Equipment"); + + draw_set_font(fnt_40k_12); + var comp = ""; + if (company <= 10 && company > 0) { + comp = romanNumerals[company - 1]; + } else if (company > 10) { + comp = "HQ"; + } + + if (vehicle_equipment == 0) { + draw_text(xx + 1292, yy + 170, $"{comp} Company, {units} Marines"); + } + if (vehicle_equipment == 1) { + draw_text(xx + 1292, yy + 170, $"{comp} Company, {units} Vehicles"); + } + + draw_set_halign(fa_left); + draw_set_color(c_gray); + + draw_rectangle(xx + 1010, yy + 215, xx + 1288, yy + 315, 1); + draw_rectangle(xx + 1574, yy + 215, xx + 1296, yy + 315, 1); + + var show_name = ""; + // Need to not show the artifact tags here somehow + + draw_text(xx + 1010, yy + 195, "Before"); + draw_text(xx + 1010.5, yy + 195.5, "Before"); + + show_name = o_wep1; + if (a_wep1 != "") { + show_name = a_wep1; + } + if (o_wep1 != "") { + draw_text(xx + 1014, yy + 215, string_hash_to_newline(show_name)); + } else { + draw_text(xx + 1014, yy + 215, ITEM_NAME_NONE); + } + + show_name = o_wep2; + if (a_wep2 != "") { + show_name = a_wep2; + } + if (o_wep2 != "") { + draw_text(xx + 1014, yy + 235, string_hash_to_newline(string(show_name))); + } else { + draw_text(xx + 1014, yy + 235, ITEM_NAME_NONE); + } + + show_name = o_armour; + if (a_armour != "") { + show_name = a_armour; + } + if (o_armour != "") { + draw_text(xx + 1014, yy + 255, string_hash_to_newline(string(show_name))); + } else { + draw_text(xx + 1014, yy + 255, ITEM_NAME_NONE); + } + + show_name = o_gear; + if (a_gear != "") { + show_name = a_gear; + } + if (o_gear != "") { + draw_text(xx + 1014, yy + 275, string_hash_to_newline(string(show_name))); + } else { + draw_text(xx + 1014, yy + 275, ITEM_NAME_NONE); + } + + show_name = o_mobi; + if (a_mobi != "") { + show_name = a_mobi; + } + if (o_mobi != "") { + draw_text(xx + 1014, yy + 295, string_hash_to_newline(string(show_name))); + } else { + draw_text(xx + 1014, yy + 295, ITEM_NAME_NONE); + } + + draw_text(xx + 1296, yy + 195, string_hash_to_newline("After")); + draw_text(xx + 1296.5, yy + 195.5, "After"); + + draw_set_color(c_gray); + if (n_good1 == 0) { + draw_set_color(255); + } + show_name = n_wep1; + if ((a_wep1 != "") && (n_wep1 == o_wep1)) { + show_name = a_wep1; + } + if (n_wep1 != "") { + draw_text(xx + 1300, yy + 215, string_hash_to_newline(string(show_name))); + } else { + draw_text(xx + 1300, yy + 215, string_hash_to_newline(ITEM_NAME_NONE)); + } + + draw_set_color(c_gray); + if (n_good2 == 0) { + draw_set_color(255); + } + show_name = n_wep2; + if ((a_wep2 != "") && (n_wep2 == o_wep2)) { + show_name = a_wep2; + } + if (n_wep2 != "") { + draw_text(xx + 1300, yy + 235, string_hash_to_newline(string(show_name))); + } else { + draw_text(xx + 1300, yy + 235, string_hash_to_newline(ITEM_NAME_NONE)); + } + + draw_set_color(c_gray); + if (n_good3 == 0) { + draw_set_color(255); + } + show_name = n_armour; + if ((a_armour != "") && (n_armour == o_armour)) { + show_name = a_armour; + } + if (n_armour != "") { + draw_text(xx + 1300, yy + 255, string_hash_to_newline(string(show_name))); + } else { + draw_text(xx + 1300, yy + 255, string_hash_to_newline(ITEM_NAME_NONE)); + } + + draw_set_color(c_gray); + if (n_good4 == 0) { + draw_set_color(255); + } + show_name = n_gear; + if ((a_gear != "") && (n_gear == o_gear)) { + show_name = a_gear; + } + if (n_gear != "") { + draw_text(xx + 1300, yy + 275, string_hash_to_newline(string(show_name))); + } else { + draw_text(xx + 1300, yy + 275, string_hash_to_newline(ITEM_NAME_NONE)); + } + + draw_set_color(c_gray); + if (n_good5 == 0) { + draw_set_color(255); + } + show_name = n_mobi; + if ((a_mobi != "") && (n_mobi == o_mobi)) { + show_name = a_mobi; + } + if (n_mobi != "") { + draw_text(xx + 1300, yy + 295, string_hash_to_newline(string(show_name))); + } else { + draw_text(xx + 1300, yy + 295, string_hash_to_newline(ITEM_NAME_NONE)); + } + + draw_set_color(c_gray); + + for (var i = 1; i <= 5; i++) { + if (target_comp == i) { + draw_text(xx + 1292, yy + 195 + (20 * i), "->"); + break; + } + } + + if ((mouse_x >= xx + 1296) && (mouse_x < xx + 1574)) { + if ((mouse_y >= yy + 215) && (mouse_y < yy + 235)) { + draw_set_alpha(0.5); + draw_line(xx + 1296, yy + 230, xx + 1574, yy + 230); + } + if ((mouse_y >= yy + 235) && (mouse_y < yy + 255)) { + draw_set_alpha(0.5); + draw_line(xx + 1296, yy + 250, xx + 1574, yy + 250); + } + if ((mouse_y >= yy + 255) && (mouse_y < yy + 275)) { + draw_set_alpha(0.5); + draw_line(xx + 1296, yy + 270, xx + 1574, yy + 270); + } + if ((mouse_y >= yy + 275) && (mouse_y < yy + 295)) { + draw_set_alpha(0.5); + draw_line(xx + 1296, yy + 290, xx + 1574, yy + 290); + } + if ((mouse_y >= yy + 295) && (mouse_y < yy + 315)) { + draw_set_alpha(0.5); + draw_line(xx + 1296, yy + 310, xx + 1574, yy + 310); + } + } + draw_set_alpha(1); + + if (target_comp != -1) { + var check = " "; + var mct = master_crafted == 1 ? 0.7 : 1; + var column = 0; + var row = 0; + var item_string; + var box = []; + var box_x; + var box_y; + var top = -1; + + var selected_item_name = [n_wep1, n_wep2, n_armour, n_gear, n_mobi]; + selected_item_name = selected_item_name[target_comp - 1]; + + for (var o = 0; o < array_length(item_name); o++) { + box_x = xx + 1016 + (row * 154); + box_y = yy + 355 + (column * 20); + box = [box_x, box_y, box_x + 144, box_y + 20]; + check = selected_item_name == item_name[o] ? "x" : " "; + item_string = $"[{check}] {item_name[o]}"; + draw_text_transformed(box_x, box_y, item_string, mct, 1, 0); + + if (point_and_click(box)) { + top = o; + } + column++; + if (column > 6) { + column = 0; + row++; + } + } + + if (top != -1) { + warning = ""; + switch (target_comp) { + case 1: + n_wep1 = item_name[top]; + sel1 = top; + break; + case 2: + n_wep2 = item_name[top]; + sel2 = top; + break; + case 3: + n_armour = item_name[top]; + sel3 = top; + break; + case 4: + n_gear = item_name[top]; + sel4 = top; + break; + case 5: + n_mobi = item_name[top]; + sel5 = top; + break; + } + } + + if (target_comp == 1 && (n_wep1 == ITEM_NAME_NONE || n_wep1 == "")) { + n_good1 = 1; + } + if (target_comp == 2 && (n_wep2 == ITEM_NAME_NONE || n_wep2 == "")) { + n_good2 = 1; + } + if (target_comp == 3 && (n_armour == ITEM_NAME_NONE || n_armour == "")) { + n_good3 = 1; + } + if (target_comp == 4 && (n_gear == ITEM_NAME_NONE || n_gear == "")) { + n_good4 = 1; + } + if (target_comp == 5 && (n_mobi == ITEM_NAME_NONE || n_mobi == "")) { + n_good5 = 1; + } + + var weapon_one_data = gear_weapon_data("weapon", n_wep1); + var weapon_two_data = gear_weapon_data("weapon", n_wep2); + var armour_data = gear_weapon_data("armour", n_armour); + + if ((target_comp == 1) && is_struct(weapon_one_data)) { + // Check numbers + req_wep1_num = units; + have_wep1_num = 0; + var i = -1; + repeat (array_length(obj_controller.display_unit)) { + i += 1; + if ((vehicle_equipment != -1) && (obj_controller.ma_wep1[i] == n_wep1)) { + have_wep1_num += 1; + } + } + have_wep1_num += scr_item_count(n_wep1); + if (have_wep1_num >= req_wep1_num || n_wep1 == ITEM_NAME_NONE) { + n_good1 = 1; + } + if (have_wep1_num < req_wep1_num && (n_wep1 != ITEM_NAME_ANY && n_wep1 != ITEM_NAME_NONE)) { + n_good1 = 0; + warning = "Not enough " + string(n_wep1) + "; " + string(req_wep1_num - have_wep1_num) + " more are required."; + } + + //TODO wrap this up in a function + if (weapon_one_data.req_exp > 0) { + var g = -1, exp_check = 0; + for (var g = 0; g < array_length(obj_controller.display_unit); g++) { + if (obj_controller.man_sel[g] == 1 && is_struct(obj_controller.display_unit[g])) { + if (obj_controller.display_unit[g].experience < weapon_one_data.req_exp) { + exp_check = 1; + n_good1 = 0; + warning = $"A unit must have {weapon_one_data.req_exp}+ EXP to use a {weapon_one_data.name}."; + break; + } + } + } + } + if (is_struct(armour_data)) { + if (((!array_contains(armour_data.tags, "terminator")) && (!array_contains(armour_data.tags, "dreadnought"))) && (n_wep1 == "Assault Cannon")) { + n_good1 = 0; + warning = "Cannot use Assault Cannons without Terminator/Dreadnought Armour."; + } + if ((!array_contains(armour_data.tags, "dreadnought")) && (n_wep1 == "Close Combat Weapon")) { + n_good1 = 0; + warning = "Only " + string(obj_ini.role[100][6]) + " can use Close Combat Weapons."; + } + } + } + if ((target_comp == 2) && is_struct(weapon_two_data)) { + // Check numbers + req_wep2_num = units; + have_wep2_num = 0; + var i = -1; + repeat (array_length(obj_controller.display_unit)) { + i += 1; + if ((vehicle_equipment != -1) && (obj_controller.ma_wep2[i] == n_wep2)) { + have_wep2_num += 1; + } + } + // req_wep2_num+=scr_item_count(n_wep2); + have_wep2_num += scr_item_count(n_wep2); + // req_wep2_num=units; + + if (have_wep2_num >= req_wep2_num || n_wep2 == ITEM_NAME_NONE) { + n_good2 = 1; + } + if (have_wep2_num < req_wep2_num && (n_wep2 != ITEM_NAME_ANY && n_wep2 != ITEM_NAME_NONE)) { + n_good2 = 0; + warning = $"Not enough {n_wep2}; {req_wep2_num - have_wep2_num} more are required."; + } + //TODO standardise exp check + if (weapon_two_data.req_exp > 0) { + var g, exp_check; + g = -1; + exp_check = 0; + for (var g = 0; g < array_length(obj_controller.display_unit); g++) { + if (obj_controller.man_sel[g] == 1 && is_struct(obj_controller.display_unit[g])) { + if (obj_controller.display_unit[g].experience < weapon_two_data.req_exp) { + exp_check = 1; + n_good1 = 0; + warning = $"A unit must have {weapon_two_data.req_exp}+ EXP to use a {weapon_two_data.name}."; + break; + } + } + } + } + if (is_struct(armour_data)) { + if (((!array_contains(armour_data.tags, "terminator")) && (!array_contains(armour_data.tags, "dreadnought"))) && (n_wep2 == "Assault Cannon")) { + n_good2 = 0; + warning = "Cannot use Assault Cannons without Terminator/Dreadnought Armour."; + } + if ((!array_contains(armour_data.tags, "dreadnought")) && (n_wep2 == "Close Combat Weapon")) { + n_good2 = 0; + warning = "Only " + string(obj_ini.role[100][6]) + " can use Close Combat Weapons."; + } + if (((string_count("Terminator", n_armour) > 0) || (string_count("Tartaros", n_armour) > 0) || (string_count("Dreadnought", n_armour) > 0)) && (n_mobi != "")) { + n_good2 = 0; + } + if (((string_count("Terminator", o_armour) > 0) || (string_count("Tartaros", o_armour) > 0) || (string_count("Dreadnought", o_armour) > 0)) && (n_mobi != "")) { + n_good2 = 0; + } + } + } + if ((target_comp == 3) && is_struct(armour_data)) { + // Check numbers + req_armour_num = units; + have_armour_num = 0; + var i; + i = -1; + repeat (array_length(obj_controller.display_unit)) { + i += 1; + if ((vehicle_equipment != -1) && (obj_controller.man_sel[i] == 1) && (obj_controller.ma_armour[i] == n_armour)) { + have_armour_num += 1; + } + } + have_armour_num += scr_item_count(n_armour); + + if (have_armour_num >= req_armour_num || n_armour == ITEM_NAME_NONE) { + n_good3 = 1; + } + if (have_armour_num < req_armour_num && (n_armour != ITEM_NAME_ANY && n_armour != ITEM_NAME_NONE)) { + n_good3 = 0; + warning = $"Not enough {n_armour} : {units - have_armour_num} more are required."; + } + + var g = -1, exp_check = 0; + if (armour_data.has_tag("terminator")) { + if (armour_data.req_exp > 0) { + var g, exp_check; + g = -1; + exp_check = 0; + for (var g = 0; g < array_length(obj_controller.display_unit); g++) { + if (obj_controller.man_sel[g] == 1 && is_struct(obj_controller.display_unit[g])) { + if (obj_controller.display_unit[g].experience < armour_data.req_exp) { + exp_check = 1; + n_good1 = 0; + warning = $"A unit must have {armour_data.req_exp}+ EXP to use a {armour_data.name}."; + break; + } + } + } + } + } + + if ((string_count("Dread", o_armour) > 0) && (string_count("Dread", n_armour) == 0)) { + n_good4 = 0; + warning = "Marines may not exit Dreadnoughts."; + } + } + if ((target_comp == 4) && (n_gear != "Assortment") && (n_gear != ITEM_NAME_NONE)) { + // Check numbers + req_gear_num = units; + have_gear_num = 0; + var i; + i = -1; + repeat (array_length(obj_controller.display_unit)) { + i += 1; + if ((vehicle_equipment != -1) && (obj_controller.man_sel[i] == 1) && (obj_controller.ma_gear[i] == n_gear)) { + have_gear_num += 1; + } + } + have_gear_num += scr_item_count(n_gear); + + if (have_gear_num >= req_gear_num || n_gear == ITEM_NAME_NONE) { + n_good4 = 1; + } + if (have_gear_num < req_gear_num && (n_gear != ITEM_NAME_ANY && n_gear != ITEM_NAME_NONE)) { + n_good4 = 0; + warning = "Not enough " + string(n_gear) + "; " + string(units - req_gear_num) + " more are required."; + } + + if ((n_gear != ITEM_NAME_NONE) && (n_gear != "") && (string_count("Dreadnought", n_armour) > 0)) { + n_good4 = 0; + warning = "Dreadnoughts may not use infantry equipment."; + } + } + if ((target_comp == 5) && (n_mobi != "Assortment") && (n_mobi != ITEM_NAME_NONE)) { + // Check numbers + req_mobi_num = units; + have_mobi_num = 0; + var i; + i = -1; + repeat (array_length(obj_controller.display_unit)) { + i += 1; + if ((vehicle_equipment != -1) && (obj_controller.man_sel[i] == 1) && (obj_controller.ma_mobi[i] == n_mobi)) { + have_mobi_num += 1; + } + } + have_mobi_num += scr_item_count(n_mobi); + + if (have_mobi_num >= req_mobi_num || n_mobi == ITEM_NAME_NONE) { + n_good5 = 1; + } + if (have_mobi_num < req_mobi_num && (n_mobi != ITEM_NAME_ANY && n_mobi != ITEM_NAME_NONE)) { + n_good5 = 0; + warning = "Not enough " + string(n_mobi) + "; " + string(units - req_mobi_num) + " more are required."; + } + + var terminator_mobi = ["", "Servo-arm", "Servo-harness", "Conversion Beamer Pack"]; + if ((!array_contains(terminator_mobi, n_mobi)) && ((n_armour == "Terminator Armour") || (n_armour == "Tartaros"))) { + n_good5 = 0; + warning = "Cannot use this gear with Terminator Armour."; + } + + if ((n_mobi != ITEM_NAME_NONE) && (n_mobi != "") && (n_armour == "Dreadnought")) { + n_good5 = 0; + warning = string(obj_ini.role[100][6]) + "s may not use mobility gear."; + } + } + } + + draw_set_halign(fa_center); + if ((target_comp == 1) || (target_comp == 2)) { + var msc = " "; + if (master_crafted == 1) { + msc = "x"; + } + if (tab == 1) { + draw_text(xx + 1292, yy + 318, string_hash_to_newline("Tab 1 [x] Tab 2 [ ] Master-Crafted [" + string(msc) + "]")); + } + if (tab == 2) { + draw_text(xx + 1292, yy + 318, string_hash_to_newline("Tab 1 [ ] Tab 2 [x] Master-Crafted [" + string(msc) + "]")); + } + } + + draw_set_color(255); + draw_set_halign(fa_center); + draw_text(xx + 1292, yy + 476, string_hash_to_newline(warning)); + + draw_set_color(c_gray); + draw_set_halign(fa_left); + draw_rectangle(xx + 1006, yy + 499, xx + 1115, yy + 518, 1); + draw_set_alpha(0.5); + draw_rectangle(xx + 1007, yy + 500, xx + 1114, yy + 517, 1); + + if (n_good1 + n_good2 + n_good3 + n_good4 + n_good5 == 5) { + draw_set_alpha(1); + draw_rectangle(xx + 1465, yy + 499, xx + 1576, yy + 518, 1); + draw_set_alpha(0.5); + draw_rectangle(xx + 1466, yy + 500, xx + 1575, yy + 517, 1); + } + if (n_good1 + n_good2 + n_good3 + n_good4 + n_good5 != 5) { + draw_set_alpha(0.25); + draw_rectangle(xx + 1465, yy + 499, xx + 1576, yy + 518, 1); + draw_rectangle(xx + 1466, yy + 500, xx + 1575, yy + 517, 1); + } + + draw_set_alpha(1); + draw_set_halign(fa_center); + draw_text(xx + 1061, yy + 501, string_hash_to_newline("Cancel")); + draw_text(xx + 1061.5, yy + 501.5, string_hash_to_newline("Cancel")); + + if (n_good1 + n_good2 + n_good3 + n_good4 == 4) { + draw_text(xx + 1521, yy + 501, string_hash_to_newline("Equip!")); + draw_text(xx + 1521.5, yy + 501.5, string_hash_to_newline("Equip!")); + } + if (n_good1 + n_good2 + n_good3 + n_good4 != 4) { + draw_set_alpha(0.25); + draw_text(xx + 1521, yy + 501, string_hash_to_newline("Equip!")); + draw_text(xx + 1521.5, yy + 501.5, string_hash_to_newline("Equip!")); + } + draw_set_alpha(1); + } + + // ** Promoting ** + if ((zoom == 0) && (type == 5) && instance_exists(obj_controller)) { + draw_set_color(0); + draw_rectangle(xx + 1006, yy + 143, xx + 1577, yy + 518, 0); + + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_center); + draw_set_color(c_gray); + draw_text(xx + 1292, yy + 145, string_hash_to_newline("Promoting")); + + draw_set_font(fnt_40k_12); + var comp = ""; + if (company <= 10 && company > 0) { + comp = romanNumerals[company - 1]; + } else if (company > 10) { + comp = "HQ"; + } + draw_text(xx + 1292, yy + 170, string_hash_to_newline(string(comp) + " Company " + string(unit_role))); + + draw_set_halign(fa_left); + draw_set_color(c_gray); + draw_text(xx + 1014, yy + 210, string_hash_to_newline("Target Company:")); + + var check = " "; + draw_set_alpha(1); + + // HQ Company + if ((target_comp == 0) || (target_comp > 10)) { + check = "x"; + } + draw_text(xx + 1470, yy + 210, string_hash_to_newline("HQ [" + string(check) + "]")); + check = " "; + // if (obj_controller.command_set[1]!=0 && !is_specialist(unit_role, "libs")){ + for (i = 1; i <= 10; i++) { + var comp_data = company_promote_data[i - 1]; + if (obj_controller.command_set[2] == 1) { + //cecks if exp requirements are activated + if (min_exp < comp_data[2]) { + draw_set_alpha(0.6); + } + } + check = " "; + if (target_comp == i) { + check = "x"; + } + var select_text = $"{romanNumerals[i - 1]} [{check}]"; + draw_text(xx + comp_data[0], yy + comp_data[1], select_text); + if (mouse_check_button_pressed(mb_left) && point_in_rectangle(mouse_x, mouse_y, xx + comp_data[0], yy + comp_data[1], xx + comp_data[0] + 90, yy + comp_data[1] + 20)) { + target_comp = i; + target_role = 0; + get_unit_promotion_options(); + cooldown = 8000; + } + } + // } + + draw_text(xx + 1014, yy + 290, string_hash_to_newline("Target Role:")); //choose new role + var role_x = 0; + role_y = 0; + if (target_comp != -1) { + for (var r = 1; r <= 11; r++) { + if (role_name[r] != "") { + draw_set_alpha(1); + check = " "; + if (target_role == r) { + check = "x"; + } + if (min_exp < role_exp[r]) { + draw_set_alpha(0.25); + } + draw_text(xx + 1030 + role_x, yy + 310 + role_y, string_hash_to_newline(string(role_name[r]) + " [" + string(check) + "]")); + if (mouse_check_button_pressed(mb_left) && point_in_rectangle(mouse_x, mouse_y, xx + 1030 + role_x, yy + 310 + role_y, xx + 1180 + role_x, yy + 330 + role_y)) { + if (min_exp >= role_exp[r]) { + target_role = r; + calculate_equipment_needs(); + all_good = 1; + cooldown = 8; + } + } + if (r % 3 == 0) { + role_y += 20; + role_x = 0; + } else { + role_x += 170; + } + } + } + } + + draw_set_alpha(1); + + draw_text(xx + 1014, yy + 370, string_hash_to_newline("Required Gear:")); + var gr = 0, tox = ""; + + if (target_role > 0) { + if (req_armour != "") { + gr = req_armour_num - have_armour_num; + tox = ""; + if (gr > 0) { + draw_set_color(c_red); + } else { + draw_set_color(c_gray); + } + draw_text(xx + 1030, yy + 390, $"{req_armour_num} {req_armour} (Have {have_armour_num})"); + } + if (req_gear != "") { + gr = req_gear_num - have_gear_num; + tox = ""; + if (gr > 0) { + draw_set_color(c_red); + } else { + draw_set_color(c_gray); + } + draw_text(xx + 1030, yy + 410, $"{req_gear_num} {req_gear} (Have {have_gear_num})"); + } + if (req_mobi != "") { + gr = req_mobi_num - have_mobi_num; + tox = ""; + if (gr > 0) { + draw_set_color(c_red); + } else { + draw_set_color(c_gray); + } + draw_text(xx + 1030, yy + 430, $"{req_mobi_num} {req_mobi} (Have {have_mobi_num})"); + } + if (req_wep1 != "") { + gr = req_wep1_num - have_wep1_num; + tox = ""; + if (gr > 0) { + draw_set_color(c_red); + } else { + draw_set_color(c_gray); + } + draw_text(xx + 1260, yy + 390, $"{req_wep1_num} {req_wep1} (Have {have_wep1_num})"); + } + if (req_wep2 != "") { + gr = req_wep2_num - have_wep2_num; + tox = ""; + if (gr > 0) { + draw_set_color(c_red); + } else { + draw_set_color(c_gray); + } + draw_text(xx + 1260, yy + 410, $"{req_wep2_num} {req_wep2} (Have {have_wep2_num})"); + } + } + + draw_set_alpha(1); + + draw_set_color(c_gray); + draw_set_halign(fa_left); + draw_rectangle(xx + 1006, yy + 499, xx + 1115, yy + 518, 1); + draw_set_alpha(0.5); + draw_rectangle(xx + 1007, yy + 500, xx + 1114, yy + 517, 1); + + if (all_good == 1) { + draw_set_alpha(1); + draw_rectangle(xx + 1465, yy + 499, xx + 1576, yy + 518, 1); + draw_set_alpha(0.5); + draw_rectangle(xx + 1466, yy + 500, xx + 1575, yy + 517, 1); + } + if (all_good != 1) { + draw_set_alpha(0.25); + draw_rectangle(xx + 1465, yy + 499, xx + 1576, yy + 518, 1); + draw_rectangle(xx + 1466, yy + 500, xx + 1575, yy + 517, 1); + } + + draw_set_alpha(1); + draw_set_halign(fa_center); + draw_text(xx + 1061, yy + 501, string_hash_to_newline("Cancel")); + draw_text(xx + 1061.5, yy + 501.5, string_hash_to_newline("Cancel")); + + if (all_good == 1) { + draw_text(xx + 1521, yy + 501, string_hash_to_newline("Promote!")); + draw_text(xx + 1521.5, yy + 501.5, string_hash_to_newline("Promote!")); + } + if (all_good != 1) { + draw_set_alpha(0.25); + draw_text(xx + 1521, yy + 501, string_hash_to_newline("Promote!")); + draw_text(xx + 1521.5, yy + 501.5, string_hash_to_newline("Promote!")); + } + draw_set_alpha(1); + } + + // ** Transfering ** + if ((zoom == 0) && (type == 5.1) && instance_exists(obj_controller)) { + draw_set_color(0); + draw_rectangle(xx + 1006, yy + 143, xx + 1577, yy + 518, 0); + + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_center); + draw_set_color(c_gray); + draw_text(xx + 1292, yy + 145, string_hash_to_newline("Transfering")); + + draw_set_font(fnt_40k_12); + var comp = ""; + if (company <= 10 && company > 0) { + comp = romanNumerals[company - 1]; + } else if (company > 10) { + comp = "HQ"; + } + draw_text(xx + 1292, yy + 170, string_hash_to_newline(string(comp) + " Company " + string(unit_role))); + + draw_set_halign(fa_left); + draw_set_color(c_gray); + draw_text(xx + 1014, yy + 210, string_hash_to_newline("Target Company:")); + + var check = " "; + // HQ Company + if ((target_comp == 0) || (target_comp > 10)) { + check = "x"; + } + draw_text(xx + 1470, yy + 210, string_hash_to_newline("HQ [" + string(check) + "]")); + check = " "; + + if (((unit_role != obj_ini.role[100, 17]) || (obj_controller.command_set[1] != 0)) && (unit_role != "Lexicanum") && (unit_role != "Codiciery")) { + // I Company + if (target_comp == 1) { + check = "x"; + } + draw_text(xx + 1030, yy + 230, string_hash_to_newline(romanNumerals[0] + " [" + string(check) + "]")); + check = " "; + // II Company + if (target_comp == 2) { + check = "x"; + } + draw_text(xx + 1140, yy + 230, string_hash_to_newline(romanNumerals[1] + " [" + string(check) + "]")); + check = " "; + // III Company + if (target_comp == 3) { + check = "x"; + } + draw_text(xx + 1250, yy + 230, string_hash_to_newline(romanNumerals[2] + " [" + string(check) + "]")); + check = " "; + // IV Company + if (target_comp == 4) { + check = "x"; + } + draw_text(xx + 1360, yy + 230, string_hash_to_newline(romanNumerals[3] + " [" + string(check) + "]")); + check = " "; + // V Company + if (target_comp == 5) { + check = "x"; + } + draw_text(xx + 1470, yy + 230, string_hash_to_newline(romanNumerals[4] + " [" + string(check) + "]")); + check = " "; + // VI Company + if (target_comp == 6) { + check = "x"; + } + draw_text(xx + 1030, yy + 250, string_hash_to_newline(romanNumerals[5] + " [" + string(check) + "]")); + check = " "; + // VII Company + if (target_comp == 7) { + check = "x"; + } + draw_text(xx + 1140, yy + 250, string_hash_to_newline(romanNumerals[6] + " [" + string(check) + "]")); + check = " "; + // VIII Company + if (target_comp == 8) { + check = "x"; + } + draw_text(xx + 1250, yy + 250, string_hash_to_newline(romanNumerals[7] + " [" + string(check) + "]")); + check = " "; + // IX Company + if (target_comp == 9) { + check = "x"; + } + draw_text(xx + 1360, yy + 250, string_hash_to_newline(romanNumerals[8] + " [" + string(check) + "]")); + check = " "; + // X Company + if (target_comp == 10) { + check = "x"; + } + draw_text(xx + 1470, yy + 250, string_hash_to_newline(romanNumerals[9] + " [" + string(check) + "]")); + check = " "; + } + + draw_set_alpha(1); + + draw_set_color(c_gray); + draw_set_halign(fa_left); + draw_rectangle(xx + 1006, yy + 499, xx + 1115, yy + 518, 1); + draw_set_alpha(0.5); + draw_rectangle(xx + 1007, yy + 500, xx + 1114, yy + 517, 1); + + if ((company != target_comp) && (target_comp >= 0)) { + draw_set_alpha(1); + draw_rectangle(xx + 1465, yy + 499, xx + 1576, yy + 518, 1); + draw_set_alpha(0.5); + draw_rectangle(xx + 1466, yy + 500, xx + 1575, yy + 517, 1); + } + if ((company == target_comp) || (target_comp < 0)) { + draw_set_alpha(0.25); + draw_rectangle(xx + 1465, yy + 499, xx + 1576, yy + 518, 1); + draw_rectangle(xx + 1466, yy + 500, xx + 1575, yy + 517, 1); + } + + draw_set_alpha(1); + draw_set_halign(fa_center); + draw_text(xx + 1061, yy + 501, "Cancel"); + draw_text(xx + 1061.5, yy + 501.5, "Cancel"); + + if ((company != target_comp) && (target_comp >= 0)) { + draw_text(xx + 1521, yy + 501, "Transfer!"); + draw_text(xx + 1521.5, yy + 501.5, "Transfer!"); + } + if ((company == target_comp) || (target_comp < 0)) { + draw_set_alpha(0.25); + draw_text(xx + 1521, yy + 501, "Transfer!"); + draw_text(xx + 1521.5, yy + 501.5, "Transfer!"); + } + draw_set_alpha(1); + } + + if (type == "duel") {} +} catch (_exception) { + handle_exception(_exception); + instance_destroy(); } diff --git a/objects/obj_popup/Keyboard_13.gml b/objects/obj_popup/Keyboard_13.gml index a25db0dbd..f17f36d81 100644 --- a/objects/obj_popup/Keyboard_13.gml +++ b/objects/obj_popup/Keyboard_13.gml @@ -13,9 +13,13 @@ if (battle_special>0){ cooldown=10;exit; } -if (option1="") and (type<5){ +if (option1="" && type<5){ obj_controller.cooldown=10; - if (number!=0) and (obj_controller.complex_event=false) then obj_turn_end.alarm[1]=4; + if (number!=0) and (obj_controller.complex_event=false){ + if (instance_exists(obj_turn_end)){ + obj_turn_end.alarm[1]=4; + } + } instance_destroy(); } diff --git a/objects/obj_popup/Mouse_50.gml b/objects/obj_popup/Mouse_50.gml index 1513649fa..0741c2a05 100644 --- a/objects/obj_popup/Mouse_50.gml +++ b/objects/obj_popup/Mouse_50.gml @@ -183,19 +183,7 @@ if (mouse_x>=xx+1465) and (mouse_y>=yy+499) and (mouse_x=xx+1465) and (mouse_y>=yy+499) and (mouse_x0){ reset_manage_arrays(); @@ -255,21 +247,20 @@ if (type=6) and (cooldown<=0){// Actually changing equipment right here } if (mouse_y>=yy+318) and (mouse_y=xx+1263) and (mouse_x=yy+318) and (mouse_y=xx+1409) and (mouse_x=yy+295) and (mouse_y=xx+1465) and (mouse_y>=yy+499) and (mouse_x=xx+1465) and (mouse_y>=yy+499) and (mouse_x=xx+1465) and (mouse_y>=yy+499) and (mouse_x0){ if (instance_exists(obj_controller)){ if (obj_controller.force_scroll=1) and (type=99) and (instance_exists(obj_turn_end)){ - - var p_strength,en_strength,ratio,diceh,mfleet,rdice; - p_strength=0;en_strength=0;mfleet=obj_turn_end.battle_pobject[obj_turn_end.current_battle]; - p_strength+=mfleet.escort_number; - p_strength+=mfleet.frigate_number*3; - p_strength+=mfleet.capital_number*8; - rdice=floor(random(100))+1; - - - - with(obj_temp3){instance_destroy();} - obj_controller.temp[2000]=obj_turn_end.battle_location[obj_turn_end.current_battle]; - with(obj_star){if (name=obj_controller.temp[2000]) then instance_create(x,y,obj_temp3);} - var that=instance_nearest(obj_temp3.x,obj_temp3.y,obj_star); - - obj_controller.temp[2001]=real(that.id); - obj_controller.temp[2002]=real(obj_turn_end.battle_opponent[obj_turn_end.current_battle]); - - var cap_total=0,frig_total=0,escort_total=0; - with(obj_en_fleet){ - if (orbiting=obj_controller.temp[2001]) and (owner=obj_controller.temp[2002]){ - cap_total += capital_number; - frig_total += frigate_number; - escort_total += escort_number; - } - } - - en_strength+=cap_total*4; - en_strength+=frig_total*2; - en_strength+=escort_total; - - - ratio=9999;if (p_strength>0) and (en_strength>0){ratio=(en_strength/p_strength)*100;} - - var esc_lost,frig_lost,cap_lost,which,sayd; - esc_lost=0;frig_lost=0;cap_lost=0;which=0;sayd=0; - - ship_lost=0;i=-1;// var ship_lost,i; - repeat(50){i+=1;ship_lost[i]=0;}i=0; - if (scr_has_adv("Kings of Space")) then rdice-=10; - if (rdice<=80) and (p_strength<=2) then rdice=-5; - - if (rdice!=-5){ - repeat(50){ - diceh=floor(random(100))+1; - if (diceh<=ratio){ratio-=100; - var onceh;onceh=0; - - if (mfleet.escort_number>0) and (onceh=0){ - esc_lost+=1; - which=floor(random(mfleet.escort_number))+1; - sayd=mfleet.escort_num[which]; - - obj_ini.ship_hp[sayd]=0;ship_lost[sayd]=1; - onceh=1;mfleet.escort_number-=1; - } - if (mfleet.frigate_number>0) and (onceh=0){ - frig_lost+=1; - which=floor(random(mfleet.frigate_number))+1; - sayd=mfleet.frigate_num[which]; - - obj_ini.ship_hp[sayd]=0;ship_lost[sayd]=1; - onceh=1;mfleet.frigate_number-=1; - } - if (mfleet.capital_number>0) and (onceh=0){ - cap_lost+=1; - which=floor(random(mfleet.capital_number))+1; - sayd=mfleet.capital_num[which]; - - obj_ini.ship_hp[sayd]=0;ship_lost[sayd]=1; - onceh=1;mfleet.capital_number-=1; - } - - // show_message("Ship lost"); - } - - } - scr_dead_marines(1); - } - - obj_p_fleet.selected=0; - obj_p_fleet.alarm[6]=1; - with(obj_fleet_select){instance_destroy();} - obj_controller.popup=0; - if (obj_controller.zoomed=1){with(obj_controller){scr_zoom();}} - - type=98;title="Fleet Retreating"; - cooldown=15;obj_controller.menu=0; - - // 139; - with(obj_temp_inq){instance_destroy();} - instance_create(obj_turn_end.battle_pobject[obj_turn_end.current_battle].x,obj_turn_end.battle_pobject[obj_turn_end.current_battle].y,obj_temp_inq); - with(obj_en_fleet){ - if (navy=1) and (point_distance(x,y,obj_temp_inq.x,obj_temp_inq.y)<40) and (trade_goods="player_hold") then trade_goods=""; - } - with(obj_temp_inq){instance_destroy();} - - if (esc_lost+frig_lost+cap_lost>0) and (mfleet.escort_number+mfleet.frigate_number+mfleet.capital_number>0){ - text="Your fleet is given the command to fall back. The vesels turn and prepare to enter the Warp, constantly under a hail of enemy fire. Some of your ships remain behind to draw off the attack and give the rest of your fleet a chance to escape. "; - - if (cap_lost=1) then text+=string(cap_lost)+" Battle Barge is destroyed. "; - if (frig_lost=1) then text+=string(frig_lost)+" Strike Cruiser is destroyed. "; - if (esc_lost=1) then text+=string(esc_lost)+" Escort is destroyed. "; - - if (cap_lost>1) then text+=string(cap_lost)+" Battle Barges were destroyed. "; - if (frig_lost>1) then text+=string(frig_lost)+" Strike Cruisers were destroyed. "; - if (esc_lost>1) then text+=string(esc_lost)+" Escorts were destroyed. "; - } - - if (esc_lost+frig_lost+cap_lost=0){ - text="Your fleet is given the command to fall back. The vesels turn and prepare to enter the Warp, constantly under a hail of enemy fire. The entire fleet manages to escape with minimal damage."; - } - - if (mfleet.escort_number+mfleet.frigate_number+mfleet.capital_number=0){ - text="Your fleet is given the command to fall back. The vessels turn and prepare to enter the Warp, constantly under a hail of enemy fire. All of your ships are destroyed attempting to flee."; - } - with (mfleet){ - complex_route=[]; - } - - with(obj_fleet_select){instance_destroy();} - if (mfleet.escort_number+mfleet.frigate_number+mfleet.capital_number=0) and (instance_exists(mfleet)){with(mfleet){instance_destroy();}} - - /* - with(obj_ini){scr_dead_marines(1);} - with(obj_ini){scr_ini_ship_cleanup();} - */ - + player_retreat_from_fleet_combat(); } } diff --git a/objects/obj_popup/Step_0.gml b/objects/obj_popup/Step_0.gml index b0779b91f..e26486d26 100644 --- a/objects/obj_popup/Step_0.gml +++ b/objects/obj_popup/Step_0.gml @@ -1,1588 +1,2144 @@ +try { + if (hide == true) { + exit; + } + + if ((cooldown >= 0) && (cooldown <= 40)) { + cooldown -= 1; + } + if (instance_exists(obj_controller)) { + if (obj_controller.zoomed == 1) { + with (obj_controller) { + scr_zoom(); + } + } + } + + if (keyboard_check_pressed(ord("1")) && (cooldown <= 0)) { + press = 1; + } + if (keyboard_check_pressed(ord("2")) && (cooldown <= 0)) { + press = 2; + } + if (keyboard_check_pressed(ord("3")) && (cooldown <= 0)) { + press = 3; + } + if ((press == 1) && (option1 == "")) { + press = 0; + } + if ((press == 2) && (option2 == "")) { + press = 0; + } + if ((press == 3) && (option3 == "")) { + press = 0; + } + if ((press != 0) && (cooldown > 0)) { + press = 0; + exit; + } + + if ((type != 6) && (master_crafted == 1)) { + master_crafted = 0; + } + + if ((type == 9.1) && (obj_controller.stc_wargear_un + obj_controller.stc_vehicles_un + obj_controller.stc_ships_un <= 0)) { + obj_controller.cooldown = 10; + instance_destroy(); + exit; + } + + if ((image == "fuklaw") && (save > 0)) { + if (press == 1) { + var del = obj_saveload.save[save]; + var _save_file = $"save{del}.ini"; + if (file_exists(_save_file)) { + file_delete(_save_file); + if (file_exists($"save{del}log.ini")) { + file_delete($"save{del}log.ini"); + } + if (file_exists($"screen{del}.png")) { + file_delete($"screen{del}.png"); + } + with (obj_saveload) { + instance_destroy(); + } + var news = instance_create(0, 0, obj_saveload); + news.menu = woopwoopwoop; + news.top = owner; + news.alarm[4] = 1; -if (hide=true) then exit; - -if (cooldown>=0) and (cooldown<=40) then cooldown-=1; -if (instance_exists(obj_controller)){if (obj_controller.zoomed=1) then with(obj_controller){scr_zoom();}} - - -if keyboard_check_pressed(ord("1")) and (cooldown<=0) then press=1; -if keyboard_check_pressed(ord("2")) and (cooldown<=0) then press=2; -if keyboard_check_pressed(ord("3")) and (cooldown<=0) then press=3; -if (press=1) and (option1="") then press=0; -if (press=2) and (option2="") then press=0; -if (press=3) and (option3="") then press=0; -if (press!=0) and (cooldown>0){ - press=0; - exit; -} + instance_destroy(); + } + } + if (press == 2) { + instance_destroy(); + } + exit; + } + + if ((room_get_name(room) == "Main_Menu") && (title == "Tutorial")) { + if (press == 2) { + // 1: yes, 2: no (without disabling) + obj_main_menu_buttons.fading = 1; + obj_main_menu_buttons.crap = 3; + obj_main_menu_buttons.cooldown = 9999; + instance_destroy(); + } + if (press == 3) { + ini_open("saves.ini"); + ini_write_real("Data", "tutorial", 1); + ini_close(); + } + + if (press >= 2) { + obj_main_menu_buttons.fading = 1; + obj_main_menu_buttons.crap = self.press; + obj_main_menu_buttons.cooldown = 9999; + instance_destroy(); + } + exit; + } + + if ((image == "debug_banshee") && (cooldown <= 0)) { + if (planet == 2) { + if ((press == 1) || (press == 3)) { + if (press == 1) { + amount = 7; + } + if (press == 3) { + amount = 9; + } + with (obj_star) { + if ((choose(0, 1, 1) == 1) && (owner != eFACTION.Eldar) && (owner != 1)) { + var fleet; + fleet = instance_create(x, y, obj_en_fleet); + fleet.owner = obj_popup.amount; + if (obj_popup.amount == 7) { + fleet.sprite_index = spr_fleet_ork; + fleet.capital_number = 3; + present_fleet[7] += 1; + } + if (obj_popup.amount == 9) { + if (present_fleet[1] == 0) { + vision = 0; + } + fleet.sprite_index = spr_fleet_tyranid; + fleet.capital_number = 3; + fleet.frigate_number = 6; + fleet.escort_number = 16; + present_fleet[9] += 1; + } + fleet.image_index = 4; + fleet.orbiting = id; + } + } + instance_destroy(); + } + if (press == 2) { + with (obj_star) { + if ((choose(0, 1, 1) == 1) && (owner != eFACTION.Eldar) && (owner != 1)) { + var h; + h = 0; + repeat (4) { + h += 1; + if ((p_type[h] != "Dead") && (p_type[h] != "")) { + p_traitors[h] = 5; + p_chaos[h] = 4; + } + } + } + } + instance_destroy(); + } + } + if (planet == 5) { + if (press == 1) { + var fleet, tar; + tar = instance_nearest(x, y, obj_star); + fleet = instance_create(tar.x, tar.y, obj_en_fleet); + fleet.owner = eFACTION.Ork; + fleet.sprite_index = spr_fleet_ork; + fleet.capital_number = 2; + fleet.frigate_number = 5; + tar.present_fleet[7] += 1; + fleet.image_index = 4; + fleet.orbiting = id; + instance_destroy(); + } + if (press == 2) { + var fleet, tar; + tar = instance_nearest(x, y, obj_star); + fleet = instance_create(tar.x, tar.y, obj_en_fleet); + fleet.owner = eFACTION.Tau; + fleet.sprite_index = spr_fleet_tau; + fleet.capital_number = 2; + fleet.frigate_number = 5; + tar.present_fleet[8] += 1; + fleet.image_index = 4; + fleet.orbiting = id; + instance_destroy(); + } + if (press == 3) { + instance_destroy(); + } + } + if (planet == 3) { + if (press == 1) { + var fleet, tar; + tar = instance_nearest(x, y, obj_star); + fleet = instance_create(tar.x, tar.y, obj_en_fleet); + fleet.owner = eFACTION.Imperium; + fleet.sprite_index = spr_fleet_imperial; + fleet.capital_number = 2; + fleet.frigate_number = 5; + tar.present_fleet[2] += 1; + fleet.image_index = 4; + fleet.orbiting = id; + instance_destroy(); + } + if (press == 2) { + var fleet, tar; + tar = instance_nearest(x, y, obj_star); + fleet = instance_create(tar.x, tar.y, obj_en_fleet); + fleet.owner = eFACTION.Chaos; + fleet.sprite_index = spr_fleet_chaos; + fleet.capital_number = 2; + fleet.frigate_number = 5; + tar.present_fleet[10] += 1; + fleet.image_index = 4; + fleet.orbiting = id; + instance_destroy(); + } + if (press == 3) { + planet = 5; + cooldown = 30; + text = "Ork, Tau, Cancel?"; + option1 = "Ork"; + option2 = "Tau"; + option3 = "Cancel"; + press = 0; + exit; + } + } + if (planet == 1) { + if (press == 1) { + planet = 2; + cooldown = 30; + text = "Select a faction"; + option1 = "Orks"; + option2 = "Chaos"; + option3 = "Tyranids"; + press = 0; + exit; + } + if (press == 2) { + planet = 3; + cooldown = 30; + text = "Imperium, Heretic, or Xeno?"; + option1 = "Imperium"; + option2 = "Heretic"; + option3 = "Xeno"; + press = 0; + exit; + } + if (press == 3) { + var flit1, flit2, onceh; + onceh = 0; + flit1 = instance_nearest(x, y, obj_p_fleet); + flit2 = instance_nearest(x, y, obj_en_fleet); + + if (instance_exists(flit1) && instance_exists(flit2)) { + if (point_distance(x, y, flit1.x, flit1.y) > point_distance(x, y, flit2.x, flit2.y)) { + with (flit2) { + instance_destroy(); + } + } else { + with (flit1) { + instance_destroy(); + } + } + onceh = 1; + } + if ((onceh == 0) && (!instance_exists(flit1)) && instance_exists(flit2)) { + if (point_distance(x, y, flit2.x, flit2.y) <= 40) { + with (flit2) { + instance_destroy(); + } + } + onceh = 1; + } + if ((onceh == 0) && instance_exists(flit1) && (!instance_exists(flit2))) { + if (point_distance(x, y, flit1.x, flit1.y) <= 40) { + with (flit1) { + instance_destroy(); + } + } + onceh = 1; + } -if (type!=6) and (master_crafted=1) then master_crafted=0; + instance_destroy(); + } + } + exit; + } + + if (((title == "Inquisition Mission") || (title == "Inquisition Recon")) && (title != "Artifact Located") && (obj_controller.demanding == 1)) { + demand = 1; + } + + if ((image == "chaos_messenger") && (title == "Chaos Meeting")) { + if ((mission == "meeting_1") || (mission == "meeting_1t")) { + if (option1 == "") { + option1 = "Die, heretic!"; + option2 = "Very well. Lead the way."; + option3 = "I must take care of an urgent matter first. (Exit)"; + exit; + } + if (option1 != "") { + if (press == 1) { + with (obj_star) { + var i = 0; + repeat (planets) { + remove_planet_problem(i, "meeting"); + remove_planet_problem(i, "meeting_trap"); + } + } + obj_controller.disposition[10] -= 10; + text = "The heretic is killed in a most violent fashion. With a lack of go-between the meeting cannot proceed."; + option1 = ""; + option2 = ""; + option3 = ""; + mission = ""; // image=""; + if (obj_controller.blood_debt == 1) { + obj_controller.penitent_current += 1; + obj_controller.penitent_turn = 0; + obj_controller.penitent_turnly = 0; + } + with (obj_temp_meeting) { + instance_destroy(); + } + cooldown = 20; + exit; + } else if ((press == 2) && (mission == "meeting_1")) { + obj_controller.complex_event = true; + obj_controller.current_eventing = "chaos_meeting_1"; + text = "mission_star signal your readiness to the heretic. Nearly twenty minutes of following the man passes before mission_star all enter an ordinary-looking structure. Down, within the basement, mission_star then pass into the entrance of a tunnel. As the trek downward continues more and more heretics appear- cultists, renegades that appear to be from the local garrison, and occasionally even the fallen of your kind. Overall the heretics seem well supplied and equip. This observation is interrupted as your group enters into a larger chamber, revealing a network of tunnels and what appears to be ancient catacombs. Bones of the ancient dead, the forgotten, litter the walls and floor. And the chamber seems to open up wider, and wider, until mission_star find yourself within a hall. Within this hall, waiting for mission_star, are several dozen Chaos Terminators, a Greater Daemon of Tzeentch and Slaanesh, and Chaos Lord " + string(obj_controller.faction_leader[eFACTION.Chaos]) + "."; + option1 = ""; + option2 = ""; + option3 = ""; + mission = "cslord1"; + image = ""; + img = 0; + image_wid = 0; + size = 3; + cooldown = 20; + exit; + } else if ((press == 2) && (mission == "meeting_1t")) { + with (obj_star) { + remove_star_problem("meeting"); + remove_star_problem("meeting_trap"); + } + obj_controller.complex_event = true; + obj_controller.current_eventing = "chaos_trap"; + text = "mission_star signal your readiness to the heretic. Nearly twenty minutes of following the man passes before mission_star all enter an ordinary-looking structure. Down, within the basement, mission_star then pass into the entrance of a tunnel. As the trek downward continues more and more heretics appear- cultists, renegades that appear to be from the local garrison, and occasionally even the fallen of your kind. Overall the heretics seem well supplied and equip. This observation is interrupted as your group enters into a larger chamber, revealing a network of tunnels and what appears to be ancient catacombs. Bones of the ancient dead, the forgotten, litter the walls and floor. And the chamber seems to open up wider, and wider, until mission_star find yourself within a hall. Within this hall, waiting for mission_star, are several dozen Chaos Terminators, a handful of Helbrute, and many more Chaos Space Marines. The Chaos Lord is nowhere to be seen. It is a trap."; + option1 = ""; + option2 = ""; + option3 = ""; + mission = "cslord1t"; + image = ""; + img = 0; + image_wid = 0; + size = 3; + cooldown = 20; + exit; + } + if ((press == 3) && instance_exists(obj_turn_end)) { + if (number != 0) { + obj_turn_end.alarm[1] = 4; + } + with (obj_temp_meeting) { + instance_destroy(); + } + instance_destroy(); + } + } + } + } + + if (title == "Scheduled Event") { + if (option1 == "") { + option1 = "Yes!"; + option2 = "No."; + exit; + } + + if ((press == 1) && (!instance_exists(obj_event))) { + instance_create(0, 0, obj_event); + if (obj_controller.fest_planet == 0) { + obj_controller.fest_attend = scr_event_dudes(1, 0, "", obj_controller.fest_sid); + } + if (obj_controller.fest_planet == 1) { + scr_event_dudes(1, 1, obj_controller.fest_star, obj_controller.fest_wid); + } + hide = true; + cooldown = 6000; + title = "Scheduled Event:2"; + exit; + } + if (press == 2) { + obj_controller.fest_repeats -= 1; + if (obj_controller.fest_repeats <= 0) { + obj_controller.fest_scheduled = 0; + + instance_create(0, 0, obj_event); + if (obj_controller.fest_planet == 0) { + obj_controller.fest_attend = scr_event_dudes(1, 0, "", obj_controller.fest_sid); + } + if (obj_controller.fest_planet == 1) { + scr_event_dudes(1, 1, obj_controller.fest_star, obj_controller.fest_wid); + } -if (type=9.1) and (obj_controller.stc_wargear_un+obj_controller.stc_vehicles_un+obj_controller.stc_ships_un<=0){ - obj_controller.cooldown=10;instance_destroy();exit; -} + with (obj_event) { + var ide = 0; + repeat (700) { + ide += 1; + if ((attend_corrupted[ide] == 0) && (attend_id[ide] > 0)) { + if (string_count("Chaos", obj_ini.artifact_tags[obj_controller.fest_display]) > 0) { + obj_ini.TTRPG[attend_co[ide], attend_id[ide]].corruption += choose(1, 2, 3, 4); + } + if (string_count("Daem", obj_ini.artifact_tags[obj_controller.fest_display]) > 0) { + obj_ini.TTRPG[attend_co[ide], attend_id[ide]].corruption += choose(6, 7, 8, 9); + } + attend_corrupted[ide] = 1; + } + } + } + with (obj_event) { + instance_destroy(); + } -if (image="fuklaw") and (save>0){ - if (press=1){ - var del;del=obj_saveload.save[self.save]; - if (file_exists("save"+string(del)+".ini")){ - file_delete("save"+string(del)+".ini"); - if (file_exists("save"+string(del)+"log.ini")){file_delete("save"+string(del)+"log.ini");} - if (file_exists("screen"+string(del)+".png")){file_delete("screen"+string(del)+".png");} - with(obj_saveload){instance_destroy();} - var news=instance_create(0,0,obj_saveload); - news.menu=woopwoopwoop; - news.top=owner; - news.alarm[4]=1; - - instance_destroy(); - } - } - if (press=2){instance_destroy();} - exit; -} + var p1, p2, p3; + p1 = obj_controller.fest_type; + p3 = ""; + p2 = obj_controller.fest_planet; + if (p2 > 0) { + p3 = string(obj_controller.fest_star) + " " + scr_roman(obj_controller.fest_wid); + } + if (p2 <= 0) { + p3 = +" the vessel '" + string(obj_ini.ship[obj_controller.fest_sid]) + "'"; + } + scr_alert("green", "event", string(p1) + " on " + string(p3) + " ends.", 0, 0); + scr_event_log("green", string(p1) + " on " + string(p3) + " ends."); + } + obj_controller.cooldown = 10; + if (number != 0) { + obj_turn_end.alarm[1] = 4; + } + instance_destroy(); + } + } + if (title == "Scheduled Event:2") { + exit; + } + + if ((image == "inquisition") && (loc == "contraband")) { + demand = 0; + option1 = "Hand over all Chaos and Daemonic Artifacts"; + option2 = "Over your dead body"; + var arti; + if (press == 1) { + var contraband = []; + for (var i = 0; i < array_length(obj_ini.artifact_struct); i++) { + if (obj_ini.artifact != "") { + arti = obj_ini.artifact_struct[i]; + if (arti.inquisition_disaprove()) { + array_push(contraband, i); + } + } + } + for (i = 0; i < array_length(contraband); i++) { + delete_artifact(contraband[i]); + } + obj_controller.cooldown = 10; + option1 = ""; + option2 = ""; + loc = ""; + text = "All Chaos and Daemonic Artifacts present have been handed over to the Inquisitor. They remain seething, but your destruction has been stalled. Or so mission_star imagine."; + exit; + } + + if (press == 2) { + obj_controller.cooldown = 10; + if (number != 0) { + obj_turn_end.alarm[1] = 4; + } + instance_destroy(); + } + } + + if ((title == "Planetary Governor Assassinated") && (option1 != "") && (cooldown <= 0)) { + if ((new_target == 0) && instance_exists(obj_temp6)) { + new_target = instance_nearest(obj_temp6.x, obj_temp6.y, obj_star); + with (obj_temp6) { + instance_destroy(); + } + } + + if (press > 0) { + var randa, randa2; + randa = floor(random(100)) + 1; + randa2 = floor(random(100)) + 1; + if (scr_has_disadv("Shitty Luck")) { + randa -= 20; + } + } -if (room_get_name(room)="Main_Menu") and (title="Tutorial"){ - if (press=2){// 1: yes, 2: no (without disabling) - obj_main_menu_buttons.fading=1; - obj_main_menu_buttons.crap=3; - obj_main_menu_buttons.cooldown=9999; - instance_destroy(); - } - if (press=3){ini_open("saves.ini");ini_write_real("Data","tutorial",1);ini_close();} + if (press == 1) { + new_target.dispo[planet] = min(obj_ini.imperium_disposition, obj_controller.disposition[2]) + choose(-1, -2, -3, -4, 0, 1, 2, 3, 4); + if (randa <= 3) { + new_target.dispo[planet] = min(new_target.dispo[planet], choose(1, 2, 3, 4, 5, 6) * 3); + } + if (randa >= 95) { + new_target.dispo[planet] = max(new_target.dispo[planet], 60 + choose(1, 2, 3, 4, 5, 6) * 3); + } + scr_event_log("", "Planetary Governor of " + string(new_target.name) + " " + scr_roman(planet) + " assassinated. The next in line takes over.", new_target.name); + text = "The next in line for rule of " + string(new_target.name) + " " + scr_roman(planet) + " has taken over their rightful position of Planetary Governor."; + option1 = ""; + option2 = ""; + option3 = ""; + with (obj_ground_mission) { + instance_destroy(); + } + cooldown = 30; + exit; + } + if (press == 2) { + new_target.dispo[planet] = 70 + floor(random_range(5, 15)) + 1; + scr_event_log("", "Planetary Governor of " + string(new_target.name) + " " + scr_roman(planet) + " assassinated. A more suitable Governor is installed."); + if (randa2 <= (10 * estimate)) { + var v = 0, ev = 0; + repeat (99) { + v += 1; + if ((ev == 0) && (obj_controller.event[v] == "")) { + ev = v; + } + } + obj_controller.event[ev] = "governor_assassination_1|" + string(new_target.name) + "|" + string(planet) + "|"; + obj_controller.event_duration[ev] = ((choose(1, 2, 3, 4, 5, 6) + choose(1, 2, 3, 4, 5, 6)) * 6) + choose(-3, -2, -1, 0, 1, 2, 3); + } + text = "Many of the successors for " + string(new_target.name) + " " + scr_roman(planet) + " are removed or otherwise made indisposed. Your chapter ensures that the new Planetary Governor is sympathetic to your plight and more than willing to heed your advice. A powerful new ally may be in the making."; + option1 = ""; + option2 = ""; + option3 = ""; + with (obj_ground_mission) { + instance_destroy(); + } + cooldown = 30; + exit; + } + if (press == 3) { + new_target.dispo[planet] = 101; + scr_event_log("", "Planetary Governor of " + string(new_target.name) + " " + scr_roman(planet) + " assassinated. One of your Chapter Serfs take their position."); + if (randa2 <= (25 * estimate)) { + var v = 0, ev = 0; + repeat (99) { + v += 1; + if ((ev == 0) && (obj_controller.event[v] == "")) { + ev = v; + } + } + obj_controller.event[ev] = "governor_assassination_2|" + string(new_target.name) + "|" + string(planet) + "|"; + obj_controller.event_duration[ev] = (choose(1, 2) * 6) + choose(-3, -2, -1, 0, 1, 2, 3); + } + text = $"All of the successors for {planet_numeral_name(planet, new_target)} are removed or otherwise made indisposed. Paperwork is slightly altered. Rather than any sort of offical one of your Chapter Serfs is installed as the Planetary Governor. The planet is effectively under your control."; + if (new_target.p_first[planet] != 3) { + new_target.p_owner[planet] = 1; + } + option1 = ""; + option2 = ""; + option3 = ""; + with (obj_ground_mission) { + instance_destroy(); + } + cooldown = 30; + exit; + } + } + /* + var he;he=instance_create(argument0.x,argument0.y,obj_temp6); + var pip;pip=instance_create(0,0,obj_popup); + pip.title="Planetary Governor Assassinated"; + pip.text=txt; - if (press>=2){ - obj_main_menu_buttons.fading=1; - obj_main_menu_buttons.crap=self.press; - obj_main_menu_buttons.cooldown=9999; - instance_destroy(); - } - exit; -} - - - - -if (image="debug_banshee") and (cooldown<=0){ - if (planet=2){ - if (press=1) or (press=3){ - if (press=1) then amount=7; - if (press=3) then amount=9; - with(obj_star){ - if (choose(0,1,1)=1) and (owner != eFACTION.Eldar) and (owner!=1){ - var fleet; - fleet=instance_create(x,y,obj_en_fleet); - fleet.owner=obj_popup.amount; - if (obj_popup.amount=7){fleet.sprite_index=spr_fleet_ork;fleet.capital_number=3;present_fleet[7]+=1;} - if (obj_popup.amount=9){ - if (present_fleet[1]=0) then vision=0; - fleet.sprite_index=spr_fleet_tyranid;fleet.capital_number=3;fleet.frigate_number=6;fleet.escort_number=16;present_fleet[9]+=1; - } - fleet.image_index=4; - fleet.orbiting=id; - } - } - instance_destroy(); - } - if (press=2){ - with(obj_star){ - if (choose(0,1,1)=1) and (owner != eFACTION.Eldar) and (owner!=1){ - var h;h=0;repeat(4){h+=1;if (p_type[h]!="Dead") and (p_type[h]!=""){p_traitors[h]=5;p_chaos[h]=4;}} - } - } - instance_destroy(); - } - } - if (planet=5){ - if (press=1){ - var fleet,tar;tar=instance_nearest(x,y,obj_star); - fleet=instance_create(tar.x,tar.y,obj_en_fleet); - fleet.owner = eFACTION.Ork;fleet.sprite_index=spr_fleet_ork; - fleet.capital_number=2;fleet.frigate_number=5; - tar.present_fleet[7]+=1;fleet.image_index=4; - fleet.orbiting=id;instance_destroy(); - } - if (press=2){ - var fleet,tar;tar=instance_nearest(x,y,obj_star); - fleet=instance_create(tar.x,tar.y,obj_en_fleet); - fleet.owner = eFACTION.Tau;fleet.sprite_index=spr_fleet_tau; - fleet.capital_number=2;fleet.frigate_number=5; - tar.present_fleet[8]+=1;fleet.image_index=4; - fleet.orbiting=id;instance_destroy(); - } - if (press=3) then instance_destroy(); + pip.option1="Allow the official successor to become Planetary Governor."; + pip.option2="Ensure that a sympathetic successor will be the one to rule."; + pip.option3="Remove all successors and install a loyal Chapter Serf."; + + // Result- this is the multiplier for the chance of discovery with the inquisition, can also be used to determine + // the new Governor disposition if they are the official successor + if (aroll<=chance){// Discovered + pip.estimate=2; } - if (planet=3){ - if (press=1){ - var fleet,tar;tar=instance_nearest(x,y,obj_star); - fleet=instance_create(tar.x,tar.y,obj_en_fleet); - fleet.owner = eFACTION.Imperium;fleet.sprite_index=spr_fleet_imperial; - fleet.capital_number=2; - fleet.frigate_number=5; - tar.present_fleet[2]+=1; - fleet.image_index=4; - fleet.orbiting=id; - instance_destroy(); - } - if (press=2){ - var fleet,tar;tar=instance_nearest(x,y,obj_star); - fleet=instance_create(tar.x,tar.y,obj_en_fleet); - fleet.owner = eFACTION.Chaos;fleet.sprite_index=spr_fleet_chaos; - fleet.capital_number=2;fleet.frigate_number=5; - tar.present_fleet[10]+=1;fleet.image_index=4; - fleet.orbiting=id; - instance_destroy(); - } - if (press=3){ - planet=5;cooldown=30; - text="Ork, Tau, Cancel?"; - option1="Ork"; - option2="Tau"; - option3="Cancel"; - press=0;exit; - } + if (aroll>chance){// Success + pip.estimate=1; } - if (planet=1){ - if (press=1){planet=2;cooldown=30;text="Select a faction";option1="Orks";option2="Chaos";option3="Tyranids";press=0;exit;} - if (press=2){planet=3;cooldown=30;text="Imperium, Heretic, or Xeno?";option1="Imperium";option2="Heretic";option3="Xeno";press=0;exit;} - if (press=3){ - var flit1,flit2,onceh;onceh=0; - flit1=instance_nearest(x,y,obj_p_fleet); - flit2=instance_nearest(x,y,obj_en_fleet); - - if (instance_exists(flit1)) and (instance_exists(flit2)){ - if (point_distance(x,y,flit1.x,flit1.y)>point_distance(x,y,flit2.x,flit2.y)) then with(flit2){instance_destroy();} - else with(flit1){instance_destroy();} - onceh=1; - } - if (onceh=0) and (!instance_exists(flit1)) and (instance_exists(flit2)){ - if (point_distance(x,y,flit2.x,flit2.y)<=40) then with(flit2){instance_destroy();}onceh=1; - } - if (onceh=0) and (instance_exists(flit1)) and (!instance_exists(flit2)){if (point_distance(x,y,flit1.x,flit1.y)<=40) then with(flit1){instance_destroy();}onceh=1;} - - instance_destroy(); + */ + + if (image == "ruins_fort") { + if ((press == 1) && (obj_controller.requisition >= 1000)) { + obj_controller.requisition -= 1000; + text = "Resources have been spent on the planet to restore the fortress. The planet's defense rating has increased to 5 ("; + option1 = ""; + option2 = ""; + option3 = ""; + text += string(star_system.p_fortified[planet]) + "+"; + text += string(5 - star_system.p_fortified[planet]) + ")"; + star_system.p_fortified[planet] = max(star_system.p_fortified[planet], 5); + cooldown = 15; + exit; + } + if (press == 2) { + var req = floor(random_range(200, 500)) + 1; + image = ""; + text = "Much of the fortress is demolished in order to salvage adamantium and raw materials. The opration has yielded " + string(req) + " requisition."; + option1 = ""; + option2 = ""; + option3 = ""; + obj_controller.requisition += req; + cooldown = 15; + exit; + } + + /* + if (loot="fortress"){// Fortress + var gene,pop;gene=floor(random_range(20,40))+1;pop=instance_create(0,0,obj_popup); + pop.image="ruins_fort";pop.title="Ancient Ruins: Fortress"; + pop.text="Your battle brothers have found a massive, ancient fortress that has fallen into disrepair. Gun batteries rusted, and walls covered in moss and undergrowth, it is a pale shadow of its former glory. It is possible to repair the structure. What is thy will?"; + pop.option1="Repair the fortress to boost planet defenses. (1000 Req)"; + pop.option2="Salvage raw materials from the fortress."; } - } - exit; -} + */ + } + + if ((image == "mechanicus") && (title == "Mechanicus Mission") || (title == "Mechanicus Mission Accepted")) { + if ((option1 == "") && (title == "Mechanicus Mission")) { + option1 = "Accept"; + option2 = "Refuse"; + } else if ((press == 1) && (option1 != "")) { + if (string_count("tomb", mission) > 0) { + with (obj_temp5) { + instance_destroy(); + } + with (obj_star) { + if (name == obj_popup.loc) { + instance_create(x, y, obj_temp5); + } + } + if (instance_exists(obj_temp5)) { + var tempy, eh, eh2, that, that2; + tempy = instance_nearest(obj_temp5.x, obj_temp5.y, obj_star); + eh = 0; + that = 0; + eh2 = 0; + that2 = 0; + repeat (4) { + eh += 1; + var tomb_list = search_planet_features(tempy.p_feature[eh], P_features.Necron_Tomb); + if ((tempy.p_owner[eh] <= 5) && (array_length(tomb_list) > 0)) { + for (var tomb = 0; tomb < array_length(tomb_list); tomb++) { + if (tempy.p_feature[eh][tomb].awake == 0) { + that = eh; + } + if (that != 0) { + break; + } + } + } + } + with (obj_temp5) { + instance_destroy(); + } + if (eh > 0) { + if (find_problem_planet(that, "", tempy) > 0) { + add_new_problem(that, "mech_tomb1", 17, tempy); + text = "The Adeptus Mechanicus await your forces at " + string(tempy.name) + " " + scr_roman(that) + ". They are expecting at least two squads of Astartes and have placed the testing on hold until their arrival. mission_star have 16 months to arrive."; + scr_event_log("", "Mechanicus Mission Accepted: At least two squads of marines are expected at " + string(tempy.name) + " " + scr_roman(that) + " within 16 months.", tempy.name); + new_star_event_marker("green"); + title = "Mechanicus Mission Accepted"; + option1 = ""; + option2 = ""; + cooldown = 15; + exit; + } + } + } + } + if ((string_count("raider", mission) > 0) || (string_count("bionics", mission) > 0) || (string_count("mech_mars", mission) > 0)) { + var mission_star = star_by_name(obj_popup.loc); + if (instance_exists(mission_star)) { + var forge_planet = scr_get_planet_with_type(mission_star, "Forge"); + if (mission_star.p_owner[eh] == 3 && forge_planet) { + mission_loc = planet_numeral_name(forge_planet, mission_star); + if (string_count("raider", mission)) { + add_new_problem(forge_planet, "mech_raider", 49, mission_star, {"completion": 0}); + text = $"The Adeptus Mechanicus await your forces at {mission_loc}. They are expecting six {obj_ini.role[100][16]}s and a Land Raider."; + scr_event_log("", $"Mechanicus Mission Accepted: Six of your {obj_ini.role[100][16]}s and a Land Raider are to be stationed at {mission_loc} for 24 months.", mission_star.name); + } else if (string_count("bionics", mission)) { + add_new_problem(forge_planet, "mech_bionics", 49, mission_star, {"completion": 0}); + text = $"The Adeptus Mechanicus await your forces at {mission_loc}. They are expecting ten Astartes with bionics."; + scr_event_log("", $"Mechanicus Mission Accepted: Ten Astartes with bionics are to be stationed at {mission_loc} for 24 months for testing purposes.", mission_star.name); + } else if (string_count("mars", mission)) { + add_new_problem(forge_planet, "mech_mars", 13, mission_star); + text = $"The Adeptus Mechanicus await your {obj_ini.role[100][16]}s at {mission_loc}. They are willing to hold on the voyage for up to 12 months."; + scr_event_log("", $"Mechanicus Mission Accepted: {obj_ini.role[100][16]}s are expected at {mission_loc} within 12 months, for the voyage to Mars.", tempy.name); + } + with (mission_star) { + new_star_event_marker("green"); + } + cooldown = 15; + title = "Mechanicus Mission Accepted"; + option1 = ""; + option2 = ""; + option3 = ""; + exit; + } + } + } + // Other missions here + } else if ((press == 2) && (option2 != "")) { + obj_controller.cooldown = 10; + if (number != 0) { + obj_turn_end.alarm[1] = 4; + } + instance_destroy(); + } + } + + if (image == "geneseed_lab") { + if (press == 1) { + image = ""; + text = string(estimate) + " gene-seed has been added to the chapter vaults."; + option1 = ""; + option2 = ""; + option3 = ""; + obj_controller.gene_seed += estimate; + with (obj_ground_mission) { + instance_destroy(); + } + cooldown = 15; + exit; + } + if (press == 2) { + var req; + req = floor(random_range(200, 500)) + 1; + image = ""; + text = "Technological components have been salvaged, granting " + string(req) + " requisition."; + option1 = ""; + option2 = ""; + option3 = ""; + obj_controller.requisition += req; + with (obj_ground_mission) { + instance_destroy(); + } + cooldown = 15; + exit; + } + if (press == 3) { + with (obj_ground_mission) { + instance_destroy(); + } + obj_controller.cooldown = 15; + cooldown = 15; + instance_destroy(); + exit; + } + } + + if (image == "ancient_ruins" && woopwoopwoop && move_to_next_stage()) { + instance_deactivate_all(true); + instance_activate_object(obj_ground_mission); + instance_activate_object(obj_popup); + var _explore_feature = obj_ground_mission.explore_feature; + _explore_feature.suprise_attack(); + woopwoopwoop = 0; + show_debug_message("ruins combat"); + instance_destroy(self.id); + instance_destroy(); + exit; + } else if (image == "ancient_ruins" && option1 != "" && instance_exists(obj_ground_mission)) { + if (press == 1) { + // Begin + var _ruins = obj_ground_mission.explore_feature; + var ruins_battle = 0, ruins_fact = 0, ruins_disp = 0, ruins_reward = 0, dice, battle_threat = 0; + + _ruins.determine_race(); + + dice = floor(random(100)) + 1; + var shit_luck = scr_has_disadv("Shitty Luck"); + var pass_mark = shit_luck ? 66 : 50; + ruins_battle = dice <= pass_mark; + + // ruins_battle=1; + + if (ruins_battle == 1) { + dice = floor(random(100)) + 1; + if (shit_luck) { + dice += 10; + } + battle_threat = 4; + if ((dice > 0) && (dice <= 60)) { + battle_threat = 1; + } + if ((dice > 60) && (dice <= 90)) { + battle_threat = 2; + } + if ((dice > 90) && (dice <= 99)) { + battle_threat = 3; + } + if ((_ruins.ruins_race == 1) || (_ruins.ruins_race == 2) || (_ruins.ruins_race == 10)) { + ruins_battle = choose(10, 10, 10, 10, 11, 11, 12); + } + if (_ruins.ruins_race == 5) { + ruins_battle = 10; + } + if (_ruins.ruins_race == 6) { + ruins_battle = choose(6, 6, 10, 10, 10, 12); + } + if (ruins_battle == 1) { + ruins_battle = choose(6, 10, 12); + } + obj_ground_mission.ruins_race = _ruins.ruins_race; + obj_ground_mission.ruins_battle = ruins_battle; + obj_ground_mission.battle_threat = battle_threat; + + option1 = ""; + option2 = ""; + option3 = ""; + text = "Your marines descended into the ancient ruins, mapping them out as they go. They quickly determine the ruins were once "; + if (_ruins.ruins_race == 1) { + text += "a Space Marine fortification from earlier times."; + } + if (_ruins.ruins_race == 2) { + text += "golden-age Imperial ruins, lost to time."; + } + if (_ruins.ruins_race == 5) { + text += "a magnificent temple of the Imperial Cult."; + } + if (_ruins.ruins_race == 6) { + text += "Eldar colonization structures from an unknown time."; + } + if (_ruins.ruins_race == 10) { + text += "golden-age Imperial ruins, since decorated with spikes and bones."; + } + if (_ruins.failed_exploration == 1) { + text += "mission_star see the scarring in the walls and round impacts where your brothers died to clense this place of it's foul inhabitants"; + } + text += " Unfortunantly, it's too late before your Battle Brothers discern the ruins are still inhabited. Shapes begin to descend upon them from all directions, masked in the shadows."; + cooldown = 15; + woopwoopwoop = 1; + exit; + } + if (ruins_battle == 0) { + var obj = obj_ground_mission.obj; + instance_activate_object(obj_star); + scr_ruins_reward(star_by_name(obj_ground_mission.battle_loc), obj_ground_mission.num, obj_ground_mission.explore_feature); + instance_destroy(); + exit; + } + } + if (press == 2) { + // Nothing + obj_controller.cooldown = 10; + obj_controller.menu = 1; + // obj_controller.managing=manag; + with (obj_controller) { + var i = -1; + man_size = 0; + selecting_location = ""; + selecting_types = ""; + selecting_ship = -1; + sel_uid = 0; + reset_manage_arrays(); + alll = 0; + update_general_manage_view(); + } + with (obj_ground_mission) { + instance_destroy(); + } + instance_destroy(); + exit; + } + if (press == 3) { + // Return to ship, exit + scr_return_ship(obj_ground_mission.loc, obj_ground_mission, obj_ground_mission.num); + var man_size, ship_id, comp, plan, i; + i = 0; + ship_id = 0; + man_size = 0; + comp = 0; + plan = 0; + repeat (30) { + i += 1; + if (obj_ini.ship[i] == obj_ground_mission.loc) { + ship_id = i; + } + } + i = 0; + obj_controller.menu = 0; + obj_controller.managing = 0; + obj_controller.cooldown = 10; + with (obj_ground_mission) { + instance_destroy(); + } + instance_destroy(); + exit; + } + } + + if (image == "stc") { + if ((ma_co > 0) && (ma_id == 0)) { + if (press == 1) { + obj_ground_mission.alarm[5] = 1; + obj_controller.cooldown = 10; + instance_destroy(); + } + if (press == 2) { + scr_return_ship(obj_ground_mission.loc, obj_ground_mission, obj_ground_mission.num); + var man_size, ship_id, comp, plan, i; + i = 0; + ship_id = 0; + man_size = 0; + comp = 0; + plan = 0; + repeat (30) { + i += 1; + if (obj_ini.ship[i] == obj_ground_mission.loc) { + ship_id = i; + } + } + i = 0; + obj_controller.menu = 0; + obj_controller.managing = 0; + obj_controller.cooldown = 10; + with (obj_ground_mission) { + instance_destroy(); + } + instance_destroy(); + exit; + } + if (press == 3) { + exit; + } + } else if ((ma_co > 0) && (ma_id > 0)) { + if (press == 1) { + obj_ground_mission.alarm[5] = 1; + obj_controller.cooldown = 10; + instance_destroy(); + } + if (press == 2) { + scr_return_ship(obj_ground_mission.loc, obj_ground_mission, obj_ground_mission.num); + var man_size, ship_id, comp, plan, i; + i = 0; + ship_id = 0; + man_size = 0; + comp = 0; + plan = 0; + + ship_id = array_get_index(obj_ini.ship, obj_ground_mission.loc); + + obj_controller.menu = 0; + obj_controller.managing = 0; + obj_controller.cooldown = 10; + with (obj_ground_mission) { + instance_destroy(); + } + instance_destroy(); + exit; + } + if (press == 3) { + obj_ground_mission.alarm[6] = 1; + obj_controller.cooldown = 10; + instance_destroy(); + } + } else if ((ma_co == 0) && (ma_id > 0) && (target_comp != 3)) { + if (press == 1) { + scr_return_ship(obj_ground_mission.loc, obj_ground_mission, obj_ground_mission.num); + var man_size, ship_id, comp, plan, i; + i = 0; + ship_id = 0; + man_size = 0; + comp = 0; + plan = 0; + ship_id = array_get_index(obj_ini.ship, obj_ground_mission.loc); + obj_controller.menu = 0; + obj_controller.managing = 0; + obj_controller.cooldown = 10; + with (obj_ground_mission) { + instance_destroy(); + } + instance_destroy(); + exit; + } + if (press == 2) { + obj_ground_mission.alarm[6] = 1; + obj_controller.cooldown = 10; + instance_destroy(); + } + if (press == 3) { + exit; + } + } + if ((ma_id > 0) && (target_comp == 3)) { + if (press == 1) { + scr_return_ship(obj_ground_mission.loc, obj_ground_mission, obj_ground_mission.num); + var man_size, ship_id, comp, plan, i; + i = 0; + ship_id = 0; + man_size = 0; + comp = 0; + plan = 0; + ship_id = array_get_index(obj_ini.ship, obj_ground_mission.loc); + obj_controller.menu = 0; + obj_controller.managing = 0; + obj_controller.cooldown = 10; + with (obj_ground_mission) { + instance_destroy(); + } + instance_destroy(); + exit; + } + if (press == 2) { + exit; + } + if (press == 3) { + exit; + } + } + } + + if (type == 6) { + // Equipment + if (target_comp == 1) { + target_role = sel1; + } + if (target_comp == 2) { + target_role = sel2; + } + if (target_comp == 3) { + target_role = sel3; + } + if (target_comp == 4) { + target_role = sel4; + } + if (target_comp == 5) { + target_role = sel5; + } + } + + if (image == "gene_bad") { + option1 = "Dispose of "; + if (obj_controller.gene_seed <= 30) { + option1 += "100% of the gene-seed."; + } + if ((obj_controller.gene_seed > 30) && (obj_controller.gene_seed < 60)) { + option1 += "50% of all gene-seed."; + } + if (obj_controller.gene_seed >= 60) { + option1 += "33% of all gene-seed."; + } + option2 = "Tell the apothecaries to let it be."; + option3 = ""; + } + + if (((title == "Inquisition Mission") || (title == "Inquisition Recon")) && (option1 == "")) { + option1 = "Accept"; + option2 = "Refuse"; + } + if (title == "Inquisitor Located") { + option1 = "Destroy their vessel"; + option2 = "Hear them out"; + } + if (title == "Necron Tomb Excursion") { + option1 = "Begin the Mission"; + option2 = "Not Yet"; + } + if (title == "Necron Tunnels : 1") { + option1 = "Continue"; + option2 = "Return to the surface"; + } + if (title == "Necron Tunnels : 2") { + option1 = "Continue"; + option2 = "Return to the surface"; + } + if (title == "Necron Tunnels : 3") { + option1 = "Continue"; + option2 = "Return to the surface"; + } + + if ((title == "He Built It") && (option1 == "") && (string_count("submerged", text) == 0)) { + option1 = "Execute the heretic"; + option2 = "Move him to the Penitorium"; + option3 = "I see no problem"; + } + + if ((press == 1) && (option1 != "") || ((demand == 1) && (mission != "") && (string_count("Inquisition", title) > 0)) || ((demand == 1) && (title == "Inquisition Recon"))) { + if (image == "gene_bad") { + var onceh; + onceh = 0; + if ((obj_controller.gene_seed <= 30) && (onceh == 0)) { + obj_controller.gene_seed = 0; + } + if ((obj_controller.gene_seed > 30) && (obj_controller.gene_seed < 60) && (onceh == 0)) { + obj_controller.gene_seed = round(obj_controller.gene_seed * 0.5); + } + if ((obj_controller.gene_seed >= 60) && (onceh == 0)) { + obj_controller.gene_seed = round(obj_controller.gene_seed * 0.66); + } + } + if ((title == "Inquisitor Located") || (title == "Artifact Offered") || (title == "Mercy Plea")) { + with (obj_en_fleet) { + if ((trade_goods == "male_her") || (trade_goods == "female_her")) { + instance_destroy(); + } + } + if (obj_controller.demanding == 0) { + obj_controller.disposition[4] += 1; + } + if (obj_controller.demanding == 1) { + obj_controller.disposition[4] += choose(0, 0, 1); + } -if ((title="Inquisition Mission") or (title="Inquisition Recon")) and (title!="Artifact Located") and (obj_controller.demanding=1) then demand=1; + if ((title == "Artifact Offered") || (title == "Mercy Plea")) { + obj_controller.disposition[4] -= choose(0, 1); + } + title = "Inquisition Mission Completed"; + image = "exploding_ship"; + text = "The Inquisitor's ship begans to bank and turn, to flee, but is immediately fired upon by your fleet. The ship explodes, taking the Inquisitor with it. The mission has been accomplished."; + option1 = ""; + option2 = ""; + option3 = ""; + + scr_event_log("", "Inquisition Mission Completed: The radical Inquisitor has been purged."); + + exit; + } + if (title == "He Built It") { + scr_kill_unit(ma_co, ma_id); + var company_to_order = ma_co; + with (obj_ini) { + scr_company_order(company_to_order); + } + } + + if (title == "Necron Tomb Excursion") { + instance_activate_all(); + var player_forces, penalty, roll; + player_forces = 0; + penalty = 0; + roll = floor(random(100)) + 1; + with (obj_star) { + if (name != obj_popup.loc) { + instance_deactivate_object(id); + } + } + if (!instance_exists(obj_temp8)) { + instance_create(obj_star.x, obj_star.y, obj_temp8); + } + player_forces = obj_star.p_player[planet]; + instance_activate_object(obj_star); + cooldown = 30; + + obj_temp8.stage += 1; + obj_temp8.loc = loc; + obj_temp8.wid = planet; + + title = $"Necron Tunnels : {obj_temp8.stage}"; + if (obj_temp8.stage == 1) { + image = "necron_tunnels_1"; + text = "Your marines enter the massive tunnel complex, following the energy readings. At first the walls are cramped and tiny, closing about them, but the tunnels widen at a rapid pace."; + option1 = "Continue"; + option2 = "Return to the surface"; + } + exit; + } + if (string_count("Necron Tunnels", title) > 0 && instance_exists(obj_temp8)) { + var player_forces, penalty, roll, battle; + player_forces = 0; + penalty = 0; + roll = floor(random(100)) + 1; + battle = 0; + instance_activate_all(); + var mission_star = star_by_name(obj_temp8.loc); -if (image="chaos_messenger") and (title="Chaos Meeting"){ - if (mission="meeting_1") or (mission="meeting_1t"){ - if (option1=""){ - option1="Die, heretic!"; - option2="Very well. Lead the way."; - option3="I must take care of an urgent matter first. (Exit)"; - exit; - } - if (option1!=""){ - if (press=1){ - with(obj_star){ - var i=0; - repeat(planets){ - remove_planet_problem(i, "meeting"); - remove_planet_problem(i, "meeting_trap"); - } - } - obj_controller.disposition[10]-=10; - text="The heretic is killed in a most violent fashion. With a lack of go-between the meeting cannot proceed."; - option1="";option2="";option3="";mission="";// image=""; - if (obj_controller.blood_debt=1){ - obj_controller.penitent_current+=1; - obj_controller.penitent_turn=0; - obj_controller.penitent_turnly=0; - } - with(obj_temp_meeting){instance_destroy();} - cooldown=20; - exit; - } - else if (press=2) and (mission="meeting_1"){ - obj_controller.complex_event=true;obj_controller.current_eventing="chaos_meeting_1"; - text="mission_star signal your readiness to the heretic. Nearly twenty minutes of following the man passes before mission_star all enter an ordinary-looking structure. Down, within the basement, mission_star then pass into the entrance of a tunnel. As the trek downward continues more and more heretics appear- cultists, renegades that appear to be from the local garrison, and occasionally even the fallen of your kind. Overall the heretics seem well supplied and equip. This observation is interrupted as your group enters into a larger chamber, revealing a network of tunnels and what appears to be ancient catacombs. Bones of the ancient dead, the forgotten, litter the walls and floor. And the chamber seems to open up wider, and wider, until mission_star find yourself within a hall. Within this hall, waiting for mission_star, are several dozen Chaos Terminators, a Greater Daemon of Tzeentch and Slaanesh, and Chaos Lord "+string(obj_controller.faction_leader[eFACTION.Chaos])+"."; - option1="";option2="";option3="";mission="cslord1";image="";img=0;image_wid=0;size=3; - cooldown=20;exit; - } - else if (press=2) and (mission="meeting_1t"){ - with(obj_star){ - remove_star_problem("meeting"); - remove_star_problem("meeting_trap"); - } - obj_controller.complex_event=true; - obj_controller.current_eventing="chaos_trap"; - text="mission_star signal your readiness to the heretic. Nearly twenty minutes of following the man passes before mission_star all enter an ordinary-looking structure. Down, within the basement, mission_star then pass into the entrance of a tunnel. As the trek downward continues more and more heretics appear- cultists, renegades that appear to be from the local garrison, and occasionally even the fallen of your kind. Overall the heretics seem well supplied and equip. This observation is interrupted as your group enters into a larger chamber, revealing a network of tunnels and what appears to be ancient catacombs. Bones of the ancient dead, the forgotten, litter the walls and floor. And the chamber seems to open up wider, and wider, until mission_star find yourself within a hall. Within this hall, waiting for mission_star, are several dozen Chaos Terminators, a handful of Helbrute, and many more Chaos Space Marines. The Chaos Lord is nowhere to be seen. It is a trap."; - option1="";option2="";option3="";mission="cslord1t";image="";img=0;image_wid=0;size=3; - cooldown=20;exit; - } - if (press=3) and (instance_exists(obj_turn_end)){ - if (number!=0) then obj_turn_end.alarm[1]=4; - with(obj_temp_meeting){instance_destroy();} - instance_destroy(); - } - } - } -} + player_forces = obj_star.p_player[obj_temp8.wid]; + obj_temp8.popup = obj_turn_end.current_popup; -if (title="Scheduled Event"){ - if (option1=""){option1="Yes!";option2="No.";exit;} - - if (press=1) and (!instance_exists(obj_event)){ - instance_create(0,0,obj_event); - if (obj_controller.fest_planet=0) then obj_controller.fest_attend=scr_event_dudes(1,0,"",obj_controller.fest_sid); - if (obj_controller.fest_planet=1) then scr_event_dudes(1,1,obj_controller.fest_star,obj_controller.fest_wid); - hide=true;cooldown=6000;title="Scheduled Event:2"; - exit; - } - if (press=2){ - obj_controller.fest_repeats-=1; - if (obj_controller.fest_repeats<=0){ - obj_controller.fest_scheduled=0; - - instance_create(0,0,obj_event); - if (obj_controller.fest_planet=0) then obj_controller.fest_attend=scr_event_dudes(1,0,"",obj_controller.fest_sid); - if (obj_controller.fest_planet=1) then scr_event_dudes(1,1,obj_controller.fest_star,obj_controller.fest_wid); - - with(obj_event){ - var ide=0; - repeat(700){ide+=1; - if (attend_corrupted[ide]=0) and (attend_id[ide]>0){ - if (string_count("Chaos",obj_ini.artifact_tags[obj_controller.fest_display])>0){ - obj_ini.TTRPG[attend_co[ide],attend_id[ide]].corruption+=choose(1,2,3,4); - } - if (string_count("Daem",obj_ini.artifact_tags[obj_controller.fest_display])>0){ - obj_ini.TTRPG[attend_co[ide],attend_id[ide]].corruption+=choose(6,7,8,9); - } - attend_corrupted[ide]=1; - } - } - } - with(obj_event){instance_destroy();} - - var p1,p2,p3; - p1=obj_controller.fest_type;p3=""; - p2=obj_controller.fest_planet; - - if (p2>0) then p3=string(obj_controller.fest_star)+" "+scr_roman(obj_controller.fest_wid); - if (p2<=0) then p3=+" the vessel '"+string(obj_ini.ship[obj_controller.fest_sid])+"'"; - - scr_alert("green","event",string(p1)+" on "+string(p3)+" ends.",0,0); - scr_event_log("green",string(p1)+" on "+string(p3)+" ends."); - } - obj_controller.cooldown=10;if (number!=0) then obj_turn_end.alarm[1]=4;instance_destroy(); - } -} -if (title="Scheduled Event:2") then exit; - - -if (image="inquisition") and (loc="contraband"){ - demand=0; - option1="Hand over all Chaos and Daemonic Artifacts"; - option2="Over your dead body"; - var arti; - if (press=1){ - var contraband=[]; - for (var i=0;i 6) { + penalty = 10; + } + if (player_forces > 10) { + penalty = 20; + } + if (player_forces >= 20) { + penalty = 30; + } + if (player_forces >= 40) { + penalty = 50; + } + if (player_forces >= 60) { + penalty = 100; + } + roll += penalty; + + // roll=30;if (string_count("3",title)>0) then roll=70; + + // Result + if (roll <= 60) { + obj_temp8.stage += 1; + title = $"Necron Tunnels : {obj_temp8.stage}"; + + if (obj_temp8.stage == 2) { + image = "necron_tunnels_2"; + text = "The energy readings are much stronger, now that your marines are deep inside the tunnels. What was once cramped is now luxuriously large, the tunnel ceiling far overhead decorated by stalactites."; + } else if (obj_temp8.stage == 3) { + image = "necron_tunnels_3"; + text = "After several hours of descent the entrance to the Necron Tomb finally looms ahead- dancing, sickly green light shining free. Your marine confirms that the Plasma Bomb is ready."; + } else if (obj_temp8.stage >= 4) { + image = ""; + title = "Inquisition Mission Completed"; + text = "Your marines finally enter the deepest catacombs of the Necron Tomb. There they place the Plasma Bomb and arm it. All around are signs of increasing Necron activity. With half an hour set, your men escape back to the surface. There is a brief rumble as the charge goes off, your mission a success."; + option1 = ""; + option2 = ""; + option3 = ""; + + if (obj_controller.demanding == 0) { + obj_controller.disposition[4] += 1; + } + if (obj_controller.demanding == 1) { + obj_controller.disposition[4] += choose(0, 0, 1); + } + instance_activate_object(obj_star); + mission_star = star_by_name(obj_controller.temp[200]); + var ppp = 0; + remove_planet_problem(planet, "bomb", mission_star); + mission_star.p_feature[planet][search_planet_features(mission_star.p_feature[planet], P_features.Necron_Tomb)[0]].sealed = 1; + with (obj_temp8) { + instance_destroy(); + } + instance_activate_object(obj_star); + scr_event_log("", $"Inquisition Mission Completed: Your Astartes have sealed the Necron Tomb on {mission_star.name} {scr_roman(planet)}.", mission_star.name); + scr_gov_disp(mission_star.name, planet, choose(3, 4, 5, 6, 7)); + var have_bomb = scr_check_equip("Plasma Bomb", self.loc, self.planet, 1); + exit; + } + } + if ((roll > 60) && (roll <= 82)) { + // Necron Wraith attack + battle = 1; + } + if ((roll > 82) && (roll <= 92)) { + // Tomb Spyder attack + battle = 2; + } + if ((roll > 92) && (roll <= 97)) { + // Tomb Stalker + battle = 3; + } + if (roll > 97) { + // Tomb World wakes up + if (player_forces <= 30) { + battle = 4; + } + if (player_forces > 30) { + battle = 5; + } + if (player_forces > 100) { + battle = 6; + } + } -if (title="Planetary Governor Assassinated") and (option1!="") and (cooldown<=0){ - if (new_target=0) and (instance_exists(obj_temp6)){ - new_target=instance_nearest(obj_temp6.x,obj_temp6.y,obj_star); - with(obj_temp6){instance_destroy();} - } - - if (press>0){ - var randa,randa2;randa=floor(random(100))+1;randa2=floor(random(100))+1; - if (string_count("Shitty",obj_ini.strin2)>0) then randa-=20; - } - - if (press=1){ - new_target.dispo[planet]=min(obj_ini.imperium_disposition,obj_controller.disposition[2])+choose(-1,-2,-3,-4,0,1,2,3,4); - if (randa<=3) then new_target.dispo[planet]=min(new_target.dispo[planet],choose(1,2,3,4,5,6)*3); - if (randa>=95) then new_target.dispo[planet]=max(new_target.dispo[planet],60+choose(1,2,3,4,5,6)*3); - scr_event_log("","Planetary Governor of "+string(new_target.name)+" "+scr_roman(planet)+" assassinated. The next in line takes over.", new_target.name); - text="The next in line for rule of "+string(new_target.name)+" "+scr_roman(planet)+" has taken over their rightful position of Planetary Governor."; - option1="";option2="";option3=""; - with(obj_ground_mission){instance_destroy();} - cooldown=30;exit; - } - if (press=2){ - new_target.dispo[planet]=70+floor(random_range(5,15))+1; - scr_event_log("","Planetary Governor of "+string(new_target.name)+" "+scr_roman(planet)+" assassinated. A more suitable Governor is installed."); - if (randa2<=(10*estimate)){ - var v=0,ev=0; - repeat(99){v+=1;if (ev=0) and (obj_controller.event[v]="") then ev=v;} - obj_controller.event[ev]="governor_assassination_1|"+string(new_target.name)+"|"+string(planet)+"|"; - obj_controller.event_duration[ev]=((choose(1,2,3,4,5,6)+choose(1,2,3,4,5,6))*6)+choose(-3,-2,-1,0,1,2,3); - } - text="Many of the successors for "+string(new_target.name)+" "+scr_roman(planet)+" are removed or otherwise made indisposed. Your chapter ensures that the new Planetary Governor is sympathetic to your plight and more than willing to heed your advice. A powerful new ally may be in the making."; - option1="";option2="";option3=""; - with(obj_ground_mission){instance_destroy();} - cooldown=30;exit; - } - if (press=3){ - new_target.dispo[planet]=101; - scr_event_log("","Planetary Governor of "+string(new_target.name)+" "+scr_roman(planet)+" assassinated. One of your Chapter Serfs take their position."); - if (randa2<=(25*estimate)){ - var v=0,ev=0; - repeat(99){v+=1;if (ev=0) and (obj_controller.event[v]="") then ev=v;} - obj_controller.event[ev]="governor_assassination_2|"+string(new_target.name)+"|"+string(planet)+"|"; - obj_controller.event_duration[ev]=(choose(1,2)*6)+choose(-3,-2,-1,0,1,2,3); - } - text=$"All of the successors for {planet_numeral_name(planet,new_target)} are removed or otherwise made indisposed. Paperwork is slightly altered. Rather than any sort of offical one of your Chapter Serfs is installed as the Planetary Governor. The planet is effectively under your control."; - if (new_target.p_first[planet]!=3) then new_target.p_owner[planet]=1; - option1="";option2="";option3=""; - with(obj_ground_mission){instance_destroy();} - cooldown=30;exit; - } -} -/* -var he;he=instance_create(argument0.x,argument0.y,obj_temp6); -var pip;pip=instance_create(0,0,obj_popup); -pip.title="Planetary Governor Assassinated"; -pip.text=txt; - -pip.option1="Allow the official successor to become Planetary Governor."; -pip.option2="Ensure that a sympathetic successor will be the one to rule."; -pip.option3="Remove all successors and install a loyal Chapter Serf."; - -// Result- this is the multiplier for the chance of discovery with the inquisition, can also be used to determine -// the new Governor disposition if they are the official successor -if (aroll<=chance){// Discovered - pip.estimate=2; -} -if (aroll>chance){// Success - pip.estimate=1; -} -*/ - - - -if (image="ruins_fort"){ - if (press=1) and (obj_controller.requisition>=1000){ - obj_controller.requisition-=1000; - text="Resources have been spent on the planet to restore the fortress. The planet's defense rating has increased to 5 ("; - option1=""; - option2=""; - option3=""; - text+=string(star_system.p_fortified[planet])+"+"; - text+=string(5-star_system.p_fortified[planet])+")"; - star_system.p_fortified[planet]=max(star_system.p_fortified[planet],5); - cooldown=15; - exit; - } - if (press=2){ - var req=floor(random_range(200,500))+1; - image=""; - text="Much of the fortress is demolished in order to salvage adamantium and raw materials. The opration has yielded "+string(req)+" requisition."; - option1=""; - option2=""; - option3=""; - obj_controller.requisition+=req; - cooldown=15; - exit; - } - - /* - if (loot="fortress"){// Fortress - var gene,pop;gene=floor(random_range(20,40))+1;pop=instance_create(0,0,obj_popup); - pop.image="ruins_fort";pop.title="Ancient Ruins: Fortress"; - pop.text="Your battle brothers have found a massive, ancient fortress that has fallen into disrepair. Gun batteries rusted, and walls covered in moss and undergrowth, it is a pale shadow of its former glory. It is possible to repair the structure. What is thy will?"; - pop.option1="Repair the fortress to boost planet defenses. (1000 Req)"; - pop.option2="Salvage raw materials from the fortress."; - } - */ -} + if (battle > 0) { + var that_one; + instance_deactivate_all(true); + instance_activate_object(obj_controller); + instance_activate_object(obj_ini); + instance_activate_object(obj_temp8); -if (image="mechanicus") and (title="Mechanicus Mission") or (title="Mechanicus Mission Accepted"){ - if (option1="")and (title="Mechanicus Mission"){ - option1="Accept"; - option2="Refuse"; - } - - else if (press=1) and (option1!=""){ - - if (string_count("tomb",mission)>0){ - with(obj_temp5){instance_destroy();} - with(obj_star){if (name=obj_popup.loc) then instance_create(x,y,obj_temp5);} - if (instance_exists(obj_temp5)){ - var tempy,eh,eh2,that,that2;tempy=instance_nearest(obj_temp5.x,obj_temp5.y,obj_star);eh=0;that=0;eh2=0;that2=0; - repeat(4){ - eh+=1; - var tomb_list = search_planet_features(tempy.p_feature[eh], P_features.Necron_Tomb); - if (tempy.p_owner[eh]<=5) and (array_length(tomb_list)>0){ - for (var tomb = 0;tomb0){ - if (find_problem_planet(that, "", tempy)>0){ - add_new_problem(that, "mech_tomb1",17, tempy); - text="The Adeptus Mechanicus await your forces at "+string(tempy.name)+" "+scr_roman(that)+". They are expecting at least two squads of Astartes and have placed the testing on hold until their arrival. mission_star have 16 months to arrive."; - scr_event_log("","Mechanicus Mission Accepted: At least two squads of marines are expected at "+string(tempy.name)+" "+scr_roman(that)+" within 16 months.", tempy.name); - new_star_event_marker("green"); - title="Mechanicus Mission Accepted"; - option1="";option2="";cooldown=15;exit; - } - } - } - } - - - if (string_count("raider",mission)>0) or (string_count("bionics",mission)>0) or (string_count("mech_mars",mission)>0){ - - var mission_star = star_by_name(obj_popup.loc); - if (instance_exists(mission_star)){ - var forge_planet = scr_get_planet_with_type(mission_star, "Forge"); - if (mission_star.p_owner[eh]=3 && forge_planet){ - mission_loc=planet_numeral_name(forge_planet,mission_star); - if (string_count("raider",mission)){ - add_new_problem(forge_planet, "mech_raider", 49, mission_star, {"completion":0}); - text=$"The Adeptus Mechanicus await your forces at {mission_loc}. They are expecting six {obj_ini.role[100][16]}s and a Land Raider."; - scr_event_log("",$"Mechanicus Mission Accepted: Six of your {obj_ini.role[100][16]}s and a Land Raider are to be stationed at {mission_loc} for 24 months.", mission_star.name); - } else if (string_count("bionics",mission)){ - add_new_problem(forge_planet, "mech_bionics", 49, mission_star, {"completion":0}); - text=$"The Adeptus Mechanicus await your forces at {mission_loc}. They are expecting ten Astartes with bionics."; - scr_event_log("",$"Mechanicus Mission Accepted: Ten Astartes with bionics are to be stationed at {mission_loc} for 24 months for testing purposes.", mission_star.name); - } else if (string_count("mars",mission)){ - add_new_problem(forge_planet, "mech_mars", 13, mission_star); - text=$"The Adeptus Mechanicus await your {obj_ini.role[100][16]}s at {mission_loc}. They are willing to hold on the voyage for up to 12 months."; - scr_event_log("",$"Mechanicus Mission Accepted: {obj_ini.role[100][16]}s are expected at {mission_loc} within 12 months, for the voyage to Mars.", tempy.name); - } - with (mission_star){ - new_star_event_marker("green") - } - cooldown=15; - title="Mechanicus Mission Accepted"; - option1=""; - option2=""; - option3=""; - exit; - } - } - } - // Other missions here - } - else if (press=2) and (option2!=""){ - obj_controller.cooldown=10; - if (number!=0) then obj_turn_end.alarm[1]=4; - instance_destroy(); - } -} - -if (image="geneseed_lab"){ - if (press=1){ - image="";text=string(estimate)+" gene-seed has been added to the chapter vaults."; - option1=""; - option2=""; - option3=""; - obj_controller.gene_seed+=estimate; - with(obj_ground_mission){instance_destroy();} - cooldown=15;exit; - } - if (press=2){ - var req;req=floor(random_range(200,500))+1; - image=""; - text="Technological components have been salvaged, granting "+string(req)+" requisition."; - option1=""; - option2=""; - option3=""; - obj_controller.requisition+=req; - with(obj_ground_mission){ - instance_destroy(); - } - cooldown=15; - exit; - } - if (press=3){ - with(obj_ground_mission){instance_destroy();} - obj_controller.cooldown=15; - cooldown=15; - instance_destroy(); - exit; - } -} + that_one = instance_nearest(0, 0, obj_star); + instance_activate_object(obj_star); + + obj_ncombat.battle_object = that_one; + instance_deactivate_object(obj_star); + obj_ncombat.battle_loc = loc; + obj_ncombat.battle_id = planet; + obj_ncombat.dropping = 0; + obj_ncombat.attacking = 0; + obj_ncombat.enemy = 13; + obj_ncombat.threat = 1; + obj_ncombat.formation_set = 1; + + if (battle == 1) { + obj_ncombat.battle_special = "wraith_attack"; + } else if (battle == 2) { + obj_ncombat.battle_special = "spyder_attack"; + } else if (battle == 3) { + obj_ncombat.battle_special = "stalker_attack"; + } else if (battle == 4) { + obj_ncombat.battle_special = "wake1_attack"; + } else if (battle == 5) { + obj_ncombat.battle_special = "wake2_attack"; + } else if (battle == 6) { + obj_ncombat.battle_special = "wake2_attack"; + } + instance_destroy(); + } -if (image="ancient_ruins" && woopwoopwoop && move_to_next_stage()) { - instance_deactivate_all(true); - instance_activate_object(obj_ground_mission); - instance_activate_object(obj_popup); - var _explore_feature = obj_ground_mission.explore_feature; - _explore_feature.suprise_attack(); - woopwoopwoop=0; - show_debug_message("ruins combat"); - instance_destroy(self.id); - instance_destroy(); - exit; -}else if (image="ancient_ruins" && option1!="" && instance_exists(obj_ground_mission)){ - if (press=1){// Begin - var _ruins = obj_ground_mission.explore_feature; - var ruins_battle=0,ruins_fact=0,ruins_disp=0,ruins_reward=0,dice,battle_threat=0; - - _ruins.determine_race() - - dice=floor(random(100))+1; - var shit_luck = array_contains(obj_ini.dis,"Shitty Luck") - var pass_mark = shit_luck ? 66 : 50; - ruins_battle = dice<=pass_mark; - - // ruins_battle=1; - - if (ruins_battle=1){ - dice=floor(random(100))+1; - if (shit_luck) then dice+=10; - - battle_threat=4; - if (dice>0) and (dice<=60) then battle_threat=1; - if (dice>60) and (dice<=90) then battle_threat=2; - if (dice>90) and (dice<=99) then battle_threat=3; - - if (_ruins.ruins_race==1) or (_ruins.ruins_race=2) or (_ruins.ruins_race=10) then ruins_battle=choose(10,10,10,10,11,11,12); - if (_ruins.ruins_race==5) then ruins_battle=10; - if (_ruins.ruins_race==6) then ruins_battle=choose(6,6,10,10,10,12); - if (ruins_battle==1) then ruins_battle = choose(6,10, 12); - obj_ground_mission.ruins_race=_ruins.ruins_race; - obj_ground_mission.ruins_battle=ruins_battle; - obj_ground_mission.battle_threat=battle_threat; - - option1=""; - option2=""; - option3=""; - text="Your marines descended into the ancient ruins, mapping them out as they go. They quickly determine the ruins were once "; - if (_ruins.ruins_race=1) then text+="a Space Marine fortification from earlier times."; - if (_ruins.ruins_race=2) then text+="golden-age Imperial ruins, lost to time."; - if (_ruins.ruins_race=5) then text+="a magnificent temple of the Imperial Cult."; - if (_ruins.ruins_race=6) then text+="Eldar colonization structures from an unknown time."; - if (_ruins.ruins_race=10) then text+="golden-age Imperial ruins, since decorated with spikes and bones."; - if (_ruins.failed_exploration == 1){ - text+= "mission_star see the scarring in the walls and round impacts where your brothers died to clense this place of it's foul inhabitants"; - } - text+=" Unfortunantly, it's too late before your Battle Brothers discern the ruins are still inhabited. Shapes begin to descend upon them from all directions, masked in the shadows."; - - cooldown=15; - woopwoopwoop=1; - exit; - } - if (ruins_battle=0){ - var obj=obj_ground_mission.obj; - instance_activate_object(obj_star); - scr_ruins_reward(star_by_name(obj_ground_mission.battle_loc),obj_ground_mission.num,obj_ground_mission.explore_feature); - instance_destroy(); - exit; - } - } - if (press=2){// Nothing - obj_controller.cooldown=10; - obj_controller.menu=1; - // obj_controller.managing=manag; - with(obj_controller){ - var i;i=-1;man_size=0;selecting_location="";selecting_types="";selecting_ship=0;sel_uid=0; - reset_manage_arrays(); - alll=0; - update_general_manage_view(); - } - with(obj_ground_mission){ - instance_destroy(); - } - instance_destroy(); - exit; - } - if (press=3){// Return to ship, exit - scr_return_ship(obj_ground_mission.loc,obj_ground_mission,obj_ground_mission.num); - var man_size,ship_id,comp,plan,i; - i=0;ship_id=0;man_size=0;comp=0;plan=0; - repeat(30){ - i+=1; - if (obj_ini.ship[i]=obj_ground_mission.loc) then ship_id=i; - }i=0; - obj_controller.menu=0;obj_controller.managing=0; - obj_controller.cooldown=10; - with(obj_ground_mission){instance_destroy();} - instance_destroy();exit; - } -} + exit; + } + + if (title == "Inquisition Recon") { + var mission_star, onceh; + onceh = 0; + obj_controller.temp[200] = string(loc); + var mission_star = star_by_name(obj_controller.temp[200]); + if (add_new_problem(planet, "recon", estimate, mission_star)) { + title = "Inquisition Mission Demand"; + text = $"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. mission_star are to land Astartes on {mission_star.name} {scr_roman(planet)} to investigate the planet within {estimate} months."; + with (mission_star) { + new_star_event_marker("green"); + } + scr_event_log("", $"Inquisition Mission Accepted: The Inquisition wish for Astartes to land on and investigate {mission_star.name} {scr_roman(planet)} within {estimate} months.", mission_star.name); + } + } else if ((mission != "") && (title == "Inquisition Mission")) { + obj_controller.temp[200] = string(loc); + var mission_star, onceh; + mission_star = 0; + onceh = 0; + var mission_star = star_by_name(obj_controller.temp[200]); + var mission_is_go = false; + if (mission_star != "none") { + var _estimate = estimate; + var _planet = planet; + var _mission = mission; + with (mission_star) { + if (add_new_problem(_planet, _mission, _estimate)) { + new_star_event_marker("green"); + mission_is_go = true; + } + } + if (mission_is_go) { + if (demand) { + title = "Inquisition Mission Demand"; + } + if (mission == "purge") { + scr_event_log("", $"Inquisition Mission Accepted: The nobles of {mission_star.name} {scr_roman(planet)} must be selectively purged within {estimate} months.", mission_star.name); + if (demand) { + text = $"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. mission_star are to selectively purge the Nobles on {mission_star.name} {scr_roman(onceh)} within {estimate} months."; + } + } else if (mission == "cleanse") { + scr_event_log("", $"Inquisition Mission Accepted: The mutants beneath {planet_numeral_name(planet, mission_star)} must be cleansed by fire within {estimate} months.", mission_star.name); + if (demand) { + text = $"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. mission_star are to cleanse by fire the mutants in Hive {planet_numeral_name(planet, mission_star)} within {estimate} months."; + } + } else if (mission == "inquisitor") { + scr_event_log("", $"Inquisition Mission Accepted: A radical Inquisitor enroute to {mission_star.name} must be removed. Estimated arrival in {estimate} months.", mission_star.name); + if (demand) { + text = $"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. A radical inquisitor is enroute to {mission_star.name}, expected within {estimate} months. They are to be silenced and removed."; + } + } + if (mission == "spyrer") { + scr_event_log("", $"Inquisition Mission Accepted: The Spyrer on {mission_star.name} {scr_roman(planet)} must be killed within {estimate} months.", mission_star.name); + if (demand) { + text = $"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. An out of control Spyrer on Hive {mission_star.name} {scr_roman(onceh)} must be removed within {estimate} months."; + } + } else if (mission == "necron") { + scr_event_log("", $"Inquisition Mission Accepted: mission_star have been given a Bomb to seal the Necron Tomb on {mission_star.name} {scr_roman(planet)}.", mission_star.name); -if (image="stc"){ - if (ma_co>0) and (ma_id=0){ - if (press=1){ - obj_ground_mission.alarm[5]=1; - obj_controller.cooldown=10; - instance_destroy(); - } - if (press=2){ - scr_return_ship(obj_ground_mission.loc,obj_ground_mission,obj_ground_mission.num); - var man_size,ship_id,comp,plan,i; - i=0;ship_id=0;man_size=0;comp=0;plan=0; - repeat(30){ - i+=1; - if (obj_ini.ship[i]=obj_ground_mission.loc) then ship_id=i; - } - i=0; - obj_controller.menu=0;obj_controller.managing=0; - obj_controller.cooldown=10; - with(obj_ground_mission){instance_destroy();} - instance_destroy();exit; - } - if (press=3) then exit; - } - else if (ma_co>0) and (ma_id>0){ - if (press=1){ - obj_ground_mission.alarm[5]=1; - obj_controller.cooldown=10; - instance_destroy(); - } - if (press=2){ - scr_return_ship(obj_ground_mission.loc,obj_ground_mission,obj_ground_mission.num); - var man_size,ship_id,comp,plan,i; - i=0;ship_id=0;man_size=0;comp=0;plan=0; - repeat(30){i+=1;if (obj_ini.ship[i]=obj_ground_mission.loc) then ship_id=i;}i=0; - obj_controller.menu=0;obj_controller.managing=0; - obj_controller.cooldown=10; - with(obj_ground_mission){instance_destroy();} - instance_destroy();exit; - } - if (press=3){ - obj_ground_mission.alarm[6]=1; - obj_controller.cooldown=10; - instance_destroy(); - } - } - else if (ma_co=0) and (ma_id>0) and (target_comp!=3){ - if (press=1){ - scr_return_ship(obj_ground_mission.loc,obj_ground_mission,obj_ground_mission.num); - var man_size,ship_id,comp,plan,i; - i=0;ship_id=0;man_size=0;comp=0;plan=0; - repeat(30){i+=1;if (obj_ini.ship[i]=obj_ground_mission.loc) then ship_id=i;}i=0; - obj_controller.menu=0;obj_controller.managing=0; - obj_controller.cooldown=10; - with(obj_ground_mission){instance_destroy();} - instance_destroy();exit; - } - if (press=2){ - obj_ground_mission.alarm[6]=1; - obj_controller.cooldown=10; - instance_destroy(); - } - if (press=3) then exit; - } - if (ma_id>0) and (target_comp=3){ - if (press=1){ - scr_return_ship(obj_ground_mission.loc,obj_ground_mission,obj_ground_mission.num); - var man_size,ship_id,comp,plan,i; - i=0;ship_id=0;man_size=0;comp=0;plan=0; - repeat(30){i+=1;if (obj_ini.ship[i]=obj_ground_mission.loc) then ship_id=i;}i=0; - obj_controller.menu=0;obj_controller.managing=0; - obj_controller.cooldown=10; - with(obj_ground_mission){instance_destroy();} - instance_destroy();exit; - } - if (press=2) then exit; - if (press=3) then exit; - } -} + image = "necron_cave"; + title = "New Equipment"; + fancy_title = 0; + text_center = 0; + text = "mission_star have been provided with 1x Plasma Bomb in order to complete the mission."; + if (demand) { + text = $"The Inquisition demands that your Chapter demonstrate its loyalty. mission_star have been given a Plasma Bomb to seal the Necron Tomb on {mission_star.name} {scr_roman(onceh)}. It is expected to be completed within {estimate} months."; + } + option1 = ""; + option2 = ""; + option3 = ""; + scr_add_item("Plasma Bomb", 1); + obj_controller.cooldown = 10; + if (demand) { + demand = 0; + } + exit; + } else if (mission == "tyranid_org") { + image = "webber"; + title = "New Equipment"; + fancy_title = 0; + text_center = 0; + text = "mission_star have been provided with 4x Astartes Webbers in order to complete the mission."; + + if (demand) { + text = "The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. mission_star are to capture a Gaunt organism and return it, unharmed- 4x Webbers have been provided for this purpose."; + } + option1 = ""; + option2 = ""; + option3 = ""; + scr_add_item("Webber", 4); + obj_controller.cooldown = 10; + scr_event_log("", $"Inquisition Mission Accepted: The Inquisition wishes for the capture of a particular strain Gaunt noticed on {mission_star.name} {scr_roman(planet)} is advisable.", mission_star.name); + obj_controller.useful_info += "Tyr|"; + if (demand) { + demand = 0; + } + exit; + } else if (mission == "ethereal") { + with (obj_star) { + if ((p_tau[1] >= 4) || (p_tau[2] >= 4) || (p_tau[3] >= 4) || (p_tau[4] >= 4)) { + new_star_event_marker("green"); + } + } + scr_quest(0, "ethereal_capture", 4, estimate); + obj_controller.useful_info += "Tau|"; + if (demand) { + title = "Inquisition Mission Demand"; + text = $"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. mission_star are to capture the Tau Ethereal somewhere within the {mission_star.name} system."; + } + if (mission_star.p_problem[planet, 1] == "recon") { + scr_event_log("", $"Inquisition Mission Accepted: The Inquisition wish for mission_star to capture the Tau Ethereal somewhere within {mission_star.name}.", mission_star.name); + } + } + } + } + if (!mission_is_go) { + if (mission == "artifact") { + var last_artifact; + scr_quest(0, "artifact_loan", 4, estimate); + if (obj_ini.fleet_type == ePlayerBase.home_world) { + image = "fortress"; + if (obj_ini.home_type == "Hive") { + image = "fortress_hive"; + } + if (obj_ini.home_type == "Death") { + image = "fortress_death"; + } + if (obj_ini.home_type == "Ice") { + image = "fortress_ice"; + } + if (obj_ini.home_type == "Lava") { + image = "fortress_lava"; + } + if (obj_ini.icon_name == "dorf1") { + image = "fortress_dorf"; + } + if (obj_ini.icon_name == "dorf2") { + image = "fortress_dorf"; + } + if (obj_ini.icon_name == "dorf3") { + image = "fortress_dorf"; + } + last_artifact = scr_add_artifact("good", "inquisition", 0, obj_ini.home_name, 2); + } else if (obj_ini.fleet_type != ePlayerBase.home_world) { + image = "artifact_given"; + last_artifact = scr_add_artifact("good", "inquisition", 0, obj_ini.ship[0], 501); + } -if (type=6){// Equipment - if (target_comp=1) then target_role=sel1; - if (target_comp=2) then target_role=sel2; - if (target_comp=3) then target_role=sel3; - if (target_comp=4) then target_role=sel4; - if (target_comp=5) then target_role=sel5; -} + title = "New Artifact"; + fancy_title = 0; + text_center = 0; + text = "The Inquisition has left an Artifact in your care, until it may be retrieved. It has been stored "; + if (obj_ini.fleet_type == ePlayerBase.home_world) { + text += "within your Fortress Monastery."; + } + if (obj_ini.fleet_type != ePlayerBase.home_world) { + text += $"upon your ship '{obj_ini.ship[0]}'."; + } + scr_event_log("", "Inquisition Mission Accepted: The Inquisition has left an Artifact in your care."); + + text += $" It is some form of {obj_ini.artifact[last_artifact]}."; + option1 = ""; + option2 = ""; + option3 = ""; + obj_controller.cooldown = 10; + exit; + } + } -if (image="gene_bad"){ - option1="Dispose of "; - if (obj_controller.gene_seed<=30) then option1+="100% of the gene-seed."; - if (obj_controller.gene_seed>30) and (obj_controller.gene_seed<60) then option1+="50% of all gene-seed."; - if (obj_controller.gene_seed>=60) then option1+="33% of all gene-seed."; - option2="Tell the apothecaries to let it be.";option3=""; -} + if (demand) { + demand = 0; + option1 = ""; + option2 = ""; + option3 = ""; + exit; + } // Remove multi-choices + } + + if ((image == "inquisition") && (title == "Investigation Completed")) { + obj_temp7.alarm[1] = 1; + instance_destroy(); + } + + if (image == "artifact") { + if (target_comp == 2) { + obj_ground_mission.alarm[3] = 1; + } + if ((target_comp > 2) && (target_comp != 7) && (target_comp < 9)) { + obj_controller.menu = 20; + obj_controller.cooldown = 10; + obj_controller.diplomacy = target_comp; + obj_controller.trading_artifact = 1; + with (obj_controller) { + scr_dialogue("artifact"); + } + instance_destroy(); + } + if ((target_comp == 7) || (target_comp >= 9)) { + obj_ground_mission.alarm[4] = 1; + obj_controller.cooldown = 10; + instance_destroy(); + } + } + + if (image == "artifact2") { + obj_ground_mission.alarm[4] = 1; + obj_controller.cooldown = 10; + instance_destroy(); + } + + obj_controller.cooldown = 10; + if (obj_controller.complex_event == false) { + if (number != 0) { + obj_turn_end.alarm[1] = 4; + } + instance_destroy(); + } + } + + if ((press == 2) && (option2 != "")) { + if (image == "gene_bad") { + scr_loyalty("Mutant Gene-Seed", "+"); + } + + if (mission == "spyrer") { + obj_controller.disposition[4] -= 2; + } + if (title == "Inquisition Recon") { + obj_controller.disposition[4] -= 2; + } + if ((image == "inquisition") && (title == "Investigation Completed")) { + with (obj_temp7) { + instance_destroy(); + } + instance_destroy(); + } -if ((title="Inquisition Mission") or (title="Inquisition Recon")) and (option1=""){option1="Accept";option2="Refuse";} -if (title="Inquisitor Located"){option1="Destroy their vessel";option2="Hear them out";} -if (title="Necron Tomb Excursion"){option1="Begin the Mission";option2="Not Yet";} -if (title="Necron Tunnels : 1"){option1="Continue";option2="Return to the surface";} -if (title="Necron Tunnels : 2"){option1="Continue";option2="Return to the surface";} -if (title="Necron Tunnels : 3"){option1="Continue";option2="Return to the surface";} - -if (title="He Built It") and (option1="") and (string_count("submerged",text)=0){ - option1="Execute the heretic"; - option2="Move him to the Penitorium"; - option3="I see no problem"; -} + if (title == "Artifact Offered") { + with (obj_en_fleet) { + if ((trade_goods == "male_her") || (trade_goods == "female_her")) { + instance_destroy(); + } + } + if (obj_ini.fleet_type != ePlayerBase.home_world) { + scr_add_artifact("random", "", 4, obj_ini.ship[0], 501); + } + if (obj_ini.fleet_type == ePlayerBase.home_world) { + scr_add_artifact("random", "", 4, obj_ini.home_name, 2); + } + var i, last_artifact; + i = 0; + last_artifact = 0; + repeat (100) { + if (last_artifact == 0) { + i += 1; + if (obj_ini.artifact[i] == "") { + last_artifact = i - 1; + } + } + } + option1 = ""; + option2 = ""; + option3 = ""; + title = "Inquisition Mission Completed"; + text = "Your ship sends over a boarding party, who retrieve the offered artifact- "; + text += " some form of " + string(obj_ini.artifact[last_artifact]) + ". Once it is safely stowed away your ship is then ordered to fire. The Inquisitor's own seems to hesitate an instant before banking away, but is quickly destroyed."; + image = "exploding_ship"; + option1 = ""; + option2 = ""; + option3 = ""; + scr_event_log("", "Artifact recovered from radical Inquisitor."); + scr_event_log("", "Inquisition Mission Completed: The radical Inquisitor has been purged."); + exit; + } + + if (title == "He Built It") { + obj_ini.god[ma_co, ma_id] += 10; + option1 = ""; + option2 = ""; + option3 = ""; + } + + if (title == "Mercy Plea") { + // If have any marines within the fleet on the ships + + var able, i; + able = 0; + i = 0; + + // Several things can happen when the ship is searched; + // Full of demons, maybe remove a marine, fired upon and explodes + + exit; + } + + if (title == "Inquisitor Located") { + var offer, gender, gender2; + offer = choose(1, 1, 2, 2, 3); + if (planet == 1) { + gender = "he"; + } + if (planet == 2) { + gender = "she"; + } + if (planet == 1) { + gender2 = "his"; + } + if (planet == 2) { + gender2 = "her"; + } + if (offer == 1) { + title = "Artifact Offered"; + text = "The Inquisitor claims that this is a massive misunderstanding, and " + string(gender) + " wishes to prove " + string(gender2) + " innocence. If mission_star allow their ship to leave " + string(gender) + " will give mission_star an artifact."; + option1 = "Destroy their vessel"; + option2 = "Take the artifact and then destroy them"; + option3 = "Take the artifact and spare them"; + exit; + } + if (offer == 2) { + title = "Mercy Plea"; + text = "The Inquisitor claims that " + string(gender) + " has key knowledge that would grant the Imperium vital power over the forces of Chaos. If mission_star allow " + string(gender2) + " ship to leave the forces of Chaos within this sector will be weakened."; + option1 = "Destroy their vessel"; + option2 = "Search their ship"; + option3 = "Spare them"; + exit; + } + if (offer == 3) { + var gender2; + if (planet == 1) { + gender2 = "his"; + } + if (planet == 2) { + gender2 = "her"; + } + with (obj_en_fleet) { + if ((trade_goods == "male_her") || (trade_goods == "female_her")) { + with (obj_p_fleet) { + if (action != "") { + instance_deactivate_object(id); + } + } + with (instance_nearest(x, y, obj_p_fleet)) { + scr_add_corruption(true, "1d3"); + } + instance_activate_object(obj_p_fleet); + instance_destroy(); + } + } + title = "Inquisition Mission Completed"; + image = "exploding_ship"; + text = "mission_star allow communications. As soon as the vox turns on mission_star hear a sickly, hateful voice. They begin to speak of the inevitable death of your marines, the fall of all that is and ever shall be, and " + string(gender2) + " Lord of Decay. Their ship is fired upon and destroyed without hesitation."; + option1 = ""; + option2 = ""; + option3 = ""; + scr_event_log("", "Inquisition Mission Completed: The radical Inquisitor has been purged."); + exit; + } + exit; + } + + if (image == "artifact") { + if ((target_comp != 7) && (target_comp < 9)) { + obj_ground_mission.alarm[4] = 1; + obj_controller.cooldown = 10; + instance_destroy(); + } + if ((target_comp >= 9) || (target_comp == 7)) { + // NOPE + scr_return_ship(obj_ground_mission.loc, obj_ground_mission, obj_ground_mission.num); + var man_size, ship_id, comp, plan, i; + i = 0; + ship_id = 0; + man_size = 0; + comp = 0; + plan = 0; + ship_id = array_get_index(obj_ini.ship, obj_ground_mission.loc); + obj_controller.menu = 0; + obj_controller.managing = 0; + obj_controller.cooldown = 10; + with (obj_ground_mission) { + instance_destroy(); + } + instance_destroy(); + exit; + } + } + + if (image == "artifact2") { + scr_return_ship(obj_ground_mission.loc, obj_ground_mission, obj_ground_mission.num); + var man_size, ship_id, comp, plan, i; + i = 0; + ship_id = 0; + man_size = 0; + comp = 0; + plan = 0; + ship_id = array_get_index(obj_ini.ship, obj_ground_mission.loc); + obj_controller.menu = 0; + obj_controller.managing = 0; + obj_controller.cooldown = 10; + with (obj_ground_mission) { + instance_destroy(); + } + instance_destroy(); + exit; + } -if (press=1) and (option1!="") or ((demand=1) and (mission!="") and (string_count("Inquisition",title)>0)) or ((demand=1) and (title="Inquisition Recon")){ - if (image="gene_bad"){ - var onceh;onceh=0; - if (obj_controller.gene_seed<=30) and (onceh=0){obj_controller.gene_seed=0;} - if (obj_controller.gene_seed>30) and (obj_controller.gene_seed<60) and (onceh=0){obj_controller.gene_seed=round(obj_controller.gene_seed*0.5);} - if (obj_controller.gene_seed>=60) and (onceh=0){obj_controller.gene_seed=round(obj_controller.gene_seed*0.66);} - } - if (title="Inquisitor Located") or (title="Artifact Offered") or (title="Mercy Plea"){ - with(obj_en_fleet){if (trade_goods="male_her") or (trade_goods="female_her") then instance_destroy();} - - if (obj_controller.demanding=0) then obj_controller.disposition[4]+=1; - if (obj_controller.demanding=1) then obj_controller.disposition[4]+=choose(0,0,1); - - if (title="Artifact Offered") or (title="Mercy Plea") then obj_controller.disposition[4]-=choose(0,1); - - title="Inquisition Mission Completed";image="exploding_ship"; - text="The Inquisitor's ship begans to bank and turn, to flee, but is immediately fired upon by your fleet. The ship explodes, taking the Inquisitor with it. The mission has been accomplished."; - option1="";option2="";option3=""; - - scr_event_log("","Inquisition Mission Completed: The radical Inquisitor has been purged."); - - exit; - } - if (title="He Built It"){ - scr_kill_unit(ma_co,ma_id); - var company_to_order = ma_co; - with(obj_ini){scr_company_order(company_to_order);}; - } - - if (title="Necron Tomb Excursion"){ - instance_activate_all(); - var player_forces,penalty,roll;player_forces=0;penalty=0;roll=floor(random(100))+1; - with(obj_star){if (name!=obj_popup.loc) then instance_deactivate_object(id);} - if (!instance_exists(obj_temp8)) then instance_create(obj_star.x,obj_star.y,obj_temp8); - player_forces=obj_star.p_player[planet]; - instance_activate_object(obj_star);cooldown=30; - - obj_temp8.stage+=1; - obj_temp8.loc=loc; - obj_temp8.wid=planet; - - title = $"Necron Tunnels : {obj_temp8.stage}"; - if (obj_temp8.stage=1){ - image="necron_tunnels_1"; - text="Your marines enter the massive tunnel complex, following the energy readings. At first the walls are cramped and tiny, closing about them, but the tunnels widen at a rapid pace."; - option1="Continue"; - option2="Return to the surface"; - } - exit; - } - - if (string_count("Necron Tunnels",title)>0 && instance_exists(obj_temp8)){ - var player_forces,penalty,roll,battle;player_forces=0;penalty=0;roll=floor(random(100))+1;battle=0; - instance_activate_all(); - var mission_star = star_by_name(obj_temp8.loc); - - player_forces=obj_star.p_player[obj_temp8.wid]; - - obj_temp8.popup=obj_turn_end.current_popup; - - // SMALL TEAM OF MARINES - if (player_forces>6) then penalty=10; - if (player_forces>10) then penalty=20; - if (player_forces>=20) then penalty=30; - if (player_forces>=40) then penalty=50; - if (player_forces>=60) then penalty=100; - roll+=penalty; - - // roll=30;if (string_count("3",title)>0) then roll=70; - - // Result - if (roll<=60){ - obj_temp8.stage+=1; - title= $"Necron Tunnels : {obj_temp8.stage}"; - - if (obj_temp8.stage=2){ - image="necron_tunnels_2"; - text="The energy readings are much stronger, now that your marines are deep inside the tunnels. What was once cramped is now luxuriously large, the tunnel ceiling far overhead decorated by stalactites."; - }else if (obj_temp8.stage=3){ - image="necron_tunnels_3"; - text="After several hours of descent the entrance to the Necron Tomb finally looms ahead- dancing, sickly green light shining free. Your marine confirms that the Plasma Bomb is ready."; - }else if (obj_temp8.stage>=4){ - image=""; - title="Inquisition Mission Completed"; - text="Your marines finally enter the deepest catacombs of the Necron Tomb. There they place the Plasma Bomb and arm it. All around are signs of increasing Necron activity. With half an hour set, your men escape back to the surface. There is a brief rumble as the charge goes off, your mission a success."; - option1=""; - option2=""; - option3=""; - - if (obj_controller.demanding=0) then obj_controller.disposition[4]+=1; - if (obj_controller.demanding=1) then obj_controller.disposition[4]+=choose(0,0,1); + obj_controller.cooldown = 10; - instance_activate_object(obj_star); - mission_star = star_by_name(obj_controller.temp[200]); - - var ppp=0; - remove_planet_problem(planet, "bomb", mission_star); - mission_star.p_feature[planet][search_planet_features(mission_star.p_feature[planet], P_features.Necron_Tomb)[0]].sealed = 1; - with(obj_temp8){instance_destroy();} - instance_activate_object(obj_star); - - scr_event_log("",$"Inquisition Mission Completed: Your Astartes have sealed the Necron Tomb on {mission_star.name} {scr_roman(planet)}.", mission_star.name); - scr_gov_disp(mission_star.name,planet,choose(3,4,5,6,7)); - var have_bomb=scr_check_equip("Plasma Bomb",self.loc,self.planet,1); - exit; - } - } - if (roll>60) and (roll<=82){// Necron Wraith attack - battle=1; - } - if (roll>82) and (roll<=92){// Tomb Spyder attack - battle=2; - } - if (roll>92) and (roll<=97){// Tomb Stalker - battle=3; - } - if (roll>97){// Tomb World wakes up - if (player_forces<=30) then battle=4; - if (player_forces>30) then battle=5; - if (player_forces>100) then battle=6; - } - - if (battle>0){ - var that_one; - instance_deactivate_all(true); - instance_activate_object(obj_controller); - instance_activate_object(obj_ini); - instance_activate_object(obj_temp8); - - instance_create(0,0,obj_ncombat); - scr_battle_roster(obj_temp8.loc,obj_temp8.wid,true); - - instance_activate_object(obj_star); - with(obj_star){if (name!=obj_temp8.loc) then instance_deactivate_object(id);} - - - that_one=instance_nearest(0,0,obj_star); - instance_activate_object(obj_star); - - obj_ncombat.battle_object=that_one;instance_deactivate_object(obj_star); - obj_ncombat.battle_loc=loc; - obj_ncombat.battle_id=planet; - obj_ncombat.dropping=0; - obj_ncombat.attacking=0; - obj_ncombat.enemy=13; - obj_ncombat.threat=1; - obj_ncombat.formation_set=1; - - if (battle=1) {obj_ncombat.battle_special="wraith_attack";} - else if (battle=2) {obj_ncombat.battle_special="spyder_attack";} - else if (battle=3) {obj_ncombat.battle_special="stalker_attack";} - else if (battle=4) {obj_ncombat.battle_special="wake1_attack";} - else if (battle=5) {obj_ncombat.battle_special="wake2_attack";} - else if (battle=6) {obj_ncombat.battle_special="wake2_attack";} - - instance_destroy(); - } - - - - exit; - } - - - - - + if (obj_controller.complex_event == false) { + if (number != 0) { + obj_turn_end.alarm[1] = 4; + } + instance_destroy(); + } + } + + if ((press == 3) && (option3 != "")) { + if (title == "Artifact Offered") { + with (obj_en_fleet) { + if ((trade_goods == "male_her") || (trade_goods == "female_her")) { + action_x = choose(room_width * -1, room_width * 2); + action_y = choose(room_height * -1, room_height * 2); + alarm[4] = 1; + trade_goods = "|DELETE|"; + action_spd = 256; + action = ""; + } + } + if (obj_ini.fleet_type != ePlayerBase.home_world) { + scr_add_artifact("random", "", 4, obj_ini.ship[0], 501); + } + if (obj_ini.fleet_type == ePlayerBase.home_world) { + scr_add_artifact("random", "", 4, obj_ini.home_name, 2); + } + var i, last_artifact; + i = 0; + last_artifact = 0; + repeat (100) { + if (last_artifact == 0) { + i += 1; + if (obj_ini.artifact[i] == "") { + last_artifact = i - 1; + } + } + } + option1 = ""; + option2 = ""; + option3 = ""; + title = "Inquisition Mission Completed"; + text = "Your ship sends over a boarding party, who retrieve the offered artifact- "; + text += " some form of " + string(obj_ini.artifact[last_artifact]) + ". As promised mission_star allow the Inquisitor to leave, hoping for the best. What's the worst that could happen?"; + image = "artifact_recovered"; + option1 = ""; + option2 = ""; + option3 = ""; + scr_event_log("", "Artifact Recovered from radical Inquisitor."); + scr_event_log("", "Inquisition Mission Completed: The radical Inquisitor has been purged."); + + var v = 0, ev = 0; + repeat (99) { + v += 1; + if ((ev == 0) && (obj_controller.event[v] == "")) { + ev = v; + } + } + obj_controller.event[ev] = "inquisitor_spared1"; + obj_controller.event_duration[ev] = floor(random_range(6, 18)) + 1; + + exit; + } + if (title == "Mercy Plea") { + with (obj_en_fleet) { + if ((trade_goods == "male_her") || (trade_goods == "female_her")) { + action_x = choose(room_width * -1, room_width * 2); + action_y = choose(room_height * -1, room_height * 2); + trade_goods = "|DELETE|"; + alarm[4] = 1; + action_spd = 256; + action = ""; + } + } + title = "Inquisition Mission Completed"; + text = "mission_star allow the Inquisitor to leave, trusting in their words. If they truly do have key information it is a risk mission_star are willing to take. What's the worst that could happen?"; + image = "artifact_recovered"; + option1 = ""; + option2 = ""; + option3 = ""; + + scr_event_log("", "Inquisition Mission Completed?: The radical Inquisitor has been allowed to flee in order to weaken the forces of Chaos, as they promised."); + + var v = 0, ev = 0; + repeat (99) { + v += 1; + if ((ev == 0) && (obj_controller.event[v] == "")) { + ev = v; + } + } + obj_controller.event[ev] = "inquisitor_spared2"; + obj_controller.event_duration[ev] = floor(random_range(6, 18)) + 1; + + exit; + } else if (image == "artifact") { + if ((target_comp < 9) && (target_comp != 7)) { + // This returns the marines to the ship + scr_return_ship(obj_ground_mission.loc, obj_ground_mission, obj_ground_mission.num); + var man_size, ship_id, comp, plan, i; + i = 0; + ship_id = 0; + man_size = 0; + comp = 0; + plan = 0; + ship_id = array_get_index(obj_ini.ship, obj_ground_mission.loc); + } - - if (title="Inquisition Recon"){ - - var mission_star,onceh;onceh=0; - obj_controller.temp[200]=string(loc); - var mission_star = star_by_name(obj_controller.temp[200]); - if (add_new_problem(planet, "recon",estimate, mission_star)){ - title="Inquisition Mission Demand"; - text=$"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. mission_star are to land Astartes on {mission_star.name} {scr_roman(planet)} to investigate the planet within {estimate} months."; - with (mission_star){ - new_star_event_marker("green"); - } - scr_event_log("",$"Inquisition Mission Accepted: The Inquisition wish for Astartes to land on and investigate {mission_star.name} {scr_roman(planet)} within {estimate} months.", mission_star.name); - } - }else if (mission!="") and (title="Inquisition Mission"){ - obj_controller.temp[200]=string(loc); - var mission_star, onceh;mission_star=0;onceh=0; - var mission_star=star_by_name(obj_controller.temp[200]); - var mission_is_go =false; - if (mission_star!="none"){ - var _estimate = estimate; - var _planet = planet; - var _mission = mission; - with (mission_star){ - if (add_new_problem(_planet, _mission, _estimate)){ - new_star_event_marker("green"); - mission_is_go=true; - } - } - if (mission_is_go){ - if (demand){ - title = "Inquisition Mission Demand"; - } - - if (mission=="purge"){ - scr_event_log("",$"Inquisition Mission Accepted: The nobles of {mission_star.name} {scr_roman(planet)} must be selectively purged within {estimate} months.", mission_star.name); - if (demand){ - text=$"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. mission_star are to selectively purge the Nobles on {mission_star.name} {scr_roman(onceh)} within {estimate} months."; - } - } - else if (mission=="cleanse"){ - - scr_event_log("",$"Inquisition Mission Accepted: The mutants beneath {planet_numeral_name(planet,mission_star)} must be cleansed by fire within {estimate} months.",mission_star.name); - if (demand){ - text=$"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. mission_star are to cleanse by fire the mutants in Hive {planet_numeral_name(planet,mission_star)} within {estimate} months."; - } - }else if (mission="inquisitor"){ - scr_event_log("",$"Inquisition Mission Accepted: A radical Inquisitor enroute to {mission_star.name} must be removed. Estimated arrival in {estimate} months.",mission_star.name); - if (demand){ - text=$"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. A radical inquisitor is enroute to {mission_star.name}, expected within {estimate} months. They are to be silenced and removed."; - } - } - - if (mission="spyrer"){ - scr_event_log("",$"Inquisition Mission Accepted: The Spyrer on {mission_star.name} {scr_roman(planet)} must be killed within {estimate} months.", mission_star.name); - if (demand){ - text=$"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. An out of control Spyrer on Hive {mission_star.name} {scr_roman(onceh)} must be removed within {estimate} months."; - } - }else if (mission="necron"){ - - scr_event_log("",$"Inquisition Mission Accepted: mission_star have been given a Bomb to seal the Necron Tomb on {mission_star.name} {scr_roman(planet)}.", mission_star.name); - - image="necron_cave"; - title="New Equipment"; - fancy_title=0; - text_center=0; - text="mission_star have been provided with 1x Plasma Bomb in order to complete the mission."; - - if (demand){ - text=$"The Inquisition demands that your Chapter demonstrate its loyalty. mission_star have been given a Plasma Bomb to seal the Necron Tomb on {mission_star.name} {scr_roman(onceh)}. It is expected to be completed within {estimate} months."; - } - option1=""; - option2=""; - option3=""; - scr_add_item("Plasma Bomb",1); - obj_controller.cooldown=10; - if (demand) then demand=0; - exit; - } - - else if (mission="tyranid_org"){ - - image="webber"; - title="New Equipment"; - fancy_title=0; - text_center=0; - text="mission_star have been provided with 4x Astartes Webbers in order to complete the mission."; - - - if (demand){ - text="The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. mission_star are to capture a Gaunt organism and return it, unharmed- 4x Webbers have been provided for this purpose."; - } - - option1=""; - option2=""; - option3=""; - scr_add_item("Webber",4); - obj_controller.cooldown=10; - scr_event_log("",$"Inquisition Mission Accepted: The Inquisition wishes for the capture of a particular strain Gaunt noticed on {mission_star.name} {scr_roman(planet)} is advisable.", mission_star.name); - obj_controller.useful_info+="Tyr|"; - if (demand) then demand=0; - exit; - } else if (mission="ethereal"){ - with(obj_star){ - if (p_tau[1]>=4) or (p_tau[2]>=4) or (p_tau[3]>=4) or (p_tau[4]>=4){ - new_star_event_marker("green"); - } - } - scr_quest(0,"ethereal_capture",4,estimate); - obj_controller.useful_info+="Tau|"; - - if (demand){title="Inquisition Mission Demand"; - text=$"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. mission_star are to capture the Tau Ethereal somewhere within the {mission_star.name} system.";} - if (mission_star.p_problem[planet,1]="recon") then scr_event_log("",$"Inquisition Mission Accepted: The Inquisition wish for mission_star to capture the Tau Ethereal somewhere within {mission_star.name}.", mission_star.name); - } - } - } - if (!mission_is_go){ - if (mission="artifact"){ - var last_artifact; - scr_quest(0,"artifact_loan",4,estimate); - if (obj_ini.fleet_type=ePlayerBase.home_world){ - image="fortress"; - if (obj_ini.home_type="Hive") then image="fortress_hive"; - if (obj_ini.home_type="Death") then image="fortress_death"; - if (obj_ini.home_type="Ice") then image="fortress_ice"; - if (obj_ini.home_type="Lava") then image="fortress_lava"; - if (obj_ini.icon_name="dorf1") then image="fortress_dorf"; - if (obj_ini.icon_name="dorf2") then image="fortress_dorf"; - if (obj_ini.icon_name="dorf3") then image="fortress_dorf"; - last_artifact = scr_add_artifact("good","inquisition",0,obj_ini.home_name,2); - }else if (obj_ini.fleet_type != ePlayerBase.home_world){ - image="artifact_given"; - last_artifact =scr_add_artifact("good","inquisition",0,obj_ini.ship[1],501); - } - - title="New Artifact"; - fancy_title=0; - text_center=0; - text="The Inquisition has left an Artifact in your care, until it may be retrieved. It has been stored "; - if (obj_ini.fleet_type=ePlayerBase.home_world) then text+="within your Fortress Monastery."; - if (obj_ini.fleet_type != ePlayerBase.home_world) then text+=$"upon your ship '{obj_ini.ship[1]}'."; - scr_event_log("","Inquisition Mission Accepted: The Inquisition has left an Artifact in your care."); - - text+=$" It is some form of {obj_ini.artifact[last_artifact]}."; - option1=""; - option2=""; - option3=""; - obj_controller.cooldown=10;exit; - } - } - - if (demand){demand=0;option1="";option2="";option3="";exit;}// Remove multi-choices - } - - - if (image="inquisition") and (title="Investigation Completed"){ - obj_temp7.alarm[1]=1;instance_destroy(); - } - - if (image="artifact"){ - if (target_comp=2){ - obj_ground_mission.alarm[3]=1; - } - if (target_comp>2) and (target_comp!=7) and (target_comp<9){ - obj_controller.menu=20; - obj_controller.cooldown=10; - obj_controller.diplomacy=target_comp; - obj_controller.trading_artifact=1; - with(obj_controller){ - scr_dialogue("artifact"); - } - instance_destroy(); - } - if (target_comp=7) or (target_comp>=9){ - obj_ground_mission.alarm[4]=1; - obj_controller.cooldown=10; - instance_destroy(); - } - } - - if (image="artifact2"){ - obj_ground_mission.alarm[4]=1; - obj_controller.cooldown=10; - instance_destroy(); - } - - obj_controller.cooldown=10; - if (obj_controller.complex_event=false){ - if (number!=0) then obj_turn_end.alarm[1]=4;instance_destroy(); - } -} + if ((target_comp != 3) && (target_comp != 4)) { + // Here, have this gift + var plan = instance_nearest(obj_ground_mission.x, obj_ground_mission.y, obj_star); + var planet_arti = search_planet_features(plan.p_feature[obj_ground_mission.num], P_features.Artifact); + if (array_length(planet_arti) > 0) { + array_delete(plan.p_feature[obj_ground_mission.num], planet_arti[0], 1); + } -if (press=2) and (option2!=""){ - if (image="gene_bad") then scr_loyalty("Mutant Gene-Seed","+"); - - if (mission="spyrer") then obj_controller.disposition[4]-=2; - if (title="Inquisition Recon") then obj_controller.disposition[4]-=2; - if (image="inquisition") and (title="Investigation Completed"){ - with(obj_temp7){instance_destroy();}instance_destroy(); - } - - - - - if (title="Artifact Offered"){ - with(obj_en_fleet){if (trade_goods="male_her") or (trade_goods="female_her") then instance_destroy();} - if (obj_ini.fleet_type != ePlayerBase.home_world) then scr_add_artifact("random","",4,obj_ini.ship[1],501); - if (obj_ini.fleet_type=ePlayerBase.home_world) then scr_add_artifact("random","",4,obj_ini.home_name,2); - var i,last_artifact;i=0;last_artifact=0; - repeat(100){if (last_artifact=0){i+=1;if (obj_ini.artifact[i]="") then last_artifact=i-1;}} - option1="";option2="";option3=""; - title="Inquisition Mission Completed"; - text="Your ship sends over a boarding party, who retrieve the offered artifact- "; - text+=" some form of "+string(obj_ini.artifact[last_artifact])+". Once it is safely stowed away your ship is then ordered to fire. The Inquisitor's own seems to hesitate an instant before banking away, but is quickly destroyed."; - image="exploding_ship"; - option1="";option2="";option3=""; - scr_event_log("","Artifact recovered from radical Inquisitor."); - scr_event_log("","Inquisition Mission Completed: The radical Inquisitor has been purged."); - exit; - } - - - - if (title="He Built It"){ - obj_ini.god[ma_co,ma_id]+=10; - option1=""; - option2=""; - option3=""; - } - - - - if (title="Mercy Plea"){ - // If have any marines within the fleet on the ships - - var able,i;able=0;i=0; - - - // Several things can happen when the ship is searched; - // Full of demons, maybe remove a marine, fired upon and explodes - - exit; - - } - - if (title="Inquisitor Located"){ - var offer,gender,gender2; - offer=choose(1,1,2,2,3); - if (planet=1) then gender="he";if (planet=2) then gender="she"; - if (planet=1) then gender2="his";if (planet=2) then gender2="her"; - - if (offer=1){ - title="Artifact Offered"; - text="The Inquisitor claims that this is a massive misunderstanding, and "+string(gender)+" wishes to prove "+string(gender2)+" innocence. If mission_star allow their ship to leave "+string(gender)+" will give mission_star an artifact."; - option1="Destroy their vessel"; - option2="Take the artifact and then destroy them"; - option3="Take the artifact and spare them"; - exit; - } - - if (offer=2){ - title="Mercy Plea"; - text="The Inquisitor claims that "+string(gender)+" has key knowledge that would grant the Imperium vital power over the forces of Chaos. If mission_star allow "+string(gender2)+" ship to leave the forces of Chaos within this sector will be weakened."; - option1="Destroy their vessel"; - option2="Search their ship"; - option3="Spare them"; - exit; - } - - if (offer=3){ - var gender2; - if (planet=1) then gender2="his";if (planet=2) then gender2="her"; - with(obj_en_fleet){ - if (trade_goods="male_her") or (trade_goods="female_her"){ - with(obj_p_fleet){if (action!="") then instance_deactivate_object(id);} - with(instance_nearest(x,y,obj_p_fleet)){scr_add_corruption(true,"1d3");} - instance_activate_object(obj_p_fleet); - instance_destroy(); - } - } - title="Inquisition Mission Completed";image="exploding_ship"; - text="mission_star allow communications. As soon as the vox turns on mission_star hear a sickly, hateful voice. They begin to speak of the inevitable death of your marines, the fall of all that is and ever shall be, and "+string(gender2)+" Lord of Decay. Their ship is fired upon and destroyed without hesitation."; - option1="";option2="";option3=""; - scr_event_log("","Inquisition Mission Completed: The radical Inquisitor has been purged."); - exit; - } - exit; - } - - if (image="artifact"){ - if (target_comp!=7) and (target_comp<9){ - obj_ground_mission.alarm[4]=1; - obj_controller.cooldown=10; - instance_destroy(); - } - if (target_comp>=9) or (target_comp=7){// NOPE - scr_return_ship(obj_ground_mission.loc,obj_ground_mission,obj_ground_mission.num); - var man_size,ship_id,comp,plan,i; - i=0;ship_id=0;man_size=0;comp=0;plan=0; - repeat(30){i+=1;if (obj_ini.ship[i]=obj_ground_mission.loc) then ship_id=i;}i=0; - obj_controller.menu=0;obj_controller.managing=0; - obj_controller.cooldown=10; - with(obj_ground_mission){instance_destroy();} - instance_destroy();exit; - } - } - - if (image="artifact2"){ - scr_return_ship(obj_ground_mission.loc,obj_ground_mission,obj_ground_mission.num); - var man_size,ship_id,comp,plan,i; - i=0;ship_id=0;man_size=0;comp=0;plan=0; - repeat(30){i+=1;if (obj_ini.ship[i]=obj_ground_mission.loc) then ship_id=i;}i=0; - obj_controller.menu=0;obj_controller.managing=0; - obj_controller.cooldown=10; - with(obj_ground_mission){instance_destroy();} - instance_destroy();exit; - } - - obj_controller.cooldown=10; - - if (obj_controller.complex_event=false){ - if (number!=0) then obj_turn_end.alarm[1]=4;instance_destroy(); - } -} + scr_return_ship(obj_ground_mission.loc, obj_ground_mission, obj_ground_mission.num); + var man_size, ship_id, comp, plan, i; + i = 0; + ship_id = 0; + man_size = 0; + comp = 0; + plan = 0; + ship_id = array_get_index(obj_ini.ship, obj_ground_mission.loc); + obj_controller.menu = 0; + obj_controller.managing = 0; + obj_controller.cooldown = 10; + + // Set disposition + // 135 + + obj_controller.menu = 20; + obj_controller.cooldown = 10; + obj_controller.diplomacy = target_comp; + with (obj_controller) { + scr_dialogue("artifact_thanks"); + } + obj_controller.force_goodbye = 2; + obj_controller.exit_all = 1; + // 135 + /*there should be a chance for things to go terribly wrong when mission_star give a gift + + Imperium: if chaos, increase the global corruption of imperial planets a bit? + Imperium: if daemonic, the commander goes chaos after a few turns? + Mechanicus: if daemonic vastly increases corruption on forge worlds? + Ecclesiarchy: if daemonic they get really pissed at mission_star? + Eldar: if daemonic they get really pissed at mission_star? + Tau: if daemonic all their worlds get big corruption boosts?*/ + + with (obj_ground_mission) { + instance_destroy(); + } + instance_destroy(); + exit; + } + if ((target_comp == 3) || (target_comp == 4)) { + // Not worth it, mang + obj_controller.menu = 0; + obj_controller.managing = 0; + obj_controller.cooldown = 10; + with (obj_ground_mission) { + instance_destroy(); + } + instance_destroy(); + } + } + obj_controller.cooldown = 10; + if (obj_controller.complex_event == false) { + if (number != 0) { + obj_turn_end.alarm[1] = 4; + } + instance_destroy(); + } + } + if (image == "new_forge_master") { + if (pathway == "") { + obj_controller.complex_event = true; + techs = collect_role_group("forge"); + charisma_pick = 0; + experience_pick = 0; + talent_pick = 0; + for (i = 1; i < array_length(techs); i++) { + if (techs[charisma_pick].charisma < techs[i].charisma) { + charisma_pick = i; + } + if (techs[experience_pick].experience < techs[i].experience) { + experience_pick = i; + } + if (techs[talent_pick].technology < techs[i].technology) { + talent_pick = i; + } + } + pathway = "selection_options"; + option1 = "Popular Pick"; + option2 = "Talent Pick"; + option3 = "Experience Pick"; + } else if (pathway == "selection_options") { + if (press > 0) { + var cur_tech; + var skill_lack = 0; + var exp_lack = 0; + var dislike = 0; + var popularity_lack = 0; + var pick = "none"; + var charisma_test = 0; + if (press > 0 && press < 4) { + if (press == 1) { + pick = techs[charisma_pick]; + } else if (press == 2) { + pick = techs[talent_pick]; + } else if (press == 3) { + pick = techs[experience_pick]; + } + for (i = 0; i < array_length(techs); i++) { + if (i == charisma_pick) { + continue; + } + cur_tech = techs[i]; + charisma_test = global.character_tester.oppposed_test(pick, cur_tech, "charisma", 10); + if (charisma_test[0] != 1) { + if (pick.technology < cur_tech.technology) { + skill_lack++; + cur_tech.loyalty -= cur_tech.technology - pick.technology; + } + if (pick.experience < cur_tech.experience) { + exp_lack++; + cur_tech.loyalty -= floor((cur_tech.experience - pick.experience) / 200); + } + if (charisma_test[0] == 2) { + dislike++; + cur_tech.loyalty -= charisma_test[1]; + } + } + } + } + if (pick != "none") { + pick.update_role("Forge Master"); -if (press=3) and (option3!=""){ - if (title="Artifact Offered"){ - with(obj_en_fleet){ - if (trade_goods="male_her") or (trade_goods="female_her"){ - action_x=choose(room_width*-1,room_width*2);action_y=choose(room_height*-1,room_height*2); - alarm[4]=1;trade_goods="|DELETE|";action_spd=256;action=""; - } - } - if (obj_ini.fleet_type != ePlayerBase.home_world) then scr_add_artifact("random","",4,obj_ini.ship[1],501); - if (obj_ini.fleet_type=ePlayerBase.home_world) then scr_add_artifact("random","",4,obj_ini.home_name,2); - var i,last_artifact;i=0;last_artifact=0; - repeat(100){if (last_artifact=0){i+=1;if (obj_ini.artifact[i]="") then last_artifact=i-1;}} - option1="";option2="";option3=""; - title="Inquisition Mission Completed"; - text="Your ship sends over a boarding party, who retrieve the offered artifact- "; - text+=" some form of "+string(obj_ini.artifact[last_artifact])+". As promised mission_star allow the Inquisitor to leave, hoping for the best. What's the worst that could happen?"; - image="artifact_recovered"; - option1="";option2="";option3=""; - scr_event_log("","Artifact Recovered from radical Inquisitor."); - scr_event_log("","Inquisition Mission Completed: The radical Inquisitor has been purged."); - - var v=0,ev=0; - repeat(99){v+=1;if (ev=0) and (obj_controller.event[v]="") then ev=v;} - obj_controller.event[ev]="inquisitor_spared1";obj_controller.event_duration[ev]=floor(random_range(6,18))+1; - - exit; - } - if (title="Mercy Plea"){ - with(obj_en_fleet){ - if (trade_goods="male_her") or (trade_goods="female_her"){ - action_x=choose(room_width*-1,room_width*2);action_y=choose(room_height*-1,room_height*2); - trade_goods="|DELETE|";alarm[4]=1;action_spd=256;action=""; - } - } - title="Inquisition Mission Completed"; - text="mission_star allow the Inquisitor to leave, trusting in their words. If they truly do have key information it is a risk mission_star are willing to take. What's the worst that could happen?"; - image="artifact_recovered"; - option1="";option2="";option3=""; - - scr_event_log("","Inquisition Mission Completed?: The radical Inquisitor has been allowed to flee in order to weaken the forces of Chaos, as they promised."); - - var v=0,ev=0; - repeat(99){v+=1;if (ev=0) and (obj_controller.event[v]="") then ev=v;} - obj_controller.event[ev]="inquisitor_spared2";obj_controller.event_duration[ev]=floor(random_range(6,18))+1; - - exit; - }else if (image="artifact"){ - if (target_comp<9) and (target_comp!=7){// This returns the marines to the ship - scr_return_ship(obj_ground_mission.loc,obj_ground_mission,obj_ground_mission.num); - var man_size,ship_id,comp,plan,i; - i=0;ship_id=0;man_size=0;comp=0;plan=0; - repeat(30){ - i+=1; - if (obj_ini.ship[i]=obj_ground_mission.loc) then ship_id=i; - }i=0; - } - - if (target_comp!=3) and (target_comp!=4){ - // Here, have this gift - var plan=instance_nearest(obj_ground_mission.x,obj_ground_mission.y,obj_star); - var planet_arti = search_planet_features(plan.p_feature[obj_ground_mission.num], P_features.Artifact) - if (array_length(planet_arti) >0){ - array_delete(plan.p_feature[obj_ground_mission.num], planet_arti[0], 1) - } - - scr_return_ship(obj_ground_mission.loc,obj_ground_mission,obj_ground_mission.num); - var man_size,ship_id,comp,plan,i; - i=0;ship_id=0;man_size=0;comp=0;plan=0; - repeat(30){i+=1;if (obj_ini.ship[i]=obj_ground_mission.loc) then ship_id=i;}i=0; - obj_controller.menu=0;obj_controller.managing=0; - obj_controller.cooldown=10; - - // Set disposition - // 135 - - obj_controller.menu=20; - obj_controller.cooldown=10; - obj_controller.diplomacy=target_comp; - with(obj_controller){scr_dialogue("artifact_thanks");} - obj_controller.force_goodbye=2; - obj_controller.exit_all=1; - - // 135 - /*there should be a chance for things to go terribly wrong when mission_star give a gift - - Imperium: if chaos, increase the global corruption of imperial planets a bit? - Imperium: if daemonic, the commander goes chaos after a few turns? - Mechanicus: if daemonic vastly increases corruption on forge worlds? - Ecclesiarchy: if daemonic they get really pissed at mission_star? - Eldar: if daemonic they get really pissed at mission_star? - Tau: if daemonic all their worlds get big corruption boosts?*/ - - with(obj_ground_mission){instance_destroy();} - instance_destroy(); - exit; - } - - if (target_comp=3) or (target_comp=4){// Not worth it, mang - obj_controller.menu=0;obj_controller.managing=0; - obj_controller.cooldown=10; - with(obj_ground_mission){instance_destroy();} - instance_destroy(); - } - } - - obj_controller.cooldown=10; - if (obj_controller.complex_event=false){ - if (number!=0) then obj_turn_end.alarm[1]=4;instance_destroy(); - } -} -if (image=="new_forge_master"){ - if (pathway==""){ - obj_controller.complex_event=true; - techs = collect_role_group("forge"); - charisma_pick=0; - experience_pick=0; - talent_pick=0; - for (i=1;i0){ - var cur_tech; - var skill_lack=0; - var exp_lack=0; - var dislike=0; - var popularity_lack=0 - var pick="none"; - var charisma_test = 0; - if (press>0 && press<4){ - if (press==1){ - pick = techs[charisma_pick]; - } else if (press==2){ - pick = techs[talent_pick]; - } else if (press==3){ - pick = techs[experience_pick]; - } - for (i=0;i5) then likability = "He is not generally well liked"; - if (dislike>10) then likability = "He mostly disliked"; - if (dislike==0) then likability = "He is like by all of his tech brothers"; - text = $"{pick.name()} is selected as the new {pick.role()} {likability}." - if (skill_lack>0 && skill_lack<6){ - text+="There are some questions about his ability."; - } else if (skill_lack>6){ - text+="Many Question his Technical Talents."; - } - if (exp_lack>0 && exp_lack<6){ - text+="A few have raised questions over his experience."; - } else if (exp_lack>=6){ - text+="There have been Many concerns over his experience."; - } - if (popularity_lack>1 && popularity_lack<6){ - text+="He is not unanimously liked."; - } else if (popularity_lack>=6){ - text+="He is disliked by many."; - } - var lacks = skill_lack+exp_lack+popularity_lack; - if (lacks<((array_length(techs)-1)/10)){ - text+="Your choice Is almost unanimously respected"; - } else if (lacks<((array_length(techs)-1)/4)){ - text+="While a few may have preferred another there are no serious concerns"; - } else if (lacks<((array_length(techs)-1)/2)){ - text+="Your supporters are more than our detractors but many are unhappy"; - }else if (lacks<((array_length(techs)-1)*0.65)){ - text+="Most are unhappy with the decision but your word is final"; - } - reset_options(); - press=0 - pathway="end_splash"; - if (pick.company>0){ - for (var i=1;i<500;i++){ - if (obj_ini.name[0][i]=="") then break; - } - scr_move_unit_info(pick.company,0, pick.marine_number, i); - } - } - } - } -}else if (image=="tech_uprising"){ - - if (pathway == ""){ - obj_controller.complex_event=true; - pathway="heretic_choice"; - option1="Do Nothing"; - option2="Support the heretics"; - option3="Support the Cult mechanicus faithfuls"; - } else if (pathway == "heretic_choice"){ - if (press>0){ - pathway = "tech_aftermath"; - } - } - if (pathway == "tech_aftermath"){ - var tech,t,i, check_tech, location_techs, location_heretics, delete_positions, heretic_data=[0,0,0],loyal_data=[0,0,0]; - techs = collect_role_group("forge"); - var tech_count = array_length(techs); - for (i=0; i0 && - array_length(location_techs)>0){ - var purge_target = "none"; - if (press==1){ - var tal; - var heretic_tally=0; - var loyal_tally=0; - for (tal=0;tal<3;tal++){ - if (heretic_data[tal]>loyal_data[0]){ - heretic_tally++; - } else if (heretic_data[tal]loyal_tally){ - purge_target =location_techs; - } else if (loyal_tally0){ - for (t=0;t 5) { + likability = "He is not generally well liked"; + } + if (dislike > 10) { + likability = "He mostly disliked"; + } + if (dislike == 0) { + likability = "He is like by all of his tech brothers"; + } + text = $"{pick.name()} is selected as the new {pick.role()} {likability}."; + if (skill_lack > 0 && skill_lack < 6) { + text += "There are some questions about his ability."; + } else if (skill_lack > 6) { + text += "Many Question his Technical Talents."; + } + if (exp_lack > 0 && exp_lack < 6) { + text += "A few have raised questions over his experience."; + } else if (exp_lack >= 6) { + text += "There have been Many concerns over his experience."; + } + if (popularity_lack > 1 && popularity_lack < 6) { + text += "He is not unanimously liked."; + } else if (popularity_lack >= 6) { + text += "He is disliked by many."; + } + var lacks = skill_lack + exp_lack + popularity_lack; + if (lacks < ((array_length(techs) - 1) / 10)) { + text += "Your choice Is almost unanimously respected"; + } else if (lacks < ((array_length(techs) - 1) / 4)) { + text += "While a few may have preferred another there are no serious concerns"; + } else if (lacks < ((array_length(techs) - 1) / 2)) { + text += "Your supporters are more than our detractors but many are unhappy"; + } else if (lacks < ((array_length(techs) - 1) * 0.65)) { + text += "Most are unhappy with the decision but your word is final"; + } + reset_options(); + press = 0; + pathway = "end_splash"; + if (pick.company > 0) { + for (var i = 1; i < 500; i++) { + if (obj_ini.name[0][i] == "") { + break; + } + } + scr_move_unit_info(pick.company, 0, pick.marine_number, i); + } + } + } + } + } else if (image == "tech_uprising") { + if (pathway == "") { + obj_controller.complex_event = true; + pathway = "heretic_choice"; + option1 = "Do Nothing"; + option2 = "Support the heretics"; + option3 = "Support the Cult mechanicus faithfuls"; + } else if (pathway == "heretic_choice") { + if (press > 0) { + pathway = "tech_aftermath"; + } + } + if (pathway == "tech_aftermath") { + var tech, t, i, check_tech, location_techs, location_heretics, delete_positions, heretic_data = [0, 0, 0], loyal_data = [0, 0, 0]; + techs = collect_role_group("forge"); + var tech_count = array_length(techs); + for (i = 0; i < tech_count; i++) { + delete_positions = []; + location_techs = []; + location_heretics = []; + tech = techs[i]; + if (tech.has_trait("tech_heretic")) { + array_push(location_heretics, tech); + } else { + array_push(location_techs, tech); + } + //loop techs to fins out which techs are in the same location + for (t = i + 1; t < tech_count; t++) { + check_tech = techs[t].marine_location(); + if (same_locations(tech.marine_location(), check_tech)) { + if (techs[t].has_trait("tech_heretic")) { + array_push(location_heretics, techs[t]); + heretic_data[0] += techs[t].weapon_skill; + heretic_data[1] += techs[t].wisdom; + heretic_data[2] += techs[t].ballistic_skill; + } else { + array_push(location_techs, techs[t]); + loyal_data[0] += techs[t].weapon_skill; + loyal_data[1] += techs[t].wisdom; + loyal_data[2] += techs[t].ballistic_skill; + } + array_push(delete_positions, t); + } + } + if (array_length(location_heretics) > 0 && array_length(location_techs) > 0) { + var purge_target = "none"; + if (press == 1) { + var tal; + var heretic_tally = 0; + var loyal_tally = 0; + for (tal = 0; tal < 3; tal++) { + if (heretic_data[tal] > loyal_data[0]) { + heretic_tally++; + } else if (heretic_data[tal] < loyal_data[0]) { + loyal_tally++; + } + } + if (heretic_tally > loyal_tally) { + purge_target = location_techs; + } else if (loyal_tally < heretic_tally) { + purge_target = location_heretics; + } + if (purge_target == "none") { + purge_target = choose(location_heretics, location_techs); + } + } else if (press == 2) { + purge_target = location_techs; + } else if (press == 3) { + purge_target = location_heretics; + } + if (purge_target != "none") { + for (tal = 0; tal < array_length(purge_target); tal++) { + kill_and_recover(purge_target[tal].company, purge_target[tal].marine_number); + } + } + } + if (array_length(delete_positions) > 0) { + for (t = 0; t < array_length(delete_positions); t++) { + array_delete(techs, delete_positions[t], 1); + tech_count--; + } + } + } + if (press == 1) { + text = "With neither faction receiving your favor it is not long until the BloodLetting begins. Within a month a brutal civil war engulfs the Tech ranks with losses suffered on both sides"; + } else if (press == 2) { + text = "With your full support the so called 'heretics' who have seen through the lies of the bureaucracy of Mars eliminate those who will not be swayed to see the truth."; + obj_controller.tech_status = "heretics"; + } else if (press == 3) { + text = "The extremists and heretics that have been allowed to grow like a cancer in the Armentarium are rooted out and disposed of."; + } + reset_options(); + press = 0; + pathway = "end_splash"; + } + } + if (pathway == "end_splash") { + option1 = "Continue"; + if (press == 1) { + obj_controller.complex_event = false; + if (instance_exists(obj_turn_end)) { + if (number != 0) { + obj_turn_end.alarm[1] = 4; + } + instance_destroy(); + } + instance_destroy(); + } + } +} catch (_exception) { + handle_exception(_exception); instance_destroy(); - } } -/* */ -/* */ diff --git a/objects/obj_saveload/Alarm_0.gml b/objects/obj_saveload/Alarm_0.gml index 71999fd12..266628174 100644 --- a/objects/obj_saveload/Alarm_0.gml +++ b/objects/obj_saveload/Alarm_0.gml @@ -62,25 +62,26 @@ if (save_part == 1) { trickle = 10; txt = "Preparing"; } - -if (load_part == 6) { - txt = "Praise to the Machine God"; - if (global.restart > 0) { - txt = "Praise be to the Emperor"; - } - with (obj_controller) { - scr_load(5, global.load); - calculate_research_points(); - location_viewer = new UnitQuickFindPanel(); - with (obj_controller) { - global.star_name_colors[1] = make_color_rgb(body_colour_replace[0], body_colour_replace[1], body_colour_replace[2]); - } - } - trickle = 50; - - if (instance_exists(obj_cuicons)) { - obj_cuicons.alarm[1] = 30; - } +if (load_part==6){ + txt="Praise to the Machine God"; + if (global.restart>0) then txt="Praise be to the Emperor"; + with(obj_controller){ + scr_load(5,global.load); + // **sets up starting forge_points + location_viewer = new UnitQuickFindPanel(); + + specialist_point_handler.calculate_research_points(); + + //** sets up marine_by_location view + with(obj_controller){ + global.star_name_colors[1] = make_color_rgb(body_colour_replace[0],body_colour_replace[1],body_colour_replace[2]); + } + } + trickle=50; + + if (instance_exists(obj_cuicons)){ + obj_cuicons.alarm[1]=30; + } } if (load_part == 5) { diff --git a/objects/obj_shop/Create_0.gml b/objects/obj_shop/Create_0.gml index 527defc03..49d3fef41 100644 --- a/objects/obj_shop/Create_0.gml +++ b/objects/obj_shop/Create_0.gml @@ -315,19 +315,52 @@ if (shop = "equipment") { item_cost[i] = 80; if (research.bolt[0]>0){ forge_cost[i] = 200; - } + } i += 1; x_mod[i] = 9; item[i] = "Combiflamer"; item_stocked[i] = scr_item_count(item[i]); forge_cost[i] = 200; - if (research.bolt[0]<1) then forge_cost[i] = 0; + if (research.bolt[0]<1 || research.flame[0]<1) then forge_cost[i] = 0; item_cost[i] = 35; if (rene = 1) { nobuy[i] = 1; item_cost[i] = 0; } i += 1; + x_mod[i] = 9; + item[i] = "Combiplasma"; + item_stocked[i] = scr_item_count(item[i]); + forge_cost[i] = 450; + if (research.bolt[0]<1 || research.plasma[0]<1) then forge_cost[i] = 0; + item_cost[i] = 110; + if (rene = 1) { + nobuy[i] = 1; + item_cost[i] = 0; + } + i += 1; + x_mod[i] = 9; + item[i] = "Combimelta"; + item_stocked[i] = scr_item_count(item[i]); + forge_cost[i] = 350; + if (research.bolt[0]<1 || research.melta[0]<1) then forge_cost[i] = 0; + item_cost[i] = 40; + if (rene = 1) { + nobuy[i] = 1; + item_cost[i] = 0; + } + i += 1; + x_mod[i] = 9; + item[i] = "Combigrav"; + item_stocked[i] = scr_item_count(item[i]); + forge_cost[i] = 450; + if (research.bolt[0]<1 || research.grav[0]<1) then forge_cost[i] = 0; + item_cost[i] = 110; + if (rene = 1) { + nobuy[i] = 1; + item_cost[i] = 0; + } + i += 1; item[i] = "Heavy Bolter"; item_stocked[i] = scr_item_count(item[i]); item_cost[i] = 50; @@ -347,6 +380,12 @@ if (shop = "equipment") { item_cost[i] = 0; } i += 1; + item[i] = "Hand Flamer"; + forge_cost[i] = 75; + if (research.flame[0]<1) then forge_cost[i] = 0; + item_stocked[i] = scr_item_count(item[i]); + item_cost[i] = 12; + i += 1; item[i] = "Flamer"; forge_cost[i] = 150; if (research.flame[0]<1) then forge_cost[i] = 0; @@ -416,7 +455,37 @@ if (shop = "equipment") { if (rene = 1) { nobuy[i] = 1; item_cost[i] = 0; - } + } + i += 1; + item[i] = "Grav-Pistol"; + forge_cost[i] = 250; + if (research.grav[0]<1) then forge_cost[i] = 0; + item_stocked[i] = scr_item_count(item[i]); + item_cost[i] = 60; + if (rene = 1) { + nobuy[i] = 1; + item_cost[i] = 0; + } + i += 1; + item[i] = "Grav-Gun"; + forge_cost[i] = 350; + if (research.grav[0]<1) then forge_cost[i] = 0; + item_stocked[i] = scr_item_count(item[i]); + item_cost[i] = 100; + if (rene = 1) { + nobuy[i] = 1; + item_cost[i] = 0; + } + i += 1; + item[i] = "Grav-Cannon"; + forge_cost[i] = 600; + if (research.grav[0]<1) then forge_cost[i] = 0; + item_stocked[i] = scr_item_count(item[i]); + item_cost[i] = 300; + if (rene = 1) { + nobuy[i] = 1; + item_cost[i] = 0; + } i += 1; x_mod[i] = 9; item[i] = "Archeotech Laspistol"; @@ -717,6 +786,14 @@ if (shop = "equipment2") { item_stocked[i] = scr_item_count(item[i]); item_cost[i] = 2500; + i += 1; + x_mod[i] = 9; + item[i] = "Gene Pod Incubator"; + item_stocked[i] = scr_item_count(item[i]); + nobuy[i] = 1; + item_cost[i] = 0; + forge_cost[i] = 80; + mc=0; repeat(i) { mc += 1; @@ -1236,6 +1313,13 @@ if (shop == "production"){ forge_cost[i] = 3000; tooltip_overide[i] = "Allows basic Melta weaponry construction"; } + if (research.grav[0] == 0){ + i++; + item[i] = ["research", research_pathways.grav[0][research.grav[0]], ["grav"]]; + item_stocked[i] = 0; + forge_cost[i] = 3000; + tooltip_overide[i] = "Allows Grav weapon Construction"; + } if (research.armour[0]>0){ if (research.armour[1].stealth[0] == 0){ i++; diff --git a/objects/obj_shop/Draw_0.gml b/objects/obj_shop/Draw_0.gml index 36b73942c..fa355c09f 100644 --- a/objects/obj_shop/Draw_0.gml +++ b/objects/obj_shop/Draw_0.gml @@ -105,7 +105,7 @@ slate_panel.inside_method = function(){ var clicked =(point_in_rectangle(mouse_x, mouse_y, xx+1520, yy+y2+2, xx+1580, yy+y2+18)&& mouse_check_button_pressed(mb_left)); if (obj_controller.in_forge){ if (clicked){ - if (array_length(obj_controller.forge_queue)<20){ + if (array_length(obj_controller.specialist_point_handler.forge_queue)<20){ var new_queue_item = { name:item[i], count:1, @@ -118,7 +118,7 @@ slate_panel.inside_method = function(){ new_queue_item.forge_points = 5 * forge_cost[i]; } } - array_push(obj_controller.forge_queue, new_queue_item); + array_push(obj_controller.specialist_point_handler.forge_queue, new_queue_item); } } }else if (nobuy[i]=0) && clicked && (!obj_controller.in_forge){ diff --git a/objects/obj_star/Alarm_3.gml b/objects/obj_star/Alarm_3.gml index 8cd3d63de..2968b8b1f 100644 --- a/objects/obj_star/Alarm_3.gml +++ b/objects/obj_star/Alarm_3.gml @@ -31,12 +31,31 @@ with(obj_star_select){ instance_create(x,y,obj_star_select); obj_star_select.owner=self.owner; obj_star_select.target=self.id; -if (obj_controller.selection_data != false){ - var data = obj_controller.selection_data; - obj_star_select.feature = data.feature; - obj_controller.selecting_planet = data.planet; - obj_controller.selection_data=false; - if (obj_controller.selecting_planet >0 && obj_controller.selecting_planet<5){ - obj_star_select.garrison = new GarrisonForce(p_operatives[obj_controller.selecting_planet]); + +try{ + if (obj_controller.selection_data != false){ + var data = obj_controller.selection_data; + if (data.system != "none"){ + if (struct_exists(data, "feature")){ + if (data.feature != " none"){ + if (is_struct(data.feature)){ + if (struct_exists(data.feature, "f_type")){ + if (data.feature.f_type != "none"){ + obj_star_select.feature = new FeatureSelected(data.feature,data.system, data.planet); + } + } + } + } + } + obj_controller.selecting_planet = data.planet; + obj_controller.selection_data=false; + if (obj_controller.selecting_planet >0 && obj_controller.selecting_planet<5){ + obj_star_select.garrison = new GarrisonForce(p_operatives[obj_controller.selecting_planet]); + } + } } -} + obj_controller.selection_data = false; +} catch(_exception){ + handle_exception(_exception); + obj_controller.selection_data = false; +} \ No newline at end of file diff --git a/objects/obj_star/Draw_0.gml b/objects/obj_star/Draw_0.gml index 09c928ea3..71f9664eb 100644 --- a/objects/obj_star/Draw_0.gml +++ b/objects/obj_star/Draw_0.gml @@ -45,30 +45,19 @@ if (!global.load && (obj_controller.zoomed || in_camera_view(star_box_shape()))) surface_set_target(star_tag_surface); var panel_width = string_width(name) + 60; if (owner != eFACTION.Player ){ - var faction_sprite = obj_img.force[owner]; - var faction_index = 0; - var faction_colour = global.star_name_colors[owner]; + var _faction_index = owner; + var faction_colour = global.star_name_colors[_faction_index]; draw_sprite_general(spr_p_name_bg, 0, 0, 0, string_width(name) + 60, 32, xx-(panel_width/2), yy+30, 1, 1, 0, faction_colour, faction_colour, faction_colour, faction_colour, 1); - if (obj_img.force_exists[owner]==-1){ - try{ - scr_image("force",-50,0,0,0,0); - var faction_sprite = obj_img.force[owner]; - draw_sprite_ext(faction_sprite,faction_index,xx+(panel_width/2)-30,yy+25, 0.60, 0.60, 0, c_white, 1); - } catch(_exception){ - handle_exception(_exception); - } - } else { - draw_sprite_ext(faction_sprite,faction_index,xx+(panel_width/2)-30,yy+25, 0.60, 0.60, 0, c_white, 1); - } + draw_sprite_ext(spr_faction_icons,_faction_index,xx+(panel_width/2)-30,yy+25, 0.60, 0.60, 0, c_white, 1); } else { scr_shader_initialize(); var main_color = make_colour_from_array(obj_controller.body_colour_replace); - var pauldron_color = make_colour_from_array(obj_controller.pauldron_colour_replace); - draw_sprite_general(spr_p_name_bg, 0, 0, 0, string_width(name) + 60, 32, xx-(panel_width/2), yy+30, 1, 1, 0, main_color, main_color, pauldron_color, pauldron_color, 1); - var faction_sprite = obj_img.creation[1]; - var faction_index = obj_ini.icon; - draw_sprite_ext(faction_sprite,faction_index,xx+(panel_width/2)-30,yy+30, 0.2, 0.2, 0, c_white, 1); - //context.set_vertical_gradient(main_color, pauldron_color); + var right_pauldron = make_colour_from_array(obj_controller.pauldron_colour_replace); + draw_sprite_general(spr_p_name_bg, 0, 0, 0, string_width(name) + 60, 32, xx-(panel_width/2), yy+30, 1, 1, 0, main_color, main_color, right_pauldron, right_pauldron, 1); + var faction_sprite = global.chapter_icon_sprite; + var _faction_index = global.chapter_icon_frame; + draw_sprite_ext(faction_sprite,_faction_index,xx+(panel_width/2)-30,yy+30, 0.2, 0.2, 0, c_white, 1); + //context.set_vertical_gradient(main_color, right_pauldron); //draw_text_ext_transformed_color(gx + xoffset,gy + yoffset,text,sep,owner.width,xscale,yscale,angle ,col1, col2, col3, col4, alpha); } draw_set_color(c_white); diff --git a/objects/obj_star/Step_0.gml b/objects/obj_star/Step_0.gml index a76a5e61d..16b7f8ce5 100644 --- a/objects/obj_star/Step_0.gml +++ b/objects/obj_star/Step_0.gml @@ -12,36 +12,71 @@ if (global.load>0){ exit; } // Sets up transparency of system image -if (name!="") and (planets==0) and (image_alpha!=0.33) then image_alpha=0.33; -if (name!="") and (planets!=0) and (image_alpha==0.33) then image_alpha=1; +if (name!=""){ + if (planets==0) and (image_alpha!=0.33){ + image_alpha=0.33; + } else if (planets!=0) and (image_alpha==0.33){ + image_alpha=1; + } + +} // Sets up warp storm image -if (storm>0) then storm_image+=1; -if (storm==0) then storm_image=0; +if (storm>0){ + storm_image++; +} else { + storm_image=0; +} // Checks if they are dead planets, then sets up image if (is_dead_star()) then image_alpha=0.33; -// Reduces enemy ai count by 1 if they are present in planet -if (ai_a>=0) then ai_a-=1; -if (ai_b>=0) then ai_b-=1; -if (ai_c>=0) then ai_c-=1; -if (ai_d>=0) then ai_d-=1; -if (ai_e>=0) then ai_e-=1; + // Sets up enemy ai beheaviour -if (ai_a==0){ - try_and_report_loop("enemy ai a",scr_enemy_ai_a); -} -if (ai_b==0) { - try_and_report_loop("enemy ai b",scr_enemy_ai_b); +if (ai_a>=0){ + ai_a--; + if (ai_a==0){ + try{ + scr_enemy_ai_a(); + } catch(_exception){ + handle_exception(_exception); + } + } } -if (ai_c==0) { - try_and_report_loop("enemy ai c",scr_enemy_ai_c); +if (ai_b>=0){ + ai_b--; + if (ai_b==0){ + try{ + scr_enemy_ai_b(); + } catch(_exception){ + handle_exception(_exception); + } + } } -if (ai_d==0) { - try_and_report_loop("enemy ai d",scr_enemy_ai_d); +if (ai_c>=0){ + ai_c--; + if (ai_c==0){ + try{ + scr_enemy_ai_c(); + } catch(_exception){ + handle_exception(_exception); + } + } } -if (ai_e==0){ - try_and_report_loop("enemy ai e",scr_enemy_ai_e); +if (ai_d>=0){ + ai_d--; + if (ai_d==0){ + try{ + scr_enemy_ai_d(); + } catch(_exception){ + handle_exception(_exception); + } + } } -//big ol temporary way -system_player_ground_forces = array_reduce(p_player, function(prev, curr) { - return prev + curr -}) \ No newline at end of file +if (ai_e>=0){ + ai_e--; + if (ai_e==0){ + try{ + scr_enemy_ai_e(); + } catch(_exception){ + handle_exception(_exception); + } + } +} \ No newline at end of file diff --git a/objects/obj_star_select/Draw_64.gml b/objects/obj_star_select/Draw_64.gml index cc6451fe0..1301369f1 100644 --- a/objects/obj_star_select/Draw_64.gml +++ b/objects/obj_star_select/Draw_64.gml @@ -37,6 +37,9 @@ if (loading=1){ if (target.space_hulk=1) then exit; } } +if (obj_controller.selecting_planet>target.planets){ + obj_controller.selecting_planet = 0; +} var click_accepted = (!obj_controller.menu) and (!obj_controller.zoomed) and (!instance_exists(obj_bomb_select)) and (!instance_exists(obj_drop_select)); if (click_accepted) { if (scr_click_left(0)) { @@ -296,11 +299,11 @@ if (obj_controller.selecting_planet!=0){ var bar_start_point = xx+349; var bar_percent_length = (bar_width/100); var current_bar_percent = 0; - with (target){ - var hidden_cult = false; - if (planet_feature_bool(p_feature[current_planet],P_features.Gene_Stealer_Cult)){ - hidden_cult = return_planet_features(p_feature[current_planet],P_features.Gene_Stealer_Cult)[0].hiding; - } + var hidden_cult = false; + if (planet_data.has_feature(P_features.Gene_Stealer_Cult)){ + hidden_cult = planet_data.get_features(P_features.Gene_Stealer_Cult)[0].hiding; + } + with (target){ for (var i=1;i<13;i++){ if (p_influence[current_planet][i]>0){ draw_set_color(global.star_name_colors[i]); @@ -326,7 +329,7 @@ if (obj_controller.selecting_planet!=0){ var planet_type = target.p_type[current_planet]; // draw_sprite(spr_planet_splash,temp1,xx+349,yy+194); - scr_image("planet",scr_planet_image_numbers(planet_type),xx+349,yy+194,128,128); + scr_image("ui/planet",scr_planet_image_numbers(planet_type),xx+349,yy+194,128,128); draw_rectangle(xx+349,yy+194,xx+477,yy+322,1); draw_set_font(fnt_40k_14); @@ -384,7 +387,7 @@ if (obj_controller.selecting_planet!=0){ var improve_cost=1500,yep=0,o=0; - if (array_contains(obj_ini.adv, "Siege Masters")) then improve_cost=1100; + if (scr_has_adv("Siege Masters")) then improve_cost=1100; draw_text_glow(xx+671, yy+281,string(improve_cost),16291875,0); @@ -491,7 +494,7 @@ if (obj_controller.selecting_planet!=0){ if (cur_feature.forge>0){ var forge = cur_feature.forge_data; var size_string= $"{size[forge.size]} Chapter Forge" - array_push(planet_displays, [size_string, target.p_feature[current_planet][i].forge_data]); + array_push(planet_displays, [size_string, forge]); } } } @@ -499,11 +502,12 @@ if (obj_controller.selecting_planet!=0){ } if (upgrade_count>0){ for (i =0; i < upgrade_count ;i++){ - if (target.p_upgrades[current_planet][i].f_type == P_features.Secret_Base){ - if (target.p_upgrades[current_planet][i].forge>0){ - var forge = target.p_upgrades[current_planet][i].forge_data; + var _upgrade = target.p_upgrades[current_planet][i]; + if (_upgrade.f_type == P_features.Secret_Base){ + if (_upgrade.forge>0){ + var forge = _upgrade.forge_data; var size_string= $"{size[forge.size]} Chapter Forge" - array_push(planet_displays, [size_string, target.p_upgrades[current_planet][i].forge_data]); + array_push(planet_displays, [size_string, forge]); } } } @@ -660,43 +664,57 @@ if (obj_controller.selecting_planet!=0){ if (planet_feature_bool(target.p_upgrades[obj_controller.selecting_planet], P_features.Secret_Base)) then building.lair=1; if (planet_feature_bool(target.p_upgrades[obj_controller.selecting_planet], P_features.Arsenal)) then building.arsenal=1; if (planet_feature_bool(target.p_upgrades[obj_controller.selecting_planet], P_features.Gene_Vault)) then building.gene_vault=1; - - obj_controller.temp[104]=string(scr_master_loc()); obj_controller.menu=60; with(obj_star_select){instance_destroy();} - }else if (current_button=="Raid"){ - instance_create(x,y,obj_drop_select); - obj_drop_select.p_target=target; - obj_drop_select.planet_number = obj_controller.selecting_planet; - obj_drop_select.sh_target=instance_nearest(x,y,obj_p_fleet); - if (instance_nearest(x,y,obj_p_fleet).acted>1) then with(obj_drop_select){instance_destroy();} + }else if (current_button=="Raid" && instance_nearest(x,y,obj_p_fleet).acted<=1){ + instance_create_layer(x, y, layer_get_all()[0], obj_drop_select,{ + p_target:target, + planet_number : obj_controller.selecting_planet, + sh_target:instance_nearest(x,y,obj_p_fleet), + purge:0, + }); + }else if (current_button=="Attack"){ - instance_create(x,y,obj_drop_select); - obj_drop_select.p_target=target; - obj_drop_select.planet_number = obj_controller.selecting_planet; - obj_drop_select.attack=1; - if (target.present_fleet[1]=0) then obj_drop_select.sh_target=-50; - if (target.present_fleet[1]>0){ - obj_drop_select.sh_target=instance_nearest(x,y,obj_p_fleet); - if (instance_nearest(x,y,obj_p_fleet).acted>=2) then with(obj_drop_select){instance_destroy();} + var _allow_attack = true; + var _targ = !target.present_fleet[1] ? -50 : instance_nearest(x,y,obj_p_fleet); + if (instance_exists(_targ)){ + if (_targ.acted>=2){ + _allow_attack = false; + } } + if (_allow_attack){ + instance_create_layer(x, y, layer_get_all()[0], obj_drop_select,{ + p_target:target, + planet_number : obj_controller.selecting_planet, + attack :true, + sh_target : _targ, + purge:0, + }); + } + }else if (current_button=="Purge"){ - instance_create(x,y,obj_drop_select); - obj_drop_select.p_target=target; - obj_drop_select.purge=1; - obj_drop_select.planet_number = obj_controller.selecting_planet; - if (target.present_fleet[1]=0) then obj_drop_select.sh_target=-50; - if (target.present_fleet[1]>0){ - obj_drop_select.sh_target=instance_nearest(x,y,obj_p_fleet); - if (instance_nearest(x,y,obj_p_fleet).acted>0) then with(obj_drop_select){instance_destroy();} + var _allow_attack = true; + var _targ = !target.present_fleet[1] ? -50 : instance_nearest(x,y,obj_p_fleet); + if (instance_exists(_targ)){ + if (_targ.acted>=2){ + _allow_attack = false; + } } + if (_allow_attack){ + instance_create_layer(x, y, layer_get_all()[0], obj_drop_select,{ + p_target:target, + purge:1, + planet_number : obj_controller.selecting_planet, + sh_target : _targ, + }); + } + }else if (current_button=="Bombard"){ instance_create(x,y,obj_bomb_select); if (instance_exists(obj_bomb_select)){ obj_bomb_select.p_target=target; obj_bomb_select.sh_target=instance_nearest(x,y,obj_p_fleet); - if (instance_nearest(x,y,obj_p_fleet).acted=0) then instance_create(target.x,target.y,obj_temp3); if (instance_nearest(x,y,obj_p_fleet).acted>0) then with(obj_bomb_select){instance_destroy();} } }else if (current_button=="+Recruiting"){ @@ -753,7 +771,7 @@ if (target!=0){ repeat(7){i+=1; if (en_fleet[i]>0){ // draw_sprite_ext(spr_force_icon,en_fleet[i],x3,y3,0.5,0.5,0,c_white,1); - scr_image("force",en_fleet[i],x3-16,y3-16,32,32); + scr_image("ui/force",en_fleet[i],x3-16,y3-16,32,32); x3+=64; } } @@ -770,7 +788,7 @@ if (target!=0){ if (debug){ var current_planet; - if (!scr_hit([36,174,337,455]) && scr_click_left()){ + if (!scr_hit([36,174,337,455]) && scr_click_left()) { debug=0; exit; } diff --git a/objects/obj_star_select/Mouse_50.gml b/objects/obj_star_select/Mouse_50.gml index 238e1b1e4..4fce88d5d 100644 --- a/objects/obj_star_select/Mouse_50.gml +++ b/objects/obj_star_select/Mouse_50.gml @@ -205,20 +205,8 @@ if (player_fleet>0) and (imperial_fleet+mechanicus_fleet+inquisitor_fleet+eldar_ } instance_deactivate_object(obj_star); - - - - - // - - var fleet_ships = fleet_full_ship_array(p_fleet); - var p_ship_id; - for (i=0;iaudiences){ if (popup_special[current_popup]="2") then pip.planet=2; pip.number=1; - if (pip.title="Ship Lost"){ - var iii=0,yar=0, unit;cah=0; - repeat(30){ - iii+=1; - if (obj_ini.name[0][iii] == "") then continue; - unit = fetch_unit([0,iii]) - if (unit.role()=="Chapter Master"){ - if (unit.ship_location>0){ - if (obj_ini.ship_location[unit.ship_location]=="Lost"){ - obj_controller.alarm[7]=70; - if (global.defeat<=1) then global.defeat=1; - } - } - } - } - } } if (current_popup>popups) or (popup[1]=0){ diff --git a/objects/obj_turn_end/Draw_0.gml b/objects/obj_turn_end/Draw_0.gml index f96106697..4163584fe 100644 --- a/objects/obj_turn_end/Draw_0.gml +++ b/objects/obj_turn_end/Draw_0.gml @@ -35,7 +35,7 @@ if (show>0) and (current_battle<=battles){ if (battle_world[i]>0) then draw_text_transformed(xxx+265,yyy+11,string_hash_to_newline("Forces Attacked! ("+string(battle_location[i])+" "+scr_roman(battle_world[i])+")"),0.7,0.7,0); if (battle_world[i]=-50) then draw_text_transformed(xxx+265,yyy+11,string_hash_to_newline("Fleet Attacked! ("+string(battle_location[i])+" System)"),0.7,0.7,0); - scr_image("force",1,xxx+378-32,yyy+86-32,64,64); + scr_image("ui/force",1,xxx+378-32,yyy+86-32,64,64); // draw_sprite(spr_force_icon,1,xxx+378,yyy+86); draw_set_font(fnt_40k_14);draw_set_halign(fa_left); @@ -61,7 +61,7 @@ if (show>0) and (current_battle<=battles){ if (enemy_fleet[1]!=0){ // draw_sprite(spr_force_icon,enemy_fleet[1],xxx+44,yyy+269); - scr_image("force",enemy_fleet[1],xxx+44-32,yyy+269-32,64,64); + scr_image("ui/force",enemy_fleet[1],xxx+44-32,yyy+269-32,64,64); var shw;shw=""; if (ecap[1]=1) then shw+=string(ecap[1])+" Battleship#"; if (ecap[1]!=1) then shw+=string(ecap[1])+" Battleships#"; @@ -75,7 +75,7 @@ if (show>0) and (current_battle<=battles){ } if (enemy_fleet[2]!=0){ // draw_sprite(spr_force_icon,enemy_fleet[2],xxx+154,yyy+269); - scr_image("force",enemy_fleet[2],xxx+154-32,yyy+269-32,64,64); + scr_image("ui/force",enemy_fleet[2],xxx+154-32,yyy+269-32,64,64); var shw;shw=""; if (ecap[2]=1) then shw+=string(ecap[2])+" Battleship#"; if (ecap[2]!=1) then shw+=string(ecap[2])+" Battleships#"; @@ -89,7 +89,7 @@ if (show>0) and (current_battle<=battles){ } if (enemy_fleet[3]!=0){ // draw_sprite(spr_force_icon,enemy_fleet[3],xxx+264,yyy+269); - scr_image("force",enemy_fleet[3],xxx+264-32,yyy+269-32,64,64); + scr_image("ui/force",enemy_fleet[3],xxx+264-32,yyy+269-32,64,64); var shw;shw=""; if (ecap[3]=1) then shw+=string(ecap[3])+" Battleship#"; if (ecap[3]!=1) then shw+=string(ecap[3])+" Battleships#"; @@ -104,7 +104,7 @@ if (show>0) and (current_battle<=battles){ if (allied_fleet[1]!=0){ // draw_sprite(spr_force_icon,allied_fleet[1],xxx+374,yyy+269); - scr_image("force",allied_fleet[1],xxx+374-32,yyy+269-32,64,64); + scr_image("ui/force",allied_fleet[1],xxx+374-32,yyy+269-32,64,64); var shw;shw=""; if (acap[1]=1) then shw+=string(acap[1])+" Battleship#"; if (acap[1]!=1) then shw+=string(acap[1])+" Battleships#"; @@ -118,7 +118,7 @@ if (show>0) and (current_battle<=battles){ } if (allied_fleet[2]!=0){ // draw_sprite(spr_force_icon,allied_fleet[1],xxx+484,yyy+269); - scr_image("force",allied_fleet[1],xxx+484-32,yyy+269-32,64,64); + scr_image("ui/force",allied_fleet[1],xxx+484-32,yyy+269-32,64,64); var shw;shw=""; if (acap[2]=1) then shw+=string(acap[2])+" Battleship#"; if (acap[2]!=1) then shw+=string(acap[2])+" Battleships#"; @@ -167,7 +167,7 @@ if (show>0) and (current_battle<=battles){ draw_set_halign(fa_center); // draw_sprite(spr_force_icon,battle_opponent[i],xxx+44,yyy+289); - scr_image("force",battle_opponent[i],xxx+44-32,yyy+289-32,64,64); + scr_image("ui/force",battle_opponent[i],xxx+44-32,yyy+289-32,64,64); draw_text_transformed(xxx+44,yyy+316,string_hash_to_newline(string(strin[4])),0.75,1,0); draw_set_halign(fa_center);draw_set_font(fnt_40k_14b); diff --git a/objects/obj_turn_end/Mouse_56.gml b/objects/obj_turn_end/Mouse_56.gml index 1c8c7cb42..3974995f5 100644 --- a/objects/obj_turn_end/Mouse_56.gml +++ b/objects/obj_turn_end/Mouse_56.gml @@ -88,23 +88,7 @@ __b__ = action_if_number(obj_popup, 0, 0); //TODO fix this because this sounds rad //if(planet_feature_bool(stahr.p_feature[p_num], P_features.Monastery)==1)thenobj_fleet.player_lasers=stahr.p_lasers[p_num]; } - var capital_count = array_length(battle_pobject[current_battle].capital); - - for (var i=1;i= 2) { - var random_second_syllable_list = syllables.second_syllables[irandom(array_length(syllables.second_syllables) - 1)]; - name += random_second_syllable_list[irandom(array_length(random_second_syllable_list) - 1)]; - } - - if (syllable_amount >= 3) { - var random_third_syllable_list = syllables.third_syllables[irandom(array_length(syllables.third_syllables) - 1)]; - name += array_random_element(random_third_syllable_list); - } - - return name; - } - - static ComplexTitledName = function(mains, embelishments, titles){ - var require_embelishments = choose(true, false); - var require_titles = choose(true, false); - var name = array_random_element(array_random_element(mains)); - if (require_embelishments){ - name+=" " + array_random_element(array_random_element(embelishments)); - } - if (require_titles){ - name+=" " + array_random_element(array_random_element(titles)); - } - return name; - - } - - static CompositeNameGeneration = function(composite_names, separate_components) { - if (struct_exists(composite_names, "special") - && is_array(composite_names.special) - && array_length(composite_names.special) > 0) - { - var use_special_name = irandom(200); - if(use_special_name == 0){ - return composite_names.special[irandom(array_length(composite_names.special) - 1)]; + + var name = array_pop(names); + array_push(used_names, name); + return name; + }; + + static MultiSyllableNameGeneration = function(syllables, syllable_amount) { + var random_first_syllable_list = syllables.first_syllables[irandom(array_length(syllables.first_syllables) - 1)]; + var name = random_first_syllable_list[irandom(array_length(random_first_syllable_list) - 1)]; + + if (syllable_amount >= 2) { + var random_second_syllable_list = syllables.second_syllables[irandom(array_length(syllables.second_syllables) - 1)]; + name += random_second_syllable_list[irandom(array_length(random_second_syllable_list) - 1)]; } - } - var random_composite_one_list = composite_names.prefixes[irandom(array_length(composite_names.prefixes) - 1)] - var random_composite_two_list = composite_names.suffixes[irandom(array_length(composite_names.suffixes) - 1)] - var composite_one = random_composite_one_list[irandom(array_length(random_composite_one_list) - 1)]; - var composite_two = random_composite_two_list[irandom(array_length(random_composite_two_list) - 1)]; + if (syllable_amount >= 3) { + var random_third_syllable_list = syllables.third_syllables[irandom(array_length(syllables.third_syllables) - 1)]; + name += array_random_element(random_third_syllable_list); + } - var separator = ""; + return name; + }; - if(separate_components){ - separator = " "; - } + static ComplexTitledName = function(mains, embelishments, titles) { + var require_embelishments = choose(true, false); + var require_titles = choose(true, false); + var name = array_random_element(array_random_element(mains)); + if (require_embelishments) { + name += " " + array_random_element(array_random_element(embelishments)); + } + if (require_titles) { + name += " " + array_random_element(array_random_element(titles)); + } + return name; + }; + + static CompositeNameGeneration = function(composite_names, separate_components) { + if (struct_exists(composite_names, "special") && is_array(composite_names.special) && array_length(composite_names.special) > 0) { + var use_special_name = irandom(200); + if (use_special_name == 0) { + return composite_names.special[irandom(array_length(composite_names.special) - 1)]; + } + } + + var random_composite_one_list = composite_names.prefixes[irandom(array_length(composite_names.prefixes) - 1)]; + var random_composite_two_list = composite_names.suffixes[irandom(array_length(composite_names.suffixes) - 1)]; + var composite_one = random_composite_one_list[irandom(array_length(random_composite_one_list) - 1)]; + var composite_two = random_composite_two_list[irandom(array_length(random_composite_two_list) - 1)]; - return $"{composite_one}{separator}{composite_two}"; - } + var separator = ""; - // Functions - // TODO rework these functions to be more generic, parameterized, e.g. generate_character_name(eFACTION.Imperial) etc. - static generate_sector_name = function() { - return SimpleNameGeneration(sector_names, sector_used_names, "Sector"); - } + if (separate_components) { + separator = " "; + } - static generate_star_name = function() { - return SimpleNameGeneration(star_names, star_used_names, "Star", false); - } + return $"{composite_one}{separator}{composite_two}"; + }; - static generate_space_marine_name = function() { - return SimpleNameGeneration(space_marines_names, space_marines_used_names, "Space Marine"); - } + // Functions + // TODO rework these functions to be more generic, parameterized, e.g. generate_character_name(eFACTION.Imperial) etc. + static generate_sector_name = function() { + return SimpleNameGeneration(sector_names, sector_used_names, "Sector"); + }; - static generate_imperial_name = function(is_male = true) { - if (is_male) { - return SimpleNameGeneration(space_marines_names, space_marines_used_names, "Space Marine"); - } else { - return SimpleNameGeneration(imperial_names, imperial_used_names, "Imperial"); - } - } + static generate_star_name = function() { + return SimpleNameGeneration(star_names, star_used_names, "Star", false); + }; - static generate_genestealer_cult_name = function(){ - return ComplexTitledName(genestealer_cult_names.main, genestealer_cult_names.embelishment, genestealer_cult_names.title); - } + static generate_space_marine_name = function() { + return SimpleNameGeneration(space_marines_names, space_marines_used_names, "Space Marine"); + }; - static generate_chaos_name = function() { - return SimpleNameGeneration(chaos_names, chaos_used_names, "Chaos"); - } + static generate_imperial_name = function(is_male = true) { + if (is_male) { + return SimpleNameGeneration(space_marines_names, space_marines_used_names, "Space Marine"); + } else { + return SimpleNameGeneration(imperial_names, imperial_used_names, "Imperial"); + } + }; - static generate_eldar_name = function(syllable_amount = 2) { - return MultiSyllableNameGeneration(eldar_syllables, syllable_amount); - } + static generate_genestealer_cult_name = function() { + return ComplexTitledName(genestealer_cult_names.main, genestealer_cult_names.embelishment, genestealer_cult_names.title); + }; - static generate_ork_name = function() { - return CompositeNameGeneration(ork_name_composites, false); - } + static generate_chaos_name = function() { + return SimpleNameGeneration(chaos_names, chaos_used_names, "Chaos"); + }; - static generate_imperial_ship_name = function() { - return SimpleNameGeneration(imperial_ship_names, imperial_ship_used_names, "Imperial Ship"); - } + static generate_eldar_name = function(syllable_amount = 2) { + return MultiSyllableNameGeneration(eldar_syllables, syllable_amount); + }; - static generate_ork_ship_name = function() { - var ork_ship_name_count = max(array_length(ork_ship_names), array_length(ork_ship_used_names)); + static generate_ork_name = function() { + return CompositeNameGeneration(ork_name_composites, false); + }; - if (irandom(ork_ship_name_count) == 0) { - // Rare, special name - return $"{generate_space_marine_name()}'s Revenge"; - } + static generate_imperial_ship_name = function() { + return SimpleNameGeneration(imperial_ship_names, imperial_ship_used_names, "Imperial Ship"); + }; + + static generate_ork_ship_name = function() { + var ork_ship_name_count = max(array_length(ork_ship_names), array_length(ork_ship_used_names)); + + if (irandom(ork_ship_name_count) == 0) { + // Rare, special name + return $"{generate_space_marine_name()}'s Revenge"; + } - return SimpleNameGeneration(ork_ship_names, ork_ship_used_names, "Ork Ship"); - } + return SimpleNameGeneration(ork_ship_names, ork_ship_used_names, "Ork Ship"); + }; - static generate_hulk_name = function() { - return CompositeNameGeneration(hulk_name_composites, true); - } + static generate_hulk_name = function() { + return CompositeNameGeneration(hulk_name_composites, true); + }; - static generate_tau_leader_name = function(){ - return CompositeNameGeneration(tau_name_composites, true); + static generate_tau_leader_name = function() { + return CompositeNameGeneration(tau_name_composites, true); + }; + } catch (_exception) { + handle_exception(_exception); } } // Init -global.name_generator = new NameGenerator(); \ No newline at end of file +global.name_generator = new NameGenerator(); diff --git a/scripts/UIComponents/UIComponents.gml b/scripts/UIComponents/UIComponents.gml index 49fb33fdb..72b651ca0 100644 --- a/scripts/UIComponents/UIComponents.gml +++ b/scripts/UIComponents/UIComponents.gml @@ -347,8 +347,8 @@ function star_ui_name_node(){ } else { scr_shader_initialize(); var main_color = make_colour_from_array(obj_controller.body_colour_replace); - var pauldron_color = make_colour_from_array(obj_controller.pauldron_colour_replace); - context.set_vertical_gradient(main_color, pauldron_color); + var right_pauldron = make_colour_from_array(obj_controller.pauldron_colour_replace); + context.set_vertical_gradient(main_color, right_pauldron); } }) .finalize() @@ -362,8 +362,8 @@ function star_ui_name_node(){ context.set_valign(fa_middle) context.owner.resize(new_w, 32) if (owner == eFACTION.Player){ - var trim_color = make_colour_from_array(obj_controller.trim_colour_replace); - context.set_color_solid(trim_color) + var main_trim = make_colour_from_array(obj_controller.trim_colour_replace); + context.set_color_solid(main_trim) } }) .finalize() diff --git a/scripts/__global_object_depths/__global_object_depths.gml b/scripts/__global_object_depths/__global_object_depths.gml index 622fca555..288b2b616 100644 --- a/scripts/__global_object_depths/__global_object_depths.gml +++ b/scripts/__global_object_depths/__global_object_depths.gml @@ -1,199 +1,202 @@ +// This will execute before the first room of the game executes. +gml_pragma("global", "__global_object_depths()"); + +// @stitch-ignore-next-line: unused-function function __global_object_depths() { - // Initialise the global array that allows the lookup of the depth of a given object - // GM2.0 does not have a depth on objects so on import from 1.x a global array is created - // NOTE: MacroExpansion is used to insert the array initialisation at import time - gml_pragma( "global", "__global_object_depths()"); + // Initialise the global array that allows the lookup of the depth of a given object + // GM2.0 does not have a depth on objects so on import from 1.x a global array is created + // NOTE: MacroExpansion is used to insert the array initialisation at import time - // insert the generated arrays here - global.__objectDepths[0] = -5000; // obj_fleet - global.__objectDepths[1] = 0; // obj_circular - global.__objectDepths[2] = -9999; // obj_fleet_spawner - global.__objectDepths[3] = 8; // obj_fleet_controller - global.__objectDepths[4] = 5; // obj_p_ship - global.__objectDepths[5] = 0; // obj_p_capital - global.__objectDepths[6] = 0; // obj_p_cruiser - global.__objectDepths[7] = 0; // obj_p_escort - global.__objectDepths[8] = 0; // obj_p_small - global.__objectDepths[9] = 0; // obj_p_th - global.__objectDepths[10] = -3; // obj_p_assra - global.__objectDepths[11] = 5; // obj_en_ship - global.__objectDepths[12] = -2000; // obj_en_capital - global.__objectDepths[13] = -2000; // obj_en_cruiser - global.__objectDepths[14] = 0; // obj_en_inter - global.__objectDepths[15] = 0; // obj_en_in - global.__objectDepths[16] = 5; // obj_en_husk - global.__objectDepths[17] = 5; // obj_al_ship - global.__objectDepths[18] = 0; // obj_al_capital - global.__objectDepths[19] = 0; // obj_al_cruiser - global.__objectDepths[20] = 0; // obj_al_in - global.__objectDepths[21] = 6; // obj_p_round - global.__objectDepths[22] = 6; // obj_en_round - global.__objectDepths[23] = 6; // obj_al_round - global.__objectDepths[24] = 3; // obj_en_pulse - global.__objectDepths[25] = -50; // obj_explosion - global.__objectDepths[26] = -25000; // obj_ncombat - global.__objectDepths[27] = -50000; // obj_centerline - global.__objectDepths[28] = -30001; // obj_pnunit - global.__objectDepths[29] = -30000; // obj_enunit - global.__objectDepths[30] = -30000; // obj_nfort - global.__objectDepths[31] = 0; // obj_temp1 - global.__objectDepths[32] = 0; // obj_temp2 - global.__objectDepths[33] = 0; // obj_temp3 - global.__objectDepths[34] = 0; // obj_ground_mission - global.__objectDepths[35] = -9999999; // obj_temp5 - global.__objectDepths[36] = 0; // obj_temp6 - global.__objectDepths[37] = 0; // obj_temp7 - global.__objectDepths[38] = -5000; // obj_temp8 - global.__objectDepths[39] = 0; // obj_temp_inq - global.__objectDepths[40] = 0; // obj_temp_arti - global.__objectDepths[41] = 0; // obj_temp_build - global.__objectDepths[42] = 0; // obj_temp_meeting - global.__objectDepths[43] = -19990; // obj_credits - global.__objectDepths[44] = -49; // obj_creation - global.__objectDepths[45] = -50001; // obj_creation_popup - global.__objectDepths[46] = -50; // obj_main_menu_buttons - global.__objectDepths[47] = -1500; // obj_new_button - global.__objectDepths[48] = -1102; // obj_managment_panel - global.__objectDepths[49] = 0; // obj_restart_game - global.__objectDepths[50] = 0; // obj_restart_vars - global.__objectDepths[51] = -1005; // obj_formation_bar - global.__objectDepths[52] = -21000; // obj_dropdown_sel - global.__objectDepths[53] = 0; // obj_enemy_leftest - global.__objectDepths[54] = 0; // obj_marine - global.__objectDepths[55] = -3; // obj_p1_bullet - global.__objectDepths[56] = -3; // obj_p1_bullet_miss - global.__objectDepths[57] = 0; // obj_ork - global.__objectDepths[58] = 0; // obj_main_menu - global.__objectDepths[59] = -9999999; // obj_cuicons - global.__objectDepths[60] = -9999999; // obj_img - global.__objectDepths[61] = -999999; // obj_lol_version - global.__objectDepths[62] = -20000; // obj_ingame_menu - global.__objectDepths[63] = -7273799; // obj_fade - global.__objectDepths[64] = -5; // obj_defeat - global.__objectDepths[65] = 0; // obj_ini - global.__objectDepths[66] = -21; // obj_controller - global.__objectDepths[67] = -1001; // obj_mass_equip - global.__objectDepths[68] = -999; // obj_turn_end - global.__objectDepths[69] = -19990; // obj_saveload - global.__objectDepths[70] = -60000; // obj_cursor - global.__objectDepths[71] = -10; // obj_all_fleet - global.__objectDepths[72] = -10; // obj_p_fleet - global.__objectDepths[73] = -10; // obj_en_fleet - global.__objectDepths[74] = -9; // obj_fleet_select - global.__objectDepths[75] = -20; // obj_star_select - global.__objectDepths[76] = -30; // obj_drop_select - global.__objectDepths[77] = -30; // obj_bomb_select - global.__objectDepths[78] = -19999; // obj_popup - global.__objectDepths[79] = -19998; // obj_popup_dialogue - global.__objectDepths[80] = -21000; // obj_event - global.__objectDepths[81] = -900; // obj_event_log - global.__objectDepths[82] = -1002; // obj_shop - global.__objectDepths[83] = -1; // obj_crusade - global.__objectDepths[84] = 0; // obj_star - global.__objectDepths[85] = -1; // obj_star_event - global.__objectDepths[86] = -999999999; // obj_halp - global.__objectDepths[87] = -11; // obj_fleet_show + // insert the generated arrays here + global.__objectDepths[0] = -5000; // obj_fleet + global.__objectDepths[1] = 0; // obj_circular + global.__objectDepths[2] = -9999; // obj_fleet_spawner + global.__objectDepths[3] = 8; // obj_fleet_controller + global.__objectDepths[4] = 5; // obj_p_ship + global.__objectDepths[5] = 0; // obj_p_capital + global.__objectDepths[6] = 0; // obj_p_cruiser + global.__objectDepths[7] = 0; // obj_p_escort + global.__objectDepths[8] = 0; // obj_p_small + global.__objectDepths[9] = 0; // obj_p_th + global.__objectDepths[10] = -3; // obj_p_assra + global.__objectDepths[11] = 5; // obj_en_ship + global.__objectDepths[12] = -2000; // obj_en_capital + global.__objectDepths[13] = -2000; // obj_en_cruiser + global.__objectDepths[14] = 0; // obj_en_inter + global.__objectDepths[15] = 0; // obj_en_in + global.__objectDepths[16] = 5; // obj_en_husk + global.__objectDepths[17] = 5; // obj_al_ship + global.__objectDepths[18] = 0; // obj_al_capital + global.__objectDepths[19] = 0; // obj_al_cruiser + global.__objectDepths[20] = 0; // obj_al_in + global.__objectDepths[21] = 6; // obj_p_round + global.__objectDepths[22] = 6; // obj_en_round + global.__objectDepths[23] = 6; // obj_al_round + global.__objectDepths[24] = 3; // obj_en_pulse + global.__objectDepths[25] = -50; // obj_explosion + global.__objectDepths[26] = -25000; // obj_ncombat + global.__objectDepths[27] = -50000; // obj_centerline + global.__objectDepths[28] = -30001; // obj_pnunit + global.__objectDepths[29] = -30000; // obj_enunit + global.__objectDepths[30] = -30000; // obj_nfort + global.__objectDepths[31] = 0; // obj_temp1 + global.__objectDepths[32] = 0; // obj_temp2 + global.__objectDepths[33] = 0; // obj_temp3 + global.__objectDepths[34] = 0; // obj_ground_mission + global.__objectDepths[35] = -9999999; // obj_temp5 + global.__objectDepths[36] = 0; // obj_temp6 + global.__objectDepths[37] = 0; // obj_temp7 + global.__objectDepths[38] = -5000; // obj_temp8 + global.__objectDepths[39] = 0; // obj_temp_inq + global.__objectDepths[40] = 0; // obj_temp_arti + global.__objectDepths[41] = 0; // obj_temp_build + global.__objectDepths[42] = 0; // obj_temp_meeting + global.__objectDepths[43] = -19990; // obj_credits + global.__objectDepths[44] = -49; // obj_creation + global.__objectDepths[45] = -50001; // obj_creation_popup + global.__objectDepths[46] = -50; // obj_main_menu_buttons + global.__objectDepths[47] = -1500; // obj_new_button + global.__objectDepths[48] = -1102; // obj_managment_panel + global.__objectDepths[49] = 0; // obj_restart_game + global.__objectDepths[50] = 0; // obj_restart_vars + global.__objectDepths[51] = -1005; // obj_formation_bar + global.__objectDepths[52] = -21000; // obj_dropdown_sel + global.__objectDepths[53] = 0; // obj_enemy_leftest + global.__objectDepths[54] = 0; // obj_marine + global.__objectDepths[55] = -3; // obj_p1_bullet + global.__objectDepths[56] = -3; // obj_p1_bullet_miss + global.__objectDepths[57] = 0; // obj_ork + global.__objectDepths[58] = 0; // obj_main_menu + global.__objectDepths[59] = -9999999; // obj_cuicons + global.__objectDepths[60] = -9999999; // obj_img + global.__objectDepths[61] = -999999; // obj_lol_version + global.__objectDepths[62] = -20000; // obj_ingame_menu + global.__objectDepths[63] = -7273799; // obj_fade + global.__objectDepths[64] = -5; // obj_defeat + global.__objectDepths[65] = 0; // obj_ini + global.__objectDepths[66] = -21; // obj_controller + global.__objectDepths[67] = -1001; // obj_mass_equip + global.__objectDepths[68] = -999; // obj_turn_end + global.__objectDepths[69] = -19990; // obj_saveload + global.__objectDepths[70] = -60000; // obj_cursor + global.__objectDepths[71] = -10; // obj_all_fleet + global.__objectDepths[72] = -10; // obj_p_fleet + global.__objectDepths[73] = -10; // obj_en_fleet + global.__objectDepths[74] = -9; // obj_fleet_select + global.__objectDepths[75] = -20; // obj_star_select + global.__objectDepths[76] = -30; // obj_drop_select + global.__objectDepths[77] = -30; // obj_bomb_select + global.__objectDepths[78] = -19999; // obj_popup + global.__objectDepths[79] = -19998; // obj_popup_dialogue + global.__objectDepths[80] = -21000; // obj_event + global.__objectDepths[81] = -900; // obj_event_log + global.__objectDepths[82] = -1002; // obj_shop + global.__objectDepths[83] = -1; // obj_crusade + global.__objectDepths[84] = 0; // obj_star + global.__objectDepths[85] = -1; // obj_star_event + global.__objectDepths[86] = -999999999; // obj_halp + global.__objectDepths[87] = -11; // obj_fleet_show - global.__objectNames[0] = "obj_fleet"; - global.__objectNames[1] = "obj_circular"; - global.__objectNames[2] = "obj_fleet_spawner"; - global.__objectNames[3] = "obj_fleet_controller"; - global.__objectNames[4] = "obj_p_ship"; - global.__objectNames[5] = "obj_p_capital"; - global.__objectNames[6] = "obj_p_cruiser"; - global.__objectNames[7] = "obj_p_escort"; - global.__objectNames[8] = "obj_p_small"; - global.__objectNames[9] = "obj_p_th"; - global.__objectNames[10] = "obj_p_assra"; - global.__objectNames[11] = "obj_en_ship"; - global.__objectNames[12] = "obj_en_capital"; - global.__objectNames[13] = "obj_en_cruiser"; - global.__objectNames[14] = "obj_en_inter"; - global.__objectNames[15] = "obj_en_in"; - global.__objectNames[16] = "obj_en_husk"; - global.__objectNames[17] = "obj_al_ship"; - global.__objectNames[18] = "obj_al_capital"; - global.__objectNames[19] = "obj_al_cruiser"; - global.__objectNames[20] = "obj_al_in"; - global.__objectNames[21] = "obj_p_round"; - global.__objectNames[22] = "obj_en_round"; - global.__objectNames[23] = "obj_al_round"; - global.__objectNames[24] = "obj_en_pulse"; - global.__objectNames[25] = "obj_explosion"; - global.__objectNames[26] = "obj_ncombat"; - global.__objectNames[27] = "obj_centerline"; - global.__objectNames[28] = "obj_pnunit"; - global.__objectNames[29] = "obj_enunit"; - global.__objectNames[30] = "obj_nfort"; - global.__objectNames[31] = "obj_temp1"; - global.__objectNames[32] = "obj_temp2"; - global.__objectNames[33] = "obj_temp3"; - global.__objectNames[34] = "obj_ground_mission"; - global.__objectNames[35] = "obj_temp5"; - global.__objectNames[36] = "obj_temp6"; - global.__objectNames[37] = "obj_temp7"; - global.__objectNames[38] = "obj_temp8"; - global.__objectNames[39] = "obj_temp_inq"; - global.__objectNames[40] = "obj_temp_arti"; - global.__objectNames[41] = "obj_temp_build"; - global.__objectNames[42] = "obj_temp_meeting"; - global.__objectNames[43] = "obj_credits"; - global.__objectNames[44] = "obj_creation"; - global.__objectNames[45] = "obj_creation_popup"; - global.__objectNames[46] = "obj_main_menu_buttons"; - global.__objectNames[47] = "obj_new_button"; - global.__objectNames[48] = "obj_managment_panel"; - global.__objectNames[49] = "obj_restart_game"; - global.__objectNames[50] = "obj_restart_vars"; - global.__objectNames[51] = "obj_formation_bar"; - global.__objectNames[52] = "obj_dropdown_sel"; - global.__objectNames[53] = "obj_enemy_leftest"; - global.__objectNames[54] = "obj_marine"; - global.__objectNames[55] = "obj_p1_bullet"; - global.__objectNames[56] = "obj_p1_bullet_miss"; - global.__objectNames[57] = "obj_ork"; - global.__objectNames[58] = "obj_main_menu"; - global.__objectNames[59] = "obj_cuicons"; - global.__objectNames[60] = "obj_img"; - global.__objectNames[61] = "obj_lol_version"; - global.__objectNames[62] = "obj_ingame_menu"; - global.__objectNames[63] = "obj_fade"; - global.__objectNames[64] = "obj_defeat"; - global.__objectNames[65] = "obj_ini"; - global.__objectNames[66] = "obj_controller"; - global.__objectNames[67] = "obj_mass_equip"; - global.__objectNames[68] = "obj_turn_end"; - global.__objectNames[69] = "obj_saveload"; - global.__objectNames[70] = "obj_cursor"; - global.__objectNames[71] = "obj_all_fleet"; - global.__objectNames[72] = "obj_p_fleet"; - global.__objectNames[73] = "obj_en_fleet"; - global.__objectNames[74] = "obj_fleet_select"; - global.__objectNames[75] = "obj_star_select"; - global.__objectNames[76] = "obj_drop_select"; - global.__objectNames[77] = "obj_bomb_select"; - global.__objectNames[78] = "obj_popup"; - global.__objectNames[79] = "obj_popup_dialogue"; - global.__objectNames[80] = "obj_event"; - global.__objectNames[81] = "obj_event_log"; - global.__objectNames[82] = "obj_shop"; - global.__objectNames[83] = "obj_crusade"; - global.__objectNames[84] = "obj_star"; - global.__objectNames[85] = "obj_star_event"; - global.__objectNames[86] = "obj_halp"; - global.__objectNames[87] = "obj_fleet_show"; + global.__objectNames[0] = "obj_fleet"; + global.__objectNames[1] = "obj_circular"; + global.__objectNames[2] = "obj_fleet_spawner"; + global.__objectNames[3] = "obj_fleet_controller"; + global.__objectNames[4] = "obj_p_ship"; + global.__objectNames[5] = "obj_p_capital"; + global.__objectNames[6] = "obj_p_cruiser"; + global.__objectNames[7] = "obj_p_escort"; + global.__objectNames[8] = "obj_p_small"; + global.__objectNames[9] = "obj_p_th"; + global.__objectNames[10] = "obj_p_assra"; + global.__objectNames[11] = "obj_en_ship"; + global.__objectNames[12] = "obj_en_capital"; + global.__objectNames[13] = "obj_en_cruiser"; + global.__objectNames[14] = "obj_en_inter"; + global.__objectNames[15] = "obj_en_in"; + global.__objectNames[16] = "obj_en_husk"; + global.__objectNames[17] = "obj_al_ship"; + global.__objectNames[18] = "obj_al_capital"; + global.__objectNames[19] = "obj_al_cruiser"; + global.__objectNames[20] = "obj_al_in"; + global.__objectNames[21] = "obj_p_round"; + global.__objectNames[22] = "obj_en_round"; + global.__objectNames[23] = "obj_al_round"; + global.__objectNames[24] = "obj_en_pulse"; + global.__objectNames[25] = "obj_explosion"; + global.__objectNames[26] = "obj_ncombat"; + global.__objectNames[27] = "obj_centerline"; + global.__objectNames[28] = "obj_pnunit"; + global.__objectNames[29] = "obj_enunit"; + global.__objectNames[30] = "obj_nfort"; + global.__objectNames[31] = "obj_temp1"; + global.__objectNames[32] = "obj_temp2"; + global.__objectNames[33] = "obj_temp3"; + global.__objectNames[34] = "obj_ground_mission"; + global.__objectNames[35] = "obj_temp5"; + global.__objectNames[36] = "obj_temp6"; + global.__objectNames[37] = "obj_temp7"; + global.__objectNames[38] = "obj_temp8"; + global.__objectNames[39] = "obj_temp_inq"; + global.__objectNames[40] = "obj_temp_arti"; + global.__objectNames[41] = "obj_temp_build"; + global.__objectNames[42] = "obj_temp_meeting"; + global.__objectNames[43] = "obj_credits"; + global.__objectNames[44] = "obj_creation"; + global.__objectNames[45] = "obj_creation_popup"; + global.__objectNames[46] = "obj_main_menu_buttons"; + global.__objectNames[47] = "obj_new_button"; + global.__objectNames[48] = "obj_managment_panel"; + global.__objectNames[49] = "obj_restart_game"; + global.__objectNames[50] = "obj_restart_vars"; + global.__objectNames[51] = "obj_formation_bar"; + global.__objectNames[52] = "obj_dropdown_sel"; + global.__objectNames[53] = "obj_enemy_leftest"; + global.__objectNames[54] = "obj_marine"; + global.__objectNames[55] = "obj_p1_bullet"; + global.__objectNames[56] = "obj_p1_bullet_miss"; + global.__objectNames[57] = "obj_ork"; + global.__objectNames[58] = "obj_main_menu"; + global.__objectNames[59] = "obj_cuicons"; + global.__objectNames[60] = "obj_img"; + global.__objectNames[61] = "obj_lol_version"; + global.__objectNames[62] = "obj_ingame_menu"; + global.__objectNames[63] = "obj_fade"; + global.__objectNames[64] = "obj_defeat"; + global.__objectNames[65] = "obj_ini"; + global.__objectNames[66] = "obj_controller"; + global.__objectNames[67] = "obj_mass_equip"; + global.__objectNames[68] = "obj_turn_end"; + global.__objectNames[69] = "obj_saveload"; + global.__objectNames[70] = "obj_cursor"; + global.__objectNames[71] = "obj_all_fleet"; + global.__objectNames[72] = "obj_p_fleet"; + global.__objectNames[73] = "obj_en_fleet"; + global.__objectNames[74] = "obj_fleet_select"; + global.__objectNames[75] = "obj_star_select"; + global.__objectNames[76] = "obj_drop_select"; + global.__objectNames[77] = "obj_bomb_select"; + global.__objectNames[78] = "obj_popup"; + global.__objectNames[79] = "obj_popup_dialogue"; + global.__objectNames[80] = "obj_event"; + global.__objectNames[81] = "obj_event_log"; + global.__objectNames[82] = "obj_shop"; + global.__objectNames[83] = "obj_crusade"; + global.__objectNames[84] = "obj_star"; + global.__objectNames[85] = "obj_star_event"; + global.__objectNames[86] = "obj_halp"; + global.__objectNames[87] = "obj_fleet_show"; - // create another array that has the correct entries - var len = array_length_1d(global.__objectDepths); - global.__objectID2Depth = []; - for( var i=0; i= 0) { - global.__objectID2Depth[ objID ] = global.__objectDepths[i]; - } // end if - } // end for + // create another array that has the correct entries + var len = array_length_1d(global.__objectDepths); + global.__objectID2Depth = []; + for( var i=0; i= 0) { + global.__objectID2Depth[ objID ] = global.__objectDepths[i]; + } // end if + } // end for } diff --git a/scripts/__init_action/__init_action.gml b/scripts/__init_action/__init_action.gml index b0e571fab..66fef7c86 100644 --- a/scripts/__init_action/__init_action.gml +++ b/scripts/__init_action/__init_action.gml @@ -1,15 +1,15 @@ -function __init_action() { - gml_pragma( "global", "__init_action();"); - global.__part_syst=-1; - global.__part_emit=[]; - global.__argument_relative=false; - global.__part_type=[]; - - for( var i=0; i<=15; ++i) - { - global.__part_type[i] = -1; - global.__part_emit[i] = -1; - } +// This will execute before the first room of the game executes. +gml_pragma("global", "__init_action()"); +// @stitch-ignore-next-line: unused-function +function __init_action() { + global.__part_syst=-1; + global.__part_emit=[]; + global.__argument_relative=false; + global.__part_type=[]; + for (var i=0; i < 16; i++) { + global.__part_type[i] = -1; + global.__part_emit[i] = -1; + } } diff --git a/scripts/__init_d3d/__init_d3d.gml b/scripts/__init_d3d/__init_d3d.gml index 2233f3901..b55b48be3 100644 --- a/scripts/__init_d3d/__init_d3d.gml +++ b/scripts/__init_d3d/__init_d3d.gml @@ -1,84 +1,82 @@ -function __init_d3d() { - gml_pragma( "global", "__init_d3d();"); - // setup the depth variable to a sensible default - global.__d3d=false; - global.__d3dDepth=0; - global.__d3dCamera=camera_create(); - global.__d3dPrimKind = -1; - global.__d3dPrimTex = -1; - global.__d3dPrimBuffer=vertex_create_buffer(); - vertex_format_begin(); - vertex_format_add_position_3d(); - vertex_format_add_normal(); - vertex_format_add_colour(); - vertex_format_add_texcoord(); - global.__d3dPrimVF=vertex_format_end(); - global.__d3dDeprecatedMessage = [ false ]; - - enum e__YYM - { - PointB, - LineB, - TriB, - PointUVB, - LineUVB, - TriUVB, - PointVB, - LineVB, - TriVB, - Texture, - Colour, - NumVerts, - PrimKind, - NumPointCols, - NumLineCols, - NumTriCols, - PointCols, - LineCols, - TriCols, +// This will execute before the first room of the game executes. +gml_pragma("global", "__init_d3d()"); - // these are used when building model primitives - V1X, - V1Y, - V1Z, - V1NX, - V1NY, - V1NZ, - V1C, - V1U, - V1V, +enum e__YYM { + PointB, + LineB, + TriB, + PointUVB, + LineUVB, + TriUVB, + PointVB, + LineVB, + TriVB, + Texture, + Colour, + NumVerts, + PrimKind, + NumPointCols, + NumLineCols, + NumTriCols, + PointCols, + LineCols, + TriCols, - V2X, - V2Y, - V2Z, - V2NX, - V2NY, - V2NZ, - V2C, - V2U, - V2V, - }; - - enum e__YYMKIND - { - PRIMITIVE_BEGIN, - PRIMITIVE_END, - VERTEX, - VERTEX_COLOR, - VERTEX_TEX, - VERTEX_TEX_COLOR, - VERTEX_N, - VERTEX_N_COLOR, - VERTEX_N_TEX, - VERTEX_N_TEX_COLOR, - SHAPE_BLOCK, - SHAPE_CYLINDER, - SHAPE_CONE, - SHAPE_ELLIPSOID, - SHAPE_WALL, - SHAPE_FLOOR, - }; + // these are used when building model primitives + V1X, + V1Y, + V1Z, + V1NX, + V1NY, + V1NZ, + V1C, + V1U, + V1V, + V2X, + V2Y, + V2Z, + V2NX, + V2NY, + V2NZ, + V2C, + V2U, + V2V, +}; +enum e__YYMKIND { + PRIMITIVE_BEGIN, + PRIMITIVE_END, + VERTEX, + VERTEX_COLOR, + VERTEX_TEX, + VERTEX_TEX_COLOR, + VERTEX_N, + VERTEX_N_COLOR, + VERTEX_N_TEX, + VERTEX_N_TEX_COLOR, + SHAPE_BLOCK, + SHAPE_CYLINDER, + SHAPE_CONE, + SHAPE_ELLIPSOID, + SHAPE_WALL, + SHAPE_FLOOR, +}; +// @stitch-ignore-next-line: unused-function +function __init_d3d() { + // setup the depth variable to a sensible default + global.__d3d=false; + global.__d3dDepth=0; + global.__d3dCamera=camera_create(); + global.__d3dPrimKind = -1; + global.__d3dPrimTex = -1; + global.__d3dPrimBuffer=vertex_create_buffer(); + vertex_format_begin(); + vertex_format_add_position_3d(); + vertex_format_add_normal(); + vertex_format_add_colour(); + vertex_format_add_texcoord(); + global.__d3dPrimVF=vertex_format_end(); + global.__d3dDeprecatedMessage = [ false ]; } diff --git a/scripts/__init_external/__init_external.gml b/scripts/__init_external/__init_external.gml index bf26acd7b..eb381b2ae 100644 --- a/scripts/__init_external/__init_external.gml +++ b/scripts/__init_external/__init_external.gml @@ -15,11 +15,11 @@ function __init_external() { } // ======================== - if (!directory_exists("logs")) { - directory_create("logs"); + if (!directory_exists("Logs")) { + directory_create("Logs"); } - #macro PATH_last_messages $"logs/last_messages.log" + #macro PATH_last_messages $"Logs/last_messages.log" var _log_file = file_text_open_write(PATH_last_messages); file_text_close(_log_file); @@ -38,9 +38,15 @@ function __init_external() { global.build_date = _build_date; if (string_char_at(_version, 1) != "v") { if (string_count("compile-", _version) > 0 || string_count("release-", _version) > 0) { - _version = string_delete(_version, 1, 8); + var _format_version = string_delete(_version, 1, 8); + var _parts = string_split(_format_version, "."); + _format_version = _parts[0] + "." + _parts[1]; + _version = _format_version; } - _version += $"/{_commit_hash}"; + if (_commit_hash != "") { + _version += $"/{_commit_hash}"; + } + _version = $"dev-{_version}"; } else { _version = string_delete(_version, 1, 1); } diff --git a/scripts/__init_global/__init_global.gml b/scripts/__init_global/__init_global.gml index 022fecd43..c5966727a 100644 --- a/scripts/__init_global/__init_global.gml +++ b/scripts/__init_global/__init_global.gml @@ -1,7 +1,8 @@ -function __init_global() { - gml_pragma( "global", "__init_global();"); +// This will execute before the first room of the game executes. +gml_pragma("global", "__init_global()"); - // set any global defaults - layer_force_draw_depth(true,0); // force all layers to draw at depth 0 - draw_set_colour( c_black ); +function __init_global() { + // set any global defaults + layer_force_draw_depth(true, 0); // force all layers to draw at depth 0 + draw_set_colour(c_black); } diff --git a/scripts/__init_view/__init_view.gml b/scripts/__init_view/__init_view.gml index 296453eb6..002c543ff 100644 --- a/scripts/__init_view/__init_view.gml +++ b/scripts/__init_view/__init_view.gml @@ -1,24 +1,19 @@ -function __init_view() { - enum e__VW - { - XView, - YView, - WView, - HView, - Angle, - HBorder, - VBorder, - HSpeed, - VSpeed, - Object, - Visible, - XPort, - YPort, - WPort, - HPort, - Camera, - SurfaceID, - }; - - -} +enum e__VW { + XView, + YView, + WView, + HView, + Angle, + HBorder, + VBorder, + HSpeed, + VSpeed, + Object, + Visible, + XPort, + YPort, + WPort, + HPort, + Camera, + SurfaceID, +}; diff --git a/scripts/explode_script/explode_script.gml b/scripts/explode_script/explode_script.gml index 84abb9f8b..e8100674a 100644 --- a/scripts/explode_script/explode_script.gml +++ b/scripts/explode_script/explode_script.gml @@ -9,7 +9,7 @@ function explode_script(argument0, argument1) { explode[0]=0; explode[1]=0; } - for (i=0; i0){ if (array_length(_units)>=_max_count){ break; @@ -247,7 +247,7 @@ function collect_role_group(group="standard", location="", opposite=false, searc if (location==""){ _add=true; } else if (!is_array(location)){ - _add=unit.is_at_location(location, 0, 0); + _add=unit.is_at_location(location); } else { _add=unit.is_at_location(location[0], location[1], location[2]); } @@ -287,7 +287,7 @@ function stat_valuator(search_params, unit){ function collect_by_religeon(religion, sub_cult="", location=""){ var _units = [], unit, count=0, _add=false; for (var com=0;com<=10;com++){ - for (i=1;i 0) { + + obj_controller.recruiting = 0; + obj_controller.income_recruiting = 0; + scr_alert("red", "recruiting", "The Chapter has run out of gene-seed!", 0, 0); + + }else if (obj_controller.recruiting > 0){ + if (local_screening_points>0){ + + marine_training(local_screening_points); + + _training_happend = true; + } else { + scr_alert("red", "recruiting", $"Recruitment on {name()} halted due to insufficient apothecary rescources", 0, 0); + } + } + } + return _training_happend; + } + + static recover_starship = function(techs){ + try { + var engineer_count = array_length(techs); + if (has_feature(P_features.Starship) && engineer_count>0){ + //TODO allow total tech point usage here + var _starship = get_features(P_features.Starship)[0]; + + var _engineer_score_start = _starship.engineer_score; + if (_starship.engineer_score<2000){ + for (var v=0;v0 && _starship.funds_spent<_target_spend){ + scr_alert("green","owner",$"{_requisition_spend} Requision spent on Ancient Ship repairs in materials and outfitting (outfitting {(_starship.funds_spent/_target_spend)*100}%)",system.x,system.y); + } + if (_starship.funds_spent>=_target_spend && _starship.engineer_score>=2000){// u2=tar; + //TODO refactor into general new ship logic + delete_features(features,P_features.Starship); + + var locy=$"{name()}"; + + var flit=instance_create(system.x,system.y,obj_p_fleet); + + var _slaughter = new_player_ship("Gloriana", system.name, "Slaughtersong"); + add_ship_to_fleet(_slaughter, flit); + flit.oribiting = system.id; + + scr_popup($"Ancient Ship Restored",$"The ancient ship within the ruins of {locy} has been fully repaired. It is determined to be a Gloriana Class vessel and is bristling with golden age weaponry and armour. Your {string(obj_ini.role[100][16])}s are excited; the Slaughtersong is ready for it's maiden voyage, at your command.","",""); + } + } + }catch (_exception){ + handle_exception(_exception); + } + } + + static guard_score_calc = function(){ + guard_score = 0; + if (guardsmen < 500 && guardsmen>0) { + guard_score = 0.1; + } else if (guardsmen >= 100000000) { + guard_score = 7; + } else if (guardsmen >= 50000000) { + guard_score = 6; + } else if (guardsmen >= 15000000) { + guard_score = 5; + } else if (guardsmen >= 6000000) { + guard_score = 4; + } else if (guardsmen >= 1000000) { + guard_score = 3; + } else if (guardsmen >= 100000) { + guard_score = 2; + } else if (guardsmen >= 2000) { + guard_score = 1; + } else { + guard_score = 0.5; + } + + return guard_score; + } + + static continue_to_planet_battle = function(stop){ + + var _nids_real = planet_forces[eFACTION.Tyranids]; + var _nids_score = _nids_real < 4 ? 0 : _nids_real; + var _nid_diff = _nids_score-_nids_real; + + if (chaos_forces==6.1) and (_nids_real>0) then tyranids_score=_nids_real; + + if (current_owner == eFACTION.Tau){ + stop = (xenos_and_heretics() + _nid_diff + player_forces + planet_forces[eFACTION.Ecclesiarchy]) <= 0; + } + + if (stop){ + if (planet_forces[eFACTION.Ork]>0) and (planet_forces[eFACTION.Ecclesiarchy]>0) then stop=0; + } + + var imperium_forces = ((guardsmen>0) or (pdf>0) or (planet_forces[eFACTION.Ecclesiarchy]>0)); + + if (stop){ + if (planet_forces[eFACTION.Necrons]>=5 || planet_forces[eFACTION.Tyranids]>=5 && imperium_forces) then stop=0; + } + + + //tau fight imperial + if (stop){ + if (current_owner = eFACTION.Tau){ + if ((guardsmen>0) or (planet_forces[eFACTION.Ecclesiarchy]>0)) and ((pdf>0) or (planet_forces[eFACTION.Tau]>0)) then stop=0; + } + + } + + // Attack heretics whenever possible, even player controlled ones + if (stop){ + if (player_forces+pdf>0) and (guardsmen>0) and (obj_controller.faction_status[2]="War") then stop=0; + } + if (stop){ + if (player_forces+pdf>0) and (planet_forces[eFACTION.Ecclesiarchy]>0) and (obj_controller.faction_status[5]="War") then stop=0; + } + + return stop; + } + + static pdf_will_support_player = function(){ + if (current_owner== eFACTION.Tau){ + return false; + } + if (has_feature(P_features.Gene_Stealer_Cult) && current_owner==eFACTION.Tyranids){ + return false; + } + + if ((current_owner=1 || obj_controller.faction_status[2]!="War") && pdf){ + return true; + } + return false; + } + + static guard_attack_matrix = function(){ + var guard_attack = ""; + // if (p_eldar[planet]>0) and (p_owner[planet]!=6) then guard_attack="eldar"; + //if (planet_forces[eFACTION.Tau] + planet_forces[eFACTION.Ork] + planet_forces[eFACTION.Heretics]+ planet_forces[eFACTION.Chaos]) + if (planet_forces[eFACTION.Tau]>0) then guard_attack="tau"; + if (planet_forces[eFACTION.Ork]>0) then guard_attack="ork"; + if (planet_forces[eFACTION.Heretics]>0){ + // Always goes after traitors first, unless + guard_attack="traitors"; + if (planet_forces[eFACTION.Heretics]<=1 && planet_forces[eFACTION.Tau]>=4) and (current_owner!=8) then guard_attack="tau"; + } + if (planet_forces[eFACTION.Chaos]>0) then guard_attack="csm"; + if (pdf>0) and (current_owner=eFACTION.Tau) then guard_attack="pdf"; + + if (current_owner = eFACTION.Player){ + if (pdf>0 && obj_controller.faction_status[2]=="War") then guard_attack="pdf"; + } + if (planet_forces[eFACTION.Tyranids]<=1) and (planet_forces[eFACTION.Ork]>=4) then guard_attack="ork"; + // if (p_tyranids[planet]>0) and (guard_attack="") then guard_attack="tyranids"; + if (planet_forces[eFACTION.Tyranids]>=4){ + guard_attack="tyranids"; + }else if (planet_forces[eFACTION.Tyranids]<4 && planet_forces[eFACTION.Tyranids]>0){ + if (has_feature(P_features.Gene_Stealer_Cult)){ + var _hidden_cult = get_features(P_features.Gene_Stealer_Cult)[0].hiding; + if (!_hidden_cult){ + guard_attack="tyranids"; + } + } + } + + return guard_attack; + } + + + static pdf_attack_matrix = function(){ + var _no_notable_traitors = planet_forces[eFACTION.Heretics]<=1; + var _pdf_attack = ""; + if (planet_forces[eFACTION.Tyranids]>=4 && !has_feature(P_features.Gene_Stealer_Cult)){ + _pdf_attack = "tyranids"; + } + + if (_no_notable_traitors && _pdf_attack=="") { + if ((planet_forces[eFACTION.Ork]>=4)){ + _pdf_attack="ork"; + } else if (planet_forces[eFACTION.Tau]>=4 && current_owner!=8){ + _pdf_attack="tau"; + } + } + if (guardsmen && _pdf_attack==""){ + if (obj_controller.faction_status[2]=="War"){ + if (pdf_will_support_player()){ + _pdf_attack="guard"; + } + } else if (current_owner == eFACTION.Tau){ + _pdf_attack="guard"; + } + } + + if (_pdf_attack==""){ + if (planet_forces[eFACTION.Chaos]>0){ + _pdf_attack="csm"; + } else if (planet_forces[eFACTION.Heretics]>0){ + _pdf_attack="traitors"; + } else if ((planet_forces[eFACTION.Ork]>0)){ + _pdf_attack="ork"; + } else if (planet_forces[eFACTION.Tau]>0) and (current_owner!=eFACTION.Tau){ + _pdf_attack="tau"; + } + } + // Always goes after traitors first, unless + return _pdf_attack; + } + + static pdf_loss_reduction_calc = function(){ + pdf_loss_reduction = fortification_level*0.001; + if (pdf_will_support_player()){ + pdf_loss_reduction+=garrison.viable_garrison*0.0005; + } + return pdf_loss_reduction; + } + + static pdf_defence_loss_to_orks = function(){ + var active_garrison = pdf_will_support_player() && garrison.viable_garrison>0; + if (planet_forces[eFACTION.Ork]>=4) and (pdf>=30000){ + pdf=floor(pdf*(min(0.95, 0.55+pdf_loss_reduction))); + } + else if (planet_forces[eFACTION.Ork]>=4 && pdf<30000 && pdf>=10000){ + pdf=active_garrison?pdf*0.4:0; + } + else if (planet_forces[eFACTION.Ork]>=3) and (pdf<10000){ + pdf=active_garrison?pdf*0.4:0; + } + else if (planet_forces[eFACTION.Ork]<3 && pdf>30000){ + pdf=floor(pdf*(min(0.95, 0.7+pdf_loss_reduction))); + } + if (planet_forces[eFACTION.Ork]>=2) and (pdf<2000){ pdf=0;} + if (planet_forces[eFACTION.Ork]>=1) and (pdf<200){ pdf=0;} + + system.p_pdf[planet] = pdf; + } + +} \ No newline at end of file diff --git a/scripts/scr_squad_names/scr_squad_names.yy b/scripts/scr_PlanetData/scr_PlanetData.yy similarity index 86% rename from scripts/scr_squad_names/scr_squad_names.yy rename to scripts/scr_PlanetData/scr_PlanetData.yy index 618d96c1f..820201a8b 100644 --- a/scripts/scr_squad_names/scr_squad_names.yy +++ b/scripts/scr_PlanetData/scr_PlanetData.yy @@ -1,7 +1,7 @@ { "resourceType": "GMScript", "resourceVersion": "1.0", - "name": "scr_squad_names", + "name": "scr_PlanetData", "isCompatibility": false, "isDnD": false, "parent": { diff --git a/scripts/scr_add_artifact/scr_add_artifact.gml b/scripts/scr_add_artifact/scr_add_artifact.gml index 7b0015621..20c3b22a6 100644 --- a/scripts/scr_add_artifact/scr_add_artifact.gml +++ b/scripts/scr_add_artifact/scr_add_artifact.gml @@ -96,7 +96,7 @@ function scr_add_artifact(artifact_type, artifact_tags, is_identified, artifact_ rand2=floor(random(100))+1;good=0; - if (string_count("Shit",obj_ini.strin2)>0){rand2=min(rand2+20,100);} + if (scr_has_disadv("Shitty Luck")){rand2=min(rand2+20,100);} if (rand2<=70){t3="";} else if (rand2<=90 && artifact_type!="random_nodemon"){ array_push(tags, "chaos"); @@ -175,7 +175,7 @@ function scr_add_artifact(artifact_type, artifact_tags, is_identified, artifact_ artifact_location = obj_ini.home_name; ship_id = 2; } else { - artifact_location = obj_ini.ship[1]; + artifact_location = obj_ini.ship[0]; ship_id = 501; } } @@ -233,6 +233,10 @@ function ArtifactStruct(Index) constructor{ static ship_id = function (){ return obj_ini.artifact_sid[index]-500; } + + static set_ship_id = function(ship_id){ + obj_ini.artifact_sid[index] = ship_id+500; + } static location_string = function(){ if (sid()>=500){ return obj_ini.ship[ship_id()]; @@ -335,25 +339,85 @@ function ArtifactStruct(Index) constructor{ }; static unequip_from_unit = function(){ + try{ if (equipped() && is_array(bearer)){ - var b_type = determine_base_type(); + var _b_type = determine_base_type(); var unit = fetch_unit(bearer); - if (b_type=="weapon"){ + if (_b_type=="weapon"){ if (unit.weapon_one(true) == index){ unit.update_weapon_one("", false, false); } else if (unit.weapon_two(true) == index){ unit.update_weapon_two("", false, false); } - } else if (b_type=="gear"){ + } else if (_b_type=="gear"){ unit.update_gear("", false, false); - } else if (b_type=="armour"){ + } else if (_b_type=="armour"){ unit.update_armour("", false, false); - } else if (b_type=="mobility"){ + } else if (_b_type=="mobility"){ unit.update_mobility_item("", false, false); } - bearer =false; + bearer = false; obj_ini.artifact_equipped[index] = false; + } else if (equipped()){ + var _b_type = determine_base_type(); + var _bearer = false; + var _bearer_found = false; + var _unit; + if (_b_type=="weapon"){ + for (var co=0;co0) then array_push(ships, capital_num[i]); } - for (i=0;i0) then array_push(ships, frigate_num[i]); } - for (i=0;i0) then array_push(ships, escort_num[c]); } - for (co=0;co<=10;co++){ - for (i=0;i=13) then obj_ini.god[target_company][good]=2;// Khorne!!!1 XDDDDDDD + //if (man_role=obj_ini.role[100][12]) and (corruption>=13) then obj_ini.god[target_company][good]=2;// Khorne!!!1 XDDDDDDD - if (missing = 1) and(man_role == obj_ini.role[100][12]) { - if (string_count("has joined the X Company", obj_turn_end.alert_text[obj_turn_end.alerts])) { - scr_alert("red", $"recruiting", "Not enough {obj_ini.role[100][12]} equipment in the armoury!", 0, 0); + if (missing = 1) and(man_role == obj_ini.role[100][12]) { + if (string_count("has joined the X Company", obj_turn_end.alert_text[obj_turn_end.alerts])) { + scr_alert("red", $"recruiting", "Not enough {obj_ini.role[100][12]} equipment in the armoury!", 0, 0); + } } - } - } - - if (!array_contains(non_marine_roles, man_role)) { - unit = new TTRPG_stats("chapter", target_company, good, "scout", other_data); - unit.corruption = corruption - unit.roll_age(); // Age here - marines += 1; + } } obj_ini.TTRPG[target_company][good] = unit; unit.add_exp(spawn_exp); unit.allocate_unit_to_fresh_spawn(home_spot); + unit.update_role(man_role); with(obj_ini) { scr_company_order(target_company); } diff --git a/scripts/scr_add_vehicle/scr_add_vehicle.gml b/scripts/scr_add_vehicle/scr_add_vehicle.gml index 045fce7f2..0affcd9b9 100644 --- a/scripts/scr_add_vehicle/scr_add_vehicle.gml +++ b/scripts/scr_add_vehicle/scr_add_vehicle.gml @@ -1,86 +1,127 @@ function scr_add_vehicle(vehicle_type, target_company, weapon1, weapon2, weapon3, upgrade, accessory) { - - - // That should be sufficient to add stuff in a highly modifiable fashion - - - var i=0;e=0;good=0;wep1="";wep2="";gear="";arm="";missing=0; - - repeat(150){ - i+=1; - if (good=0){ - if (obj_ini.veh_role[target_company,i]="") then good=i; + try { + // That should be sufficient to add stuff in a highly modifiable fashion + + var i = 0; + e = 0; + good = 0; + wep1 = ""; + wep2 = ""; + gear = ""; + arm = ""; + missing = 0; + + for (var i = 1; i < array_length(obj_ini.veh_role[target_company]); i++) { + if (good == 0) { + if (obj_ini.veh_role[target_company][i] == "") { + good = i; + break; + } + } } - } - - - if (good!=0){ - obj_ini.veh_race[target_company][good]=1; - - if (obj_ini.fleet_type=ePlayerBase.home_world){ - obj_ini.veh_loc[target_company][good]=obj_ini.home_name; - obj_ini.veh_wid[target_company][good]=2; - obj_ini.veh_lid[target_company][good]=0;} - - if (obj_ini.fleet_type != ePlayerBase.home_world){// Need a more elaborate ship_carrying += here for the different types of units - var first,backup;first=0;backup=0;i=0; - repeat(30){i+=1; - if (obj_ini.ship_class[i]="Battle Barge") and (first=0) and (obj_ini.ship_capacity[i]>obj_ini.ship_carrying[i]) then first=i; - if (obj_ini.ship_class[i]="Strike Cruiser") and (backup=0) and (obj_ini.ship_capacity[i]>obj_ini.ship_carrying[i]) then backup=i; - } - if (first!=0){ - obj_ini.veh_lid[target_company][good]=first; - obj_ini.veh_loc[target_company][good]=obj_ini.ship_location[first]; - obj_ini.veh_wid[target_company][good]=0; - obj_ini.ship_carrying[first]+=1; - } - if (first=0) and (backup!=0){ - obj_ini.veh_lid[target_company][good]=backup; - obj_ini.veh_loc[target_company][good]=obj_ini.ship_location[backup]; - obj_ini.veh_wid[target_company][good]=0; - obj_ini.ship_carrying[backup]+=1; - } - if (first=0) and (backup=0){ - obj_ini.veh_lid[target_company][good]=0; - obj_ini.veh_loc[target_company][good]=""; - obj_ini.veh_wid[target_company][good]=0;exit; - } - } - - - - - obj_ini.veh_role[target_company][good]=vehicle_type; - - if (weapon1!="standard") then obj_ini.veh_wep1[target_company][good]=weapon1; - if (weapon2!="standard") then obj_ini.veh_wep2[target_company][good]=weapon2; - if (weapon3!="standard") then obj_ini.veh_wep3[target_company][good]=weapon3; - if (upgrade!="standard") then obj_ini.veh_upgrade[target_company][good]=upgrade; - if (accessory!="standard") then obj_ini.veh_acc[target_company][good]=accessory; - - if (weapon1="standard") and (weapon2="standard") and (weapon3="standard"){ - if (vehicle_type="Rhino"){obj_ini.veh_wep1[target_company][good]="Storm Bolter";} - if (vehicle_type="Whirlwind"){obj_ini.veh_wep1[target_company][good]="Whirlwind Missiles";} - if (vehicle_type="Predator"){ - var randumb;randumb=choose(1,2) - if (randumb=1){obj_ini.veh_wep1[target_company][good]="Autocannon Turret";} - if (randumb=2){obj_ini.veh_wep1[target_company][good]="Twin Linked Lascannon Turret";} - } - if (vehicle_type="Land Raider"){ - var randumb=choose(1,1,2,3) - if (randumb=1){obj_ini.veh_wep1[target_company][good]="Twin Linked Heavy Bolter Mount";obj_ini.veh_wep2[target_company][good]="Twin Linked Lascannon Sponsons";} - if (randumb=2){obj_ini.veh_wep1[target_company][good]="Twin Linked Assault Cannon Mount";obj_ini.veh_wep2[target_company][good]="Hurricane Bolter Sponsons";} - if (randumb=3){obj_ini.veh_wep1[target_company][good]="Twin Linked Assault Cannon Mount";obj_ini.veh_wep2[target_company][good]="Flamestorm Cannon Sponsons";} - } - if (vehicle_type="Land Speeder"){obj_ini.veh_wep1[target_company][good]="Heavy Bolter";obj_ini.veh_wep2[target_company][good]="";obj_ini.veh_upgrade[target_company][good]="";} - } + if (good != 0) { + obj_ini.veh_race[target_company][good] = 1; + + if (obj_ini.fleet_type == ePlayerBase.home_world) { + obj_ini.veh_loc[target_company][good] = obj_ini.home_name; + obj_ini.veh_wid[target_company][good] = 2; + obj_ini.veh_lid[target_company][good] = -1; + } + + if (obj_ini.fleet_type != ePlayerBase.home_world) { + // Need a more elaborate ship_carrying += here for the different types of units + var first = 0, backup = 0, i = 0; + for (var i = 0; i < array_length(obj_ini.ship_class); i++) { + if ((obj_ini.ship_class[i] == "Battle Barge") && (first == 0) && (obj_ini.ship_capacity[i] > obj_ini.ship_carrying[i])) { + first = i; + } + if ((obj_ini.ship_class[i] == "Strike Cruiser") && (backup == 0) && (obj_ini.ship_capacity[i] > obj_ini.ship_carrying[i])) { + backup = i; + } + } + if (first != 0) { + obj_ini.veh_lid[target_company][good] = first; + obj_ini.veh_loc[target_company][good] = obj_ini.ship_location[first]; + obj_ini.veh_wid[target_company][good] = 0; + obj_ini.ship_carrying[first] += 1; + } else if ((first == 0) && (backup != 0)) { + obj_ini.veh_lid[target_company][good] = backup; + obj_ini.veh_loc[target_company][good] = obj_ini.ship_location[backup]; + obj_ini.veh_wid[target_company][good] = 0; + obj_ini.ship_carrying[backup] += 1; + } else if ((first == 0) && (backup == 0)) { + obj_ini.veh_lid[target_company][good] = -1; + obj_ini.veh_loc[target_company][good] = ""; + obj_ini.veh_wid[target_company][good] = 0; + exit; + } + } + + obj_ini.veh_role[target_company][good] = vehicle_type; + + if (weapon1 != "standard") { + obj_ini.veh_wep1[target_company][good] = weapon1; + } + if (weapon2 != "standard") { + obj_ini.veh_wep2[target_company][good] = weapon2; + } + if (weapon3 != "standard") { + obj_ini.veh_wep3[target_company][good] = weapon3; + } + if (upgrade != "standard") { + obj_ini.veh_upgrade[target_company][good] = upgrade; + } + if (accessory != "standard") { + obj_ini.veh_acc[target_company][good] = accessory; + } + + if ((weapon1 == "standard") && (weapon2 == "standard") && (weapon3 == "standard")) { + if (vehicle_type == "Rhino") { + obj_ini.veh_wep1[target_company][good] = "Storm Bolter"; + } + if (vehicle_type == "Whirlwind") { + obj_ini.veh_wep1[target_company][good] = "Whirlwind Missiles"; + } + if (vehicle_type == "Predator") { + var randumb; + randumb = choose(1, 2); + if (randumb == 1) { + obj_ini.veh_wep1[target_company][good] = "Autocannon Turret"; + } + if (randumb == 2) { + obj_ini.veh_wep1[target_company][good] = "Twin Linked Lascannon Turret"; + } + } + if (vehicle_type == "Land Raider") { + var randumb = choose(1, 1, 2, 3); + if (randumb == 1) { + obj_ini.veh_wep1[target_company][good] = "Twin Linked Heavy Bolter Mount"; + obj_ini.veh_wep2[target_company][good] = "Twin Linked Lascannon Sponsons"; + } + if (randumb == 2) { + obj_ini.veh_wep1[target_company][good] = "Twin Linked Assault Cannon Mount"; + obj_ini.veh_wep2[target_company][good] = "Hurricane Bolter Sponsons"; + } + if (randumb == 3) { + obj_ini.veh_wep1[target_company][good] = "Twin Linked Assault Cannon Mount"; + obj_ini.veh_wep2[target_company][good] = "Flamestorm Cannon Sponsons"; + } + } + if (vehicle_type == "Land Speeder") { + obj_ini.veh_wep1[target_company][good] = "Heavy Bolter"; + obj_ini.veh_wep2[target_company][good] = ""; + obj_ini.veh_upgrade[target_company][good] = ""; + } + } + + obj_ini.veh_hp[target_company][good] = 100; + obj_ini.veh_chaos[target_company][good] = 0; + obj_ini.veh_pilots[target_company][good] = 0; + } - obj_ini.veh_hp[target_company][good]=100; - obj_ini.veh_chaos[target_company][good]=0; - obj_ini.veh_pilots[target_company][good]=0; + return [target_company, good]; + } catch (_exception) { + handle_exception(_exception); } - - return [target_company, good] - } diff --git a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml index b7ecc8d04..e4e66dbd4 100644 --- a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml +++ b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml @@ -20,7 +20,9 @@ function scr_ruins_suprise_attack_player(){ instance_deactivate_all(true); instance_activate_object(obj_controller); instance_activate_object(obj_ini); + instance_activate_object(obj_star_select); instance_activate_object(obj_star); + instance_activate_object(obj_ground_mission); var _star = star_by_name(obj_ground_mission.loc); var _planet = obj_ground_mission.num; @@ -30,7 +32,7 @@ function scr_ruins_suprise_attack_player(){ //that_one=instance_nearest(0,0,obj_star); // instance_activate_object(obj_star); - scr_battle_roster(_star.name ,_planet,true); + scr_battle_roster(obj_ground_mission.loc ,_planet,true); obj_controller.cooldown=10; obj_ncombat.battle_object=_star; obj_ncombat.battle_loc=_star.name; @@ -48,6 +50,10 @@ function scr_ruins_suprise_attack_player(){ } catch (_exception) { handle_exception(_exception); instance_activate_all(); + instance_destroy(obj_popup); + instance_destroy(obj_star_select); + instance_destroy(obj_ground_mission); + instance_destroy(obj_ncombat); } } //spawn point for starship @@ -134,60 +140,63 @@ function scr_ruins_determine_race(){ }; -function scr_explore_ruins(){ +function scr_explore_ruins() { + try { + obj_controller.current_planet_feature = self; + obj_controller.menu = 0; - obj_controller.current_planet_feature =self; - obj_controller.menu=0; + var pip = instance_create(0, 0, obj_popup); + pip.title = "Ancient Ruins"; - var pip=instance_create(0,0,obj_popup); - pip.title="Ancient Ruins"; - - var nu=planet_numeral_name(planet,star); + var nu = planet_numeral_name(planet, star); - var arti=instance_create(star.x,star.y,obj_ground_mission); - arti.explore_feature = self; - arti.num=planet; - arti.loc=star.name; - arti.battle_loc=star.name; - arti.manag=obj_controller.managing; - arti.obj=star; - with (arti){ - setup_planet_mission_group(); - } + var arti = instance_create(star.x, star.y, obj_ground_mission); + arti.explore_feature = self; + arti.num = planet; + arti.loc = star.name; + arti.battle_loc = star.name; + arti.manag = obj_controller.managing; + arti.obj = star; + with (arti) { + setup_planet_mission_group(); + } - arti.ship_id=obj_controller.ma_lid[1]; - obj_controller.current_planet_feature.battle = arti; + arti.ship_id = obj_controller.ma_lid[1]; + obj_controller.current_planet_feature.battle = arti; - if (failed_exploration){ - pip.text=$"The accursed ruins on {nu} where your brothers fell still holds many secrets including the remains of your brothers honour demands you avenge them." - }else{ - pip.text=$"Located upon {nu} is a {ruins_size} expanse of ancient ruins, dating back to times long since forgotten. Locals are superstitious about the place- as a result the ruins are hardly explored. What they might contain, and any potential threats, are unknown."; - switch (ruins_size){ - case "tiny": - pip.text += "It's tiny nature means no more than five marines can operate in cohesion without being seperated"; - break; - case "small": - pip.text += "As a result of it's narrow corridors and tight spaces a squad of any more than 15 would struggle to operate effectivly"; - break; - case "medium": - pip.text += "Half a standard company (55) could easily operate effectivly in the many wide spaces and caverns"; - break; - case "large": - pip.text += "A whole company (110) would not be confined in the huge spaces that such a ruin contain"; - break; - case "sprawling": - pip.text += "The ruins is of an unprecidented size whole legions of old would not feel uncomfortable in such a space" - break; + if (failed_exploration) { + pip.text = $"The accursed ruins on {nu} where your brothers fell still holds many secrets including the remains of your brothers honour demands you avenge them."; + } else { + pip.text = $"Located upon {nu} is a {ruins_size} expanse of ancient ruins, dating back to times long since forgotten. Locals are superstitious about the place- as a result the ruins are hardly explored. What they might contain, and any potential threats, are unknown."; + switch (ruins_size) { + case "tiny": + pip.text += "It's tiny nature means no more than five marines can operate in cohesion without being seperated"; + break; + case "small": + pip.text += "As a result of it's narrow corridors and tight spaces a squad of any more than 15 would struggle to operate effectivly"; + break; + case "medium": + pip.text += "Half a standard company (55) could easily operate effectivly in the many wide spaces and caverns"; + break; + case "large": + pip.text += "A whole company (110) would not be confined in the huge spaces that such a ruin contain"; + break; + case "sprawling": + pip.text += "The ruins is of an unprecidented size whole legions of old would not feel uncomfortable in such a space"; + break; + } + pip.text += ". What is thy will?"; } - pip.text += ". What is thy will?" - } - pip.option1="Explore the ruins."; - pip.option2="Do nothing."; - pip.option3="Return your marines to the ship."; - pip.image="ancient_ruins"; - + pip.option1 = "Explore the ruins."; + pip.option2 = "Do nothing."; + pip.option3 = "Return your marines to the ship."; + pip.image = "ancient_ruins"; + } catch (_exception) { + handle_exception(_exception); + } } + function scr_check_for_ruins_exploration(select_planet, star){ var _planet_features = star.p_feature[select_planet] var _ruins_list = search_planet_features( _planet_features, P_features.Ancient_Ruins) diff --git a/scripts/scr_apothecarium/scr_apothecarium.gml b/scripts/scr_apothecarium/scr_apothecarium.gml new file mode 100644 index 000000000..ce74f0fa3 --- /dev/null +++ b/scripts/scr_apothecarium/scr_apothecarium.gml @@ -0,0 +1,198 @@ +// Script assets have changed for v2.3.0 see +// https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information + +function scr_destroy_gene_slave_batch(batch_id, recover_gene=true){ + var _cur_slave = obj_ini.gene_slaves[batch_id]; + if (revover_gene){ + obj_controller.gene_seed+=_cur_slave.num; + scr_add_item("Gene Pod Incubator", _cur_slave.num); + } + delete _cur_slave; + array_delete(obj_ini.gene_slaves,batch_id, 1); +} + +function destroy_all_gene_slaves(recover_gene=true){ + var _slave_length = array_length(obj_ini.gene_slaves); + if (_slave_length>0){ + for (var i=_slave_length-1; i>=0; i--){ + scr_destroy_gene_slave_batch(i,recover_gene); + } + obj_ini.gene_slaves = []; + } +} + +function add_new_gene_slave(){ + if (gene_seed>0) and (obj_ini.zygote==0) { + var _added = false; + if (array_length(obj_ini.gene_slaves)){ + var _last_set = obj_ini.gene_slaves[array_length(obj_ini.gene_slaves)-1]; + if (_last_set.turn == obj_controller.turn){ + _last_set.num++; + obj_controller.gene_seed--; + _added=true; + } + } + if (!_added){ + array_push(obj_ini.gene_slaves, { + num : 1, + eta : 120, + harvested_once : false, + turn : obj_controller.turn, + assigned_apothecaries : [], + }); + obj_controller.gene_seed--; + } + scr_add_item("Gene Pod Incubator", -1); + } +} + +function scr_apothecarium(){ + draw_sprite(spr_rock_bg, 0, xx, yy); + + draw_set_alpha(0.75); + draw_set_color(0); + draw_rectangle(xx + 326 + 16, yy + 66, xx + 887 + 16, yy + 818, 0); + draw_set_alpha(1); + draw_set_color(c_gray); + draw_rectangle(xx + 326 + 16, yy + 66, xx + 887 + 16, yy + 818, 1); + draw_line(xx + 326 + 16, yy + 426, xx + 887 + 16, yy + 426); + + draw_set_alpha(0.75); + draw_set_color(0); + draw_rectangle(xx + 945, yy + 66, xx + 1580, yy + 818, 0); + draw_set_alpha(1); + draw_set_color(c_gray); + draw_rectangle(xx + 945, yy + 66, xx + 1580, yy + 818, 1); + + if (menu_adept = 0) { + scr_image("advisor", 1, xx + 16, yy + 43, 310, 828); + // draw_sprite(spr_advisors,1,xx+16,yy+43); + if (global.chapter_name = "Space Wolves") then scr_image("advisor", 11, xx + 16, yy + 43, 310, 828); + // draw_sprite(spr_advisors,11,xx+16,yy+43); + draw_set_halign(fa_left); + draw_set_color(c_gray); + draw_set_font(fnt_40k_30b); + draw_text_transformed(xx + 336 + 16, yy + 66, "Apothecarium", 1, 1, 0); + draw_text_transformed(xx + 336 + 16, yy + 100, "Master of the Apothecarion " + string(obj_ini.name[0, 3]), 0.6, 0.6, 0); + draw_set_font(fnt_40k_14); + } + if (menu_adept = 1) { + // draw_sprite(spr_advisors,0,xx+16,yy+43); + scr_image("advisor", 0, xx + 16, yy + 43, 310, 828); + draw_set_halign(fa_left); + draw_set_color(c_gray); + draw_set_font(fnt_40k_30b); + draw_text_transformed(xx + 336 + 16, yy + 40, "Apothecarium", 1, 1, 0); + draw_text_transformed(xx + 336 + 16, yy + 100, $"Adept {obj_controller.adept_name}", 0.6, 0.6, 0); + draw_set_font(fnt_40k_14); + } + + blurp = "Milord, I come with a report. Our Chapter currently boasts " + string(temp[36]) + " " + string(obj_ini.role[100, 15]) + " working on a variety of things, from field-duty to research to administrative duties. "; + + if (training_apothecary = 0) then blurp += "Our Brothers are currently not assigned to train further " + string(obj_ini.role[100, 15]) + "; no more can be trained until Apothcarium funds are increased."; + // + if (training_apothecary > 0) then blurp += "Our Brothers assigned to the training of future " + string(obj_ini.role[100, 15]) + "s have taken up a "; + if (training_apothecary >= 1 && training_apothecary <= 6){ + var _recruit_rates = ARR_recruitment_rates; + blurp += _recruit_rates[training_apothecary]; + } + if (training_apothecary > 0){ + blurp += " pace and expect to graduate an additional " + string(obj_ini.role[100, 15]) + " in "; + var training_points_values = ARR_apothecary_training_tiers; + eta = floor((47 - apothecary_recruit_points) / training_points_values[training_apothecary]) + 1; + blurp += string(eta) + " months."; + } + // + + // + + if (gene_seed <= 0) then blurp += "##My lord, our stocks of gene-seed are empty. It would be best to have some come mechanicus tithe.##Further training of Neophytes is halted until our stocks replenish."; + if (gene_seed > 0) and(gene_seed <= 10) then blurp += "##My Brother " + string(obj_ini.role[100, 15]) + "s assigned to the gene-vault have informed me that our stocks are nearly gone. They only number " + string(gene_seed) + "; this includes those recently recovered from our fallen comerades-in-arms."; + if (gene_seed > 10) then blurp += "##My Brother " + string(obj_ini.role[100, 15]) + "s assigned to the gene-vault have informed me that our stocks of gene-seed currently number " + string(gene_seed) + ". This includes those recently recovered from our fallen comerades-in-arms."; + if (gene_seed > 0) then blurp += "##The stocks are stable and show no sign of mutation."; + + if (menu_adept = 1) { + var _recruit_pace = ARR_recruitment_pace; + blurp = "Your Chapter contains " + string(temp[36]) + " " + string(obj_ini.role[100, 15]) + ".##"; + blurp += "Training of further " + string(obj_ini.role[100, 15]) + "s"; + if (training_apothecary >= 0 && training_apothecary <= 6) then blurp += _recruit_pace[training_apothecary]; + if (training_apothecary > 0) then blurp += " The next " + string(obj_ini.role[100, 15]) + " is expected in " + string(eta) + " months."; + blurp += "##You have " + string(gene_seed) + " gene-seed stocked."; + } + + draw_text_ext(xx + 336 + 16, yy + 130, string_hash_to_newline(string(blurp)), -1, 536); + + var blurp2 = ""; + var _slave_length = array_length(obj_ini.gene_slaves); + if (!obj_ini.zygote) { + if (obj_controller.marines + obj_controller.gene_seed <= 300) and(_slave_length = 0) { + blurp2 = "Our Chapter is disasterously low in number- it is strongly advised that we make use of test-slaves to breed new gene-seed. Give me the word andwe can begin installing gestation pods."; + } + else if (obj_controller.marines + obj_controller.gene_seed > 300) and(_slave_length = 0) { + blurp2 = "Our Chapter is capable of using test-slaves to breed new gene-seed. Should our number of astartes ever plummet this may prove a valuable method of rapidly bringing our chapter back up to size."; + } + else if (_slave_length > 0) { + blurp2 = "Our Test-Slave Incubators are working optimally. As soon as a batch fully matures a second progenoid gland they will be harvested and prepared for use."; + } + } + if (obj_ini.zygote = 1) then blurp2 = "Unfortunantly we cannot make use of Test-Slave Incubators. Due to our missing Zygote any use of gestation pods is ultimately useless- no new gene-seed may be grown, no matter how long we wait."; + + draw_set_halign(fa_center); + draw_set_color(c_gray); + draw_set_font(fnt_40k_30b); + draw_text_transformed(xx + 622, yy + 440, "Test-Slave Incubators", 0.6, 0.6, 0); + draw_set_halign(fa_left); + draw_set_color(c_gray); + draw_set_font(fnt_40k_14); + draw_text_ext(xx + 336 + 16, yy + 477, string_hash_to_newline(string(blurp2)), -1, 536); + + ; + var _slave_index_shown = 0; + var _cur_slave; + for (var i = 0; i < _slave_length; i++) { // TODO why go through all batches if we can only display 10? + if (obj_ini.gene_slaves[i].num > 0 && _slave_index_shown < 10) { + _slave_index_shown++; + _cur_slave = obj_ini.gene_slaves[i]; + draw_text(xx + 336 + 16, yy + 513 + (_slave_index_shown * 20), $"Batch {_slave_index_shown}" ); + draw_text(xx + 336 + 16.5, yy + 513.5 + (_slave_index_shown * 20), $"Batch {_slave_index_shown}"); + draw_text(xx + 536, yy + 513 + (_slave_index_shown * 20), $"Eta: {_cur_slave.eta} months"); + draw_text(xx + 756, yy + 513 + (_slave_index_shown * 20), $"{_cur_slave.num} pods"); + } + } + draw_set_alpha(1); + if (obj_controller.gene_seed <= 0) or(obj_ini.zygote = 1) then draw_set_alpha(0.5); + draw_set_color(c_gray); + draw_set_color(c_black); + if (scr_item_count("Gene Pod Incubator")){ + if (point_and_click(draw_unit_buttons([xx + 411, yy + 793],"Add Test-Slave",[0.75,0.75],c_green))){ + add_new_gene_slave(); + } + } else { + if (scr_hit(draw_unit_buttons([xx + 411, yy + 793],"Add Test-Slave",[0.75,0.75],c_grey))){ + tooltip_draw("No available Gene Pod Incubators, Build more Gene Pod Incubators in the forge"); + } + } + + draw_set_alpha(1); + if (_slave_length <= 0){ + draw_set_alpha(0.5); + } + draw_set_color(c_gray); + draw_rectangle(xx + 659, yy + 788, xx + 838, yy + 811, 0); + draw_set_color(c_black); + var _destroy_button = draw_unit_buttons([xx + 664, yy + 793], "Destroy All Incubators", [0.75,0.75],c_red); + if (_slave_length > 0 && scr_hit(_destroy_button)) { + draw_set_alpha(0.2); + draw_set_color(c_gray); + draw_rectangle(xx + 659, yy + 788, xx + 838, yy + 811, 0); + if (point_and_click(_destroy_button)){ + if (_slave_length>0){ + for (var i=_slave_length-1; i>=0; i--){ + scr_destroy_gene_slave_batch(i); + } + obj_ini.gene_slaves = []; + } + } + } + draw_set_alpha(1); +} \ No newline at end of file diff --git a/scripts/file_encrypt/file_encrypt.yy b/scripts/scr_apothecarium/scr_apothecarium.yy similarity index 59% rename from scripts/file_encrypt/file_encrypt.yy rename to scripts/scr_apothecarium/scr_apothecarium.yy index b1d164dbe..de196db02 100644 --- a/scripts/file_encrypt/file_encrypt.yy +++ b/scripts/scr_apothecarium/scr_apothecarium.yy @@ -1,11 +1,11 @@ { "resourceType": "GMScript", "resourceVersion": "1.0", - "name": "file_encrypt", + "name": "scr_apothecarium", "isCompatibility": false, "isDnD": false, "parent": { - "name": "Sys", - "path": "folders/Scripts/Sys.yy", + "name": "Scripts", + "path": "folders/Scripts.yy", }, } \ No newline at end of file diff --git a/scripts/scr_apothecary_ground/scr_apothecary_ground.gml b/scripts/scr_apothecary_ground/scr_apothecary_ground.gml index e6780f4ff..bb3272365 100644 --- a/scripts/scr_apothecary_ground/scr_apothecary_ground.gml +++ b/scripts/scr_apothecary_ground/scr_apothecary_ground.gml @@ -1,69 +1,83 @@ -function apothecary_simple(){ - var company, v, unit, mar_loc, array_slot, is_healer, is_tech, key_val,veh_location; - var tech_spread = {}; - var apoth_spread = {}; - var unit_spread = {}; +enum eSystemLoc { + orbit, + planet1, + planet2, + planet3, + planet4 +} +function calculate_full_chapter_spread(){ obj_controller.command=0; - obj_controller.marines=0; - marines-=1; - for(company=0;company<11;company++){ - for (v=0;v<500;v++){ + obj_controller.marines=0; + var _mar_loc,is_healer,_is_tech,key_val,veh_location,array_slot,_unit; + var _tech_spread = {}; + var _apoth_spread = {}; + var _unit_spread = {}; + for(var company=0;company<11;company++){ + var _company_length = (array_length(obj_ini.name[company])); + for (var v=0; v < _company_length; v++) { key_val = ""; if (obj_ini.name[company][v]=="") then continue; - unit = fetch_unit([company, v]); - mar_loc = unit.marine_location(); - if (unit.base_group=="astartes"){ - if (unit.IsSpecialist()){ + _unit = fetch_unit([company, v]); + _mar_loc = _unit.marine_location(); + if (_unit.base_group=="astartes"){ + if (_unit.IsSpecialist()){ obj_controller.command++; } else { obj_controller.marines++; } } - - is_tech = (unit.IsSpecialist("forge") && unit.hp()>=10); - is_healer = (((unit.IsSpecialist("apoth",true) && unit.gear()=="Narthecium") || (unit.role()=="Sister Hospitaler")) && unit.hp()>=10); - if (mar_loc[2]!="warp"){ - if (mar_loc[0]=location_types.planet){ - array_slot = mar_loc[1]; - } else if (mar_loc[0] == location_types.ship){ - array_slot=0; + tech_points_used += _unit.equipment_maintenance_burden(); + _is_tech = (_unit.IsSpecialist("forge")); + if (_is_tech){ + add_forge_points_to_stack(_unit); + } + is_healer = (((_unit.IsSpecialist("apoth",true) && _unit.gear()=="Narthecium") || (_unit.role()=="Sister Hospitaler")) && _unit.hp()>=10); + if (is_healer){ + add_apoth_points_to_stack(_unit); + } + if (_mar_loc[2]!="Warp" && _mar_loc[2]!="Lost"){ + if (_mar_loc[0]=location_types.planet){ + array_slot = _mar_loc[1]; + } else if (_mar_loc[0] == location_types.ship){ + array_slot=eSystemLoc.orbit; } - key_val = mar_loc[2]; - } else if (mar_loc[0] == location_types.ship){ + key_val = _mar_loc[2]; + } else if (_mar_loc[0] == location_types.ship){ if instance_exists(obj_p_fleet){ with (obj_p_fleet){ - if (array_contains(capital_num, mar_loc[1]) || - array_contains(frigate_num, mar_loc[1])|| - array_contains(escort_num, mar_loc[1]) + if (array_contains(capital_num, _mar_loc[1]) || + array_contains(frigate_num, _mar_loc[1])|| + array_contains(escort_num, _mar_loc[1]) ){ - key_val=string(id); - array_slot=0; + key_val=$"{id}"; + array_slot=eSystemLoc.orbit; break; } } } } if (key_val!=""){ - if (! struct_exists(unit_spread, key_val)){ - unit_spread[$key_val] = [[],[],[],[],[]]; - tech_spread[$key_val] = [[],[],[],[],[]]; - apoth_spread[$key_val] = [[],[],[],[],[]]; + if (! struct_exists(_unit_spread, key_val)){ + _unit_spread[$key_val] = [[],[],[],[],[]]; + _tech_spread[$key_val] = [[],[],[],[],[]]; + _apoth_spread[$key_val] = [[],[],[],[],[]]; } - array_push(unit_spread[$key_val][array_slot] ,unit); - if (is_tech){ - array_push(tech_spread[$key_val][array_slot] ,unit); + array_push(_unit_spread[$key_val][array_slot] ,_unit); + if (_is_tech){ + array_push(_tech_spread[$key_val][array_slot] ,_unit); } if (is_healer) { - array_push(apoth_spread[$key_val][array_slot] ,unit); + array_push(_apoth_spread[$key_val][array_slot] ,_unit); } } key_val=""; if (v0){ if (obj_ini.veh_race[company][v]!=0){ - if(obj_ini.veh_lid[company][v]>0){ + if(obj_ini.veh_lid[company][v]>-1){ veh_location = obj_ini.veh_lid[company][v]; - if (obj_ini.ship_location[veh_location] == "warp"){ + var _ship_loc = obj_ini.ship_location[veh_location]; + if (_ship_loc == "Warp" || _ship_loc=="Lost"){ if instance_exists(obj_p_fleet){ with (obj_p_fleet){ if (array_contains(capital_num, veh_location) || @@ -71,13 +85,13 @@ function apothecary_simple(){ array_contains(escort_num, veh_location) ){ key_val=string(id); - array_slot=0; + array_slot=eSystemLoc.orbit; break; } } } } else if (obj_ini.ship_location[veh_location] != ""){ - array_slot=0; + array_slot=eSystemLoc.orbit; key_val=obj_ini.ship_location[veh_location]; } } @@ -88,165 +102,194 @@ function apothecary_simple(){ } } if (key_val!=""){ - if (! struct_exists(unit_spread, key_val)){ - unit_spread[$key_val] = [[],[],[],[],[]]; - tech_spread[$key_val] = [[],[],[],[],[]]; - apoth_spread[$key_val] = [[],[],[],[],[]]; + if (! struct_exists(_unit_spread, key_val)){ + _unit_spread[$key_val] = [[],[],[],[],[]]; + _tech_spread[$key_val] = [[],[],[],[],[]]; + _apoth_spread[$key_val] = [[],[],[],[],[]]; } - array_push(unit_spread[$key_val][array_slot] ,[company,v]); + array_push(_unit_spread[$key_val][array_slot] ,[company,v]); } } } } } - var locations = struct_get_names(unit_spread); + return [_tech_spread,_apoth_spread,_unit_spread] +} +function single_loc_point_data(){ + return { + heal_points_use : 0, + heal_points : 0, + forge_points_use : 0, + forge_points : 0, + }; +} +function system_point_data_spawn(){ + var _single_point_pos = single_loc_point_data(); + return [ + DeepCloneStruct(_single_point_pos), + DeepCloneStruct(_single_point_pos), + DeepCloneStruct(_single_point_pos), + DeepCloneStruct(_single_point_pos), + DeepCloneStruct(_single_point_pos), + ]; +} + +function apothecary_simple(){ + var _unit; + var _spreads = chapter_spread(); + var _tech_spread = _spreads[0]; + var _apoth_spread = _spreads[1]; + var _unit_spread = _spreads[2]; + forge_string += $"Equipment Maintenance : -{tech_points_used}#"; + //marines-=1; + + var _locations = struct_get_names(_unit_spread); + var cur_apoths; + with (obj_star){ - for (i=0;i 0) { + var _training_ground = system_feature_bool(self, P_features.Recruiting_World); + if (_training_ground){ + obj_controller.recruiting = 0; + obj_controller.income_recruiting = 0; + scr_alert("red", "recruiting", "The Chapter has run out of gene-seed!", 0, 0); + } } } } - var cur_units, cur_apoths, cur_techs, total_heal_points, total_tech_points, veh_health, points_spent, cur_system, features; - var p, i, a; + + var cur_units, cur_techs, _loc_heal_points, veh_health, points_spent, cur_system, features; var total_bionics = scr_item_count("Bionics"); - for (i=0;i0){ - if (array_length(unit)>1){ - while (points_spent<10 && obj_ini.veh_hp[unit[0]][unit[1]]<100 && total_tech_points>0){ + _unit = cur_units[a]; + if (is_array(_unit) && _loc_forge_points>0){ + if (array_length(_unit)>1){ + var _role = obj_ini.veh_role[_unit[0]][_unit[1]]; + if (_role=="Land Raider"){ + forge_veh_maintenance.land_raider = struct_exists(forge_veh_maintenance, "land_raider") ?forge_veh_maintenance.land_raider + 1 : 1; + _loc_forge_points--; + tech_points_used++; + } else if (array_contains(["Rhino","Predator", "Whirlwind"],_role)){ + forge_veh_maintenance.small_vehicles = struct_exists(forge_veh_maintenance, "small_vehicles") ?forge_veh_maintenance.small_vehicles + 0.2 :0.2; + _loc_forge_points-=0.2; + tech_points_used+=0.2; + } + while (points_spent<10 && obj_ini.veh_hp[_unit[0]][_unit[1]]<100 && _loc_forge_points>0){ points_spent++; - obj_ini.veh_hp[unit[0]][unit[1]]++; - total_tech_points--; + if (turn_end){ + obj_ini.veh_hp[_unit[0]][_unit[1]]++; + } + forge_veh_maintenance.repairs++; + _loc_forge_points--; + tech_points_used++; } } - } else if (is_struct(unit)){ - if (unit.hp() < unit.max_health()){ - if (unit.armour() != "Dreadnought"){ - if (unit.hp()>0){ - if (total_heal_points >0){ - unit.healing(true); - total_heal_points--; + } else if (is_struct(_unit)){ + _loc_forge_points -= _unit.equipment_maintenance_burden(); + if (_unit.hp() < _unit.max_health()){ + if (_unit.armour() != "Dreadnought"){ + if (_unit.hp()>0){ + if (_loc_heal_points >0){ + if (turn_end){ + _unit.healing(true); + } + _loc_heal_points--; + apothecary_points_used--; } else { - unit.healing(false); + if (turn_end){ + _unit.healing(false); + } } - } else if (total_heal_points>0 && total_tech_points>=3 && unit.bionics<10){ - unit.add_bionics(); - total_heal_points--; - total_tech_points-=3; + } else if (_loc_heal_points>0 && _loc_forge_points>=3 && _unit.bionics<10){ + _unit.add_bionics(); + _loc_heal_points--; + apothecary_points_used--; + tech_points_used++; + _loc_forge_points--; } } else { - if (total_heal_points>0 && total_tech_points>=3 && unit.hp()>0){ - unit.healing(true); - total_heal_points--; - total_tech_points-=3; + if (_loc_heal_points>0 && _loc_forge_points>=3 && _unit.hp()>0){ + if (turn_end){ + _unit.healing(true); + } + _loc_heal_points--; + apothecary_points_used--; + tech_points_used+=3; + _loc_forge_points-=3; } } } } } - if (cur_system!="" && p>0){ + _point_breakdown.heal_points_use = _point_breakdown.heal_points - _loc_heal_points; + _point_breakdown.forge_points_use = _point_breakdown.forge_points - _loc_forge_points; + if (cur_system!=""){ + point_breakdown.systems[$ cur_system.name][p] = DeepCloneStruct(_point_breakdown); + } else if (p==0 && (string_count("ref instance", _cur_loc))){ + try { + var _instance_int = real(string_replace(_cur_loc, "ref instance ", "")); + if (instance_exists(_instance_int)){ + var _instance = _instance_int; + _instance.point_breakdown = DeepCloneStruct(_point_breakdown); + } + }catch(_exception) { + handle_exception(_exception); + } + } + if (cur_system!="" && p>0 && turn_end){ with (cur_system){ if (array_length(p_feature[p])!=0){ - var engineer_count=array_length(cur_techs); - if (planet_feature_bool(p_feature[p],P_features.Starship)==1 && engineer_count>0){ - - var starship = p_feature[p][search_planet_features(p_feature[p],P_features.Starship)[0]]; - var engineer_score_start = starship.engineer_score; - if (starship.engineer_score<2000){ - for (var v=0;v0) and (starship.funds_spent=target_spend) and(starship.engineer_score>=2000){// u2=tar; - delete_features(cur_system.p_feature[p],P_features.Starship); - - var locy=$"{name} {scr_roman_numerals()[p-1]}"; - - var flit=instance_create(cur_system.x+24,cur_system.y-24,obj_p_fleet); - var s=0,ship_names="",new_name="",last_ship=0; - for(s=1;s<=40;s++){ - if (last_ship=0) and (obj_ini.ship[s]="") then last_ship=s; - }; - - new_name="Slaughtersong"; - - obj_ini.ship[last_ship]=new_name; - obj_ini.ship_uid[last_ship]=floor(random(99999999))+1; - obj_ini.ship_owner[last_ship]=1; - obj_ini.ship_size[last_ship]=3; - obj_ini.ship_location[last_ship]=name; - obj_ini.ship_leadership[last_ship]=100; - - obj_ini.ship_class[last_ship]="Slaughtersong"; - - obj_ini.ship_hp[last_ship]=2400; - obj_ini.ship_maxhp[last_ship]=2400; - obj_ini.ship_conditions[last_ship]=""; - obj_ini.ship_speed[last_ship]=25; - obj_ini.ship_turning[last_ship]=60; - obj_ini.ship_front_armour[last_ship]=8; - obj_ini.ship_other_armour[last_ship]=8; - obj_ini.ship_weapons[last_ship]=4; - obj_ini.ship_shields[last_ship]=24; - obj_ini.ship_wep[last_ship,1]="Lance Battery"; - ship_wep_facing[last_ship,1]="most"; - obj_ini.ship_wep_condition[last_ship,1]=""; - obj_ini.ship_wep[last_ship,2]="Lance Battery"; - ship_wep_facing[last_ship,2]="most"; - obj_ini.ship_wep_condition[last_ship,2]=""; - obj_ini.ship_wep[last_ship,3]="Lance Battery"; - ship_wep_facing[last_ship,3]="most"; - obj_ini.ship_wep_condition[last_ship,3]=""; - obj_ini.ship_wep[last_ship,4]="Plasma Cannon"; - ship_wep_facing[last_ship,4]="front"; - obj_ini.ship_wep_condition[last_ship,4]=""; - obj_ini.ship_capacity[last_ship]=800; - obj_ini.ship_carrying[last_ship]=0; - obj_ini.ship_contents[last_ship]=""; - obj_ini.ship_turrets[last_ship]=8; - - flit.capital[1]=obj_ini.ship[last_ship]; - flit.capital_number=1; - flit.capital_num[1]=last_ship; - flit.capital_uid[1]=obj_ini.ship_uid[last_ship]; - flit.oribiting = cur_system.id; - - scr_popup($"Ancient Ship Restored",$"The ancient ship within the ruins of {locy} has been fully repaired. It is determined to be a Slaughtersong vessel and is bristling with golden age weaponry and armour. Your {string(obj_ini.role[100][16])}s are excited; the Slaughtersong is ready for it's maiden voyage, at your command.","",""); - } + var _planet_data = new PlanetData(p, self); + _planet_data.recover_starship(cur_techs); + if (_planet_data.planet_training(_loc_heal_points)){ + } } } @@ -257,4 +300,3 @@ function apothecary_simple(){ - diff --git a/scripts/scr_array_functions/scr_array_functions.gml b/scripts/scr_array_functions/scr_array_functions.gml index 7c81f8846..934715764 100644 --- a/scripts/scr_array_functions/scr_array_functions.gml +++ b/scripts/scr_array_functions/scr_array_functions.gml @@ -23,14 +23,38 @@ function array_sum(choice_array,start_value=0, offset=0,length=0){ return array_reduce(choice_array,arraysum,start_value,offset,length) } +function array_join(){ + var new_array = []; + var add_array; + for (var i = 0; i < argument_count; i ++) + { + add_array = argument[i]; + for (var r=0;r 0) or(new_combat.battle_special == "space_hulk") or(string_count("chaos_meeting", new_combat.battle_special) > 0) { - if (string_count("Dread", obj_ini.armour[company][v]) > 0) then okay = -1; - } - if (string_count("spyrer", new_combat.battle_special) > 0) { - if (okay == 1) and(sofar > 2) then okay = -1; - } - if (okay <= -1) then new_combat.fighting[company][v] = 0; - - //Normal and other battle cases checks go here - else if (okay >= 0) { - if (instance_exists(obj_ground_mission)) { //Exploring ruins ambush case - if (obj_ini.loc[company][v] == required_location) and(unit.planet_location == _target_location) { - okay = 1; - } else { - continue; - } - } else if (!instance_exists(obj_drop_select)) { // Only when attacked, normal battle - if (_is_planet) and(obj_ini.loc[company][v] == required_location) and(unit.planet_location == _target_location) then okay = 1; - else if (!_is_planet) and(unit.ship_location == _target_location) then okay = 1; - if (instance_exists(obj_temp_meeting)) { - meeting = true; - if (company == 0) and(v <= obj_temp_meeting.dudes) and(obj_temp_meeting.present[v] == 1) then okay = 1; - else if (company > 0) or(v > obj_temp_meeting.dudes) then okay = 0; - } - } else if (instance_exists(obj_drop_select)) { // When attacking, normal battle - //If not fighting (obj_drop_select pre-check), we skip the unit - if (obj_drop_select.fighting[company][v] == 0) then okay = 0; - - else if (obj_drop_select.attack == 1) { - if (_is_planet) and(obj_ini.loc[company][v] == required_location) and(unit.planet_location == _target_location) then okay = 1; - else if (!_is_planet) and(unit.ship_location == _target_location) then okay = 1; - } else if (obj_drop_select.attack != 1) { - //Related to defensive battles (¿?). Without the above check, it duplicates marines on offensive ones. - if (obj_drop_select.fighting[company][v] == 1) and(unit.ship_location == _target_location) then okay = 1; - } + //Special (okay -1) battle cases go here + var _not_dread_advised = (_spyrer_mission > 0) or(new_combat.battle_special == "space_hulk") or(string_count("chaos_meeting", new_combat.battle_special) > 0); + if (_not_dread_advised) { + var _u_armour = unit.get_armour_data(); + if (is_struct(_u_armour)){ + if (_u_armour.has_tag("dreadnought")){ + okay = -1; } } + } + if (_spyrer_mission > 0) { + if (okay == 1) and(array_length(new_combat.unit_struct)) then okay = -1; + } + if (okay <= -1) then new_combat.fighting[company][v] = 0; - // Start adding unit to battle - if (okay >= 1) { - var man_size = 1; - - //Same as co/company and v, but with extra comprovations in case of a meeting (meeting?) - var cooh, va; - cooh = 0; - va = 0; - - if (!meeting) { - cooh = company; - va = v; - }else { - if (v <= obj_temp_meeting.dudes) { - cooh = obj_temp_meeting.company[v]; - va = obj_temp_meeting.ide[v]; - } - } - - var col = 0,targ = 0,moov = 0; - _u_role = unit.role(); - - if (new_combat.battle_special == "space_hulk") then new_combat.player_starting_dudes++; - if (unit.role() = obj_ini.role[100][18]) { - col = obj_controller.bat_tactical_column; //sergeants - new_combat.sgts++; - }else if (unit.role() = obj_ini.role[100, 19]){ - col = obj_controller.bat_veteran_column; - new_combat.vet_sgts++; - } - if (unit.role() = obj_ini.role[100, 12]) { //scouts - col = obj_controller.bat_scout_column; - new_combat.scouts++; - - }else if (array_contains( [obj_ini.role[100][8], $"{obj_ini.role[100, 15]} Aspirant", $"{obj_ini.role[100, 14]} Aspirant"] , unit.role())) { - col = obj_controller.bat_tactical_column; //tactical_marines - new_combat.tacticals++; - }else if (unit.role() = obj_ini.role[100, 3]){ //veterans and veteran sergeants - col = obj_controller.bat_veteran_column; - new_combat.veterans++; - }else if (unit.role() = obj_ini.role[100, 9]) { //devastators - col = obj_controller.bat_devastator_column; - new_combat.devastators++; - }else if(unit.role() = obj_ini.role[100, 10]){ //assualt marines - col = obj_controller.bat_assault_column; - new_combat.assaults++; - - //librarium roles - - }else if (unit.IsSpecialist("libs",true)){ - col = obj_controller.bat_librarian_column; //librarium - new_combat.librarians++; - moov = 1; - }else if (unit.role() = obj_ini.role[100, 16]) { //techmarines - col = obj_controller.bat_techmarine_column; - new_combat.techmarines++; - moov = 2; - } else if (unit.role() = obj_ini.role[100, 2]) { //honour guard - col = obj_controller.bat_honor_column; - new_combat.honors++; - - } else if (unit.IsSpecialist("dreadnoughts")){ - col = obj_controller.bat_dreadnought_column; //dreadnoughts - new_combat.dreadnoughts++; - }else if (unit.role() = obj_ini.role[100][4]) { //terminators - col = obj_controller.bat_terminator_column; - new_combat.terminators++; - } - - if (moov > 0) { - if ((moov = 1) and(obj_controller.command_set[8] = 1)) or((moov = 2) and(obj_controller.command_set[9] = 1)) { - if (company >= 2) then col = obj_controller.bat_tactical_column; - if (company = 10) then col = obj_controller.bat_scout_column; - if (obj_ini.mobi[cooh][va] = "Jump Pack") { - col = obj_controller.bat_assault_column; - } - } - } - - if (unit.role() = obj_ini.role[100, 15]) or(unit.role() = obj_ini.role[100, 14]) or(string_count("Aspirant", unit.role()) > 0) { - if (unit.role() = string(obj_ini.role[100, 14]) + " Aspirant") { - col = obj_controller.bat_tactical_column; - new_combat.tacticals++; - } - - if (unit.role() = obj_ini.role[100, 15]) then new_combat.apothecaries++; - if (unit.role() = obj_ini.role[100, 14]) { - new_combat.chaplains++; - if (new_combat.big_mofo > 5) then new_combat.big_mofo = 5; - } - - col = obj_controller.bat_tactical_column; - if (obj_ini.armour[cooh][va] = "Terminator Armour") or(obj_ini.armour[cooh][va] = "Tartaros Armour") { - col = obj_controller.bat_terminator_column; - } - if (company = 10) then col = obj_controller.bat_scout_column; - } - - if (unit.role() = obj_ini.role[100, 5]) or(unit.role() = obj_ini.role[100][11]) or(unit.role() = obj_ini.role[100, 7]) { - if (unit.role() = obj_ini.role[100, 5]) { - new_combat.captains++; - if (new_combat.big_mofo > 5) then new_combat.big_mofo = 5; - } - if (unit.role() = obj_ini.role[100][11]) then new_combat.standard_bearers++; - if (unit.role() = obj_ini.role[100, 7]) then new_combat.champions++; - - //if (company = 1) { - // col = obj_controller.bat_veteran_column; - // if (obj_ini.armour[cooh][va] = "Terminator Armour") then col = obj_controller.bat_terminator_column; - // if (obj_ini.armour[cooh][va] = "Tartaros Armour") then col = obj_controller.bat_terminator_column; - //} - if (company >= 2) then col = obj_controller.bat_tactical_column; - if (company = 10) then col = obj_controller.bat_scout_column; - if (obj_ini.mobi[cooh][va] = "Jump Pack") then col = obj_controller.bat_assault_column; - } - - if (unit.role() = "Chapter Master") { - col = obj_controller.bat_command_column; - new_combat.important_dudes++; - new_combat.big_mofo = 1; - if (string_count("0", obj_ini.spe[cooh][va]) > 0) then new_combat.chapter_master_psyker = 1; - else { - new_combat.chapter_master_psyker = 0; - } - } - if (unit.IsSpecialist("heads")){ - col = obj_controller.bat_command_column; - new_combat.important_dudes++; - }; - if (new_combat.big_mofo > 2) then new_combat.big_mofo = 2; - if (new_combat.big_mofo > 3) then new_combat.big_mofo = 3; - if (unit.squad!="none"){ - squad = obj_ini.squads[unit.squad]; - switch(squad.formation_place){ - case "assault": - col = obj_controller.bat_assault_column; - column_decided=true; - break; - case "veteran": - col = obj_controller.bat_veteran_column; - column_decided=true; - break; - case "tactical": - col = obj_controller.bat_tactical_column; - column_decided=true; - break; - case "devastator": - col = obj_controller.bat_devastator_column; - column_decided=true; - break; - case "terminator": - col = obj_controller.bat_terminator_column; - column_decided=true; - break; - case "command": - col = obj_controller.bat_command_column; - column_decided=true; - break; - } - } - if (col = 0) then col = obj_controller.bat_hire_column; - - targ = instance_nearest(col * 10, 240, obj_pnunit); - with (targ){ - scr_add_unit_to_roster(unit); - } - - if (unit.role() = "Death Company") { // Ahahahahah - var really; - really = false; - if (string_count("Dreadnought", targ.marine_armour[targ.men]) > 0) then really = true; - if (really = false) then new_combat.thirsty++; - if (really = true) then new_combat.really_thirsty++; - col = max(obj_controller.bat_assault_column, obj_controller.bat_command_column, obj_controller.bat_honor_column, obj_controller.bat_dreadnought_column, obj_controller.bat_veteran_column); + //Normal and other battle cases checks go here + else if (okay >= 0) { + if (instance_exists(obj_ground_mission)) { //Exploring ruins ambush case + if (obj_ini.loc[company][v] == required_location) and(unit.planet_location == _target_location) { + okay = 1; + } else { + continue; } - // info for ai targetting armour and what they think is best. TODO find out what marine_ranged and attack does - - // marine_attack[i]=1; - // marine_ranged[i]=1; - // marine_defense[i]=1; + } else if (!instance_exists(obj_drop_select)) { // Only when attacked, normal battle + if (_is_planet) and(obj_ini.loc[company][v] == required_location) and(unit.planet_location == _target_location) then okay = 1; + else if (!_is_planet) and(unit.ship_location == _target_location) then okay = 1; - if (obj_ini.mobi[cooh][va] = "Bike") { - man_Size = 3; - } - if (obj_ini.mobi[cooh][va] = "Jump Pack") { - man_Size = 2; + if (instance_exists(obj_temp_meeting)) { + _meeting = true; + if (company == 0) and(v <= obj_temp_meeting.dudes) and(obj_temp_meeting.present[v] == 1) then okay = 1; + else if (company > 0) or(v > obj_temp_meeting.dudes) then okay = 0; } + } else if (instance_exists(obj_drop_select)) { // When attacking, normal battle + //If not fighting (obj_drop_select pre-check), we skip the unit + if (obj_drop_select.fighting[company][v] == 0) then okay = 0; - //evaluates if there is a limit on the size of men that can be in a battle and only adds the allowable number to roster - if (new_combat.man_size_limit == 0) { - new_combat.fighting[cooh][va] = 1; - sofar++; - } else { - if (man_size_count + man_size <= new_combat.man_size_limit) { - new_combat.fighting[cooh][va] = 1; - sofar++; - man_size_count += man_size; - if (man_size_count == new_combat.man_size_limit) { - man_limit_reached = true; - } - } + else if (obj_drop_select.attack == 1) { + if (_is_planet) and(obj_ini.loc[company][v] == required_location) and(unit.planet_location == _target_location) then okay = 1; + else if (!_is_planet) and(unit.ship_location == _target_location) then okay = 1; + } else if (obj_drop_select.attack != 1) { + //Related to defensive battles (¿?). Without the above check, it duplicates marines on offensive ones. + if (obj_drop_select.fighting[company][v] == 1) and(unit.ship_location == _target_location) then okay = 1; } } + } - // Vehicle checks - if (v <= 100) and(string_count("spyrer", new_combat.battle_special) = 0) and(company <= 10) and(meeting = false) { - var vokay; - vokay = 0; + // Start adding unit to battle + if (okay >= 1) { - if (obj_ini.veh_race[company][v] != 0) and(obj_ini.veh_loc[company][v] = required_location) and(obj_ini.veh_wid[company][v] = _target_location) then vokay = 1; + add_unit_to_battle(unit, _meeting); + // Vehicle checks + } + } + for (v=0;v 0) then vokay = 1; + var _veh_loc = obj_ini.veh_loc[company][v]; + var _veh_planet = obj_ini.veh_wid[company][v]; + var _veh_race = obj_ini.veh_race[company][v]; + + if (_veh_race) and(_veh_loc = required_location) and(_veh_planet = _target_location) then vokay = 1; + if (_is_planet) and(new_combat.local_forces = 1) { + var world_name, p_num; + world_name = ""; + p_num = obj_controller.selecting_planet; if (instance_exists(obj_drop_select)) { - if (obj_drop_select.attack = 0) then vokay = 0; + world_name = obj_drop_select.p_target.name; } + if (_veh_race) and(_veh_loc = world_name) and(_veh_planet = p_num) then vokay = 2; + } + if (!_is_planet) and(obj_ini.veh_lid[company][v] = _target_location) and(obj_ini.veh_hp[company][v] > 0) then vokay = 1; - - // if (obj_ncombat.veh_fighting[company,v]=1) then vokay=2;// Fuck on me, AI - - if (vokay >= 1) and(new_combat.dropping = 0) { - new_combat.veh_fighting[company][v] = 1; - - var col = 1, targ = 0; - - switch (obj_ini.veh_role[company][v]){ - case "Rhino": - col = obj_controller.bat_rhino_column; - new_combat.rhinos++; - break; - case "Predator": - col = obj_controller.bat_predator_column; - new_combat.predators++; - break; - case "Land Raider": - col = obj_controller.bat_landraider_column; - new_combat.land_raiders++; - break; - case "Whirlwind": - col = 1; - new_combat.whirlwinds++; - break; - } - - targ = instance_nearest(col * 10, 240 / 2, obj_pnunit); - targ.veh++; - targ.veh_co[targ.veh] = company; - targ.veh_id[targ.veh] = v; - targ.veh_type[targ.veh] = obj_ini.veh_role[company][v]; - targ.veh_wep1[targ.veh] = obj_ini.veh_wep1[company][v]; - targ.veh_wep2[targ.veh] = obj_ini.veh_wep2[company][v]; - targ.veh_wep3[targ.veh] = obj_ini.veh_wep3[company][v]; - targ.veh_upgrade[targ.veh] = obj_ini.veh_upgrade[company][v]; - targ.veh_acc[targ.veh] = obj_ini.veh_acc[company][v]; - if (vokay = 2) then targ.veh_local[targ.veh] = 1; + if (instance_exists(obj_drop_select)) { + if (obj_drop_select.attack = 0) then vokay = 0; + } - if (obj_ini.veh_role[company][v] = "Land Speeder") { - targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 3; - targ.veh_hp_multiplier[targ.veh] = 3; - targ.veh_ac[targ.veh] = 30; - } - if (obj_ini.veh_role[company][v] = "Rhino") or(obj_ini.veh_role[company][v] = "Whirlwind") { - targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 5; - targ.veh_hp_multiplier[targ.veh] = 5; - targ.veh_ac[targ.veh] = 40; - } - if (obj_ini.veh_role[company][v] = "Predator") { - targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 6; - targ.veh_hp_multiplier[targ.veh] = 6; - targ.veh_ac[targ.veh] = 45; - } - if (obj_ini.veh_role[company][v] = "Land Raider") { - targ.veh_hp[targ.veh] = obj_ini.veh_hp[company][v] * 8; - targ.veh_hp_multiplier[targ.veh] = 8; - targ.veh_ac[targ.veh] = 50; - } + // if (obj_ncombat.veh_fighting[company,v]=1) then vokay=2;// Fuck on me, AI - // STC Bonuses - if (targ.veh_type[targ.veh] != "") { - if (obj_controller.stc_bonus[3] = 1) { - targ.veh_hp[targ.veh] = round(targ.veh_hp[targ.veh] * 1.1); - targ.veh_hp_multiplier[targ.veh] = targ.veh_hp_multiplier[targ.veh] * 1.1; - } - if (obj_controller.stc_bonus[3] = 2) { - //TODO reimplement STC bonus for ranged vehicle weapons - //veh ranged isn't a thing sooooo.... oh well - //targ.veh_ranged[targ.veh] = targ.veh_ranged[targ.veh] * 1.05; - } - if (obj_controller.stc_bonus[3] = 5) { - targ.veh_ac[targ.veh] = round(targ.veh_ac[targ.veh] * 1.1); - } - if (obj_controller.stc_bonus[4] = 1) { - targ.veh_hp[targ.veh] = round(targ.veh_hp[targ.veh] * 1.1); - targ.veh_hp_multiplier[targ.veh] = targ.veh_hp_multiplier[targ.veh] * 1.1; - } - if (obj_controller.stc_bonus[4] = 2) { - targ.veh_ac[targ.veh] = round(targ.veh_ac[targ.veh] * 1.1); - } - } - } + if (vokay >= 1) and(new_combat.dropping = 0) { + add_vehicle_to_battle(company, v) } } + } } } diff --git a/scripts/scr_boarding_actions/scr_boarding_actions.gml b/scripts/scr_boarding_actions/scr_boarding_actions.gml index fcd9b9c1c..081d027fc 100644 --- a/scripts/scr_boarding_actions/scr_boarding_actions.gml +++ b/scripts/scr_boarding_actions/scr_boarding_actions.gml @@ -1,8 +1,7 @@ function create_boarding_craft(target_ship){ var first=0,o=1; - repeat(500){ - o+=1; + for (var o=0;o=10) then bear.apothecary+=1; } } - o+=1; + if (bear.boarders>=20){ + break; + } } bear.apothecary_had=bear.apothecary; diff --git a/scripts/scr_bomb_world/scr_bomb_world.gml b/scripts/scr_bomb_world/scr_bomb_world.gml index d66664e31..a66c2f156 100644 --- a/scripts/scr_bomb_world/scr_bomb_world.gml +++ b/scripts/scr_bomb_world/scr_bomb_world.gml @@ -104,7 +104,7 @@ function scr_bomb_world(star_system, planet_number, bombard_target_faction, bomb reduced_bombard_score=bombard_ment_power/3; strength_reduction=0; - + var i=reduced_bombard_score; roll=0; diff --git a/scripts/scr_buttons/scr_buttons.gml b/scripts/scr_buttons/scr_buttons.gml index 355e85c1b..641e4caa0 100644 --- a/scripts/scr_buttons/scr_buttons.gml +++ b/scripts/scr_buttons/scr_buttons.gml @@ -65,9 +65,10 @@ function UnitButtonObject() constructor{ tooltip = ""; static update = function(data){ - updaters = struct_get_names(data); - for (var i=0;i1){ + if (scr_hit(drop_down_area)){ + current_target=true; + var roll_down_offset=4+string_height(selection); + for (var col = 0;col 0.5) state_alpha -= 0.05; + } + else{ + if (state_alpha < 1) state_alpha += 0.05; + if (hover()) { + if (hover_alpha > 0.8) hover_alpha -= 0.02; // Decrease state_alpha when hovered + } else { + if (hover_alpha < 1) hover_alpha += 0.03; // Increase state_alpha when not hovered + } + } + + total_alpha = state_alpha * hover_alpha; + draw_rectangle_color_simple(x1, y1, x1 + width, y1 + str1_h, 1, button_color, total_alpha); + draw_set_halign(text_halign); + draw_set_valign(fa_top); + draw_text_color_simple(text_x, text_y, str1, text_color, total_alpha); + draw_set_alpha(1); + draw_set_halign(fa_left); + }; +} + +function InteractiveButton() constructor { + x1 = 0; + y1 = 0; + x2 = 0; + y2 = 0; + str1 = ""; + inactive_tooltip = ""; + tooltip = ""; + width = 0; + height = 0; + state_alpha = 1; + hover_alpha = 1; + active = true; + text_halign = fa_left; + text_color = c_gray; + button_color = c_gray; + + update = function () { + if (width == 0) { + width = string_width(str1) + 4; + } + if (height == 0) { + height = string_height(str1) + 4; + } + x2 = x1 + width; + y2 = y1 + height; + }; + + hover = function() { + return (scr_hit(x1, y1, x2, y2)); + }; + + clicked = function() { + if (hover() && scr_click_left()) { + if (!active){ + audio_play_sound(snd_error, 10, false, 1); + return false; + } else { + audio_play_sound(snd_click_small, 10, false, 1); + return true; + } + } else { + return false; + } + }; + + draw = function() { + var str1_h = string_height(str1); + var text_padding = width * 0.03; + var text_x = x1 + text_padding; + var text_y = y1 + text_padding; + var total_alpha; + + if (text_halign == fa_center) { + text_x = x1 + (width / 2); + } + + if (!active){ + if (state_alpha > 0.5) state_alpha -= 0.05; + if (inactive_tooltip != "" && hover()) { + tooltip_draw(inactive_tooltip); + } + } else{ + if (state_alpha < 1) state_alpha += 0.05; + if (hover()) { + if (hover_alpha > 0.8) hover_alpha -= 0.02; // Decrease state_alpha when hovered + if (tooltip != "") { + tooltip_draw(tooltip); + } + } else { + if (hover_alpha < 1) hover_alpha += 0.03; // Increase state_alpha when not hovered + } + } + + total_alpha = state_alpha * hover_alpha; + draw_rectangle_color_simple(x1, y1, x1 + width, y1 + str1_h, 1, button_color, total_alpha); + draw_set_halign(text_halign); + draw_set_valign(fa_top); + draw_text_color_simple(text_x, text_y, str1, text_color, total_alpha); + draw_set_alpha(1); + draw_set_halign(fa_left); + }; } \ No newline at end of file diff --git a/scripts/scr_chapter/scr_chapter.gml b/scripts/scr_chapter/scr_chapter.gml deleted file mode 100644 index 475b15cc7..000000000 --- a/scripts/scr_chapter/scr_chapter.gml +++ /dev/null @@ -1,351 +0,0 @@ -function scr_chapter(chosen_chapter) { - - // chosen_chapter = chapter - - // Assigns premade Chapter settings - - if (cooldown<=0){click=1; - cooldown=8;psy_powers="default"; - - company_title[0]="";var i;i=0;repeat(40){i+=1;company_title[i]="";} - - if (chosen_chapter="White Scars"){founding="N/A"; - librarian_name="Stormseer"; - } - - - var i;i=-1; - repeat(21){i+=1; - world[i]=""; - world_type[i]=""; - world_feature[i]=""; - } - - - - if (chosen_chapter="Dark Angels"){founding="N/A"; - selected_chapter=1;chapter_name=chosen_chapter;icon=1;icon_name="da";fleet_type=2;maximum_size=10;purity=8;stability=10;cooperation=5; - custom=0;points_spent=0;points_total=0;keyboard_string=chosen_chapter;flash=0;adv_selecting=0;advantage1=8;adv1="Enemy: Fallen"; - advantage2=0;adv2="";advantage3=0;adv3="";disadvantage1=5;dis1="Never Forgive";disadvantage2=0;dis2="";disadvantage3=0;dis3=""; - battle_cry="Repent! For tomorow you may die";monastery_name="The Rock";master_name="Azreal"; - main_color="Caliban Green";secondary_color="None";lens_color="Red";weapon_color="Black";initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine"; - veteran_name="Veteran";devastator_name="Devastator Marine";assault_name="Assault Marine";apothecary_name="Apothecary";librarian_name="Librarian"; - tech_name="Techmarine";chaplain_name="Chaplain";role[100][2]="Honour Guard";dreadnought_name="Dreadnought";captain_name="Captain"; - master_melee=3;master_ranged=999;forbidden_unit1="";forbidden_unit2="";forbidden_unit3=""; - home_type="Dead";recruiting_type="Death";recruiting_name="Kimmeria";home_name="The Rock";lord_admiral_name=global.name_generator.generate_space_marine_name(); - chief_librarian_name="Ezekial";high_chaplain_name="Sapphon";high_apothecary_name=global.name_generator.generate_space_marine_name();forge_master_name=""; - chaplain_melee=1;chaplain_ranged=1;apothecary_melee=1;apothecary_ranged=1;sergeant_melee=1; - sergeant_ranged=1;scout_melee=2;scout_ranged=1;honor_melee=3;honor_mobi=1;honor_ranged=1; - successor_chapters=9;progenitor_disposition=0;astartes_disposition=15;imperium_disposition=16;guard_disposition=16; - inquisition_disposition=15;ecclesiarchy_disposition=15;other1_disposition=11;other1="";other2_disposition=15;other2="Mechanicus"; - mutations=0;mutations_selected=0;mutation=""; - - recruit_trial=eTrials.BLOODDUEL; - company_title[1]="Deathwing";company_title[2]="Ravenwing"; - } - if (chosen_chapter="Duke Test"){founding="N/A"; - selected_chapter=1;chapter_name=chosen_chapter;icon=1;icon_name="da";fleet_type=1;maximum_size=10;purity=8;stability=10;cooperation=5; - custom=0;points_spent=0;points_total=0;keyboard_string=chosen_chapter;flash=0;adv_selecting=0;advantage1=8;adv1="Enemy: Fallen"; - advantage2=0;adv2="";advantage3=0;adv3="";disadvantage1=5;dis1="Never Forgive";disadvantage2=0;dis2="";disadvantage3=0;dis3=""; - battle_cry="Repent! For tomorow you may die";monastery_name="Bananajam";master_name="Azreal"; - main_color="Dark Green";secondary_color="None";lens_color="Red";weapon_color="Black";initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine"; - veteran_name="Veteran";devastator_name="Devastator Marine";assault_name="Assault Marine";apothecary_name="Apothecary";librarian_name="Librarian"; - tech_name="Techmarine";chaplain_name="Chaplain";role[100][2]="Honour Guard";dreadnought_name="Dreadnought";captain_name="Captain"; - master_melee=3;master_ranged=999;forbidden_unit1="";forbidden_unit2="";forbidden_unit3=""; - home_type="Dead";recruiting_type="Death";recruiting_name="Kimmeria";home_name="The Rock";lord_admiral_name=global.name_generator.generate_space_marine_name(); - chief_librarian_name="Ezekial";high_chaplain_name="Sapphon";high_apothecary_name=global.name_generator.generate_space_marine_name();forge_master_name=""; - chaplain_melee=1;chaplain_ranged=1;apothecary_melee=1;apothecary_ranged=1;sergeant_melee=1; - sergeant_ranged=1;scout_melee=2;scout_ranged=1;honor_melee=3;honor_mobi=1;honor_ranged=1; - successor_chapters=9;progenitor_disposition=0;astartes_disposition=15;imperium_disposition=16;guard_disposition=16; - inquisition_disposition=15;ecclesiarchy_disposition=15;other1_disposition=11;other1="";other2_disposition=15;other2="Mechanicus"; - mutations=0;mutations_selected=0;mutation=""; - - recruit_trial=eTrials.BLOODDUEL; - company_title[1]="Deathwing";company_title[2]="Ravenwing"; - } - - - - if (chosen_chapter="Space Wolves"){founding="N/A"; - selected_chapter=3;chapter_name=chosen_chapter;icon=3;icon_name="sw";fleet_type=2;maximum_size=10;purity=8;stability=5;cooperation=5; - custom=0;points_spent=0;points_total=0;keyboard_string=chosen_chapter;flash=0;adv_selecting=0;advantage1=18;adv1="Melee Enthusiasts"; - advantage2=0;adv2="";advantage3=0;adv3="";disadvantage1=1;dis1="Black Rage";disadvantage2=11;dis2="Suspicious";disadvantage3=0;dis3=""; - battle_cry="For Russ and the Allfather";monastery_name="The Fang";master_name="Logan Grimnar"; - main_color="Light Blue";secondary_color="Black";lens_color="Black";weapon_color="Black"; - - initiate_name="Initiate"; - scout_name="Wolf Scout"; - tactical_name="Grey Hunter"; - veteran_name="Wolf Guard"; - devastator_name="Long Fang"; - assault_name="Blood Claw"; - apothecary_name="Wolf Priest"; - librarian_name="Rune Priest"; - tech_name="Iron Priest"; - chaplain_name="Wolf Priest"; - role[100][2]="Wolf Guard"; - captain_name="Wolf Lord"; - - master_melee=3;master_ranged=6;forbidden_unit1="Chaplain";forbidden_unit2="";forbidden_unit3=""; - home_type="Ice";recruiting_type="Ice";recruiting_name="Fenrir";home_name="Fenrir";lord_admiral_name="Engir Krakendoom"; - chief_librarian_name="Njal Stormcaller";high_chaplain_name="Ulrik the Slaye";high_apothecary_name="Ranek Icewalker";forge_master_name="Krom Dragongaz"; - chaplain_melee=1;chaplain_ranged=1;apothecary_melee=1;apothecary_ranged=1;sergeant_melee=1; - sergeant_ranged=1;scout_melee=2;scout_ranged=1;honor_melee=1;honor_mobi=1;honor_ranged=2; - successor_chapters=1;progenitor_disposition=0;astartes_disposition=15;imperium_disposition=16;guard_disposition=18; - inquisition_disposition=15;ecclesiarchy_disposition=13;other1_disposition=12;other1="Imperial Fists";other2_disposition=15;other2="Mechanicus"; - mutations=0;mutations_selected=0;mutation="";psy_powers="rune Magick"; - - recruit_trial=eTrials.EXPOSURE; - company_title[1]="Champions of Fenris"; - company_title[2]="The Bloodmaws"; - company_title[3]="The Seawolves"; - company_title[4]="The Sons of Morkai"; - company_title[5]="The Red Moons"; - company_title[6]="The Deathwolves"; - company_title[7]="The Stormwolves"; - company_title[8]="The Ironwolves"; - company_title[9]="The Drakeslayers"; - company_title[10]="The Blackmanes"; - company_title[11]="The Firehowlers"; - company_title[12]="The Grimbloods"; - company_title[13]="The Wulfen"; - } - /* - if (chosen_chapter="Imperial Fists"){founding="N/A"; - selected_chapter=4;chapter_name="Imperial Fists";icon=4;fleet_type=2;maximum_size=8;purity=7;stability=10;cooperation=3; - custom=0;points_spent=0;points_total=0;keyboard_string="Imperial Fists";flash=0;adv_selecting=0;advantage1=11;adv1="Siege Masters"; - advantage2=3;adv2="Bolter Drilling";advantage3=0;adv3="";disadvantage1=0;dis1="";disadvantage2=0;dis2="";disadvantage3=0;dis3=""; - battle_cry="Primarch-Progenitor, to your glory and the glory of him on earth";master_name="Vorn Hagen";monastery_name=""; - main_color="Yellow";secondary_color="Yellow"; - lens_color="Red";weapon_color="Black";initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine"; - veteran_name="Veteran";devastator_name="Devastator Marine";assault_name="Assault Marine";apothecary_name="Apothecary";librarian_name="Librarian"; - tech_name="Techmarine";chaplain_name="Chaplain";role[100][2]="Honour Guard";dreadnought_name="Dreadnought";captain_name="Captain"; - master_melee=2;master_ranged=1;forbidden_unit1="";forbidden_unit2="";forbidden_unit3=""; - - home_name="Terra"; - } - - - */ - - - - if (chosen_chapter="Imperial Fists"){ - founding="N/A";selected_chapter=7;chapter_name="Imperial Fists";icon=4;icon_name="im"; - fleet_type=1;maximum_size=10;purity=7;stability=10;cooperation=8; - custom=0;points_spent=0;points_total=0;keyboard_string=chosen_chapter;flash=0;adv_selecting=0; - advantage1=16;advantage2=17;advantage3=0;adv1="Siege Masters";adv2="Slow and Purposeful";adv3=""; - disadvantage1=0;disadvantage2=0;disadvantage3=0;dis1="";dis2="";dis3=""; - battle_cry="Primarch-Progenitor, to your glory and the glory of him on earth!"; - monastery_name="Phalanx";master_name="Vorn Hagen"; - main_color="Dark Gold";secondary_color="Red";lens_color="Red";weapon_color="Black"; - initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine";veteran_name="Veteran"; - devastator_name="Devastator Marine";assault_name="Assault Marine";apothecary_name="Apothecary";librarian_name="Librarian"; - tech_name="Techmarine";chaplain_name="Chaplain";role[100][2]="Honour Guard";dreadnought_name="Dreadnought"; - captain_name="Captain";master_melee=1;master_ranged=1; - forbidden_unit1="";forbidden_unit2="";forbidden_unit3=""; - home_type="Hive";recruiting_type="Hive";recruiting_name="Terra-";home_name="Terra-"; - lord_admiral_name="Quirion Octavious";chief_librarian_name="Kurt Kempka";high_chaplain_name="Carnak Cassius"; - high_apothecary_name="Lakari";forge_master_name="Suprema Lysol Bane"; - chaplain_melee=1;chaplain_ranged=1;apothecary_melee=1;apothecary_ranged=1; - sergeant_melee=1;sergeant_ranged=1;scout_melee=2;scout_ranged=1; - honor_melee=1;honor_mobi=1;honor_ranged=1;successor_chapters=27; - progenitor_disposition=0;astartes_disposition=17;imperium_disposition=18;guard_disposition=18; - inquisition_disposition=16;ecclesiarchy_disposition=15;other1_disposition=12; - // other1="Imperial Fists";// - other2_disposition=15; - other2="Mechanicus";mutations=2;mutations_selected=2;mutation="Betcher's Gland|Sus-an Membrane|"; - betchers=1;membrane=1; - } - - - - - if (chosen_chapter="Blood Angels"){founding="N/A"; - selected_chapter=5;chapter_name="Blood Angels";icon=5;icon_name="ba";fleet_type=2;maximum_size=10;purity=10;stability=9;cooperation=7; - custom=0;points_spent=0;points_total=0;keyboard_string="Blood Angels";flash=0;adv_selecting=0;advantage1=18;adv1="Melee Enthusiasts"; - advantage2=0;adv2="";advantage3=0;adv3="";disadvantage1=1;dis1="Black Rage";disadvantage2=0;dis2="";disadvantage3=0;dis3=""; - battle_cry="For the Emperor and Sanguinius! Death! DEATH";monastery_name="Fortress of Baal";master_name="Dante"; - main_color="Red";secondary_color="Red";lens_color="Green";weapon_color="Black";initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine"; - veteran_name="Veteran";devastator_name="Devastator Marine";assault_name="Assault Marine";apothecary_name="Sanguinary Priest";librarian_name="Librarian"; - tech_name="Techmarine";chaplain_name="Chaplain";role[100][2]="Sanguinary Guard";dreadnought_name="Dreadnought";captain_name="Captain"; - master_melee=3;master_ranged=2;forbidden_unit1="";forbidden_unit2="";forbidden_unit3=""; - home_type="Desert";recruiting_type="Desert";recruiting_name="Baal";home_name="Baal";lord_admiral_name="Bellerophon"; - chief_librarian_name="Mephiston";high_chaplain_name="Astorath the Grim";high_apothecary_name=global.name_generator.generate_space_marine_name();forge_master_name="Incarael"; - chaplain_melee=1;chaplain_ranged=1;apothecary_melee=1;apothecary_ranged=1;sergeant_melee=1; - sergeant_ranged=1;scout_melee=2;scout_ranged=1;honor_melee=3;honor_mobi=2;honor_ranged=5; - successor_chapters=3;progenitor_disposition=0;astartes_disposition=17;imperium_disposition=18;guard_disposition=18; - inquisition_disposition=16;ecclesiarchy_disposition=15;other1_disposition=11;other1="";other2_disposition=15;other2="Mechanicus"; - mutations=0;mutations_selected=0;mutation=""; - - recruit_trial=eTrials.BLOODDUEL; - company_title[1]="Archangels"; - company_title[2]="The Blooded"; - company_title[3]="Ironhelms"; - company_title[4]="Knights of Baal"; - company_title[5]="Daemonbanes"; - company_title[6]="Eternals"; - company_title[7]="Unconquerables"; - company_title[8]="Bloodbanes"; - company_title[9]="Sunderers"; - company_title[10]="Redeemers"; - } - - - - if (chosen_chapter="Iron Hands"){founding="N/A"; - selected_chapter=6;chapter_name=chosen_chapter;icon=6;icon_name="ih";fleet_type=2;maximum_size=5;purity=8;stability=8;cooperation=2; - custom=0;points_spent=0;points_total=0;keyboard_string=chosen_chapter;flash=0;adv_selecting=0;advantage1=15;adv1="Tech-Brothers"; - advantage2=17;adv2="Slow and Purposeful";advantage3=0;adv3="";disadvantage1=10;dis1="Splintered";disadvantage2=11;dis2="Suspicious";disadvantage3=0;dis3=""; - battle_cry="The flesh is weak";monastery_name="Medusa";master_name="Kardan Stronos"; - main_color="Black";secondary_color="None";lens_color="Dark Red";weapon_color="Silver";initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine"; - veteran_name="Veteran";devastator_name="Devastator Marine";assault_name="Assault Marine";apothecary_name="Apothecary";librarian_name="Librarian"; - tech_name="Iron Father";chaplain_name="Iron Father";role[100][2]="Honour Guard";dreadnought_name="Dreadnought";captain_name="Captain"; - master_melee=3;master_ranged=999;forbidden_unit1="Chaplain";forbidden_unit2="";forbidden_unit3=""; - home_type="Lava";recruiting_type="Lava";recruiting_name="Medusa";home_name="Medusa";lord_admiral_name=global.name_generator.generate_space_marine_name(); - chief_librarian_name="Lydriik";high_chaplain_name="Shulgaar";high_apothecary_name="Grolvoch";forge_master_name="Feirros"; - chaplain_melee=1;chaplain_ranged=1;apothecary_melee=1;apothecary_ranged=1;sergeant_melee=1; - sergeant_ranged=1;scout_melee=2;scout_ranged=1;honor_melee=3;honor_mobi=1;honor_ranged=1; - successor_chapters=6;progenitor_disposition=0;astartes_disposition=13;imperium_disposition=12;guard_disposition=12; - inquisition_disposition=14;ecclesiarchy_disposition=12;other1_disposition=15;other1="";other2_disposition=18;other2="Mechanicus"; - mutations=0;mutations_selected=0;mutation=""; - - recruit_trial=eTrials.KNOWLEDGE; - company_title[1]="Clan Avernii"; - company_title[2]="Clan Garrsak"; - company_title[3]="Clan Felg"; - company_title[4]="Clan Garrsak"; - company_title[5]="Clan Kaargul"; - company_title[6]="Clan Morragul"; - company_title[7]="Clan Sorrgol"; - company_title[8]="Clan Borrgar"; - company_title[9]="Clan Ungavarr"; - company_title[10]="Clan Dorrvok"; - } - - - - - if (chosen_chapter="Ultramarines"){founding="N/A"; - selected_chapter=7;chapter_name="Ultramarines";icon=7;icon_name="um";fleet_type=2;maximum_size=10;purity=10;stability=10;cooperation=7; - custom=0;points_spent=0;points_total=0;keyboard_string="Ultramarines";flash=0;adv_selecting=0;advantage1=0;adv1=""; - advantage2=0;adv2="";advantage3=0;adv3="";disadvantage1=0;dis1="";disadvantage2=0;dis2="";disadvantage3=0;dis3=""; - battle_cry="Courage and honor";monastery_name="Fortress of Hera";master_name="Marneus Calgar"; - main_color="Blue";secondary_color="Dark Gold";lens_color="Red";weapon_color="Black";initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine"; - veteran_name="Veteran";devastator_name="Devastator Marine";assault_name="Assault Marine";apothecary_name="Apothecary";librarian_name="Librarian"; - tech_name="Techmarine";chaplain_name="Chaplain";role[100][2]="Honour Guard";dreadnought_name="Dreadnought";captain_name="Captain"; - master_melee=1;master_ranged=1;forbidden_unit1="";forbidden_unit2="";forbidden_unit3=""; - home_type="Temperate";recruiting_type="Death";recruiting_name="Parmenio";home_name="Macragge";lord_admiral_name="Lazlo Tiberius"; - chief_librarian_name="Varro Tigurius";high_chaplain_name="Ortan Cassius";high_apothecary_name="Corpus Helix";forge_master_name="Fennias Maxim"; - chaplain_melee=1;chaplain_ranged=1;apothecary_melee=1;apothecary_ranged=1;sergeant_melee=1; - sergeant_ranged=1;scout_melee=2;scout_ranged=1;honor_melee=1;honor_mobi=1;honor_ranged=1; - successor_chapters=27;progenitor_disposition=0;astartes_disposition=17;imperium_disposition=18;guard_disposition=18; - inquisition_disposition=16;ecclesiarchy_disposition=15;other1_disposition=12;other1="Imperial Fists";other2_disposition=15;other2="Mechanicus"; - mutations=0;mutations_selected=0;mutation=""; - - recruit_trial=eTrials.EXPOSURE; - company_title[1]="Warriors of Ultramar"; - company_title[2]="Guardians of the Temple"; - company_title[3]="Scourge of the Xenos"; - company_title[4]="Defenders of Ultramar"; - company_title[5]="Wardens of the Eastern Fringe"; - } - - - - - if (chosen_chapter="Salamanders"){founding="N/A"; - selected_chapter=8;chapter_name="Salamanders";icon=8;icon_name="sl";fleet_type=2;maximum_size=5;purity=8;stability=9;cooperation=10; - custom=0;points_spent=0;points_total=0;keyboard_string="Salamanders";flash=0;adv_selecting=0;advantage1=6;adv1="Crafters"; - advantage2=17;adv2="Slow and Purposeful";advantage3=0;adv3="";disadvantage1=0;dis1="";disadvantage2=0;dis2="";disadvantage3=0;dis3=""; - battle_cry="Into the fires of battle, unto the anvil of war!";monastery_name="Prometheus";master_name="Tu'Shan"; - main_color="Firedrake Green";secondary_color="Black";lens_color="Yellow";weapon_color="Black";initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine"; - veteran_name="Veteran";devastator_name="Devastator Marine";assault_name="Assault Marine";apothecary_name="Apothecary";librarian_name="Librarian"; - tech_name="Techmarine";chaplain_name="Chaplain";role[100][2]="Pyre Guard";dreadnought_name="Dreadnought";captain_name="Captain"; - master_melee=2;master_ranged=3;forbidden_unit1="";forbidden_unit2="";forbidden_unit3=""; - home_type="Lava";recruiting_type="Lava";recruiting_name="Nocturne";home_name="Nocturne";lord_admiral_name=global.name_generator.generate_space_marine_name(); - chief_librarian_name=global.name_generator.generate_space_marine_name();high_chaplain_name=global.name_generator.generate_space_marine_name();high_apothecary_name=global.name_generator.generate_space_marine_name();forge_master_name="Vulkan He'stan"; - chaplain_melee=1;chaplain_ranged=2;apothecary_melee=1;apothecary_ranged=2;sergeant_melee=1; - sergeant_ranged=3;scout_melee=2;scout_ranged=1;honor_melee=3;honor_mobi=1;honor_ranged=4; - successor_chapters=3;progenitor_disposition=0;astartes_disposition=17;imperium_disposition=18;guard_disposition=18; - inquisition_disposition=16;ecclesiarchy_disposition=15;other1_disposition=11;other1="Iron Hands";other2_disposition=15;other2="Mechanicus"; - mutations=1;mutations_selected=1;mutation="secretions";secretions=1;psy_powers="pyromancy"; - - recruit_trial=eTrials.APPRENTICESHIP; - company_title[1]="The Firedrakes"; - } - - - /* - if (chosen_chapter="Salamanders"){founding="N/A"; - selected_chapter=8;chapter_name="Salamanders";icon=8;fleet_type=2;maximum_size=7;purity=7;stability=8;cooperation=9; - custom=0;points_spent=0;points_total=0;keyboard_string="Salamanders";flash=0;adv_selecting=0;advantage1=4;adv1="Crafters"; - advantage2=0;adv2="";advantage3=0;adv3="";disadvantage1=0;dis1="";disadvantage2=0;dis2="";disadvantage3=0;dis3=""; - battle_cry="Into the fires of battle, unto the anvil of war";master_name="Tu'Shan";monastery_name=""; - main_color="Green";secondary_color="Black"; - lens_color="Yellow";weapon_color="Black";initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine"; - veteran_name="Veteran";devastator_name="Devastator Marine";assault_name="Assault Marine";apothecary_name="Apothecary";librarian_name="Librarian"; - tech_name="Techmarine";chaplain_name="Chaplain";role[100][2]="Honour Guard";dreadnought_name="Dreadnought";captain_name="Captain"; - master_melee=2;master_ranged=3;forbidden_unit1="Land Speeder";forbidden_unit2="Bike";forbidden_unit3=""; - - home_name="Nocturne"; - } - - - if (chosen_chapter="Lamenters"){founding="Blood Angels"; - selected_chapter=13;chapter_name="Lamenters";icon=13;fleet_type=3;maximum_size=5;purity=10;stability=10;cooperation=2; - custom=0;points_spent=0;points_total=0;keyboard_string="Lamenters";flash=0;adv_selecting=0;advantage1=0;adv1=""; - advantage2=0;adv2="";advantage3=0;adv3="";disadvantage1=4;dis1="Shitty Luck";disadvantage2=5;dis2="Sieged";disadvantage3=7;dis3="Suspicious"; - battle_cry="For those we cherish, we die in Glory";master_name="Malakim Phoros";monastery_name=""; - main_color="Yellow";secondary_color="None"; - lens_color="Dark Red";weapon_color="Black";initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine"; - veteran_name="Veteran";devastator_name="Devastator Marine";assault_name="Assault Marine";apothecary_name="Apothecary";librarian_name="Librarian"; - tech_name="Techmarine";chaplain_name="Chaplain";role[100][2]="Honour Guard";dreadnought_name="Dreadnought";captain_name="Captain"; - master_melee=3;master_ranged=2;forbidden_unit1="";forbidden_unit2="";forbidden_unit3=""; - - home_name="Lacrima Vex"; - }*/ - - - - if (chosen_chapter="Lamenters"){founding="Blood Angels"; - selected_chapter=13;chapter_name="Lamenters";icon=13;icon_name="lam";fleet_type=3;maximum_size=5;purity=10;stability=8;cooperation=3; - custom=0;points_spent=0;points_total=0;keyboard_string=chapter_name;flash=0;adv_selecting=0;advantage1=18;adv1="Melee Enthusiasts"; - advantage2=0;adv2="";advantage3=0;adv3="";disadvantage1=8;dis1="Shitty Luck";disadvantage2=9;dis2="Sieged";disadvantage3=11;dis3="Suspicious"; - battle_cry="For those we cherish, we die in Glory";monastery_name="Lacrima Vex";master_name="Malakim Phoros"; - main_color="Yellow";secondary_color="None";lens_color="Dark Red";weapon_color="Black";initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine"; - veteran_name="Veteran";devastator_name="Devastator Marine";assault_name="Assault Marine";apothecary_name="Apothecary";librarian_name="Librarian"; - tech_name="Techmarine";chaplain_name="Chaplain";role[100][2]="Honour Guard";dreadnought_name="Dreadnought";captain_name="Captain"; - master_melee=3;master_ranged=2;forbidden_unit1="";forbidden_unit2="";forbidden_unit3=""; - home_type="random";recruiting_type="Temperate";recruiting_name="random";home_name="random";lord_admiral_name=global.name_generator.generate_space_marine_name(); - chief_librarian_name=global.name_generator.generate_space_marine_name();high_chaplain_name=global.name_generator.generate_space_marine_name();high_apothecary_name=global.name_generator.generate_space_marine_name();forge_master_name=global.name_generator.generate_space_marine_name(); - chaplain_melee=1;chaplain_ranged=1;apothecary_melee=1;apothecary_ranged=1;sergeant_melee=1; - sergeant_ranged=1;scout_melee=2;scout_ranged=1;honor_melee=1;honor_ranged=1;honor_mobi=1; - successor_chapters=0;progenitor_disposition=16;astartes_disposition=12;imperium_disposition=11;guard_disposition=11; - inquisition_disposition=11;ecclesiarchy_disposition=12;other1_disposition=0;other1="";other2_disposition=12;other2="Mechanicus"; - mutations=0;mutations_selected=0;mutation="";chapter_year=908; - // Badab Sector, need custom map - - recruit_trial=eTrials.CHALLENGE; - } - - - /* - if (chosen_chapter="Angry Marines"){founding="Desert Fangs"; - selected_chapter=15;chapter_name="Angry Marines";icon=15;fleet_type=2;maximum_size=5;purity=10;stability=10;cooperation=0; - custom=0;points_spent=0;points_total=0;keyboard_string="Angry Marines";flash=0;adv_selecting=0;advantage1=13;adv1="Melee Enthusiasts"; - advantage2=0;adv2="";advantage3=0;adv3="";disadvantage1=1;dis1="Black Rage";disadvantage2=0;dis2="";disadvantage3=0;dis3=""; - typing_slot=0;battle_cry="ALWAYS ANGRY ALL THE TIME";main_color="Yellow";secondary_color="Red";monastery_name=""; - lens_color="Red";weapon_color="Red";initiate_name="Initiate";scout_name="Scout";tactical_name="Tactical Marine";veteran_name="Cock Knockers"; - devastator_name="Devastator Marine";assault_name="Angrier Marine";apothecary_name="Apothecary";librarian_name="Master of Mindfuckery"; - tech_name="Techmarine";chaplain_name="Holy Pugilist";role[100][2]="Honour Guard";dreadnought_name="Belligerent Engine";captain_name="Captain"; - master_name="Temperus Maximus";master_melee=1;master_ranged=1;forbidden_unit1="Devastator Marine";forbidden_unit2="Apothecary";forbidden_unit3=""; - - home_name="Angrymar"; - }*/ - - - } - - -} diff --git a/scripts/scr_chapter_new/scr_chapter_new.gml b/scripts/scr_chapter_new/scr_chapter_new.gml index fa6699b0c..82d7e1959 100644 --- a/scripts/scr_chapter_new/scr_chapter_new.gml +++ b/scripts/scr_chapter_new/scr_chapter_new.gml @@ -1,6 +1,192 @@ +/// @description Constructor for loading Chapter data from JSON and providing type completion +/// see the actual json files for extended documentation on each property +function ChapterData() constructor { + id = eCHAPTERS.UNKNOWN; + name = ""; + points = 0; + flavor = ""; + origin = eCHAPTER_ORIGINS.NONE; + founding = eCHAPTERS.UNKNOWN; + successors = 0; + splash = 0; + icon = 0; + icon_name = "aa"; + aspirant_trial = eTrials.BLOODDUEL; + fleet_type = eFLEET_TYPES.NONE; + strength = 0; + purity = 0; + stability = 0; + cooperation = 0; + homeworld = "Hive"; //e.g. "Death" + homeworld_name = global.name_generator.generate_star_name(); // e.g. "The Rock" + homeworld_exists = 0; + recruiting_exists = 0; + recruiting = "Death"; + recruiting_name = global.name_generator.generate_star_name(); + homeworld_rule = eHOMEWORLD_RULE.NONE; + flagship_name = global.name_generator.generate_imperial_ship_name(); + monastary_name = ""; + advantages = array_create(9); + disadvantages = array_create(9); + discipline = "default"; // todo convert to enum + + full_liveries = ""; + complex_livery_data = complex_livery_default(); + + + colors = { + main: "Grey", + secondary: "Grey", + pauldron_r: "Grey", + pauldron_l: "Grey", + trim: "Grey", + lens: "Grey", + weapon: "Grey", + /// 0 - normal, 1 - Breastplate, 2 - Vertical, 3 - Quadrant + special: 0, + /// 0 no, 1 yes for special trim colours + //trim_on: 0, + }; + names = { + hchaplain: global.name_generator.generate_space_marine_name(), + clibrarian: global.name_generator.generate_space_marine_name(), + fmaster: global.name_generator.generate_space_marine_name(), + hapothecary: global.name_generator.generate_space_marine_name(), + recruiter: global.name_generator.generate_space_marine_name(), + admiral: global.name_generator.generate_space_marine_name(), + honorcapt: global.name_generator.generate_space_marine_name(), + watchmaster: global.name_generator.generate_space_marine_name(), + arsenalmaster: global.name_generator.generate_space_marine_name(), + marchmaster: global.name_generator.generate_space_marine_name(), + ritesmaster: global.name_generator.generate_space_marine_name(), + victualler: global.name_generator.generate_space_marine_name(), + lordexec: global.name_generator.generate_space_marine_name(), + relmaster: global.name_generator.generate_space_marine_name(), + }; + mutations = { + preomnor: 0, + voice: 0, + doomed: 0, + lyman: 0, + omophagea: 0, + ossmodula: 0, + membrane: 0, + zygote: 0, + betchers: 0, + catalepsean: 0, + secretions: 0, + occulobe: 0, + mucranoid: 0, + }; + battle_cry = "For the Emperor"; + equal_specialists = 0; + load_to_ships = { + escort_load: 0, + split_scouts: 0, + split_vets: 0, + }; + /// @type {Array} + disposition = array_create(10, 0); + /// @type {Array} + company_titles = array_create(11, ""); + chapter_master = { + name: global.name_generator.generate_space_marine_name(), + melee: 0, + ranged: 0, + specialty: eCM_SPECIALTY.NONE, + /// @type {Array} + traits: [], + gear: "", + mobi: "", + armour: "", + }; + extra_ships = { + battle_barges: 0, + gladius: 0, + strike_cruisers: 0, + hunters: 0 + }; + extra_specialists = { + chaplains: 0, + techmarines: 0, + apothecary: 0, + epistolary: 0, + codiciery: 0, + lexicanum: 0, + terminator: 0, + assault: 0, + veteran: 0, + devastator: 0, + }; + extra_marines = { + second: 0, + third: 0, + fourth: 0, + fifth: 0, + sixth: 0, + seventh: 0, + eighth: 0, + ninth: 0, + tenth: 0, + }; + extra_vehicles = { + rhino: 0, + whirlwind: 0, + predator: 0, + land_raider: 0, + land_speeder: 0, + } + extra_equipment = []; + custom_roles = {}; + squad_name = "Squad"; + custom_squads = {}; + + + /// @desc Returns true if loaded successfully, false if not. + /// @param {Enum.eCHAPTERS} chapter_id + /// @param {Bool} use_app_data if set to true will read from %AppData%/Local/ChapterMaster instead of /datafiles + /// @returns {Bool} + function load_from_json(chapter_id, use_app_data = false){ + var file_loader = new JsonFileListLoader(); + var load_result; + if(use_app_data){ + load_result = file_loader.load_struct_from_json_file($"chaptersave#{chapter_id}.json", "chapter", true); + } else { + load_result = file_loader.load_struct_from_json_file($"main\\chapters\\{chapter_id}.json", "chapter", false); + } + if(!load_result.is_success){ + // debugl($"No chapter json exits for chapter_id {chapter_id}"); + return false; + } + var json_chapter = load_result.value.chapter; + var keys = struct_get_names(json_chapter); + for(var i = 0; i < array_length(keys); i++){ + var key = keys[i]; + var val = struct_get(json_chapter, key); + + // Treat incoming empty vals as 'use default' and don't overwrite + // a value if it was already set in the chapter constructor + if (struct_exists(self, key)){ + if(self[key] != "" && val == ""){ + continue; + } + } + struct_set(self, key, val); + } + return true; + } +} + +/// @mixin obj_creation +/// @description called when a chapter's icon is clicked on the first page after the main menu. +/// used to set up initialise the data that is later fed into `scr_initialize_custom` when the game starts function scr_chapter_new(argument0) { + full_liveries = ""; // until chapter objects are in full use kicks off livery propogation + // argument0 = chapter + obj_creation.use_chapter_object = false; // for the new json testing + var chapter_id = eCHAPTERS.UNKNOWN; //1st captain = honor_captain_name //2nd captain = watch_master_name @@ -13,759 +199,297 @@ function scr_chapter_new(argument0) { //9th captain = relic_master_name //10th captain = recruiter_name - var i;i=-1; - repeat(21){i+=1;world[i]="";world_type[i]="";world_feature[i]="";} - var i;i=-1;repeat(6){i+=1;adv[i]="";adv_num[i]=0;dis[i]="";dis_num[i]=0;} - points=100;maxpoints=100;custom=0; - //Chapter Staff - hapothecary=global.name_generator.generate_space_marine_name(); - hchaplain=global.name_generator.generate_space_marine_name(); - clibrarian=global.name_generator.generate_space_marine_name(); - fmaster=global.name_generator.generate_space_marine_name(); - //Company Captains - honorcapt=global.name_generator.generate_space_marine_name(); - watchmaster=global.name_generator.generate_space_marine_name(); - arsenalmaster=global.name_generator.generate_space_marine_name(); - admiral=global.name_generator.generate_space_marine_name(); - marchmaster=global.name_generator.generate_space_marine_name(); - ritesmaster=global.name_generator.generate_space_marine_name(); - victualler=global.name_generator.generate_space_marine_name(); - lordexec=global.name_generator.generate_space_marine_name(); - relmaster=global.name_generator.generate_space_marine_name(); - recruiter=global.name_generator.generate_space_marine_name(); + var i = 0; + world = array_create(20, ""); + world_type = array_create(20, ""); + world_feature = array_create(20, ""); - i=99; - repeat(3){i+=1;// First is for the correct slot, second is for default - role[i,2]="Honour Guard";wep1[i,2]="Power Sword";wep2[i,2]="Bolter";armour[i,2]="Artificer Armour"; - role[i,3]="Veteran";wep1[i,3]="Chainsword";wep2[i,3]="Combiflamer";armour[i,3]="Power Armour"; - role[i,4]="Terminator";wep1[i,4]="Power Fist";wep2[i,4]="Storm Bolter";armour[i,4]="Terminator Armour"; - role[i,5]="Captain";wep1[i,5]="Power Sword";wep2[i,5]="Bolt Pistol";armour[i,5]="Power Armour";gear[i,5]="Iron Halo"; - role[i,6]="Dreadnought";wep1[i,6]="Close Combat Weapon";wep2[i,6]="Twin Linked Lascannon";armour[i,6]="Dreadnought"; - role[i,8]="Tactical Marine";wep1[i,8]="Bolter";wep2[i,8]="Combat Knife";armour[i,8]="Power Armour"; - role[i,9]="Devastator Marine";wep1[i,9]="Heavy Ranged";wep2[i,9]="Combat Knife";armour[i,9]="Power Armour";mobi[i,9]="Heavy Weapons Pack"; - role[i,10]="Assault Marine";wep1[i,10]="Chainsword";wep2[i,10]="Bolt Pistol";armour[i,10]="Power Armour";mobi[i,10]="Jump Pack"; - role[i,11]="Ancient";wep1[i,11]="Company Standard";wep2[i,11]="Bolt Pistol";armour[i,11]="Power Armour"; - role[i,12]="Scout";wep1[i,12]="Bolter";wep2[i,12]="Combat Knife";armour[i,12]="Scout Armour"; - role[i,14]="Chaplain";wep1[i,14]="Crozius Arcanum";wep2[i,14]="Bolt Pistol";armour[i,14]="Power Armour";gear[i,14]="Rosarius"; - role[i,15]="Apothecary";wep1[i,15]="Chainsword";wep2[i,15]="Bolt Pistol";armour[i,15]="Power Armour";gear[i,15]="Narthecium"; - role[i,16]="Techmarine";wep1[i,16]="Power Axe";wep2[i,16]="Bolt Pistol";armour[i,16]="Artificer Armour";mobi[i,16]="Servo-arm";gear[i,16]=""; - role[i,17]="Librarian";wep1[i,17]="Force Staff";wep2[i,17]="Bolt Pistol";armour[i,17]="Power Armour";gear[i,17]="Psychic Hood"; - role[i,18]="Sergeant";wep1[i,18]="Chainsword";wep2[i,18]="Bolt Pistol";armour[i,18]="Power Armour";gear[i,18]=""; - role[i,19]="Veteran Sergeant";wep1[i,19]="Chainsword";wep2[i,19]="Plasma Pistol";armour[i,19]="Power Armour";gear[i,19]=""; - }i=100; - - chapter="nopw_nopw"; - - - - - - - if (argument0="Dark Angels"){founding="N/A";points=150; - selected_chapter=1;chapter=argument0;icon=1;icon_name="da";founding=0;fleet_type=1;strength=10;purity=8;stability=10;cooperation=5; - homeworld="Dead";homeworld_name="The Rock";recruiting="Death";recruiting_name="Kimmeria"; - homeworld_exists=1;recruiting_exists=1;homeworld_rule=3;aspirant_trial=eTrials.SURVIVAL; - adv[1]="Enemy: Fallen";dis[1]="Never Forgive"; - // Pauldron2: Left, Pauldron: Right - color_to_main="Caliban Green";color_to_secondary="Caliban Green";color_to_trim="Grey"; - color_to_pauldron="Caliban Green";color_to_pauldron2="Caliban Green";color_to_lens="Red"; - color_to_weapon="Dark Red";col_special=0;trim=0; - hchaplain="Sapphon";clibrarian="Ezekial";fmaster="Sepharon";hapothecary="Razaek"; - honorcapt="Belial";watchmaster="Sammael";arsenalmaster="Astoran";admiral="Korahael";marchmaster="Balthazar"; - ritesmaster="Araphil";victualler="Ezekiah";lordexec="Molochi";relmaster="Xerophus";recruiter="Ranaeus"; - battle_cry="Repent! For tomorow you may die"; - equal_specialists=0;load_to_ships=[2,0,0];successors=9; - mutations=0;mutations_selected=0; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - // disposition[1]=0;// Prog - disposition[2]=65;disposition[3]=60;disposition[4]=60;disposition[5]=60; - disposition[6]=50;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Azreal";chapter_master_specialty=2; - chapter_master_melee=5;chapter_master_ranged=4; - - company_title[1]="Deathwing"; - company_title[2]="Ravenwing"; - company_title[3]="The Unmerciful"; - company_title[4]="The Feared"; - company_title[5]="The Unrelenting"; - company_title[6]="The Resolute"; - company_title[7]="The Unbowed"; - company_title[8]="The Wrathful"; - company_title[9]="The Remorseless"; - company_title[10]="The Redeemed"; - - for(i=100;i<=102;i++){ - // role[i,1]="Supreme Grand Master"; - role[i,5]="Master"; - wep1[i,5]="Power Sword"; - role[i,2]="Deathwing Knight" + + points=100;maxpoints=100;custom=0; + function load_default_gear(_role_id, _role_name, _wep1, _wep2, _armour, _mobi, _gear){ + for(var i = 100; i <=102; i++){ + obj_creation.role[i][_role_id] = _role_name; + obj_creation.wep1[i][_role_id] = _wep1; + obj_creation.wep2[i][_role_id] = _wep2; + obj_creation.armour[i][_role_id] = _armour; + obj_creation.mobi[i][_role_id] = _mobi; + obj_creation.gear[i][_role_id] = _gear; + obj_creation.race[i][_role_id] = 1; } } -if (argument0="White Scars"){founding="N/A";points=150; - selected_chapter=2;chapter=argument0;icon=2;icon_name="ws";founding=0;fleet_type=1;strength=5;purity=10;stability=8;cooperation=5; - homeworld="Feudal";homeworld_name="Chogoris"; - homeworld_exists=1;recruiting_exists=0;homeworld_rule=3;aspirant_trial=eTrials.SURVIVAL;discipline="rune Magick"; - adv[1]="Lightning Warriors";adv[2]="Brothers, All";adv[3]="Melee Enthusiasts";dis[1]="Splintered"; - // Pauldron2: Left, Pauldron: Right - color_to_main="White";color_to_secondary="White";color_to_trim="Red"; - color_to_pauldron="White";color_to_pauldron2="White";color_to_lens="Red"; - color_to_weapon="Black";col_special=0; - hapothecary="Ogholei";hchaplain="Jaghorin";clibrarian="Saghai";fmaster="Khamkar"; - honorcapt="Jurga";watchmaster="Khajog";arsenalmaster="Kor'sarro";admiral="Joghaten"; - marchmaster="Suboden";ritesmaster="Seglei";victualler="Dorghai";lordexec="Vorgha";relmaster="Khadajei"; - recruiter="Jodagha"; - battle_cry="For the Emperor and the Khan!";// monastery_name="Quan Zhou";master_name= - equal_specialists=0;load_to_ships=[2,0,0];successors=12; - mutations=0;mutations_selected=0; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - // disposition[1]=0;// Prog - disposition[2]=50;disposition[3]=50;disposition[4]=50;disposition[5]=50; - disposition[6]=65;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Jubal Khan";chapter_master_melee=5; - chapter_master_ranged=3;chapter_master_specialty=1; - company_title[1]="The Spearpoint Brotherhood";company_title[2]="The Firefist Brotherhood";company_title[3]="The Eagle Brotherhood"; - company_title[4]="The Tulwar Brotherhood";company_title[5]="The Stormwrath Brotherhood";company_title[6]="The Hawkeye Brotherhood"; - company_title[7]="The Plainstalker Brotherhood";company_title[8]="The Bloodrider Brotherhood";company_title[9]="The Stormbolt Brotherhood"; - company_title[10]="The Windspeaker Brotherhood"; - - i=99;repeat(3){i+=1; - role[i,2]="Keshig";wep1[i,2]="Power Sword";wep2[i,2]="Bolter";armour[i,2]="Terminator Armour"; - role[i,5]="Khan";wep1[i,5]="Power Sword" - role[i,15]="Emchi"; - role[i,17]="Stormseer"; - + load_default_gear(eROLE.HonourGuard, "Honour Guard", "Power Sword", "Bolter", "Artificer Armour", "", ""); + load_default_gear(eROLE.Veteran, "Veteran", "Combiflamer", "Combat Knife", "Power Armour", "", ""); + load_default_gear(eROLE.Terminator, "Terminator", "Power Fist", "Storm Bolter", "Terminator Armour", "", ""); + load_default_gear(eROLE.Captain, "Captain", "Power Sword", "Bolt Pistol", "Power Armour", "", "Iron Halo"); + load_default_gear(eROLE.Dreadnought, "Dreadnought", "Dreadnought Lightning Claw", "Lascannon", "Dreadnought", "", ""); + load_default_gear(eROLE.Champion, "Champion", "Power Sword", "Power Armour", "Power Armour", "", "Combat Shield"); + load_default_gear(eROLE.Tactical, "Tactical", "Bolter", "Combat Knife", "Power Armour", "", ""); + load_default_gear(eROLE.Devastator, "Devastator", "", "Combat Knife", "Power Armour", "", ""); + load_default_gear(eROLE.Assault, "Assault", "Chainsword", "Bolt Pistol", "Power Armour", "Jump Pack", ""); + load_default_gear(eROLE.Ancient, "Ancient", "Company Standard", "Bolt Pistol", "Power Armour", "", ""); + load_default_gear(eROLE.Scout, "Scout", "Bolter", "Combat Knife", "Scout Armour", "", ""); + load_default_gear(eROLE.Chaplain, "Chaplain", "Crozius Arcanum", "Bolt Pistol", "Power Armour", "", "Rosarius"); + load_default_gear(eROLE.Apothecary, "Apothecary", "Chainsword", "Bolt Pistol", "Power Armour", "", "Narthecium"); + load_default_gear(eROLE.Techmarine, "Techmarine", "Power Axe", "Bolt Pistol", "Artificer Armour", "Servo-arm", ""); + load_default_gear(eROLE.Librarian, "Librarian", "Force Staff", "Bolt Pistol", "Power Armour", "", "Psychic Hood"); + load_default_gear(eROLE.Sergeant, "Sergeant", "Chainsword", "Bolt Pistol", "Power Armour", "", ""); + load_default_gear(eROLE.VeteranSergeant, "Veteran Sergeant", "Chainsword", "Plasma Pistol", "Power Armour", "", ""); + + + for(var c = 0; c < array_length(obj_creation.all_chapters); c++){ + if(argument0 == obj_creation.all_chapters[c].name && obj_creation.all_chapters[c].json == true){ + obj_creation.use_chapter_object = true; + chapter_id = obj_creation.all_chapters[c].id; } -} - - - if (argument0="Ultramarines"){founding="N/A";points=150; - selected_chapter=7;chapter=argument0;icon=7;icon_name="um";founding=0;fleet_type=1;strength=5;purity=10;stability=10;cooperation=10; - homeworld="Temperate";homeworld_name="Macragge";recruiting="Death";recruiting_name="Parmenio"; - homeworld_exists=1;recruiting_exists=1;homeworld_rule=3;aspirant_trial=eTrials.EXPOSURE; - // Pauldron2: Left, Pauldron: Right - color_to_main="Dark Ultramarine";color_to_secondary="Dark Ultramarine";color_to_trim="Gold"; - color_to_pauldron="Dark Ultramarine";color_to_pauldron2="Dark Ultramarine";color_to_lens="Red"; - color_to_weapon="Red";col_special=0; - hapothecary="Corpus Helix";hchaplain="Ortan Cassius";clibrarian="Varro Tigurius";fmaster="Fennias Maxim"; - honorcapt="Severus Agemman";watchmaster="Cato Sicarius";arsenalmaster="Mikael Fabian";admiral="Uriel Ventris"; - marchmaster="Caito Galenus";ritesmaster="Maximus Epathus";victualler="Gerad Ixion";lordexec="Numitor";relmaster="Sinon"; - recruiter="Antilochus"; - battle_cry="Courage and honor";// monastery_name="Fortress of Hera";master_name= - equal_specialists=0;load_to_ships=[2,0,0];successors=27; - mutations=0;mutations_selected=0; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - // disposition[1]=0;// Prog - disposition[2]=80;disposition[3]=65;disposition[4]=65;disposition[5]=65; - disposition[6]=65;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Marneus Calgar";chapter_master_melee=1; - chapter_master_ranged=1;chapter_master_specialty=1; - company_title[1]="Warriors of Ultramar"; company_title[2]="Guardians of the Temple"; company_title[3]="Scourge of the Xenos"; - company_title[4]="Defenders of Ultramar"; company_title[5]="Wardens of the Eastern Fringe"; company_title[6]="Brethren of the Forge"; - company_title[7]="Defenders of Caeserean"; company_title[8]="Honourblades"; company_title[9]="Stormbringers"; - company_title[10]="The Scions of Ultramar"; - } - //Waiting on new disadv to give anymore adv. - if (argument0="Imperial Fists"){founding="N/A";points=150; - selected_chapter=4;chapter=argument0;icon=4;icon_name="if";founding=0;fleet_type=1;strength=6;purity=7;stability=10;cooperation=8; - adv[1]="Bolter Drilling";adv[2]="Siege Masters"; - homeworld="Ice";homeworld_name="Inwit";recruiting="Hive";recruiting_name="Necromunda"; - homeworld_exists=1;recruiting_exists=1;homeworld_rule=2;aspirant_trial=eTrials.SURVIVAL;discipline="telekinesis"; - - color_to_main="Gold";color_to_secondary="Gold";color_to_trim="Red";color_to_pauldron="Gold" - color_to_pauldron2="Gold";color_to_lens="Red";color_to_weapon="Black" - hapothecary="Dyserna";hchaplain="Guaron";clibrarian="Vidos Harn";fmaster="Atornus Geis"; - admiral="Kyne Phasn";honorcapt="Darnath Lysander";watchmaster="Helion";arsenalmaster="Tor Garadon";;marchmaster="Maluan"; - ritesmaster="Antaros";victualler="Jonas";lordexec="Chalosa";relmaster="Kaheron";recruiter="Taelos"; - - battle_cry="Primarch-Progenitor, to your glory and the glory of him on earth!"; - equal_specialists=0;load_to_ships=[2,0,0]; - successors=21; - mutations=2;mutations_selected=2; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=1; - zygote=0;betchers=1;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - // disposition[1]=0;// Prog - disposition[2]=75;disposition[3]=60;disposition[4]=50;disposition[5]=60; - disposition[6]=60;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Vorn Hagen";chapter_master_melee=4; - chapter_master_ranged=7;chapter_master_specialty=1; - - company_title[1]="The Fists of Dorn";company_title[2]="The Scions of Redemption";company_title[3]="The Sentinels of Terra"; - company_title[4]="The Reductors";company_title[5]="The Heralds of Truth";company_title[6]="The Siege Hammers"; - company_title[7]="Guardians of Phalanx";company_title[8]="Dorn's Huscarls";company_title[9]="The Wardens"; - company_title[10]="The Eyes of Dorn"; - - i=99;repeat(3){i+=1; - role[i,2]="Huscarl";wep1[i,2]="Power Sword";wep2[i,2]="Storm Shield";armour[i,2]="Power Armour"; - } - } - - if (argument0="Space Wolves"){founding="N/A";points=150; - selected_chapter=3;chapter=argument0;icon=3;icon_name="sw";founding=0;fleet_type=1;strength=10;purity=8;stability=5;cooperation=4; - adv[1]="Melee Enthusiasts";dis[1]="Black Rage";dis[2]="Suspicious"; - homeworld="Ice";homeworld_name="Fenris"; - homeworld_exists=1;recruiting_exists=0;homeworld_rule=2;aspirant_trial=eTrials.EXPOSURE;discipline="rune Magick"; - // Pauldron2: Left, Pauldron: Right - color_to_main="Fenrisian Grey";color_to_secondary="Fenrisian Grey";color_to_trim="Dark Gold"; - color_to_pauldron="Dark Gold";color_to_pauldron2="Dark Gold";color_to_lens="Red"; - color_to_weapon="Dark Gold";col_special=0;trim=0; - hapothecary="Ulstvan Morkaison";hchaplain="Ulrik the Slayer";clibrarian="Njal Stormcaller";fmaster="Krom Dragongaze"; - honorcapt="Bran Redmaw";watchmaster="Engir Krakendoom";arsenalmaster="Erik Morkai";admiral="Gunnar Red Moon";marchmaster="Harald Deathwolf"; - ritesmaster="Bjorn Stormwolf";victualler="Vorek Gnarlfist";lordexec="Krom Dragongaze";relmaster="Ragnar Blackmane";recruiter="Sven Bloodhowl"; - battle_cry="For Russ and the Allfather";// monastery_name="The Fang";master_name= - equal_specialists=1;load_to_ships=[2,0,0];successors=1; - mutations=0;mutations_selected=0; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - // disposition[1]=0;// Prog - disposition[2]=50;disposition[3]=40;disposition[4]=15;disposition[5]=15; - disposition[6]=40;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Logan Grimnar";chapter_master_melee=6; - chapter_master_ranged=1;chapter_master_specialty=2; - - //Weird since they have 13 companies if the hard coding changes in the future this will as well - /*company_title[0]="Champions of Fenris";*/company_title[1]="The Bloodmaws";company_title[2]="The Seawolves"; - company_title[3]="The Sons of Morkai";company_title[4]="The Red Moons";company_title[5]="The Deathwolves"; - company_title[6]="The Stormwolves";company_title[7]="The Ironwolves";company_title[8]="The Drakeslayers"; - company_title[9]="The Blackmanes";/*company_title[10]="The Firehowlers";company_title[12]="The Grimbloods"; - company_title[13]="The Wulfen";*/ - - i=99;repeat(3){i+=1; - role[i,2]="Wolf Guard";wep1[i,2]="Power Axe";wep2[i,2]="Bolter";armour[i,2]="Power Armour"; - role[i,3]="Veteran";wep1[i,3]="Chainaxe"; - role[i,5]="Wolf Lord";role[i,8]="Grey Hunter";role[i,9]="Long Fang"; - role[i,10]="Blood Claw";wep1[i,10]="Chainaxe"; - role[i,12]="Wolf Scout";wep1[i,12]="Sniper Rifle";wep2[i,12]="Chainaxe"; - race[i,14]=0;role[i,14]="Wolf Priest";wep1[i,14]="Power Axe"; - role[i,15]="Wolf Priest";wep1[i,15]="Power Axe"; - role[i,16]="Iron Priest";wep1[i,16]="Power Axe"; - role[i,17]="Rune Priest";wep1[i,17]="Force Staff"; - role[i,18]="Pack Leader";wep1[i,18]="Chainaxe"; - role[i,19]="Wolf Guard Pack Leader";wep1[i,19]="Chainaxe"; - } - } + if(obj_creation.use_chapter_object){ + var chapter_obj = new ChapterData(); + var successfully_loaded = chapter_obj.load_from_json(chapter_id); + if(!successfully_loaded){ + var issue = $"No json file exists for chapter id {chapter_id} and name {argument0}"; + // debugl (issue); + scr_popup("Error Loading Chapter", issue, "debug"); + return false; + } + global.chapter_creation_object = chapter_obj; - if (argument0="Blood Angels"){founding="N/A";points=150; - selected_chapter=5;chapter=argument0;icon=5;icon_name="ba";founding=0;fleet_type=1;strength=5;purity=9;stability=9;cooperation=7; - adv[1]="Melee Enthusiasts";dis[1]="Black Rage"; - homeworld="Desert";homeworld_name="Baal"; - homeworld_exists=1;recruiting_exists=0;homeworld_rule=3;aspirant_trial=eTrials.BLOODDUEL; - // Pauldron2: Left, Pauldron: Right - color_to_main="Sanguine Red";color_to_secondary="Sanguine Red";color_to_trim="Lighter Black"; - color_to_pauldron="Sanguine Red";color_to_pauldron2="Sanguine Red";color_to_lens="Lime"; - color_to_weapon="Black";col_special=0;trim=0; - hchaplain="Astorath the Grim";clibrarian="Mephiston";fmaster="Incarael";hapothecary="Corbulo"; - honorcapt="Areno Karlaen";watchmaster="Donatos Aphael";arsenalmaster="Machiavi";admiral="Castigon";marchmaster="Sendini"; - ritesmaster="Raxiatel";victualler="Phaeton";lordexec="Zedrenael";relmaster="Sendroth";recruiter="Borgio"; - battle_cry="For the Emperor and Sanguinius! Death! DEATH";// monastery_name="Fortress of Hera";master_name= - equal_specialists=0;load_to_ships=[2,0,0];successors=3; - mutations=0;mutations_selected=0; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - // disposition[1]=0;// Prog - disposition[2]=75;disposition[3]=60;disposition[4]=50;disposition[5]=60; - disposition[6]=60;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Dante";chapter_master_melee=6; - chapter_master_ranged=2;chapter_master_specialty=2; - company_title[1]="Archangels";company_title[2]="The Blooded";company_title[3]="Ironhelms"; - company_title[4]="Knights of Baal";company_title[5]="Daemonbanes";company_title[6]="Eternals"; - company_title[7]="Unconquerables";company_title[8]="Bloodbanes";company_title[9]="Sunderers"; - company_title[10]="Redeemers"; - - i=99;repeat(3){i+=1; - role[i,2]="Sanguinary Guard";wep1[i,2]="Power Axe";wep2[i,2]="Bolt Pistol";mobi[i,2]="Jump Pack"; - role[i,15]="Sanguinary Priest";wep1[i,15]="Power Axe"; - } } - - if (argument0="Iron Hands"){founding="N/A";points=150; - selected_chapter=6;chapter=argument0;icon=6;icon_name="ih";founding=0;fleet_type=1;strength=5;purity=8;stability=8;cooperation=2; - adv[1]="Tech-Brothers";adv[2]="Slow and Purposeful";dis[1]="Splintered";dis[2]="Suspicious"; - homeworld="Lava";homeworld_name="Medusa";homeworld_exists=1;recruiting_exists=0; - homeworld_rule=3;aspirant_trial=eTrials.KNOWLEDGE; - // Pauldron2: Left, Pauldron: Right - color_to_main="Black";color_to_secondary="Black";color_to_trim="Silver"; - color_to_pauldron="Black";color_to_pauldron2="Black";color_to_lens="Dark Red"; - color_to_weapon="Silver";col_special=0;trim=0; - hchaplain="Jorggir Shidd";clibrarian="Lydriik";fmaster="Feirros";hapothecary="Anaar Telech"; - honorcapt="Caanok Var";watchmaster="Eutuun Hes";arsenalmaster="Sind Grolvoch";admiral="Maarkul Rumann";marchmaster="Tyrrod"; - ritesmaster="Golloth";victualler="Raan";lordexec="Doroor Hesh";relmaster="Verrox";recruiter="Telavech"; - battle_cry="The flesh is weak";// monastery_name="Fortress of Hera";master_name= - equal_specialists=1;load_to_ships=[2,0,0];successors=6; - mutations=0;mutations_selected=0; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - // disposition[1]=0;// Prog - disposition[2]=30;disposition[3]=80;disposition[4]=35;disposition[5]=30; - disposition[6]=50;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Kardan Stronos";chapter_master_melee=4; - chapter_master_ranged=3;chapter_master_specialty=2; - - company_title[1]="Clan Avernii";company_title[2]="Clan Garrsak";company_title[3]="Clan Raukaan"; - company_title[4]="Clan Kaargul";company_title[5]="Clan Haarmek";company_title[6]="Clan Sorrgol"; - company_title[7]="Clan Borrgos";company_title[8]="Clan Morlaag";company_title[9]="Clan Vurgaan"; - company_title[10]="Clan Dorrvok"; - - for(i=100;i<=102;i++){ - race[i,14]=0;role[i,14]="Iron Father";role[i,16]="Iron Father"; - role[i,5]="Iron Captain";wep1[i,5]="Power Axe"; - } + #region Custom Chapter + //generates custom chapter if it exists + if (is_real(argument0) && argument0 >= eCHAPTERS.CUSTOM_1 && argument0 <= eCHAPTERS.CUSTOM_10){ + obj_creation.use_chapter_object = true; + var chapter_obj = new ChapterData(); + var successfully_loaded = chapter_obj.load_from_json(argument0, true); + if(!successfully_loaded){ + var issue = $"No json file exists for chapter id {argument0} and name {argument0}"; + debugl (issue); + scr_popup("Error Loading Chapter", issue, "debug"); + return false; + } + global.chapter_creation_object = chapter_obj; } + #endregion - if (argument0="Salamanders"){founding="N/A";points=150; - selected_chapter=8;chapter=argument0;icon=8;icon_name="sl";founding=0;fleet_type=1;strength=2;purity=8;stability=8;cooperation=10; - adv[1]="Crafters";adv[2]="Slow and Purposeful"; - homeworld="Lava";homeworld_name="Nocturne";homeworld_exists=1;recruiting_exists=0; - homeworld_rule=1;aspirant_trial=eTrials.APPRENTICESHIP;discipline="pyromancy"; - // Pauldron2: Left, Pauldron: Right - color_to_main="Firedrake Green";color_to_secondary="Firedrake Green";color_to_trim="Dark Gold"; - color_to_pauldron="Black";color_to_pauldron2="Black";color_to_lens="Red"; - color_to_weapon="Black";col_special=0;trim=0; - fmaster="Argos";clibrarian="Velcona";hapothecary="Harath Shen";hchaplain="Leotrak Esar"; - watchmaster="Pellas Mir'San";arsenalmaster="Adrax Agatone" admiral="Dac'tyr"; - marchmaster="Mulcebor";ritesmaster="Ur'zan Draakgard";recruiter="Sol Ba'ken"; - battle_cry="Into the fires of battle! Unto the anvil of war";// monastery_name="Fortress of Hera";master_name= - equal_specialists=0;load_to_ships=[2,0,0];successors=2; - mutations=1;mutations_selected=1; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=1;occulobe=0;mucranoid=0; - // disposition[1]=0;// Prog - disposition[2]=80;disposition[3]=65;disposition[4]=65;disposition[5]=60; - disposition[6]=60;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Tu'Shan";chapter_master_melee=4; - chapter_master_ranged=2;chapter_master_specialty=2; + if(obj_creation.use_chapter_object){ + + var chapter_object = global.chapter_creation_object; - company_title[1]="The Firedrakes";company_title[2]="Defenders of Nocturne";company_title[3]="The Pyroclasts"; - company_title[4]="The Branded";company_title[5]="The Drake Hunters";company_title[6]="The Flamehammers"; - company_title[10]="Sons of Nocturne"; - - for(i=100;i<=102;i++){ - role[i,3]="Firedrake";wep1[i,3]="Power Sword"; - role[i,19]="Firedrake Master";wep1[i,3]="Power Sword"; - } - } - - - if (argument0="Raven Guard"){founding="N/A";points=150; - selected_chapter=9;chapter=argument0;icon=9;icon_name="rg";founding=0;fleet_type=1;strength=5;purity=8;stability=4;cooperation=5; - adv[1]="Ambushers";adv[2]="Melee Enthusiasts";dis[1]="Splintered"; - homeworld="Dead";homeworld_name="Deliverance";homeworld_exists=1;recruiting_exists=1; - homeworld_rule=1;aspirant_trial=eTrials.EXPOSURE; - // Pauldron2: Left, Pauldron: Right - color_to_main="Black";color_to_secondary="Black";color_to_trim="Silver"; - color_to_pauldron="Black";color_to_pauldron2="Black";color_to_lens="Dark Red"; - color_to_weapon="Black";col_special=0;trim=0; - hchaplain="Jolaran Tael";fmaster="Saar Laeron";clibrarian="Taalis Shraek";hapothecary="Vynda Aason" - honorcapt="Vykar Kaed";watchmaster="Aaja Solari";arsenalmaster="Vordin Krayn";admiral="Aethon Shaan";marchmaster="Kyrin Solaq"; - ritesmaster="Syras Colfaen";victualler="Aervar Qeld";lordexec="Reszasz Krevaan";relmaster="Vos Delorn";recruiter="Kalae Korvydae"; - battle_cry="Victorus aut Mortis";// monastery_name="Fortress of Hera";master_name= - equal_specialists=0;load_to_ships=[2,0,0];successors=8; - mutations=2;mutations_selected=2; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=1;catalepsean=0;secretions=0;occulobe=0;mucranoid=1; - // disposition[1]=0;// Prog - disposition[2]=80;disposition[3]=50;disposition[4]=50;disposition[5]=50; - disposition[6]=60;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Kayvaan Shrike";chapter_master_melee=2; - chapter_master_ranged=1;chapter_master_specialty=1; + // * All of this obj_creation setting is just to keep things working + obj_creation.founding = chapter_object.founding; + obj_creation.successors = chapter_object.successors; + obj_creation.homeworld_rule = chapter_object.homeworld_rule; + obj_creation.chapter_name = chapter_object.name; + + obj_creation.icon = chapter_object.icon; + obj_creation.icon_name = chapter_object.icon_name; + obj_creation.fleet_type = chapter_object.fleet_type; + obj_creation.strength = chapter_object.strength; + obj_creation.purity = chapter_object.purity; + obj_creation.stability = chapter_object.stability; + obj_creation.cooperation = chapter_object.cooperation; - company_title[1]="The Blackwings";company_title[2]="The Shadowborne";company_title[3]="The Ghoststalkers"; - company_title[4]="The Silent";company_title[5]="The Watchful";company_title[6]="The Darkened Blades"; - company_title[7]="The Whisperclaws";company_title[8]="The Unseen";company_title[9]="The Dirgesingers";company_title[10]="The Subtle"; - for(i=100;i<=102;i++){ - role[i,5]="Shadow Captain";wep1[i,5]="Lightning Claw"; - role[i,2]="Shadow Warden";mobi[i,2]="Jump Pack"; + obj_creation.homeworld_exists = chapter_object.homeworld_exists; + obj_creation.homeworld = chapter_object.homeworld; + obj_creation.homeworld_rule = chapter_object.homeworld_rule; + obj_creation.homeworld_name = chapter_object.homeworld_name; + + obj_creation.recruiting_exists = chapter_object.recruiting_exists; + obj_creation.recruiting = chapter_object.recruiting; + obj_creation.recruiting_name = chapter_object.recruiting_name; + + obj_creation.aspirant_trial = trial_map(chapter_object.aspirant_trial); + obj_creation.adv = chapter_object.advantages; + obj_creation.dis = chapter_object.disadvantages; + + obj_creation.full_liveries = chapter_object.full_liveries; + obj_creation.complex_livery_data = chapter_object.complex_livery_data; + if (obj_creation.full_liveries!=""){ + obj_creation.livery_picker.map_colour = full_liveries[0]; + obj_creation.livery_picker.role_set = 0; } - } - - if (argument0="Black Templars"){founding=4;points=200; - selected_chapter=10;chapter=argument0;icon=10;icon_name="bt";founding=4; - fleet_type=3;strength=5;purity=7;stability=10;cooperation=5; - adv[1]="Melee Enthusiasts";adv[2]="Kings of Space";adv[3]="Reverent Guardians";adv[4]="Brothers, All";dis[1]="Psyker Intolerant";dis[2]="Suspicious"; - homeworld_exists=0;recruiting_exists=1; - recruiting_name=global.name_generator.generate_star_name(); - aspirant_trial=eTrials.APPRENTICESHIP; - // Pauldron2: Left, Pauldron: Right - color_to_main="Black";color_to_secondary="Black";color_to_trim="Silver"; - color_to_pauldron2="White";color_to_pauldron="White";color_to_lens="Dark Red"; - color_to_weapon="Black";col_special=0;trim=0; - battle_cry="No Pity! No Remorse! No Fear"; - equal_specialists=1;load_to_ships=[2,0,0];successors=0; - mutations=2;mutations_selected=2; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=1; - zygote=0;betchers=1;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - hchaplain="Grimaldus"; fmaster="Jurisian"; recruiter="Emrik"; - admiral="Stenheir";hapothecary="Colber"; - disposition[1]=50;// Prog - disposition[2]=60;//Imperium - disposition[3]=40;//Admech - disposition[4]=30;//Inquisition - disposition[5]=80;//Ecclesiarchy - disposition[6]=35;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Helbrecht";chapter_master_melee=5; - chapter_master_ranged=2;chapter_master_specialty=2; - role[i,5]="Marshall";wep1[i,5]="Power Sword"; - role[i,3]="Sword Brother"; - } - -if (argument0="Minotaurs"){founding=10;points=450; - selected_chapter=11;chapter=argument0;icon=11;icon_name="min";founding=10; - fleet_type=2;strength=5;purity=10;stability=10;cooperation=2; - adv[1]="Paragon";adv[2]="Siege Masters";adv[3]="Boarders";adv[4]="Enemy: Fallen";dis[1]="Suspicious"; - homeworld_exists=0;recruiting_exists=1; - recruiting="Death";recruiting_name=global.name_generator.generate_star_name(); - homeworld_rule=0;aspirant_trial=eTrials.CHALLENGE; - // Pauldron2: Left, Pauldron: Right - color_to_main="Lightest Brown";color_to_secondary="Lightest Brown";color_to_trim="Light Brown"; - color_to_pauldron2="Dark Red";color_to_pauldron="Dark Red";color_to_lens="Red"; - color_to_weapon="Dark Red";col_special=0;trim=1; - hchaplain="Ivanus Enkomi"; - fmaster="Varro Crag";clibrarian="Lykos Gorgon";hapothecary="Raze Korthos" - recruiter="Axion Eurytos";admiral="Thoul Brontes"; - battle_cry="..."; - equal_specialists=0;load_to_ships=[2,0,0];successors=0; - mutations=0;mutations_selected=0; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - disposition[1]=0;// Prog - disposition[2]=100;//Imperium - disposition[3]=50;//Admech - disposition[4]=60;//Inquisition - disposition[5]=25;//Ecclesiarchy - disposition[6]=30;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Asterion Moloc";chapter_master_melee=5; - chapter_master_ranged=7;chapter_master_specialty=2; - } - - - if (argument0="Blood Ravens"){ - founding=10;points=100; - selected_chapter=12;chapter=argument0;icon=12;icon_name="br"; - fleet_type=2;strength=5;purity=10;stability=6;cooperation=7; - adv[1]="Scavengers";adv[2]="Psyker Abundance";dis[1]="Suspicious"; - hapothecary="Galan";hchaplain="Mikelus";clibrarian="Jonah Orion";fmaster="Martellus"; - honorcapt="Apollo Diomedes";watchmaster="Yriel Rikarius";marchmaster="Aramus"; - ritesmaster="Tarkus";victualler="Atanaxis";lordexec="Thaddeus";relmaster="Avitus";recruiter="Cyrus"; - homeworld="Dead";homeworld_name="Aurelia";flagship_name="Omnis Arcanum"; - homeworld_exists=0;recruiting_exists=1; - recruiting="Death";recruiting_name="Trontiux"; - homeworld_rule=0;aspirant_trial=eTrials.KNOWLEDGE; - // Pauldron2: Left, Pauldron: Right - color_to_main="Sanguine Red";color_to_secondary="Sanguine Red";color_to_trim="Lighter Black"; - color_to_pauldron2="Bone";color_to_pauldron="Bone";color_to_lens="Lime"; - color_to_weapon="Black";col_special=0;trim=1; - battle_cry=choose("None shall find us wanting.","Knowledge is power, guard it well"); - equal_specialists=0;load_to_ships=[2,0,0];successors=0; - mutations=0;mutations_selected=0; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - disposition[1]=50;// Prog - disposition[2]=40;disposition[3]=30;disposition[4]=45;disposition[5]=25; - disposition[6]=35;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Gabriel Angelos";chapter_master_melee=4; - chapter_master_ranged=3;chapter_master_specialty=1; - } + obj_creation.color_to_main = chapter_object.colors.main; + obj_creation.color_to_secondary = chapter_object.colors.secondary; + obj_creation.color_to_pauldron = chapter_object.colors.pauldron_l; + obj_creation.color_to_pauldron2 = chapter_object.colors.pauldron_r; + obj_creation.color_to_trim = chapter_object.colors.trim; + obj_creation.color_to_lens = chapter_object.colors.lens; + obj_creation.color_to_weapon = chapter_object.colors.weapon; + obj_creation.col_special = chapter_object.colors.special; + //obj_creation.trim = chapter_object.colors.trim_on; + with (obj_creation){ + if (array_length(col)>0){ + if (color_to_main!=""){ + main_color = max(array_find_value(col,color_to_main),0); + color_to_main = ""; + } + if (color_to_secondary!=""){ + secondary_color = max(array_find_value(col,color_to_secondary),0); + color_to_secondary = ""; + } + if (color_to_trim!=""){ + main_trim = max(array_find_value(col,color_to_trim),0); + color_to_trim = ""; + } + if (color_to_pauldron2!=""){ + right_pauldron = max(array_find_value(col,color_to_pauldron2),0); + color_to_pauldron2 = ""; + } + if (color_to_pauldron!=""){ + left_pauldron = max(array_find_value(col,color_to_pauldron),0); + color_to_pauldron = ""; + } + if (color_to_lens!=""){ + lens_color = max(array_find_value(col,color_to_lens),0); + color_to_lens = ""; + } + if (color_to_weapon!=""){ + weapon_color = max(array_find_value(col,color_to_weapon),0); + color_to_weapon = ""; + } + } + if (obj_creation.full_liveries==""){ + var struct_cols = { + main_color :main_color, + secondary_color:secondary_color, + main_trim:main_trim, + right_pauldron:right_pauldron, + left_pauldron:left_pauldron, + lens_color:lens_color, + weapon_color:weapon_color + } + obj_creation.livery_picker = new ColourItem(100,230); + obj_creation.livery_picker.scr_unit_draw_data(); + obj_creation.livery_picker.set_default_armour(struct_cols,col_special); + obj_creation.full_liveries = array_create(21,DeepCloneStruct(obj_creation.livery_picker.map_colour)); + obj_creation.full_liveries[eROLE.Librarian] = obj_creation.livery_picker.set_default_librarian(struct_cols); + + obj_creation.full_liveries[eROLE.Chaplain] = obj_creation.livery_picker.set_default_chaplain(struct_cols); + + obj_creation.full_liveries[eROLE.Apothecary] = obj_creation.livery_picker.set_default_apothecary(struct_cols); + + obj_creation.full_liveries[eROLE.Techmarine] = obj_creation.livery_picker.set_default_techmarines(struct_cols); + obj_creation.livery_picker.scr_unit_draw_data(); + obj_creation.livery_picker.set_default_armour(struct_cols,col_special); + } + obj_creation.livery_picker.map_colour = full_liveries[0]; + obj_creation.livery_picker.role_set = 0; + } + // handles making sure blank names are generated properly and only + // actual values being set in the json will overwrite them + struct_foreach(chapter_object.names, function(key, val){ + if(val != ""){ + struct_set(obj_creation, key, val); + } + }); -if (argument0="Crimson Fists"){founding=4;points=150; - selected_chapter=13;chapter=argument0;icon=4;icon_name="cf";fleet_type=1;strength=2;purity=7;stability=10;cooperation=8; - adv[1]="Bolter Drilling";adv[2]="Enemy: Orks";dis[1]="Sieged"; - homeworld="Agri";homeworld_name="Rynn's World"; - homeworld_exists=1;recruiting_exists=0;homeworld_rule=1;aspirant_trial=eTrials.CHALLENGE - color_to_main="Blue";color_to_secondary="Blue";color_to_trim="White";color_to_pauldron="Blue" - color_to_pauldron2="Blue";color_to_lens="Red";color_to_weapon="Black" - hapothecary="Curien Droga";hchaplain="Marqol Tomasi";clibrarian="Eustace Mendoza";fmaster="Javier Adon"; - honorcapt="Alessio Cortez";watchmaster="Steffan Hios";arsenalmaster="Faradis Anto";admiral="Isidore Haleous"; - marchmaster="Balthazar";recruiter="Ishmael Icario" - battle_cry="There is only the Emperor! He is our shield and our protector!"; - equal_specialists=0;load_to_ships=[2,0,0];successors=0; - mutations=2;mutations_selected=2; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=1; - zygote=0;betchers=1;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - disposition[1]=60;// Prog - disposition[2]=80;disposition[3]=50;disposition[4]=50;disposition[5]=50; - disposition[6]=60;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Pedro Kantor";chapter_master_melee=1; - chapter_master_ranged=1;chapter_master_specialty=1; - - company_title[1]="The Righteous Crusaders";company_title[2]="The Shieldwall";company_title[3]="The Red Lightning"; - company_title[4]="The Crimson Lancers";company_title[5]="The War Riders";company_title[6]="Iron Guardians"; - company_title[7]="The Wardens of Rynn";company_title[8]="The Red Path";company_title[9]="The Fists of Rynn"; - company_title[10]="The Wayfinders"; + obj_creation.battle_cry = chapter_object.battle_cry; + obj_creation.discipline = chapter_object.discipline; -} -if (argument0="Lamenters"){founding=5;points=150; - selected_chapter=14;chapter=argument0;icon=14;icon_name="cd"; - fleet_type=3;strength=5;purity=8;stability=4;cooperation=5; - adv[1]="Melee Enthusiasts";adv[2]="Boarders";dis[1]="Suspicious"; - homeworld="Dead";homeworld_name="Lacrima Vex"; - homeworld_exists=0;recruiting_exists=1; - recruiting="Death";recruiting_name=global.name_generator.generate_star_name(); - homeworld_rule=0;aspirant_trial=eTrials.CHALLENGE; - // Pauldron2: Left, Pauldron: Right - color_to_main="Yellow";color_to_secondary="Yellow";color_to_trim="Dark Gold"; - color_to_pauldron2="Yellow";color_to_pauldron="Yellow";color_to_lens="Red"; - color_to_weapon="Black";col_special=0;trim=0; - battle_cry="For those we cherish, we die in Glory"; - equal_specialists=0;load_to_ships=[2,0,0];successors=0; - mutations=0;mutations_selected=0; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - disposition[1]=60;// Prog - disposition[2]=15;disposition[3]=20;disposition[4]=10;disposition[5]=25; - disposition[6]=50;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Malakim Phoros";chapter_master_melee=3; - chapter_master_ranged=2;chapter_master_specialty=2; - } - - if (argument0="Carcharodons"){founding=9;points=100; - selected_chapter=15;chapter=argument0;icon=15;icon_name="cd"; - fleet_type=2;strength=5;purity=8;stability=4;cooperation=5; - adv[1]="Melee Enthusiasts";adv[2]="Boarders";adv[3]="Kings of Space";dis[1]="Splintered";dis[2]="Suspicious"; - homeworld_exists=0;recruiting_exists=0;flagship_name="Nicor"; - recruiting="Death";recruiting_name=global.name_generator.generate_star_name(); - homeworld_rule=0;aspirant_trial=eTrials.CHALLENGE; - color_to_main="Codex Grey";color_to_secondary="Codex Grey";color_to_trim="Copper"; - color_to_pauldron2="Dark Grey";color_to_pauldron="Dark Grey";color_to_lens="Red"; - color_to_weapon="Black";col_special=0;trim=1; - hapothecary="Tamaron";hchaplain="Niko'manu";clibrarian="Te Kahurangi";fmaster="Uthulu"; - honorcapt="Tagaloa";watchmaster="Akamu";arsenalmaster="Akia";admiral="Mannfor";marchmaster="Fa'atiu"; - ritesmaster="Mafui'e";victualler="Aleki";lordexec="Atonga";relmaster="Enele";recruiter="Bail Sharr" - battle_cry="Silence"; - equal_specialists=0;load_to_ships=[2,1,1];successors=0; - mutations=1;mutations_selected=1; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=1; - disposition[1]=30;// Prog - disposition[2]=40;disposition[3]=40;disposition[4]=40;disposition[5]=30; - disposition[6]=30;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Tyberos";chapter_master_melee=2; - chapter_master_ranged=1;chapter_master_specialty=2; - role[i,4]="Red Brother"; - role[i,5]="Company Master";wep1[i,5]="Eviscerator"; - role[i,19]="Veteran Strike Leader";wep1[i,19]="Power Axe"; - role[i,18]="Strike Leader";wep1[i,18]="Chainaxe"; - role[i,8]="Void Brother";wep2[i,8]="Chainaxe"; - role[i,10]="Devourer";wep1[i,10]="Chainaxe"; + var load = chapter_object.load_to_ships; + obj_creation.load_to_ships = [load.escort_load, load.split_scouts, load.split_vets]; + obj_creation.equal_specialists = chapter_object.equal_specialists; - } - - if (argument0="Soul Drinkers"){founding="N/A";points=200; - selected_chapter=16;chapter=argument0;icon=14;icon_name="sd";founding= 4; - fleet_type=2;strength=2;purity=10;stability=2;cooperation=2; - adv[1]="Melee Enthusiasts";adv[2]="Kings of Space";adv[3]="Boarders";adv[4]="Daemon Binders";dis[1]="Suspicious"; - homeworld="Dead";homeworld_name="Entymion"; - homeworld_exists=0;recruiting_exists=1; - recruiting="Death";recruiting_name=global.name_generator.generate_star_name(); - homeworld_rule=0;aspirant_trial=eTrials.CHALLENGE; - // Pauldron2: Left, Pauldron: Right - color_to_main="Purple";color_to_secondary="Purple";color_to_trim="Dark Gold"; - color_to_pauldron2="Purple";color_to_pauldron="Purple";color_to_lens="Red"; - color_to_weapon="Purple";col_special=0;trim=1; - battle_cry="Cold and Hard, Soul Drinkers"; - equal_specialists=0;load_to_ships=[2,0,0];successors=0; - mutations=1;mutations_selected=1; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=1;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - disposition[1]=60;// Prog - disposition[2]=15;disposition[3]=20;disposition[4]=10;disposition[5]=25; - disposition[6]=50;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Sarpedon";chapter_master_melee=8; - chapter_master_ranged=3;chapter_master_specialty=3; - } + obj_creation.mutations = 0; + struct_foreach(chapter_object.mutations, function(key, val){ + struct_set(obj_creation, key, val); + if(val == 1) { + obj_creation.mutations += 1; + } + }); + obj_creation.disposition = chapter_object.disposition; - if (argument0="Doom Benefactors"){points=100; - selected_chapter=135;chapter=argument0;icon=0;icon_name="eye";founding=0;scr_icon(""); - fleet_type=1;strength=1;purity=10;stability=7;cooperation=8; - homeworld="Forge";homeworld_name="Ariana Prime";recruiting="Death";recruiting_name=global.name_generator.generate_star_name(); - homeworld_exists=1;recruiting_exists=1;homeworld_rule=2;aspirant_trial=eTrials.APPRENTICESHIP; - // Pauldron2: Left, Pauldron: Right - color_to_main="Dark Red";color_to_secondary="Black";color_to_trim="Copper"; - color_to_pauldron="Black";color_to_pauldron2="Black";color_to_lens="Sanguine Red"; - color_to_weapon="Black";col_special=0;trim=1; - hapothecary="Vaylund"; - hchaplain="Eli"; - clibrarian="Dagoth"; - fmaster="Mjenzi"; - admiral=global.name_generator.generate_space_marine_name(); - battle_cry="Death to the enemy! DEATH";// monastery_name="Fortress of Hera";master_name= - equal_specialists=0; - - load_to_ships=[2,0,0]; - // load_to_ships=0; - - successors=0; - mutations=0;mutations_selected=0; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - disposition[1]=60;// Prog - disposition[2]=50;disposition[3]=40;disposition[4]=25;disposition[5]=40; - disposition[6]=50;// Astartes - disposition[7]=0;// Reserved - chapter_master_name="Duke Sacerdos";chapter_master_melee=7; - chapter_master_ranged=3;chapter_master_specialty=3; - - adv[1]="Paragon"; - adv[2]="Reverent Guardians"; - adv[3]="Crafters"; - dis[1]="First In, Last Out"; - - stage=6; - } - //generates custom chapter if it exists - if (argument0=chapter21){ - points=100; - selected_chapter=21;chapter=argument0;icon=icon21;icon_name=icon_name21;founding=founding21; - fleet_type=fleet_type21; - strength=strength21; - purity=purity21; - stability=stability21; - cooperation=cooperation21; - homeworld=homeworld21; - homeworld_name=homeworld_name21; - recruiting=recruiting_world21; - recruiting_name=recruiting_name21; - homeworld_exists=homeworld_rule21; - recruiting_exists=recruiting_exists21; - homeworld_rule=homeworld_rule21; - aspirant_trial=aspirant_trial21; - discipline=discipline21; - // Pauldron2: Left, Pauldron: Right - color_to_main=color_to_main21; - color_to_secondary=color_to_secondary21; - color_to_trim=color_to_trim21; - color_to_pauldron2=color_to_pauldron2_21; - color_to_paulrdon=color_to_pauldron21; - color_to_lens=color_to_lens21; - color_to_weapon=color_to_weapon21; - col_special=col_special21;trim=trim21; - hapothecary=hapothecary21; - hchaplain=hchaplain21; - clibrarian=clibrarian21; - fmaster=fmaster21; - admiral=admiral21 - recruiter=recruiter21 - battle_cry=battle_cry_21 - load_to_ships=[2,0,0]; - complex_livery_data = complex_livery21; + obj_creation.chapter_master = chapter_object.chapter_master; + + if(chapter_object.chapter_master.name != ""){ + obj_creation.chapter_master_name = chapter_object.chapter_master.name; + } + obj_creation.chapter_master_melee = chapter_object.chapter_master.melee; + obj_creation.chapter_master_ranged = chapter_object.chapter_master.ranged; + obj_creation.chapter_master_specialty = chapter_object.chapter_master.specialty; + if(struct_exists(chapter_object, "company_titles")){ + obj_creation.company_title = chapter_object.company_titles; + } + + if(struct_exists(chapter_object, "artifact")){ + obj_creation.artifact = chapter_object.artifact; + } - for (var i=1;i<=20;i++){ - role[100][i] = role_21[i]; - wep1[100][i]=wep1_21[i] - wep2[100][i]=wep2_21[i] - armour[100][i]=armour_21[i] - gear[100][i]=gear_21[i] - mobi[100][i]=mobi_21[i] + obj_creation.flagship_name = chapter_object.flagship_name; + obj_creation.extra_ships = chapter_object.extra_ships; + obj_creation.extra_specialists = chapter_object.extra_specialists; + obj_creation.extra_marines = chapter_object.extra_marines; + obj_creation.extra_vehicles = chapter_object.extra_vehicles; + obj_creation.extra_equipment = chapter_object.extra_equipment; + + obj_creation.squad_name = chapter_object.squad_name; + if(struct_exists(chapter_object, "custom_roles")){ + obj_creation.custom_roles = chapter_object.custom_roles; + } + if(struct_exists(chapter_object, "custom_squads")){ + obj_creation.custom_squads = chapter_object.custom_squads; } - - //monastery_name=monastery_name21; - //master_name=master_name21 - equal_specialists=equal_specialists21 - - load_to_ships=[2,0,0]; - // load_to_ships=0; - - successors=successors; - mutations=mutations21; - mutations_selected=mutations_selected21; - preomnor=preomnor21; - voice=voice21; - doomed=doomed21; - lyman=lyman21; - omophagea=omophagea21; - ossmodula=ossmodula21; - membrane=membrane21; - zygote=zygote21; - betchers=betchers21; - catalepsean=catalepsean21; - secretions=secretions; - occulobe=occulobe; - mucranoid=mucranoid21; - disposition[1]=disposition21[1];// Prog - disposition[2]=disposition21[2]; - disposition[3]=disposition21[3]; - disposition[4]=disposition21[4]; - disposition[5]=disposition21[5]; - disposition[6]=disposition21[6];// Astartes - disposition[7]=disposition21[7];// Reserved - chapter_master_name=chapter_master_name21; - chapter_master_melee=chapter_master_melee21; - chapter_master_ranged=chapter_master_ranged21; - chapter_master_specialty=chapter_master_specialty21; - - for(var i = 1; i <= 8; i++){ - adv[i]=adv21[i]; - dis[i]=dis21[i]; - } - } - - /* - if (h=1) then it="Power Fists"; - if (h=2) then it="Relic Blade"; - if (h=3) then it="Master Crafted Thunder Hammer"; - if (h=4) then it="Master Crafted Power Sword"; - if (h=5) then it="Master Crafted Power Axe"; - if (h=6) then it="Master Crafted Eviscerator"; - if (h=7) then it="Master Crafted Force Staff"; - - if (h=1) then it="Integrated Bolters"; - if (h=2) then it="Infernus Pistol"; - if (h=3) then it="Plasma Pistol"; - if (h=4) then it="Plasma Gun"; - if (h=5) then it="Master Crafted Heavy Bolter"; - if (h=6) then it="Master Crafted Meltagun"; - if (h=7) then it="Storm Shield"; - */ + points = chapter_object.points; + maxpoints=chapter_object.points; + } - var i,a;i=0;a=0; - repeat(8){a+=1;i=0; - repeat(40){i+=1; - if (adv[a]!="") and (advantage[i]=adv[a]) then adv_num[a]=i; - if (dis[a]!="") and (disadvantage[i]=dis[a]) then dis_num[a]=i; - } + + for(var a = 0; a < array_length(adv); a++){ + for(var k = 0; k < array_length(obj_creation.all_advantages); k++){ + if(adv[a]!="" && obj_creation.all_advantages[k].name=adv[a]){ + adv_num[a] = k; + } + } + for(var j = 0; j < array_length(obj_creation.all_disadvantages); j++){ + if (dis[a]!="" && obj_creation.all_disadvantages[j].name=dis[a]){ + dis_num[a]=j; + } + } } maxpoints=points; + return true; +} +enum eFLEET_TYPES { + NONE = 0, + HOMEWORLD = 1, + FLEET_BASED, + PENITENCE, +} + +enum eHOMEWORLD_RULE { + NONE = 0, + GOVERNOR = 1, + COUNTRY, + PERSONAL, +} + +enum eCM_SPECIALTY { + NONE = 0, + LEADER = 1, + CHAMPION, + PSYKER, } diff --git a/scripts/scr_chapter_random/scr_chapter_random.gml b/scripts/scr_chapter_random/scr_chapter_random.gml index 7e28edaea..10be3c36a 100644 --- a/scripts/scr_chapter_random/scr_chapter_random.gml +++ b/scripts/scr_chapter_random/scr_chapter_random.gml @@ -1,26 +1,32 @@ +/// @mixin obj_creation +/// @description Called when an empty custom chapter icon is picked, or the custom icon in bottom right is picked from the new game menu. +/// if "Create Custom" is picked, argument0 = 0, if "Create Random" is picked, argument0 = 1 +/// @param {Real} argument0 0 if Blank Custom, 1 if Random function scr_chapter_random(argument0) { - + // argument0 = 0 = create custom + // argument0 = 1 = create random // if argument0=0 then it just gives a name var i;i=-1; - repeat(21){i+=1; - world[i]=""; - world_type[i]=""; - world_feature[i]=""; - } + world = array_create(21, ""); + world_type = array_create(21, ""); + world_feature = array_create(21, ""); + company_title = array_create(11, ""); + adv = array_create(9, ""); + dis = array_create(9, ""); + adv_num = array_create(9, 0); + dis_num = array_create(9, 0); - company_title[0]="";var i;i=0;repeat(40){i+=1;company_title[i]="";} var ran1, ran2, phrase1, phrase2, main, secondary, lens, weapon, found_secret; phrase1="";phrase2=""; - chapter="Unnamed";chapter_string="Unnamed"; + chapter_name="Unnamed";chapter_string="Unnamed"; icon=1;icon_name="da"; founding=1;found_secret=0; points=0;maxpoints=100; fleet_type=1;strength=5;cooperation=5;purity=5;stability=5; - var i;i=-1;repeat(6){i+=1;adv[i]="";adv_num[i]=0;dis[i]="";dis_num[i]=0;} homeworld="Temperate";homeworld_name=global.name_generator.generate_star_name(); recruiting="Death";recruiting_name=global.name_generator.generate_star_name(); flagship_name=global.name_generator.generate_imperial_ship_name(); @@ -28,8 +34,8 @@ function scr_chapter_random(argument0) { homeworld_rule=1;aspirant_trial=eTrials.BLOODDUEL; discipline="default";battle_cry="For the Emperor"; - main_color=1;secondary_color=1;trim_color=1; - pauldron2_color=1;pauldron_color=1;// Left/Right pauldron + main_color=1;secondary_color=1;main_trim=1; + left_pauldron=1;right_pauldron=1;// Left/Right pauldron lens_color=1;weapon_color=1;col_special=choose(0,0,0,0,0,1,2,3); color_to_main=""; @@ -40,42 +46,47 @@ function scr_chapter_random(argument0) { color_to_lens=""; color_to_weapon=""; - hapothecary=global.name_generator.generate_space_marine_name();hchaplain=global.name_generator.generate_space_marine_name();clibrarian=global.name_generator.generate_space_marine_name(); - fmaster=global.name_generator.generate_space_marine_name();recruiter=global.name_generator.generate_space_marine_name();admiral=global.name_generator.generate_space_marine_name(); + hapothecary=global.name_generator.generate_space_marine_name(); + hchaplain=global.name_generator.generate_space_marine_name(); + clibrarian=global.name_generator.generate_space_marine_name(); + fmaster=global.name_generator.generate_space_marine_name(); + recruiter=global.name_generator.generate_space_marine_name(); + admiral=global.name_generator.generate_space_marine_name(); equal_specialists=0;load_to_ships=[2,0,0];successors=0; mutations=0;mutations_selected=0; preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; - disposition[0]=0; - disposition[1]=0;// Prog - disposition[2]=0;// Imp - disposition[3]=0;// Mech - disposition[4]=0;// Inq - disposition[5]=0;// Ecclesiarchy - disposition[6]=0;// Astartes - disposition[7]=0;// Reserved + disposition = array_create(8, 0); + // disposition[0]=0; + // disposition[1]=0;// Prog + // disposition[2]=0;// Imp + // disposition[3]=0;// Mech + // disposition[4]=0;// Inq + // disposition[5]=0;// Ecclesiarchy + // disposition[6]=0;// Astartes + // disposition[7]=0;// Reserved chapter_master_name=global.name_generator.generate_space_marine_name(); chapter_master_melee=1; chapter_master_ranged=1; chapter_master_specialty=choose(1,1,1,1,1,2,2,2,2,2,3); + custom_roles = {}; - - + // create random if (argument0=1){ strength=choose(2,3,4,5,6,7,8); purity=choose(2,3,4,5,6,7,8);if (strength<5) then purity+=2; stability=choose(2,3,4,5,6,7,8);if (purity<5) then stability+=2; cooperation=choose(2,3,4,5,6,7,8);if (stability<5) then cooperation+=2; - founding=10;found_secret=floor(random(20))+1; + founding=10;found_secret=floor(random(10))+1; custom=1;points=100;maxpoints=100; battle_cry="For the Emperor"; @@ -90,6 +101,7 @@ function scr_chapter_random(argument0) { ran2=floor(random(95))+1; ran3=floor(random(9))+1; + //create random if (argument0=1){ mutations=0;mutations_selected=0;mutation=""; preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; @@ -98,9 +110,9 @@ function scr_chapter_random(argument0) { if (found_secret=1){adv[1]="Enemy: Fallen";dis[1]="Never Forgive";} if (found_secret=2) then adv[1]="Lightning Warriors"; - if (found_secret=3){adv[1]="Melee Enthusiasts";dis[1]="Suspicious";} + if (found_secret=3){adv[1]="Assault Doctrine";dis[1]="Suspicious";} if (found_secret=4){adv[1]="Bolter Drilling";betchers=1;membrane=1;mutations_selected+=2;mutations+=2;mutat=2;} - if (found_secret=5){adv[1]="Melee Enthusiasts";dis[1]="Black Rage";disadvantage1=1;} + if (found_secret=5){adv[1]="Assault Doctrine";dis[1]="Black Rage";disadvantage1=1;} if (found_secret=6){adv[1]="Tech-Brothers";dis[1]="Psyker Intolerant";} // if (found_secret=7) then founding="Ultramarines"; if (found_secret=8){adv[1]="Crafters";dis[1]="Tolerant";secretions=1;mutations+=1;mutations_selected+=1;mutat+=1;} @@ -338,13 +350,68 @@ function scr_chapter_random(argument0) { color_to_weapon=col_weapon; trim=choose(0,1); - chapter=string(phrase1)+" "+string(phrase2);chapter_string=chapter; - - + if (color_to_main!=""){ + main_color = max(array_find_value(col,color_to_main),0); + color_to_main = ""; + } + if (color_to_secondary!=""){ + secondary_color = max(array_find_value(col,color_to_secondary),0); + color_to_secondary = ""; + } + if (color_to_trim!=""){ + main_trim = max(array_find_value(col,color_to_trim),0); + color_to_trim = ""; + } + if (color_to_pauldron!=""){ + right_pauldron = max(array_find_value(col,color_to_pauldron),0); + color_to_pauldron = ""; + } + if (color_to_pauldron2!=""){ + left_pauldron = max(array_find_value(col,color_to_pauldron2),0); + color_to_pauldron2 = ""; + } + if (color_to_lens!=""){ + lens_color = max(array_find_value(col,color_to_lens),0); + color_to_lens = ""; + } + if (color_to_weapon!=""){ + weapon_color = max(array_find_value(col,color_to_weapon),0); + color_to_weapon = ""; + } + + //TODO add some funcky stuff for custom random complex livery + var struct_cols = { + main_color :main_color, + secondary_color:secondary_color, + main_trim:main_trim, + right_pauldron:right_pauldron, + left_pauldron:left_pauldron, + lens_color:lens_color, + weapon_color:weapon_color + } + obj_creation.livery_picker = new ColourItem(100,230); + obj_creation.livery_picker.scr_unit_draw_data(); + obj_creation.livery_picker.set_default_armour(struct_cols,col_special); + obj_creation.full_liveries = array_create(21,DeepCloneStruct(obj_creation.livery_picker.map_colour)); + obj_creation.full_liveries[eROLE.Librarian] = obj_creation.livery_picker.set_default_librarian(struct_cols); + + obj_creation.full_liveries[eROLE.Chaplain] = obj_creation.livery_picker.set_default_chaplain(struct_cols); + + obj_creation.full_liveries[eROLE.Apothecary] = obj_creation.livery_picker.set_default_apothecary(struct_cols); + + obj_creation.full_liveries[eROLE.Techmarine] = obj_creation.livery_picker.set_default_techmarines(struct_cols); + obj_creation.livery_picker.scr_unit_draw_data(); + obj_creation.livery_picker.set_default_armour(struct_cols,col_special); + + obj_creation.livery_picker.map_colour = full_liveries[0]; + obj_creation.livery_picker.role_set = 0; + chapter_name=string(phrase1)+" "+string(phrase2);chapter_string=chapter_name; + + monastery_name = ""; if (argument0=1){ homeworld_rule=choose(1,1,1,2,2,3,3); - chapter=string(phrase1)+" "+string(phrase2); - chapter_string=chapter; + chapter_name=string(phrase1)+" "+string(phrase2); + chapter_string=chapter_name; fleet_type=choose(1,2,3); // if (fleet_type=2) then monastery_name=string(phrase1)+" Hold"; @@ -363,6 +430,7 @@ function scr_chapter_random(argument0) { if (argument0=1) then other1=founding; if (argument0=0) then fleet_type=choose(1,2); + cooldown=8000; diff --git a/scripts/scr_cheatcode/scr_cheatcode.gml b/scripts/scr_cheatcode/scr_cheatcode.gml index 6513e1809..6ef5c5248 100644 --- a/scripts/scr_cheatcode/scr_cheatcode.gml +++ b/scripts/scr_cheatcode/scr_cheatcode.gml @@ -47,7 +47,7 @@ function scr_cheatcode(argument0) { } break; case "newapoth": - obj_controller.apothecary_points = 50; + obj_controller.apothecary_training_points = 50; break; case "newpsyk": obj_controller.psyker_points = 70; @@ -65,10 +65,10 @@ function scr_cheatcode(argument0) { break; case "artifact": if (cheat_arguments[0] == "1") { - scr_add_artifact("random", "", 6, obj_ini.ship[1], 501); + scr_add_artifact("random", "", 6, obj_ini.ship[0], 501); } else { repeat(real(cheat_arguments[1])){ - scr_add_artifact(cheat_arguments[0], "", 6, obj_ini.ship[1], 501); + scr_add_artifact(cheat_arguments[0], "", 6, obj_ini.ship[0], 501); } } break; @@ -113,11 +113,11 @@ function scr_cheatcode(argument0) { break; case "inquisarti": scr_quest(0, "artifact_loan", 4, 10); - var last_artifact = scr_add_artifact("good", "inquisition", 0, obj_ini.ship[1], 501); + var last_artifact = scr_add_artifact("good", "inquisition", 0, obj_ini.ship[0], 501); break; case "govmission": with (obj_star) { - for (i = 1; i <= planets; i++) { + for (var i = 1; i <= planets; i++) { var existing_problem = false; //has_any_problem_planet(i); if (!existing_problem) { if (p_owner[i] == eFACTION.Imperium) { @@ -130,14 +130,14 @@ function scr_cheatcode(argument0) { break; case "artifactpopulate": with (obj_star) { - for (i = 1; i <= planets; i++) { + for (var i = 1; i <= planets; i++) { array_push(p_feature[i], new NewPlanetFeature(P_features.Artifact)); } } break; case "ruinspopulate": with (obj_star) { - for (i = 1; i <= planets; i++) { + for (var i = 1; i <= planets; i++) { array_push(p_feature[i], new NewPlanetFeature(P_features.Ancient_Ruins)); } } @@ -280,6 +280,13 @@ function scr_cheatcode(argument0) { scr_alert("green", "recruitment", (string(obj_controller.recruit_name[i]) + "has started training."), 0, 0) } break; + case "shiplostevent": + loose_ship_to_warp_event(); + break; + case "recoverlostship": + return_lost_ship(); + break; + } } } catch(_exception) { diff --git a/scripts/scr_check_equip/scr_check_equip.gml b/scripts/scr_check_equip/scr_check_equip.gml index ac8b0f879..53b2ac064 100644 --- a/scripts/scr_check_equip/scr_check_equip.gml +++ b/scripts/scr_check_equip/scr_check_equip.gml @@ -9,17 +9,17 @@ function scr_check_equip(search_item, system, planet_or_ship_id, remove_item) { - var man_c=0,man_i=0,c=0,i=0,have=0, unit, marine_present; + var man_c=0,man_i=0,have=0, unit, marine_present; - for (c=0;c<=10;c++){ - for (i=1;i<=500;i++){ + for (var c=0;c<=10;c++){ + for (var i=1;i<=500;i++){ if (obj_ini.name[c][i]=="") then continue; marine_present=false; if (!instance_exists(obj_ncombat)){ unit = obj_ini.TTRPG[c][i]; if (system!="") and (planet_or_ship_id>0){ - if (unit.is_at_location(system,planet_or_ship_id,0)){ + if (unit.is_at_location(system,planet_or_ship_id,-1)){ marine_present=true; } } diff --git a/scripts/scr_colour_modifiers/scr_colour_modifiers.gml b/scripts/scr_colour_modifiers/scr_colour_modifiers.gml deleted file mode 100644 index 1dded6b6d..000000000 --- a/scripts/scr_colour_modifiers/scr_colour_modifiers.gml +++ /dev/null @@ -1,25 +0,0 @@ -/// calculate_shadow_color(original_color, shadow_intensity) -/// Returns a shadow color by applying gamma correction to the given RGB color. - - -function shadow_creator(red,green,blue, shadow,gamma = 2.2){ - - var original_color, shadow_intensity; - - // Apply gamma correction to each RGB component - // You can experiment with different gamma values - var shadow_color = make_color_rgb( - power(red / 255, gamma) * 255, - power(green/ 255, gamma) * 255, - power(blue / 255, gamma) * 255 - ); - - // Darken the color further based on the shadow intensity - shadow_color = make_color_rgb( - color_get_red(shadow_color) * shadow, - color_get_red(shadow_color) * shadow, - color_get_red(shadow_color) * shadow - ); - - return shadow_color; -}//33,30,132 \ No newline at end of file diff --git a/scripts/scr_colour_modifiers/scr_colour_modifiers.yy b/scripts/scr_colour_modifiers/scr_colour_modifiers.yy deleted file mode 100644 index dda2dee26..000000000 --- a/scripts/scr_colour_modifiers/scr_colour_modifiers.yy +++ /dev/null @@ -1,11 +0,0 @@ -{ - "resourceType": "GMScript", - "resourceVersion": "1.0", - "name": "scr_colour_modifiers", - "isCompatibility": false, - "isDnD": false, - "parent": { - "name": "User Interface", - "path": "folders/Scripts/User Interface.yy", - }, -} \ No newline at end of file diff --git a/scripts/scr_company_order/scr_company_order.gml b/scripts/scr_company_order/scr_company_order.gml index cedc635a9..1d9c4400c 100644 --- a/scripts/scr_company_order/scr_company_order.gml +++ b/scripts/scr_company_order/scr_company_order.gml @@ -197,7 +197,7 @@ function scr_company_order(company) { } //if no new sergeants are found for squad someone gets promoted //find a new_sergeant - var _sarge = _roles[Role.SERGEANT] + var _sarge = _roles[eROLE.Sergeant] if (struct_exists(squad.required, _sarge)){ if (squad.required[$ _sarge] > 0){ squad.new_sergeant(); @@ -205,7 +205,7 @@ function scr_company_order(company) { } } //find a new veteran sergeant - var _vet_sarge = _roles[Role.VETERAN_SERGEANT]; + var _vet_sarge = _roles[eROLE.VeteranSergeant]; if (struct_exists(squad.required, _vet_sarge)){ if (squad.required[$ _vet_sarge] > 0){ squad.new_sergeant(true); @@ -237,14 +237,14 @@ function scr_company_order(company) { var squadless_and_squad_spaces = [squadless,empty_squads]; var squad_builder = [ - ["tactical_squad",_roles[Role.TACTICAL],5], - ["devastator_squad",_roles[Role.DEVASTATOR],5], - ["sternguard_veteran_squad",_roles[Role.VETERAN],5], - ["vanguard_veteran_squad",_roles[Role.VETERAN],5], - ["terminator_squad",_roles[Role.TERMINATOR],4], - ["terminator_assault_squad",_roles[Role.TERMINATOR],4], - ["assault_squad",_roles[Role.ASSAULT],5], - ["scout_squad",_roles[Role.SCOUT],5], + ["tactical_squad",_roles[eROLE.Tactical],5], + ["devastator_squad",_roles[eROLE.Devastator],5], + ["sternguard_veteran_squad",_roles[eROLE.Veteran],5], + ["vanguard_veteran_squad",_roles[eROLE.Veteran],5], + ["terminator_squad",_roles[eROLE.Terminator],4], + ["terminator_assault_squad",_roles[eROLE.Terminator],4], + ["assault_squad",_roles[eROLE.Assault],5], + ["scout_squad",_roles[eROLE.Scout],5], ] for (i=0;i0) && (array_length(squadless[$_roles[Role.CHAMPION]])>0) && (array_length(squadless[$_roles[Role.ANCIENT]])>0){ + if (struct_exists(squadless,_roles[eROLE.Captain])) && (struct_exists(squadless,_roles[eROLE.Champion])) && (struct_exists(squadless,_roles[eROLE.Ancient])){ + if (array_length(squadless[$_roles[eROLE.Captain]])>0) && (array_length(squadless[$_roles[eROLE.Champion]])>0) && (array_length(squadless[$_roles[eROLE.Ancient]])>0){ new_squad_index=false; if (array_length(empty_squads)>0){ new_squad_index = empty_squads[0]; @@ -367,35 +367,35 @@ function role_hierarchy(){ "Forge Master", "Master of Sanctity", "Master of the Apothecarion", - string("Chief {0}",_roles[Role.LIBRARIAN]), - _roles[Role.HONOUR_GUARD], - _roles[Role.CAPTAIN], - _roles[Role.CHAPLAIN], - string("{0} Aspirant",_roles[Role.CHAPLAIN]), + string("Chief {0}",_roles[eROLE.Librarian]), + _roles[eROLE.HonourGuard], + _roles[eROLE.Captain], + _roles[eROLE.Chaplain], + string("{0} Aspirant",_roles[eROLE.Chaplain]), "Death Company", - _roles[Role.TECHMARINE], - string("{0} Aspirant",_roles[Role.TECHMARINE]), + _roles[eROLE.Techmarine], + string("{0} Aspirant",_roles[eROLE.Techmarine]), "Techpriest", - _roles[Role.APOTHECARY], - string("{0} Aspirant",_roles[Role.APOTHECARY]), + _roles[eROLE.Apothecary], + string("{0} Aspirant",_roles[eROLE.Apothecary]), "Sister Hospitaler", - _roles[Role.LIBRARIAN], + _roles[eROLE.Librarian], "Codiciery", "Lexicanum", - string("{0} Aspirant",_roles[Role.LIBRARIAN]), - _roles[Role.ANCIENT], - _roles[Role.CHAMPION], + string("{0} Aspirant",_roles[eROLE.Librarian]), + _roles[eROLE.Ancient], + _roles[eROLE.Champion], "Death Company", - _roles[Role.VETERAN_SERGEANT], - _roles[Role.SERGEANT], - _roles[Role.TERMINATOR], - _roles[Role.VETERAN], - _roles[Role.TACTICAL], - _roles[Role.ASSAULT], - _roles[Role.DEVASTATOR], - _roles[Role.SCOUT], - $"Venerable {_roles[Role.DREADNOUGHT]}", - _roles[Role.DREADNOUGHT], + _roles[eROLE.VeteranSergeant], + _roles[eROLE.Sergeant], + _roles[eROLE.Terminator], + _roles[eROLE.Veteran], + _roles[eROLE.Tactical], + _roles[eROLE.Assault], + _roles[eROLE.Devastator], + _roles[eROLE.Scout], + $"Venerable {_roles[eROLE.Dreadnought]}", + _roles[eROLE.Dreadnought], "Skitarii", "Crusader", "Ranger", diff --git a/scripts/scr_company_struct/scr_company_struct.gml b/scripts/scr_company_struct/scr_company_struct.gml index 77980955e..dfc8542bf 100644 --- a/scripts/scr_company_struct/scr_company_struct.gml +++ b/scripts/scr_company_struct/scr_company_struct.gml @@ -52,11 +52,11 @@ function CompanyStruct(comp) constructor{ for (var i=0;i0){ + if (obj_ini.veh_lid[unit[0]][unit[1]]>-1){ array_push(ma_loc,obj_ini.ship_location[obj_ini.veh_lid[unit[0]][unit[1]]]); } else { array_push(ma_loc,obj_ini.veh_loc[unit[0]][unit[1]]); @@ -118,6 +120,7 @@ function add_vehicle_to_manage_arrays(unit){ array_push(ma_promote,0); array_push(ma_god,0); array_push(ma_view,true); + array_push(squad, -1); } } @@ -188,7 +191,7 @@ function scr_company_view(company) { // Check if unit is on a lost ship if ( - obj_ini.veh_lid[company][i] > 0 && + obj_ini.veh_lid[company][i] > -1 && obj_ini.ship_location[obj_ini.veh_lid[company][i]] == "Lost" ) { continue @@ -218,8 +221,7 @@ function scr_company_view(company) { } function other_manage_data(){ - var v, mans, bad, squads, squad_type, squad_loc, squad_members, unit, unit_loc; - v=0; + var mans, bad, squads, squad_type, squad_loc, squad_members, unit, unit_loc; mans=0; bad=0; squads=0; @@ -361,6 +363,7 @@ function filter_and_sort_company(type, specific){ var tempprom =ma_promote[a]; var tempdis =display_unit[a]; var tempview = ma_view[a]; + var temp_squad = squad[a] man[a]=man[b]; ide[a]=ide[b]; @@ -380,6 +383,7 @@ function filter_and_sort_company(type, specific){ ma_promote[a]=ma_promote[b]; display_unit[a] =display_unit[b]; ma_view[a] =ma_view[b]; + squad[a] = squad[b] man[b]=tempman; ide[b]=tempide; @@ -398,7 +402,8 @@ function filter_and_sort_company(type, specific){ ma_exp[b]= tempexp; ma_promote[b]= tempprom; display_unit[b] = tempdis; - ma_view[b] = tempview; + ma_view[b] = tempview; + squad[b] = temp_squad; } if (type=="stat"){ var swapped; @@ -489,3 +494,31 @@ function company_manage_actions(){ switch_view_company(new_view) } } + +function ui_manage_hotkeys(){ + if (managing >=0){ + for (var i=1;i<10;i++){ + if (press_exclusive(ord(string(i)))){ + switch_view_company(i); + } + } + if (press_exclusive(ord("0"))){ + switch_view_company(10); + } + else if (press_exclusive(ord("Q"))){ + switch_view_company(11); + } + else if (press_exclusive(ord("E"))){ + switch_view_company(12); + } + else if (press_exclusive(ord("R"))){ + switch_view_company(13); + } + else if (press_exclusive(ord("T"))){ + switch_view_company(14); + } + else if (press_exclusive(ord("Y"))){ + switch_view_company(15); + } + } +} diff --git a/scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml b/scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml new file mode 100644 index 000000000..5292d0217 --- /dev/null +++ b/scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml @@ -0,0 +1,370 @@ +function coord_relevative_positions(coords, xx, yy){ + return [coords[0]+xx, coords[1]+yy,coords[2]+xx, coords[3]+yy]; +} + +enum eMarkings { + RIGHTPAD, + LEFTPAD, + LEFTKNEE, + RIGHTKNEE +} +function ColourItem(xx,yy) constructor{ + self.xx=xx; + self.yy=yy; + data_slate = new DataSlate(); + static scr_unit_draw_data = function(){ + map_colour = { + is_changed : false, + left_leg_lower : 0, + left_leg_upper : 0, + left_leg_knee : 0, + right_leg_lower : 0, + right_leg_upper : 0, + right_leg_knee : 0, + metallic_trim : 0, + right_trim : 0, + left_trim : 0, + left_chest : 0, + right_chest : 0, + left_thorax : 0, + right_thorax : 0, + left_pauldron : 0, + left_arm : 0, + left_hand : 0, + right_pauldron: 0, + right_arm : 0, + right_hand : 0, + left_head : 0, + right_head: 0, + left_muzzle: 0, + right_muzzle: 0, + eye_lense :0, + right_backpack : 0, + left_backpack : 0, + weapon_primary : 0, + weapon_secondary : 0, + company_marks : 0, + company_marks_loc : 0, + } + return map_colour; + } + + role_set=0; + static image_location_maps = { + left_leg_lower : [103,165, 148,217], + left_leg_upper : [83,107, 119,134], + left_leg_knee : [105,138, 126,159], + right_leg_lower : [15,165, 57,218], + right_leg_upper : [43,107, 73,139], + right_leg_knee : [35,138, 58,160], + metallic_trim : [70,53, 100,70], + + right_trim : [-100,31,string_width("R Trim"), string_height("R Trim")], + left_trim : [-150,31,string_width("R Trim"), string_height("R Trim")], + + left_chest : [84,72, 108,92], + right_chest : [50,73, 82,103], + + left_thorax : 0, + right_thorax : 0, + + weapon_primary : 0, + weapon_secondary : 0, + + left_pauldron :[114,31, 150,67], + right_pauldron: [19,31, 43,71], + + left_head : [81,15, 94,30], + right_head: [68,15, 81,31], + + left_muzzle: [82,32, 90,42], + right_muzzle: [73,32, 82,42], + + eye_lense : [40,-20,string_width("Lense"), string_height("Lense")], + + left_arm : [119,67,146,105], + left_hand : [128,109,146,123], + + right_arm : [19,67,34,106], + right_hand : [18,109,33,134], + + right_backpack : [32,17,60,38], + left_backpack : [97,17,130,38], + + company_marks :[30, 40, string_width("Company Marks"), string_height("Company Marks")], + } + + static lower_left = ["left_leg_lower","left_leg_upper","left_leg_knee"]; + + static lower_right = ["right_leg_lower","right_leg_upper","right_leg_knee"]; + + static upper_left = ["left_chest","left_arm","left_hand","left_backpack"]; + + static chest = ["left_chest", "right_chest"]; + + static upper_right = ["right_chest","right_arm","right_hand","right_backpack"]; + + static legs = ["left_leg_lower","left_leg_upper","left_leg_knee","right_leg_lower","right_leg_upper","right_leg_knee"]; + + static head_set = ["left_head", "right_head","left_muzzle", "right_muzzle"]; + + static backpack = ["right_backpack","left_backpack"] + + static trim_all = ["right_trim","left_trim", "metallic_trim"]; + + static full_body = array_join(lower_left,lower_right,upper_left,chest,upper_right,head_set); + + static set_pattern = function(col, pattern){ + for (var i=0 ;i0){ + // 1 = chapter select + // 2 = Chapter Naming, Points assignment, advantages/disadvantages + // 3 = Homeworld, Flagship, Psychic discipline, Aspirant Trial + // 4 = Livery, Roles + // 5 = Gene Seed Mutations, Disposition + // 6 = Chapter Master + + show_debug_message($"calling scr_creation with input {slide_num}"); + if (slide_num=2 && custom>0){ if (name_bad=1){cooldown=8000;/*(sound_play(bad);*/} if (name_bad=0){ change_slide=1;goto_slide=3;cooldown=8000;race[100,17]=1; @@ -10,35 +17,77 @@ function scr_creation(argument0) { } } - if (argument0=2) and (custom=0){ - change_slide=1;goto_slide=3;cooldown=8000;race[100,17]=1;race[100,14]=1; - if (scr_has_disadv("Psyker Intolerant")) then race[100,17]=0; - if (chapter="Iron Hands") or (chapter="Space Wolves") then race[100,14]=0; + if (slide_num=2 && custom==0){ + change_slide=1; + goto_slide=3; + cooldown=8000; + race[100,eROLE.Chaplain]=1; + race[100,eROLE.Librarian]=1; + if(scr_has_disadv("Psyker Intolerant")){ + race[100,eROLE.Librarian]=0; + } + if (chapter_name="Iron Hands" || chapter_name="Space Wolves"){ + race[100,eROLE.Chaplain]=0; + } } - if (floor(argument0)==3) and (recruiting_name!=homeworld_name){ - change_slide=1;goto_slide=4;cooldown=8000;alarm[0]=1; + if (floor(slide_num)==3 && (recruiting_name!=homeworld_name || custom == 0)){ + change_slide=1; + goto_slide=4; + cooldown=8000; + alarm[0]=1; - if (argument0=3.5){ - if (color_to_main!=""){var q,good;q=0;good=0;repeat(30){q+=1;if (color_to_main=col[q]) and (good=0){good=q;color_to_main="";main_color=q;}}} - if (color_to_secondary!=""){var q,good;q=0;good=0;repeat(30){q+=1;if (color_to_secondary=col[q]) and (good=0){good=q;color_to_secondary="";secondary_color=q;}}} - if (color_to_trim!=""){var q,good;q=0;good=0;repeat(30){q+=1;if (color_to_trim=col[q]) and (good=0){good=q;color_to_trim="";trim_color=q;}}} - if (color_to_pauldron!=""){var q,good;q=0;good=0;repeat(30){q+=1;if (color_to_pauldron=col[q]) and (good=0){good=q;color_to_pauldron="";pauldron_color=q;}}} - if (color_to_pauldron2!=""){var q,good;q=0;good=0;repeat(30){q+=1;if (color_to_pauldron2=col[q]) and (good=0){good=q;color_to_pauldron2="";pauldron2_color=q;}}} - if (color_to_lens!=""){var q,good;q=0;good=0;repeat(30){q+=1;if (color_to_lens=col[q]) and (good=0){good=q;color_to_lens="";lens_color=q;}}} - if (color_to_weapon!=""){var q,good;q=0;good=0;repeat(30){q+=1;if (color_to_weapon=col[q]) and (good=0){good=q;color_to_weapon="";weapon_color=q;}}} + if (slide_num=3.5){ + + + if (full_liveries == ""){ + var struct_cols = { + main_color :main_color, + secondary_color:secondary_color, + main_trim:main_trim, + right_pauldron:right_pauldron, + left_pauldron:left_pauldron, + lens_color:lens_color, + weapon_color:weapon_color + } + livery_picker.scr_unit_draw_data(); + livery_picker.set_default_armour(struct_cols,col_special); + full_liveries = array_create(21,DeepCloneStruct(livery_picker.map_colour)); + full_liveries[eROLE.Librarian] = livery_picker.set_default_librarian(struct_cols); + + full_liveries[eROLE.Chaplain] = livery_picker.set_default_chaplain(struct_cols); + + full_liveries[eROLE.Apothecary] = livery_picker.set_default_apothecary(struct_cols); + + full_liveries[eROLE.Techmarine] = livery_picker.set_default_techmarines(struct_cols); + livery_picker.scr_unit_draw_data(); + livery_picker.set_default_armour(struct_cols,col_special); + } } } - - if (argument0=4){ - if (hapothecary!="") and (hchaplain!="") and (clibrarian!="") and (fmaster!="") and (recruiter!="") and (admiral!="") and (battle_cry!=""){ - change_slide=1;goto_slide=5;cooldown=8000; + + if (slide_num=4){ + if (custom == 0 || (hapothecary!="" && hchaplain!="" && clibrarian!="" && fmaster!="" && recruiter!="" && admiral!="" && battle_cry!="")){ + change_slide=1; + goto_slide=5; + cooldown=8000; if (custom=2){ mutations_selected=0; - preomnor=0;voice=0;doomed=0;lyman=0;omophagea=0;ossmodula=0;membrane=0; - zygote=0;betchers=0;catalepsean=0;secretions=0;occulobe=0;mucranoid=0; + preomnor=0; + voice=0; + doomed=0; + lyman=0; + omophagea=0; + ossmodula=0; + membrane=0; + zygote=0; + betchers=0; + catalepsean=0; + secretions=0; + occulobe=0; + mucranoid=0; if (purity>=1) then mutations=4; if (purity>=2) then mutations=3; if (purity>=4) then mutations=2; @@ -48,18 +97,17 @@ function scr_creation(argument0) { if (custom>0){ disposition[0]=0; - disposition[1]=0;// Prog + disposition[1]=60;// Prog disposition[2]=0;// Imp disposition[3]=0;// Mech disposition[4]=0;// Inq disposition[5]=0;// Ecclesiarchy - disposition[6]=0;// Astartes + disposition[6]=50;// Astartes disposition[7]=0;// Reserved - disposition[1]=60;disposition[6]=50; - if (founding=3) then disposition[1]=70; - if (founding=4) then disposition[1]=50; - if (founding=8) then disposition[1]=70; + if (founding==eCHAPTERS.SPACE_WOLVES) then disposition[1]=70; + if (founding==eCHAPTERS.IMPERIAL_FISTS) then disposition[1]=50; + if (founding==eCHAPTERS.SALAMANDERS) then disposition[1]=70; disposition[2]=50; disposition[3]=40; @@ -68,7 +116,7 @@ function scr_creation(argument0) { if (strength>5) then disposition[4]-=(strength-5)*2; if (purity<6) then disposition[4]-=5; - if (founding=10) then disposition[4]-=5; + if (founding==10) then disposition[4]-=5; // random/unknown if (cooperation<5){ disposition[6]-=(6-cooperation)*2; @@ -77,58 +125,69 @@ function scr_creation(argument0) { disposition[3]-=(6-cooperation); disposition[2]-=(6-cooperation)*2; } - //TODO encode this logic into advantage/disadvantage structs to be more maintainable and less hardcoded - var ahuh,k;ahuh=0;k=0; - repeat(8){k+=1;if (adv[k]="Crafters") then ahuh=1;} - if (ahuh=1) then disposition[3]+=2;ahuh=0;k=0; - - repeat(8){k+=1;if (adv[k]="Tech-Brothers") then ahuh=1;} - if (ahuh=1) then disposition[3]+=10;ahuh=0;k=0; - - repeat(8){k+=1;if (adv[k]="Psyker Intolerant") then ahuh=1;} - if (ahuh=1) then disposition[4]+=5;ahuh=0;k=0; - - repeat(8){k+=1;if (adv[k]="Daemon Binders") then ahuh=1;} - if (ahuh=1) then disposition[3]-=8;ahuh=0;k=0; - - repeat(8){k+=1;if (adv[k]="Sieged") then ahuh=1;} - if (ahuh=1) then disposition[6]+=5;ahuh=0;k=0; - - repeat(8){k+=1;if (adv[k]="Suspicious") then ahuh=1;} - if (ahuh=1) then disposition[4]-=15;ahuh=0;k=0; - - repeat(8){k+=1;if (adv[k]="Tech-Heresy") then ahuh=1;} - if (ahuh=1) then disposition[3]-=8;ahuh=0;k=0; - - repeat(8){k+=1;if (adv[k]="Psyker Abundance") then ahuh=1;} - if (ahuh=1) then disposition[4]-=4;ahuh=0;k=0; - repeat(8){k+=1;if (dis[k]="Tolerant") then ahuh=1;} - if (ahuh=1){ - disposition[1]-=5;disposition[2]-=5;disposition[4]-=5; - disposition[3]-=5;disposition[5]-=5;disposition[6]-=5; - }ahuh=0;k=0; + if(scr_has_adv("Crafters")){ + disposition[3]+=2; + } + if(scr_has_adv("Tech-Brothers")){ + disposition[3]+=10; + } + if(scr_has_disadv("Psyker Intolerant")){ + disposition[4]+=5; + } + if(scr_has_adv("Daemon Binders")){ + disposition[3]-=8; + } + if(scr_has_disadv("Sieged")){ + disposition[6]+=5; + } + if(scr_has_disadv("Suspicious")){ + disposition[4]-=15; + } + if(scr_has_disadv("Tech-Heresy")){ + disposition[3]-=8; + } + if(scr_has_adv("Psyker Abundance")){ + disposition[4]-=4; + } + if(scr_has_disadv("Tolerant")){ + disposition[1]-=5; + disposition[2]-=5; + disposition[3]-=5; + disposition[4]-=5; + disposition[5]-=5; + disposition[6]-=5; + } } } } // 5 to 6 - if (argument0=5){ - if (custom=0) or (mutations<=mutations_selected){change_slide=1;goto_slide=6;cooldown=8000;} + if (slide_num=5){ + if (custom=0 || mutations<=mutations_selected){ + change_slide=1; + goto_slide=6; + cooldown=8000; + } } // 6 to finish - if (argument0=6){ - if (chapter_master_name!="") and (chapter_master_melee!=0) and (chapter_master_ranged!=0) and (chapter_master_specialty!=0){ + if (slide_num=6){ + if (chapter_master_name!="" && chapter_master_melee!=0 && chapter_master_ranged!=0 && chapter_master_specialty!=0){ global.icon_name=obj_creation.icon_name; - cooldown=9999;instance_create(0,0,obj_ini);audio_stop_all(); + cooldown=9999; + instance_create(0,0,obj_ini); + audio_stop_all(); audio_play_sound(snd_royal,0,true); audio_sound_gain(snd_royal,0,0); - var nope;nope=0;if (master_volume=0) or (music_volume=0) then nope=1; - if (nope!=1){audio_sound_gain(snd_royal,0.25*master_volume*music_volume,2000);} + if (master_volume=0 || music_volume=0) { + audio_sound_gain(snd_royal,0.25*master_volume*music_volume,2000); + } - if (founding=8) or (chapter="Salamanders") then obj_ini.skin_color=1; - if (chapter!="Salamanders") and (founding!=8) and (secretions=1){ + if (founding == eCHAPTERS.SALAMANDERS || global.chapter_id == eCHAPTERS.SALAMANDERS) { + obj_ini.skin_color=1; + } + if (global.chapter_id != eCHAPTERS.SALAMANDERS && founding!=eCHAPTERS.SALAMANDERS && secretions=1){ obj_ini.skin_color=choose(2,3,4); } diff --git a/scripts/scr_crusade/scr_crusade.gml b/scripts/scr_crusade/scr_crusade.gml index bf9765cc9..10d236c83 100644 --- a/scripts/scr_crusade/scr_crusade.gml +++ b/scripts/scr_crusade/scr_crusade.gml @@ -39,7 +39,7 @@ function scr_crusade() { good=0;dead=false; if (obj_ini.name[co][i]=="") then continue; unit=fetch_unit([co, i]); - if (unit.ship_location==0) then continue; + if (unit.ship_location==-1) then continue; if (array_contains(total_ship_id,unit.ship_location)){ unit=obj_ini.TTRPG[co][i]; death_determination=floor(random(100))+1; @@ -92,7 +92,6 @@ function scr_crusade() { if (unit.IsSpecialist("apoth")) and (obj_ini.gear[co][i]="Narthecium") then apoth++; unit.add_exp(irandom(death_data[3][0])+death_data[3][1]); - if (unit.IsSpecialist("libs")) then unit.update_powers(); if (irandom(99)==1 && irandom(20)0) then repeat(artifacts){ if (obj_ini.fleet_type=ePlayerBase.home_world) then scr_add_artifact("random","",4,obj_ini.home_name,2); - if (obj_ini.fleet_type != ePlayerBase.home_world) then scr_add_artifact("random","",4,obj_ini.ship[1],501); + if (obj_ini.fleet_type != ePlayerBase.home_world) then scr_add_artifact("random","",4,obj_ini.ship[0],501); } diff --git a/scripts/scr_dead_marines/scr_dead_marines.gml b/scripts/scr_dead_marines/scr_dead_marines.gml index fc5bd9492..fbdd4047a 100644 --- a/scripts/scr_dead_marines/scr_dead_marines.gml +++ b/scripts/scr_dead_marines/scr_dead_marines.gml @@ -13,27 +13,20 @@ function scr_dead_marines(run) { obj_controller.marines=0; obj_controller.command=0; } + i=0; var unit, squad; if (run == 1){ for (company=0;company<11;company++){ comp_length = array_length(obj_ini.name[company]); clean = true; - for (i=1;i0){ + if (unit.ship_location>-1){ if ((ship_lost[unit.ship_location]>0) or (obj_ini.ship_hp[unit.ship_location]<=0)){ fallen+=1; clean = false; - - if (obj_ini.role[company,i]="Chapter Master"){ - obj_controller.alarm[7]=1; - if (global.defeat<=1) then global.defeat=1; - } - if (obj_ini.wep1[company,i]="Company Standard") then scr_loyalty("Lost Standard","+"); - if (obj_ini.wep2[company,i]="Company Standard") then scr_loyalty("Lost Standard","+"); - unit.remove_from_squad(); scr_kill_unit(company, i); } } @@ -47,21 +40,8 @@ function scr_dead_marines(run) { } if (i<120){ - if (obj_ini.veh_role[company,i]!="") and ((ship_lost[obj_ini.veh_lid[company,i]]>0) or (obj_ini.ship_hp[obj_ini.veh_lid[company,i]]<=0)) and (obj_ini.veh_lid[company,i]>0){ - clean = false; - obj_ini.veh_race[company,i]=0; - obj_ini.veh_loc[company,i]=""; - obj_ini.veh_name[company,i]=""; - obj_ini.veh_role[company,i]=""; - obj_ini.veh_wep1[company,i]=""; - obj_ini.veh_wep2[company,i]=""; - obj_ini.veh_wep3[company,i]=""; - obj_ini.veh_upgrade[company,i]=""; - obj_ini.veh_acc[company,i]=""; - obj_ini.veh_hp[company,i]=100; - obj_ini.veh_chaos[company,i]=0; - obj_ini.veh_pilots[company,i]=0; - obj_ini.veh_lid[company,i]=0; + if (obj_ini.veh_role[company,i]!="") and ((ship_lost[obj_ini.veh_lid[company,i]]>0) or (obj_ini.ship_hp[obj_ini.veh_lid[company,i]]<=0)) and (obj_ini.veh_lid[company,i]>-1){ + destroy_vehicle(company,i); } } } @@ -71,3 +51,20 @@ function scr_dead_marines(run) { } } } + + +function destroy_vehicle(co, num){ + obj_ini.veh_race[co][num]=0; + obj_ini.veh_loc[co][num]=""; + obj_ini.veh_name[co][num]=""; + obj_ini.veh_role[co][num]=""; + obj_ini.veh_wep1[co][num]=""; + obj_ini.veh_wep2[co][num]=""; + obj_ini.veh_wep3[co][num]=""; + obj_ini.veh_upgrade[co][num]=""; + obj_ini.veh_acc[co][num]=""; + obj_ini.veh_hp[co][num]=100; + obj_ini.veh_chaos[co][num]=0; + obj_ini.veh_pilots[co][num]=0; + obj_ini.veh_lid[co][num]=-1; +} diff --git a/scripts/scr_destroy_planet/scr_destroy_planet.gml b/scripts/scr_destroy_planet/scr_destroy_planet.gml index 08613b60f..a49965c68 100644 --- a/scripts/scr_destroy_planet/scr_destroy_planet.gml +++ b/scripts/scr_destroy_planet/scr_destroy_planet.gml @@ -52,7 +52,7 @@ function scr_destroy_planet(destruction_method) { for (var ed=0;ed0){ current_eventing=diplo_keyphrase;combating=1; @@ -337,7 +337,9 @@ function scr_dialogue(diplo_keyphrase) { if (instance_number(obj_ground_mission)==0){ with(obj_star){ if (string_count(name,scr_master_loc())>0){ - repeat(obj_ini.TTRPG[0,1].planet_location){instance_create(x,y,obj_ground_mission);} + repeat(obj_ini.TTRPG[0,0].planet_location){ + instance_create(x,y,obj_ground_mission); + } } } } @@ -1028,8 +1030,8 @@ function scr_dialogue(diplo_keyphrase) { if (rando==2) then diplo_text="[[The flesh is weak. "+string(faction_leader[eFACTION.Mechanicus])+" believes in this part of the iron creed above all others, forcing all those under him to mirror his dedication. All meaty parts of his body have been removed, leaving only the most vital parts of his brain. His retinue display their rank by showing how little of their body remains.]]"; diplo_text+="###"; if (disposition[3]>30) and (disposition[3]<60) then tempd="Greetings. I wish to see you bring the light of civilization to this sector, Chapter Master."; - if (disposition[3]<=30) or (string_count("Tech-Heresy",obj_ini.strin2)>0) then tempd="You are impure, illogical and irritating. Keep your army of techno barbarians away from my territory."; - if (disposition[3]>=60) or (string_count("Tech-Brothers",obj_ini.strin)>0) then tempd="Hail, Chapter Master. Were it not a logical fallacy, I would wish you luck in your coming endeavors."; + if (disposition[3]<=30) or (scr_has_disadv("Tech-Heresy")) then tempd="You are impure, illogical and irritating. Keep your army of techno barbarians away from my territory."; + if (disposition[3]>=60) or (scr_has_adv("Tech-Brothers")) then tempd="Hail, Chapter Master. Were it not a logical fallacy, I would wish you luck in your coming endeavors."; diplo_text+=tempd; } if (diplo_keyphrase=="hello"){ @@ -1779,35 +1781,34 @@ function scr_dialogue(diplo_keyphrase) { diplo_text+="###"; // * Normal craftworld reveal * if (string_count("1",diplo_keyphrase)>0){ - if (obj_ini.tolerant==1) and (string_count("Eldar",obj_ini.strin)==0){ - diplo_text+="Your future is clouded, human. Will you be a tool, or a thorn in our side?"; - } - if (obj_ini.tolerant==0) and (string_count("Eldar",obj_ini.strin)==0){ - diplo_text+="Another repulsive Mon'keigh. Leave the Eldar alone, primitive. You have no idea what you face."; - } - if (string_count("Eldar",obj_ini.strin)=1){ + if (scr_has_adv("Enemy: Eldar")){ diplo_text+="This is our home, Mon'keigh. Leave it in peace or feel the full wrath of Kaela Mensha Khaine."; + } else { + if (obj_ini.tolerant==1){ + diplo_text+="Your future is clouded, human. Will you be a tool, or a thorn in our side?"; + } else { + diplo_text+="Another repulsive Mon'keigh. Leave the Eldar alone, primitive. You have no idea what you face."; + } } } // * Running into eldar ships * if (string_count("2",diplo_keyphrase)>0){ - if (obj_ini.tolerant==1) and (string_count("Eldar",obj_ini.strin)==0){ + if (obj_ini.tolerant==1) and (!scr_has_adv("Enemy: Eldar")){ diplo_text+="This meeting is long since due. I pray that you pull back your forces, "+string(obj_ini.master_name)+". None of this concerns you."; - } - if (obj_ini.tolerant==0) or (string_count("Eldar",obj_ini.strin)==1){ + } else { diplo_text+="You do not understand that which you trifle with. Leave or be eradicated."; } } // * Request audience * if (diplo_keyphrase=="intro"){ - if (obj_ini.tolerant==1) and (string_count("Eldar",obj_ini.strin)==0){ - diplo_text+="We have been expecting you, "+string(obj_ini.master_name)+"."; - } - if (obj_ini.tolerant==0) and (string_count("Eldar",obj_ini.strin)==0){ - diplo_text+="The skeins have foretold of our meeting, Space Marine."; - } - if (string_count("Eldar",obj_ini.strin)=1){ + if (scr_has_adv("Enemy: Eldar")){ diplo_text+="Another repulsive Mon'keigh. Leave the Eldar alone, primitive, you have no idea what you face."; + } else { + if (obj_ini.tolerant==1) { + diplo_text+="We have been expecting you, "+string(obj_ini.master_name)+"."; + } else { + diplo_text+="The skeins have foretold of our meeting, Space Marine."; + } } } diplo_text+=tempd; @@ -2267,14 +2268,14 @@ function scr_dialogue(diplo_keyphrase) { if (rando==1) then diplo_text="[["+string(faction_leader[diplomacy])+" is the scourge of the sector, a colossal green brute infamous for the destruction of a dozen worlds. He rules his vicious horde of xenos savages the only way greenskins know how; with brute force. Trophies from the champions of a score of races bedeck his armour, including many from "+string(choose("other Astartes","the Tyranids","the Tau Empire"))+".]]"; if (rando==2) then diplo_text="[["+string(faction_leader[diplomacy])+" is a veteran of countless engagements, leading his tribe into battle with an almost manic giddiness. His name is synonymous with extended campaigns of looting and senseless violence, even more so than the other members of his barbaric race. He and the rest of his tribe hail from the "+string(choose("Goffs","Blood Axes","Bad Moons","Death Skulls","Death Skulls"))+" clan.]]"; diplo_text+="###"; - if (obj_ini.tolerant==1) and (string_count("Ork",obj_ini.strin)==0){ - diplo_text+="You seem good for a scrap, ya beaky faced ponce! Bring your lads down my way some time and we'll have one!"; - } - if (obj_ini.tolerant==0) and (string_count("Ork",obj_ini.strin)==0){ - diplo_text+="All you space marines seem da same ta me. I reckon we'll be seein' each other soon enough..."; - } - if (string_count("Ork",obj_ini.strin)==1){ + if (scr_has_adv("Enemy: Orks")){ diplo_text+="Oi Beaky! I ain't heard your name round here before! If ya eva get bored of havin' your ‘ead attached to your shouldas, good old "+string(faction_leader[diplomacy])+" can sort dat out for ya!"; + } else { + if (obj_ini.tolerant==1){ + diplo_text+="You seem good for a scrap, ya beaky faced ponce! Bring your lads down my way some time and we'll have one!"; + } else { + diplo_text+="All you space marines seem da same ta me. I reckon we'll be seein' each other soon enough..."; + } } diplo_text+=tempd; } diff --git a/scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.gml b/scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.gml index 19fa8858a..c9d509aa8 100644 --- a/scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.gml +++ b/scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.gml @@ -29,7 +29,7 @@ function basic_diplomacy_screen(){ draw_set_color(0); var sw=1; - for (i=1;i<5;i++){ + for (var i=1;i<5;i++){ if (string_width(string_hash_to_newline(diplo_option[slot]))*sw>530) then sw-=0.05; } if (string_width(string_hash_to_newline(diplo_option[slot]))*sw<=530) and (sw=1) then draw_text_transformed(xx+620,yy+696,string_hash_to_newline(string(diplo_option[slot])),sw,sw,0); diff --git a/scripts/scr_distribute_experience/scr_distribute_experience.gml b/scripts/scr_distribute_experience/scr_distribute_experience.gml new file mode 100644 index 000000000..94d3a160b --- /dev/null +++ b/scripts/scr_distribute_experience/scr_distribute_experience.gml @@ -0,0 +1,22 @@ +function distribute_experience(_units, _exp_amount) { + var _eligible_units_count = array_length(_units); + var _average_exp = 0; + + if (_eligible_units_count > 0 && _exp_amount > 0) { + var _individual_exp = _exp_amount / _eligible_units_count; + _average_exp = _individual_exp; + for (var i = 0; i < _eligible_units_count; i++) { + var _unit = _units[i][0]; + var _exp_mod = _units[i][1]; + var _exp_update_data = _unit.add_exp(_individual_exp*_exp_mod); + + var _powers_learned = _exp_update_data[1]; + if (_powers_learned > 0) { + array_push(obj_ncombat.upgraded_librarians, _unit); + } + + } + } + + return _average_exp; +} diff --git a/scripts/scr_special_weapon/scr_special_weapon.yy b/scripts/scr_distribute_experience/scr_distribute_experience.yy similarity index 82% rename from scripts/scr_special_weapon/scr_special_weapon.yy rename to scripts/scr_distribute_experience/scr_distribute_experience.yy index 718581c88..d2ff004aa 100644 --- a/scripts/scr_special_weapon/scr_special_weapon.yy +++ b/scripts/scr_distribute_experience/scr_distribute_experience.yy @@ -1,7 +1,7 @@ { "resourceType": "GMScript", "resourceVersion": "1.0", - "name": "scr_special_weapon", + "name": "scr_distribute_experience", "isCompatibility": false, "isDnD": false, "parent": { diff --git a/scripts/scr_distributions/scr_distributions.gml b/scripts/scr_distributions/scr_distributions.gml index 0fff4df9c..09ec91d02 100644 --- a/scripts/scr_distributions/scr_distributions.gml +++ b/scripts/scr_distributions/scr_distributions.gml @@ -1,5 +1,3 @@ -// Script assets have changed for v2.3.0 see -// https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information function gauss(base, sd){ var x1, x2, w; do { @@ -12,17 +10,17 @@ function gauss(base, sd){ return base + sd * x1 * w; } -function gauss_negative(base, sd){ - var x1, x2, w; - do { - x1 = random_range(-1, 0); - x2 = random_range(-1, 0); - w = sqr(x1)+sqr(x2); - } until (0 < w and w < 1); +// function gauss_negative(base, sd){ +// var x1, x2, w; +// do { +// x1 = random_range(-1, 0); +// x2 = random_range(-1, 0); +// w = sqr(x1)+sqr(x2); +// } until (0 < w and w < 1); - w = sqrt(-2 * ln(w) / w); - return base + (sd * x1 * w); -} +// w = sqrt(-2 * ln(w) / w); +// return base + (sd * x1 * w); +// } function gauss_positive(base, sd){ @@ -37,19 +35,19 @@ function gauss_positive(base, sd){ return base + (sd * x1 * w); } -function skewed_guass(minimum, maximum, average){ - var skew = choose(0,1); - if (skew){ - return gauss_positive(average, maximum/3.3); - } else { - return gauss_negative(average, minimum/3.3); - } -} +// function skewed_guass(minimum, maximum, average){ +// var skew = choose(0,1); +// if (skew){ +// return gauss_positive(average, maximum/3.3); +// } else { +// return gauss_negative(average, minimum/3.3); +// } +// } -function pareto(base, exponent=1){ - return base * (1 - power(random(1), 1 / (1 + exponent))); -} +// function pareto(base, exponent=1){ +// return base * (1 - power(random(1), 1 / (1 + exponent))); +// } function lanczos_gamma(x1) { var g = 7; @@ -72,14 +70,14 @@ function lanczos_gamma(x1) { } } -function beta_function(alpha, beta) { - return lanczos_gamma(alpha) * lanczos_gamma(beta) / lanczos_gamma(alpha + beta); -} +// function beta_function(alpha, beta) { +// return lanczos_gamma(alpha) * lanczos_gamma(beta) / lanczos_gamma(alpha + beta); +// } -function beta_distribution(alpha, beta) { - var x1 = random_range(0, 1); - return power(x1, alpha - 1) * power(1 - x1, beta - 1) / beta_function(alpha, beta); -} +// function beta_distribution(alpha, beta) { +// var x1 = random_range(0, 1); +// return power(x1, alpha - 1) * power(1 - x1, beta - 1) / beta_function(alpha, beta); +// } // function exponent(lambda, base) { // var u = random(1); // Generate a uniform random number between 0 and 1 diff --git a/scripts/scr_draw_armentarium/scr_draw_armentarium.gml b/scripts/scr_draw_armentarium/scr_draw_armentarium.gml index f548429b7..f50d3cd9f 100644 --- a/scripts/scr_draw_armentarium/scr_draw_armentarium.gml +++ b/scripts/scr_draw_armentarium/scr_draw_armentarium.gml @@ -18,7 +18,7 @@ function set_up_armentarium(){ click=1; temp[36]=scr_role_count(obj_ini.role[100][16],""); temp[37]=temp[36]+scr_role_count(string(obj_ini.role[100][16])+" Aspirant",""); - calculate_research_points(); + specialist_point_handler.calculate_research_points(); in_forge=false forge_button = new ShutterButton(); stc_flashes = new GlowDot(); @@ -35,66 +35,10 @@ function set_up_armentarium(){ ] } -function drop_down(selection, draw_x, draw_y, options,open_marker){ - if (selection!=""){ - draw_unit_buttons([draw_x, draw_y],selection,[1,1],c_green); - draw_set_color(c_red); - if (array_length(options)>1){ - if (point_in_rectangle( - mouse_x, - mouse_y, - draw_x, - draw_y, - draw_x + 5 + string_width(selection), - draw_y + 4 + string_height(selection) - )){ - open_marker = true; - } - if (open_marker){ - current_target=true; - var roll_down_offset=4+string_height(selection); - for (var col = 0;col40 && techs[i].hp() >0){ - research_points += techs[i].technology-40; - forge_point_gen=techs[i].forge_point_generation(true); - gen_data = forge_point_gen[1]; - if (struct_exists(gen_data,"crafter")) then crafters++; - if (struct_exists(gen_data,"at_forge")){ - at_forge++; - master_craft_chance += (techs[i].experience/50) - } - forge_points += forge_point_gen[0]; - if (techs[i].has_trait("tech_heretic")){ - array_push(heretics, i); - } - } - tech_locations[i] = techs[i].marine_location(); - } - if (forge_master>-1){ - obj_controller.master_of_forge = techs[forge_master]; - } - forge_string += $"Techmarines: +{floor(forge_points)}#"; - var forge_veh_maintenance={}; - for (var comp=0;comp<=10;comp++){ - for (var veh=0;veh<=100;veh++){ - if (obj_ini.veh_role[comp][veh]=="Land Raider"){ - forge_veh_maintenance.land_raider = struct_exists(forge_veh_maintenance, "land_raider") ?forge_veh_maintenance.land_raider + 1 : 1; - } else if (array_contains(["Rhino","Predator", "Whirlwind"],obj_ini.veh_role[comp][veh])){ - forge_veh_maintenance.small_vehicles = struct_exists(forge_veh_maintenance, "small_vehicles") ?forge_veh_maintenance.small_vehicles + 0.2 :0.2; - } - } - } - - if (struct_exists(forge_veh_maintenance, "land_raider")){ - forge_string += $"Land Raider Maintenance: -{forge_veh_maintenance.land_raider}#"; - forge_points-=forge_veh_maintenance.land_raider; - } - if (struct_exists(forge_veh_maintenance, "small_vehicles")){ - if (floor(forge_veh_maintenance.small_vehicles)>0){ - forge_string += $"Small Vehicle Maintenance: -{floor(forge_veh_maintenance.small_vehicles)}#"; - forge_points-=floor(forge_veh_maintenance.small_vehicles); - } - } - if (player_forge_data.player_forges>0){ - forge_points += 5*player_forge_data.player_forges; - forge_string += $"Forges: +{5*player_forge_data.player_forges}#"; - } - forge_points = floor(forge_points); - var tech_test, charisma_test, piety_test, met_non_heretic, heretics_pursuade_chances, new_pursuasion; - //in this instance tech heretics are techmarines with the "tech_heretic" trait - if (turn_end){ - if (array_length(techs)==0) then scr_loyalty("Upset Machine Spirits","+"); - if (array_length(heretics)>0 && turn>75){ - var heretic_location, same_location, current_heretic, current_tech; - //iterate through tech heretics; - for (var heretic=0; heretic0; i++){ - same_location=false; - new_pursuasion = irandom(array_length(techs)-1); - //if tech is also heretic skip - if (array_contains(heretics,new_pursuasion)) then continue; - if (array_contains(pursuasions,new_pursuasion)) then continue; - heretics_pursuade_chances--; - current_tech = techs[new_pursuasion]; - - // find out if heretic is in same location as techmarine - if (same_locations(heretic_location,tech_locations[new_pursuasion])){ - met_non_heretic=true; - //if so do a an opposed technology test of techmarine vs tech heretic techmarine - tech_test = global.character_tester.oppposed_test(current_heretic,current_tech, "technology"); - - - if (tech_test[0]==1){ - // if heretic wins do an opposed charisma test - charisma_test = global.character_tester.oppposed_test(current_heretic,current_tech, "charisma", -15+current_tech.corruption); - if (charisma_test[0]==1){ - // if heretic win tech is corrupted - //tech is corrupted by half the pass margin of the heretic - //this means high charisma heretics will spread corruption more quickly and more often - if (current_heretic.corruption>current_tech.corruption){ - current_tech.edit_corruption(min(4,charisma_test[1])); - } - - // tech takes a piety test to see if tehy break faith with cult mechanicus and become tech heretic - //piety test is augmented by by the techs corruption with the test becoming harder to pass the more - // corrupted the tech is - piety_test = global.character_tester.standard_test(current_tech, "piety", +75 - current_tech.corruption); - - // if tech fails piety test tech also becomes tech heretic - if (piety_test[0] == false && choose(true,false)){ - current_tech.add_trait("tech_heretic"); - } - } else if (charisma_test[0]==2){ - if (charisma_test[1] > 40 && notice_heresy=false){ - scr_alert("purple","Tech Heresy",$"{current_tech.name_role()} contacts you concerned of Tech Heresy in the Armentarium"); - notice_heresy=true; - } - } - } - if (new_pursuasion==forge_master){ - // if tech is the forge master then forge master takes a wisdom in this case doubling as a perception test - // if forge master passes tech heresy is noted and chapter master notified - if (global.character_tester.standard_test(current_tech, "wisdom", - 40)[0] && !notice_heresy){ - notice_heresy=true; - scr_event_log("purple",$"{techs[forge_master].name_role()} Has noticed signs of tech heresy amoung the Armentarium ranks"); - scr_alert("purple","Tech Heresy",$"{techs[forge_master].name_role()} Has noticed signs of tech heresy amoung the Armentarium ranks"); - //pip=instance_create(0,0,obj_popup); - } - } - } - } - if (!met_non_heretic){ - if (irandom(4)==0){ - current_heretic.edit_corruption(1); - } - } - //add check to see if tech heretic is anywhere near mechanicus forge if so maybe do stuff?? - /*if (heretic_location==location_types.planet){ - if - }*/ - } - if (array_length(techs)>array_length(heretics)){ - if (array_length(heretics)/array_length(techs)>=0.35){ - if (irandom(9)==0){ - /*var text_string = "You Recive an Urgent Transmision from"; - if (forge_master>-1){ - - }*/ - scr_popup("Technical Differences!","You Recive an Urgent Transmision A serious breakdown in culture has coccured causing believers in tech heresy to demand that they are given preseidence and assurance to continue their practises","tech_uprising",""); - } - } - } - } - possibility_of_heresy = 8; - if (array_contains(obj_ini.dis,"Tech-Heresy")) then possibility_of_heresy = 6; - if (irandom(power(possibility_of_heresy,(array_length(heretics)+2.2))) == 0 && array_length(techs)>0){ - var current_tech = techs[irandom(array_length(techs)-1)]; - if (!global.character_tester.standard_test(current_tech, "piety")[0]){ - current_tech.add_trait("tech_heretic"); - current_tech.edit_corruption(20+irandom(15)); - } - } - if (forge_master==-1){ - var tech_count = scr_role_count(obj_ini.role[100][16]); - if (tech_count>1){ - var last_master = obj_ini.previous_forge_masters[array_length(obj_ini.previous_forge_masters)-1]; - scr_popup("New Forge Master",$"The Demise of Forge Master {last_master} means a replacement must be chosen. Several Options have already been put forward to you but it is ultimatly your decision.","new_forge_master",""); - } else if (tech_count==1){ - scr_role_count(obj_ini.role[100][16],"","units")[0].update_role("Forge Master"); - } - } - forge_queue_logic(); - } - } -} -function scr_forge_item(item){ - var master_craft_count=0; - var quality_string=""; - var normal_count=0; - for (var s=0;s0){ - scr_add_item(item.name, master_craft_count,"master_crafted"); - var numerical_string = master_craft_count==1?"was":"were"; - quality_string=$"X{master_craft_count} {numerical_string} Completed to a Master Crafted standard"; - }else { - quality_string=$"all were completed to a standard STC compliant quality"; - } - scr_popup("Forge Completed",$"{item.name} X{item.count} construction finished {quality_string}","",""); -} - -function scr_advance_research(research){ - if (research.name[0]=="research"){ - var tier_depth = array_length(research.name[2]); - var tier_names=research.name[2]; - if (tier_depth==1){ - production_research[$ tier_names[0]][0]++; - } else if (tier_depth==2){ - production_research[$ tier_names[0]][1][$ tier_names[1]][0]++; - } else if (tier_depth == 3){ - production_research[$ tier_names[0]][1][$ tier_names[1]][1][$ tier_names[2]][0]++; - } - } -} -function scr_evaluate_forge_item_completion(item){ - if (is_string(item.name)){ - var vehicles = ["Rhino","Predator","Land Raider","Whirlwind","Land Speeder"]; - var is_vehicle = array_contains(vehicles,item.name); - if (!is_vehicle){ - scr_forge_item(item); - } else { - repeat(item.count){ - var vehicle = scr_add_vehicle(item.name,9,"standard","standard","standard","standard","standard"); - var build_loc = array_random_element(player_forge_data.vehicle_hanger); - obj_ini.veh_loc[vehicle[0]][vehicle[1]] = build_loc[0]; - obj_ini.veh_wid[vehicle[0]][vehicle[1]] = build_loc[1]; - obj_ini.veh_lid[vehicle[0]][vehicle[1]] = 0; - } - scr_popup("Forge Completed",$"{item.name} X{item.count} construction finished Vehicles Waiting at hanger on {build_loc[0]} {build_loc[1]}","",""); - } - } else if (is_array(item.name)){ - scr_advance_research(item); - } -} -function forge_queue_logic(){ - if (forge_points>0){ - var reduction_points = forge_points; - if (array_length(forge_queue)>0 && forge_points>0){ - var forging_length = array_length(forge_queue); - for (var i=0;i5000*(research_area_limit+1)){ - identify_stc(stc_research.research_focus); - } -} function identify_stc(area){ switch(area){ @@ -405,15 +75,8 @@ function identify_stc(area){ } } function scr_draw_armentarium(){ - var recruitment_pace = [ - " is currently halted.", - " is advancing sluggishly.", - " is advancing slowly.", - " is advancing moderately fast.", - " is advancing fast.", - " is advancing frenetically.", - " is advancing as fast as possible." - ]; + var _recruit_pace = ARR_recruitment_pace; + var _train_tiers = ARR_techmarine_training_tiers; var xx = __view_get(e__VW.XView, 0) + 0; var yy = __view_get(e__VW.YView, 0) + 0; draw_sprite(spr_rock_bg, 0, xx, yy); @@ -570,32 +233,11 @@ function scr_draw_armentarium(){ blurp = "Your Chapter contains " + string(temp[36]) + " " + string(obj_ini.role[100, 16]) + ".##"; blurp += "The training of a new " + string(obj_ini.role[100, 16]); } - if (training_techmarine = 0) { - blurp += recruitment_pace[training_techmarine]; - } - if (training_techmarine = 1) { - blurp += recruitment_pace[training_techmarine]; - eta = floor((359 - tech_points) / 1) + 1; - } - if (training_techmarine = 2) { - blurp += recruitment_pace[training_techmarine]; - eta = floor((359 - tech_points) / 2) + 1; + if (training_techmarine>=0){ + blurp += _recruit_pace[training_techmarine]; } - if (training_techmarine = 3) { - blurp += recruitment_pace[training_techmarine]; - eta = floor((359 - tech_points) / 4) + 1; - } - if (training_techmarine = 4) { - blurp += recruitment_pace[training_techmarine]; - eta = floor((359 - tech_points) / 6) + 1; - } - if (training_techmarine = 5) { - blurp += recruitment_pace[training_techmarine]; - eta = floor((359 - tech_points) / 10) + 1; - } - if (training_techmarine = 6) { - blurp += recruitment_pace[training_techmarine]; - eta = floor((359 - tech_points) / 14) + 1; + if (training_techmarine >0 && training_techmarine<=6) { + eta = floor((359 - tech_points) / _train_tiers[training_techmarine])+ 1; } if (tech_aspirant > 0) and(training_techmarine > 0) and(menu_adept = 1) { @@ -626,7 +268,7 @@ function scr_draw_armentarium(){ }else if (stc_research.research_focus=="ships"){ research_area_limit = stc_ships; } - var research_progress = ceil(((5000*(research_area_limit+1))-stc_research[$ stc_research.research_focus])/research_points); + var research_progress = ceil(((5000*(research_area_limit+1))-stc_research[$ stc_research.research_focus])/specialist_point_handler.research_points); static research_drop_down = false; var research_eta_message = $"Based on current progress it will be {research_progress} months until next significant research step is complete"; draw_text_ext(xx + 336 + 16, y_offset+25, string_hash_to_newline(research_eta_message), -1, 536); @@ -830,102 +472,13 @@ function scr_draw_armentarium(){ draw_set_color(0); //draw_rectangle(xx + 359, yy + 66, xx + 886, yy + 818, 0); - var forge_buttons= [xx + 359, yy + 77, 0, 0] - draw_unit_buttons([forge_buttons[0] , forge_buttons[1]],"<-- Overview",[1,1],c_red); - forge_buttons[2] = forge_buttons[0] + (string_width("<-- Overview")) + 8; - forge_buttons[3] = forge_buttons[1] + (string_height("<-- Overview")) + 5; - if (point_in_rectangle( - mouse_x, - mouse_y, - forge_buttons[0], - forge_buttons[1], - forge_buttons[2], - forge_buttons[3] - ) && mouse_check_button_pressed(mb_left) - ){ + if (point_and_click(draw_unit_buttons([xx + 359, yy + 77],"<-- Overview",[1,1],c_red))){ in_forge=false; } - draw_set_color(c_gray); - draw_rectangle(xx + 359, yy + 107, xx + 886, yy + 127, 0); - draw_set_alpha(1); - draw_set_font(fnt_40k_14); - draw_set_color(0); - draw_text(xx+359,yy+109,"Name"); - draw_text(xx+500,yy+109,"Number"); - draw_text(xx+600,yy+109,"Forge Points"); - draw_text(xx+700,yy+109,"Construction ETA"); - draw_set_color(c_gray); - var item_gap = 130; - var total_eta=0; - static top_point=0; - for (var i=top_point; i<13; i++){ - if (i+1>array_length(forge_queue)) then break; - draw_set_color(c_gray); - if point_in_rectangle(mouse_x, mouse_y, xx + 359,yy +item_gap, xx + 886, yy +item_gap+20){ - draw_set_color(c_white) - } - if (is_string(forge_queue[i].name)){ - draw_text(xx+359,yy + item_gap,string_hash_to_newline(forge_queue[i].name)); - draw_text(xx+525,yy + item_gap,string_hash_to_newline(forge_queue[i].count)); - if (forge_queue[i].ordered==obj_controller.turn){ - if (forge_queue[i].count>1){ - draw_unit_buttons([xx+500 , yy + item_gap],"-",[0.75,0.75],c_red); - if (point_in_rectangle( - mouse_x, - mouse_y, - xx+500, - yy + item_gap, - xx+500+3+(0.75*string_width("-")), - yy + item_gap+3+(0.75*string_height("-")), - ) && mouse_check_button_pressed(mb_left) - ){ - var unit_cost = forge_queue[i].forge_points/forge_queue[i].count; - forge_queue[i].count--; - forge_queue[i].forge_points-=unit_cost; - } - } - if (forge_queue[i].count<100){ - draw_unit_buttons([xx+545 , yy + item_gap],"+",[0.75,0.75],c_green); - if (point_in_rectangle( - mouse_x, - mouse_y, - xx+545, - yy + item_gap, - xx+545+3+(0.75*string_width("+")), - yy + item_gap+3+(0.75*string_height("+")) - ) && mouse_check_button_pressed(mb_left) && current_target==false - ){ - var unit_cost = forge_queue[i].forge_points/forge_queue[i].count; - forge_queue[i].count++; - forge_queue[i].forge_points+=unit_cost; - } - } - } - } else if (is_array(forge_queue[i].name)){ - if (forge_queue[i].name[0] == "research"){ - draw_text(xx+359,yy + item_gap,string_hash_to_newline(forge_queue[i].name[1])); - } - } - draw_text(xx+630,yy + item_gap,string_hash_to_newline(forge_queue[i].forge_points)); - total_eta += ceil(forge_queue[i].forge_points/forge_points); - draw_text(xx+735,yy+ item_gap,string_hash_to_newline(total_eta) + " turns"); - forge_buttons= [xx+850, yy + item_gap, 0, 0] - draw_unit_buttons([forge_buttons[0] , forge_buttons[1]],"X",[0.75,0.75],c_red); - forge_buttons[2] = forge_buttons[0] + (string_width("X")) + 8; - forge_buttons[3] = forge_buttons[1] + (string_height("X")) + 5; - if (point_in_rectangle( - mouse_x, - mouse_y, - forge_buttons[0], - forge_buttons[1], - forge_buttons[2], - forge_buttons[3] - ) && mouse_check_button_pressed(mb_left) - ){ - array_delete(forge_queue, i, 1); - } - item_gap +=20 - } + + specialist_point_handler.draw_forge_queue(xx+ 359,yy + 107); + + // draw_set_color(c_red); //draw_line(xx + 326 + 16, yy + 426, xx + 887 + 16, yy + 426); draw_set_color(#af5a00); diff --git a/scripts/scr_draw_management_unit/scr_draw_management_unit.gml b/scripts/scr_draw_management_unit/scr_draw_management_unit.gml index d74a0b8cf..2fca21be9 100644 --- a/scripts/scr_draw_management_unit/scr_draw_management_unit.gml +++ b/scripts/scr_draw_management_unit/scr_draw_management_unit.gml @@ -41,7 +41,7 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){ assignment=unit.assignment(); if (assignment!="none"){ unit_location_string += $"({assignment})"; - }else if (fest_planet==0) and (fest_sid>0) and (fest_repeats>0) and (ma_lid[selected]==fest_sid){ + }else if (fest_planet==0) and (fest_sid>-1) and (fest_repeats>0) and (ma_lid[selected]==fest_sid){ unit_location_string="=Event="; eventing=true; }else if (fest_planet==1) and (fest_wid>0) and (fest_repeats>0) and (ma_wid[selected]==fest_wid) and (ma_loc[selected]==fest_star){ @@ -52,7 +52,7 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){ if (draw) { health_string=$"{round((unit.hp()/unit.max_health())*100)}% HP"; - var exp_string= $"{ma_exp[selected]} XP"; + var exp_string= $"{round(ma_exp[selected])} EXP"; ma_ar="";ma_we1="";ma_we2="";ma_ge="";ma_mb="";ttt=0; ar_ar=0;ar_we1=0;ar_we2=0;ar_ge=0;ar_mb=0; @@ -88,7 +88,7 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){ if (ma_wid[selected]!=0){ //numeral for vehicle planet unit_location_string += scr_roman(ma_wid[selected]); - } else if (ma_lid[selected]>0){ + } else if (ma_lid[selected]>-1){ unit_location_string = obj_ini.ship[ma_lid[selected]] } health_string=string(round(ma_health[selected]))+"% HP"; @@ -173,14 +173,26 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){ // Squads var sqi=""; draw_set_color(c_black); - var squad_colours=[c_teal,c_red,c_green,c_orange,c_aqua,c_fuchsia,c_green,c_blue,c_fuchsia,c_maroon] - var squad_modulo = squad[selected]%10; - draw_set_color(squad_colours[squad_modulo]) + var squad_colours=[c_teal,c_red,c_green,c_orange,c_aqua,c_fuchsia,c_green,c_blue,c_fuchsia,c_maroon]; + if (squad[selected]!=-1){ + var _squad_modulo = squad[selected]%10; + draw_set_color(squad_colours[_squad_modulo]) + } - if (selected>0 && selected0 && selectedselected){ + var _cur_squad = squad[selected]; + var _next_squad = squad[selected+1]; + var _prev_squad = squad[selected-1]; + if (_cur_squad==_next_squad){ + if (squad[selected]!=_prev_squad){ + sqi="top"; + } else { + sqi="mid" + } + } + else if (squad[selected]==_prev_squad){ + sqi="bot"; + } } //TODO handle recursively with an array draw_rectangle(xx+25,yy+64,xx+25+8,yy+85,0); @@ -207,11 +219,11 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){ } var hpText = [xx+240+8, yy+66, string_hash_to_newline(string(health_string))]; // HP - var xpText = [xx+330+8, yy+66, string_hash_to_newline(string(exp_string))]; // XP + var xpText = [xx+330+8, yy+66, exp_string]; // EXP var hpColor = c_gray; var xpColor = c_gray; var specialismColors = []; - // Draw XP value and set up health color + // Draw EXP value and set up health color if (man[selected] == "man"){ if (ma_promote[selected] >= 10){ hpColor = c_red; @@ -250,8 +262,6 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){ draw_text(xx+430+8,yy+66,truncatedLocation);// LOC draw_set_alpha(1); - // ma_lid[i]=0;ma_wid[i]=0; - if (ma_loc[selected]=="Mechanicus Vessel"){ draw_sprite(spr_loc_icon,2,xx+427+8,yy+66); } else { @@ -259,7 +269,7 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){ c = managing<=10 ? managing : 0; var unit = display_unit[selected]; - if (ma_lid[selected]>0) and (ma_wid[selected]==0){ + if (ma_lid[selected]>-1) and (ma_wid[selected]==0){ draw_sprite( spr_loc_icon, unit.is_boarder ? 2 : 1, @@ -269,8 +279,8 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){ draw_sprite(spr_loc_icon,0,xx+427+8,yy+66); } }else{ - if (ma_lid[selected]==0) and (ma_wid[selected]>0) then draw_sprite(spr_loc_icon,0,xx+427+8,yy+66); - if (ma_lid[selected]>0) and (ma_wid[selected]==0) then draw_sprite(spr_loc_icon,1,xx+427+8,yy+66); + if (ma_lid[selected]==-1) and (ma_wid[selected]>0) then draw_sprite(spr_loc_icon,0,xx+427+8,yy+66); + if (ma_lid[selected]>-1) and (ma_wid[selected]==0) then draw_sprite(spr_loc_icon,1,xx+427+8,yy+66); } } //TODO handle recursively @@ -337,8 +347,8 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){ var no_location = (selecting_location==""); var wrong_location = false; if (!no_location){ - if (selecting_ship>0){ - if (ma_lid[selected]==0){ + if (selecting_ship>-1){ + if (ma_lid[selected]==-1){ wrong_location=true; } else { wrong_location = obj_ini.ship_location[ma_lid[selected]] != selecting_location; diff --git a/scripts/scr_draw_planet_features/scr_draw_planet_features.gml b/scripts/scr_draw_planet_features/scr_draw_planet_features.gml index 57d1e0d35..76a1dd72c 100644 --- a/scripts/scr_draw_planet_features/scr_draw_planet_features.gml +++ b/scripts/scr_draw_planet_features/scr_draw_planet_features.gml @@ -15,24 +15,22 @@ function FeatureSelected(Feature, system, planet) constructor{ planet_data = new PlanetData(planet,system); if (feature.f_type == P_features.Forge){ - var worker_caps= [2,4,8]; - worker_capacity = worker_caps[feature.size-1]; + var _worker_caps = [2,4,8]; + worker_capacity = _worker_caps[feature.size-1]; techs = collect_role_group("forge", obj_star_select.target.name); feature.techs_working = 0; for (var i=0;i=upgrade_cost){ feature.vehicle_hanger=1; obj_controller.requisition -= upgrade_cost; - array_push(obj_controller.player_forge_data.vehicle_hanger,[obj_controller.selected.name,obj_controller.selecting_planet]); + array_push(obj_controller.player_forge_data.vehicle_hanger,[obj_controller.selected.name,planet_data.planet]); } } else if(feature.vehicle_hanger){ draw_text(next_position[0], next_position[1], "Forge has a vehicle hanger") @@ -179,9 +177,27 @@ function FeatureSelected(Feature, system, planet) constructor{ }; } break; + case P_features.Recruiting_World: + generic = true; + var _planet = planet_data.planet; + var _star = obj_star_select.target; + var _system_point_use = obj_controller.specialist_point_handler.point_breakdown.systems; + var _spare_apoth_points = 0; + if (struct_exists(_system_point_use, _star.name)){ + var _point_data = _system_point_use[$_star.name][_planet] + _spare_apoth_points = _point_data.heal_points - _point_data.heal_points_use; + } + title = "Marine Recruitment"; + body = $"There are {_spare_apoth_points} apothecary rescource points available for recruit screening\n" + var _recruit_find_chance = find_recruit_success_chance(_spare_apoth_points, _star.p_type[_planet]); + + body += $"there is a {_recruit_find_chance*100}% of producing a successful recruit this month on the basis of the available apothecary time to screen candidates and the chances of the aspirants passing their trials to an acceptable standard\n" + + body += $"To increase recruit success chance more apothecaries will be required on the planet surface, we could also spend further req on rescources to aid exiting efforts"; + break; case P_features.Mission: var mission_description=$""; - var planet_name = planet_numeral_name(obj_controller.selecting_planet, obj_star_select.target); + var planet_name = planet_numeral_name(planet_data.planet, obj_star_select.target); var button_text="none"; var button_function="none"; var help = "none"; @@ -206,9 +222,9 @@ function FeatureSelected(Feature, system, planet) constructor{ purpose:"Beast Hunt", purpose_code : feature.problem, number:3, - system:obj_controller.selected.id, + system:planet_data.system, feature:obj_star_select.feature, - planet : obj_controller.selecting_planet, + planet : planet_data.planet, array_slot : feature.array_position, selections : [] }); @@ -229,9 +245,9 @@ function FeatureSelected(Feature, system, planet) constructor{ purpose:"Select Officer", purpose_code : feature.problem, number:1, - system:obj_controller.selected.id, + system:planet_data.system, feature:obj_star_select.feature, - planet : obj_controller.selecting_planet, + planet : planet_data.planet, selections : [] }); destroy=true; @@ -253,7 +269,7 @@ function FeatureSelected(Feature, system, planet) constructor{ if (button_text!="none"){ if (point_and_click(draw_unit_buttons([xx+((area_width/2)-(string_width(button_text)/2)), yy+40+text_body_height+10], button_text))){ - if (is_method(button_function)){ + if (is_callable(button_function)){ button_function(); destroy=true; } else { @@ -302,7 +318,7 @@ function DataSlateMKTwo()constructor{ width=0; XX=0; YY=0; - static draw = function(xx,yy,x_scale, y_scale){ + static draw = function(xx,yy,x_scale=1, y_scale=1){ XX=xx; YY=yy; height = 250*y_scale; @@ -548,7 +564,7 @@ function DataSlate() constructor{ width = 860*scale_x; height = 850*scale_y; draw_sprite_ext(spr_data_slate,1, xx,yy, scale_x, scale_y, 0, c_white, 1); - if (is_method(inside_method)){ + if (is_callable(inside_method)){ inside_method(); } if (static_line<=10) then draw_set_alpha(static_line/10); @@ -585,7 +601,7 @@ function DataSlate() constructor{ draw_sprite_part_ext(spr_data_slate,1, 0, 752, 850, 98, XX, YY+(69+683*((middle_percent/100)))*scale_y, scale_x, scale_y, c_white, 1); width = 860*scale_x; height = (69+(683*(middle_percent/100))+98 )*scale_y; - if (is_method(inside_method)){ + if (is_callable(inside_method)){ inside_method(); } } diff --git a/scripts/scr_draw_text/scr_draw_text.gml b/scripts/scr_draw_text/scr_draw_text.gml index 7113d4184..8bf76252f 100644 --- a/scripts/scr_draw_text/scr_draw_text.gml +++ b/scripts/scr_draw_text/scr_draw_text.gml @@ -37,7 +37,8 @@ function draw_text_glow(_x, _y, _text, _text_color, _glow_color){ draw_set_color(_cur_color); } -/// @function draw_text_glow + +/// @function draw_text_glow_transformed /// @description This function will draw text in a similar way to draw_text(), only now the text will have a glow effect. function draw_text_glow_transformed(_x, _y, _text, _text_scale = [1,1], _angle = 0, _text_color, _glow_color){ var _cur_color = draw_get_color(); @@ -126,4 +127,4 @@ function draw_text_ext_shadow(_x, _y, _text, _sep=-1, _w=9999){ draw_text_ext(_x-1, _y+1, _text, _sep, _w); draw_set_color(_cur_color); draw_text_ext(_x, _y, _text, _sep, _w); -} \ No newline at end of file +} diff --git a/scripts/scr_draw_unit_image/scr_draw_unit_image.gml b/scripts/scr_draw_unit_image/scr_draw_unit_image.gml index 6cc37cf10..58cd275bf 100644 --- a/scripts/scr_draw_unit_image/scr_draw_unit_image.gml +++ b/scripts/scr_draw_unit_image/scr_draw_unit_image.gml @@ -26,36 +26,138 @@ enum UnitSpecialColours { Gold, } - -function ColorItem() constructor{ - function scr_unit_draw_data(){ - map_colour = { - left_leg_lower : 0, - left_leg_upper : 0, - left_leg_knee : 0, - left_right_lower : 0, - left_right_upper : 0, - left_right_knee : 0, - metallic_trim : 0, - right_trim : 0, - left_trim : 0, - left_chest : 0, - right_chest : 0, - left_thorax : 0, - right_thorax : 0, - left_pauldron : 0, - right_pauldron: 0, - left_head : 0, - right_head: 0, +enum eARMOUR_SET { + None, + MK3, + MK4, + MK5, + MK6, + MK7, + MK8, + Indomitus, + Tartaros, +} +function ComplexSet() constructor{ + static add_to_area = function(area, add_sprite){ + if (!struct_exists(self, area)){ + self[$ area] = sprite_duplicate(add_sprite); + } else { + sprite_merge(self[$ area], add_sprite); } } - static set_legs_solid = function(col){ - var legs = ["left_leg_lower","left_leg_upper","left_leg_knee","left_right_lower","left_right_upper","left_right_knee"]; - for (var i=0 ;i 0){ var _spr_index = (hand_variant[right_left] - 1) * 2; - var _spr_w = sprite_get_width(_hand_spr) - sprite_get_xoffset(_hand_spr) * 2; if (right_left == 2) { _spr_index += (specialist_colours >= 2) ? 1 : 0; - draw_sprite_ext(_hand_spr, _spr_index, offset_x + _spr_w, offset_y, -1, 1, 0, c_white, 1); + draw_sprite_flipped(_hand_spr, _spr_index, offset_x, offset_y); } else { draw_sprite(_hand_spr, _spr_index, offset_x, offset_y); } @@ -225,63 +338,78 @@ function scr_draw_unit_image(_background=false){ if (hand_variant[right_left] == 1){ if (armour_type == ArmourType.Normal && !hide_bionics && struct_exists(body[$ (right_left == 1 ? "right_arm" : "left_arm")], "bionic")) { var bionic_hand = body[$ (right_left == 1 ? "right_arm" : "left_arm")][$ "bionic"]; - var _spr_w = sprite_get_width(spr_bionics_hand) - sprite_get_xoffset(spr_bionics_hand) * 2; var bionic_spr_index = bionic_hand.variant * 2; if (right_left == 2) { bionic_spr_index += (specialist_colours >= 2) ? 1 : 0; - draw_sprite_ext(spr_bionics_hand, bionic_spr_index, offset_x + _spr_w, offset_y, -1, 1, 0, c_white, 1); + draw_sprite_flipped(spr_bionics_hand, bionic_spr_index, offset_x, offset_y); } else { draw_sprite(spr_bionics_hand, bionic_spr_index, offset_x, offset_y); } } } } - } - - function draw_unit_arms(x_surface_offset, y_surface_offset, armour_type, specialist_colours, hide_bionics){ - if (array_contains([ArmourType.Normal,ArmourType.Terminator, ArmourType.Scout], armour_type)){ - var offset_x = x_surface_offset; - var offset_y = y_surface_offset; - switch(armour_type){ + }; + + var draw_unit_arms = function(_x_surface_offset, _y_surface_offset, _armour_type, _specialist_colours, _hide_bionics, _complex_set) { + if (array_contains([ArmourType.Normal, ArmourType.Terminator, ArmourType.Scout], _armour_type)) { + var _bionic_options = []; + var _arm_spr; + switch (_armour_type) { case ArmourType.Terminator: - var _arm_spr = spr_terminator_arms; + _arm_spr = spr_terminator_arms; + _bionic_options = [spr_indomitus_right_arm_bionic]; break; case ArmourType.Scout: - var _arm_spr = spr_scout_arms; + _arm_spr = spr_scout_arms; break; case ArmourType.Normal: default: - var _arm_spr = spr_pa_arms; + _bionic_options = [spr_bionics_arm, spr_bionics_arm_2]; + if (armour() == "Artificer Armour") { + //todo: refactor this + _arm_spr = spr_pa_arms_ornate; + } else { + _arm_spr = spr_pa_arms; + } break; } - if (armour() == "Artificer Armour"){ //todo: refactor this - _arm_spr = spr_pa_arms_ornate; - } - for (var right_left = 1; right_left <= 2; right_left++) { + for (var _right_left = 1; _right_left <= 2; _right_left++) { // Draw bionic arms - if (arm_variant[right_left] == 1 && armour_type == ArmourType.Normal && !hide_bionics && struct_exists(body[$ (right_left == 1 ? "right_arm" : "left_arm")], "bionic")){ - var bionic_arm = body[$ (right_left == 1 ? "right_arm" : "left_arm")][$ "bionic"]; - var _spr_w = sprite_get_width(spr_bionics_arm) - sprite_get_xoffset(spr_bionics_arm) * 2; - var bionic_spr_index = bionic_arm.variant * 2; - if (right_left == 2) { - bionic_spr_index += (specialist_colours >= 2) ? 1 : 0; - draw_sprite_ext(spr_bionics_arm, bionic_spr_index, offset_x + _spr_w, offset_y, -1, 1, 0, c_white, 1); + var _bionic_arm = get_body_data("bionic", _right_left == 1 ? "right_arm" : "left_arm"); + if (arm_variant[_right_left] == 1 && array_length(_bionic_options) && !_hide_bionics && _bionic_arm) { + var _bionic_variant = _bionic_arm.variant % array_length(_bionic_options); + var _bionic_spr_index = 0; + var _bionic_spr = _bionic_options[_bionic_variant]; + if (_right_left == 2) { + if (_specialist_colours >= 2) { + _bionic_spr_index = sprite_get_number(_bionic_spr) - 1; + } + draw_sprite_flipped(_bionic_spr, _bionic_spr_index, _x_surface_offset, _y_surface_offset); } else { - draw_sprite(spr_bionics_arm, bionic_spr_index, offset_x, offset_y); + draw_sprite(_bionic_spr, _bionic_spr_index, _x_surface_offset, _y_surface_offset); } - } else if (arm_variant[right_left] > 0){ - var _spr_index = (arm_variant[right_left] - 1) * 2; - var _spr_w = sprite_get_width(_arm_spr) - sprite_get_xoffset(_arm_spr) * 2; - if (right_left == 2) { - _spr_index += (specialist_colours >= 2) ? 1 : 0; - draw_sprite_ext(_arm_spr, _spr_index, offset_x + _spr_w, offset_y, -1, 1, 0, c_white, 1); + } else if (arm_variant[_right_left] > 0) { + if ((_right_left == 1) && struct_exists(_complex_set, "right_arm") && (arm_variant[_right_left] == 1)) { + setup_complex_livery_shader(role()); + draw_sprite(_complex_set.right_arm, 0, _x_surface_offset, _y_surface_offset); + shader_set(sReplaceColor); + } else if ((_right_left == 2) && struct_exists(_complex_set, "left_arm") && (arm_variant[_right_left] == 1)) { + setup_complex_livery_shader(role()); + draw_sprite(_complex_set.left_arm, 0, _x_surface_offset, _y_surface_offset); + shader_set(sReplaceColor); } else { - draw_sprite(_arm_spr, _spr_index, offset_x, offset_y); + var _spr_index = (arm_variant[_right_left] - 1) * 2; + if (_right_left == 2) { + _spr_index += (_specialist_colours >= 2) ? 1 : 0; + draw_sprite_flipped(_arm_spr, _spr_index, _x_surface_offset, _y_surface_offset); + } else { + draw_sprite(_arm_spr, _spr_index, _x_surface_offset, _y_surface_offset); + } } } } } - } + }; var x_surface_offset = 200; var y_surface_offset = 110; @@ -291,38 +419,36 @@ function scr_draw_unit_image(_background=false){ draw_set_font(fnt_40k_14b); draw_set_color(c_gray); var xx=__view_get( e__VW.XView, 0 )+0, yy=__view_get( e__VW.YView, 0 )+0, bb="", img=0; - var blandify = obj_controller.blandify; + var modest_livery = obj_controller.modest_livery; + var progenitor_visuals = obj_controller.progenitor_visuals; var draw_sequence = []; + try { if (name_role()!="") and (base_group=="astartes"){ - ui_weapon[1]=spr_weapon_blank; - ui_weapon[2]=spr_weapon_blank; - arm_variant[1]=1; - arm_variant[2]=1; - hand_variant[1]=1; - hand_variant[2]=1; - hand_on_top[1]=false; - hand_on_top[2]=false; - ui_spec[1]=false; - ui_spec[2]=false; - ui_twoh[1]=false; - ui_twoh[2]=false; - ui_xmod[1]=0; - ui_xmod[2]=0; - ui_ymod[1]=0; - ui_ymod[2]=0; - ui_back=true; - ui_force_both=false; - pauldron_trim=0; + for (var i = 1; i <= 2; i++) { + ui_weapon[i]=spr_weapon_blank; + arm_variant[i]=1; + hand_variant[i]=1; + hand_on_top[i]=false; + ui_spec[i]=false; + ui_twoh[i]=false; + ui_xmod[i]=0; + ui_ymod[i]=0; + new_weapon_draw[i]=false; + } + var draw_backpack = true; + var ui_force_both=false; + var pauldron_trim=false; var armour_bypass = false; var hide_bionics = false; var robes_bypass = false; var robes_hood_bypass = false; var halo_bypass = false; var arm_bypass = false; - var armour_draw =[]; + var armour_draw = []; var specialist_colours=obj_ini.col_special; var specific_armour_sprite = "none"; var unit_chapter = global.chapter_name; + var unit_progenitor = progenitor_visuals ? progenitor_map() : 0; var unit_is_sniper = false; var unit_role = role(); var unit_wep1=weapon_one(); @@ -335,16 +461,17 @@ function scr_draw_unit_image(_background=false){ var skin_color=obj_ini.skin_color; var armour_type = ArmourType.Normal; var armour_sprite = spr_weapon_blank; - var back_type = BackType.None, - psy_hood = 0, - skull_mask = 0, - servo_arm = 0, - servo_harness = 0, - halo = 0, - reverent_guardians = 0, - slow_trait = 0, - tech_brothers_trait = -5, - body_part; + var complex_livery = false; + var back_equipment = BackType.None; + var psy_hood = 0; + var skull_mask = 0; + var servo_arm = 0; + var servo_harness = 0; + var halo = 0; + var reverent_guardians = false; + var tech_brothers_trait = -5; + var body_part; + var dev_trait = 0; // if (unit_role=="Chapter Master"){unit_specialization=111;} // // Honour Guard @@ -391,30 +518,31 @@ function scr_draw_unit_image(_background=false){ } } // Blood Angels gold - if ((unit_role==obj_ini.role[100][Role.HONOUR_GUARD] || unit_role=="Chapter Master")) and (unit_chapter=="Blood Angels"){ + if ((unit_role==_role[eROLE.HonourGuard] || unit_role=="Chapter Master")) and (unit_chapter=="Blood Angels"){ unit_special_colours=UnitSpecialColours.Gold; } // Sets up the description for the equipement of current marine - if (array_contains([UnitSpecialization.Chaplain, UnitSpecialization.WolfPriest, UnitSpecialization.Librarian], unit_specialization) || unit_role=="Chapter Master"){ - if (array_contains(obj_ini.adv, "Reverent Guardians")){ - reverent_guardians=1 + if (scr_has_adv("Reverent Guardians")){ + if (array_contains([UnitSpecialization.Chaplain, UnitSpecialization.WolfPriest, UnitSpecialization.Librarian], unit_specialization) || unit_role=="Chapter Master"){ + reverent_guardians = true; } } + if (unit_gear="Psychic Hood"){ psy_hood=-50; } if (array_contains([UnitSpecialization.Chaplain, UnitSpecialization.WolfPriest], unit_specialization)) then skull_mask=-50; - // if (_armour_type!=ArType.Norm) then ui_back=false; + // if (_armour_type!=ArType.Norm) then draw_backpack=false; if (unit_back=="Jump Pack"){ - ui_back=false; - back_type=BackType.Jump; + draw_backpack=false; + back_equipment=BackType.Jump; }else if (unit_back=="Heavy Weapons Pack"){ - ui_back=false; - back_type=BackType.Dev; + draw_backpack=false; + back_equipment=BackType.Dev; } else if (unit_back="Servo-arm"){ servo_arm=1; } else if (unit_back="Servo-harness"){ @@ -436,14 +564,14 @@ function scr_draw_unit_image(_background=false){ case "Dreadnought": armour_type = ArmourType.Dreadnought; break; - case "(None)": + case ITEM_NAME_NONE: case "": case "None": armour_type = ArmourType.None; break; } - if (armour_type!=ArmourType.Normal) then ui_back=false; + if (armour_type!=ArmourType.Normal) then draw_backpack=false; if (armour_type!=ArmourType.Dreadnought && armour_type!=ArmourType.None){ if (weapon_one()!=""){ @@ -489,7 +617,7 @@ function scr_draw_unit_image(_background=false){ unit_specialization=0; if (unit_role=obj_ini.role[100,14]) then unit_specialization == UnitSpecialization.Chaplain;// Chaplain if (unit_role=obj_ini.role[100,15]) then unit_specialization == UnitSpecialization.Apothecary;// Apothecary - if (unit_role=obj_ini.role[100,15]) and ((unit_chapter="Blood Angels" || obj_ini.progenitor==5)) then unit_specialization=4;// Sanguinary + if (unit_role=obj_ini.role[100,15]) and ((unit_chapter="Blood Angels" || obj_ini.progenitor==PROGENITOR.BLOOD_ANGELS)) then unit_specialization=4;// Sanguinary if (unit_role=obj_ini.role[100,16]) then unit_specialization == UnitSpecialization.Techmarine;// Techmarine if (unit_role=obj_ini.role[100,17]) then unit_specialization == UnitSpecialization.Librarian;// Librarian */ @@ -515,7 +643,7 @@ function scr_draw_unit_image(_background=false){ } } } - + //TODO complex shader means no need for all this edge case stuff // Apothecary else if (unit_specialization == UnitSpecialization.Apothecary) and (unit_chapter!="Space Wolves"){ shader_array_set[ShaderType.Body] = Colors.White; @@ -549,7 +677,7 @@ function scr_draw_unit_image(_background=false){ } // Honour Guard - else if (unit_role==obj_ini.role[100][Role.HONOUR_GUARD]){ + else if (unit_role==_role[eROLE.HonourGuard]){ pauldron_trim=0; specialist_colours=0; // Blood Angels @@ -579,14 +707,14 @@ function scr_draw_unit_image(_background=false){ // Dark Angels Deathwing if (unit_special_colours == UnitSpecialColours.Deathwing){ - if !array_contains([obj_ini.role[100][Role.CHAPLAIN],obj_ini.role[100][Role.LIBRARIAN], obj_ini.role[100][Role.TECHMARINE]], unit_role){ + if !array_contains([_role[eROLE.Chaplain],_role[eROLE.Librarian], _role[eROLE.Techmarine]], unit_role){ shader_array_set[ShaderType.Body] = Colors.Deathwing; shader_array_set[ShaderType.Trim] = Colors.Light_Caliban_Green; - if (unit_role != obj_ini.role[100][Role.APOTHECARY]){ + if (unit_role != _role[eROLE.Apothecary]){ shader_array_set[ShaderType.Helmet] = Colors.Deathwing; } } - if !array_contains([obj_ini.role[100][Role.CHAPLAIN],obj_ini.role[100][Role.TECHMARINE]], unit_role){ + if !array_contains([_role[eROLE.Chaplain],_role[eROLE.Techmarine]], unit_role){ shader_array_set[ShaderType.RightPauldron] = Colors.Deathwing; } shader_array_set[ShaderType.LeftPauldron] = Colors.Deathwing; @@ -596,11 +724,11 @@ function scr_draw_unit_image(_background=false){ // Dark Angels Ravenwing if (unit_special_colours == UnitSpecialColours.Ravenwing){ - if !array_contains([obj_ini.role[100][Role.CHAPLAIN],obj_ini.role[100][Role.LIBRARIAN], obj_ini.role[100][Role.TECHMARINE],obj_ini.role[100][Role.APOTHECARY]], unit_role){ + if !array_contains([_role[eROLE.Chaplain],_role[eROLE.Librarian], _role[eROLE.Techmarine],_role[eROLE.Apothecary]], unit_role){ shader_array_set[ShaderType.Body] = Colors.Black; shader_array_set[ShaderType.Helmet] = Colors.Black; } - if !array_contains([obj_ini.role[100][Role.CHAPLAIN],obj_ini.role[100][Role.TECHMARINE]], unit_role){ + if !array_contains([_role[eROLE.Chaplain],_role[eROLE.Techmarine]], unit_role){ shader_array_set[ShaderType.RightPauldron] = Colors.Black; } shader_array_set[ShaderType.LeftPauldron] = Colors.Black; @@ -609,7 +737,7 @@ function scr_draw_unit_image(_background=false){ } // Dark Angels Captains - if (unit_chapter == "Dark Angels" && unit_role == obj_ini.role[100][Role.CAPTAIN] && company != 1){ + if (unit_chapter == "Dark Angels" && unit_role == _role[eROLE.Captain] && company != 1){ shader_array_set[ShaderType.RightPauldron] = Colors.Dark_Red; shader_array_set[ShaderType.Helmet] = Colors.Deathwing; pauldron_trim=0; @@ -617,7 +745,7 @@ function scr_draw_unit_image(_background=false){ } // Dark Angels Honour Guard - if (unit_chapter == "Dark Angels" && unit_role == obj_ini.role[100][Role.HONOUR_GUARD]){ + if (unit_chapter == "Dark Angels" && unit_role == _role[eROLE.HonourGuard]){ shader_array_set[ShaderType.Body] = Colors.Deathwing; shader_array_set[ShaderType.RightPauldron] = Colors.Deathwing; shader_array_set[ShaderType.LeftPauldron] = Colors.Deathwing; @@ -627,7 +755,7 @@ function scr_draw_unit_image(_background=false){ } // Blood Angels Sergeants - if (unit_chapter == "Blood Angels" && unit_role == obj_ini.role[100][Role.SERGEANT]){ + if (unit_chapter == "Blood Angels" && unit_role == _role[eROLE.Sergeant]){ shader_array_set[ShaderType.LeftPauldron] = Colors.Black; shader_array_set[ShaderType.RightPauldron] = Colors.Black; pauldron_trim=0; @@ -649,26 +777,43 @@ function scr_draw_unit_image(_background=false){ //Rejoice! // draw_sprite(spr_marine_base,img,x_surface_offset,y_surface_offset); - var clothing_style=3; - if (progenitor_map()=="Dark Angels") {clothing_style=0;} - else if (progenitor_map()=="White Scars") {clothing_style=1; } - else if (progenitor_map()=="Space Wolves") {clothing_style=2;} - else if (progenitor_map()=="Imperial Fists") {clothing_style=0;} - else if (progenitor_map()=="Iron Hands" ) { clothing_style=0;} - else if (progenitor_map()=="Salamanders" ) {clothing_style=4;} - else if (progenitor_map()=="Raven Guard") {clothing_style=0;} - else if (progenitor_map()=="Doom Benefactors") {clothing_style=4;} + var clothing_style = 3; + + if (global.chapter_name == "Doom Benefactors") { + clothing_style = 4; + } else { + switch (obj_ini.progenitor) { + case ePROGENITOR.DARK_ANGELS: + case ePROGENITOR.IMPERIAL_FISTS: + case ePROGENITOR.IRON_HANDS: + case ePROGENITOR.RAVEN_GUARD: + clothing_style = 0; + break; + + case ePROGENITOR.WHITE_SCARS: + clothing_style = 1; + break; + + case ePROGENITOR.SPACE_WOLVES: + clothing_style = 2; + break; + + case ePROGENITOR.SALAMANDERS: + clothing_style = 4; + break; + } + } // Determine Sprite if (skull_mask=-50) then skull_mask=1; if (unit_armour!=""){ var yep=0; - if (array_contains(obj_ini.adv,"Slow and Purposeful")){ - slow_trait=1 + if scr_has_adv("Devastator Doctrine"){ + dev_trait=1 } if (unit_specialization == UnitSpecialization.Techmarine){ - if (array_contains(obj_ini.adv,"Tech-Brothers")){ + if (scr_has_adv("Tech-Brothers")){ tech_brothers_trait=0 } } @@ -677,7 +822,7 @@ function scr_draw_unit_image(_background=false){ if (armour_type == ArmourType.Scout){ - if (slow_trait>0) then slow_trait=10; + if (dev_trait>0) then dev_trait=10; armour_sprite=spr_scout_colors2; if (squad!="none"){ if (obj_ini.squads[squad].type=="scout_sniper_squad" || weapon_one()=="Sniper Rifle" || weapon_two()=="Sniper Rifle"){ @@ -686,32 +831,32 @@ function scr_draw_unit_image(_background=false){ } if (psy_hood=-50) then psy_hood=0; }else if (unit_armour=="MK3 Iron Armour"){ - if (slow_trait>0) then slow_trait=13; + if (dev_trait>0) then dev_trait=13; if (tech_brothers_trait>-5) then tech_brothers_trait=3; armour_sprite=spr_mk3_colors; if (psy_hood=-50) then psy_hood=5; }else if (unit_armour=="MK4 Maximus"){ - if (slow_trait>0) then slow_trait=13; + if (dev_trait>0) then dev_trait=13; if (tech_brothers_trait>-5) then tech_brothers_trait=3; armour_sprite=spr_mk4_colors; if (psy_hood=-50) then psy_hood=6; }else if (unit_armour=="MK5 Heresy"){ - if (slow_trait>0) then slow_trait=13; + if (dev_trait>0) then dev_trait=13; if (tech_brothers_trait>-5) then tech_brothers_trait=3; armour_sprite=spr_mk5_colors; if (psy_hood=-50) then psy_hood=6; }else if (unit_armour=="MK6 Corvus"){ - if (slow_trait>0) then slow_trait=13; + if (dev_trait>0) then dev_trait=13; if (tech_brothers_trait>-5) then tech_brothers_trait=2; armour_sprite=spr_beakie_colors; if (psy_hood=-50) then psy_hood=3; }else if (unit_armour=="MK7 Aquila" || unit_armour=="Power Armour"){ if (tech_brothers_trait>-5) then tech_brothers_trait=0; - if (slow_trait>0) then slow_trait=13; + if (dev_trait>0) then dev_trait=13; armour_sprite=spr_mk7_colors; if (psy_hood=-50) then psy_hood=1; }else if (unit_armour=="MK8 Errant"){ - if (slow_trait>0) then slow_trait=13; + if (dev_trait>0) then dev_trait=13; if (tech_brothers_trait>-5) then tech_brothers_trait=0; armour_sprite=spr_mk8_colors; if (psy_hood=-50) then psy_hood=4; @@ -727,7 +872,7 @@ function scr_draw_unit_image(_background=false){ if (psy_hood=-50) then psy_hood=9; if (skull_mask==1) then skull_mask=2; }else if (unit_armour=="Artificer Armour"){ - if (slow_trait>0) then slow_trait=13; + if (dev_trait>0) then dev_trait=13; if (tech_brothers_trait>-5) then tech_brothers_trait=1; armour_sprite=spr_artificer_colors; if (psy_hood=-50) then psy_hood=2; @@ -735,13 +880,13 @@ function scr_draw_unit_image(_background=false){ if (armour_sprite=spr_weapon_blank) and (unit_armour!=""){ if (string_count("Power Armour",unit_armour)>0){ - if (slow_trait>0) then slow_trait=13; + if (dev_trait>0) then dev_trait=13; if (tech_brothers_trait>-5) then tech_brothers_trait=0; armour_sprite=spr_mk7_colors; if (psy_hood=-50) then psy_hood=1; } if (string_count("Artifi",unit_armour)>0){ - if (slow_trait>0) then slow_trait=13; + if (dev_trait>0) then dev_trait=13; if (tech_brothers_trait>-5) then tech_brothers_trait=1; armour_sprite=spr_artificer_colors; if (psy_hood=-50) then psy_hood=2; @@ -755,7 +900,7 @@ function scr_draw_unit_image(_background=false){ } // Draw the lights - if (unit_specialization == UnitSpecialization.Apothecary) and (unit_armour!="") and (back_type == BackType.None){ + if (unit_specialization == UnitSpecialization.Apothecary) and (unit_armour!="") and (back_equipment == BackType.None){ if (unit_armour=="Terminator Armour") then draw_sprite(spr_gear_apoth,0,x_surface_offset,y_surface_offset-22); // for terminators else draw_sprite(spr_gear_apoth,0,x_surface_offset,y_surface_offset-6); // for normal power armour } @@ -776,47 +921,7 @@ function scr_draw_unit_image(_background=false){ draw_sprite(spr_marine_base,skin_color,x_surface_offset,y_surface_offset); if (skin_color!=6) then draw_sprite(spr_clothing_colors,clothing_style,x_surface_offset,y_surface_offset); - } else { - if (reverent_guardians=1) and (blandify=0){ - if (armour_type==ArmourType.Normal) then draw_sprite(spr_pack_brazier,0,x_surface_offset,y_surface_offset); - if (armour_type!=ArmourType.Normal) then draw_sprite(spr_pack_brazier,1,0-2,0); - } - // Draw the backpack - if (armour_type!=ArmourType.Dreadnought){ - if (ui_back){ - var back_sprite [0, 0]; - if (specialist_colours==0) then back_sprite = [armour_sprite, 10]; - if (specialist_colours==1) then back_sprite = [armour_sprite, 11]; - if (specialist_colours>=2) then back_sprite = [armour_sprite, 12]; - if (body.torso.backpack_variation < 3) { - if (progenitor_map()=="Dark Angels"){ - if array_contains(["MK5 Heresy", "MK6 Corvus","MK7 Aquila", "MK8 Errant", "Artificer Armour"], unit_armour){ - back_sprite = [spr_da_backpack, 0]; - } - } - } - if (unit_chapter == "Dark Angels") { - if (unit_role == "Chapter Master") { - back_sprite = [spr_da_backpack, 1]; - } else if (unit_role == "Master of Sanctity") { - back_sprite = [spr_da_chaplain, 1]; - } - } - draw_sprite(back_sprite[0],back_sprite[1],x_surface_offset,y_surface_offset); - }else{ - if (back_type==BackType.Jump){ - if (specialist_colours==0) then draw_sprite(spr_pack_jump,0,x_surface_offset,y_surface_offset); - if (specialist_colours==1) then draw_sprite(spr_pack_jump,1,x_surface_offset,y_surface_offset); - if (specialist_colours>=2) then draw_sprite(spr_pack_jump,2,x_surface_offset,y_surface_offset); - } - if (back_type==BackType.Dev){ - if (specialist_colours==0) then draw_sprite(spr_pack_devastator,0,x_surface_offset,y_surface_offset); - if (specialist_colours==1) then draw_sprite(spr_pack_devastator,1,x_surface_offset,y_surface_offset); - if (specialist_colours>=2) then draw_sprite(spr_pack_devastator,2,x_surface_offset,y_surface_offset); - } - } - } - + } else { var specific_helm = false; var helm_draw=[0,0]; if (armour_type == ArmourType.Scout){ @@ -829,11 +934,14 @@ function scr_draw_unit_image(_background=false){ specific_armour_sprite=armour_sprite; armour_bypass=true; }else if (unit_armour=="MK3 Iron Armour"){ - specific_armour_sprite = spr_mk3_colors; + specific_armour_sprite = spr_mk3_complex; + complex_set = get_complex_set(eARMOUR_SET.MK3); + complex_livery = true; specific_helm = spr_generic_sgt_mk3; - if (progenitor_map()=="Dark Angels"){ + if (unit_progenitor == ePROGENITOR.DARK_ANGELS){ + complex_livery = false; specific_helm = false; - if (unit_role==obj_ini.role[100][Role.CAPTAIN]){ + if (unit_role==_role[eROLE.Captain]){ // specific_armour_sprite = spr_da_mk3; armour_draw=[spr_da_mk3,0]; robes_bypass = true; @@ -843,8 +951,10 @@ function scr_draw_unit_image(_background=false){ } } else if (unit_armour=="MK4 Maximus"){ specific_helm = spr_generic_sgt_mk4; - specific_armour_sprite = spr_mk4_colors; - if (array_contains(["Champion",obj_ini.role[100][2],obj_ini.role[100][5]], unit_role)){ + specific_armour_sprite = spr_mk4_complex; + complex_set = get_complex_set(eARMOUR_SET.MK4); + complex_livery = true; + if (array_contains(["Champion",_role[2],_role[5]], unit_role)){ /*if (unit_chapter=="Ultramarines"){ armour_draw=[spr_ultra_honor_guard,body.torso.armour_choice]; armour_bypass=true; @@ -854,10 +964,11 @@ function scr_draw_unit_image(_background=false){ armour_bypass=true; }*/ } - if (progenitor_map()=="Dark Angels"){ + if (unit_progenitor == ePROGENITOR.DARK_ANGELS){ specific_helm = false; - if (unit_role==obj_ini.role[100][Role.CAPTAIN]){ + if (unit_role==_role[eROLE.Captain]){ // specific_armour_sprite = spr_da_mk4; + complex_livery = false; armour_draw=[spr_da_mk4,0]; robes_bypass = true; robes_hood_bypass = true; @@ -865,25 +976,32 @@ function scr_draw_unit_image(_background=false){ } } } else if (unit_armour=="MK5 Heresy"){ - specific_armour_sprite = spr_mk5_colors; + specific_armour_sprite = spr_mk5_complex; + complex_set = get_complex_set(eARMOUR_SET.MK5); + complex_livery = true; //TODO sort this mess out streamline system somehow specific_helm = spr_generic_sgt_mk5; - if (progenitor_map()=="Dark Angels"){ + if (unit_progenitor == ePROGENITOR.DARK_ANGELS){ specific_helm = false; - if (unit_role==obj_ini.role[100][Role.CAPTAIN]){ + if (unit_role==_role[eROLE.Captain]){ // specific_armour_sprite = spr_da_mk5; armour_draw=[spr_da_mk5,0]; robes_bypass = true; robes_hood_bypass = true; armour_bypass=true; + complex_livery = false; } } } else if (unit_armour=="MK6 Corvus"){ + specific_armour_sprite = spr_mk6_complex; + complex_set = get_complex_set(eARMOUR_SET.MK6); + complex_livery = true; specific_armour_sprite = spr_beakie_colors; specific_helm = spr_generic_sgt_mk6; - if (progenitor_map()=="Dark Angels"){ + if (obj_ini.progenitor == ePROGENITOR.DARK_ANGELS){ specific_helm = false; - if (unit_role==obj_ini.role[100][Role.CAPTAIN]){ + if (unit_role==_role[eROLE.Captain]){ + complex_livery = false; // specific_armour_sprite = spr_da_mk6; armour_draw=[spr_da_mk6,0]; robes_bypass = true; @@ -893,24 +1011,29 @@ function scr_draw_unit_image(_background=false){ } } else if (unit_armour=="MK7 Aquila" || unit_armour="Power Armour"){ - specific_armour_sprite = spr_mk7_colors; + specific_armour_sprite = spr_mk7_complex; + complex_set = get_complex_set(eARMOUR_SET.MK7); + complex_livery = true; specific_helm = spr_generic_sgt_mk7; - if (progenitor_map()=="Dark Angels"){ + if (obj_ini.progenitor == ePROGENITOR.DARK_ANGELS){ specific_helm = false; - if (unit_role==obj_ini.role[100][Role.CAPTAIN]){ + if (unit_role==_role[eROLE.Captain]){ // specific_armour_sprite = spr_da_mk7; armour_draw = [spr_da_mk7,0]; robes_bypass = true; robes_hood_bypass = true; armour_bypass = true; + complex_livery = false; } } } else if (unit_armour=="MK8 Errant"){ specific_helm = spr_generic_sgt_mk8; specific_armour_sprite = spr_mk8_colors; - if (progenitor_map()=="Dark Angels"){ + complex_set = get_complex_set(eARMOUR_SET.MK8); + complex_livery = true; + if (unit_progenitor == ePROGENITOR.DARK_ANGELS) { specific_helm = false; - if (unit_role==obj_ini.role[100][Role.CAPTAIN]){ + if (unit_role==_role[eROLE.Captain]){ // specific_armour_sprite = spr_da_mk8; armour_draw=[spr_da_mk8,0]; robes_bypass = true; @@ -919,26 +1042,38 @@ function scr_draw_unit_image(_background=false){ } } } else if (unit_armour=="Artificer Armour"){ - specific_armour_sprite = spr_artificer_colors; - if (array_contains(["Champion",obj_ini.role[100][2],obj_ini.role[100][5]], unit_role)){ + complex_set = get_complex_set(eARMOUR_SET.MK7); + complex_set.add_group({ + right_leg : spr_artificer_right_leg, + left_leg : spr_artificer_left_leg, + chest_variants : spr_artificer_chest, + thorax_variants : spr_artificer_thorax, + mouth_variants : spr_artificer_mouth, + left_trim : spr_artificer_left_trim, + left_pauldron : spr_artificer_left_pad, + }); + complex_livery = true; + specific_helm = spr_generic_sgt_mk7; + if (array_contains(["Champion",_role[2],_role[5]], unit_role)){ if (unit_chapter=="Ultramarines"){ - armour_draw=[spr_ultra_honor_guard2,body.torso.armour_choice]; + armour_draw=[spr_ultra_honor_guard2, body.torso.armour_choice]; armour_bypass=true; + // Draw cape; draw_sprite(spr_ultra_honor_guard2,2,x_surface_offset,y_surface_offset); - } else { - armour_draw=[spr_generic_honor_guard,body.torso.armour_choice]; - armour_bypass=true; } } - if (unit_chapter=="Blood Angels"){ + if (unit_chapter=="Blood Angels" || unit_progenitor == eCHAPTERS.BLOOD_ANGELS){ if (unit_role=="Chapter Master"){ + armour_bypass=true; hide_bionics = true; robes_bypass = true; robes_hood_bypass = true; armour_draw=[spr_dante,0]; + // Draw wings; draw_sprite(spr_dante,1,x_surface_offset,y_surface_offset); - } else if (unit_role==obj_ini.role[100][2]){ + } else if (unit_role==_role[2]){ + armour_bypass=true; hide_bionics = true; robes_bypass = true; @@ -964,13 +1099,17 @@ function scr_draw_unit_image(_background=false){ } } } else if (unit_armour="Tartaros"){ - specific_armour_sprite = spr_tartaros2_colors; + specific_armour_sprite = spr_tartaros_complex; + complex_set = get_complex_set(eARMOUR_SET.Tartaros); + complex_livery = true; } else if (unit_armour="Terminator Armour"){ - specific_armour_sprite = spr_terminator3_colors; + specific_armour_sprite = spr_indomitus_complex; + complex_set = get_complex_set(eARMOUR_SET.Indomitus); + complex_livery = true; specific_helm = spr_generic_terminator_sgt; if(unit_chapter == "Dark Angels"){ specific_helm = false; - if (unit_role == obj_ini.role[100][2]){ + if (unit_role == _role[eROLE.HonourGuard]){ armour_bypass=true; armour_draw=[spr_da_term_honor,0]; hide_bionics = true; @@ -979,15 +1118,30 @@ function scr_draw_unit_image(_background=false){ } if (unit_specialization == UnitSpecialization.Techmarine){ - if (armour_type==ArmourType.Normal && armour_bypass==false){ - if (array_contains(traits, "tinkerer")){ - armour_draw=[spr_techmarine_core,0]; - armour_bypass = true; + if array_contains(["MK5 Heresy", "MK6 Corvus","MK7 Aquila", "MK8 Errant", "Artificer Armour"], unit_armour){ + if (has_trait("tinkerer") && complex_livery){ + complex_set.add_group({ + "armour":spr_techmarine_complex, + "right_trim":spr_techmarine_right_trim, + "left_trim":spr_techmarine_left_trim, + "leg_variants":spr_techmarine_left_leg, + "leg_variants":spr_techmarine_right_leg, + "head":spr_techmarine_head, + "chest_variants":spr_techmarine_chest, + }) } } } - + if (armour_type==ArmourType.Normal && complex_livery && unit_role==_role[2]){ + complex_set.add_group({ + right_leg : spr_artificer_right_leg, + left_leg : spr_artificer_left_leg, + chest_variants : spr_artificer_chest, + thorax_variants : spr_artificer_thorax, + mouth_variants : spr_artificer_mouth + }); + } // Draw the Iron Halo if (halo==1 && !halo_bypass){ var halo_offset_y = 0; @@ -996,9 +1150,7 @@ function scr_draw_unit_image(_background=false){ if (array_contains(["Raven Guard", "Dark Angels"], unit_chapter)) { halo_color = 1; } - if (unit_armour=="Artificer Armour" && !armour_bypass){ - halo_offset_y -= 14; - } else if (unit_armour=="Terminator Armour"){ + if (unit_armour=="Terminator Armour"){ halo_type = 2; halo_offset_y -= 20; } else if (unit_armour=="Tartaros"){ @@ -1008,37 +1160,182 @@ function scr_draw_unit_image(_background=false){ draw_sprite(spr_gear_halo,halo_type+halo_color,x_surface_offset,y_surface_offset+halo_offset_y); } - // Draw arms - draw_unit_arms(x_surface_offset, y_surface_offset, armour_type, specialist_colours, hide_bionics); + // Draw the backpack + if (draw_backpack){ + var _backpack_sprite = ""; + var _backpack_index = 0; + + if (specialist_colours==0) { + _backpack_sprite = armour_sprite; + _backpack_index = 10; + } else if (specialist_colours==1) { + _backpack_sprite = armour_sprite; + _backpack_index = 11; + } else if (specialist_colours>=2) { + _backpack_sprite = armour_sprite; + _backpack_index = 12; + } + + if (body.torso.backpack_variation % 3 == 0) { + if (unit_progenitor == ePROGENITOR.DARK_ANGELS){ + if array_contains(["MK5 Heresy", "MK6 Corvus","MK7 Aquila", "MK8 Errant", "Artificer Armour"], unit_armour){ + _backpack_sprite = spr_da_backpack; + complex_set.add_to_area("backpack",spr_da_backpack); + } + } + if (reverent_guardians) and (!modest_livery){ + complex_set.add_to_area("backpack",spr_pack_brazier3); + } + } + + /*if (unit_progenitor == "Dark Angels") { + if (unit_role == "Chapter Master") { + _backpack_sprite = spr_da_backpack; + _backpack_index = 1; + } else if (unit_role == "Master of Sanctity") { + _backpack_sprite = spr_da_chaplain; + _backpack_index = 1; + } + }*/ + if (complex_livery) && (struct_exists(complex_set, "backpack")){ + var choice = get_body_data("backpack_variation","torso")%sprite_get_number(complex_set.backpack); + setup_complex_livery_shader(role()); + draw_sprite(complex_set.backpack,choice,x_surface_offset,y_surface_offset); + shader_set(sReplaceColor); + } else { + draw_sprite(_backpack_sprite, _backpack_index, x_surface_offset, y_surface_offset); + } + }else{ + if (back_equipment==BackType.Jump){ + var color_variant = min(specialist_colours, 2); + draw_sprite(spr_pack_jump,color_variant,x_surface_offset,y_surface_offset); + } else if (back_equipment==BackType.Dev){ + var color_variant = min(specialist_colours, 2); + draw_sprite(spr_pack_devastator,color_variant,x_surface_offset,y_surface_offset); + } + } + + if (armour_type == ArmourType.Terminator && complex_livery){ + var _body_parts = ARR_body_parts; + for (var part = 0; part < array_length(_body_parts); part++) { + if (struct_exists(body[$ _body_parts[part]], "bionic")) { + + var body_part = _body_parts[part]; + var bionic = body[$ body_part][$ "bionic"]; + switch (body_part) { + case "left_eye": + complex_set.add_to_area("left_eye", spr_indomitus_left_eye_bionic); + break; + + case "right_eye": + complex_set.add_to_area("right_eye", spr_indomitus_right_eye_bionic); + break; + + case "left_leg": + complex_set.add_to_area("left_leg", spr_indomitus_left_leg_bionic); + break; + + case "right_leg": + complex_set.add_to_area("right_leg", spr_indomitus_right_leg_bionic); + break; + } + + } + } + } + draw_unit_arms(x_surface_offset, y_surface_offset, armour_type, specialist_colours, hide_bionics, complex_set); // Draw torso if (!armour_bypass){ - draw_sprite(armour_sprite,specialist_colours,x_surface_offset,y_surface_offset); + if (complex_livery){ + setup_complex_livery_shader(role()); + if (struct_exists(complex_set, "armour")){ + draw_sprite(complex_set.armour,body.torso.armour_choice,x_surface_offset,y_surface_offset); + if (struct_exists(complex_set, "chest_variants")){ + var choice = get_body_data("chest_variation","torso")%sprite_get_number(complex_set.chest_variants); + draw_sprite(complex_set.chest_variants,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "thorax_variants")){ + var choice = get_body_data("thorax_variation","torso")%sprite_get_number(complex_set.thorax_variants); + draw_sprite(complex_set.thorax_variants,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "mouth_variants")){ + var choice = get_body_data("mouth_variants","jaw")%sprite_get_number(complex_set.mouth_variants); + draw_sprite(complex_set.mouth_variants,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "leg_variants")){ + var choice = get_body_data("leg_variants","left_leg")%sprite_get_number(complex_set.leg_variants); + draw_sprite(complex_set.leg_variants,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "left_leg")){ + var choice = get_body_data("leg_variants","left_leg")%sprite_get_number(complex_set.left_leg); + draw_sprite(complex_set.left_leg,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "right_leg")){ + var choice = get_body_data("leg_variants","right_leg")%sprite_get_number(complex_set.right_leg); + draw_sprite(complex_set.right_leg,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "left_trim")){ + var choice = get_body_data("trim_variation","left_arm")%sprite_get_number(complex_set.left_trim); + draw_sprite(complex_set.left_trim,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "right_trim")){ + var choice = get_body_data("trim_variation","right_arm")%sprite_get_number(complex_set.right_trim); + draw_sprite(complex_set.right_trim,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "head")){ + var choice = get_body_data("variation","head")%sprite_get_number(complex_set.head); + draw_sprite(complex_set.head,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "left_eye")){ + var choice = get_body_data("variant","left_eye")%sprite_get_number(complex_set.left_eye); + draw_sprite(complex_set.left_eye,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "right_eye")){ + var choice = get_body_data("variant","right_eye")%sprite_get_number(complex_set.right_eye); + draw_sprite(complex_set.right_eye,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "gorget")){ + var choice = get_body_data("variant","throat")%sprite_get_number(complex_set.gorget); + draw_sprite(complex_set.gorget,choice,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "right_pauldron")){ + draw_sprite(complex_set.right_pauldron,company,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "left_pauldron")){ + draw_sprite(complex_set.left_pauldron,company,x_surface_offset,y_surface_offset); + } + if (struct_exists(complex_set, "left_knee")){ + draw_sprite(complex_set.left_knee,company,x_surface_offset,y_surface_offset); + } + } else { + draw_sprite(specific_armour_sprite,0,x_surface_offset,y_surface_offset); + } + shader_set(sReplaceColor); + } else{ + draw_sprite(armour_sprite,specialist_colours,x_surface_offset,y_surface_offset); + } // Draw additional torso decals if (array_contains(["MK3 Iron Armour", "MK6 Corvus", "MK7 Aquila", "MK8 Errant"], unit_armour)){ - if (back_type == BackType.Jump || back_type == BackType.Dev){ + if (back_equipment == BackType.Jump || back_equipment == BackType.Dev){ draw_sprite(mk7_chest_variants,1,x_surface_offset,y_surface_offset); - } else if (unit_armour=="MK7 Aquila"){ - if (struct_exists(body.torso, "variation")){ - if (body.torso.variation%2 == 1){ - draw_sprite(mk7_chest_variants,0,x_surface_offset,y_surface_offset); - } - } } } // Draw pauldron trim - if (specific_armour_sprite != "none"){ - if (pauldron_trim==0 && specialist_colours<=1) then draw_sprite(specific_armour_sprite,4,x_surface_offset,y_surface_offset); - if (pauldron_trim==0 && specialist_colours>=2) then draw_sprite(specific_armour_sprite,5,x_surface_offset,y_surface_offset); + if (!complex_livery){ + if (specific_armour_sprite != "none"){ + if (pauldron_trim==0 && specialist_colours<=1) then draw_sprite(specific_armour_sprite,4,x_surface_offset,y_surface_offset); + if (pauldron_trim==0 && specialist_colours>=2) then draw_sprite(specific_armour_sprite,5,x_surface_offset,y_surface_offset); + } } } else if (array_length(armour_draw)){ draw_sprite(armour_draw[0], armour_draw[1],x_surface_offset,y_surface_offset); } // Draw decals, features and other stuff - if (slow_trait>=10) and (blandify=0) then draw_sprite(armour_sprite,slow_trait,x_surface_offset,y_surface_offset);// Slow and Purposeful battle damage - // if (tech_brothers_trait>=0) and (blandify=0) then draw_sprite(spr_gear_techb,tech_brothers_trait,x_surface_offset,y_surface_offset);// Tech-Brothers bling + if (dev_trait>=10) and (!modest_livery) then draw_sprite(armour_sprite,dev_trait,x_surface_offset,y_surface_offset);// Devastator Doctrine battle damage + // if (tech_brothers_trait>=0) and (modest_livery=0) then draw_sprite(spr_gear_techb,tech_brothers_trait,x_surface_offset,y_surface_offset);// Tech-Brothers bling //sgt helms if (specific_helm!=false){ var return_helm = false; @@ -1053,7 +1350,7 @@ function scr_draw_unit_image(_background=false){ var sec=0; var lenne2=0; var recolour_helm =false; - if (unit_role==obj_ini.role[100][Role.SERGEANT]){ + if (unit_role==_role[eROLE.Sergeant]){ with (obj_ini.complex_livery_data.sgt){ prime=helm_primary; sec=helm_secondary; @@ -1061,7 +1358,7 @@ function scr_draw_unit_image(_background=false){ helm_pat=helm_pattern; recolour_helm=true; } - }else if(unit_role==obj_ini.role[100][Role.VETERAN_SERGEANT]){ + }else if(unit_role==_role[eROLE.VeteranSergeant]){ with (obj_ini.complex_livery_data.vet_sgt){ prime=helm_primary; sec=helm_secondary; @@ -1069,7 +1366,7 @@ function scr_draw_unit_image(_background=false){ helm_pat=helm_pattern; recolour_helm=true; } - }else if(unit_role==obj_ini.role[100][Role.CAPTAIN]){ + }else if(unit_role==_role[eROLE.Captain]){ with (obj_ini.complex_livery_data.captain){ prime=helm_primary; sec=helm_secondary; @@ -1077,7 +1374,7 @@ function scr_draw_unit_image(_background=false){ helm_pat=helm_pattern; recolour_helm=true; } - }else if(unit_role==obj_ini.role[100][Role.VETERAN] || (unit_role==obj_ini.role[100][Role.TERMINATOR] && company = 1)){ + }else if(unit_role==_role[eROLE.Veteran] || (unit_role==_role[eROLE.Terminator] && company = 1)){ with (obj_ini.complex_livery_data.veteran){ prime=helm_primary; sec=helm_secondary; @@ -1145,12 +1442,12 @@ function scr_draw_unit_image(_background=false){ if (unit_armour == "Terminator Armour" || unit_armour == "Tartaros"){ lens_offset = -6; } - if (irandom(1) == 0) { - draw_sprite_ext(spr_gear_techa, 0, x_surface_offset + sprite_get_width(spr_gear_techa), y_surface_offset + lens_offset, -1, 1, 0, c_white, 1); + if (body.head.variation > 5) { + draw_sprite_flipped(spr_gear_techa, 0, x_surface_offset, y_surface_offset + lens_offset); } else { draw_sprite(spr_gear_techa,0,x_surface_offset,y_surface_offset + lens_offset); } - if (irandom(4) == 0 && !array_contains(traits, "tinkerer")) { + if (body.torso.variation > 5) { if (unit_armour == "Terminator Armour"){ draw_sprite(spr_gear_techb,1,x_surface_offset,y_surface_offset); } else { @@ -1158,6 +1455,15 @@ function scr_draw_unit_image(_background=false){ } } } + + // Librarian Details + if (unit_specialization == UnitSpecialization.Librarian) { + if (armour_type == ArmourType.Normal) { + draw_sprite(spr_gear_librarian, 0, x_surface_offset, y_surface_offset); + } else if (armour_type == ArmourType.Terminator) { + draw_sprite(spr_gear_librarian, 0, x_surface_offset-14, y_surface_offset-14); + } + } // Hood if (psy_hood>0){ @@ -1165,7 +1471,7 @@ function scr_draw_unit_image(_background=false){ var psy_hood_offset_x = 0; var psy_hood_offset_y = 0; robes_hood_bypass = true; - if (array_contains(obj_ini.adv,"Daemon Binders") && blandify==0 && psy_hood<7){ + if (scr_has_adv("Daemon Binders") && !modest_livery && psy_hood<7){ robes_bypass = true; if (pauldron_trim=1){ draw_sprite(spr_gear_hood2,0,x_surface_offset-2,y_surface_offset-11); @@ -1187,55 +1493,58 @@ function scr_draw_unit_image(_background=false){ //Chaplain head and Terminator version if (skull_mask>0){ - if (unit_armour!="Terminator"){ - //if (_armour_type==ArType.Tart || _armour_type==ArType.Term) then draw_sprite(spr_terminator_chap,1,0-2,0-11); - } - shader_reset(); - if (armour_type == ArmourType.Normal || unit_armour=="Terminator Armour") then draw_sprite(spr_chaplain_skull_helm,0,x_surface_offset,y_surface_offset); - if (unit_armour=="Tartaros") then draw_sprite(spr_chaplain_skull_helm,0,x_surface_offset,y_surface_offset); - shader_set(sReplaceColor); + if (armour_type == ArmourType.Normal) { + draw_sprite(spr_chaplain_skull_helm,0,x_surface_offset,y_surface_offset); + } else if (armour_type == ArmourType.Terminator) { + draw_sprite(spr_chaplain_skull_helm,1,x_surface_offset,y_surface_offset); + } } } //purity seals/decorations //TODO imprvoe this logic to be more extendable + if (armour_type==ArmourType.Normal){ - if (struct_exists(body[$ "torso"],"purity_seal")){ - if (body[$ "torso"][$"purity_seal"][2]==1){ + var _torso_data = body[$ "torso"]; + if (struct_exists(_torso_data,"purity_seal")){ + var _torso_purity_seals = _torso_data[$"purity_seal"]; + if (_torso_purity_seals[2]==1){ draw_sprite(spr_purity_seal,2,x_surface_offset-24,y_surface_offset+14); } - if (body[$ "torso"][$"purity_seal"][0]==1){ + if (_torso_purity_seals[0]==1){ draw_sprite(spr_purity_seal,0,x_surface_offset-44,y_surface_offset+18); } - if (body[$ "torso"][$"purity_seal"][1]==1){ + if (_torso_purity_seals[1]==1){ draw_sprite(spr_purity_seal,0,x_surface_offset-6,y_surface_offset+16); } } if (struct_exists(body[$ "left_arm"],"purity_seal")){ - if (body[$ "left_arm"][$"purity_seal"][0]==1){ + var _arm_seals = body[$ "left_arm"][$"purity_seal"]; + if (_arm_seals[0]==1){ draw_sprite(spr_purity_seal,1,x_surface_offset+70,y_surface_offset); } - if (body[$ "left_arm"][$"purity_seal"][1]==1){ + if (_arm_seals[1]==1){ draw_sprite(spr_purity_seal,0,x_surface_offset+26,y_surface_offset+7); } - if (body[$ "left_arm"][$"purity_seal"][2]==1){ + if (_arm_seals[2]==1){ draw_sprite(spr_purity_seal,0,x_surface_offset+15,y_surface_offset+10); } } if (struct_exists(body[$ "right_arm"],"purity_seal")){ - if (body[$ "right_arm"][$"purity_seal"][0]==1){ + var _arm_seals = body[$ "right_arm"][$"purity_seal"]; + if (_arm_seals[0]==1){ draw_sprite(spr_purity_seal,2,x_surface_offset-54,y_surface_offset-3); } - if (body[$ "right_arm"][$"purity_seal"][0]==1){ + if (_arm_seals[0]==1){ draw_sprite(spr_purity_seal,0,x_surface_offset-72,y_surface_offset+8); } - if (body[$ "right_arm"][$"purity_seal"][0]==1){ + if (_arm_seals[0]==1){ draw_sprite(spr_purity_seal,0,x_surface_offset-57,y_surface_offset+12); } } } // Bionics - if (!hide_bionics) { + if (!hide_bionics || armour_type != ArmourType.Terminator) { var eye_move_x = 0; var eye_move_y = 0; var eye_spacer = 0; @@ -1319,29 +1628,29 @@ function scr_draw_unit_image(_background=false){ } // Draw Custom Helmets if (armour_type==ArmourType.Normal && !armour_bypass){ - if (unit_role == obj_ini.role[100][Role.CHAMPION]) { + if (unit_role == _role[eROLE.Champion]) { if (unit_armour!="MK3 Iron Armour"){ draw_sprite(spr_special_helm,0,x_surface_offset,y_surface_offset); } draw_sprite(spr_laurel,0,x_surface_offset,y_surface_offset); draw_sprite(spr_helm_decorations,1,x_surface_offset,y_surface_offset); } - if (unit_role == obj_ini.role[100][Role.CAPTAIN]) { + if (unit_role == _role[eROLE.Captain]) { draw_sprite(spr_laurel,0,x_surface_offset,y_surface_offset); } - if (unit_role == obj_ini.role[100][Role.SERGEANT] || unit_role == obj_ini.role[100][Role.VETERAN_SERGEANT]) { + if (unit_role == _role[eROLE.Sergeant] || unit_role == _role[eROLE.VeteranSergeant]) { draw_sprite(spr_helm_decorations,1,x_surface_offset,y_surface_offset); } } else if (unit_armour=="Terminator Armour" && !armour_bypass){ - if (unit_role == obj_ini.role[100][Role.CHAMPION]) { + if (unit_role == _role[eROLE.Champion]) { draw_sprite(spr_laurel,0,x_surface_offset,y_surface_offset-8); draw_sprite(spr_helm_decorations,0,x_surface_offset,y_surface_offset-10); } - if (unit_role == obj_ini.role[100][Role.CAPTAIN]) { + if (unit_role == _role[eROLE.Captain]) { draw_sprite(spr_laurel,0,x_surface_offset,y_surface_offset-8); } - if (unit_role == obj_ini.role[100][Role.SERGEANT] || unit_role == obj_ini.role[100][Role.VETERAN_SERGEANT]) { + if (unit_role == _role[eROLE.Sergeant] || unit_role == _role[eROLE.VeteranSergeant]) { draw_sprite(spr_helm_decorations,0,x_surface_offset,y_surface_offset-10); } } else if (armour_type == ArmourType.Scout){ @@ -1354,22 +1663,26 @@ function scr_draw_unit_image(_background=false){ } - if (psy_hood==0) and (armour_type==ArmourType.Normal) and (unit_armour!="") and (unit_role==obj_ini.role[100][2]) && (unit_chapter!="Ultramarines") && (unit_chapter!="Blood Angels"){ + if (psy_hood==0) and (armour_type==ArmourType.Normal) and (unit_armour!="") and (unit_role==_role[2]) && (unit_chapter!="Ultramarines") && (unit_chapter!="Blood Angels"){ var helm_ii,o,yep; helm_ii=0; yep=0; - if (array_contains(obj_ini.adv,"Tech-Brothers")){ + if (scr_has_adv("Tech-Brothers")){ helm_ii=2; - }else if (array_contains(obj_ini.adv,"Never Forgive") || obj_ini.progenitor==1){ + }else if (scr_has_adv("Never Forgive") || obj_ini.progenitor == ePROGENITOR.DARK_ANGELS){ helm_ii=3; - } else if (array_contains(obj_ini.adv,"Reverent Guardians")) { + } else if (reverent_guardians) { helm_ii=4; } draw_sprite(spr_honor_helm,helm_ii,x_surface_offset-2,y_surface_offset-11); } // Drawing Robes - if (unit_chapter == "Dark Angels" or obj_ini.progenitor == 0) && (unit_role != obj_ini.role[100][Role.SERGEANT]) && (unit_role != obj_ini.role[100][Role.VETERAN_SERGEANT]){ + if ( + ((unit_chapter == "Dark Angels") || (obj_ini.progenitor == ePROGENITOR.DARK_ANGELS)) && + (unit_role != _role[eROLE.Sergeant]) && + (unit_role != _role[eROLE.VeteranSergeant]) + ) { robes_bypass = true; robes_hood_bypass = true; } @@ -1396,11 +1709,6 @@ function scr_draw_unit_image(_background=false){ } } - if (armour_type == ArmourType.Scout){ - ui_ymod[1]+=7; - ui_ymod[2]+=7; - } - var shield_offset_x = 0; var shield_offset_y = 0; if (unit_armour=="Terminator Armour"){ @@ -1410,7 +1718,7 @@ function scr_draw_unit_image(_background=false){ shield_offset_x = -8; } if (gear() == "Combat Shield"){ - if (unit_role == obj_ini.role[100][Role.CHAMPION]){ + if (unit_role == _role[eROLE.Champion]){ draw_sprite (spr_gear_combat_shield, 1, x_surface_offset + shield_offset_x, y_surface_offset + shield_offset_y); } else { draw_sprite (spr_gear_combat_shield, 0, x_surface_offset + shield_offset_x, y_surface_offset + shield_offset_y); @@ -1423,26 +1731,38 @@ function scr_draw_unit_image(_background=false){ } // // Draw weapons - if (ui_weapon[1]!=0) and (sprite_exists(ui_weapon[1])){ - if (ui_twoh[1]==false) and (ui_twoh[2]==false){ - draw_sprite(ui_weapon[1],0,x_surface_offset+ui_xmod[1],y_surface_offset+ui_ymod[1]); - } - if (ui_twoh[1]==true){ - if (specialist_colours<=1) then draw_sprite(ui_weapon[1],0,x_surface_offset+ui_xmod[1],y_surface_offset+ui_ymod[1]); - if (specialist_colours>=2) then draw_sprite(ui_weapon[1],3,x_surface_offset+ui_xmod[1],y_surface_offset+ui_ymod[1]); - if (ui_force_both==true){ + if (!new_weapon_draw[1]) { + if (ui_weapon[1]!=0) and (sprite_exists(ui_weapon[1])){ + if (ui_twoh[1]==false) and (ui_twoh[2]==false){ + draw_sprite(ui_weapon[1],0,x_surface_offset+ui_xmod[1],y_surface_offset+ui_ymod[1]); + } + if (ui_twoh[1]==true){ if (specialist_colours<=1) then draw_sprite(ui_weapon[1],0,x_surface_offset+ui_xmod[1],y_surface_offset+ui_ymod[1]); - if (specialist_colours>=2) then draw_sprite(ui_weapon[1],1,x_surface_offset+ui_xmod[1],y_surface_offset+ui_ymod[1]); + if (specialist_colours>=2) then draw_sprite(ui_weapon[1],3,x_surface_offset+ui_xmod[1],y_surface_offset+ui_ymod[1]); + if (ui_force_both==true){ + if (specialist_colours<=1) then draw_sprite(ui_weapon[1],0,x_surface_offset+ui_xmod[1],y_surface_offset+ui_ymod[1]); + if (specialist_colours>=2) then draw_sprite(ui_weapon[1],1,x_surface_offset+ui_xmod[1],y_surface_offset+ui_ymod[1]); + } } } + } else { + if (ui_weapon[1]!=0) and (sprite_exists(ui_weapon[1])){ + draw_sprite(ui_weapon[1],0,x_surface_offset+ui_xmod[1],y_surface_offset+ui_ymod[1]); + } } - if (ui_weapon[2]!=0) and (sprite_exists(ui_weapon[2])) and ((ui_twoh[1]==false || ui_force_both==true)){ - if (ui_spec[2]==false){ - draw_sprite(ui_weapon[2],1,x_surface_offset+ui_xmod[2],y_surface_offset+ui_ymod[2]); + if (!new_weapon_draw[2]) { + if (ui_weapon[2]!=0) and (sprite_exists(ui_weapon[2])) and ((ui_twoh[1]==false || ui_force_both==true)){ + if (ui_spec[2]==false){ + draw_sprite(ui_weapon[2],1,x_surface_offset+ui_xmod[2],y_surface_offset+ui_ymod[2]); + } + if (ui_spec[2]==true){ + if (specialist_colours<=1) then draw_sprite(ui_weapon[2],2,x_surface_offset+ui_xmod[2],y_surface_offset+ui_ymod[2]); + if (specialist_colours>=2) then draw_sprite(ui_weapon[2],3,x_surface_offset+ui_xmod[2],y_surface_offset+ui_ymod[2]); + } } - if (ui_spec[2]==true){ - if (specialist_colours<=1) then draw_sprite(ui_weapon[2],2,x_surface_offset+ui_xmod[2],y_surface_offset+ui_ymod[2]); - if (specialist_colours>=2) then draw_sprite(ui_weapon[2],3,x_surface_offset+ui_xmod[2],y_surface_offset+ui_ymod[2]); + } else { + if (ui_weapon[2]!=0) and (sprite_exists(ui_weapon[2])){ + draw_sprite_flipped(ui_weapon[2],0,x_surface_offset+ui_xmod[2],y_surface_offset+ui_ymod[2]); } } @@ -1467,6 +1787,9 @@ function scr_draw_unit_image(_background=false){ } // if (race()!="1"){draw_set_color(38144);draw_rectangle(0,x_surface_offset,y_surface_offset+166,0+231,0);} } + }catch(_exception) { + handle_exception(_exception); + } draw_set_alpha(1); @@ -1489,6 +1812,14 @@ function scr_draw_unit_image(_background=false){ //draw_surface(unit_surface, xx+_x1-x_surface_offset,yy+_y1-y_surface_offset); //surface_free(unit_surface); shader_reset(); + var _complex_sprite_names = struct_get_names(complex_set); + for (var i=0;i 0 && argument1 == true) { // Adding marines to the drop roster + if (argument0 > -1 && argument1 == true) { // Adding marines to the drop roster ship_all[argument2] = 1; var unit; for (var i = 0; i <= 3500; i++) { @@ -82,7 +82,7 @@ function scr_drop_fiddle(argument0, argument1, argument2, argument3) { } } - if (argument0 > 0 && argument1 == false) { // Removing marines from the drop roster + if (argument0 > -1 && argument1 == false) { // Removing marines from the drop roster ship_all[argument2] = 0; for (var i = 0; i <= 3500; i++) { diff --git a/scripts/scr_drop_select_function/scr_drop_select_function.gml b/scripts/scr_drop_select_function/scr_drop_select_function.gml new file mode 100644 index 000000000..a673fdfed --- /dev/null +++ b/scripts/scr_drop_select_function/scr_drop_select_function.gml @@ -0,0 +1,547 @@ +enum DropType { + RaidAttack=0, + PurgeSelect, + PurgeBombard, + PurgeFire, + PurgeSelective, + PurgeAssassinate +} + +function drop_select_draw(){ + with (obj_drop_select){ + if (purge != DropType.PurgeSelect) { + w = 660; + h = 520; + // Center of the screen + var _x_center = main_slate.XX; + var _y_center = main_slate.YY; + var x1 = _x_center + var y1 = _y_center; + var x2 = x1 + w; + var y2 = y1 + h; + var x3 = (x1 + x2) / 2; + var y3 = (y1 + y2) / 2; + + if (purge ==DropType.RaidAttack){ + draw_set_font(fnt_40k_30b); + + // var xx,yy; + // xx=view_xview[0]+545;yy=view_yview[0]+212; + draw_set_halign(fa_left); + draw_set_color(c_gray); + var attack_type = attack ? "Attacking" : "Raiding" + draw_text_transformed(x1 + 40, y1 + 38, $"{attack_type} ({planet_numeral_name(planet_number, p_target)} )", 0.6, 0.6, 0); + var _offset = x1 + 40; + draw_set_font(fnt_40k_14); + for (var i=0;i=array_length(formation_possible)){ + formation_current = 0; + } + } + + // Ships Are Up, Fuck Me + draw_set_color(c_gray); + draw_text(x1 + 40, 273, "Available Forces:"); + } + var e = 0; + var sigh = 0; + var sip = 1; + var column = 1; + var row = 1; + var x8 = 552; + var y8 = 299; + + var add_ground = 0; + + // Local force button; + + // Ship buttons; + if (purge != DropType.PurgeBombard){ + var _local_button = roster.local_button; + _local_button.x1 = x8 + _local_button.y1 = y8 + _local_button.update(); + _local_button.draw(); + if (_local_button.clicked()) { + roster.update_roster(); + } + } + y8 += 21; + + var _all_active = true; + + for (var e=0;e 590){ + _row++; + _x_offset = 0; + } + _button.x1 = (_squads_box.x1) + _x_offset; + _button.y1 = (_squads_box.y1 + string_height(_squads_box.header) + 10) + _row * 28; + _button.update(); + _button.draw(); + + if (_button.clicked()) { + roster.update_roster(); + } + + _x_offset += _button.width +10; + } + + // draw_text(x2 + 14, y2 + 352, string_hash_to_newline("Selection: " + string(smin) + "/" + string(smax))); + + // Target + if (purge == DropType.RaidAttack){ + var target_race = "", + target_threat = "", + race_quantity = 0; + var races = ["", "Ecclesiarchy", "Eldar", "Orks", "Tau", "Tyranids", "Heretics", "CSMs", "Daemons", "Necrons"]; + var threat_levels = ["", "Negligible", "Minor", "Moderate", "High", "Very High", "Overwhelming"]; + var race_quantities = [0, sisters, eldar, ork, tau, tyranids, traitors, csm, demons, necrons]; + + if (attacking >= 5 && attacking <= 13) { + race_quantity = race_quantities[attacking - 4]; + target_race = races[attacking - 4]; + } + + if (race_quantity >= 1 && race_quantity <= 6) { + target_threat = threat_levels[race_quantity]; + } else if (race_quantity >= 6) { + target_threat = threat_levels[6]; + } + target.x1 = formation.x1; + target.y1 = formation.y2 + 10; + target.str1 = "Target: "; + if (race_quantity != 0) { + target.str1 += $"{target_race} ({target_threat} Threat)"; + } else { + target.str1 += "None"; + } + target.update(); + target.draw(); + draw_sprite(spr_faction_icons, attacking, x2 - 100, y1 + 40); + var q = 0; + repeat(20) { + q += 1; + if (target.clicked() && force_present[q] != 0) { + if (attacking != force_present[q] && force_present[q] > 0) { + attacking = force_present[q]; + } + } + } + target.locked = (force_present[q] == 0); + } + + // Back / Purge buttons + btn_back.x1 = x3 - 100; + btn_back.y1 = y2 - 60; + btn_back.update(); + btn_back.draw(); + if (btn_back.clicked()) { + menu = 0; + purge = 0; + instance_destroy(); + } + + // Attack / Raid buttons + btn_attack.x1 = btn_back.x1 + btn_attack.width + 10; + btn_attack.y1 = btn_back.y1; + if (purge == DropType.RaidAttack){ + if (attack = 0) then btn_attack.str1 = "RAID!"; + if (attack = 1) then btn_attack.str1 = "ATTACK!"; + btn_attack.active = (array_length(roster.selected_units) > 0 && race_quantity > 0); + } + else if (purge>1){ + btn_attack.str1 = "PURGE" + btn_attack.active = (array_length(roster.selected_units) > 0) + } + btn_attack.update(); + btn_attack.draw(); + if (btn_attack.clicked()) { + if (purge == 0){ + combating = 1; // Start battle here + + if (attack = 1) then obj_controller.last_attack_form = formation_possible[formation_current]; + if (attack = 0) then obj_controller.last_raid_form = formation_possible[formation_current]; + + instance_deactivate_all(true); + instance_activate_object(obj_controller); + instance_activate_object(obj_ini); + instance_activate_object(obj_drop_select); + + // 135 ; temporary balancing + if (sh_target != -50) { + sh_target.acted += 1; + } + + if (attacking == 10) or (attacking == 11) { + remove_planet_problem(planet_number, "meeting", p_target); + remove_planet_problem(planet_number, "meeting_trap", p_target); + } + + instance_create(0, 0, obj_ncombat); + obj_ncombat.battle_object = p_target; + obj_ncombat.battle_loc = p_target.name; + obj_ncombat.battle_id = planet_number; + obj_ncombat.dropping = 1 - attack; + obj_ncombat.attacking = attack; + obj_ncombat.enemy = attacking; + obj_ncombat.formation_set = formation_possible[formation_current]; + obj_ncombat.defending = false; + obj_ncombat.local_forces = roster.local_button.active + + var _planet = obj_ncombat.battle_object.p_feature[obj_ncombat.battle_id] + if (obj_ncombat.battle_object.space_hulk = 1) then obj_ncombat.battle_special = "space_hulk"; + if (planet_feature_bool(_planet, P_features.Warlord6) == 1) and(obj_ncombat.enemy = 6) and(obj_controller.faction_defeated[6] = 0) then obj_ncombat.leader = 1; + if (obj_ncombat.enemy = 7) and(obj_controller.faction_defeated[7] <= 0) { + if (planet_feature_bool(_planet, P_features.OrkWarboss)) { + obj_ncombat.leader = 1; + obj_ncombat.Warlord = _planet[search_planet_features(_planet, P_features.OrkWarboss)[0]]; + } + } + + if (obj_ncombat.enemy = 9) and(obj_ncombat.battle_object.space_hulk = 0) { + if (has_problem_planet(planet_number, "tyranid_org", p_target)) then obj_ncombat.battle_special = "tyranid_org"; + } + + if (obj_ncombat.enemy = 11) { + if (planet_feature_bool(obj_ncombat.battle_object.p_feature[obj_ncombat.battle_id], P_features.World_Eaters) == 1) { + obj_ncombat.battle_special = "world_eaters"; + obj_ncombat.leader = 1; + } + } + + var _threats = [0,0,0,0,0,sisters,eldar,ork,tau, tyranids, traitors,csm, demons, necrons]; + if (obj_ncombat.enemy >=5 && obj_ncombat.enemy<=13){ + obj_ncombat.threat = _threats[obj_ncombat.enemy]; + } + + if (obj_ncombat.enemy = 8) { + var eth; + eth = 0; + eth = scr_quest(4, "ethereal_capture", 8, 0); + if (eth > 0) and(obj_ncombat.battle_object.p_owner[obj_ncombat.battle_id] = 8) { + var rolli; + rolli = irandom_range(1, 100) + if (obj_ncombat.threat = 6) and(rolli <= 80) then obj_ncombat.ethereal = 1; + if (obj_ncombat.threat = 5) and(rolli <= 65) then obj_ncombat.ethereal = 1; + if (obj_ncombat.threat = 4) and(rolli <= 50) then obj_ncombat.ethereal = 1; + if (obj_ncombat.threat = 3) and(rolli <= 35) then obj_ncombat.ethereal = 1; + } + // show_message("Ethereal Quest?: "+string(eth)+"#Ethereal?: "+string(obj_ncombat.ethereal)); + } + + // if (obj_ncombat.threat>1) and (obj_ncombat.enemy!=13) then obj_ncombat.threat-=1; + if (obj_ncombat.threat > 1) and(obj_ncombat.battle_special != "world_eaters") and(attack = 0) then obj_ncombat.threat -= 1; + if (obj_ncombat.threat < 1) then obj_ncombat.threat = 1; + if (obj_ncombat.enemy = 10) and(obj_ncombat.battle_object.p_type[obj_ncombat.battle_id] = "Daemon") then obj_ncombat.threat = 7; + + var _battle_place = obj_ncombat.battle_object; + var _battle_sub_loc = obj_ncombat.battle_id; + var _chaos_lord_jump_possible = (attacking = 0|| attacking = 10|| attacking = 11); + var _no_know_chaos = (_battle_place.p_traitors[_battle_sub_loc] == 0 && _battle_place.p_chaos[_battle_sub_loc] == 0); + + var _chaos_warlord_present = planet_feature_bool(_battle_place.p_feature[obj_ncombat.battle_id], P_features.Warlord10); + + var _chaos_popup_turn_reached = obj_controller.turn >= obj_controller.chaos_turn; + + var _chaos_unknown = (obj_controller.known[eFACTION.Chaos] == 0) and (obj_controller.faction_gender[10] = 1); + + if (_chaos_lord_jump_possible && _no_know_chaos) { + if (_chaos_popup_turn_reached && _chaos_warlord_present){ + if (_chaos_unknown) { + var pop; + pop = instance_create(0, 0, obj_popup); + pop.image = "chaos_symbol"; + pop.title = "Concealed Heresy"; + pop.text = $"Your astartes set out and begin to cleanse {planet_numeral_name(_battle_sub_loc,_battle_place)} of possible heresy. The general populace appears to be devout in their faith, but a disturbing trend appears- the odd citizen cursing your forces, frothing at the mouth, and screaming out heresy most foul. One week into the cleansing a large hostile force is detected approaching and encircling your forces."; + cancel_combat(); + combating = 0; + instance_activate_all(); + exit; + } + if (obj_controller.known[eFACTION.Chaos] >= 2 && obj_controller.faction_gender[10] = 1){ + with(obj_drop_select) { + obj_ncombat.enemy = 11; + obj_ncombat.threat = 0; + cancel_combat(); + combating = 0; + instance_destroy(); + instance_activate_all(); + exit; + } + } + } + } + + scr_battle_allies(); + setup_battle_formations(); + roster.add_to_battle(); + } else if (purge >1){ + draw_set_alpha(0.2); + draw_rectangle(954, 556, 1043, 579, 0); + draw_set_alpha(1); + var _purge_score=0; + if (purge == 2) { + _purge_score = roster.purge_bombard_score(); + } + + if (purge >= 3) { + _purge_score = array_length(roster.selected_units); + } + + scr_purge_world(p_target, planet_number, purge , _purge_score); + } + } + } + + + // Purge shit happens bellow; + // God, save us; + if (menu == 0) { + if (purge == 1) { + + + } else if (purge >= 2) { + draw_set_halign(fa_center); + draw_set_font(fnt_40k_30b); + + // 2 is bombardment + + var x2 = 535; + var y2 = 200; + + draw_set_halign(fa_left); + draw_set_color(c_gray); + var _purge_strings = ["Bombard Purging {0}", "Fire Cleansing {0}","Selective Purging {0}", "Assassinate Governor ({0})"]; + var _planet_string = planet_numeral_name(planet_number, p_target); + draw_text_transformed(x2 + 14, y2 + 12, string(_purge_strings[purge-2],_planet_string), 0.6, 0.6, 0); + + // Disposition here + var succession = 0, + pp = planet_number + + var succession = has_problem_planet(pp, "succession", p_target); + + if ((p_target.dispo[pp] >= 0) and(p_target.p_owner[pp] <= 5) and(p_target.p_population[pp] > 0)) and (!succession) { + var wack = 0; + draw_set_color(c_blue); + draw_rectangle(x2 + 12, y2 + 53, x2 + 12 + max(0, (min(100, p_target.dispo[pp]) * 4.37)), y2 + 71, 0); + } + draw_set_color(c_gray); + draw_rectangle(x2 + 12, y2 + 53, x2 + 449, y2 + 71, 1); + draw_set_color(c_white); + + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_center); + if (!succession) { + if (p_target.dispo[pp] >= 0) and(p_target.p_first[pp] <= 5) and(p_target.p_owner[pp] <= 5) and(p_target.p_population[pp] > 0) then draw_text(x2 + 231, y2 + 54, string_hash_to_newline("Disposition: " + string(min(100, p_target.dispo[pp])) + "/100")); + if (p_target.dispo[pp] > -30) and(p_target.dispo[pp] < 0) and(p_target.p_owner[pp] <= 5) and(p_target.p_population[pp] > 0) then draw_text(x2 + 231, y2 + 54, string_hash_to_newline("Disposition: ???/100")); + if ((p_target.dispo[pp] >= 0) and(p_target.p_first[pp] <= 5) and(p_target.p_owner[pp] > 5)) or(p_target.p_population[pp] <= 0) then draw_text(x2 + 231, y2 + 54, string_hash_to_newline("-------------")); + if (p_target.dispo[pp] <= -3000) then draw_text(x2 + 231, y2 + 54, "Chapter Rule"); + } + if (succession = 1) then draw_text(x2 + 231, y2 + 54, "War of Succession"); + + draw_set_color(c_gray); + draw_set_font(fnt_40k_14); + draw_set_halign(fa_left); + + // Planet icon here + draw_rectangle(x2 + 459, y2 + 14, x2 + 516, y2 + 71, 0); + + draw_set_font(fnt_40k_14); + draw_set_color(c_gray); + draw_set_alpha(1); + + + var smin, smax; + var w; + w = -1; + smin = 0; + smax = 0; + + + //draw_text(x2 + 14, y2 + 352, string_hash_to_newline("Selection: " + string(smin) + "/" + string(smax))); + } + } +} +} + +function collect_local_units(){ + // + // I think this script is used to count local forces. l_ meaning local. + // + ship_use[500]=0; + ship_max[500]=l_size; + purge_d=ship_max[500]; + + if (purge==1) + { + + + + + if (sh_target!=-50){ + + max_ships=sh_target.capital_number+sh_target.frigate_number+sh_target.escort_number; + + + if (sh_target.acted>=1) then instance_destroy(); + + var tump;tump=0; + + var i, q, b;i=-1;q=-1;b=-1; + repeat(sh_target.capital_number){ + b+=1; + if (sh_target.capital[b]!=""){ + i+=1; + ship[i]=sh_target.capital[i]; + + ship_use[i]=0; + tump=sh_target.capital_num[i]; + ship_max[i]=obj_ini.ship_carrying[tump]; + ship_ide[i]=tump; + + ship_size[i]=3; + + purge_a+=3; + purge_b+=ship_max[i];purge_c+=ship_max[i];purge_d+=ship_max[i]; + } + } + q=-1; + repeat(sh_target.frigate_number){ + q+=1; + if (sh_target.frigate[q]!=""){ + i+=1; + ship[i]=sh_target.frigate[q]; + + ship_use[i]=0; + tump=sh_target.frigate_num[q]; + ship_max[i]=obj_ini.ship_carrying[tump]; + ship_ide[i]=tump; + + ship_size[i]=2; + + purge_a+=1; + purge_b+=ship_max[i]; + purge_c+=ship_max[i]; + purge_d+=ship_max[i]; + } + } + q=-1; + repeat(sh_target.escort_number){ + q+=1; + if (sh_target.escort[q]!="") and (obj_ini.ship_carrying[sh_target.escort_num[q]]>0){ + i+=1; + ship[i]=sh_target.escort[q]; + + ship_use[i]=0; + tump=sh_target.escort_num[q]; + ship_max[i]=obj_ini.ship_carrying[tump]; + ship_ide[i]=tump; + + ship_size[i]=1; + + purge_b+=ship_max[i]; + purge_c+=ship_max[i]; + purge_d+=ship_max[i]; + } + } + + } + + if (p_target.p_player[planet_number]>0) then max_ships+=1; + var pp=planet_number; + purge_d = p_target.p_type[pp]!="Dead"; + + if (has_problem_planet(pp,"succession",p_target)) then purge_d=0 + + if (p_target.dispo[pp]<-2000) then purge_d=0; + + if (planet_feature_bool(p_target.p_feature[pp],P_features.Monastery)==1) and (obj_controller.homeworld_rule!=1) then purge_d=0; + + if (p_target.p_type[pp]="Dead") then purge_d=0; + + + } +} + + diff --git a/scripts/scr_drop_select_function/scr_drop_select_function.yy b/scripts/scr_drop_select_function/scr_drop_select_function.yy new file mode 100644 index 000000000..d0402e12a --- /dev/null +++ b/scripts/scr_drop_select_function/scr_drop_select_function.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "scr_drop_select_function", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "Scripts", + "path": "folders/Scripts.yy", + }, +} \ No newline at end of file diff --git a/scripts/scr_en_weapon/scr_en_weapon.gml b/scripts/scr_en_weapon/scr_en_weapon.gml index 91110552a..49c1f41a9 100644 --- a/scripts/scr_en_weapon/scr_en_weapon.gml +++ b/scripts/scr_en_weapon/scr_en_weapon.gml @@ -21,996 +21,998 @@ function scr_en_weapon(name, is_man, man_number, man_type, group) { acr = 0; amm = -1; faith_bonus = 0; - - if (string_count("elee", name) > 0) { - var to; - to = string_delete(name, 0, 5); - atta = 10; - arp = 0; - rang = 1; - spli = 3; - } - - //if (obj_ncombat.enemy=5) then faith_bonus=faith[man_type]; - - if (name = "Venom Claws") { - atta = 200; - arp = 0; - rang = 1; - spli = 0; - if (obj_ini.preomnor = 1) { - atta = 240; - } - } - if (name = "Web Spinner") { - atta = 40; - arp = 0; - rang = 2.1; - spli = 3; - amm = 1; - } - if (name = "Warpsword") { - atta = 300; - arp = 1; - rang = 1; - spli = 3; - } - if (name = "Iron Claw") { - atta = 400; - arp = 1; - rang = 1; - spli = 0; - } - if (name = "Maulerfiend Claws") { - atta = 300; - arp = 300; - rang = 1; - spli = 3; - } - - if (name = "Eldritch Fire") { - atta = 80; - arp = 1; - rang = 5.1; - } - if (name = "Bloodletter Melee") { - atta = 70; - arp = 0; - rang = 1; - spli = 3; - } - if (name = "Daemonette Melee") { - atta = 65; - arp = 0; - rang = 1; - spli = 3; - } - if (name = "Plaguebearer Melee") { - atta = 60; - arp = 0; - rang = 1; - spli = 3; - if (obj_ini.preomnor = 1) { - atta = 70; - } - } - if (name = "Khorne Demon Melee") { - atta = 350; - arp = 1; - rang = 1; - spli = 3; - } - if (name = "Demon Melee") { - atta = 250; - arp = 1; - rang = 1; - spli = 3; - } - if (name = "Lash Whip") { - atta = 80; - arp = 0; - rang = 2; - } - if (name = "Nurgle Vomit") { - atta = 100; - arp = 0; - rang = 2; - spli = 3; - if (obj_ini.preomnor = 1) { - atta = 260; - } - } - if (name = "Multi-Melta") { - atta = 200; - arp = 1; - rang = 4.1; - spli = 0; - amm = 6; - } - - if (obj_ncombat.enemy = 3) { - if (name = "Phased Plasma-fusil") { - atta = 100; - arp = 1; - rang = 7.1; - spli = 3; - } - if (name = "Lightning Gun") { - atta = choose(80, 80, 80, 150); - arp = 0; - rang = 5; - spli = 0; - } - if (name = "Thallax Melee") { - atta = 80; + var struct = gear_weapon_data("weapon",name); + if (!struct){ + if (string_count("elee", name) > 0) { + var to; + to = string_delete(name, 0, 5); + atta = 10; arp = 0; rang = 1; spli = 3; } - } - if (obj_ncombat.enemy = 6) { + //if (obj_ncombat.enemy=5) then faith_bonus=faith[man_type]; - if (argument0 = "Fusion Gun") or(argument0 = "Firepike") { + if (name = "Venom Claws") { atta = 200; - arp = 1; - rang = 2; - amm = 4; - } - if (argument0 = "Singing Spear") { - atta = 120; - arp = 0; - rang = 1; - spli = 3; - } - if (argument0 = "Singing Spear Throw") { - atta = 120; - arp = 1; - rang = 2; - spli = 3; - } - if (argument0 = "Witchblade") { - atta = 100; - arp = 1; - rang = 1; - } - if (argument0 = "Psyshock") { - atta = 50; arp = 0; - rang = 2; - } - if (argument0 = "Wailing Doom") { - atta = 200; - arp = 1; rang = 1; - spli = 3; - } - if (argument0 = "Avatar Smite") { - atta = 300; - arp = 1; - rang = 2; - amm = 2; - } - if (argument0 = "Ranger Long Rifle") { - atta = 60; - arp = 0; - rang = 25; - } - if (argument0 = "Pathfinder Long Rifle") { - atta = 70; - arp = 0; - rang = 25; - } - if (argument0 = "Shuriken Catapult") { - atta = 35; - arp = 0; - rang = 2; - } - if (argument0 = "Twin Linked Shuriken Catapult") { - atta = 50; - arp = 0; - rang = 2; + spli = 0; + if (obj_ini.preomnor = 1) { + atta = 240; + } } - if (argument0 = "Avenger Shuriken Catapult") { + if (name = "Web Spinner") { atta = 40; arp = 0; - rang = 3; - } - if (argument0 = "Power Weapon") or(argument0 = "Power Blades") { - atta = 80; - arp = 0; - rang = 1; - spli = 3; - } - if (argument0 = "Shuriken Pistol") { - atta = 25; - arp = 0; rang = 2.1; - } - if (argument0 = "Executioner") { - atta = 200; - arp = 1; - rang = 1; - } - if (argument0 = "Scorpion Chainsword") { - atta = 40; - arp = 0; - rang = 1; spli = 3; + amm = 1; } - if (argument0 = "Mandiblaster") { - atta = 20; - arp = 0; - rang = 1; - } - if (argument0 = "Biting Blade") { - atta = 70; - arp = 0; + if (name = "Warpsword") { + atta = 300; + arp = 1; rang = 1; spli = 3; } - if (argument0 = "Scorpian's Claw") { - atta = 150; + if (name = "Iron Claw") { + atta = 400; arp = 1; rang = 1; - spli = 3; + spli = 0; } - if (argument0 = "Meltabomb") { - atta = 0; - arp = 200; + if (name = "Maulerfiend Claws") { + atta = 300; + arp = 300; rang = 1; - amm = 1; - } - if (argument0 = "Deathspinner") { - atta = 50; - arp = 0; - rang = 2; - } - if (argument0 = "Dual Deathspinner") { - atta = 80; - arp = 0; - rang = 2; - } - if (argument0 = "Reaper Launcher") { - atta = 150; - arp = 80; - rang = 20; - amm = 8; - spli = 3; - } - if (argument0 = "Eldar Missile Launcher") { - atta = 200; - arp = 1; - rang = 20; - amm = 4; spli = 3; } - if (argument0 = "Laser Lance") { + + if (name = "Eldritch Fire") { atta = 80; - arp = 0; - rang = 2; - spli = 3; - } - if (argument0 = "Fusion Pistol") { - atta = 100; - arp = 1; - rang = 1.1; - amm = 4; - } - if (argument0 = "Plasma Pistol") { - atta = 60; arp = 1; - rang = 3.1; + rang = 5.1; } - if (argument0 = "Harlequin's Kiss") { - atta = 350; + if (name = "Bloodletter Melee") { + atta = 70; arp = 0; rang = 1; - amm = 1; - } - if (argument0 = "Wraithcannon") { - atta = 80; - arp = 1; - rang = 2.1; - } - if (argument0 = "Pulse Laser") { - atta = 80; - arp = 1; - rang = 15; - } - if (argument0 = "Bright Lance") { - atta = 100; - arp = 1; - rang = 8; + spli = 3; } - if (argument0 = "Shuriken Cannon") { + if (name = "Daemonette Melee") { atta = 65; arp = 0; - rang = 3; - } - if (argument0 = "Prism Cannon") { - atta = 250; - arp = 1; - rang = 20; - } - if (argument0 = "Twin Linked Doomweaver") { - atta = 100; - arp = 0; - rang = 2; - } // Also create difficult terrain? - if (argument0 = "Starcannon") { - atta = 140; - arp = 1; - rang = 3; - spli = 3; - } - if (argument0 = "Two Power Fists") { - atta = 300; - arp = 1; rang = 1; - } - if (argument0 = "Flamer") { - atta = 100; - arp = 0; - rang = 2; - amm = 4; spli = 3; } - if (argument0 = "Titan Starcannon") { - atta = 220; - arp = 1; - rang = 4; - spli = 3; - } - if (argument0 = "Phantom Pulsar") { - atta = 500; - arp = 1; - rang = 20; - spli = 3; - } - } - - if (obj_ncombat.enemy = 7) { - - if (argument0 = "Choppa") { - atta = 28; + if (name = "Plaguebearer Melee") { + atta = 60; arp = 0; rang = 1; spli = 3; + if (obj_ini.preomnor = 1) { + atta = 70; + } } - if (argument0 = "Power Klaw") { - atta = 150; + if (name = "Khorne Demon Melee") { + atta = 350; arp = 1; rang = 1; spli = 3; } - if (argument0 = "Slugga") { - atta = 27; - arp = 0; - rang = 3.1; - amm = 4; - spli = 3; - } - if (argument0 = "Tankbusta Bomb") { - atta = 264; + if (name = "Demon Melee") { + atta = 250; arp = 1; rang = 1; - amm = 1; - spli = 0; - } - if (argument0 = "Big Shoota") { - atta = 100; - arp = 0; - rang = 12; - amm = 30; - spli = 0; - } - if (argument0 = "Dakkagun") { - atta = 150; - arp = 0; - rang = 10; - amm = 20; - spli = 0; - } - if (argument0 = "Deffgun") { - atta = 120; - arp = 0; - rang = 8; - amm = 20; - spli = 0; + spli = 3; } - if (argument0 = "Snazzgun") { + if (name = "Lash Whip") { atta = 80; arp = 0; - rang = 10; - spli = 0; - } - if (argument0 = "Grot Blasta") { - atta = 12; - arp = 0; rang = 2; - amm = 6; - } - if (argument0 = "Kannon") { - atta = 200; - arp = 1; - rang = 10.1; - amm = 5; - spli = 3; } - if (argument0 = "Shoota") { - atta = 30; + if (name = "Nurgle Vomit") { + atta = 100; arp = 0; - rang = 6; - } - if (argument0 = "Burna") { - atta = 140; - arp = 1; - rang = 2; - amm = 4; - spli = 3; - } - if (argument0 = "Skorcha") { - atta = 160; - arp = 1; rang = 2; - amm = 6; - spli = 3; - } - if (argument0 = "Rokkit Launcha") { - atta = 150; - arp = 1; - rang = 15; - spli = 3; - } - if (argument0 = "Krooz Missile") { - atta = 250; - arp = 1; - rang = 15; spli = 3; + if (obj_ini.preomnor = 1) { + atta = 260; + } } - - } - - if (obj_ncombat.enemy = 8) { - if (name = "Fusion Blaster") { + if (name = "Multi-Melta") { atta = 200; arp = 1; - rang = 2; - amm = 4; - } - if (name = "Plasma Rifle") { - atta = 120; - arp = 1; - rang = 10; - } - if (name = "Cyclic Ion Blaster") { - atta = 180; - arp = 0; - rang = 6; - spli = 3; - } // x6 - if (name = "Burst Rifle") { - atta = 130; - arp = 0; - rang = 16; - spli = 3; - } - if (name = "Missile Pod") { - atta = 160; - arp = 1; - rang = 15; + rang = 4.1; + spli = 0; amm = 6; - spli = 3; - } - if (name = "Smart Missile System") { - atta = 150; - arp = 1; - rang = 15; - } - if (name = "Small Railgun") { - atta = 150; - arp = 1; - rang = 18; - } - if (name = "Pulse Rifle") { - atta = 37; - arp = 0; - rang = 12; - } - if (name = "Rail Rifle") { - atta = 65; - arp = 0; - rang = 14; } - if (name = "Kroot Rifle") { - atta = 25; - arp = 0; - rang = 6; - } - if (name = "Vespid Crystal") { - atta = 60; - arp = 0; - rang = 2.1; - } - if (name = "Railgun") { - atta = 400; - arp = 1; - rang = 20; + + if (obj_ncombat.enemy = 3) { + if (name = "Phased Plasma-fusil") { + atta = 100; + arp = 1; + rang = 7.1; + spli = 3; + } + if (name = "Lightning Gun") { + atta = choose(80, 80, 80, 150); + arp = 0; + rang = 5; + spli = 0; + } + if (name = "Thallax Melee") { + atta = 80; + arp = 0; + rang = 1; + spli = 3; + } } - } - if (obj_ncombat.enemy = 9) { + if (obj_ncombat.enemy = 6) { - if (argument0 = "Bonesword") { - atta = 120; - arp = 0; - rang = 1; - spli = 3; - } - if (argument0 = "Lash Whip") { - atta = 80; - arp = 0; - rang = 2; - } - if (argument0 = "Heavy Venom Cannon") { - atta = 150; - arp = 1; - rang = 8; - } - if (argument0 = "Crushing Claws") { - atta = 90; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Rending Claws") { - atta = 80; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Devourer") { - atta = choose(40, 60, 80, 100); - arp = 0; - rang = 5; - if (obj_ini.preomnor = 1) { - atta = choose(48, 72, 96, 120); + if (argument0 = "Fusion Gun") or(argument0 = "Firepike") { + atta = 200; + arp = 1; + rang = 2; + amm = 4; } - } - if (argument0 = "Zoanthrope Blast") { - atta = 200; - arp = 1; - rang = 2; - } - if (argument0 = "Carnifex Claws") { - atta = 300; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Venom Cannon") { - atta = 150; - arp = 0; - rang = 5; - } - if (argument0 = "Deathspitter") { - atta = 100; - arp = 0; - rang = 2.1; - if (obj_ini.preomnor = 1) { + if (argument0 = "Singing Spear") { atta = 120; + arp = 0; + rang = 1; + spli = 3; } - } - if (argument0 = "Fleshborer") { - atta = 15; - arp = 0; - rang = 2.1; - if (obj_ini.preomnor = 1) { - atta = 19; + if (argument0 = "Singing Spear Throw") { + atta = 120; + arp = 1; + rang = 2; + spli = 3; + } + if (argument0 = "Witchblade") { + atta = 100; + arp = 1; + rang = 1; + } + if (argument0 = "Psyshock") { + atta = 50; + arp = 0; + rang = 2; + } + if (argument0 = "Wailing Doom") { + atta = 200; + arp = 1; + rang = 1; + spli = 3; + } + if (argument0 = "Avatar Smite") { + atta = 300; + arp = 1; + rang = 2; + amm = 2; + } + if (argument0 = "Ranger Long Rifle") { + atta = 60; + arp = 0; + rang = 25; + } + if (argument0 = "Pathfinder Long Rifle") { + atta = 70; + arp = 0; + rang = 25; + } + if (argument0 = "Shuriken Catapult") { + atta = 35; + arp = 0; + rang = 2; + } + if (argument0 = "Twin Linked Shuriken Catapult") { + atta = 50; + arp = 0; + rang = 2; + } + if (argument0 = "Avenger Shuriken Catapult") { + atta = 40; + arp = 0; + rang = 3; + } + if (argument0 = "Power Weapon") or(argument0 = "Power Blades") { + atta = 80; + arp = 0; + rang = 1; + spli = 3; + } + if (argument0 = "Shuriken Pistol") { + atta = 25; + arp = 0; + rang = 2.1; + } + if (argument0 = "Executioner") { + atta = 200; + arp = 1; + rang = 1; + } + if (argument0 = "Scorpion Chainsword") { + atta = 40; + arp = 0; + rang = 1; + spli = 3; + } + if (argument0 = "Mandiblaster") { + atta = 20; + arp = 0; + rang = 1; + } + if (argument0 = "Biting Blade") { + atta = 70; + arp = 0; + rang = 1; + spli = 3; + } + if (argument0 = "Scorpian's Claw") { + atta = 150; + arp = 1; + rang = 1; + spli = 3; + } + if (argument0 = "Meltabomb") { + atta = 0; + arp = 200; + rang = 1; + amm = 1; + } + if (argument0 = "Deathspinner") { + atta = 50; + arp = 0; + rang = 2; + } + if (argument0 = "Dual Deathspinner") { + atta = 80; + arp = 0; + rang = 2; + } + if (argument0 = "Reaper Launcher") { + atta = 150; + arp = 80; + rang = 20; + amm = 8; + spli = 3; + } + if (argument0 = "Eldar Missile Launcher") { + atta = 200; + arp = 1; + rang = 20; + amm = 4; + spli = 3; + } + if (argument0 = "Laser Lance") { + atta = 80; + arp = 0; + rang = 2; + spli = 3; + } + if (argument0 = "Fusion Pistol") { + atta = 100; + arp = 1; + rang = 1.1; + amm = 4; + } + if (argument0 = "Plasma Pistol") { + atta = 60; + arp = 1; + rang = 3.1; + } + if (argument0 = "Harlequin's Kiss") { + atta = 350; + arp = 0; + rang = 1; + amm = 1; + } + if (argument0 = "Wraithcannon") { + atta = 80; + arp = 1; + rang = 2.1; + } + if (argument0 = "Pulse Laser") { + atta = 80; + arp = 1; + rang = 15; + } + if (argument0 = "Bright Lance") { + atta = 100; + arp = 1; + rang = 8; + } + if (argument0 = "Shuriken Cannon") { + atta = 65; + arp = 0; + rang = 3; + } + if (argument0 = "Prism Cannon") { + atta = 250; + arp = 1; + rang = 20; + } + if (argument0 = "Twin Linked Doomweaver") { + atta = 100; + arp = 0; + rang = 2; + } // Also create difficult terrain? + if (argument0 = "Starcannon") { + atta = 140; + arp = 1; + rang = 3; + spli = 3; + } + if (argument0 = "Two Power Fists") { + atta = 300; + arp = 1; + rang = 1; + } + if (argument0 = "Flamer") { + atta = 100; + arp = 0; + rang = 2; + amm = 4; + spli = 3; + } + if (argument0 = "Titan Starcannon") { + atta = 220; + arp = 1; + rang = 4; + spli = 3; + } + if (argument0 = "Phantom Pulsar") { + atta = 500; + arp = 1; + rang = 20; + spli = 3; } - } - if (argument0 = "Scything Talons") { - atta = 30; - arp = 0; - rang = 1; - } - if (argument0 = "Genestealer Claws") { - atta = choose(105, 105, 130); - arp = 1; - rang = 1; - } - if (argument0 = "Witchfire") { - atta = 100; - arp = 1; - rang = 2; - } - if (argument0 = "Autogun") { - atta = 20; - arp = 0; - rang = 6; - amm = 12; - spli = 3; - } - if (argument0 = "Lictor Claws") { - atta = 300; - arp = 0; - rang = 1; - } - if (argument0 = "Flesh Hooks") { - atta = 50; - arp = 0; - rang = 2; - amm = 1; } - } + if (obj_ncombat.enemy = 7) { - if (obj_ncombat.enemy >= 10) or(obj_ncombat.enemy = 2) or(obj_ncombat.enemy = 5) or(obj_ncombat.enemy = 1) { + if (argument0 = "Choppa") { + atta = 28; + arp = 0; + rang = 1; + spli = 3; + } + if (argument0 = "Power Klaw") { + atta = 150; + arp = 1; + rang = 1; + spli = 3; + } + if (argument0 = "Slugga") { + atta = 27; + arp = 0; + rang = 3.1; + amm = 4; + spli = 3; + } + if (argument0 = "Tankbusta Bomb") { + atta = 264; + arp = 1; + rang = 1; + amm = 1; + spli = 0; + } + if (argument0 = "Big Shoota") { + atta = 100; + arp = 0; + rang = 12; + amm = 30; + spli = 0; + } + if (argument0 = "Dakkagun") { + atta = 150; + arp = 0; + rang = 10; + amm = 20; + spli = 0; + } + if (argument0 = "Deffgun") { + atta = 120; + arp = 0; + rang = 8; + amm = 20; + spli = 0; + } + if (argument0 = "Snazzgun") { + atta = 80; + arp = 0; + rang = 10; + spli = 0; + } + if (argument0 = "Grot Blasta") { + atta = 12; + arp = 0; + rang = 2; + amm = 6; + } + if (argument0 = "Kannon") { + atta = 200; + arp = 1; + rang = 10.1; + amm = 5; + spli = 3; + } + if (argument0 = "Shoota") { + atta = 30; + arp = 0; + rang = 6; + } + if (argument0 = "Burna") { + atta = 140; + arp = 1; + rang = 2; + amm = 4; + spli = 3; + } + if (argument0 = "Skorcha") { + atta = 160; + arp = 1; + rang = 2; + amm = 6; + spli = 3; + } + if (argument0 = "Rokkit Launcha") { + atta = 150; + arp = 1; + rang = 15; + spli = 3; + } + if (argument0 = "Krooz Missile") { + atta = 250; + arp = 1; + rang = 15; + spli = 3; + } - if (argument0 = "Plasma Pistol") { - atta = 70; - arp = 1; - rang = 3.1; - } - if (argument0 = "Power Weapon") { - atta = 120; - arp = 0; - rang = 1; - } - if (argument0 = "Power Sword") { - atta = 120; - arp = 0; - rang = 1; - } - if (argument0 = "Force Weapon") { - atta = 400; - arp = 1; - rang = 1; - } - if (argument0 = "Chainfist") { - atta = 300; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Meltagun") { - atta = 200; - arp = 1; - rang = 2; - amm = 4; - } - if (argument0 = "Flamer") { - atta = 160; - arp = 0; - rang = 2.1; - amm = 4; - spli = 3; - } - if (argument0 = "Heavy Flamer") { - atta = 250; - arp = 0; - rang = 2.1; - amm = 6; - spli = 3; - } - if (argument0 = "Combi-Flamer") { - atta = 160; - arp = 0; - rang = 2.1; - amm = 1; - spli = 3; - } - if (argument0 = "Bolter") { - atta = 45; - arp = 0; - rang = 12; - amm = 15; - if (obj_ncombat.enemy = 5) then atta = 35; - } // Bursts - if (argument0 = "Power Fist") { - atta = 425; - arp = 1; - rang = 1; - } - if (argument0 = "Possessed Claws") { - atta = 250; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Missile Launcher") { - atta = 200; - arp = 1; - rang = 20; - amm = 4; - spli = 3; - } - if (argument0 = "Chainsword") { - atta = 45; - arp = 0; - rang = 1; - } - if (argument0 = "Bolt Pistol") { - atta = 35; - arp = 0; - rang = 3.1; - amm = 18; - } - if (argument0 = "Chainaxe") { - atta = 55; - arp = 0; - rang = 1; } - if (argument0 = "Poisoned Chainsword") { - atta = 90; - arp = 0; - rang = 1; - if (obj_ini.preomnor = 1) { + + if (obj_ncombat.enemy = 8) { + if (name = "Fusion Blaster") { + atta = 200; + arp = 1; + rang = 2; + amm = 4; + } + if (name = "Plasma Rifle") { + atta = 120; + arp = 1; + rang = 10; + } + if (name = "Cyclic Ion Blaster") { + atta = 180; + arp = 0; + rang = 6; + spli = 3; + } // x6 + if (name = "Burst Rifle") { atta = 130; + arp = 0; + rang = 16; + spli = 3; + } + if (name = "Missile Pod") { + atta = 160; + arp = 1; + rang = 15; + amm = 6; + spli = 3; + } + if (name = "Smart Missile System") { + atta = 150; + arp = 1; + rang = 15; + } + if (name = "Small Railgun") { + atta = 150; + arp = 1; + rang = 18; + } + if (name = "Pulse Rifle") { + atta = 37; + arp = 0; + rang = 12; + } + if (name = "Rail Rifle") { + atta = 65; + arp = 0; + rang = 14; + } + if (name = "Kroot Rifle") { + atta = 25; + arp = 0; + rang = 6; + } + if (name = "Vespid Crystal") { + atta = 60; + arp = 0; + rang = 2.1; + } + if (name = "Railgun") { + atta = 400; + arp = 1; + rang = 20; } - } - if (argument0 = "Sonic Blaster") { - atta = 120; - arp = 0; - rang = 3; - spli = 3; - } - if (argument0 = "Rubric Bolter") { - atta = 80; - arp = 0; - rang = 12; - amm = 15; - } // Bursts - if (argument0 = "Witchfire") { - atta = 200; - arp = 1; - rang = 5.1; - } - if (argument0 = "Autogun") { - atta = 20; - arp = 0; - rang = 6; - amm = 12; - } - if (argument0 = "Storm Bolter") { - atta = 65; - arp = 0; - rang = 8; - amm = 10; - spli = 3; - } - if (argument0 = "Lascannon") { - atta = 200; - arp = 1; - rang = 20; - amm = 8; - } - if (argument0 = "Twin Linked Heavy Bolters") { - atta = 240; - arp = 0; - rang = 16; - spli = 3; - } - if (argument0 = "Twin-Linked Heavy Bolters") { - atta = 240; - arp = 0; - rang = 16; - spli = 3; - } - if (argument0 = "Twin Linked Lascannon") { - atta = 300; - arp = 1; - rang = 20; - } - if (argument0 = "Twin-Linked Lascannon") { - atta = 300; - arp = 1; - rang = 20; - } - if (argument0 = "Battle Cannon") { - atta = 300; - arp = 1; - rang = 12; - } - if (argument0 = "Demolisher Cannon") { - atta = 500; - arp = 1; - rang = 2; - if (instance_exists(obj_nfort)) then rang = 5; - } - if (argument0 = "Earthshaker Cannon") { - atta = 300; - arp = 0; - rang = 12; - spli = 3; - } - if (argument0 = "Havoc Launcher") { - atta = 100; - arp = 0; - rang = 12; - } - if (argument0 = "Baleflame") { - atta = 120; - arp = 0; - rang = 2; - } - if (argument0 = "Defiler Claws") { - atta = 350; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Reaper Autocannon") { - atta = 320; - arp = 0; - rang = 18; - amm = 10; - spli = 3; } - if (name = "Ripper Gun") { - atta = 40; - arp = 0; - rang = 3; - amm = 5; - spli = 0; - } - if (name = "Ogryn Melee") { - atta = 90; - arp = 0; - rang = 1; - } - if (name = "Multi-Laser") { - atta = choose(60, 75, 90, 105); - arp = 0; - rang = 10; - } + if (obj_ncombat.enemy = 9) { - if (argument0 = "Blessed Weapon") { - atta = 150; - arp = 1; - rang = 1; - } - if (argument0 = "Electro-Flail") { - atta = 125; - arp = 1; - rang = 1; - spli = 3; - } - if (argument0 = "Neural Whip") { - atta = 85; - arp = 0; - rang = 1; - spli = 3 - } - if (argument0 = "Sarissa") { - atta = 65; - arp = 0; - rang = 2; - } - if (argument0 = "Seraphim Pistols") { - atta = 200; - arp = 1; - rang = 4; - } - if (argument0 = "Laser Mace") { - atta = 200; - arp = 1; - rang = 5.1; - amm = 3; - } - if (argument0 = "Heavy Bolter") { - atta = 120; - arp = 0; - rang = 16; - spli = 0; - } + if (argument0 = "Bonesword") { + atta = 120; + arp = 0; + rang = 1; + spli = 3; + } + if (argument0 = "Lash Whip") { + atta = 80; + arp = 0; + rang = 2; + } + if (argument0 = "Heavy Venom Cannon") { + atta = 150; + arp = 1; + rang = 8; + } + if (argument0 = "Crushing Claws") { + atta = 90; + arp = 1; + rang = 1; + spli = 3; + } + if (argument0 = "Rending Claws") { + atta = 80; + arp = 1; + rang = 1; + spli = 3; + } + if (argument0 = "Devourer") { + atta = choose(40, 60, 80, 100); + arp = 0; + rang = 5; + if (obj_ini.preomnor = 1) { + atta = choose(48, 72, 96, 120); + } + } + if (argument0 = "Zoanthrope Blast") { + atta = 200; + arp = 1; + rang = 2; + } + if (argument0 = "Carnifex Claws") { + atta = 300; + arp = 1; + rang = 1; + spli = 3; + } + if (argument0 = "Venom Cannon") { + atta = 150; + arp = 0; + rang = 5; + } + if (argument0 = "Deathspitter") { + atta = 100; + arp = 0; + rang = 2.1; + if (obj_ini.preomnor = 1) { + atta = 120; + } + } + if (argument0 = "Fleshborer") { + atta = 15; + arp = 0; + rang = 2.1; + if (obj_ini.preomnor = 1) { + atta = 19; + } + } + if (argument0 = "Scything Talons") { + atta = 30; + arp = 0; + rang = 1; + } + if (argument0 = "Genestealer Claws") { + atta = choose(105, 105, 130); + arp = 1; + rang = 1; + } + if (argument0 = "Witchfire") { + atta = 100; + arp = 1; + rang = 2; + } + if (argument0 = "Autogun") { + atta = 20; + arp = 0; + rang = 6; + amm = 12; + spli = 3; + } + if (argument0 = "Lictor Claws") { + atta = 300; + arp = 0; + rang = 1; + } + if (argument0 = "Flesh Hooks") { + atta = 50; + arp = 0; + rang = 2; + amm = 1; + } - if (name = "Lasgun") { - atta = 20; - arp = 0; - rang = 6; - amm = 30; } - if (name = "Daemonhost Claws") { - atta = 350; - arp = 1; - rang = 1; - spli = 3; - } - if (name = "Daemonhost_Powers") { - atta = round(random_range(100, 300)); - arp = round(random_range(100, 300)); - rang = round(random_range(1, 6)); - spli = choose(0, 1); - } - } - if (obj_ncombat.enemy = 13) { // Some of these, like the Gauss Particle Cannon and Particle Whip, used to be more than twice as strong. - if (name = "Staff of Light") { - atta = 200; - arp = 1; - rang = 1; - spli = 3; - } - if (name = "Staff of Light Shooting") { - atta = 180; - arp = 0; - rang = 3; - spli = 3; - } - if (name = "Warscythe") { - atta = 200; - arp = 1; - rang = 1; - spli = 0; - } - if (name = "Gauss Flayer") { - atta = choose(50, 50, 50, 50, 50, 70); - atta = choose(30, 30, 30, 30, 30, 70); - rang = 6.1; - spli = 0; - } - if (name = "Gauss Blaster") { - atta = choose(70, 70, 70, 70, 70, 100); - arp = choose(0, 0, 0, 0, 0, 1); - rang = 6.1; - spli = 0; - } - if (name = "Gauss Cannon") { - atta = 180; - arp = 1; - rang = 10; - spli = 3; - } - if (name = "Gauss Particle Cannon") { - atta = 300; - arp = 1; - rang = 10.1; - spli = 3; - } - if (name = "Overcharged Gauss Cannon") { - atta = 250; - arp = 1; - rang = 8.1; - spli = 3; - } - if (name = "Wraith Claws") { - atta = 80; - arp = 1; - rang = 1; - spli = 0; - } - if (name = "Claws") { - atta = 300; - arp = 1; - rang = 1; - spli = 0; - } - if (name = "Gauss Flux Arc") { - atta = 180; - arp = 1; - rang = 8; - spli = 3; - } - if (name = "Particle Whip") { - atta = 300; - arp = 1; - rang = 4.1; - spli = 3; - } - if (name = "Gauss Flayer Array") { - atta = 180; - arp = 1; - rang = 8.1; - spli = 3; + if (obj_ncombat.enemy >= 10) or(obj_ncombat.enemy = 2) or(obj_ncombat.enemy = 5) or(obj_ncombat.enemy = 1) { + + if (argument0 = "Plasma Pistol") { + atta = 70; + arp = 1; + rang = 3.1; + } + if (argument0 = "Power Weapon") { + atta = 120; + arp = 0; + rang = 1; + } + if (argument0 = "Power Sword") { + atta = 120; + arp = 0; + rang = 1; + } + if (argument0 = "Force Weapon") { + atta = 400; + arp = 1; + rang = 1; + } + if (argument0 = "Chainfist") { + atta = 300; + arp = 1; + rang = 1; + spli = 3; + } + if (argument0 = "Meltagun") { + atta = 200; + arp = 1; + rang = 2; + amm = 4; + } + if (argument0 = "Flamer") { + atta = 160; + arp = 0; + rang = 2.1; + amm = 4; + spli = 3; + } + if (argument0 = "Heavy Flamer") { + atta = 250; + arp = 0; + rang = 2.1; + amm = 6; + spli = 3; + } + if (argument0 = "Combi-Flamer") { + atta = 160; + arp = 0; + rang = 2.1; + amm = 1; + spli = 3; + } + if (argument0 = "Bolter") { + atta = 45; + arp = 0; + rang = 12; + amm = 15; + if (obj_ncombat.enemy = 5) then atta = 35; + } // Bursts + if (argument0 = "Power Fist") { + atta = 425; + arp = 1; + rang = 1; + } + if (argument0 = "Possessed Claws") { + atta = 250; + arp = 1; + rang = 1; + spli = 3; + } + if (argument0 = "Missile Launcher") { + atta = 200; + arp = 1; + rang = 20; + amm = 4; + spli = 3; + } + if (argument0 = "Chainsword") { + atta = 45; + arp = 0; + rang = 1; + } + if (argument0 = "Bolt Pistol") { + atta = 35; + arp = 0; + rang = 3.1; + amm = 18; + } + if (argument0 = "Chainaxe") { + atta = 55; + arp = 0; + rang = 1; + } + if (argument0 = "Poisoned Chainsword") { + atta = 90; + arp = 0; + rang = 1; + if (obj_ini.preomnor = 1) { + atta = 130; + } + } + if (argument0 = "Sonic Blaster") { + atta = 120; + arp = 0; + rang = 3; + spli = 3; + } + if (argument0 = "Rubric Bolter") { + atta = 80; + arp = 0; + rang = 12; + amm = 15; + } // Bursts + if (argument0 = "Witchfire") { + atta = 200; + arp = 1; + rang = 5.1; + } + if (argument0 = "Autogun") { + atta = 20; + arp = 0; + rang = 6; + amm = 12; + } + if (argument0 = "Storm Bolter") { + atta = 65; + arp = 0; + rang = 8; + amm = 10; + spli = 3; + } + if (argument0 = "Lascannon") { + atta = 200; + arp = 1; + rang = 20; + amm = 8; + } + if (argument0 = "Twin Linked Heavy Bolters") { + atta = 240; + arp = 0; + rang = 16; + spli = 3; + } + if (argument0 = "Twin-Linked Heavy Bolters") { + atta = 240; + arp = 0; + rang = 16; + spli = 3; + } + if (argument0 = "Twin Linked Lascannon") { + atta = 300; + arp = 1; + rang = 20; + } + if (argument0 = "Twin-Linked Lascannon") { + atta = 300; + arp = 1; + rang = 20; + } + if (argument0 = "Battle Cannon") { + atta = 300; + arp = 1; + rang = 12; + } + if (argument0 = "Demolisher Cannon") { + atta = 500; + arp = 1; + rang = 2; + if (instance_exists(obj_nfort)) then rang = 5; + } + if (argument0 = "Earthshaker Cannon") { + atta = 300; + arp = 0; + rang = 12; + spli = 3; + } + if (argument0 = "Havoc Launcher") { + atta = 100; + arp = 0; + rang = 12; + } + if (argument0 = "Baleflame") { + atta = 120; + arp = 0; + rang = 2; + } + if (argument0 = "Defiler Claws") { + atta = 350; + arp = 1; + rang = 1; + spli = 3; + } + if (argument0 = "Reaper Autocannon") { + atta = 320; + arp = 0; + rang = 18; + amm = 10; + spli = 3; + } + + if (name = "Ripper Gun") { + atta = 40; + arp = 0; + rang = 3; + amm = 5; + spli = 0; + } + if (name = "Ogryn Melee") { + atta = 90; + arp = 0; + rang = 1; + } + if (name = "Multi-Laser") { + atta = choose(60, 75, 90, 105); + arp = 0; + rang = 10; + } + + if (argument0 = "Blessed Weapon") { + atta = 150; + arp = 1; + rang = 1; + } + if (argument0 = "Electro-Flail") { + atta = 125; + arp = 1; + rang = 1; + spli = 3; + } + if (argument0 = "Neural Whip") { + atta = 85; + arp = 0; + rang = 1; + spli = 3 + } + if (argument0 = "Sarissa") { + atta = 65; + arp = 0; + rang = 2; + } + if (argument0 = "Seraphim Pistols") { + atta = 200; + arp = 1; + rang = 4; + } + if (argument0 = "Laser Mace") { + atta = 200; + arp = 1; + rang = 5.1; + amm = 3; + } + if (argument0 = "Heavy Bolter") { + atta = 120; + arp = 0; + rang = 16; + spli = 0; + } + + if (name = "Lasgun") { + atta = 20; + arp = 0; + rang = 6; + amm = 30; + } + if (name = "Daemonhost Claws") { + atta = 350; + arp = 1; + rang = 1; + spli = 3; + } + if (name = "Daemonhost_Powers") { + atta = round(random_range(100, 300)); + arp = round(random_range(100, 300)); + rang = round(random_range(1, 6)); + spli = choose(0, 1); + } } - if (name = "Doomsday Cannon") { - atta = 300; - arp = 1; - rang = 6.1; - spli = 3; + + if (obj_ncombat.enemy = 13) { // Some of these, like the Gauss Particle Cannon and Particle Whip, used to be more than twice as strong. + if (name = "Staff of Light") { + atta = 200; + arp = 1; + rang = 1; + spli = 3; + } + if (name = "Staff of Light Shooting") { + atta = 180; + arp = 0; + rang = 3; + spli = 3; + } + if (name = "Warscythe") { + atta = 200; + arp = 1; + rang = 1; + spli = 0; + } + if (name = "Gauss Flayer") { + atta = choose(50, 50, 50, 50, 50, 70); + atta = choose(30, 30, 30, 30, 30, 70); + rang = 6.1; + spli = 0; + } + if (name = "Gauss Blaster") { + atta = choose(70, 70, 70, 70, 70, 100); + arp = choose(0, 0, 0, 0, 0, 1); + rang = 6.1; + spli = 0; + } + if (name = "Gauss Cannon") { + atta = 180; + arp = 1; + rang = 10; + spli = 3; + } + if (name = "Gauss Particle Cannon") { + atta = 300; + arp = 1; + rang = 10.1; + spli = 3; + } + if (name = "Overcharged Gauss Cannon") { + atta = 250; + arp = 1; + rang = 8.1; + spli = 3; + } + if (name = "Wraith Claws") { + atta = 80; + arp = 1; + rang = 1; + spli = 0; + } + if (name = "Claws") { + atta = 300; + arp = 1; + rang = 1; + spli = 0; + } + if (name = "Gauss Flux Arc") { + atta = 180; + arp = 1; + rang = 8; + spli = 3; + } + if (name = "Particle Whip") { + atta = 300; + arp = 1; + rang = 4.1; + spli = 3; + } + if (name = "Gauss Flayer Array") { + atta = 180; + arp = 1; + rang = 8.1; + spli = 3; + } + if (name = "Doomsday Cannon") { + atta = 300; + arp = 1; + rang = 6.1; + spli = 3; + } } } diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index cc6b9817c..23d47fab6 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -40,22 +40,19 @@ function scr_enemy_ai_a() { // checking for inquisition dead world inspections here if (present_fleet[eFACTION.Player]>=0) and (present_fleet[eFACTION.Inquisition]==0){ - var chapter_asset_discovery,cur_planet=0,yep=0,stop=false,shitty=false; - - chapter_asset_discovery=floor(random(200))+1; - - if (array_contains(obj_ini.dis,"Shitty Luck")) then shitty=true; - - if (shitty=true) then chapter_asset_discovery=floor(random(50))+1; + var chapter_asset_discovery,yep=0,stop=false; + + var shitty = scr_has_disadv("Shitty Luck"); if (present_fleet[1]=0){ - chapter_asset_discovery=floor(random(2000))+1; - if (shitty=true) then chapter_asset_discovery=floor(random(800))+1; + chapter_asset_discovery = irandom_range(1, shitty?800:2000); + } else { + chapter_asset_discovery = irandom_range(1, shitty?50:200); } // 137 ; chapter_asset_discovery=floor(random(20))+1; - cur_planet=0; + var cur_planet=0; if (chapter_asset_discovery<=5){ repeat(planets){ cur_planet+=1; @@ -86,7 +83,7 @@ function scr_enemy_ai_a() { var plap=0,old_x=x,old_y=y,flee=0; var _current_planet_name = name; var launch_planet, launch_point_found=false; - launch_planet = nearest_star_with_ownership(x,y, [owner=eFACTION.Imperium, owner=eFACTION.Mechanicus], self.id); + launch_planet = nearest_star_with_ownership(x,y, [eFACTION.Imperium, eFACTION.Mechanicus], self.id); if (launch_planet != "none"){ if (instance_exists(launch_planet)){ flee=instance_create(launch_planet.x,launch_planet.y,obj_en_fleet); @@ -109,10 +106,14 @@ function scr_enemy_ai_a() { var stop; var rand=0; var garrison_force=false, total_garrison=0; + var _planet_data; for (var _run =1;_run<=planets;_run++){ + _planet_data = new PlanetData(_run, self); garrison_force=false; var garrison = new GarrisonForce(p_operatives[_run], true); var sabatours = new GarrisonForce(p_operatives[_run], true, "sabotage"); + _planet_data.garrison = garrison; + _planet_data.sabatours = sabatours; garrison_force = garrison.garrison_force; array_push(system_garrison, garrison); @@ -121,11 +122,7 @@ function scr_enemy_ai_a() { stop=0; ensure_no_planet_negatives(_run); - planet_forces = planet_forces_array(_run); - - if (planet_forces[eFACTION.Tyranids] < 4){ - planet_forces[eFACTION.Tyranids] = 0; - } + planet_forces = _planet_data.planet_forces; var present_forces = []; for (var i=0;i0){//orks prevail over other factions if (p_owner[_run]==2 or p_owner[_run]==6){ p_owner[_run]=eFACTION.Ork; } } + if (!stop){ + stop = _planet_data.continue_to_planet_battle(stop); + if (stop){ + continue; + } + } + var large=0; + var guard_score=0; + var pdf_score=0; + var eldar_score=0; - var guard_score, pdf_score, traitors_score, csm_score, eldar_score, tyranids_score, necrons_score, sisters_score, large; - large=0;guard_score=0;pdf_score=0;traitors_score=0;csm_score=0;eldar_score=0;tyranids_score=0;necrons_score=0;sisters_score=0; - - var guard_attack, pdf_attack, ork_attack, tau_attack, traitors_attack, csm_attack, eldar_attack, tyranids_attack, necrons_attack, sisters_attack; - guard_attack="";pdf_attack="";ork_attack="";tau_attack="";traitors_attack="";csm_attack=""; - eldar_attack="";tyranids_attack="";necrons_attack="";sisters_attack=""; + var guard_attack="",pdf_attack="",ork_attack="",tau_attack="",traitors_attack="",csm_attack=""; + var eldar_attack="",tyranids_attack="",necrons_attack="",sisters_attack=""; - traitors_score=p_traitors[_run]; - csm_score=p_chaos[_run]; - tyranids_score=p_tyranids[_run]; - necrons_score=p_necrons[_run]; - sisters_score=p_sisters[_run]; + var traitors_score=p_traitors[_run]; + var csm_score=p_chaos[_run]; + var tyranids_score=p_tyranids[_run]; + var necrons_score=p_necrons[_run]; + var sisters_score=p_sisters[_run]; // if (p_eldar[_run]>0) then eldar_score=p_eldar[_run]+1; - - - if (p_tyranids[_run]<4) then tyranids_score=0; - if (p_chaos[_run]=6.1) and (p_tyranids[_run]>0) then tyranids_score=p_tyranids[_run]; - if (p_tau[_run]=0) and (p_orks[_run]=0) and (p_traitors[_run]=0) and (p_chaos[_run]=0) and (p_player[_run]<=0) and (tyranids_score<5) and (p_necrons[_run]=0) and (p_owner[_run]=8) and (p_sisters[_run]=0) then stop=1; - - if (p_orks[_run]>0) and (p_sisters[_run]>0) then stop=0; - var imperium_forces = ((p_guardsmen[_run]>0) or (p_pdf[_run]>0) or (p_sisters[_run]>0)); - if (p_necrons[_run]>=5 && imperium_forces) then stop=0; - if (p_tyranids[_run]>=5 && imperium_forces) then stop=0; - if ((p_guardsmen[_run]>0) or (p_sisters[_run]>0)) and ((p_pdf[_run]>0) or (p_tau[_run]>0)) and (p_owner[_run]=8) and (stop=1) then stop=0; - - // Attack heretics whenever possible, even player controlled ones - if (p_player[_run]+p_pdf[_run]>0) and (p_guardsmen[_run]>0) and (obj_controller.faction_status[2]="War") then stop=0; - if (p_player[_run]+p_pdf[_run]>0) and (p_sisters[_run]>0) and (obj_controller.faction_status[5]="War") then stop=0; - - + if (p_tyranids[_run]<4) then tyranids_score=0; + if (p_tyranids[_run]>0) and (stop!=1) and (p_owner[_run]!=9){// This might have been causing the problem /*if (p_tyranids[_run]<5) and (p_guardsmen[_run]>0){ if (p_tyranids[_run]=4) then p_guardsmen[_run]=max(0,p_guardsmen[_run]-100000); @@ -184,70 +173,40 @@ function scr_enemy_ai_a() { if (p_tyranids[_run]>=5) then tyranids_score=7; } - var pdf_with_player=false; - var pdf_loss_reduction=p_fortified[_run]*0.001;//redues man loss from battle loss if higher defences - if (p_owner[_run]!=8) && (p_owner[_run]=1 ||obj_controller.faction_status[2]!="War") && (garrison_force){ - pdf_with_player = true; - pdf_loss_reduction+=garrison.viable_garrison*0.0005; - } - + var pdf_with_player=_planet_data.pdf_will_support_player(); + var pdf_loss_reduction=_planet_data.pdf_loss_reduction_calc();//redues man loss from battle loss if higher defences + + if (!stop){ + guard_score = _planet_data.guard_score_calc(); + } if (p_guardsmen[_run]>0) and (stop!=1){ - if (p_guardsmen[_run] < 500) { - guard_score = 0.1; - } else if (p_guardsmen[_run] >= 100000000) { - guard_score = 7; - } else if (p_guardsmen[_run] >= 50000000) { - guard_score = 6; - } else if (p_guardsmen[_run] >= 15000000) { - guard_score = 5; - } else if (p_guardsmen[_run] >= 6000000) { - guard_score = 4; - } else if (p_guardsmen[_run] >= 1000000) { - guard_score = 3; - } else if (p_guardsmen[_run] >= 100000) { - guard_score = 2; - } else if (p_guardsmen[_run] >= 2000) { - guard_score = 1; - } else { - guard_score = 0.5; - } - - - guard_attack = guard_target_matrix(_run); + guard_score = _planet_data.guard_score_calc(); + guard_attack = _planet_data.guard_attack_matrix(); + if (guard_attack="tyranids") then tyranids_score=p_tyranids[_run]; // Tend to prioritize traitors > Orks > Tau // Eldar don't get into pitched battles so nyuck nyuck nyuck } - if (((p_guardsmen[_run]=0) or ((guard_score<=0.5))) or (p_owner[_run]==8)) or ((p_guardsmen[_run]>0) and (obj_controller.faction_status[2]=="War")) and (p_pdf[_run]>0) and (stop!=1){ + if (_planet_data.pdf>0 && !stop){ var pdf_mod; - var defence_mult = p_fortified[_run]*0.1; + var defence_mult = _planet_data.fortification_level*0.1; try { - if (pdf_with_player){//if player supports give garrison bonus - pdf_score=determine_pdf_defence(p_pdf[_run],garrison,p_fortified[_run])[0]; + if (pdf_with_player && garrison_force){//if player supports give garrison bonus + pdf_score=determine_pdf_defence(_planet_data.pdf,garrison,_planet_data.fortification_level)[0]; } else{ - pdf_score=determine_pdf_defence(p_pdf[_run],,p_fortified[_run])[0]; + pdf_score=determine_pdf_defence(_planet_data.pdf,,_planet_data.fortification_level)[0]; } }catch(_exception) { handle_exception(_exception,,,,_run); } // // if (p_eldar[_run]>0) and (p_owner[_run]!=6) then pdf_attack="eldar"; - if (p_tyranids[_run]>=4) then pdf_attack="tyranids"; - if (p_tau[_run]>0) and (p_owner[_run]!=8) then pdf_attack="tau"; - if (p_orks[_run]>0) then pdf_attack="ork"; - if (p_traitors[_run]>0) then pdf_attack="traitors"; - if (p_chaos[_run]>0) then pdf_attack="csm"; - if (p_guardsmen[_run]>0) and (p_owner[_run]=8) then pdf_attack="guard"; - if (p_guardsmen[_run]>0) and (p_owner[_run]=1) and (obj_controller.faction_status[2]="War") then pdf_attack="guard"; - // Always goes after traitors first, unless - if (p_traitors[_run]<=1) and (p_tau[_run]>=4) and (p_owner[_run]!=8) then pdf_attack="tau"; - if (p_traitors[_run]<=1) and (p_orks[_run]>=4) then pdf_attack="ork"; - if (p_tyranids[_run]>=4) then pdf_attack="tyranids"; + pdf_attack = _planet_data.pdf_attack_matrix(); } if (p_sisters[_run]>0) and (stop!=1){// THEY MARCH FOR THE ECCLESIARCHY - if (p_player[_run]>0) and (obj_controller.faction_status[5]="War"){ + if (p_player[_run]>0) and (obj_controller.faction_status[5]=="War"){ sisters_attack="player"; } else { if (p_tau[_run]>0) then sisters_attack="tau"; @@ -352,7 +311,7 @@ function scr_enemy_ai_a() { - if (stop=0){// Start stop + if (!stop){// Start stop default_imperium_attack = guard_score>0 && !((guard_score<=0.5) && (pdf_score>1)) ?"guard":"pdf"; @@ -575,20 +534,7 @@ function scr_enemy_ai_a() { rand2=(pdf_random*pdf_score); var active_garrison = pdf_with_player && garrison.viable_garrison>0; if (rand1>rand2){ - if (planet_forces[eFACTION.Ork]>=4) and (p_pdf[_run]>=30000){ - p_pdf[_run]=floor(p_pdf[_run]*(min(0.95, 0.55+pdf_loss_reduction))); - } - else if (planet_forces[eFACTION.Ork]>=4 && p_pdf[_run]<30000 && p_pdf[_run]>=10000){ - p_pdf[_run]=active_garrison?p_pdf[_run]*0.4:0; - } - else if (planet_forces[eFACTION.Ork]>=3) and (p_pdf[_run]<10000){ - p_pdf[_run]=active_garrison?p_pdf[_run]*0.4:0; - } - else if (planet_forces[eFACTION.Ork]<3 && p_pdf[_run]>30000){ - p_pdf[_run]=floor(p_pdf[_run]*(min(0.95, 0.7+pdf_loss_reduction))); - } - if (planet_forces[eFACTION.Ork]>=2) and (p_pdf[_run]<2000){ p_pdf[_run]=0;} - if (planet_forces[eFACTION.Ork]>=1) and (p_pdf[_run]<200){ p_pdf[_run]=0;} + _planet_data.pdf_defence_loss_to_orks(); if (active_garrison){ var tixt = $"Chapter Forces led by {garrison.garrison_leader.name_role()} on {name} {scr_roman_numerals()[_run-1]} were unable to secure PDF victory chapter support requested"; @@ -611,7 +557,7 @@ function scr_enemy_ai_a() { if (p_pdf[_run]=0) and (p_player[_run]<=0){ var badd=1; - if (p_pdf[1]+p_pdf[2]+p_pdf[3]+p_pdf[4]=0) and (p_guardsmen[1]+p_guardsmen[2]+p_guardsmen[3]+p_guardsmen[4]=0){ + if (array_sum(p_pdf)==0) and (p_guardsmen[1]+p_guardsmen[2]+p_guardsmen[3]+p_guardsmen[4]=0){ badd=2; } @@ -822,14 +768,14 @@ function scr_enemy_ai_a() { if (p_pdf[_run]=0) and (p_player[_run]<=0) and (p_necrons[_run]>0){ - var badd;badd=1; + var _system_overrun=false; - if (p_pdf[1]+p_pdf[2]+p_pdf[3]+p_pdf[4]=0) and (p_guardsmen[1]+p_guardsmen[2]+p_guardsmen[3]+p_guardsmen[4]=0){ - badd=2; + if (!array_sum(p_pdf,0, 1, planets) && !array_sum(p_guardsmen,0, 1, planets)){ + _system_overrun=true; } - if (badd = 1) and(p_tyranids[_run] < 5) and(p_orks[_run] = 0) and(p_traitors[_run] = 0) { - scr_alert("red", "owner", string(name) + " " + string(_run) + " has been overwhelmed by Necrons!", x, y); + if (!_system_overrun) and(p_tyranids[_run] < 5) and(p_orks[_run] = 0) and(p_traitors[_run] = 0) { + scr_alert("red", "owner", $"{_planet_data.name()} has been overwhelmed by Necrons!", x, y); if (visited == 1) { if (p_type[_run] == "Forge") { //visited variable check whether the star has been visisted or not 1 for true 0 for false dispo[_run] -= 10; // 10 Disposition decrease for the planet govrnor if it's overrun by necrons @@ -841,9 +787,9 @@ function scr_enemy_ai_a() { } } - if (badd=2) and (p_tyranids[_run]<5) and (p_orks[_run]=0) and (p_traitors[_run]=0){ - scr_popup("System Lost","The "+string(name)+" system has been ovewhelmed by Necrons!","necron_army",""); - scr_event_log("red","System "+string(name)+" has been overwhelmed by Necrons.", name); + if (_system_overrun && p_tyranids[_run]<5 && p_orks[_run]=0 && p_traitors[_run]=0){ + scr_popup("System Lost",$"The {name} system has been ovewhelmed by Necrons!","necron_army",""); + scr_event_log("red",$"System {name} has been overwhelmed by Necrons.", name); } } @@ -871,7 +817,7 @@ function scr_enemy_ai_a() { // 135; - p_time_since_saved[_run] = 0; + var planet_saved = ((p_player[_run] + p_raided[_run]) > 0 && p_orks[_run] = 0 && p_tyranids[_run] < 4 && p_chaos[_run] = 0 && p_traitors[_run] = 0 && p_necrons[_run] = 0 && p_tau[_run] = 0); if (planet_saved){ @@ -921,6 +867,7 @@ function scr_enemy_ai_a() { } if (p_raided[_run] > 0) then p_raided[_run] = 0; + delete _planet_data; } // end repeat here @@ -939,7 +886,7 @@ function scr_enemy_ai_a() { // Restock PDF and military var i; i = 0; - repeat(4) { + repeat(planets) { i += 1; if (p_type[i] == "Daemon") { p_heresy[i] = 200; diff --git a/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml b/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml index 9fb787695..17c49c51c 100644 --- a/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml +++ b/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml @@ -66,7 +66,7 @@ function scr_enemy_ai_b() { var fleet_spawn_chance=irandom(99)+1 onceh=0; - if (array_contains(obj_ini.dis,"Shitty Luck")) then fleet_spawn_chance-=5; + if (scr_has_disadv("Shitty Luck")) then fleet_spawn_chance-=5; if (fleet_spawn_chance<=15){ if (present_fleet[eFACTION.Necrons] > 0) {//if necron fleet diff --git a/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml b/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml index 37acd838e..22ca8f14a 100644 --- a/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml +++ b/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml @@ -212,7 +212,7 @@ function scr_enemy_ai_d() { } if (reward=2){ if (obj_ini.fleet_type=ePlayerBase.home_world) then scr_add_artifact("random","",0,obj_ini.home_name,2); - if (obj_ini.fleet_type != ePlayerBase.home_world) then scr_add_artifact("random","",0,obj_ini.ship[1],501); + if (obj_ini.fleet_type != ePlayerBase.home_world) then scr_add_artifact("random","",0,obj_ini.ship[0],501); text="The Mechanicus Research team on planet "+string(name)+" "+scr_roman(i)+" have completed their work without any major setbacks. Pleased with your astartes' work, they have granted your Chapter an artifact, to be used as you see fit."; scr_event_log("","Mechanicus Mission Completed: The Mechanicus research team on "+string(name)+" "+scr_roman(i)+" have completed their work."); scr_event_log("","Artifact gifted from Mechanicus."); @@ -240,16 +240,16 @@ function scr_enemy_ai_d() { for (com =0; com<=10;com++){ for (ide =0; ide<=array_length(obj_ini.role[com]);ide++){ unit = fetch_unit([com,ide]) - if (unit.role()=obj_ini.role[100][Role.TECHMARINE]){ + if (unit.role()=obj_ini.role[100][eROLE.Techmarine]){ // Case 1: on planet if (obj_ini.loc[com][ide]=name) and (unit.planet_location=i){ p_player[i]-=scr_unit_size(obj_ini.armour[com][ide],obj_ini.role[com][ide],true); obj_ini.loc[com][ide]="Mechanicus Vessel"; unit.planet_location=0; - unit.ship_location=0; + unit.ship_location=-1; techs_taken+=1; } - if (unit.ship_location>0){ + if (unit.ship_location>-1){ ship_planet=obj_ini.ship_location[unit.ship_location]; if (ship_planet=name){ obj_ini.ship_carrying[unit.ship_location]-=scr_unit_size(obj_ini.armour[com][ide],obj_ini.role[com][ide],true); @@ -450,7 +450,7 @@ function scr_enemy_ai_d() { var woop=scr_role_count("Chief "+string(obj_ini.role[100,17]),""); var o,yep,yep2;o=0;yep=true;yep2=false; - if (array_contains(obj_ini.dis, "Psyker Intolerant")) then yep=false; + if (scr_has_disadv("Psyker Intolerant")) then yep=false; if (obj_controller.known[eFACTION.Tyranids]=0) and (woop!=0) and (yep!=false){ scr_popup("Shadow in the Warp",$"Chief {obj_ini.role[100,17]} "+string(obj_ini.name[0,5])+" reports a disturbance in the warp. He claims it is like a shadow.","shadow",""); @@ -484,14 +484,14 @@ function scr_enemy_ai_d() { storm-=1; if (storm=0){ var tr="Warp Storms over "+string(name)+" dissipate."; - scr_alert("green","warp",tr,x,y);scr_event_log("green",tr); + scr_alert("green","Warp",tr,x,y);scr_event_log("green",tr); } } if (trader>0){ trader-=1; if (trader=0){ var tr="Rogue Trader fleet departs from "+string(name)+"."; - scr_alert("green","warp",tr,x,y);scr_event_log("green",tr); + scr_alert("green","Warp",tr,x,y);scr_event_log("green",tr); } } diff --git a/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml b/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml index 47301e3ae..e1acc55b2 100644 --- a/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml +++ b/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml @@ -20,10 +20,10 @@ function scr_enemy_ai_e() { var damage = array_create(20,0); - var i = 0; - repeat(13) { - i += 1; - if (present_fleet[i]) then have_fleets += 1; + for (var i = 1; i <= 13; i += 1) { + if (present_fleet[i]) { + have_fleets += 1; + } } if (present_fleet[1] > 0) { // Battle1 is reserved for player battles @@ -597,18 +597,9 @@ function scr_enemy_ai_e() { thirdpop = p_max_population[run] / 3; halfpop = p_max_population[run] / 2; - if (array_length(p_feature[run]) != 0) { + if (array_length(p_feature[run])) { var planet_data = new PlanetData(run, self); - //initiate training logics rest to be found in scr_recruit_data - if (planet_feature_bool(p_feature[run], P_features.Recruiting_World)){ - if (obj_controller.gene_seed == 0) and (obj_controller.recruiting > 0) { - obj_controller.recruiting = 0; - obj_controller.income_recruiting = 0; - scr_alert("red", "recruiting", "The Chapter has run out of gene-seed!", 0, 0); - } else if (obj_controller.recruiting > 0){ - planet_data.marine_training(); - } - } + // Transforming billions pop number to a real number so the code can handle it // Otherwise, 3 and a half billions get translated as 3,50 instead of 3500000000 @@ -743,7 +734,7 @@ function scr_enemy_ai_e() { } } - for (i=1;i<=planets;i++){ + for (var i=1;i<=planets;i++){ var existing_problem = has_any_problem_planet(i); if (!existing_problem){ if (!irandom(50) && p_owner[i]==eFACTION.Imperium){ diff --git a/scripts/scr_equipment_struct/scr_equipment_struct.gml b/scripts/scr_equipment_struct/scr_equipment_struct.gml new file mode 100644 index 000000000..72e92c728 --- /dev/null +++ b/scripts/scr_equipment_struct/scr_equipment_struct.gml @@ -0,0 +1,398 @@ +function EquipmentStruct(item_data, core_type,quality="none") constructor{ + type = core_type; + + var properties = [ + ["hp_mod", 0], + ["description", ""], + ["damage_resistance_mod", 0], + ["ranged_mod", 0], + ["melee_mod", 0], + ["armour_value", 0], + ["attack", 0], + ["melee_hands", 0], + ["ranged_hands", 0], + ["ammo", 0], + ["range", 0], + ["spli", 0], + ["arp", 0], + ["special_description", ""], + ["special_properties", []], + ["abbreviation", ""], + ["tags", []], + ["name", ""], + ["second_profiles", []], + ["req_exp", 0], + ["maintenance", 0] + ]; + + for (var i = 0; i < array_length(properties); i++) { + var name = properties[i][0]; + var default_value = properties[i][1]; + + if (struct_exists(item_data, name)) { + self[$ name] = item_data[$ name]; + if (quality != "none") { + if (is_struct(self[$ name])) { + if (struct_exists(self[$ name], quality)) { + self[$ name] = self[$ name][$ quality]; + } else { + self[$ name] = self[$ name].standard; + } + } + } + } else { + self[$ name] = default_value; + } + } + + variable_struct_set(self, "quality", quality == "none" ? "standard" : quality); + + if (maintenance == 0){ + if (has_tags(["heavy_ranged","power", "plasma", "melta"])){ + maintenance = 0.05; + } + } + static item_tooltip_desc_gen = function(){ + item_desc_tooltip = ""; + var stat_order; + var item_type = type; + if (type==""){ + if struct_exists(global.gear[$ "armour"],name){ + item_type = "armour"; + } + else if struct_exists(global.gear[$ "mobility"],name){ + item_type = "mobility"; + } + else if struct_exists(global.gear[$ "gear"],name){ + item_type = "gear"; + } + else if struct_exists(global.weapons,name){ + item_type = "weapon"; + } + else{ + item_desc_tooltip = "Error: Item not found!"; + return item_desc_tooltip; + } + } + switch (item_type) { + default: + stat_order = ["description", "special_description", "quality", "armour_value", "damage_resistance_mod", "hp_mod", "ranged_mod", "melee_mod", "attack", "spli", "range", "ammo", "melee_hands", "ranged_hands", "maintenance","special_properties", "req_exp", "tags"]; + break; + case "weapon": + stat_order = ["description", "special_description", "quality", "attack", "spli", "range", "ammo", "ranged_mod", "melee_mod", "armour_value", "hp_mod", "damage_resistance_mod", "melee_hands", "ranged_hands", "maintenance","special_properties", "req_exp", "tags"]; + break; + } + + for (var i = 0; i < array_length(stat_order); i++) { + var stat = stat_order[i]; + switch (stat) { + case "description": + if (description!=""){ + item_desc_tooltip += $"{description}##" + } + break; + case "quality": + if (quality!=""){ + item_desc_tooltip += $"Quality: {quality_string_conversion(quality)}##" + } + break; + case "armour_value": + if (armour_value!=0){ + if item_type = "armour"{ + item_desc_tooltip += $"Armour: {armour_value}#" + } + else{ + item_desc_tooltip += $"Armour: {format_number_with_sign(armour_value)}#" + } + } + break; + case "hp_mod": + if (hp_mod!=0){ + item_desc_tooltip += $"Health Mod: {format_number_with_sign(hp_mod)}%#" + } + break; + case "damage_resistance_mod": + if (damage_resistance_mod!=0){ + item_desc_tooltip += $"Damage Res: {format_number_with_sign(damage_resistance_mod)}%#" + } + break; + case "attack": + if (attack!=0){ + item_desc_tooltip += $"Damage: {attack}#" + } + break; + case "spli": + if item_type = "weapon"{ + item_desc_tooltip += $"Max Kills: {max(1, spli)}#" + } + break; + case "ranged_mod": + if (ranged_mod!=0){ + item_desc_tooltip += $"Ranged Mod: {format_number_with_sign(ranged_mod)}%#" + } + break; + case "melee_mod": + if (melee_mod!=0){ + item_desc_tooltip += $"Melee Mod: {format_number_with_sign(melee_mod)}%#" + } + break; + case "ammo": + if (ammo!=0){ + item_desc_tooltip += $"Ammo: {ammo}#" + } + break; + case "range": + if (range>1.1){ + item_desc_tooltip += $"Range: {range}#" + } + break; + case "melee_hands": + if (melee_hands != 0) { + if item_type = "weapon"{ + item_desc_tooltip += $"Melee Burden: {melee_hands}#" + } + else{ + item_desc_tooltip += $"Melee Burden Cap: {format_number_with_sign(melee_hands)}#" + } + } + break; + case "ranged_hands": + if (ranged_hands != 0) { + if item_type = "weapon"{ + item_desc_tooltip += $"Ranged Burden: {ranged_hands}#" + } + else{ + item_desc_tooltip += $"Ranged Burden Cap: {format_number_with_sign(ranged_hands)}#" + } + } + break; + case "special_properties": + var special_properties_array = []; + if (array_length(special_properties)>0){ + for (var k = 0; k < array_length(special_properties); k++) { + array_push(special_properties_array, special_properties[k]); + } + } + if (arp>0){ + array_push(special_properties_array, "Armour Piercing") + } + else if (arp<0){ + array_push(special_properties_array, "Low Penetration") + } + if (array_length(second_profiles)>0){ + for (var h = 0; h < array_length(second_profiles); h++) { + if (string_pos("Integrated", second_profiles[h]) == 0) { + var integrated_member = "Integrated " + second_profiles[h]; + array_push(special_properties_array, integrated_member); + } + else{ + array_push(special_properties_array, second_profiles[h]); + } + } + //item_desc_tooltip += $"#Properties:#{special_properties_string}#" + } + if (array_length(special_properties_array) > 0){ + var special_properties_string = "" + for (var j = 0; j < array_length(special_properties_array); j++) { + special_properties_string += special_properties_array[j] + if (j < array_length(special_properties_array) - 1) { + special_properties_string += ", " + } + } + item_desc_tooltip += $"#Properties:#{special_properties_string}#" + } + break; + case "special_description": + if (special_description!=""){ + item_desc_tooltip += $"#{special_description}#" + } + break; + case "req_exp": + if (req_exp>0){ + item_desc_tooltip += $"#Requires {req_exp} EXP#" + } + break; + case "tags": + if (array_length(tags)>0){ + var tagString = "" + for (var j = 0; j < array_length(tags); j++) { + tagString += tags[j] + if (j < array_length(tags) - 1) { + tagString += ", " + } + } + item_desc_tooltip += $"#Keywords:#{tagString}#" + } + break; + case "maintenance": + if (maintenance>0){ + item_desc_tooltip += $"#Maintenance:#{maintenance} Forge Points#" + } + } + } + return item_desc_tooltip + } + + static has_tag = function(tag){ + return array_contains(tags, tag); + } + + static has_tags = function(search_tags){ + var satisfied=false; + var wanted_tags_length=array_length(search_tags); + for (var i=0;i0 && obj_controller.stc_bonus[1]<5){ + if (obj_controller.stc_bonus[1]==2 && has_tag("chain")){ + attack*=1.07; + } else if (obj_controller.stc_bonus[1]==3 && has_tag("flame")){ + attack*=1.1; + }else if (obj_controller.stc_bonus[1]==4 && has_tag("explosive")){ + attack*=1.07; + }else if (obj_controller.stc_bonus[1]==1 && has_tag("bolt")){ + attack*=1.07; + } + } + if (obj_controller.stc_bonus[2]>0 && obj_controller.stc_bonus[2]<3){ + if (obj_controller.stc_bonus[1]==1 && has_tag("fist")){ + attack*=1.1; + } else if (obj_controller.stc_bonus[1]==2 && has_tag("Plasma")){ + attack*=1.1; + } + } + } + } + } +} +function gear_weapon_data(search_area="any",item,wanted_data="all", sub_class=false, quality="standard"){ + var item_data_set=false; + var equip_area=false; + gear_areas = ["gear","armour","mobility"]; + if (search_area=="any"){ + data_found=false; + for (i=0;i<3;i++){ + if (struct_exists(global.gear[$ gear_areas[i]],item)){ + equip_area=global.gear; + item_data_set=global.gear[$ gear_areas[i]][$item]; + data_found=true; + search_area=gear_areas[i]; + break; + } + } + if (!data_found){ + equip_area=global.weapons; + if (struct_exists(equip_area,item)){ + item_data_set=equip_area[$item]; + search_area="weapon"; + } + } + } else { + if (array_contains(gear_areas,search_area)){ + equip_area=global.gear; + if (struct_exists(equip_area[$ search_area],item)){ + item_data_set = equip_area[$ search_area][$ item] + } + } else if (search_area=="weapon"){ + equip_area=global.weapons; + if (struct_exists(equip_area,item)){ + item_data_set=equip_area[$item] + search_area="weapon"; + } + } + } + + if (is_struct(item_data_set)){ + if (wanted_data=="all"){ + item_data_set.name=item; + return new EquipmentStruct(item_data_set,search_area,quality); + } + if (struct_exists(item_data_set, wanted_data)){ + if (is_struct(item_data_set[$ wanted_data])){ + if (struct_exists(item_data_set[$ wanted_data], quality)){ + return item_data_set[$ wanted_data][$ quality]; + } else { + if (struct_exists(item_data_set[$ wanted_data],"standard")){ + return item_data_set[$ wanted_data][$ "standard"] + } else { + return 0;//default value + } + } + } else { + return item_data_set[$ wanted_data] + } + } else { + return 0;//default value + } + } + return false;//nothing found +} + +function quality_string_conversion(quality){ + var quality_conversions = { + standard:"Normal", + master_crafted:"Master Crafted", + artificer:"Articifer", + artifact:"Artifact", + exemplary:"Exemplary" + } + if (struct_exists(quality_conversions, quality)){ + return quality_conversions[$ quality] + } else {return "";} +} + +function quality_color(_item_quality){ + switch(_item_quality){ + case "standard": + return(draw_get_color()) + break; + case "master_crafted": + return(#bf9340); + break; + case "artificer": + return(#bf4040); + break; + case "artifact": + return(#40bfbf); + break; + case "exemplary": + return(#80bf40); + break; + } +} + +function format_number_with_sign(number){ + return number > 0 ? "+" + string(number) : string(number); +} diff --git a/scripts/scr_equipment_struct/scr_equipment_struct.yy b/scripts/scr_equipment_struct/scr_equipment_struct.yy new file mode 100644 index 000000000..e7b079433 --- /dev/null +++ b/scripts/scr_equipment_struct/scr_equipment_struct.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "scr_equipment_struct", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "Scripts", + "path": "folders/Scripts.yy", + }, +} \ No newline at end of file diff --git a/scripts/scr_event_dudes/scr_event_dudes.gml b/scripts/scr_event_dudes/scr_event_dudes.gml index 6e34b685d..bda847c0b 100644 --- a/scripts/scr_event_dudes/scr_event_dudes.gml +++ b/scripts/scr_event_dudes/scr_event_dudes.gml @@ -8,14 +8,14 @@ function scr_event_dudes(do_action, is_planet, system_name, location_id) { */ if (do_action=1){ - if (obj_ini.progenitor=0){ + if (obj_ini.progenitor == ePROGENITOR.NONE) { if (obj_controller.fest_feasts<2) then obj_controller.fest_feasts=2; } - if ((global.chapter_name="Space Wolves") or (obj_ini.progenitor=3)){ + if ((global.chapter_name="Space Wolves") || (obj_ini.progenitor == ePROGENITOR.SPACE_WOLVES)) { if (obj_controller.fest_feasts<10) then obj_controller.fest_feasts=10; if (obj_controller.fest_boozes<10) then obj_controller.fest_boozes=10; } - if ((global.chapter_name="Blood Angels") or (obj_ini.progenitor=5)){ + if ((global.chapter_name="Blood Angels") || (obj_ini.progenitor == ePROGENITOR.BLOOD_ANGELS)) { if (obj_controller.fest_boozes<3) then obj_controller.fest_boozes=3; } } diff --git a/scripts/scr_fleet_advisor/scr_fleet_advisor.gml b/scripts/scr_fleet_advisor/scr_fleet_advisor.gml index d36dcf5aa..d76da309d 100644 --- a/scripts/scr_fleet_advisor/scr_fleet_advisor.gml +++ b/scripts/scr_fleet_advisor/scr_fleet_advisor.gml @@ -1,5 +1,6 @@ // Script assets have changed for v2.3.0 see // https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information +/// @mixin function scr_fleet_advisor(){ //TODO swap this xx yy stuff out for a surface var xx = __view_get(e__VW.XView, 0) + 0; @@ -76,9 +77,6 @@ function scr_fleet_advisor(){ // TODO: Probably a good idea to turn this whole interactive list/sheet generating logic into a constructor, that can be reused on many screens. // I have no passion for this atm. if (instance_exists(cn)) { - var _header_offset = 80; - var _row_height = 20; - var _row_gap = 2; var _columns = { name: { w: 176, @@ -108,6 +106,7 @@ function scr_fleet_advisor(){ }; var _column_x = xx + 953; + var _header_offset = 80; var _columns_array = ["name", "class", "location", "hp", "carrying"]; for (var i = 0; i < array_length(_columns_array); i++) { @@ -135,9 +134,12 @@ function scr_fleet_advisor(){ } draw_set_halign(fa_left); + var _row_height = 20; + var _row_gap = 2; for (var i = ship_current; i < ship_current + 34; i++) { + if (i>= array_length(obj_ini.ship)) then continue; if (obj_ini.ship[i] != "") { - var _row_y = yy + _header_offset + (i * (_row_height + _row_gap)); + var _row_y = _columns[$ "name"].y1 + _row_height + (i * (_row_height + _row_gap)); draw_rectangle(xx + 950, _row_y, xx + 1546, _row_y + _row_height, 1); var _goto_button = { @@ -182,7 +184,7 @@ function scr_fleet_advisor(){ } } - if scr_hit(xx + 950, _row_y, xx + 1546, yy + 100 + (i * (_row_height + _row_gap))) { + if scr_hit(xx + 950, _row_y, xx + 1546, _row_y + _row_height) { if (cn.temp[101] != obj_ini.ship[i]) { cn.temp[101] = obj_ini.ship[i]; cn.temp[102] = obj_ini.ship_class[i]; @@ -198,14 +200,14 @@ function scr_fleet_advisor(){ cn.temp[109] = string(obj_ini.ship_turrets[i]); - cn.temp[110] = obj_ini.ship_wep[i][1]; - cn.temp[111] = obj_ini.ship_wep_facing[i][1]; - cn.temp[112] = obj_ini.ship_wep[i][2]; - cn.temp[113] = obj_ini.ship_wep_facing[i][2]; - cn.temp[114] = obj_ini.ship_wep[i][3]; - cn.temp[115] = obj_ini.ship_wep_facing[i][3]; - cn.temp[116] = obj_ini.ship_wep[i][4]; - cn.temp[117] = obj_ini.ship_wep_facing[i][4]; + var facing_length = array_length(obj_ini.ship_wep_facing[i]); + var wep_length = array_length(obj_ini.ship_wep[i]); + var max_weapons = min(facing_length, wep_length, 5); + + for (var s = 1; s < max_weapons; s++) { + cn.temp[110+((s-1)*2)] = obj_ini.ship_wep[i][s]; + cn.temp[110+((s-1)*2)+1] = obj_ini.ship_wep_facing[i][s]; + } cn.temp[118] = $"{obj_ini.ship_carrying[i]}/{obj_ini.ship_capacity[i]}"; cn.temp[119] = ""; @@ -213,24 +215,16 @@ function scr_fleet_advisor(){ } tooltip_draw($"Carrying ({cn.temp[118]}): {cn.temp[119]}"); if (_goto_button.click()) { - obj_controller.temp[40] = obj_ini.ship[i]; with(obj_p_fleet) { - for (var k = 0; k <= 40; k++) { - if (capital[k] == obj_controller.temp[40]) then instance_create(x, y, obj_temp7); - if (frigate[k] == obj_controller.temp[40]) then instance_create(x, y, obj_temp7); - if (escort[k] == obj_controller.temp[40]) then instance_create(x, y, obj_temp7); - } - } - if (instance_exists(obj_temp7)) { - obj_controller.x = obj_temp7.x; - obj_controller.y = obj_temp7.y; - obj_controller.menu = 0; - with(obj_fleet_show) { - instance_destroy(); - } - instance_create(obj_temp7.x, obj_temp7.y, obj_fleet_show); - with(obj_temp7) { - instance_destroy(); + var _fleet_ships = fleet_full_ship_array(); + if (array_contains(_fleet_ships, i)){ + obj_controller.x = x; + obj_controller.y = y; + obj_controller.menu = 0; + with(obj_fleet_show) { + instance_destroy(); + } + instance_create(x, y, obj_fleet_show); } } } diff --git a/scripts/scr_fleet_functions/scr_fleet_functions.gml b/scripts/scr_fleet_functions/scr_fleet_functions.gml index 389c092da..b918c7e12 100644 --- a/scripts/scr_fleet_functions/scr_fleet_functions.gml +++ b/scripts/scr_fleet_functions/scr_fleet_functions.gml @@ -1,5 +1,19 @@ +function distribute_strength_to_fleet(strength, fleet){ + while(strength>0){ + var ship_type = choose(1,1,1,1,2,2,3); + strength-=ship_type; + if (ship_type==1){ + fleet.escort_number++; + } else if (ship_type==2){ + fleet.frigate_number++; + }else if (ship_type==3){ + fleet.capital_number++; + } + } +} + //to be run within with scope function set_fleet_target(targ_x, targ_y, final_target){ action_x = targ_x; @@ -182,10 +196,9 @@ function set_fleet_movement(fastest_route = true){ function load_unit_to_fleet(fleet, unit){ var loaded = false; var all_ships = fleet_full_ship_array(fleet); - var i, ship_ident; - for (i=0;iobj_ini.ship_carrying[ship_ident]){ obj_ini.ship_carrying[ship_ident]+=unit.size; unit.planet_location=0; diff --git a/scripts/scr_garrison/scr_garrison.gml b/scripts/scr_garrison/scr_garrison.gml index 79f02828c..f16d4ee3b 100644 --- a/scripts/scr_garrison/scr_garrison.gml +++ b/scripts/scr_garrison/scr_garrison.gml @@ -13,7 +13,7 @@ function disposition_description_chart(dispo){ return "Very Friendly"; }else if (dispo<90){ return "Excellent"; - }else if (dispo<=100){ + }else { return "Unquestionable"; } } @@ -273,7 +273,7 @@ function determine_pdf_defence(pdf, garrison="none", planet_forti=0, enemy=0){ explanations += $"Planet Defences:X{defence_mult+1}#" if (garrison!="none"){//if player supports give garrison bonus var garrison_mult = garrison.viable_garrison*(0.008+(0.001*planet_forti)) - var siege_masters =array_contains(obj_ini.adv, "Siege Masters"); + var siege_masters =scr_has_adv("Siege Masters"); if (siege_masters) then garrison_mult*=2; explanations += $"Garrison Bonus:X{garrison_mult+1}#"; if (siege_masters){ diff --git a/scripts/scr_get_item_names/scr_get_item_names.gml b/scripts/scr_get_item_names/scr_get_item_names.gml new file mode 100644 index 000000000..3667a4077 --- /dev/null +++ b/scripts/scr_get_item_names/scr_get_item_names.gml @@ -0,0 +1,903 @@ +#macro ITEM_NAME_NONE "(None)" +#macro ITEM_NAME_ANY "(any)" + +/// @description This function appends the ITEM_NAME_NONE and ITEM_NAME_ANY to the given list, as requested. +/// @param {array} _item_names - The list of item names to append to. +/// @param {bool} _with_none - Whether to include ITEM_NAME_NONE in the list. +/// @param {bool} _with_any - Whether to include ITEM_NAME_ANY in the list. +function get_none_or_any_item_names(_item_names, _with_none=false, _with_any=false) { + var expandCount = (_with_any != 0) + (_with_none != 0); + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + expandCount); + var index = initial_size; + if (_with_none) { + _item_names[@ index++] = ITEM_NAME_NONE; + } + if (_with_any) { + _item_names[@ index++] = ITEM_NAME_ANY; + } +} + +/// @description This function returns the hard-coded list of ranged weapons. +/// @param {array} _item_names - The list of ranged weapons to append to. +/// @returns {void} +function push_marine_ranged_weapons_item_names(_item_names) { + var item_count = 23 + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Archeotech Laspistol"; + _item_names[@ index++] = "Assault Cannon"; + _item_names[@ index++] = "Bolt Pistol"; + _item_names[@ index++] = "Bolter"; + _item_names[@ index++] = "Stalker Pattern Bolter"; + _item_names[@ index++] = "Combiflamer"; + _item_names[@ index++] = "Flamer"; + _item_names[@ index++] = "Heavy Bolter"; + _item_names[@ index++] = "Heavy Flamer"; + _item_names[@ index++] = "Hellrifle"; + _item_names[@ index++] = "Incinerator"; + _item_names[@ index++] = "Integrated Bolter"; + _item_names[@ index++] = "Lascannon"; + _item_names[@ index++] = "Lascutter"; + _item_names[@ index++] = "Meltagun"; + _item_names[@ index++] = "Missile Launcher"; + _item_names[@ index++] = "Multi-Melta"; + _item_names[@ index++] = "Autocannon"; + _item_names[@ index++] = "Plasma Gun"; + _item_names[@ index++] = "Plasma Pistol"; + _item_names[@ index++] = "Sniper Rifle"; + _item_names[@ index++] = "Storm Bolter"; + _item_names[@ index++] = "Webber"; // 23 +} + +/// @description This function returns the hard-coded list of melee weapons. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_marine_melee_weapons_item_names(_item_names) { + var item_count = 16; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Combat Knife"; + _item_names[@ index++] = "Chainsword"; + _item_names[@ index++] = "Chainaxe"; + _item_names[@ index++] = "Eviscerator"; + _item_names[@ index++] = "Power Sword"; + _item_names[@ index++] = "Power Axe"; + _item_names[@ index++] = "Power Fist"; + _item_names[@ index++] = "Chainfist"; + _item_names[@ index++] = "Lightning Claw"; + _item_names[@ index++] = "Force Staff"; + _item_names[@ index++] = "Thunder Hammer"; + _item_names[@ index++] = "Crozius Arcanum"; + _item_names[@ index++] = "Boarding Shield"; + _item_names[@ index++] = "Storm Shield"; + _item_names[@ index++] = "Bolt Pistol"; + _item_names[@ index++] = "Bolter"; // 16 +} + + +/// @description This function appends the list of marine armour items to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_marine_armour_item_names(_item_names) { + var item_count = 11; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Scout Armour"; + _item_names[@ index++] = "Power Armour"; + _item_names[@ index++] = "MK3 Iron Armour"; + _item_names[@ index++] = "MK4 Maximus"; + _item_names[@ index++] = "MK5 Heresy"; + _item_names[@ index++] = "MK6 Corvus"; + _item_names[@ index++] = "MK7 Aquila"; + _item_names[@ index++] = "MK8 Errant"; + _item_names[@ index++] = "Artificer Armour"; + _item_names[@ index++] = "Terminator Armour"; + _item_names[@ index++] = "Tartaros"; // 11 +} + +/// @description This function appends the list of marine gear items to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_marine_gear_item_names(_item_names) { + var item_count = 4; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + // _item_names[@ index++] = "Bionics"; + _item_names[@ index++] = "Iron Halo"; + _item_names[@ index++] = "Narthecium"; + _item_names[@ index++] = "Psychic Hood"; + _item_names[@ index++] = "Rosarius"; // 4 +} + +/// @description This function appends the list of marine mobility items to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_marine_mobility_item_names(_item_names) { + var item_count = 5; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Bike"; + _item_names[@ index++] = "Jump Pack"; + _item_names[@ index++] = "Heavy Weapons Pack"; + _item_names[@ index++] = "Servo-arm"; + _item_names[@ index++] = "Servo-harness"; // 5 +} + + +/// @description This function appends the list of dreadnought ranged weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_dreadnought_ranged_weapons_item_names(_item_names) { + var item_count = 10; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Multi-Melta"; + _item_names[@ index++] = "Twin Linked Heavy Flamer Sponsons"; + _item_names[@ index++] = "Plasma Cannon"; + _item_names[@ index++] = "Assault Cannon"; + _item_names[@ index++] = "Autocannon"; + _item_names[@ index++] = "Missile Launcher"; + _item_names[@ index++] = "Twin Linked Lascannon"; + _item_names[@ index++] = "Twin Linked Assault Cannon Mount"; + _item_names[@ index++] = "Twin Linked Heavy Bolter"; + _item_names[@ index++] = "Heavy Conversion Beam Projector"; // 10 +} + +/// @description This function appends the list of dreadnought melee weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_dreadnought_melee_weapons_item_names(_item_names) { + var item_count = 3; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Close Combat Weapon"; + _item_names[@ index++] = "Dreadnought Power Claw"; + _item_names[@ index++] = "Dreadnought Lightning Claw"; // 3 +} + +/// @description This function appends the list of land raider front weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_land_raider_front_weapons_item_names(_item_names) { + var item_count = 4; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Twin Linked Heavy Bolter Mount"; + _item_names[@ index++] = "Twin Linked Lascannon Mount"; + _item_names[@ index++] = "Twin Linked Assault Cannon Mount"; + _item_names[@ index++] = "Whirlwind Missiles"; // 4 +} + +/// @description This function appends the list of land raider relic front weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_land_raider_relic_front_weapons_item_names(_item_names) { + var item_count = 2; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + // _item_names[@ index++] = "Thunderfire Cannon Mount"; + _item_names[@ index++] = "Neutron Blaster Turret"; + _item_names[@ index++] = "Reaper Autocannon Mount"; // 2 + // _item_names[@ index++] = "Twin Linked Helfrost Cannon Mount"; + // _item_names[@ index++] = "Graviton Cannon Mount"; +} + +/// @description This function appends the list of land raider sponson weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_land_raider_regular_sponsons_item_names(_item_names) { + var item_count = 3; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Twin Linked Lascannon Sponsons"; + _item_names[@ index++] = "Hurricane Bolter Sponsons"; + _item_names[@ index++] = "Flamestorm Cannon Sponsons"; // 3 +} + +/// @description This function returns the hard-coded list of land raider relic sponsons. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_land_raider_relic_sponsons_item_names(_item_names) { + var item_count = 4; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Quad Linked Heavy Bolter Sponsons"; + _item_names[@ index++] = "Twin Linked Heavy Flamer Sponsons"; + _item_names[@ index++] = "Twin Linked Multi-Melta Sponsons"; + _item_names[@ index++] = "Twin Linked Volkite Culverin Sponsons"; // 4 +} + +/// @description This function appends the list of land raider pintle weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_land_raider_pintle_item_names(_item_names) { + var item_count = 5; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Bolter"; + _item_names[@ index++] = "Combiflamer"; + _item_names[@ index++] = "Twin Linked Bolters"; + _item_names[@ index++] = "Storm Bolter"; + _item_names[@ index++] = "HK Missile"; // 5 +} + +/// @description This function appends the list of rhino weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_rhino_weapons_item_names(_item_names) { + var item_count = 5; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Bolter"; + _item_names[@ index++] = "Combiflamer"; + _item_names[@ index++] = "Twin Linked Bolters"; + _item_names[@ index++] = "Storm Bolter"; + _item_names[@ index++] = "HK Missile"; // 5 +} + +/// @description This function appends the list of predator turret weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_predator_turret_item_names(_item_names) { + var item_count = 9; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Autocannon Turret"; + _item_names[@ index++] = "Twin Linked Lascannon Turret"; + _item_names[@ index++] = "Flamestorm Cannon Turret"; + _item_names[@ index++] = "Twin Linked Assault Cannon Turret"; + _item_names[@ index++] = "Magna-Melta Turret"; + _item_names[@ index++] = "Plasma Destroyer Turret"; + _item_names[@ index++] = "Heavy Conversion Beam Projector"; + _item_names[@ index++] = "Neutron Blaster Turret"; + _item_names[@ index++] = "Volkite Saker Turret"; // 9 + // _item_names[@ index++] = "Graviton Cannon Turret"; +} + +/// @description This function appends the list of predator sponson weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_predator_sponsons_item_names(_item_names) { + var item_count = 4; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Heavy Bolter Sponsons"; + _item_names[@ index++] = "Lascannon Sponsons"; + _item_names[@ index++] = "Heavy Flamer Sponsons"; + _item_names[@ index++] = "Volkite Culverin Sponsons"; // 4 +} + +/// @description This function appends the list of predator pintle weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_predator_pintle_item_names(_item_names) { + var item_count = 5; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Bolter"; + _item_names[@ index++] = "Combiflamer"; + _item_names[@ index++] = "Twin Linked Bolters"; + _item_names[@ index++] = "Storm Bolter"; + _item_names[@ index++] = "HK Missile"; // 5 +} + +/// @description This function appends the list of land speeder primary weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_land_speeder_primary_item_names(_item_names) { + var item_count = 2; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Multi-Melta"; + _item_names[@ index++] = "Heavy Bolter"; // 2 +} + +/// @description This function appends the list of land speeder secondary weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_land_speeder_secondary_item_names(_item_names) { + var item_count = 2; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Heavy Flamer"; + _item_names[@ index++] = "Assault Cannon"; // 2 +} + +/// @description This function appends the list of whirlwind missiles to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_whirlwind_missiles_item_names(_item_names) { + _item_names[@ array_length(_item_names)] = "Whirlwind Missiles"; +} + +/// @description This function appends the list of whirlwind pintle weapons to the given list. +/// @param {array} _item_names - The list to append to. +/// @returns {void} +function push_whirlwind_pintle_item_names(_item_names) { + var item_count = 5; + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + _item_names[@ index++] = "Bolter"; + _item_names[@ index++] = "Combiflamer"; + _item_names[@ index++] = "Twin Linked Bolters"; + _item_names[@ index++] = "Storm Bolter"; + _item_names[@ index++] = "HK Missile"; // 5 +} + +/// @description This function appends the list of tank upgrade items to the given list. +/// @param {array} _item_names - The list to append to. +/// @param {bool} _is_land_raider - Whether the tank is a land raider. +/// @returns {void} +function push_tank_upgrade_item_names(_item_names, _is_land_raider=false) { + var item_count = 3 + (_is_land_raider != 0); + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + // array_push(_item_names, "Armoured Ceramite"); + // array_push(_item_names, "Artificer Hull"); + // array_push(_item_names, "Heavy Armour"); + // if (_is_land_raider) { + // array_push(_item_names, "Void Shield"); + // } + _item_names[@ index++] = "Armoured Ceramite"; + _item_names[@ index++] = "Artificer Hull"; + _item_names[@ index++] = "Heavy Armour"; + if (_is_land_raider) { + _item_names[@ index++] = "Void Shield"; + } +} + +/// @description This function appends the list of tank accessory items to the given list. +/// @param {array} _item_names - The list to append to. +/// @param {bool} _is_land_raider - Whether the tank is a land raider. +/// @param {bool} _is_dreadnought - Whether the 'tank' is a dreadnought. +/// @returns {void} +function push_tank_accessory_item_names(_item_names, _is_land_raider=false, _is_dreadnought=false) { + var item_count = 3 + (!_is_dreadnought) + (!_is_land_raider && !_is_dreadnought); + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + item_count); + + var index = initial_size; + if (!_is_dreadnought) { + _item_names[@ index++] = "Dozer Blades"; + } + _item_names[@ index++] = "Searchlight"; + _item_names[@ index++] = "Smoke Launchers"; + _item_names[@ index++] = "Frag Assault Launchers"; + if (!_is_land_raider && !_is_dreadnought) { + _item_names[@ index++] = "Lucifer Pattern Engine"; + } +} + +/// @description Returns a list of equipment names filtered by given criteria. +/// @param {array} _item_names - The list of item names to append to. +/// @param {string} _equip_category - The category of equipment ("weapon", "armour", "gear", "mobility"). +/// @param {bool} _melee_or_ranged - Whether the equipment is melee or ranged. true for melee, false for ranged. +/// @param {bool} _is_master_crafted - Whether to include only master-crafted items. +/// @param {array} _required_tags - Tags that the equipment must have. +/// @param {array} _excluded_tags - Tags that the equipment must not have. +/// @param {bool} _with_none - Include "(None)" in the list. +/// @param {bool} _with_any - Include "(any)" in the list. +/// @returns {array} item_names - The filtered list of equipment names. +function get_filtered_equipment_item_names(_item_names, _equip_category, _melee_or_ranged, _is_master_crafted=false, _required_tags=undefined, _excluded_tags=undefined, _with_none=false, _with_any=false) { + get_none_or_any_item_names(_item_names, _with_none, _with_any); + + var matched_indexes = []; + + for (var _i = 0; _i < array_length(obj_ini.equipment); _i++) { + if (_is_master_crafted && !array_contains(obj_ini.equipment_quality[_i], "master_crafted")) { + continue; + } + + var equip_data = gear_weapon_data(_equip_category, obj_ini.equipment[_i]); + if (!is_struct(equip_data) || obj_ini.equipment_number[_i] <= 0) { + continue; + } + + if (_melee_or_ranged != undefined) { + if ((_melee_or_ranged && equip_data.range > 1.1) || (!_melee_or_ranged && equip_data.range <= 1.1)) { + continue; + } + } + + // Check required tags + var valid = true; + if (_required_tags != undefined) { + for (var _t = 0; _t < array_length(_required_tags); _t++) { + if (!equip_data.has_tag(_required_tags[_t])) { + valid = false; + break; + } + } + } + + // Check excluded tags + if (valid && _excluded_tags != undefined) { + for (var _t = 0; _t < array_length(_excluded_tags); _t++) { + if (equip_data.has_tag(_excluded_tags[_t])) { + valid = false; + break; + } + } + } + + if (valid) { + array_push(matched_indexes, _i); + } + } + + var initial_size = array_length(_item_names); + array_resize(_item_names, initial_size + array_length(matched_indexes)); + + var index = initial_size; + for (var j = 0; j < array_length(matched_indexes); j++) { + var equip_index = matched_indexes[j]; + var equip_data = gear_weapon_data(_equip_category, obj_ini.equipment[equip_index]); + _item_names[@ index++] = equip_data.name; + } + + return _item_names; +} + +enum eEQUIPMENT_TYPE { + None, + PrimaryWeapon = 1, // LeftHand, Turret, Front, Primary + SecondaryWeapon = 2, // RightHand, Sponson, Secondary + Armour = 3, + GearUpgrade = 4, + MobilityAccessory = 5 +} + +enum eENGAGEMENT { + None = 0, + Ranged = 1, // Regular land raider weapons + Melee = 2, // Relic land raider weapons + Any = 3 +} + +/// @description This function returns the name of the slot for a given role and slot number. +/// @param {eROLE} _role - The type of unit to equip, see eROLE. +/// @param {number} _slot - The equipment slot number, 1-5; for primary weapon, secondary weapon, armour, gear/upgrade, and mobility/accessory. +/// @returns {string} The name of the slot. +function get_slot_name(_role, _slot) { + switch (_role) { + case eROLE.ChapterMaster: + case eROLE.HonourGuard: + case eROLE.Veteran: + case eROLE.Terminator: + case eROLE.Captain: + case eROLE.Champion: + case eROLE.Tactical: + case eROLE.Devastator: + case eROLE.Assault: + case eROLE.Ancient: + case eROLE.Scout: + case eROLE.Chaplain: + case eROLE.Apothecary: + case eROLE.Techmarine: + case eROLE.Librarian: + case eROLE.Sergeant: + case eROLE.VeteranSergeant: + switch (_slot) { + case 1: return "First Weapon"; + case 2: return "Second Weapon"; + case 3: return "Armour"; + case 4: return "Gear"; + case 5: return "Mobility"; + default: return "Unknown"; + } + case eROLE.Dreadnought: + switch (_slot) { + case 1: return "First Weapon"; + case 2: return "Second Weapon"; + case 5: return "Accessory"; + default: return "Unknown"; + } + case eROLE.LandRaider: + switch (_slot) { + case 1: return "Front"; + case 2: return "Sponson"; + case 3: return "Pintle"; + case 4: return "Upgrade"; + case 5: return "Accessory"; + default: return "Unknown"; + } + case eROLE.Rhino: + switch (_slot) { + case 1: return "Weapon"; + case 4: return "Upgrade"; + case 5: return "Accessory"; + default: return "Unknown"; + } + case eROLE.Predator: + switch (_slot) { + case 1: return "Turret"; + case 2: return "Sponsons"; + case 3: return "Pintle"; + case 4: return "Upgrade"; + case 5: return "Accessory"; + default: return "Unknown"; + } + case eROLE.LandSpeeder: + switch (_slot) { + case 1: return "First Weapon"; + case 2: return "Second Weapon"; + default: return "Unknown"; + } + case eROLE.Whirlwind: + switch (_slot) { + case 1: return "Missiles"; + case 2: return "Pintle"; + case 4: return "Upgrade"; + case 5: return "Accessory"; + default: return "Unknown"; + } + default: + return "Unknown"; + } +} + +/// @description This function is used to populate the weapon/equipment selection list in the equipment screen. +/// @param {array} _item_names - The list of items to populate the selection list with. +/// @param {eROLE} _role - The role of the unit to equip, see eROLE. +/// @param {real} _slot - The slot number to populate, 1-5; for primary weapon, secondary weapon, armour, gear/upgrade, and mobility/accessory. +/// @param {eEngagement} _engagement - The desired engagement type to filter weapons by, see eEngagement. +/// @param {bool} _include_company_standard - Whether to include the Company Standard in the selection list. +/// @param {bool} _show_available_only - Whether to limit the selection to what is in inventory, or show all items. +/// @param {bool} _master_crafted_only - Whether to show only master crafted items, or hide them. +/// @param {bool} _skip_none - Omit the "(None)" option from the list. This help us avoid duplicates when combining range & melee hand weapons. +/// @returns {array} The list of items to populate the selection list with. +function scr_get_item_names(_item_names, _role, _slot, _engagement, _include_company_standard=false, _show_available_only=false, _master_crafted_only=false, _skip_none=false) { + if (_item_names == undefined) { + assert_error_popup("_item_names is undefined"); + return; + } + if (!is_array(_item_names)) { + assert_error_popup($"_item_names is not an array: {_item_names}"); + return; + } + + var _with_none_if_not_skip = _skip_none ? false : true; + + switch(_role) { + case eROLE.ChapterMaster: + case eROLE.HonourGuard: + case eROLE.Veteran: + case eROLE.Terminator: + case eROLE.Captain: + case eROLE.Champion: + case eROLE.Tactical: + case eROLE.Devastator: + case eROLE.Assault: + case eROLE.Ancient: + case eROLE.Scout: + case eROLE.Chaplain: + case eROLE.Apothecary: + case eROLE.Techmarine: + case eROLE.Librarian: + case eROLE.Sergeant: + case eROLE.VeteranSergeant: + switch (_slot) { + case 1: + case 2: + if (_engagement == eENGAGEMENT.Ranged) { + if (_show_available_only) { + get_filtered_equipment_item_names( + _item_names, + "weapon", + false, // ranged + _master_crafted_only, + undefined, // no required tags + ["vehicle"], // exclude vehicle weapons + _with_none_if_not_skip, + true // with_any + ); + } else { + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + push_marine_ranged_weapons_item_names(_item_names); + } + } else if (_engagement == eENGAGEMENT.Melee) { + if (_show_available_only) { + get_filtered_equipment_item_names( + _item_names, + "weapon", + true, // melee + _master_crafted_only, + undefined, // no required tags + ["vehicle"], // exclude vehicle weapons + _with_none_if_not_skip, + true // with_any + ); + if (_include_company_standard) { + _item_names[@ array_length(_item_names)] = "Company Standard"; + } + } else { + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + push_marine_melee_weapons_item_names(_item_names); + } + } else if (_engagement == eENGAGEMENT.Any) { + if (_show_available_only) { + get_filtered_equipment_item_names( + _item_names, + "weapon", + undefined, // no range filter + _master_crafted_only, + undefined, // no required tags + ["vehicle"], // exclude vehicle weapons + _with_none_if_not_skip, + true // with_any + ); + } else { + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + push_marine_ranged_weapons_item_names(_item_names); + push_marine_melee_weapons_item_names(_item_names); + } + } else { + assert_error_popup($"Invalid engagement enumerator for infantry: {_engagement}"); + return; + } + break; + case 3: + if (_show_available_only) { + _item_names = get_filtered_equipment_item_names( + _item_names, + "armour", + undefined, // no range filter + false, // not master crafted + undefined, // no required tags + ["vehicle"], // exclude vehicle armour + _with_none_if_not_skip, + true // with_any + ); + } else { + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + push_marine_armour_item_names(_item_names); + } + break; + case 4: + if (_show_available_only) { + get_filtered_equipment_item_names( + _item_names, + "gear", + undefined, // no range filter + false, // not master crafted + undefined, // no required tags + ["vehicle"], // exclude vehicle gear + _with_none_if_not_skip, + true // with_any + ); + } else { + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + push_marine_gear_item_names(_item_names); + } + break; + case 5: + if (_show_available_only) { + get_filtered_equipment_item_names( + _item_names, + "mobility", + undefined, // no range filter + false, // not master crafted + undefined, // no required tags + ["vehicle"], // exclude vehicle mobility + _with_none_if_not_skip, + true // with_any + ); + } else { + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + push_marine_mobility_item_names(_item_names); + } + break; + default: + assert_error_popup($"Invalid slot for infantry: {_slot}"); + return; + } + break; + case eROLE.Dreadnought: + switch (_slot) { + case 1: + case 2: + if (_engagement == eENGAGEMENT.Ranged) { + if (_show_available_only) { + get_filtered_equipment_item_names( + _item_names, + "weapon", + false, // ranged + _master_crafted_only, + ["dreadnought"], // required tags + undefined, // no excluded tags + _with_none_if_not_skip, + true // with_any + ); + } else { + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + push_dreadnought_ranged_weapons_item_names(_item_names); + } + } else if (_engagement == eENGAGEMENT.Melee) { + if (_show_available_only) { + get_filtered_equipment_item_names( + _item_names, + "weapon", + true, // melee + _master_crafted_only, + ["dreadnought"], // required tags + undefined, // no excluded tags + _with_none_if_not_skip, + true // with_any + ); + } else { + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + push_dreadnought_melee_weapons_item_names(_item_names); + } + } else if (_engagement == eENGAGEMENT.Any) { + if (_show_available_only) { + get_filtered_equipment_item_names( + _item_names, + "weapon", + undefined, // no range filter + _master_crafted_only, + ["dreadnought"], // required tags + undefined, // no excluded tags + _with_none_if_not_skip, + true // with_any + ); + } else { + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + push_dreadnought_ranged_weapons_item_names(_item_names); + push_dreadnought_melee_weapons_item_names(_item_names); + } + } else { + assert_error_popup($"Invalid engagement enumerator for dreadnought: {_engagement}"); + return; + } + break; + case 5: + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + push_tank_accessory_item_names(_item_names, false, true); + break; + case 3: + case 4: + // Dreadnought doesn't have these slots, but empty lists are shown in the UI + break; + default: + assert_error_popup($"Invalid slot for dreadnought: {_slot}"); + return; + } + break; + case eROLE.LandRaider: + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + switch (_slot) { + case 1: + if (_engagement == eENGAGEMENT.Ranged) { // Regular land raider weapons + push_land_raider_front_weapons_item_names(_item_names); + } else if (_engagement == eENGAGEMENT.Melee) { // Relic land raider weapons + push_land_raider_relic_front_weapons_item_names(_item_names); + } else if (_engagement == eENGAGEMENT.Any) { + push_land_raider_front_weapons_item_names(_item_names); + push_land_raider_relic_front_weapons_item_names(_item_names); + } else { + assert_error_popup($"Invalid engagement enumerator for land raider: {_engagement}"); + return; + } + break; + case 2: + if (_engagement == eENGAGEMENT.Ranged) { // Regular land raider weapons + push_land_raider_regular_sponsons_item_names(_item_names); + } else if (_engagement == eENGAGEMENT.Melee) { // Relic land raider weapons + push_land_raider_relic_sponsons_item_names(_item_names); + } else if (_engagement == eENGAGEMENT.Any) { + push_land_raider_regular_sponsons_item_names(_item_names); + push_land_raider_relic_sponsons_item_names(_item_names); + } else { + assert_error_popup($"Invalid engagement enumerator for land raider: {_engagement}"); + return; + } + break; + case 3: push_land_raider_pintle_item_names(_item_names); break; + case 4: push_tank_upgrade_item_names(_item_names, _with_none_if_not_skip); break; + case 5: push_tank_accessory_item_names(_item_names, _with_none_if_not_skip, false); break; + default: + assert_error_popup($"Invalid slot for land raider: {_slot}"); + return; + } + break; + case eROLE.Rhino: + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + switch (_slot) { + case 1: push_rhino_weapons_item_names(_item_names); break; + case 4: push_tank_upgrade_item_names(_item_names, false); break; + case 5: push_tank_accessory_item_names(_item_names, false, false); break; + case 2: + case 3: + // Rhino doesn't have these slots, but empty lists are shown in the UI + break; + default: + assert_error_popup($"Invalid slot for rhino: {_slot}"); + return; + } + break; + case eROLE.Predator: + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + switch (_slot) { + case 1: push_predator_turret_item_names(_item_names); break; + case 2: push_predator_sponsons_item_names(_item_names); break; + case 3: push_predator_pintle_item_names(_item_names); break; + case 4: push_tank_upgrade_item_names(_item_names, false); break; + case 5: push_tank_accessory_item_names(_item_names, false, false); break; + default: + assert_error_popup($"Invalid slot for predator: {_slot}"); + return; + } + break; + case eROLE.LandSpeeder: + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + switch (_slot) { + case 1: push_land_speeder_primary_item_names(_item_names); break; + case 2: push_land_speeder_secondary_item_names(_item_names); break; + case 4: + case 3: + case 5: + // Land speeder doesn't have these slots, but empty lists are shown in the UI + break; + default: + assert_error_popup($"Invalid slot for land speeder: {_slot}"); + return; + } + break; + case eROLE.Whirlwind: + get_none_or_any_item_names(_item_names, _with_none_if_not_skip, false); + switch (_slot) { + case 1: push_whirlwind_missiles_item_names(_item_names); break; + case 2: push_whirlwind_pintle_item_names(_item_names); break; + case 4: push_tank_upgrade_item_names(_item_names, false); break; + case 5: push_tank_accessory_item_names(_item_names, false, false); break; + case 3: + // Whirlwind doesn't have this slot, but an empty list is shown in the UI + break; + default: + assert_error_popup($"Invalid slot for whirlwind: {_slot}"); + return; + } + break; + } +} diff --git a/scripts/scr_weapons_equip/scr_weapons_equip.yy b/scripts/scr_get_item_names/scr_get_item_names.yy similarity index 86% rename from scripts/scr_weapons_equip/scr_weapons_equip.yy rename to scripts/scr_get_item_names/scr_get_item_names.yy index db1a3c6f5..d2f72f9ee 100644 --- a/scripts/scr_weapons_equip/scr_weapons_equip.yy +++ b/scripts/scr_get_item_names/scr_get_item_names.yy @@ -1,7 +1,7 @@ { "resourceType": "GMScript", "resourceVersion": "1.0", - "name": "scr_weapons_equip", + "name": "scr_get_item_names", "isCompatibility": false, "isDnD": false, "parent": { diff --git a/scripts/scr_ground_ai_helpers/scr_ground_ai_helpers.gml b/scripts/scr_ground_ai_helpers/scr_ground_ai_helpers.gml index d57739b4e..7f834040c 100644 --- a/scripts/scr_ground_ai_helpers/scr_ground_ai_helpers.gml +++ b/scripts/scr_ground_ai_helpers/scr_ground_ai_helpers.gml @@ -49,26 +49,6 @@ function planet_forces_array(planet){ return force_array; } -function guard_target_matrix(planet){ - guard_attack = ""; - // if (p_eldar[planet]>0) and (p_owner[planet]!=6) then guard_attack="eldar"; - //if (planet_forces[eFACTION.Tau] + planet_forces[eFACTION.Ork] + planet_forces[eFACTION.Heretics]+ planet_forces[eFACTION.Chaos]) - if (p_tau[planet]>0) then guard_attack="tau"; - if (p_orks[planet]>0) then guard_attack="ork"; - if (p_traitors[planet]>0) then guard_attack="traitors"; - if (p_chaos[planet]>0) then guard_attack="csm"; - if (p_pdf[planet]>0) and (p_owner[planet]=8) then guard_attack="pdf"; - - // Always goes after traitors first, unless - if (p_traitors[planet]<=1) and (p_tau[planet]>=4) and (p_owner[planet]!=8) then guard_attack="tau"; - if (p_pdf[planet]>0) and (obj_controller.faction_status[2]="War") and (p_owner[planet]=1) then guard_attack="pdf"; - if (p_traitors[planet]<=1) and (p_orks[planet]>=4) then guard_attack="ork"; - // if (p_tyranids[planet]>0) and (guard_attack="") then guard_attack="tyranids"; - if (p_tyranids[planet]>=4) then guard_attack="tyranids"; - - return guard_attack; -} - diff --git a/scripts/scr_has_adv/scr_has_adv.gml b/scripts/scr_has_adv/scr_has_adv.gml index 9d5dc204c..cc1c82a6f 100644 --- a/scripts/scr_has_adv/scr_has_adv.gml +++ b/scripts/scr_has_adv/scr_has_adv.gml @@ -1,5 +1,5 @@ /** - * @arg {String} advantage advantage name e.g. "Scavengers" + * @arg {String} advantage advantage name e.g. "Tech-Scavengers" * @return {Bool} */ function scr_has_adv(advantage){ diff --git a/scripts/scr_hit/scr_hit.gml b/scripts/scr_hit/scr_hit.gml index 2c33b5457..30ea2bb8f 100644 --- a/scripts/scr_hit/scr_hit.gml +++ b/scripts/scr_hit/scr_hit.gml @@ -28,13 +28,19 @@ function point_and_click(rect, cooldown = 60) { if (controller_exist && obj_controller.cooldown > 0) { show_debug_message("point_and_click: ignored click for cooldown, " + string(obj_controller.cooldown) + " steps remaining"); + show_debug_message($"{array_to_string_list(debug_get_callstack())}"); return false; } var click_check = point_in_rectangle(mouse_consts[0], mouse_consts[1], rect[0], rect[1],rect[2], rect[3]); - if (controller_exist && click_check) { + if (controller_exist && click_check && cooldown > 0) { + show_debug_message("scr_click_left: clicked and set cooldown!"); + show_debug_message($"{array_to_string_list(debug_get_callstack())}"); obj_controller.cooldown = cooldown * delta_time/1000000; } + if(is_debug_overlay_open()){ + show_debug_message($"mouse coords x: {mouse_consts[0]} y: {mouse_consts[1]}") + } return click_check; } @@ -49,8 +55,11 @@ function scr_click_left(cooldown = 60){ if (controller_exist && obj_controller.cooldown > 0) { show_debug_message("scr_click_left: ignored click for cooldown, " + string(obj_controller.cooldown) + " steps remaining"); + show_debug_message($"{array_to_string_list(debug_get_callstack())}"); return false; - } else if (controller_exist) { + } else if (controller_exist && cooldown > 0) { + show_debug_message("scr_click_left: clicked and set cooldown!"); + show_debug_message($"{array_to_string_list(debug_get_callstack())}"); obj_controller.cooldown = cooldown * delta_time/1000000; } diff --git a/scripts/scr_image/scr_image.gml b/scripts/scr_image/scr_image.gml index a6d61499a..6b534cd67 100644 --- a/scripts/scr_image/scr_image.gml +++ b/scripts/scr_image/scr_image.gml @@ -1,4 +1,13 @@ -function scr_image(argument0, argument1, argument2, argument3, argument4, argument5) { +/// @description Draws a png image. Example: +/// `scr_image("creation/chapters/icons", 1, 450, 250, 32, 32);` +/// For actual sprites with multiple frames, don't use this. +/// @param {String} path the file path after 'images' in the 'datafiles' folder. e.g. "creation/chapters/icons" +/// @param {Real} image_id the name of the image. Convention follows using numbers, e.g. "1.png", so that loops are useful, and it can be stored at it's own array index in the cache. +/// @param {Real} x1 the x coordinates to start drawing +/// @param {Real} y1 the y coordinates to start drawing +/// @param {Real} width the width of the image +/// @param {Real} height the height of the image +function scr_image(path, image_id, x1, y1, width, height) { // argument0: keyword // argument1: number @@ -6,112 +15,151 @@ function scr_image(argument0, argument1, argument2, argument3, argument4, argume // argument3: y1 // argument4: width // argument5: height - //TODO rewrite this file if (!instance_exists(obj_img)) then exit; + /// First attempt at the a new method of image loading logic to do away with 500 lines of madness. + /// Any image loaded from the filesystem to be drawn as a sprite should be saved to some sort of cache so that it + /// only ever has to load from disk once. We are using the `obj_img` object to store this cache in the format below: + /// img_cache: { + /// "creation/chapters": [somesprite1, somesprite2, ...], + /// "some/path": [-1, -1, somesprite3], + /// } + /// The key is the folder path, its value will be an array. + /// The image_id passed will be used to index the array where the sprite is stored. + /// i.e. if `scr_image("some/path", 1, ...);` is used, then the "some/path" key will have an array [-1, sprite1] + /// where sprite1 is loaded from "/images/some/path/1.png" + /// Converting to the new method will require renaming images and redoing folder structure where it makes sense, + /// and composite images like `chapter_icons.png` need to be broken up into separate pngs. + /// One notable thing missing is any sprite_delete handling, that may require it's own separate function. + if(string_count("/", path) > 0){ + var old_alpha = draw_get_alpha(); + var old_color = draw_get_color(); + var drawing_sprite = scr_image_cache(path, image_id); + + // Draws the red box with a X through it + if(is_undefined(drawing_sprite) || !sprite_exists(drawing_sprite)){ + draw_set_alpha(1);draw_set_color(0); + draw_rectangle(x1,y1,x1+width,y1+height,0); + draw_set_color(c_red); + draw_rectangle(x1,y1,x1+width,y1+height,1); + draw_rectangle(x1+1,y1+1,x1+width-1,y1+height-1,1); + draw_rectangle(x1+2,y1+2,x1+width-2,y1+height-2,1); + draw_line_width(x1+1.5,y1+1.5,x1+width-1.5,y1+height-1.5,3); + draw_line_width(x1+width-1.5,y1+1.5,x1+1.5,y1+height-1.5,3); + draw_set_color(c_black); + return; + } + // Draws the real image if we found it + draw_sprite_stretched(drawing_sprite,1,x1,y1,width,height); + + draw_set_alpha(old_alpha); + draw_set_color(old_color); + return; + } + - if (argument1<=-666) or (argument1=666){with(obj_img){// Clear out these images + if (image_id<=-666) or (image_id=666){with(obj_img){// Clear out these images var i,single_image;i=-1;single_image=false; - if (argument0="creation") or (argument0="all") or (argument0=""){creation_good=false;single_image=true;} - if (argument0="main_splash") or (argument0="existing_splash") or (argument0="other_splash") or (argument0="all") or (argument0="") then splash_good=false; - if (argument0="advisor") or (argument0="all") or (argument0="") then advisor_good=false; - if (argument0="diplomacy_splash") or (argument0="all") or (argument0="") then diplomacy_splash_good=false; - if (argument0="diplomacy_daemon") or (argument0="all") or (argument0="") then diplomacy_daemon_good=false; - if (argument0="diplomacy_icon") or (argument0="all") or (argument0=""){diplomacy_icon_good=false;single_image=true;} - if (argument0="menu") or (argument0="all") or (argument0=""){menu_good=false;single_image=true;} - if (argument0="loading") or (argument0="all") or (argument0="") then loading_good=false; - if (argument0="postbattle") or (argument0="all") or (argument0="") then postbattle_good=false; - if (argument0="postspace") or (argument0="all") or (argument0="") then postspace_good=false; - if (argument0="formation") or (argument0="all") or (argument0="") then formation_good=false; - if (argument0="popup") or (argument0="all") or (argument0="") then popup_good=false; - if (argument0="commander") or (argument0="all") or (argument0="") then commander_good=false; - if (argument0="planet") or (argument0="all") or (argument0="") then planet_good=false; - if (argument0="attacked") or (argument0="all") or (argument0="") then attacked_good=false; - if (argument0="force") or (argument0="all") or (argument0="") then force_good=false; - if (argument0="purge") or (argument0="all") or (argument0="") then purge_good=false; - if (argument0="event") or (argument0="all") or (argument0="") then event_good=false; - if (argument0="title_splash") or (argument0="all") or (argument0="") then title_splash_good=false; - if (argument0="symbol") or (argument0="all") or (argument0="") then symbol_good=false; - if (argument0="defeat") or (argument0="all") or (argument0="") then defeat_good=false; - if (argument0="slate") or (argument0="all") or (argument0="") then slate_good=false; + if (path="creation") or (path="all") or (path=""){creation_good=false;single_image=true;} + if (path="main_splash") or (path="existing_splash") or (path="other_splash") or (path="all") or (path="") then splash_good=false; + if (path="advisor") or (path="all") or (path="") then advisor_good=false; + if (path="diplomacy_splash") or (path="all") or (path="") then diplomacy_splash_good=false; + if (path="diplomacy_daemon") or (path="all") or (path="") then diplomacy_daemon_good=false; + if (path="diplomacy_icon") or (path="all") or (path=""){diplomacy_icon_good=false;single_image=true;} + if (path="menu") or (path="all") or (path=""){menu_good=false;single_image=true;} + if (path="loading") or (path="all") or (path="") then loading_good=false; + if (path="postbattle") or (path="all") or (path="") then postbattle_good=false; + if (path="postspace") or (path="all") or (path="") then postspace_good=false; + if (path="formation") or (path="all") or (path="") then formation_good=false; + if (path="popup") or (path="all") or (path="") then popup_good=false; + if (path="commander") or (path="all") or (path="") then commander_good=false; + if (path="planet") or (path="all") or (path="") then planet_good=false; + if (path="attacked") or (path="all") or (path="") then attacked_good=false; + if (path="force") or (path="all") or (path="") then force_good=false; + if (path="purge") or (path="all") or (path="") then purge_good=false; + if (path="event") or (path="all") or (path="") then event_good=false; + if (path="title_splash") or (path="all") or (path="") then title_splash_good=false; + if (path="symbol") or (path="all") or (path="") then symbol_good=false; + if (path="defeat") or (path="all") or (path="") then defeat_good=false; + if (path="slate") or (path="all") or (path="") then slate_good=false; repeat(80){i+=1; - if ((argument0="creation") or (argument0="all") or (argument0="")) and (creation_exists[i]>0) and (sprite_exists(creation[i])){ + if ((path="creation") or (path="all") or (path="")) and (creation_exists[i]>0) and (sprite_exists(creation[i])){ sprite_delete(creation[i]);creation_exists[i]=-1;creation[i]=0; } - if ((argument0="main_splash") or (argument0="all") or (argument0="")){ + if ((path="main_splash") or (path="all") or (path="")){ if (main_exists[i]>0) and (sprite_exists(main[i])){sprite_delete(main[i]);main_exists[i]=-1;main[i]=0;} } - if ((argument0="existing_splash") or (argument0="all") or (argument0="")){ + if ((path="existing_splash") or (path="all") or (path="")){ if (existing_exists[i]>0) and (sprite_exists(existing[i])){sprite_delete(existing[i]);existing_exists[i]=-1;existing[i]=0;} } - if ((argument0="other_splash") or (argument0="all") or (argument0="")){ + if ((path="other_splash") or (path="all") or (path="")){ if (others_exists[i]>0) and (sprite_exists(others[i])){sprite_delete(others[i]);others_exists[i]=-1;others[i]=0;} } - if ((argument0="advisor") or (argument0="all") or (argument0="")) and (advisor_exists[i]>0) and (sprite_exists(advisor[i])){ + if ((path="advisor") or (path="all") or (path="")) and (advisor_exists[i]>0) and (sprite_exists(advisor[i])){ sprite_delete(advisor[i]);advisor_exists[i]=-1;advisor[i]=0; } - if ((argument0="diplomacy_splash") or (argument0="all") or (argument0="")) and (diplomacy_splash_exists[i]>0) and (sprite_exists(diplomacy_splash[i])){ + if ((path="diplomacy_splash") or (path="all") or (path="")) and (diplomacy_splash_exists[i]>0) and (sprite_exists(diplomacy_splash[i])){ sprite_delete(diplomacy_splash[i]);diplomacy_splash_exists[i]=-1;diplomacy_splash[i]=0; } - if ((argument0="diplomacy_daemon") or (argument0="all") or (argument0="")) and (diplomacy_daemon_exists[i]>0) and (sprite_exists(diplomacy_daemon[i])){ + if ((path="diplomacy_daemon") or (path="all") or (path="")) and (diplomacy_daemon_exists[i]>0) and (sprite_exists(diplomacy_daemon[i])){ sprite_delete(diplomacy_daemon[i]);diplomacy_daemon_exists[i]=-1;diplomacy_daemon[i]=0; } - if ((argument0="diplomacy_icon") or (argument0="all") or (argument0="")) and (diplomacy_icon_exists[i]>0) and (sprite_exists(diplomacy_icon[i])){ + if ((path="diplomacy_icon") or (path="all") or (path="")) and (diplomacy_icon_exists[i]>0) and (sprite_exists(diplomacy_icon[i])){ sprite_delete(diplomacy_icon[i]);diplomacy_icon_exists[i]=-1;diplomacy_icon[i]=0; } - if ((argument0="menu") or (argument0="all") or (argument0="")) and (menu_exists[i]>0) and (sprite_exists(menu[i])){ + if ((path="menu") or (path="all") or (path="")) and (menu_exists[i]>0) and (sprite_exists(menu[i])){ sprite_delete(menu[i]);menu_exists[i]=-1;menu[i]=0; } - if ((argument0="loading") or (argument0="all") or (argument0="")) and (loading_exists[i]>0) and (sprite_exists(loading[i])){ + if ((path="loading") or (path="all") or (path="")) and (loading_exists[i]>0) and (sprite_exists(loading[i])){ sprite_delete(loading[i]);loading_exists[i]=-1;loading[i]=0; } - if ((argument0="postbattle") or (argument0="all") or (argument0="")) and (postbattle_exists[i]>0) and (sprite_exists(postbattle[i])){ + if ((path="postbattle") or (path="all") or (path="")) and (postbattle_exists[i]>0) and (sprite_exists(postbattle[i])){ sprite_delete(postbattle[i]);postbattle_exists[i]=-1;postbattle[i]=0; } - if ((argument0="postspace") or (argument0="all") or (argument0="")) and (postspace_exists[i]>0) and (sprite_exists(postspace[i])){ + if ((path="postspace") or (path="all") or (path="")) and (postspace_exists[i]>0) and (sprite_exists(postspace[i])){ sprite_delete(postspace[i]);postspace_exists[i]=-1;postspace[i]=0; } - if ((argument0="formation") or (argument0="all") or (argument0="")) and (formation_exists[i]>0) and (sprite_exists(formation[i])){ + if ((path="formation") or (path="all") or (path="")) and (formation_exists[i]>0) and (sprite_exists(formation[i])){ sprite_delete(formation[i]);formation_exists[i]=-1;formation[i]=0; } - if ((argument0="popup") or (argument0="all") or (argument0="")) and (popup_exists[i]>0) and (sprite_exists(popup[i])){ + if ((path="popup") or (path="all") or (path="")) and (popup_exists[i]>0) and (sprite_exists(popup[i])){ sprite_delete(popup[i]);popup_exists[i]=-1;popup[i]=0; } - if ((argument0="commander") or (argument0="all") or (argument0="")) and (commander_exists[i]>0) and (sprite_exists(commander[i])){ + if ((path="commander") or (path="all") or (path="")) and (commander_exists[i]>0) and (sprite_exists(commander[i])){ sprite_delete(commander[i]);commander_exists[i]=-1;commander[i]=0; } - if ((argument0="planet") or (argument0="all") or (argument0="")) and (planet_exists[i]>0) and (sprite_exists(planet[i])){ + if ((path="planet") or (path="all") or (path="")) and (planet_exists[i]>0) and (sprite_exists(planet[i])){ sprite_delete(planet[i]);planet_exists[i]=-1;planet[i]=0; } - if ((argument0="attacked") or (argument0="all") or (argument0="")) and (attacked_exists[i]>0) and (sprite_exists(attacked[i])){ + if ((path="attacked") or (path="all") or (path="")) and (attacked_exists[i]>0) and (sprite_exists(attacked[i])){ sprite_delete(attacked[i]);attacked_exists[i]=-1;attacked[i]=0; } - if ((argument0="force") or (argument0="all") or (argument0="")) and (force_exists[i]>0) and (sprite_exists(force[i])){ + if ((path="force") or (path="all") or (path="")) and (force_exists[i]>0) and (sprite_exists(force[i])){ sprite_delete(force[i]);force_exists[i]=-1;force[i]=0; } - if ((argument0="purge") or (argument0="all") or (argument0="")) and (purge_exists[i]>0) and (sprite_exists(purge[i])){ + if ((path="purge") or (path="all") or (path="")) and (purge_exists[i]>0) and (sprite_exists(purge[i])){ sprite_delete(purge[i]);purge_exists[i]=-1;purge[i]=0; } - if ((argument0="event") or (argument0="all") or (argument0="")) and (event_exists[i]>0) and (sprite_exists(event[i])){ + if ((path="event") or (path="all") or (path="")) and (event_exists[i]>0) and (sprite_exists(event[i])){ sprite_delete(event[i]);event_exists[i]=-1;event[i]=0; } - if ((argument0="title_splash") or (argument0="all") or (argument0="")){ + if ((path="title_splash") or (path="all") or (path="")){ if (title_splash_exists[i]>0) and (sprite_exists(title_splash[i])){sprite_delete(title_splash[i]);title_splash_exists[i]=-1;title_splash[i]=0;} } - if ((argument0="symbol") or (argument0="all") or (argument0="")){ + if ((path="symbol") or (path="all") or (path="")){ if (symbol_exists[i]>0) and (sprite_exists(symbol[i])){sprite_delete(symbol[i]);symbol_exists[i]=-1;symbol[i]=0;} } - if ((argument0="defeat") or (argument0="all") or (argument0="")){ + if ((path="defeat") or (path="all") or (path="")){ if (defeat_exists[i]>0) and (sprite_exists(defeat[i])){sprite_delete(defeat[i]);defeat_exists[i]=-1;defeat[i]=0;} } - if ((argument0="slate") or (argument0="all") or (argument0="")){ + if ((path="slate") or (path="all") or (path="")){ if (slate_exists[i]>0) and (sprite_exists(slate[i])){sprite_delete(slate[i]);slate_exists[i]=-1;slate[i]=0;} } @@ -120,119 +168,119 @@ function scr_image(argument0, argument1, argument2, argument3, argument4, argume }} - if (argument1>-600) and (argument1<0){with(obj_img){// Initialize these images + if (image_id>-600) and (image_id<0){with(obj_img){// Initialize these images var i,single_image;i=-1;single_image=false; repeat(80){i+=1; - if (argument0="creation") and (creation_exists[i]>0) and (sprite_exists(creation[i])){ + if (path="creation") and (creation_exists[i]>0) and (sprite_exists(creation[i])){ sprite_delete(creation[i]);creation_exists[i]=-1;creation[i]=0; } - if (argument0="splash"){ + if (path="splash"){ if (main_exists[i]>0) and (sprite_exists(main[i])){sprite_delete(main[i]);main_exists[i]=-1;main[i]=0;} if (existing_exists[i]>0) and (sprite_exists(existing[i])){sprite_delete(existing[i]);existing_exists[i]=-1;existing[i]=0;} if (others_exists[i]>0) and (sprite_exists(others[i])){sprite_delete(others[i]);others_exists[i]=-1;others[i]=0;} } - if (argument0="advisor") and (advisor_exists[i]>0) and (sprite_exists(advisor[i])){ + if (path="advisor") and (advisor_exists[i]>0) and (sprite_exists(advisor[i])){ sprite_delete(advisor[i]);advisor_exists[i]=-1;advisor[i]=0; } - if (argument0="diplomacy_splash") and (diplomacy_splash_exists[i]>0) and (sprite_exists(diplomacy_splash[i])){ + if (path="diplomacy_splash") and (diplomacy_splash_exists[i]>0) and (sprite_exists(diplomacy_splash[i])){ sprite_delete(diplomacy_splash[i]);diplomacy_splash_exists[i]=-1;diplomacy_splash[i]=0; } - if (argument0="diplomacy_daemon") and (diplomacy_daemon_exists[i]>0) and (sprite_exists(diplomacy_daemon[i])){ + if (path="diplomacy_daemon") and (diplomacy_daemon_exists[i]>0) and (sprite_exists(diplomacy_daemon[i])){ sprite_delete(diplomacy_daemon[i]);diplomacy_daemon_exists[i]=-1;diplomacy_daemon[i]=0; } - if (argument0="diplomacy_icon") and (diplomacy_icon_exists[i]>0) and (sprite_exists(diplomacy_icon[i])){ + if (path="diplomacy_icon") and (diplomacy_icon_exists[i]>0) and (sprite_exists(diplomacy_icon[i])){ sprite_delete(diplomacy_icon[i]);diplomacy_icon_exists[i]=-1;diplomacy_icon[i]=0; } - if (argument0="menu") and (menu_exists[i]>0) and (sprite_exists(menu[i])){ + if (path="menu") and (menu_exists[i]>0) and (sprite_exists(menu[i])){ sprite_delete(menu[i]);menu_exists[i]=-1;menu[i]=0; } - if (argument0="loading") and (loading_exists[i]>0) and (sprite_exists(loading[i])){ + if (path="loading") and (loading_exists[i]>0) and (sprite_exists(loading[i])){ sprite_delete(loading[i]);loading_exists[i]=-1;loading[i]=0; } - if (argument0="postbattle") and (postbattle_exists[i]>0) and (sprite_exists(postbattle[i])){ + if (path="postbattle") and (postbattle_exists[i]>0) and (sprite_exists(postbattle[i])){ sprite_delete(postbattle[i]);postbattle_exists[i]=-1;postbattle[i]=0; } - if (argument0="postspace") and (postspace_exists[i]>0) and (sprite_exists(postspace[i])){ + if (path="postspace") and (postspace_exists[i]>0) and (sprite_exists(postspace[i])){ sprite_delete(postspace[i]);postspace_exists[i]=-1;postspace[i]=0; } - if (argument0="formation") and (formation_exists[i]>0) and (sprite_exists(formation[i])){ + if (path="formation") and (formation_exists[i]>0) and (sprite_exists(formation[i])){ sprite_delete(formation[i]);formation_exists[i]=-1;formation[i]=0; } - if (argument0="popup") and (popup_exists[i]>0) and (sprite_exists(popup[i])){ + if (path="popup") and (popup_exists[i]>0) and (sprite_exists(popup[i])){ sprite_delete(popup[i]);popup_exists[i]=-1;popup[i]=0; } - if (argument0="commander") and (commander_exists[i]>0) and (sprite_exists(commander[i])){ + if (path="commander") and (commander_exists[i]>0) and (sprite_exists(commander[i])){ sprite_delete(commander[i]);commander_exists[i]=-1;commander[i]=0; } - if (argument0="planet") and (planet_exists[i]>0) and (sprite_exists(planet[i])){ + if (path="planet") and (planet_exists[i]>0) and (sprite_exists(planet[i])){ sprite_delete(planet[i]);planet_exists[i]=-1;planet[i]=0; } - if (argument0="attacked") and (attacked_exists[i]>0) and (sprite_exists(attacked[i])){ + if (path="attacked") and (attacked_exists[i]>0) and (sprite_exists(attacked[i])){ sprite_delete(attacked[i]);attacked_exists[i]=-1;attacked[i]=0; } - if (argument0="force") and (force_exists[i]>0) and (sprite_exists(force[i])){ + if (path="force") and (force_exists[i]>0) and (sprite_exists(force[i])){ sprite_delete(force[i]);force_exists[i]=-1;force[i]=0; } - if (argument0="purge") and (purge_exists[i]>0) and (sprite_exists(purge[i])){ + if (path="purge") and (purge_exists[i]>0) and (sprite_exists(purge[i])){ sprite_delete(purge[i]);purge_exists[i]=-1;purge[i]=0; } - if (argument0="event") and (event_exists[i]>0) and (sprite_exists(event[i])){ + if (path="event") and (event_exists[i]>0) and (sprite_exists(event[i])){ sprite_delete(event[i]);event_exists[i]=-1;event[i]=0; } - if (argument0="title_splash") and (title_splash_exists[i]>0) and (sprite_exists(title_splash[i])){ + if (path="title_splash") and (title_splash_exists[i]>0) and (sprite_exists(title_splash[i])){ sprite_delete(title_splash[i]);title_splash_exists[i]=-1;title_splash[i]=0; } - if (argument0="symbol") and (symbol_exists[i]>0) and (sprite_exists(symbol[i])){ + if (path="symbol") and (symbol_exists[i]>0) and (sprite_exists(symbol[i])){ sprite_delete(symbol[i]);symbol_exists[i]=-1;symbol[i]=0; } - if (argument0="defeat") and (defeat_exists[i]>0) and (sprite_exists(defeat[i])){ + if (path="defeat") and (defeat_exists[i]>0) and (sprite_exists(defeat[i])){ sprite_delete(defeat[i]);defeat_exists[i]=-1;defeat[i]=0; } - if (argument0="slate") and (slate_exists[i]>0) and (sprite_exists(slate[i])){ + if (path="slate") and (slate_exists[i]>0) and (sprite_exists(slate[i])){ sprite_delete(slate[i]);slate_exists[i]=-1;slate[i]=0; } } - if (argument0="creation"){creation_good=false;single_image=true;} - if (argument0="main_splash") or (argument0="existing_splash") or (argument0="other_splash") then splash_good=false; - if (argument0="advisor") then advisor_good=false; - if (argument0="diplomacy_splash") then diplomacy_splash_good=false; - if (argument0="diplomacy_daemon") then diplomacy_daemon_good=false; - if (argument0="diplomacy_icon"){diplomacy_icon_good=false;single_image=true;} - if (argument0="menu"){menu_good=false;single_image=true;} - if (argument0="loading") then loading_good=false; - if (argument0="postbattle") then postbattle_good=false; - if (argument0="postspace") then postspace_good=false; - if (argument0="formation") then formation_good=false; - if (argument0="popup") then popup_good=false; - if (argument0="commander") then commander_good=false; - if (argument0="planet") then planet_good=false; - if (argument0="attacked") then attacked_good=false; - if (argument0="force") then force_good=false; - if (argument0="purge") then purge_good=false; - if (argument0="event") then event_good=false; - if (argument0="title_splash"){title_splash_good=false;single_image=true;} - if (argument0="symbol") then symbol_good=false; - if (argument0="defeat") then defeat_good=false; - if (argument0="slate") then slate_good=false; + if (path="creation"){creation_good=false;single_image=true;} + if (path="main_splash") or (path="existing_splash") or (path="other_splash") then splash_good=false; + if (path="advisor") then advisor_good=false; + if (path="diplomacy_splash") then diplomacy_splash_good=false; + if (path="diplomacy_daemon") then diplomacy_daemon_good=false; + if (path="diplomacy_icon"){diplomacy_icon_good=false;single_image=true;} + if (path="menu"){menu_good=false;single_image=true;} + if (path="loading") then loading_good=false; + if (path="postbattle") then postbattle_good=false; + if (path="postspace") then postspace_good=false; + if (path="formation") then formation_good=false; + if (path="popup") then popup_good=false; + if (path="commander") then commander_good=false; + if (path="planet") then planet_good=false; + if (path="attacked") then attacked_good=false; + if (path="force") then force_good=false; + if (path="purge") then purge_good=false; + if (path="event") then event_good=false; + if (path="title_splash"){title_splash_good=false;single_image=true;} + if (path="symbol") then symbol_good=false; + if (path="defeat") then defeat_good=false; + if (path="slate") then slate_good=false; if (single_image=true){ - if (argument0="creation") and (file_exists(working_directory + "\\images\\creation\\creation_icons.png")){ - creation[1]=sprite_add(working_directory + "\\images\\creation\\creation_icons.png",23,false,false,0,0);creation_exists[1]=true;creation_good=true; + if (path="creation") and (file_exists(working_directory + "\\images\\creation\\creation_icons.png")){ + creation[1]=sprite_add(working_directory + "\\images\\creation\\creation_icons.png",24,false,false,0,0);creation_exists[1]=true;creation_good=true; } - if (argument0="diplomacy_icon") and (file_exists(working_directory + "\\images\\diplomacy\\diplomacy_icons.png")){ + if (path="diplomacy_icon") and (file_exists(working_directory + "\\images\\diplomacy\\diplomacy_icons.png")){ diplomacy_icon[1]=sprite_add(working_directory + "\\images\\diplomacy\\diplomacy_icons.png",28,false,false,0,0);diplomacy_icon_exists[1]=true;diplomacy_icon_good=true; } - if (argument0="menu") and (file_exists(working_directory + "\\images\\ui\\ingame_menu.png")){ + if (path="menu") and (file_exists(working_directory + "\\images\\ui\\ingame_menu.png")){ menu[1]=sprite_add(working_directory + "\\images\\ui\\ingame_menu.png",2,false,false,0,0);menu_exists[1]=true;menu_good=true; } - if (argument0="title_splash") and (file_exists(working_directory + "\\images\\title_splash.png")){ + if (path="title_splash") and (file_exists(working_directory + "\\images\\title_splash.png")){ title_splash[1]=sprite_add(working_directory + "\\images\\title_splash.png",1,false,false,0,0);title_splash_exists[1]=true;title_splash_good=true; } } @@ -241,103 +289,103 @@ function scr_image(argument0, argument1, argument2, argument3, argument4, argume var i,w;i=0;w=0; repeat(40){i+=1; - if (argument0="main_splash"){ + if (path="main_splash"){ if (file_exists(working_directory + "\\images\\creation\\main"+string(i)+".png")){ main[i-1]=sprite_add(working_directory + "\\images\\creation\\main"+string(i)+".png",1,false,false,0,0);main_exists[i-1]=1;w+=1; } if (w>0) then splash_good=true; } - if (argument0="existing_splash"){ + if (path="existing_splash"){ if (file_exists(working_directory + "\\images\\creation\\existing"+string(i)+".png")){ existing[i-1]=sprite_add(working_directory + "\\images\\creation\\existing"+string(i)+".png",1,false,false,0,0);existing_exists[i-1]=1;w+=1; } if (w>0) then splash_good=true; } - if (argument0="other_splash"){ + if (path="other_splash"){ if (file_exists(working_directory + "\\images\\creation\\other"+string(i)+".png")){ others[i-1]=sprite_add(working_directory + "\\images\\creation\\other"+string(i)+".png",1,false,false,0,0);others_exists[i-1]=1;w+=1; } if (w>0) then splash_good=true; } - if (argument0="advisor"){ + if (path="advisor"){ if (file_exists(working_directory + "\\images\\diplomacy\\advisor"+string(i)+".png")){ advisor[i-1]=sprite_add(working_directory + "\\images\\diplomacy\\advisor"+string(i)+".png",1,false,false,0,0);advisor_exists[i-1]=1;w+=1; } if (w>0) then advisor_good=true; } - if (argument0="diplomacy_splash"){ + if (path="diplomacy_splash"){ if (file_exists(working_directory + "\\images\\diplomacy\\diplomacy"+string(i)+".png")){ diplomacy_splash[i-1]=sprite_add(working_directory + "\\images\\diplomacy\\diplomacy"+string(i)+".png",1,false,false,0,0);diplomacy_splash_exists[i-1]=1;w+=1; } if (w>0) then diplomacy_splash_good=true; } - if (argument0="diplomacy_daemon"){ + if (path="diplomacy_daemon"){ if (file_exists(working_directory + "\\images\\diplomacy\\daemon"+string(i)+".png")){ diplomacy_daemon[i-1]=sprite_add(working_directory + "\\images\\diplomacy\\daemon"+string(i)+".png",1,false,false,0,0);diplomacy_daemon_exists[i-1]=1;w+=1; } if (w>0) then diplomacy_daemon_good=true; } // loading screen error arg - if (argument0="loading"){ + if (path="loading"){ if (file_exists(working_directory + "\\images\\loading\\loading"+string(i)+".png")){ loading[i-1]=sprite_add(working_directory + "\\images\\loading\\loading"+string(i)+".png",1,false,false,0,0);loading_exists[i-1]=1;w+=1; } if (w>0) then loading_good=true; } - if (argument0="postbattle"){ + if (path="postbattle"){ if (file_exists(working_directory + "\\images\\ui\\postbattle"+string(i)+".png")){ postbattle[i-1]=sprite_add(working_directory + "\\images\\ui\\postbattle"+string(i)+".png",1,false,false,0,0);postbattle_exists[i-1]=1;w+=1; } if (w>0) then postbattle_good=true; } - if (argument0="postspace"){ + if (path="postspace"){ if (file_exists(working_directory + "\\images\\ui\\postspace"+string(i)+".png")){ postspace[i-1]=sprite_add(working_directory + "\\images\\ui\\postspace"+string(i)+".png",1,false,false,0,0);postspace_exists[i-1]=1;w+=1; } if (w>0) then postspace_good=true; } - if (argument0="formation"){ + if (path="formation"){ if (file_exists(working_directory + "\\images\\ui\\formation"+string(i)+".png")){ formation[i-1]=sprite_add(working_directory + "\\images\\ui\\formation"+string(i)+".png",1,false,false,0,0);formation_exists[i-1]=1;w+=1; } if (w>0) then formation_good=true; } - if (argument0="popup"){ + if (path="popup"){ if (file_exists(working_directory + "\\images\\popup\\popup"+string(i)+".png")){ popup[i-1]=sprite_add(working_directory + "\\images\\popup\\popup"+string(i)+".png",1,false,false,0,0);popup_exists[i-1]=1;w+=1; } if (w>0) then popup_good=true; } - if (argument0="commander"){ + if (path="commander"){ if (file_exists(working_directory + "\\images\\ui\\commander"+string(i)+".png")){ commander[i-1]=sprite_add(working_directory + "\\images\\ui\\commander"+string(i)+".png",1,false,false,0,0);commander_exists[i-1]=1;w+=1; } if (w>0) then commander_good=true; } - if (argument0="planet"){ + if (path="planet"){ if (file_exists(working_directory + "\\images\\ui\\planet"+string(i)+".png")){ planet[i-1]=sprite_add(working_directory + "\\images\\ui\\planet"+string(i)+".png",1,false,false,0,0);planet_exists[i-1]=1;w+=1; } if (w>0) then planet_good=true; } - if (argument0="attacked"){ + if (path="attacked"){ if (file_exists(working_directory + "\\images\\ui\\attacked"+string(i)+".png")){ attacked[i-1]=sprite_add(working_directory + "\\images\\ui\\attacked"+string(i)+".png",1,false,false,0,0);attacked_exists[i-1]=1;w+=1; } if (w>0) then attacked_good=true; } - if (argument0="force"){ + if (path="force"){ if (file_exists(working_directory + "\\images\\ui\\force"+string(i)+".png")){ force[i-1]=sprite_add(working_directory + "\\images\\ui\\force"+string(i)+".png",1,false,false,0,0); force_exists[i-1]=1; @@ -346,35 +394,35 @@ function scr_image(argument0, argument1, argument2, argument3, argument4, argume if (w>0) then force_good=true; } - if (argument0="purge"){ + if (path="purge"){ if (file_exists(working_directory + "\\images\\ui\\purge"+string(i)+".png")){ purge[i-1]=sprite_add(working_directory + "\\images\\ui\\purge"+string(i)+".png",1,false,false,0,0);purge_exists[i-1]=1;w+=1; } if (w>0) then purge_good=true; } - if (argument0="event"){ + if (path="event"){ if (file_exists(working_directory + "\\images\\ui\\event"+string(i)+".png")){ event[i-1]=sprite_add(working_directory + "\\images\\ui\\event"+string(i)+".png",1,false,false,0,0);event_exists[i-1]=1;w+=1; } if (w>0) then event_good=true; } - if (argument0="symbol"){ + if (path="symbol"){ if (file_exists(working_directory + "\\images\\diplomacy\\symbol"+string(i)+".png")){ symbol[i-1]=sprite_add(working_directory + "\\images\\diplomacy\\symbol"+string(i)+".png",1,false,false,0,0);symbol_exists[i-1]=1;w+=1; } if (w>0) then symbol_good=true; } - if (argument0="defeat"){ + if (path="defeat"){ if (file_exists(working_directory + "\\images\\ui\\defeat"+string(i)+".png")){ defeat[i-1]=sprite_add(working_directory + "\\images\\ui\\defeat"+string(i)+".png",1,false,false,0,0);defeat_exists[i-1]=1;w+=1; } if (w>0) then defeat_good=true; } - if (argument0="slate"){ + if (path="slate"){ if (file_exists(working_directory + "\\images\\creation\\slate"+string(i)+".png")){ slate[i-1]=sprite_add(working_directory + "\\images\\creation\\slate"+string(i)+".png",1,false,false,0,0);slate_exists[i-1]=1;w+=1; } @@ -395,101 +443,102 @@ function scr_image(argument0, argument1, argument2, argument3, argument4, argume - if (argument0!="") and (argument1>=0) and (argument1!=666){with(obj_img){// Draw the image + if (path!="") and (image_id>=0) and (image_id!=666){with(obj_img){// Draw the image var drawing_sprite,drawing_exists,old_alpha,old_color,x13,y13,x14,y14; drawing_sprite=0;drawing_exists=false;x13=0;y13=0;x14=0;y14=0; old_alpha=draw_get_alpha(); old_color=draw_get_colour(); - if (argument0="creation"){ + if (path="creation"){ if (creation_exists[1]>0) and (sprite_exists(creation[1])){drawing_sprite=creation[1];drawing_exists=true;} } - if (argument0="main_splash"){ - if (main_exists[argument1]>0) and (sprite_exists(main[argument1])){drawing_sprite=main[argument1];drawing_exists=true;} + if (path="main_splash"){ + if (main_exists[image_id]>0) and (sprite_exists(main[image_id])){drawing_sprite=main[image_id];drawing_exists=true;} } - if (argument0="existing_splash"){ - if (existing_exists[argument1]>0) and (sprite_exists(existing[argument1])){drawing_sprite=existing[argument1];drawing_exists=true;} + if (path="existing_splash"){ + if (existing_exists[image_id]>0) and (sprite_exists(existing[image_id])){drawing_sprite=existing[image_id];drawing_exists=true;} } - if (argument0="other_splash"){ - if (others_exists[argument1]>0) and (sprite_exists(others[argument1])){drawing_sprite=others[argument1];drawing_exists=true;} + if (path="other_splash"){ + if (others_exists[image_id]>0) and (sprite_exists(others[image_id])){drawing_sprite=others[image_id];drawing_exists=true;} } - if (argument0="advisor"){ - if (advisor_exists[argument1]>0) and (sprite_exists(advisor[argument1])){drawing_sprite=advisor[argument1];drawing_exists=true;} + if (path="advisor"){ + if (advisor_exists[image_id]>0) and (sprite_exists(advisor[image_id])){drawing_sprite=advisor[image_id];drawing_exists=true;} } - if (argument0="diplomacy_splash"){ - if (diplomacy_splash_exists[argument1]>0) and (sprite_exists(diplomacy_splash[argument1])){drawing_sprite=diplomacy_splash[argument1];drawing_exists=true;} + if (path="diplomacy_splash"){ + if (diplomacy_splash_exists[image_id]>0) and (sprite_exists(diplomacy_splash[image_id])){drawing_sprite=diplomacy_splash[image_id];drawing_exists=true;} } - if (argument0="diplomacy_daemon"){ - if (diplomacy_daemon_exists[argument1]>0) and (sprite_exists(diplomacy_daemon[argument1])){drawing_sprite=diplomacy_daemon[argument1];drawing_exists=true;} + if (path="diplomacy_daemon"){ + if (diplomacy_daemon_exists[image_id]>0) and (sprite_exists(diplomacy_daemon[image_id])){drawing_sprite=diplomacy_daemon[image_id];drawing_exists=true;} } - if (argument0="diplomacy_icon"){ + if (path="diplomacy_icon"){ if (diplomacy_icon_exists[1]>0) and (sprite_exists(diplomacy_icon[1])){drawing_sprite=diplomacy_icon[1];drawing_exists=true;} } - if (argument0="menu"){ + if (path="menu"){ if (menu_exists[1]>0) and (sprite_exists(menu[1])){drawing_sprite=menu[1];drawing_exists=true;} } - if (argument0="loading"){ - if (loading_exists[argument1]>0) and (sprite_exists(loading[argument1])){drawing_sprite=loading[argument1];drawing_exists=true;} + if (path="loading"){ + if (loading_exists[image_id]>0) and (sprite_exists(loading[image_id])){drawing_sprite=loading[image_id];drawing_exists=true;} } - if (argument0="postbattle"){ - if (postbattle_exists[argument1]>0) and (sprite_exists(postbattle[argument1])){drawing_sprite=postbattle[argument1];drawing_exists=true;} + if (path="postbattle"){ + if (postbattle_exists[image_id]>0) and (sprite_exists(postbattle[image_id])){drawing_sprite=postbattle[image_id];drawing_exists=true;} } - if (argument0="postspace"){ - if (postspace_exists[argument1]>0) and (sprite_exists(postspace[argument1])){drawing_sprite=postspace[argument1];drawing_exists=true;} + if (path="postspace"){ + if (postspace_exists[image_id]>0) and (sprite_exists(postspace[image_id])){drawing_sprite=postspace[image_id];drawing_exists=true;} } - if (argument0="formation"){ - if (formation_exists[argument1]>0) and (sprite_exists(formation[argument1])){drawing_sprite=formation[argument1];drawing_exists=true;} + if (path="formation"){ + if (formation_exists[image_id]>0) and (sprite_exists(formation[image_id])){drawing_sprite=formation[image_id];drawing_exists=true;} } - if (argument0="popup"){ - if (popup_exists[argument1]>0) and (sprite_exists(popup[argument1])){drawing_sprite=popup[argument1];drawing_exists=true;} + if (path="popup"){ + if (popup_exists[image_id]>0) and (sprite_exists(popup[image_id])){drawing_sprite=popup[image_id];drawing_exists=true;} } - if (argument0="commander"){ - if (commander_exists[argument1]>0) and (sprite_exists(commander[argument1])){drawing_sprite=commander[argument1];drawing_exists=true;} + if (path="commander"){ + if (commander_exists[image_id]>0) and (sprite_exists(commander[image_id])){drawing_sprite=commander[image_id];drawing_exists=true;} } - if (argument0="planet"){ - if (planet_exists[argument1]>0) and (sprite_exists(planet[argument1])){drawing_sprite=planet[argument1];drawing_exists=true;} + if (path="planet"){ + if (planet_exists[image_id]>0) and (sprite_exists(planet[image_id])){drawing_sprite=planet[image_id];drawing_exists=true;} } - if (argument0="attacked"){ - if (attacked_exists[argument1]>0) and (sprite_exists(attacked[argument1])){drawing_sprite=attacked[argument1];drawing_exists=true;} + if (path="attacked"){ + if (attacked_exists[image_id]>0) and (sprite_exists(attacked[image_id])){drawing_sprite=attacked[image_id];drawing_exists=true;} } - if (argument0="force"){ - if (force_exists[argument1]>0) and (sprite_exists(force[argument1])){drawing_sprite=force[argument1];drawing_exists=true;} + if (path="force"){ + if (force_exists[image_id]>0) and (sprite_exists(force[image_id])){drawing_sprite=force[image_id];drawing_exists=true;} } - if (argument0="raid"){ - if (raid_exists[argument1]>0) and (sprite_exists(raid[argument1])){drawing_sprite=raid[argument1];drawing_exists=true;} + if (path="raid"){ + if (raid_exists[image_id]>0) and (sprite_exists(raid[image_id])){drawing_sprite=raid[image_id];drawing_exists=true;} } - if (argument0="purge"){ - if (purge_exists[argument1]>0) and (sprite_exists(purge[argument1])){drawing_sprite=purge[argument1];drawing_exists=true;} + if (path="purge"){ + if (purge_exists[image_id]>0) and (sprite_exists(purge[image_id])){drawing_sprite=purge[image_id];drawing_exists=true;} } - if (argument0="event"){ - if (event_exists[argument1]>0) and (sprite_exists(event[argument1])){drawing_sprite=event[argument1];drawing_exists=true;} + if (path="event"){ + if (event_exists[image_id]>0) and (sprite_exists(event[image_id])){drawing_sprite=event[image_id];drawing_exists=true;} } - if (argument0="title_splash"){ + if (path="title_splash"){ if (title_splash_exists[1]>0) and (sprite_exists(title_splash[1])){drawing_sprite=title_splash[1];drawing_exists=true;} } - if (argument0="symbol"){ - if (symbol_exists[argument1]>0) and (sprite_exists(symbol[argument1])){drawing_sprite=symbol[argument1];drawing_exists=true;} + if (path="symbol"){ + if (symbol_exists[image_id]>0) and (sprite_exists(symbol[image_id])){drawing_sprite=symbol[image_id];drawing_exists=true;} } - if (argument0="defeat"){ - if (defeat_exists[argument1]>0) and (sprite_exists(defeat[argument1])){drawing_sprite=defeat[argument1];drawing_exists=true;} + if (path="defeat"){ + if (defeat_exists[image_id]>0) and (sprite_exists(defeat[image_id])){drawing_sprite=defeat[image_id];drawing_exists=true;} } - if (argument0="slate"){ - if (slate_exists[argument1]>0) and (sprite_exists(slate[argument1])){drawing_sprite=slate[argument1];drawing_exists=true;} + if (path="slate"){ + if (slate_exists[image_id]>0) and (sprite_exists(slate[image_id])){drawing_sprite=slate[image_id];drawing_exists=true;} } if (drawing_exists=true){ - draw_sprite_stretched(drawing_sprite,argument1,argument2,argument3,argument4,argument5); + draw_sprite_stretched(drawing_sprite,image_id,x1,y1,width,height); } if (drawing_exists=false){ - draw_set_alpha(1);draw_set_color(0); - draw_rectangle(argument2,argument3,argument2+argument4,argument3+argument5,0); + draw_set_alpha(1); + draw_set_color(0); + draw_rectangle(x1,y1,x1+width,y1+height,0); draw_set_color(c_red); - draw_rectangle(argument2,argument3,argument2+argument4,argument3+argument5,1); - draw_rectangle(argument2+1,argument3+1,argument2+argument4-1,argument3+argument5-1,1); - draw_rectangle(argument2+2,argument3+2,argument2+argument4-2,argument3+argument5-2,1); - draw_line_width(argument2+1.5,argument3+1.5,argument2+argument4-1.5,argument3+argument5-1.5,3); - draw_line_width(argument2+argument4-1.5,argument3+1.5,argument2+1.5,argument3+argument5-1.5,3); + draw_rectangle(x1,y1,x1+width,y1+height,1); + draw_rectangle(x1+1,y1+1,x1+width-1,y1+height-1,1); + draw_rectangle(x1+2,y1+2,x1+width-2,y1+height-2,1); + draw_line_width(x1+1.5,y1+1.5,x1+width-1.5,y1+height-1.5,3); + draw_line_width(x1+width-1.5,y1+1.5,x1+1.5,y1+height-1.5,3); draw_set_color(c_black); } @@ -498,3 +547,50 @@ function scr_image(argument0, argument1, argument2, argument3, argument4, argume }} } + +/// @description Use this to load the image at given path and id into the image cache so it can be +/// referenced in a different function to scr_image. Obtain the image later with `obj_img.image_cache[$path][image_id]` +function scr_image_cache(path, image_id) { + try { + var drawing_sprite; + var cache_arr_exists = struct_exists(obj_img.image_cache, path); + if (!cache_arr_exists) { + var empty_arr = array_create(100, -1); + variable_struct_set(obj_img.image_cache, path, empty_arr); + } + // Start with 100 slots but allow it to expand if needed + if (cache_arr_exists && image_id > 100) { + for (var i = 100; i <= image_id; i++) { + array_push(obj_img.image_cache[$ path], -1); + } + } + + var existing_sprite = -1; + try { + existing_sprite = array_get(obj_img.image_cache[$ path], image_id); + } catch (_ex) { + debugl($"error trying to fetch image {path}/{image_id}.png from cache: {_ex}"); + existing_sprite = -1; + } + + if (sprite_exists(existing_sprite)) { + drawing_sprite = existing_sprite; + } else if (image_id > -1) { + var folders = string_replace_all(path, "/", "\\"); + var dir = $"{working_directory}\\images\\{folders}\\{string(image_id)}.png"; + if (file_exists(dir)) { + drawing_sprite = sprite_add(dir, 1, false, false, 0, 0); + if (image_id >= array_length(obj_img.image_cache[$ path])) { + array_resize(obj_img.image_cache[$ path], image_id + 1); + } + array_set(obj_img.image_cache[$ path], image_id, drawing_sprite); + } else { + drawing_sprite = -1; + // debugl($"No directory/file found matching {dir}"); // too much noise + } + } + return drawing_sprite; + } catch (_exception) { + handle_exception(_exception); + } +} diff --git a/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml b/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml index 8d7b1749e..d3188c033 100644 --- a/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml +++ b/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml @@ -193,7 +193,7 @@ function navy_attack_player_world(){ if (instance_exists(orbiting)){ var tar=0; var i=0; - for (var i=1;i<=orniting.planets;i++){ + for (i = 1; i <= orbiting.planets; i++) { if (orbiting.p_owner[i]=eFACTION.Player) and (planet_feature_bool(orbiting.p_feature[i],P_features.Monastery)==0) and (orbiting.p_guardsmen[i]=0) @@ -320,7 +320,7 @@ function scr_navy_unload_guard(planet){ function scr_navy_planet_action(){ if (action=="") and (is_orbiting()) and (!guardsmen_unloaded){// Unload if problem sector, otherwise patrol - var p=0,selected_planet=0,highest=0,popu=0,popu_large=false; + var selected_planet=0,highest=0,popu=0,popu_large=false; for (var p=1;p<=orbiting.planets;p++){ var planet_enemies = planet_imperial_base_enemies(p, orbiting); diff --git a/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml b/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml index e7005232e..898ae7766 100644 --- a/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml +++ b/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml @@ -1,49 +1,115 @@ -function scr_ini_ship_cleanup() { - var i,j,meh; - i=0;j=0;meh=0; - var co,ide; - co=0;ide=0; +function scr_kill_ship(index){ + try { + with(obj_ini){ + var _units_on_ship = []; + var _unit; + for (var co=0;co<=companies;co++){ + for (var i=0;i-1){ + if (_unit.ship_location == index){ + if (!(irandom(_unit.luck)-3)){ + scr_kill_unit(_unit.company, _unit.marine_number); + } else { + array_push(_units_on_ship, _unit); + } + } else { + if (_unit.ship_location>index){ + _unit.ship_location--; + } + } + } + } + for (var i=0;iindex){ + veh_lid[co][i]--; + } + } + } + var in_warp = ship_location[index] == "Warp"; + var _available_ships = []; + var _ship_fleet = find_ships_fleet(index); + if (!in_warp){ + var _nearest_star = star_by_name(ship_location[index]); + } + if (_ship_fleet!="none"){ + delete_ship_from_fleet(index,_ship_fleet); + _available_ships = fleet_full_ship_array(_ship_fleet); + } + _units_on_ship = array_shuffle(_units_on_ship); + for (var i=0;i0){ + f++; + if (_units_on_ship[0].get_unit_size()+ship_carrying[_cur_ship]<=ship_capacity[_cur_ship]){ + _units_on_ship[0].load_marine(_cur_ship); + array_delete(_units_on_ship, 0, 1); + } + } + } + array_delete(ship,index,1); + array_delete(ship_uid,index,1); + array_delete(ship_owner,index,1); + array_delete(ship_class,index,1); + array_delete(ship_size,index,1); + array_delete(ship_leadership,index,1); + array_delete(ship_hp,index,1); + array_delete(ship_maxhp,index,1); + array_delete(ship_location,index,1); + array_delete(ship_shields,index,1); + array_delete(ship_conditions,index,1); + array_delete(ship_speed,index,1); + array_delete(ship_turning,index,1); - /* - This is one of the scripts that has given me a lot of trouble - over the ages. Formerly, when ships were destroyed, their - array would be crushed. This meant that marine LID (ship ID) - variables had to be changed to take this into account and - assign them to the recently changed ship IP. - - As of recent I have simply removed the 'clean and smash' ship - script, so that their ID's never change. Instead of condensing - empty slots they are simply left empty. Ideally this should, - and so far has, prevent marines from teleporting from ship to - ship. - - This scripts new purpose is to simply remove all variables - formerly assigned to a dead ship within the array. This (should) - prevent the engine from mistaking a dead ship for still being - active and alive. - */ + array_delete(ship_front_armour,index,1); + array_delete(ship_other_armour,index,1); + array_delete(ship_weapons,index,1); + array_delete(ship_wep ,index,1); + array_delete(ship_wep_condition,index,1); + array_delete(ship_wep_facing,index,1); + array_delete(ship_capacity,index,1); + array_delete(ship_carrying,index,1); + array_delete(ship_contents,index,1); + array_delete(ship_turrets,index,1); + if (!in_warp){ + if (_nearest_star!="none"){ + while(array_length(_units_on_ship)>0){ + _unit = array_pop(_units_on_ship); + if (irandom(100)>100-_unit.luck){ + _unit.unload(irandom_range(1, _nearest_star.planets), _nearest_star); + } + } + } + } + for (var i=0;i=0;i--){ + if (ship[i]!="") and (ship_hp[i]<=0){ + scr_kill_ship(i); + } + } + } } } diff --git a/scripts/scr_initialize_custom/scr_initialize_custom.gml b/scripts/scr_initialize_custom/scr_initialize_custom.gml index c4ec4b60b..fac1dbc56 100644 --- a/scripts/scr_initialize_custom/scr_initialize_custom.gml +++ b/scripts/scr_initialize_custom/scr_initialize_custom.gml @@ -1,25 +1,65 @@ -enum Role { - CHAPTER_MASTER = 1, - HONOUR_GUARD = 2, - VETERAN = 3, - TERMINATOR = 4, - CAPTAIN = 5, - DREADNOUGHT = 6, - CHAMPION = 7, - TACTICAL = 8, - DEVASTATOR = 9, - ASSAULT = 10, - ANCIENT = 11, - SCOUT = 12, - CHAPLAIN = 14, - APOTHECARY = 15, - TECHMARINE = 16, - LIBRARIAN = 17, - SERGEANT = 18, - VETERAN_SERGEANT = 19 +enum eROLE { + None = 0, + ChapterMaster = 1, + HonourGuard = 2, + Veteran = 3, + Terminator = 4, + Captain = 5, + Dreadnought = 6, + Champion = 7, + Tactical = 8, + Devastator = 9, + Assault = 10, + Ancient = 11, + Scout = 12, + Chaplain = 14, + Apothecary = 15, + Techmarine = 16, + Librarian = 17, + Sergeant = 18, + VeteranSergeant = 19, + LandRaider = 50, + Rhino = 51, + Predator = 52, + LandSpeeder = 53, + Whirlwind = 54 } -function complex_livery_default(){ +enum ePROGENITOR { + NONE, + DARK_ANGELS, + WHITE_SCARS, + SPACE_WOLVES, + IMPERIAL_FISTS, + BLOOD_ANGELS, + IRON_HANDS, + ULTRAMARINES, + SALAMANDERS, + RAVEN_GUARD, + RANDOM, +} +function progenitor_map(){ + var founding_chapters = [ + "", + "Dark Angels", + "White Scars", + "Space Wolves", + "Imperial Fists", + "Blood Angels", + "Iron Hands", + "Ultramarines", + "Salamanders", + "Raven Guard", + ] + for (i=1;i<10;i++){ + if (global.chapter_name==founding_chapters[i] || obj_ini.progenitor==i){ + return i; + } + } + return 0; +} + +function complex_livery_default() { return { sgt : { helm_pattern:3, @@ -47,418 +87,466 @@ function complex_livery_default(){ helm_primary : 0, helm_secondary : 0, helm_detail : 0, - helm_lens : 0, - } + helm_lens : 0, + } }; } -function progenitor_livery(chapter, specific="none"){ - //default - var livery_data = complex_livery_default(); - //custom for chapters - if (chapter=="Space Wolves"){ - livery_data = { - sgt : { - helm_pattern:3, - helm_primary :Colors.Fenrisian_Grey, - helm_secondary : Colors.Red, - helm_detail : 0, - helm_lens : Colors.Red, - }, - vet_sgt : { - helm_pattern:3, - helm_primary : Colors.Fenrisian_Grey, - helm_secondary : Colors.Black, - helm_detail : 0, - helm_lens : Colors.Red, - }, - captain : { - helm_pattern:3, - helm_primary : Colors.Fenrisian_Grey, - helm_secondary : Colors.Black, - helm_detail : 0, - helm_lens : Colors.Red, - }, - veteran : { - helm_pattern:0, - helm_primary : Colors.White, - helm_secondary : Colors.White, - helm_detail : Colors.White, - helm_lens : Colors.Red, - } - } - }else if (chapter == "Dark Angels"){ - livery_data = { - sgt: { - helm_pattern: 0, - helm_primary: obj_creation.main_color, - helm_secondary: obj_creation.main_color, - helm_detail: obj_creation.trim_color, - helm_lens: obj_creation.lens_color, - }, - vet_sgt: { - helm_pattern: 1, - helm_primary: obj_creation.main_color, - helm_secondary: obj_creation.main_color, - helm_detail: obj_creation.trim_color, - helm_lens: obj_creation.lens_color, - }, - captain: { - helm_pattern: 0, - helm_primary: obj_creation.main_color, - helm_secondary: obj_creation.main_color, - helm_detail: obj_creation.trim_color, - helm_lens: obj_creation.lens_color, - }, - veteran: { - helm_pattern: 0, - helm_primary: obj_creation.main_color, - helm_secondary: obj_creation.main_color, - helm_detail: obj_creation.trim_color, - helm_lens: obj_creation.lens_color, - } - } - }else if (chapter=="Raven Guard"){ - livery_data = { - sgt : { - helm_pattern:0, - helm_primary :Colors.White, - helm_secondary : Colors.White, - helm_detail : 0, - helm_lens : Colors.Red, - }, - vet_sgt : { - helm_pattern:1, - helm_primary : Colors.Black, - helm_secondary : Colors.White, - helm_detail : 0, - helm_lens : Colors.Red, - }, - captain : { - helm_pattern:0, - helm_primary : Colors.White, - helm_secondary : Colors.White, - helm_detail : 0, - helm_lens : Colors.Red, - }, - veteran : { - helm_pattern:0, - helm_primary : Colors.Black, - helm_secondary : Colors.Black, - helm_detail : Colors.Black, - helm_lens : Colors.Green, - } - } - }else if (chapter=="Salamanders"){ - livery_data = { - sgt : { - helm_pattern:0, - helm_primary :Colors.Black, - helm_secondary : Colors.Black, - helm_detail : 0, - helm_lens : Colors.Red, - }, - vet_sgt : { - helm_pattern:1, - helm_primary : Colors.Black, - helm_secondary : Colors.Red, - helm_detail : 0, - helm_lens : Colors.Red, - }, - captain : { - helm_pattern:0, - helm_primary : Colors.Firedrake_Green, - helm_secondary : Colors.Firedrake_Green, - helm_detail : 0, - helm_lens : Colors.Red, - }, - veteran : { - helm_pattern:0, - helm_primary : Colors.Black, - helm_secondary : Colors.Black, - helm_detail : Colors.Black, - helm_lens : Colors.Green, - } - } - }else if (chapter=="White Scars"){ - livery_data = { - sgt : { - helm_pattern:0, - helm_primary :Colors.White, - helm_secondary : Colors.White, - helm_detail : 0, - helm_lens : Colors.Red, - }, - vet_sgt : { - helm_pattern:1, - helm_primary : Colors.White, - helm_secondary : Colors.Red, - helm_detail : 0, - helm_lens : Colors.Red, - }, - captain : { - helm_pattern:0, - helm_primary : Colors.White, - helm_secondary : Colors.White, - helm_detail : 0, - helm_lens : Colors.Red, - }, - veteran : { - helm_pattern:0, - helm_primary : Colors.White, - helm_secondary : Colors.White, - helm_detail : Colors.White, - helm_lens : Colors.Green, - } - } - }else if (chapter=="Iron Hands"){ - livery_data = { - sgt : { - helm_pattern:0, - helm_primary :Colors.White, - helm_secondary : Colors.White, - helm_detail : 0, - helm_lens : Colors.Red, - }, - vet_sgt : { - helm_pattern:1, - helm_primary : Colors.Black, - helm_secondary : Colors.White, - helm_detail : 0, - helm_lens : Colors.Red, - }, - captain : { - helm_pattern:0, - helm_primary : Colors.White, - helm_secondary : Colors.White, - helm_detail : 0, - helm_lens : Colors.Red, - }, - veteran : { - helm_pattern:0, - helm_primary : Colors.Black, - helm_secondary : Colors.Black, - helm_detail : Colors.Black, - helm_lens : Colors.Green, - } - } - }else if (chapter=="Ultramarines"){ - livery_data = { - sgt : { - helm_pattern:0, - helm_primary : Colors.Red, - helm_secondary : Colors.Red, - helm_detail : Colors.Red, - helm_lens : Colors.Green, - }, - vet_sgt : { - helm_pattern:1, - helm_primary : Colors.Red, - helm_secondary : Colors.White, - helm_detail : Colors.Red, - helm_lens : Colors.Green, - }, - captain : { - helm_pattern:0, - helm_primary : Colors.Dark_Ultramarine, - helm_secondary : Colors.Dark_Ultramarine, - helm_detail : Colors.Dark_Ultramarine, - helm_lens : Colors.Red, - }, - veteran : { - helm_pattern:0, - helm_primary : Colors.White, - helm_secondary : Colors.White, - helm_detail : Colors.White, - helm_lens : Colors.Red, - } - } - }else if (chapter=="Imperial Fists"){ - livery_data = { - sgt : { - helm_pattern:0, - helm_primary : Colors.Black, - helm_secondary : Colors.Black, - helm_detail : Colors.Red, - helm_lens : Colors.Green, - }, - vet_sgt : { - helm_pattern:1, - helm_primary : Colors.Black, - helm_secondary : Colors.White, - helm_detail : Colors.Red, - helm_lens : Colors.Green, - }, - captain : { - helm_pattern:0, - helm_primary : Colors.Dark_Gold, - helm_secondary : Colors.Dark_Gold, - helm_detail : Colors.Dark_Gold, - helm_lens : Colors.Red, - }, - veteran : { - helm_pattern:0, - helm_primary : Colors.Red, - helm_secondary : Colors.Red, - helm_detail : Colors.Red, - helm_lens : Colors.Green, - } - } - }else if (chapter=="Blood Angels"){ - livery_data = { - sgt : { - helm_pattern:1, - helm_primary : Colors.Sanguine_Red, - helm_secondary : Colors.Sanguine_Red, - helm_detail : Colors.Lighter_Black, - helm_lens : Colors.Lime, - }, - vet_sgt : { - helm_pattern:1, - helm_primary : Colors.Gold, - helm_secondary : Colors.Black, - helm_detail : Colors.Gold, - helm_lens : Colors.Lime, - }, - captain : { - helm_pattern:0, - helm_primary : Colors.Sanguine_Red, - helm_secondary : Colors.Sanguine_Red, - helm_detail : Colors.Gold, - helm_lens : Colors.Lime, - }, - veteran : { - helm_pattern:0, - helm_primary : Colors.Gold, - helm_secondary : Colors.Gold, - helm_detail : Colors.Gold, - helm_lens : Colors.Lime, - } - } - }else if (global.chapter_name=="Blood Ravens"){ - livery_data = { - sgt : { - helm_pattern:0, - helm_primary : Colors.Black, - helm_secondary : Colors.Black, - helm_detail : Colors.Black, - helm_lens : Colors.Lime, - }, - vet_sgt : { - helm_pattern:1, - helm_primary : Colors.Black, - helm_secondary : Colors.White, - helm_detail : Colors.Black, - helm_lens : Colors.Lime, - }, - captain : { - helm_pattern:0, - helm_primary : Colors.Copper, - helm_secondary : Colors.Copper, - helm_detail : Colors.Copper, - helm_lens : Colors.Lime, - }, - veteran : { - helm_pattern:0, - helm_primary : Colors.White, - helm_secondary : Colors.White, - helm_detail : Colors.White, - helm_lens : Colors.Lime, - } - } - }else if (global.chapter_name=="Minotaurs"){ - livery_data = { - sgt : { - helm_pattern:0, - helm_primary : Colors.Black, - helm_secondary : Colors.Black, - helm_detail : Colors.Black, - helm_lens : Colors.Red, - }, - vet_sgt : { - helm_pattern:1, - helm_primary : obj_creation.main_color, - helm_secondary : Colors.Black, - helm_detail : obj_creation.main_color, - helm_lens : Colors.Red, - }, - captain : { - helm_pattern:2, - helm_primary : obj_creation.main_color, - helm_secondary : Colors.Dark_Red, - helm_detail : obj_creation.main_color, - helm_lens : Colors.Red, - }, - veteran : { - helm_pattern:0, - helm_primary : obj_creation.main_color, - helm_secondary : obj_creation.main_color, - helm_detail : obj_creation.main_color, - helm_lens : Colors.Red, - } - } - }else { - livery_data = { - sgt : { - helm_pattern:0, - helm_primary : Colors.Red, - helm_secondary : Colors.Red, - helm_detail : Colors.Red, - helm_lens : Colors.Green, - }, - vet_sgt : { - helm_pattern:1, - helm_primary : Colors.Red, - helm_secondary : Colors.White, - helm_detail : Colors.Red, - helm_lens : Colors.Green, - }, - captain : { - helm_pattern:0, - helm_primary : obj_creation.main_color, - helm_secondary : obj_creation.main_color, - helm_detail : obj_creation.main_color, - helm_lens : obj_creation.lens_color, - }, - veteran : { - helm_pattern:0, - helm_primary : Colors.White, - helm_secondary : Colors.White, - helm_detail : Colors.White, - helm_lens : Colors.Red, - } - } - } - if (specific=="none"){ - return livery_data; - } else { - return livery_data[$ specific]; - } + +function select_livery_data(livery_data, specific) { + // Return specific livery data if requested + if (specific == "none") { + return livery_data; + } else { + return livery_data[$ specific]; + } } -function progenitor_map(){ - var founding_chapters = [ - "", - "Dark Angels", - "White Scars", - "Space Wolves", - "Imperial Fists", - "Blood Angels", - "Iron Hands", - "Ultramarines", - "Salamanders", - "Raven Guard" - ] - for (i=1;i<10;i++){ - if (global.chapter_name==founding_chapters[i] || obj_ini.progenitor==i){ - return founding_chapters[i]; - } +function progenitor_livery(progenitor, specific = "none") { + var livery_data; + + var name_selected = true; + switch (global.chapter_name) { + case "Blood Ravens": + livery_data = { + sgt: { + helm_pattern: 0, + helm_primary: Colors.Black, + helm_secondary: Colors.Black, + helm_detail: Colors.Black, + helm_lens: Colors.Lime, + }, + vet_sgt: { + helm_pattern: 1, + helm_primary: Colors.Black, + helm_secondary: Colors.White, + helm_detail: Colors.Black, + helm_lens: Colors.Lime, + }, + captain: { + helm_pattern: 0, + helm_primary: Colors.Copper, + helm_secondary: Colors.Copper, + helm_detail: Colors.Copper, + helm_lens: Colors.Lime, + }, + veteran: { + helm_pattern: 0, + helm_primary: Colors.White, + helm_secondary: Colors.White, + helm_detail: Colors.White, + helm_lens: Colors.Lime, + }, + }; + break; + + case "Minotaurs": + livery_data = { + sgt: { + helm_pattern: 0, + helm_primary: Colors.Black, + helm_secondary: Colors.Black, + helm_detail: Colors.Black, + helm_lens: Colors.Red, + }, + vet_sgt: { + helm_pattern: 1, + helm_primary: obj_creation.main_color, + helm_secondary: Colors.Black, + helm_detail: obj_creation.main_color, + helm_lens: Colors.Red, + }, + captain: { + helm_pattern: 2, + helm_primary: obj_creation.main_color, + helm_secondary: Colors.Dark_Red, + helm_detail: obj_creation.main_color, + helm_lens: Colors.Red, + }, + veteran: { + helm_pattern: 0, + helm_primary: obj_creation.main_color, + helm_secondary: obj_creation.main_color, + helm_detail: obj_creation.main_color, + helm_lens: Colors.Red, + }, + }; + break; + + default: + name_selected = false; + break; + } + + if (name_selected) { + return select_livery_data(livery_data, specific); + } + + switch (progenitor) { + case ePROGENITOR.SPACE_WOLVES: + livery_data = { + sgt: { + helm_pattern: 3, + helm_primary: Colors.Fenrisian_Grey, + helm_secondary: Colors.Red, + helm_detail: 0, + helm_lens: Colors.Red, + }, + vet_sgt: { + helm_pattern: 3, + helm_primary: Colors.Fenrisian_Grey, + helm_secondary: Colors.Black, + helm_detail: 0, + helm_lens: Colors.Red, + }, + captain: { + helm_pattern: 3, + helm_primary: Colors.Fenrisian_Grey, + helm_secondary: Colors.Black, + helm_detail: 0, + helm_lens: Colors.Red, + }, + veteran: { + helm_pattern: 0, + helm_primary: Colors.White, + helm_secondary: Colors.White, + helm_detail: Colors.White, + helm_lens: Colors.Red, + }, + }; + break; + + case ePROGENITOR.DARK_ANGELS: + livery_data = { + sgt: { + helm_pattern: 0, + helm_primary: obj_creation.main_color, + helm_secondary: obj_creation.main_color, + helm_detail: obj_creation.main_trim, + helm_lens: obj_creation.lens_color, + }, + vet_sgt: { + helm_pattern: 1, + helm_primary: obj_creation.main_color, + helm_secondary: obj_creation.main_color, + helm_detail: obj_creation.main_trim, + helm_lens: obj_creation.lens_color, + }, + captain: { + helm_pattern: 0, + helm_primary: obj_creation.main_color, + helm_secondary: obj_creation.main_color, + helm_detail: obj_creation.main_trim, + helm_lens: obj_creation.lens_color, + }, + veteran: { + helm_pattern: 0, + helm_primary: obj_creation.main_color, + helm_secondary: obj_creation.main_color, + helm_detail: obj_creation.main_trim, + helm_lens: obj_creation.lens_color, + }, + }; + break; + + case ePROGENITOR.RAVEN_GUARD: + livery_data = { + sgt: { + helm_pattern: 0, + helm_primary: Colors.White, + helm_secondary: Colors.White, + helm_detail: 0, + helm_lens: Colors.Red, + }, + vet_sgt: { + helm_pattern: 1, + helm_primary: Colors.Black, + helm_secondary: Colors.White, + helm_detail: 0, + helm_lens: Colors.Red, + }, + captain: { + helm_pattern: 0, + helm_primary: Colors.White, + helm_secondary: Colors.White, + helm_detail: 0, + helm_lens: Colors.Red, + }, + veteran: { + helm_pattern: 0, + helm_primary: Colors.Black, + helm_secondary: Colors.Black, + helm_detail: Colors.Black, + helm_lens: Colors.Green, + }, + }; + break; + + case ePROGENITOR.SALAMANDERS: + livery_data = { + sgt: { + helm_pattern: 0, + helm_primary: Colors.Black, + helm_secondary: Colors.Black, + helm_detail: 0, + helm_lens: Colors.Red, + }, + vet_sgt: { + helm_pattern: 1, + helm_primary: Colors.Black, + helm_secondary: Colors.Red, + helm_detail: 0, + helm_lens: Colors.Red, + }, + captain: { + helm_pattern: 0, + helm_primary: Colors.Firedrake_Green, + helm_secondary: Colors.Firedrake_Green, + helm_detail: 0, + helm_lens: Colors.Red, + }, + veteran: { + helm_pattern: 0, + helm_primary: Colors.Black, + helm_secondary: Colors.Black, + helm_detail: Colors.Black, + helm_lens: Colors.Green, + }, + }; + break; + + case ePROGENITOR.WHITE_SCARS: + livery_data = { + sgt: { + helm_pattern: 0, + helm_primary: Colors.White, + helm_secondary: Colors.White, + helm_detail: 0, + helm_lens: Colors.Red, + }, + vet_sgt: { + helm_pattern: 1, + helm_primary: Colors.White, + helm_secondary: Colors.Red, + helm_detail: 0, + helm_lens: Colors.Red, + }, + captain: { + helm_pattern: 0, + helm_primary: Colors.White, + helm_secondary: Colors.White, + helm_detail: 0, + helm_lens: Colors.Red, + }, + veteran: { + helm_pattern: 0, + helm_primary: Colors.White, + helm_secondary: Colors.White, + helm_detail: Colors.White, + helm_lens: Colors.Green, + }, + }; + break; + + case ePROGENITOR.IRON_HANDS: + livery_data = { + sgt: { + helm_pattern: 0, + helm_primary: Colors.White, + helm_secondary: Colors.White, + helm_detail: 0, + helm_lens: Colors.Red, + }, + vet_sgt: { + helm_pattern: 1, + helm_primary: Colors.Black, + helm_secondary: Colors.White, + helm_detail: 0, + helm_lens: Colors.Red, + }, + captain: { + helm_pattern: 0, + helm_primary: Colors.White, + helm_secondary: Colors.White, + helm_detail: 0, + helm_lens: Colors.Red, + }, + veteran: { + helm_pattern: 0, + helm_primary: Colors.Black, + helm_secondary: Colors.Black, + helm_detail: Colors.Black, + helm_lens: Colors.Green, + }, + }; + break; + + case ePROGENITOR.ULTRAMARINES: + livery_data = { + sgt: { + helm_pattern: 0, + helm_primary: Colors.Red, + helm_secondary: Colors.Red, + helm_detail: Colors.Red, + helm_lens: Colors.Green, + }, + vet_sgt: { + helm_pattern: 1, + helm_primary: Colors.Red, + helm_secondary: Colors.White, + helm_detail: Colors.Red, + helm_lens: Colors.Green, + }, + captain: { + helm_pattern: 0, + helm_primary: Colors.Dark_Ultramarine, + helm_secondary: Colors.Dark_Ultramarine, + helm_detail: Colors.Dark_Ultramarine, + helm_lens: Colors.Red, + }, + veteran: { + helm_pattern: 0, + helm_primary: Colors.White, + helm_secondary: Colors.White, + helm_detail: Colors.White, + helm_lens: Colors.Red, + }, + }; + break; + + case ePROGENITOR.IMPERIAL_FISTS: + livery_data = { + sgt: { + helm_pattern: 0, + helm_primary: Colors.Black, + helm_secondary: Colors.Black, + helm_detail: Colors.Red, + helm_lens: Colors.Green, + }, + vet_sgt: { + helm_pattern: 1, + helm_primary: Colors.Black, + helm_secondary: Colors.White, + helm_detail: Colors.Red, + helm_lens: Colors.Green, + }, + captain: { + helm_pattern: 0, + helm_primary: Colors.Dark_Gold, + helm_secondary: Colors.Dark_Gold, + helm_detail: Colors.Dark_Gold, + helm_lens: Colors.Red, + }, + veteran: { + helm_pattern: 0, + helm_primary: Colors.Red, + helm_secondary: Colors.Red, + helm_detail: Colors.Red, + helm_lens: Colors.Green, + }, + }; + break; + + case ePROGENITOR.BLOOD_ANGELS: + livery_data = { + sgt: { + helm_pattern: 1, + helm_primary: Colors.Sanguine_Red, + helm_secondary: Colors.Sanguine_Red, + helm_detail: Colors.Lighter_Black, + helm_lens: Colors.Lime, + }, + vet_sgt: { + helm_pattern: 1, + helm_primary: Colors.Gold, + helm_secondary: Colors.Black, + helm_detail: Colors.Gold, + helm_lens: Colors.Lime, + }, + captain: { + helm_pattern: 0, + helm_primary: Colors.Sanguine_Red, + helm_secondary: Colors.Sanguine_Red, + helm_detail: Colors.Gold, + helm_lens: Colors.Lime, + }, + veteran: { + helm_pattern: 0, + helm_primary: Colors.Gold, + helm_secondary: Colors.Gold, + helm_detail: Colors.Gold, + helm_lens: Colors.Lime, + }, + }; + break; + + default: + // Not a named chapter or progenitor we have data for. + // before this refactor, this was the true default, not complex_livery_default + livery_data = { + sgt: { + helm_pattern: 0, + helm_primary: Colors.Red, + helm_secondary: Colors.Red, + helm_detail: Colors.Red, + helm_lens: Colors.Green, + }, + vet_sgt: { + helm_pattern: 1, + helm_primary: Colors.Red, + helm_secondary: Colors.White, + helm_detail: Colors.Red, + helm_lens: Colors.Green, + }, + captain: { + helm_pattern: 0, + helm_primary: obj_creation.main_color, + helm_secondary: obj_creation.main_color, + helm_detail: obj_creation.main_color, + helm_lens: obj_creation.lens_color, + }, + veteran: { + helm_pattern: 0, + helm_primary: Colors.White, + helm_secondary: Colors.White, + helm_detail: Colors.White, + helm_lens: Colors.Red, + }, + }; + break; + } + return select_livery_data(livery_data, specific); +} + +function trial_map(trial_name){ + if(is_real(trial_name)){ + return trial_name; + } + switch(trial_name){ + case "BLOOD_DUEL": + case "BLOODDUEL": + return eTrials.BLOODDUEL; + case "SURVIVAL": + return eTrials.SURVIVAL; + case "APPRENTICESHIP": + return eTrials.APPRENTICESHIP; + case "CHALLENGE": + return eTrials.CHALLENGE; + case "EXPOSURE": + return eTrials.EXPOSURE; + case "HUNTING": + return eTrials.HUNTING; + case "KNOWLEDGE": + return eTrials.KNOWLEDGE; + default: + return eTrials.BLOODDUEL; } - return ""; } +/// @mixin obj_ini function scr_initialize_custom() { - + // show_debug_message("Executing scr_initialize_custom"); + progenitor = obj_creation.founding; successors = obj_creation.successors; homeworld_rule = obj_creation.homeworld_rule; @@ -466,7 +554,7 @@ function scr_initialize_custom() { // Initializes all of the marine/vehicle/ship variables for the chapter. - techs = 8; + techmarines = 8; apothecary = 8; epistolary = 2; codiciery = 2; @@ -492,59 +580,61 @@ function scr_initialize_custom() { // show_message(instance_number(obj_controller)); - global.chapter_name = obj_creation.chapter; + global.chapter_name = obj_creation.chapter_name; global.founding = obj_creation.founding; global.founding_secret = ""; global.game_seed = floor(random(99999999)) + string_to_integer(global.chapter_name) + string_to_integer(obj_creation.chapter_master_name); - use_custom_icon = 0; - if (string_count("custom", obj_creation.icon_name) > 0) { - use_custom_icon = global.game_seed; - - var ta, na; - ta = string(obj_creation.custom_icon) + ".png"; - na = string(global.game_seed) + ".png"; - - /* if (file_exists(working_directory + "\icons_save\"+string(ta))){ - file_copy(working_directory + "\icons\"+string(ta),working_directory + "\icons_save\"+string(na)); - }*/ - } - if (progenitor = 10) { // Pretty sure that's random? - var legions = ["Dark Angels", - "Emperor's Children", - "Iron Warriors", - "White Scars", - "Space Wolves", - "Imperial Fists", - "Night Lords", - "Blood Angels", - "Iron Hands", - "World Eaters", - "Ultramarines", - "Death Guard", - "Thousand Sons", - "Black Legion", - "Word Bearers", - "Salamanders", - "Raven Guard", - "Alpha Legion" - ] - global.founding_secret = legions[irandom(17)]; + if (progenitor == ePROGENITOR.RANDOM) { + global.founding_secret = array_random_element([ + "Dark Angels", + "Emperor's Children", + "Iron Warriors", + "White Scars", + "Space Wolves", + "Imperial Fists", + "Night Lords", + "Blood Angels", + "Iron Hands", + "World Eaters", + "Ultramarines", + "Death Guard", + "Thousand Sons", + "Black Legion", + "Word Bearers", + "Salamanders", + "Raven Guard", + "Alpha Legion" + ]); + } + + + company_title = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ] + if(struct_exists(obj_creation, "company_title")){ + for(var ct = 0; ct < array_length(obj_creation.company_title); ct++){ + company_title[ct] = obj_creation.company_title[ct]; + } } - company_title[0] = ""; - array_copy(company_title, 1, obj_creation.company_title, 1, 40); - - - - home_name = obj_creation.homeworld_name; obj_creation.restart_home_name = home_name; - chapter_name = obj_creation.chapter; + chapter_name = obj_creation.chapter_name; // fortress_name=""; flagship_name = obj_creation.flagship_name; obj_creation.restart_flagship_name = flagship_name; @@ -570,10 +660,7 @@ function scr_initialize_custom() { adv = obj_creation.adv; dis = obj_creation.dis; - battle_barges = 0; - strike_cruisers = 0; - gladius = 0; - hunters = 0; + recruiting_type = obj_creation.recruiting; recruit_trial = obj_creation.aspirant_trial; @@ -582,139 +669,78 @@ function scr_initialize_custom() { home_name = obj_creation.homeworld_name; fleet_type = obj_creation.fleet_type; - if (obj_creation.fleet_type != 1) { - battle_barges = 1; - if (array_contains(obj_creation.adv, "Kings of Space")) battle_barges += 1; - strike_cruisers = 6; - if (array_contains(obj_creation.adv, "Boarders")) strike_cruisers += 2; + battle_barges = 0; + strike_cruisers = 0; + gladius = 0; + hunters = 0; + + if (obj_creation.fleet_type == eFLEET_TYPES.HOMEWORLD) { + strike_cruisers = 8; gladius = 7; hunters = 3; - // obj_controller.fleet_type="Fleet"; - } - if (obj_creation.fleet_type = 1) { - strike_cruisers = 8; - if (array_contains(obj_creation.adv, "Boarders")) strike_cruisers += 2; + } else { + battle_barges = 1; + strike_cruisers = 6; gladius = 7; hunters = 3; - if (array_contains(obj_creation.adv, "Kings of Space")) battle_barges += 1; - // obj_controller.fleet_type="Homeworld"; } - if (obj_creation.custom = 0) { - if (obj_creation.fleet_type != 1) { - flagship_name = obj_creation.flagship_name; - battle_barges = 1; - strike_cruisers = 6; + /** + * * Default fleet composition + * * Homeworld + * - 2 Battle Barges, 8 Strike cruisers, 7 Gladius, 3 Hunters + * * Fleet based and Penitent + * - 4 Battle Barges, 3 Strike Cruisers, 7 Gladius, 3 Hunters + */ + if (obj_creation.custom == 0) { + flagship_name = obj_creation.flagship_name; + if (obj_creation.fleet_type == eFLEET_TYPES.HOMEWORLD) { + battle_barges = 2; + strike_cruisers = 8; gladius = 7; hunters = 3; - - if (global.chapter_name = "Soul Drinkers") then gladius -= 4; - strike_cruisers -= 3; - battle_barges += 1; - - } - if (obj_creation.fleet_type = 1) { - strike_cruisers = 8; + } else { + battle_barges = 4; + strike_cruisers = 3; gladius = 7; hunters = 3; + } - if (global.chapter_name = "Raven Guard") { - flagship_name = "Avenger" - } - if (global.chapter_name = "Salamanders") { - flagship_name = "Flamewrought"; - } - - if (global.chapter_name = "Ultramarines") { - flagship_name = "Laurels of Victory"; - } - - if (global.chapter_name = "Imperial Fists") { - flagship_name = "Spear of Vengeance"; - battle_barges += 1; - } - - if (global.chapter_name = "Crimson Fists") { - flagship_name = "Throne's Fury"; - battle_barges -= 1; - gladius -= 3; - strike_cruisers -= 4 - } - - if (global.chapter_name = "Dark Angels") { - flagship_name = "Invincible Reason"; - battle_barges++; - - } - if (global.chapter_name = "Black Templars") { - flagship_name = "Eternal Crusader"; - - } - if (global.chapter_name = "Minotaurs") { - flagship_name = "Daedelos Krata"; + battle_barges = battle_barges + obj_creation.extra_ships.battle_barges; + strike_cruisers = strike_cruisers + obj_creation.extra_ships.strike_cruisers; + gladius = gladius + obj_creation.extra_ships.gladius; + hunters = hunters + obj_creation.extra_ships.hunters; - } - } - if (obj_creation.fleet_type = 3) { - if (global.chapter_name = "Lamenters") { - strike_cruisers = 2; - gladius = 2; - hunters = 1; - battle_barges = 0; - } - if (global.chapter_name = "Blood Ravens") { - battle_barges = 1; - } - } - if (global.chapter_name != "Lamenters") and(global.chapter_name != "Doom Benefactors") and(global.chapter_name != "Blood Ravens") then battle_barges += 2; } - var i = -1; - v = 0; - /*repeat(110){i+=1; - ship[i]="";ship_owner[i]=0;ship_class[i]="";ship_size[i]=0; - ship_leadership[i]=0;ship_hp[i]=0;ship_maxhp[i]=0;ship_location[i]="";ship_shields[i]=0; - ship_conditions[i]="";ship_speed[i]=0;ship_turning[i]=0; - ship_front_armour[i]=0;ship_other_armour[i]=0;ship_weapons[i]=0;ship_shields[i]=0; - ship_wep[i,0]="";ship_wep_facing[i,0]="";ship_wep_condition[i,0]=""; - ship_wep[i,1]="";ship_wep_facing[i,1]="";ship_wep_condition[i,1]=""; - ship_wep[i,2]="";ship_wep_facing[i,2]="";ship_wep_condition[i,2]=""; - ship_wep[i,3]="";ship_wep_facing[i,3]="";ship_wep_condition[i,3]=""; - ship_wep[i,4]="";ship_wep_facing[i,4]="";ship_wep_condition[i,4]=""; - ship_wep[i,5]="";ship_wep_facing[i,5]="";ship_wep_condition[i,5]=""; - ship_capacity[i]=0;ship_carrying[i]=0;ship_contents[i]="";ship_turrets[i]=0; - }*/ + if (scr_has_adv ("Kings of Space")) {battle_barges += 1;} + if (scr_has_adv("Boarders")){ strike_cruisers += 2;} + if (scr_has_disadv("Obliterated")) {battle_barges = 0; strike_cruisers = 1; gladius = 2; hunters = 0;} + + var ship_summary_str = $"Ships: bb: {battle_barges} sc: {strike_cruisers} g: {gladius} h: {hunters}" + // debugl(ship_summary_str); + // show_debug_message(ship_summary_str); if (battle_barges>=1){ - for (v=1;v<=battle_barges;v++){ - var new_ship = new_player_ship("Battle Barge", "home") - if (flagship_name!="") and (v=1) then ship[new_ship]=flagship_name; - if (flagship_name="") or (v>1) then ship[new_ship]=global.name_generator.generate_imperial_ship_name(); + for (v=0;v0) or ((global.chapter_name="Doom Benefactors") and (obj_creation.custom=0)){ - if ((progenitor >= 1) and(progenitor <= 10)) or((global.chapter_name = "Doom Benefactors") and(obj_creation.custom = 0)) { + // Strength ratings are made up for founding chapters + if (progenitor > ePROGENITOR.NONE && progenitor < ePROGENITOR.RANDOM) { if (obj_creation.strength <= 4) then ninth = 0; if (obj_creation.strength <= 3) then eighth = 0; if (obj_creation.strength <= 2) then seventh = 0; if (obj_creation.strength <= 1) then sixth = 0; - var bonus_marines = 0, - o = 0; + var bonus_marines = 0; if (obj_creation.strength > 5) then bonus_marines = (obj_creation.strength - 5) * 50; - - /*repeat(20){ - if (bonus_marines>=5) and (veteran>0){bonus_marines-=5;veteran+=5;} - if (bonus_marines>=5) and (second>0){bonus_marines-=5;second+=5;} - if (bonus_marines>=5) and (third>0){bonus_marines-=5;second+=5;} - if (bonus_marines>=5) and (fourth>0){bonus_marines-=5;second+=5;} - if (bonus_marines>=5) and (fifth>0){bonus_marines-=5;second+=5;} - if (bonus_marines>=5) and (sixth>0){bonus_marines-=5;second+=5;} - if (bonus_marines>=5) and (seventh>0){bonus_marines-=5;second+=5;} - if (bonus_marines>=5) and (eighth>0){bonus_marines-=5;second+=5;} - if (bonus_marines>=5) and (ninth>0){bonus_marines-=5;second+=5;} - if (bonus_marines>=5) and (tenth>0){bonus_marines-=5;second+=5;} - }*/ } if (obj_creation.custom != 0) { - var bonus_marines = 0, - o = 0; + var bonus_marines = 0; if (obj_creation.strength > 5) then bonus_marines = (obj_creation.strength - 5) * 50; - i = 0 + if scr_has_disadv("Obliterated") then bonus_marines = (obj_creation.strength - 5) * 10; + var i = 0; while (bonus_marines >= 5) { switch (i % 10) { case 0: @@ -1005,82 +1044,58 @@ function scr_initialize_custom() { } } + if(struct_exists(obj_creation, "extra_specialists")){ + var c_specialists = obj_creation.extra_specialists; + var c_specialist_names = struct_get_names(c_specialists); + for(var s = 0; s < array_length(c_specialist_names); s++){ + var s_name = c_specialist_names[s]; + var s_val = struct_get(c_specialists, s_name); + // show_debug_message($"updating specialist {s_name} with {s_val})"); + switch (s_name){ + case "chaplains": chaplains = chaplains + real(s_val); break; + case "chaplains_per_company": chaplains_per_company = chaplains_per_company + real(s_val); break; + case "techmarines": techmarines = techmarines + real(s_val); break; + case "techmarines_per_company": techmarines_per_company = techmarines_per_company + real(s_val); break; + case "apothecary": apothecary = apothecary + real(s_val); break; + case "apothecary_per_company": apothecary_per_company = apothecary_per_company + real(s_val); break; + case "epistolary": epistolary = epistolary + real(s_val); break; + case "epistolary_per_company": epistolary_per_company = epistolary_per_company + real(s_val); break; + case "codiciery": codiciery = codiciery + real(s_val); break; + case "lexicanum": lexicanum = lexicanum + real(s_val); break; + case "terminator": terminator = terminator + real(s_val); break; + case "assault": assault = assault + real(s_val); break; + case "veteran": veteran = veteran + real(s_val); break; + case "devastator": devastator = devastator + real(s_val); break; + } + } + } - - switch (global.chapter_name) { - case "Salamanders": - veteran += 20; - second += 20; - third += 20; - fourth += 20; - fifth += 20; - sixth += 20; - seventh = 0; - eighth = 0; - ninth = 0; - tenth -= 40; - break; - case "Blood Angels": - chaap += 4; - apothecary += 4; - epistolary += 1; - codiciery += 1; - lexicanum += 2; - break; - case "Dark Angels": - chaap += 4; - veteran = 5; - terminator = 100; - break; - case "Lamenters": - tenth = 0; - ninth = 0; - eighth = 0; - seventh = 0; - sixth = 0; - fifth = 0; - techs = 4; - chaap = 4; - apothecary = 4; - epistolary = 3; - codiciery = 3; - lexicanum = 6; - terminator = 5; - veteran += 10; - break; - case "Soul Drinkers": - tenth -= 38; - seventh = 0; - sixth = 40; - assault -= 10; - fifth -= 20; - fourth -= 20; - third -= 20; - second -= 20; - terminator -= 5; - veteran -= 20; - break; - case "Crimson Fists": - veteran += 30; - break; - case "Space Wolves": - veteran += 40; - second += 40; - third += 40; - fourth += 40; - fifth += 40; - sixth += 40; - seventh += 40; - eighth += 40; - ninth += 40; - tenth += 60; - break; - case "Iron Hands": - chaap = 0; - techmarines_per_company += 1; - break; + if(struct_exists(obj_creation, "extra_marines")){ + var c_marines = obj_creation.extra_marines; + var c_marines_names = struct_get_names(c_marines); + for(var s = 0; s < array_length(c_marines_names); s++){ + var s_name = c_marines_names[s]; + var s_val = struct_get(c_marines, s_name); + switch(s_name){ + case "second": second = second + real(s_val); break; + case "third": third = third + real(s_val); break; + case "fourth": fourth = fourth + real(s_val); break; + case "fifth": fifth = fifth + real(s_val); break; + case "sixth": sixth = sixth + real(s_val); break; + case "seventh": seventh = seventh + real(s_val); break; + case "eighth": eighth = eighth + real(s_val); break; + case "ninth": ninth = ninth + real(s_val); break; + case "tenth": tenth = tenth + real(s_val); break; + } + } } - if (obj_creation.custom = 0) and(global.chapter_name != "Iron Hands") and(global.chapter_name != "Doom Benefactors") { + if(chaplains <= 0) {chaplains_per_company = 0}; + if(apothecary <= 0) {apothecary_per_company = 0}; + if(techmarines <= 0) {techmarines_per_company = 0}; + if(epistolary <= 0) {epistolary_per_company = 0}; + + + if (obj_creation.custom == 0) { if (veteran >= 20) and(global.founding = 0) { veteran -= 20; terminator += 20; @@ -1089,13 +1104,9 @@ function scr_initialize_custom() { veteran -= 10; terminator += 10; } - // if (global.chapter_name="Lamenters") then terminator=0; - // tenth-=1; } - - icon = obj_creation.icon; icon_name = obj_creation.icon_name; battle_cry = obj_creation.battle_cry; @@ -1104,23 +1115,30 @@ function scr_initialize_custom() { // This needs to be updated main_color = obj_creation.main_color; secondary_color = obj_creation.secondary_color; - trim_color = obj_creation.trim_color; - pauldron2_color = obj_creation.pauldron2_color; - pauldron_color = obj_creation.pauldron_color; + main_trim = obj_creation.main_trim; + left_pauldron = obj_creation.left_pauldron; + right_pauldron = obj_creation.right_pauldron; lens_color = obj_creation.lens_color; weapon_color = obj_creation.weapon_color; col_special = obj_creation.col_special; trim = obj_creation.trim; skin_color = obj_creation.skin_color; - complex_livery_data = obj_creation.complex_livery_data; - var complex_type = ["sgt", "vet_sgt", "captain", "veteran"]; - for (var i=0;i>} TTRPG[0, i] = new TTRPG_stats("chapter", 0, i, "blank"); } - for (i = 0; i <= 100; i++) { - i += 1; - role[100, i] = ""; - wep1[100, i] = ""; - wep2[100, i] = ""; - armour[100, i] = ""; - gear[100, i] = ""; - mobi[100, i] = ""; //hirelings?? - role[102, i] = ""; - wep1[102, i] = ""; - wep2[102, i] = ""; - armour[102, i] = ""; - gear[102, i] = ""; - mobi[102, i] = ""; //hirelings?? - } - - for (i = 100; i < 103; i++) { // gear - role[i, 2] = "Honour Guard"; - wep1[i, 2] = "Power Sword"; - wep2[i, 2] = "Bolter"; - armour[i, 2] = "Artificer Armour"; - mobi[i, 2] = ""; - gear[i, 2] = ""; - - role[i, 3] = "Veteran"; - wep1[i, 3] = "Chainsword"; - wep2[i, 3] = "Combiflamer"; - armour[i, 3] = "Power Armour"; - mobi[i, 3] = ""; - gear[i, 3] = ""; - - role[i, 4] = "Terminator"; - wep1[i, 4] = "Power Fist"; - wep2[i, 4] = "Storm Bolter"; - armour[i, 4] = "Terminator Armour"; - mobi[i, 4] = ""; - gear[i, 4] = ""; - - role[i, 5] = "Captain"; - wep1[i, 5] = "Power Sword"; - wep2[i, 5] = "Bolt Pistol"; - armour[i, 5] = "Power Armour"; - mobi[i, 5] = ""; - gear[i, 5] = "Iron Halo"; - - role[i, 6] = "Dreadnought"; - wep1[i, 6] = "Dreadnought Lightning Claw"; - wep2[i, 6] = "Twin Linked Lascannon"; - armour[i, 6] = "Dreadnought"; - mobi[i, 6] = ""; - gear[i, 6] = ""; - - role[i, 7] = "Champion"; - wep1[i, 7] = "Power Sword"; - wep2[i, 7] = "Bolt Pistol"; - armour[i, 7] = "Power Armour"; - mobi[i, 7] = ""; - gear[i, 7] = "Combat Shield"; - - role[i, 8] = "Tactical"; - wep1[i, 8] = "Bolter"; - wep2[i, 8] = "Combat Knife"; - armour[i, 8] = "Power Armour"; - mobi[i, 8] = ""; - gear[i, 8] = ""; - - role[i, 9] = "Devastator"; - wep1[i, 9] = ""; - wep2[i, 9] = "Combat Knife"; - armour[i, 9] = "Power Armour"; - mobi[i, 9] = ""; - gear[i, 9] = ""; - - role[i, 10] = "Assault"; - wep1[i, 10] = "Chainsword"; - wep2[i, 10] = "Bolt Pistol"; - armour[i, 10] = "Power Armour"; - mobi[i, 10] = "Jump Pack"; - gear[i, 10] = ""; - - role[i, 11] = "Ancient"; - wep1[i, 11] = "Company Standard"; - wep2[i, 11] = "Bolt Pistol"; - armour[i, 11] = "Power Armour"; - mobi[i, 11] = ""; - gear[i, 11] = ""; - - role[i, 12] = "Scout"; - wep1[i, 12] = "Bolter"; - wep2[i, 12] = "Combat Knife"; - armour[i, 12] = "Scout Armour"; - mobi[i, 12] = ""; - gear[i, 12] = ""; - - role[i, 14] = "Chaplain"; - wep1[i, 14] = "Crozius Arcanum"; - wep2[i, 14] = "Bolt Pistol"; - armour[i, 14] = "Power Armour"; - gear[i, 14] = "Rosarius"; - mobi[i, 14] = ""; - - role[i, 15] = "Apothecary"; - wep1[i, 15] = "Chainsword"; - wep2[i, 15] = "Bolt Pistol"; - armour[i, 15] = "Power Armour"; - gear[i, 15] = "Narthecium"; - mobi[i, 15] = ""; - - role[i, 16] = "Techmarine"; - wep1[i, 16] = "Power Axe"; - wep2[i, 16] = "Bolt Pistol"; - armour[i, 16] = "Artificer Armour"; - gear[i, 16] = ""; - mobi[i, 16] = "Servo-arm"; - - role[i, 17] = "Librarian"; - wep1[i, 17] = "Force Staff"; - wep2[i, 17] = "Bolt Pistol"; - armour[i, 17] = "Power Armour"; - gear[i, 17] = "Psychic Hood"; - mobi[i, 17] = ""; - - role[i, 18] = "Sergeant"; - wep1[i, 18] = "Chainsword"; - wep2[i, 18] = "Bolt Pistol"; - armour[i, 18] = "Power Armour"; - mobi[i, 18] = ""; - gear[i, 18] = ""; - - role[i, 19] = "Veteran Sergeant"; - wep1[i, 19] = "Chainsword"; - wep2[i, 19] = "Plasma Pistol"; - armour[i, 19] = "Power Armour"; - mobi[i, 19] = ""; - gear[i, 19] = ""; - } // 100 is defaults, 101 is the allowable starting equipment // info - for (i = 0; i <= 20; i++) { - race[100, i] = obj_creation.race[100, i]; - role[100, i] = obj_creation.role[100, i]; - wep1[100, i] = obj_creation.wep1[100, i]; - wep2[100, i] = obj_creation.wep2[100, i]; - armour[100, i] = obj_creation.armour[100, i]; - gear[100, i] = obj_creation.gear[100, i]; - mobi[100, i] = obj_creation.mobi[100, i]; + for (var i = 0; i <= 100; i++) { + role[100, i] = ""; + wep1[100, i] = ""; + wep2[100, i] = ""; + armour[100, i] = ""; + gear[100, i] = ""; + mobi[100, i] = ""; //hirelings?? + role[102, i] = ""; + wep1[102, i] = ""; + wep2[102, i] = ""; + armour[102, i] = ""; + gear[102, i] = ""; + mobi[102, i] = ""; //hirelings?? + } + + defaults_slot = 100; + + function load_default_gear(_role_id, _role_name, _wep1, _wep2, _armour, _mobi, _gear){ + role[defaults_slot, _role_id] = _role_name; + wep1[defaults_slot, _role_id] = _wep1; + wep2[defaults_slot, _role_id] = _wep2; + armour[defaults_slot, _role_id] = _armour; + mobi[defaults_slot, _role_id] = _mobi; + gear[defaults_slot, _role_id] = _gear; + race[defaults_slot, _role_id] = 1; + } + var _hi_qual_armour = "Artificer Armour"; + if(scr_has_disadv("Poor Equipment")){ + _hi_qual_armour = "Power Armour"; + } + + load_default_gear(eROLE.HonourGuard, "Honour Guard", "Power Sword", "Bolter", _hi_qual_armour, "", ""); + load_default_gear(eROLE.Veteran, "Veteran", "Combiflamer", "Combat Knife","Power Armour", "", ""); + load_default_gear(eROLE.Terminator, "Terminator", "Power Fist", "Storm Bolter", "Terminator Armour", "", ""); + load_default_gear(eROLE.Captain, "Captain", "Power Sword", "Bolt Pistol", "Power Armour", "", "Iron Halo"); + load_default_gear(eROLE.Dreadnought, "Dreadnought", "Close Combat Weapon", "Lascannon", "Dreadnought", "", ""); + load_default_gear(eROLE.Champion, "Champion", "Power Sword", "Bolt Pistol", "Power Armour", "", "Combat Shield"); + load_default_gear(eROLE.Tactical, "Tactical", "Bolter", "Combat Knife", "Power Armour", "", ""); + load_default_gear(eROLE.Devastator, "Devastator", "", "Combat Knife", "Power Armour", "", ""); + load_default_gear(eROLE.Assault, "Assault", "Chainsword", "Bolt Pistol", "Power Armour", "Jump Pack", ""); + load_default_gear(eROLE.Ancient, "Ancient", "Company Standard", "Bolt Pistol", "Power Armour", "", ""); + load_default_gear(eROLE.Scout, "Scout", "Bolter", "Combat Knife", "Scout Armour", "", ""); + load_default_gear(eROLE.Chaplain, "Chaplain", "Crozius Arcanum", "Bolt Pistol", "Power Armour", "", "Rosarius"); + load_default_gear(eROLE.Apothecary, "Apothecary", "Chainsword", "Bolt Pistol", "Power Armour", "", "Narthecium"); + load_default_gear(eROLE.Techmarine, "Techmarine", "Power Axe", "Bolt Pistol", _hi_qual_armour, "Servo-arm", ""); + load_default_gear(eROLE.Librarian, "Librarian", "Force Staff", "Bolt Pistol", "Power Armour", "", "Psychic Hood"); + load_default_gear(eROLE.Sergeant, "Sergeant", "Chainsword", "Bolt Pistol", "Power Armour", "", ""); + load_default_gear(eROLE.VeteranSergeant, "Veteran Sergeant", "Chainsword", "Plasma Pistol", "Power Armour", "", ""); + + + if(struct_exists(obj_creation, "custom_roles")){ + var c_roles = obj_creation.custom_roles; + var possible_custom_roles = [ + ["chapter_master", eROLE.ChapterMaster], + ["honour_guard",eROLE.HonourGuard], + ["veteran",eROLE.Veteran], + ["terminator",eROLE.Terminator], + ["captain",eROLE.Captain], + ["dreadnought",eROLE.Dreadnought], + ["champion",eROLE.Champion], + ["tactical",eROLE.Tactical], + ["devastator",eROLE.Devastator], + ["assault",eROLE.Assault], + ["ancient",eROLE.Ancient], + ["scout",eROLE.Scout], + ["chaplain",eROLE.Chaplain], + ["apothecary",eROLE.Apothecary], + ["techmarine",eROLE.Techmarine], + ["librarian",eROLE.Librarian], + ["sergeant",eROLE.Sergeant], + ["veteran_sergeant",eROLE.VeteranSergeant], + ]; + var possible_custom_attributes = [ + "name", "wep1", "wep2", "mobi","gear","armour" + ] + /** + * check whether the json structure exists to populate custom role names and + * attributes then set them using the map above + * role[100] is the 'default role name' storage spot, or something + */ + for(var c = 0; c < array_length(possible_custom_roles); c++){ + if(struct_exists(c_roles, possible_custom_roles[c][0])){ + var c_rolename = possible_custom_roles[c][0]; + var c_roleid = possible_custom_roles[c][1]; + for(var a = 0; a < array_length(possible_custom_attributes); a++){ + var attribute = possible_custom_attributes[a]; + if(struct_exists(c_roles[$ c_rolename], attribute)){ + var value = c_roles[$ c_rolename][$ attribute]; + // var dbg_m = $"role {c_roleid} {c_rolename} updated {attribute} to {typeof(value)} {value}"; + // debugl(dbg_m); + // show_debug_message(dbg_m); + switch (attribute){ + case "name": role[defaults_slot][c_roleid] = value; break; + case "wep1": wep1[defaults_slot][c_roleid] = value; break; + case "wep2": wep2[defaults_slot][c_roleid] = value; break; + case "armour": armour[defaults_slot][c_roleid] = value; break; + case "gear": gear[defaults_slot][c_roleid] = value; break; + case "mobi": mobi[defaults_slot][c_roleid] = value; break; + } + // array_set_value(obj_ini[attribute][100][c_roleid], value); + // [$attribute][100][c_roleid] = value; + } + } + } + } } var roles = { - chapter_master: role[100][1], - honour_guard: role[100][2], - veteran: role[100][3], - terminator: role[100][4], - captain: role[100][5], - dreadnought: role[100][6], - champion: role[100][7], - tactical: role[100][8], - devastator: role[100][9], - assault: role[100][10], - ancient: role[100][11], - scout: role[100][12], - chaplain: role[100][14], - apothecary: role[100][15], - techmarine: role[100][16], - librarian: role[100][17], - sergeant: role[100][18], - veteran_sergeant: role[100][19], + chapter_master: role[defaults_slot][eROLE.ChapterMaster], + honour_guard: role[defaults_slot][eROLE.HonourGuard], + veteran: role[defaults_slot][eROLE.Veteran], + terminator: role[defaults_slot][eROLE.Terminator], + captain: role[defaults_slot][eROLE.Captain], + dreadnought: role[defaults_slot][eROLE.Dreadnought], + champion: role[defaults_slot][eROLE.Champion], + tactical: role[defaults_slot][eROLE.Tactical], + devastator: role[defaults_slot][eROLE.Devastator], + assault: role[defaults_slot][eROLE.Assault], + ancient: role[defaults_slot][eROLE.Ancient], + scout: role[defaults_slot][eROLE.Scout], + chaplain: role[defaults_slot][eROLE.Chaplain], + apothecary: role[defaults_slot][eROLE.Apothecary], + techmarine: role[defaults_slot][eROLE.Techmarine], + librarian: role[defaults_slot][eROLE.Librarian], + sergeant: role[defaults_slot][eROLE.Sergeant], + veteran_sergeant: role[defaults_slot][eROLE.VeteranSergeant], } - + var weapon_lists = { heavy_weapons: ["Heavy Bolter", "Heavy Bolter", "Heavy Bolter", "Heavy Bolter", "Missile Launcher", "Missile Launcher", "Multi-Melta", "Lascannon"], special_weapons: ["Flamer", "Flamer", "Flamer", "Meltagun", "Meltagun", "Plasma Gun"], @@ -1367,11 +1347,12 @@ function scr_initialize_custom() { } /* squad guidance - define a role that can exist in a squad by defining [, { - "max": - "min": - } - ] + define a role that can exist in a squad by defining + [, { + "max": + "min": + } + ] by adding "loadout" as a key to the role struct e.g {"min":1,"max":1,"loadout":{}} a default or optional loadout can be created for the given role in the squad "loadout" has two possible keys "required" and "option" @@ -1385,11 +1366,15 @@ function scr_initialize_custom() { */ var squad_name = "Squad"; - if (global.chapter_name == "Space Wolves" || obj_ini.progenitor == 3) { - squad_name = "Pack"; + if(obj_creation.custom != 0){ + if (obj_ini.progenitor == ePROGENITOR.SPACE_WOLVES) { + squad_name = "Pack"; + } + if (obj_ini.progenitor == ePROGENITOR.IRON_HANDS) { + squad_name = "Clave"; + } } - if (global.chapter_name == "Iron Hands" || obj_ini.progenitor == 6) { - squad_name = "Clave"; + if(struct_exists(obj_creation, "squad_name")) {squad_name = obj_creation.squad_name; } squad_types = {}; var st = { @@ -1421,6 +1406,12 @@ function scr_initialize_custom() { [roles.veteran, { "max": 5, "min": 0, + "loadout": { + "required": { + "wep1": [wep1[defaults_slot][eROLE.Veteran], 5], + "wep2": [wep2[defaults_slot][eROLE.Veteran], 5], + } + }, "role": $"Company {roles.veteran}" }], [roles.techmarine, { @@ -1447,7 +1438,8 @@ function scr_initialize_custom() { "role": $"{roles.terminator} {roles.sergeant}", "loadout": { "required": { - "wep1": ["Power Sword", 1], + "wep1": [wep1[defaults_slot][eROLE.Terminator], 1], + "wep2": [wep2[defaults_slot][eROLE.Terminator], 1], }, } }], @@ -1528,11 +1520,11 @@ function scr_initialize_custom() { "role": $"Sternguard {roles.veteran}", "loadout": { "required": { - "wep1": ["Combat Knife", 9], - "wep2": ["", 0], + "wep1": ["", 0], + "wep2": ["Combat Knife", 9], }, "option": { - "wep2": [ + "wep1": [ [ ["Bolter", "Stalker Pattern Bolter", "Storm Bolter"], 5 ], @@ -1553,11 +1545,11 @@ function scr_initialize_custom() { [roles.veteran_sergeant, { "max": 1, "min": 1, - "role": $"Sternguard {roles.sergeant}", + "role": $"Sternguard {roles.veteran_sergeant}", "loadout": { "required": { - "wep1": [wep1[100, 3], 1], - "wep2": ["Stalker Pattern Bolter", 1], + "wep1": ["Stalker Pattern Bolter", 1], + "wep2": [wep2[100][eROLE.Veteran], 1], }, } }], @@ -1606,7 +1598,7 @@ function scr_initialize_custom() { [roles.veteran_sergeant, { "max": 1, "min": 1, - "role": $"Vanguard {roles.sergeant}", + "role": $"Vanguard {roles.veteran_sergeant}", "loadout": { "required": { "wep1": ["Thunder Hammer", 1], @@ -1722,7 +1714,10 @@ function scr_initialize_custom() { ["type_data", { "display_data": $"{roles.tactical} {squad_name}", "formation_options": ["tactical", "assault", "devastator", "scout"], - }] + "class":["troop"] + }], + + ], "assault_squad": [ @@ -1731,13 +1726,13 @@ function scr_initialize_custom() { "min": 4, "loadout": { "required": { - "wep1": [wep1[100, 10], 7], - "wep2": [wep2[100, 10], 7], + "wep1": [wep1[100, 10], 5], + "wep2": [wep2[100, 10], 5], }, "option": { "wep1": [ [ - ["Eviscerator"], 2 + weapon_lists.melee_weapons, 2, ], ], "wep2": [ @@ -1864,7 +1859,35 @@ function scr_initialize_custom() { }], ] }; - if (global.chapter_name == "Salamanders") or (array_contains(obj_creation.adv, "Crafters")) { //salamanders squads + + // show_debug_message($"squads object for chapter {chapter_name}"); + // show_debug_message($"{st}"); + + + if(struct_exists(obj_creation, "custom_squads")){ + var custom_squads = obj_creation.custom_squads; + // show_debug_message($"custom roles {custom_squads}"); + if(array_length(struct_get_names(custom_squads)) != 0){ + var names = struct_get_names(st); + // show_debug_message($"names {names}"); + for(var n = 0; n < array_length(names); n++){ + var squad_name = names[n]; + // show_debug_message($"matched squad name name {squad_name}"); + + if(struct_exists(custom_squads, squad_name)){ + var custom_squad = struct_get(custom_squads, squad_name); + // show_debug_message($"overwriting squad layout for {squad_name}"); + // show_debug_message($"{custom_squad}") + variable_struct_set(st, squad_name, custom_squad); + } + } + } + } + + // show_debug_message($"roles object for chapter {chapter_name} after setting from obj"); + // show_debug_message($"{st}"); + + if (scr_has_adv("Crafters")) { //salamanders squads variable_struct_set(st, "assault_squad", [ [roles.assault, { "max": 9, @@ -1918,28 +1941,28 @@ function scr_initialize_custom() { }] ]) } - if (global.chapter_name == "White Scars") or (array_contains(obj_creation.adv, "Lightning Warriors")) { + if (scr_has_adv("Lightning Warriors")) { variable_struct_set(st, "bikers", [ [roles.tactical, { "max": 9, "min": 4, "loadout": { //tactical marine - "required": { - "wep1": [wep1[100, 8], 4], - "wep2": [wep2[100, 8], 4], + "required": { + "wep1": [wep1[100, 8], 6], + "wep2": [wep2[100, 8], 6], "mobi": ["Bike", max] }, "option": { "wep1": [ [ - ["Plasma Gun", "Storm Bolter", "Flamer", "Meltagun"], 3 + weapon_lists.special_weapons, 3 ], ], "wep2": [ [ - ["Power Sword", "Power Axe", "Chainsword"], 3 + weapon_lists.melee_weapons, 3 ], - ] + ], } }, "role": $"{roles.tactical} Biker" @@ -1949,25 +1972,29 @@ function scr_initialize_custom() { "min": 1, "loadout": { //sergeant "required": { + "wep1": ["", 0], + "wep2": ["Chainsword", 1], "mobi": ["Bike", 1] }, "option": { "wep1": [ [ - ["Power Sword", "Power Axe", "Power Fist", "Thunder Hammer", "Chainsword"], 1 - ] + weapon_lists.pistols, 1 + ], ], "wep2": [ [ - ["Plasma Pistol", "Storm Bolter", "Plasma Gun"], 1 - ] - ] + weapon_lists.melee_weapons, 1 + ], + ], } }, "role": $"{roles.tactical} Bike {roles.sergeant}" }, ], ["type_data", { - "display_data": $"{roles.tactical} Bike {squad_name}" + "display_data": $"{roles.tactical} Bike {squad_name}", + "class":["bike"], + "formation_options": ["tactical", "assault", "devastator", "scout"], }] ]) @@ -1975,237 +2002,171 @@ function scr_initialize_custom() { [roles.tactical, { "max": 9, "min": 4, - "loadout": { //tactical marine + "loadout": { "required": { - "wep1": [wep1[100, 8], 4], - "wep2": [wep2[100, 8], 4], + "wep1": [wep1[100, 8], 7], + "wep2": [wep2[100, 8], 7] }, "option": { "wep1": [ [ - ["Meltagun", "Flamer"], 2 - ], - [ - ["Stalker Pattern Bolter", "Storm Bolter"], 2 + weapon_lists.special_weapons, 1 ], [ - weapon_lists.heavy_weapons, 1 + weapon_lists.heavy_weapons, 1, { + "wep2":"Combat Knife", + "mobi":"Heavy Weapons Pack", + } ] ], - "wep2": [ + } + } + }], + [roles.sergeant, { + "max": 1, + "min": 1, + "role": $"{roles.tactical} {roles.sergeant}", + "loadout": { + "required": { + "wep1": ["", 0], + "wep2": ["Chainsword", 1] + }, + "option": { + "wep1": [ [ - ["Chainsword"], 3 + weapon_lists.pistols, 1 ], + ], + "wep2": [ [ - ["Power Sword", "Power Axe"], 2 + weapon_lists.melee_weapons, 1 ], - ] + ], } } }], - - [roles.sergeant, { - "max": 1, - "min": 1, - "role": $"{roles.tactical} {roles.sergeant}" - }], // sergeant ["type_data", { - "display_data": $"{roles.tactical} {squad_name}" + "display_data": $"{roles.tactical} {squad_name}", + "formation_options": ["tactical", "assault", "devastator", "scout"], }] ]) } - if (global.chapter_name == "Imperial Fists") or (array_contains(obj_creation.adv, "Boarders")) { + if (scr_has_adv("Boarders")) { variable_struct_set(st, "breachers", [ - [roles.assault, { - "max": 9, - "min": 4, - "loadout": { //assault breacher marine - "required": { - "wep1":["Chainaxe", 4], - "wep2":["Boarding Shield", max], - "armour":["MK3 Iron Armour", max], - "gear":["Plasma Bomb", 2], - "mobi":["", max] - }, - "option": { - "wep1": [ - [ - ["Storm Bolter", "Combiflamer", "Meltagun"], 2, - ], - [ - ["Power Axe", "Power Fist"], 2 - ] - - ] - } - }, - "role": $"{roles.assault} Breacher" - }], - [roles.sergeant, { - "max": 1, - "min": 1, - "loadout": { //sergeant - "required": { - "armour":["MK3 Iron Armour", 1], - "gear": ["Plasma Bomb", 1] - }, - "option": { - "wep1": [ - [ - ["Power Sword", "Power Axe", "Power Fist", "Thunder Hammer", "Chainsword"], 1 - ] - ], - "wep2": [ - [ - ["Boarding Shield", "Storm Bolter", "Meltagun"], 1 - ] - ] - } - }, - "role": $"{roles.assault} Breacher {roles.sergeant}" - }, ], - ["type_data", { - "display_data": $"{roles.assault} Breacher {squad_name}" - }] - ]) - } - variable_struct_set(st,"assault_squad", [ [roles.assault, { "max": 9, "min": 4, - "loadout": { + "loadout": { //assault breacher marine "required": { - "wep1": [wep1[100, 10], 7], - "wep2": [wep2[100, 10], 7], + "wep1":["Chainaxe", 4], + "wep2":["Boarding Shield", max], + "armour":["MK3 Iron Armour", max], + "gear":["Plasma Bomb", 2], + "mobi":["", max] }, "option": { "wep1": [ [ - ["Eviscerator"], 2 + ["Storm Bolter", "Combiflamer", "Meltagun"], 3, ], - ], - "wep2": [ [ - ["Plasma Pistol", "Flamer"], 2 + ["Power Axe", "Power Fist"], 2 ] + ] - } - } + } + }, + "role": $"{roles.assault} Breacher" }], [roles.sergeant, { "max": 1, "min": 1, - "role": $"{roles.assault} {roles.sergeant}", - "loadout": { + "loadout": { //sergeant "required": { - "wep1": ["", 0], - "wep2": ["", 0], - "gear": ["Combat Shield", 1] + "armour":["MK3 Iron Armour", 1], + "mobi": ["",1], + "gear": ["Plasma Bomb", 1] }, "option": { "wep1": [ [ - weapon_lists.pistols, 1 - ], + ["Power Sword", "Power Axe", "Power Fist", "Thunder Hammer", "Chainsword"], 1 + ] ], "wep2": [ [ - weapon_lists.melee_weapons, 1 - ], - ], + ["Boarding Shield", "Storm Bolter", "Meltagun"], 1 + ] + ] } - } - }], + }, + "role": $"{roles.assault} Breacher {roles.sergeant}" + }, ], ["type_data", { - "display_data": $"{roles.assault} {squad_name}", - "formation_options": ["assault"], + "display_data": $"{roles.assault} Breacher {squad_name}", + "formation_options": ["tactical", "assault", "devastator", "scout"], }] ]) - - if (global.chapter_name == "Dark Angels") { - variable_struct_set(st, "terminator_squad", [ - // Terminator Sergeant - [roles.veteran_sergeant, { - "max": 1, - "min": 1, - "role": $"Deathwing {roles.sergeant}", - "loadout": { - "required": { - "wep1": ["Power Sword", 1], - }, - } - }], - // Terminator - [roles.terminator, { - "max": 4, - "min": 2, - "role": $"Deathwing {roles.terminator}", + variable_struct_set(st,"assault_squad", [ + [roles.assault, { + "max": 9, + "min": 4, "loadout": { "required": { - "wep1": ["", 0], - "wep2": [wep2[100, 4], 3], + "wep1": [wep1[100, 10], 7], + "wep2": [wep2[100, 10], 7], }, "option": { "wep1": [ [ - ["Power Fist", "Chainfist"], 4 + weapon_lists.melee_weapons, 2 ], ], "wep2": [ [ - ["Heavy Flamer", "Heavy Flamer", "Heavy Flamer", "Assault Cannon", "Assault Cannon", "Plasma Cannon", ], 1 - ], - ], + ["Plasma Pistol", "Flamer"], 2 + ] + ] } } }], - ["type_data", { - "display_data": $"Deathwing {roles.terminator} {squad_name}", - "formation_options": ["terminator", "veteran", "assault", "devastator", "scout", "tactical"], - }] - ]) - variable_struct_set(st, "terminator_assault_squad", [ - // Assault Terminator Sergeant - [roles.veteran_sergeant, { + [roles.sergeant, { "max": 1, "min": 1, - "role": $"Deathwing {roles.sergeant}", - "loadout": { - "required": { - "wep1": ["Thunder Hammer", 1], - "wep2": ["Storm Shield", 1], - }, - }, - }], - // Assault Terminator - [roles.terminator, { - "max": 4, - "min": 2, - "role": $"Deathwing {roles.terminator}", + "role": $"{roles.assault} {roles.sergeant}", "loadout": { "required": { - "wep1": ["Thunder Hammer", 1], - "wep2": ["Storm Shield", 1], + "wep1": ["", 0], + "wep2": ["", 0], + "gear": ["Combat Shield", 1] }, "option": { "wep1": [ [ - ["Lightning Claw"], 3, { - "wep2":"Lightning Claw", - } + weapon_lists.pistols, 1 + ], + ], + "wep2": [ + [ + weapon_lists.melee_weapons, 1 ], ], } - }, - }, ], + } + }], ["type_data", { - "display_data": $"Deathwing {roles.terminator} {squad_name}", - "formation_options": ["terminator", "veteran", "assault", "devastator", "scout", "tactical"], + "display_data": $"{roles.assault} {squad_name}", + "formation_options": ["tactical", "assault", "devastator", "scout"], }] ]) } + var squad_names = struct_get_names(st); + // show_debug_message($" {squad_names}"); + // show_debug_message($"^^^ Squad names"); + + for (var st_iter = 0; st_iter < array_length(squad_names); st_iter++) { var s_group = st[$squad_names[st_iter]]; squad_types[$squad_names[st_iter]] = {}; @@ -2213,13 +2174,27 @@ function scr_initialize_custom() { squad_types[$squad_names[st_iter]][$s_group[iter_2][0]] = s_group[iter_2][1]; } } + if(scr_has_adv("Ambushers")){ + var _class_data = squad_types.tactical_squad.type_data.class; + array_push(_class_data, "scout") + } + // show_debug_message("Squad types"); + // show_debug_message(squad_types); - for (i = 0; i <= 20; i++;) { - if (role[100, i] != "") then scr_start_allow(i, "wep1", wep1[100, i]); - if (role[100, i] != "") then scr_start_allow(i, "wep2", wep2[100, i]); - if (role[100, i] != "") then scr_start_allow(i, "mobi", mobi[100, i]); - if (role[100, i] != "") then scr_start_allow(i, "gear", gear[100, i]); + for (i = 0; i <= 20; i++) { + if (role[defaults_slot, i] != "") { + scr_start_allow(i, "wep1", wep1[defaults_slot, i]); + } + if (role[defaults_slot, i] != "") { + scr_start_allow(i, "wep2", wep2[defaults_slot, i]); + } + if (role[defaults_slot, i] != "") { + scr_start_allow(i, "mobi", mobi[defaults_slot, i]); + } + if (role[defaults_slot, i] != "") { + scr_start_allow(i, "gear", gear[defaults_slot, i]); + } // check for allowable starting equipment here } @@ -2301,164 +2276,51 @@ function scr_initialize_custom() { //TODO will refactor how traits are distributed to chapter masters along with a refactor of chapter data last_artifact = find_open_artifact_slot(); var arti; - switch (global.chapter_name) { - case "Dark Angels": - chapter_master.add_trait("old_guard"); - chapter_master.add_trait("melee_enthusiast"); + + // From json + if(struct_exists(obj_creation, "artifact") ){ + if(is_struct(obj_creation.artifact) && struct_exists(obj_creation.artifact, "name")){ arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "Sword of Secrets"; - arti.custom_description = "A master-crafted Power Sword of formidable potency created soon after the disappearance of Lion El'Jonson. It is the mightiest of the Heavenfall Blades,"; - obj_ini.artifact[last_artifact] = "Power Sword"; - arti.bearer = [0, 1]; + arti.name = obj_creation.artifact.name; + arti.custom_description = obj_creation.artifact.description; + obj_ini.artifact[last_artifact] = obj_creation.artifact.base_weapon_type; + arti.bearer = [0,1]; obj_ini.artifact_identified[last_artifact] = 0; chapter_master_equip.wep1 = last_artifact; - break; - case "Blood Angels": - chapter_master.add_trait("ancient"); - chapter_master.add_trait("old_guard"); - chapter_master.add_trait("melee_enthusiast"); - arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "Axe Mortalis"; - arti.custom_description = "An immensely powerful Power Axe, the Axe Mortalis, forged in the days immediately after the end of the Horus Heresy."; - obj_ini.artifact[last_artifact] = "Power Axe"; - arti.bearer = [0, 1]; - obj_ini.artifact_identified[last_artifact] = 0; - chapter_master_equip.wep1=last_artifact; - chapter_master_equip.gear="Iron Halo"; - chapter_master_equip.mobi="Jump Pack"; - break; - case "Iron Hands": - chapter_master_equip.wep1 = "Power Axe"; - chapter_master.add_trait("flesh_is_weak"); - chapter_master.add_trait("zealous_faith"); - chapter_master.add_trait("tinkerer"); - for (i = 0; i < 10; i++) { - chapter_master.add_bionics("none", "standard", false); - } - chapter_master.add_trait("old_guard"); - break; - case "Doom Benefactors": - for (i = 0; i < 4; i++) { - chapter_master.add_bionics("none", "standard", false); + } else if(is_array(obj_creation.artifact) && array_length(obj_creation.artifact) > 0){ + for(var a = 0; a < array_length(obj_creation.artifact); a++){ + arti = obj_ini.artifact_struct[last_artifact]; + arti.name = obj_creation.artifact[a].name; + arti.custom_description = obj_creation.artifact[a].description; + obj_ini.artifact[last_artifact] = obj_creation.artifact[a].base_weapon_type; + arti.bearer = [0,1]; + obj_ini.artifact_identified[last_artifact] = 0; + switch (obj_creation.artifact[a].slot){ + case "wep1": chapter_master_equip.wep1 = last_artifact; break; + case "wep2": chapter_master_equip.wep2 = last_artifact; break; + case "armour": chapter_master_equip.armour = last_artifact; break; + case "gear": chapter_master_equip.gear = last_artifact; break; + case "mobi": chapter_master_equip.armour = last_artifact; break; + } + last_artifact++; } - chapter_master.add_trait("old_guard"); - break; - case "Ultramarines": - for (i = 0; i < 4; i++) { + } + } + if(struct_exists(obj_creation, "chapter_master")){ + if(struct_exists(obj_creation.chapter_master, "gear") && obj_creation.chapter_master.gear != ""){ + chapter_master_equip.gear = obj_creation.chapter_master.gear; + } + if(struct_exists(obj_creation.chapter_master, "mobi") && obj_creation.chapter_master.mobi != ""){ + chapter_master_equip.mobi = obj_creation.chapter_master.mobi; + } + if(struct_exists(obj_creation.chapter_master, "armour") && obj_creation.chapter_master.armour != ""){ + chapter_master_equip.armour = obj_creation.chapter_master.armour; + } + if(struct_exists(obj_creation.chapter_master, "bionics") && obj_creation.chapter_master.bionics != ""){ + for (i = 0; i < real(obj_creation.chapter_master.bionics); i++) { chapter_master.add_bionics("none", "standard", false); } - chapter_master.add_trait("still_standing"); - chapter_master.add_trait("tyrannic_vet"); - - arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "Gauntlet of Ultramar"; - arti.custom_description = "A mighty Power Fist with an Integrated Bolter that was reclaimed from a fallen Chaos champion, slain during the Gamalia Reclusiam Massacre by the Primarch of the Ultramarines, Roboute Guilliman himself"; - obj_ini.artifact[last_artifact] = "Boltstorm Gauntlet"; - obj_ini.artifact_identified[last_artifact] = 0; - arti.bearer = [0, 1]; - chapter_master_equip.wep1 = last_artifact; - last_artifact++; - - arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "Gauntlet of Ultramar"; - arti.custom_description = "A mighty Power Fist with an Integrated Bolter that was reclaimed from a fallen Chaos champion, slain during the Gamalia Reclusiam Massacre by the Primarch of the Ultramarines, Roboute Guilliman himself"; - obj_ini.artifact[last_artifact] = "Boltstorm Gauntlet"; - obj_ini.artifact_identified[last_artifact] = 0; - arti.bearer = [0, 1]; - chapter_master_equip.wep2 = last_artifact; - last_artifact++; - - chapter_master_equip.armour = last_artifact; - arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "Armour of Antilochus"; - arti.custom_description = "A masterwork suit of the standard Indomitus pattern Terminator Armour. It incorporates a Teleport Homer, allowing Terminator squads of the veteran First Company to deploy next to their Chapter Master's side."; - arti.bearer = [0, 1]; - obj_ini.artifact_identified[last_artifact] = 0; - obj_ini.artifact[last_artifact] = "Terminator Armour"; - break; - case "Space Wolves": - chapter_master_equip.armour = "Terminator Armour"; - chapter_master.add_trait("ancient"); - chapter_master.add_trait("melee_enthusiast"); - chapter_master.add_trait("feet_floor"); - arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "Axe of Morkai"; - arti.custom_description = "Once a Khornate axe of great power it was reforged in the image of the death wolf Morkai"; - obj_ini.artifact[last_artifact] = "Executioner Power Axe"; - arti.bearer = [0, 1]; - obj_ini.artifact_identified[last_artifact] = 0; - chapter_master_equip.wep1 = last_artifact; - break; - case "Black Templars": - chapter_master.add_trait("melee_enthusiast"); - chapter_master.add_trait("zealous_faith"); - chapter_master.add_trait("old_guard"); - arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "Sword of the High Marshalls"; - arti.custom_description = "A relic blade forged from the shards of Rogal Dorn's shattered sword passed down by the High Marshalls as a sign of office"; - obj_ini.artifact[last_artifact] = "Relic Blade"; - arti.bearer = [0, 1]; - obj_ini.artifact_identified[last_artifact] = 0; - chapter_master_equip.wep1 = last_artifact; - break; - case "Minotaurs": - chapter_master.add_trait("very_hard_to_kill"); - chapter_master.add_trait("seasoned"); - chapter_master_equip.armour = "Tartaros"; - arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "The Black Spear"; - arti.custom_description = "An ancient artefact that is steeped in blood and said to have once been used by the Legio Custodes."; - obj_ini.artifact[last_artifact] = "Power Spear"; - arti.bearer = [0, 1]; - obj_ini.artifact_identified[last_artifact] = 0; - chapter_master_equip.wep1 = last_artifact; - case "Lamenters": - chapter_master.add_trait("shitty_luck"); - chapter_master.add_trait("old_guard"); - case "Salamanders": - chapter_master.add_trait("old_guard"); - chapter_master.add_trait("tinkerer"); - chapter_master.add_trait("slow_and_purposeful"); - arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "Stormbearer"; - arti.custom_description = "A masterwork Thunder Hammer, Stormbearer is thought to be made from the same material as that used to create Thunderhead, the Thunder Hammer of Vulkan."; - obj_ini.artifact[last_artifact] = "Thunder Hammer"; - arti.bearer = [0, 1]; - obj_ini.artifact_identified[last_artifact] = 0; - chapter_master_equip.wep1 = last_artifact; - break; - case "Raven Guard": - mobi[0, 1] = "Jump Pack&SIL|"; - chapter_master.add_trait("lightning_warriors"); - chapter_master.add_trait("still_standing"); - chapter_master.add_trait("seasoned"); - break; - case "Carcharodons": - - chapter_master.add_trait("melee_enthusiast") - chapter_master.add_trait("slow_and_purposeful"); - chapter_master.add_trait("ancient"); - arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "Hunger"; - arti.custom_description = "An artifact Lightning Claw of unknown origin that has an inner maw of adamantium toothed chainblades usually paired with Slake"; - obj_ini.artifact[last_artifact] = "Lightning Claw"; - obj_ini.artifact_identified[last_artifact] = 0; - arti.bearer = [0, 1]; - chapter_master_equip.wep1 = last_artifact; - - arti.name = "Hunger & Slake"; - arti.custom_description = "An artifact Lightning Claw of unknown origin that has an inner maw of adamantium toothed chainblades usually paired with Hunger"; - obj_ini.artifact[last_artifact] = "Lightning Claw"; - obj_ini.artifact_identified[last_artifact] = 0; - arti.bearer = [0, 1]; - chapter_master_equip.wep2 = last_artifact; - - chapter_master_equip.armour = "Terminator Armour" - - break; - default: - chapter_master.add_trait("old_guard"); - + } } spe[company, 1] = ""; chapter_master.add_trait("lead_example"); @@ -2507,149 +2369,80 @@ function scr_initialize_custom() { } mobi[company, 1] = mobi[100, 2]; chapter_master.alter_equipment(chapter_master_equip, false, false, "master_crafted") - if (scr_has_adv("Paragon")) then chapter_master.add_trait("paragon") + if(scr_has_adv("Paragon")){ + chapter_master.add_trait("paragon"); + } chapter_master.marine_assembling(); - //TODO All heads of specialties data should be in chapter data + var _hq_armour = "Artificer Armour"; + if(scr_has_disadv("Poor Equipment")){ + _hq_armour = "MK6 Corvus"; + } + + k = 1; + commands = 1; + // Forge Master - TTRPG[company, 2] = new TTRPG_stats("chapter", company, 2); - race[company, 2] = 1; - loc[company, 2] = home_name; - role[company, 2] = "Forge Master"; - wep1[company, 2] = "Infernus Pistol"; name[company, 2] = obj_creation.fmaster; - wep2[company, 2] = "Power Axe"; - armour[company, 2] = "Artificer Armour"; - mobi[company, 2] = "Servo-harness"; - gear[company, 2] = ""; - chaos[company, 2] = 0; - spawn_unit = TTRPG[company, 2]; - if (spawn_unit.technology < 40) { - spawn_unit.technology = 40; + var _forge_master = add_unit_to_company("marine", company, 2, "Forge Master", eROLE.Techmarine, "Infernus Pistol", "Power Axe", "", "Servo-harness", _hq_armour); + if (_forge_master.technology < 40) { + _forge_master.technology = 40; } - spawn_unit.add_trait("mars_trained"); - spawn_unit.add_bionics("right_arm", "standard", false); - spawn_unit.marine_assembling(); - if (global.chapter_name = "Lamenters") then armour[company, 2] = "MK6 Corvus"; + _forge_master.add_trait("mars_trained"); + _forge_master.add_bionics("right_arm", "standard", false); + _forge_master.marine_assembling(); if (global.chapter_name = "Iron Hands") { repeat(9) { - spawn_unit.add_bionics("none", "standard", false); + _forge_master.add_bionics("none", "standard", false); } } else { repeat(irandom(5) + 3) { - spawn_unit.add_bionics("none", "standard", false) + _forge_master.add_bionics("none", "standard", false) }; } + k+=1; + commands +=1; + // Master of Sanctity (Chaplain) - if (global.chapter_name != "Iron Hands"){ - TTRPG[company, 3] = new TTRPG_stats("chapter", company, 3); - race[company, 3] = 1; - loc[company, 3] = home_name; - role[company, 3] = "Master of Sanctity"; - wep1[company, 3] = wep1[101, 14]; - name[company, 3] = obj_creation.hchaplain; - wep2[company, 3] = "Plasma Pistol"; - armour[company, 3] = "Artificer Armour"; - gear[company, 3] = gear[101, 14]; - chaos[company, 3] = -100; - if (global.chapter_name = "Lamenters") then armour[company, 3] = "MK6 Corvus"; - spawn_unit = TTRPG[company, 3]; - if (spawn_unit.piety < 45) { - spawn_unit.piety = 45; + if (chaplains > 0){ + name[company, 3] = high_chaplain_name; + var _hchap = add_unit_to_company("marine", company, 3, "Master of Sanctity", eROLE.Chaplain, "default", "Plasma Pistol", "default", "", _hq_armour); + _hchap.edit_corruption(-100); + if (_hchap.piety < 45) { + _hchap.piety = 45; } - spawn_unit.marine_assembling(); - spawn_unit.add_trait("zealous_faith"); + _hchap.add_trait("zealous_faith"); + k+=1; + commands +=1; } // Maser of the Apothecarion (Apothecary) - TTRPG[company, 4] = new TTRPG_stats("chapter", company, 4); - race[company, 4] = 1; - loc[company, 4] = home_name; - role[company, 4] = "Master of the Apothecarion"; - wep1[company, 4] = wep1[101, 15]; name[company, 4] = obj_creation.hapothecary; - wep2[company, 4] = "Plasma Pistol"; - armour[company, 4] = "Artificer Armour"; - gear[company, 4] = gear[101, 15]; - chaos[company, 4] = 0; - spawn_unit = TTRPG[company][4]; - spawn_unit.marine_assembling(); - if (global.chapter_name = "Lamenters") then armour[company, 4] = "MK6 Corvus"; + var _hapoth = add_unit_to_company("marine", company, 4, "Master of the Apothecarion", eROLE.Apothecary, "default", "Plasma Pistol", "default", "", _hq_armour); + _hapoth.edit_corruption(0); + k+=1; + commands +=1; // Chief Librarian - TTRPG[company][5] = new TTRPG_stats("chapter", company, 5); - var cheif_lib = TTRPG[company][5]; - race[company, 5] = 1; - loc[company, 5] = home_name; - role[company, 5] = string("Chief {0}", role[100, 17]); - wep1[company, 5] = wep1[101, 17]; - name[company, 5] = obj_creation.clibrarian; - wep2[company, 5] = "Plasma Pistol"; - armour[company, 5] = "Artificer Armour"; - gear[company, 5] = gear[101, 17]; - chaos[company, 5] = 0; - spawn_unit = TTRPG[company][5]; - spawn_unit.marine_assembling(); - if (global.chapter_name = "Lamenters") then armour[company, 5] = "MK6 Corvus"; - if (obj_creation.discipline = "default") { - let = "D"; - letmax = 7; - } - if (obj_creation.discipline = "biomancy") { - let = "B"; - letmax = 5; - } - if (obj_creation.discipline = "pyromancy") { - let = "P"; - letmax = 5; - } - if (obj_creation.discipline = "telekinesis") { - let = "T"; - letmax = 5; - } - if (obj_creation.discipline = "rune Magick") { - let = "R"; - letmax = 5; - } - spe[company, 5] = string(let) + "0|"; - cheif_lib.psionic = choose(13, 14, 15, 16); - cheif_lib.update_powers(); - cheif_lib.add_trait("warp_touched"); - k = 0; - commands += 5; - k = 5; - man_size = 5; - - if (intolerant == 1) { - race[company, 5] = 0; - loc[company, 5] = ""; - role[company, 5] = ""; - wep1[company, 5] = ""; - name[company, 5] = ""; - wep2[company, 5] = ""; - armour[company, 5] = ""; - gear[company, 5] = ""; - man_size -= 1; - commands -= 1; - TTRPG[company, 5] = new TTRPG_stats("chapter", company, 1, "blank"); + if(!scr_has_disadv("Psyker Intolerant")){ + name[company, 5] = obj_creation.clibrarian; + var _clibrarian = add_unit_to_company("marine", company, 5, string("Chief {0}", roles.librarian), eROLE.Librarian, "default", "Plasma Pistol", "default", "", _hq_armour); + _clibrarian.edit_corruption(0); + _clibrarian.psionic = choose(13, 14, 15, 16); + _clibrarian.update_powers(); + _clibrarian.add_trait("warp_touched"); + k+=1; + commands +=1; } + man_size = k; + // Techmarines in the armoury - repeat(techs) { + repeat(techmarines) { k += 1; commands += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.techmarine; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); - wep1[company][k] = wep1[101, 16]; - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - gear[company][k] = gear[101, 16]; - mobi[company][k] = mobi[101, 16]; + add_unit_to_company("marine", company, k, roles.techmarine, eROLE.Techmarine, "default", choose_weighted(weapon_weighted_lists.pistols), "default", "default", ""); } // Librarians in the librarium @@ -2657,93 +2450,18 @@ function scr_initialize_custom() { k += 1; commands += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - spawn_unit = TTRPG[company][k]; - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.librarian; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep1[company][k] = wep1[101, 17]; - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - gear[company][k] = gear[101, 17]; - if (psyky = 1){ - spawn_unit.add_exp(10); - } - var - let = "", letmax = 0; - if (obj_creation.discipline = "default") { - let = "D"; - letmax = 7; - } - if (obj_creation.discipline = "biomancy") { - let = "B"; - letmax = 5; - } - if (obj_creation.discipline = "pyromancy") { - let = "P"; - letmax = 5; - } - if (obj_creation.discipline = "telekinesis") { - let = "T"; - letmax = 5; - } - if (obj_creation.discipline = "rune Magick") { - let = "R"; - letmax = 5; - } - spe[company][k] += string(let) + "0|"; - spawn_unit.marine_assembling(); - spawn_unit.add_trait("warp_touched"); - spawn_unit.psionic = choose(13, 14, 15, 16); - spawn_unit.update_powers(); + var _epi = add_unit_to_company("marine", company, k, roles.librarian, eROLE.Librarian, "default", choose_weighted(weapon_weighted_lists.pistols), "default", "default", ""); + _epi.psionic = choose(13, 14, 15, 16); + _epi.update_powers(); } // Codiciery repeat(codiciery) { k += 1; commands += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - spawn_unit = TTRPG[company][k]; - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = "Codiciery"; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep1[company][k] = wep1[101, 17]; - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - gear[company][k] = gear[101, 17]; - if (psyky = 1){ - spawn_unit.add_exp(10); - } - var - let, letmax; - let = ""; - letmax = 0; - if (obj_creation.discipline = "default") { - let = "D"; - letmax = 7; - } - if (obj_creation.discipline = "biomancy") { - let = "B"; - letmax = 5; - } - if (obj_creation.discipline = "pyromancy") { - let = "P"; - letmax = 5; - } - if (obj_creation.discipline = "telekinesis") { - let = "T"; - letmax = 4; - } - if (obj_creation.discipline = "rune Magick") { - let = "R"; - letmax = 5; - } - spe[company][k] += string(let) + "0|"; - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); - spawn_unit.add_trait("warp_touched"); - spawn_unit.psionic = choose(11, 12, 13, 14, 15); - spawn_unit.update_powers(); + var _codi = add_unit_to_company("marine", company, k, "Codiciery", eROLE.Librarian, "default", choose_weighted(weapon_weighted_lists.pistols), "default", "default", ""); + _codi.psionic = choose(11, 12, 13, 14, 15); + _codi.update_powers(); } // Lexicanum @@ -2751,45 +2469,9 @@ function scr_initialize_custom() { k += 1; commands += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - var spawn_unit = TTRPG[company][k]; - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = "Lexicanum"; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep1[company][k] = wep1[101, 17]; - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - gear[company][k] = gear[101, 17]; - if (psyky = 1){ - spawn_unit.add_exp(10); - } - var - let = "", letmax = 0; - if (obj_creation.discipline = "default") { - let = "D"; - letmax = 7; - } - if (obj_creation.discipline = "biomancy") { - let = "B"; - letmax = 5; - } - if (obj_creation.discipline = "pyromancy") { - let = "P"; - letmax = 5; - } - if (obj_creation.discipline = "telekinesis") { - let = "T"; - letmax = 4; - } - if (obj_creation.discipline = "rune Magick") { - let = "R"; - letmax = 5; - } - spe[company][k] += string(let) + "0|"; - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); - spawn_unit.add_trait("warp_touched"); - spawn_unit.psionic = choose(8, 9, 10, 11, 12, 13, 14); + var _lexi = add_unit_to_company("marine", company, k, "Lexicanum", eROLE.Librarian, "default", choose_weighted(weapon_weighted_lists.pistols), "default", "default", ""); + _lexi.psionic = choose(8, 9, 10, 11, 12, 13, 14); + _lexi.update_powers(); } // Apothecaries in Apothecarion @@ -2797,79 +2479,42 @@ function scr_initialize_custom() { k += 1; commands += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.apothecary; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep1[company][k] = "Chainsword"; - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - gear[company][k] = gear[101, 15]; - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); + add_unit_to_company("marine", company, k, roles.apothecary, eROLE.Apothecary,"Chainsword", choose_weighted(weapon_weighted_lists.pistols), "default", "default",""); } // Chaplains in Reclusium - repeat(chaap) { + repeat(chaplains) { k += 1; commands += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.chaplain; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep1[company][k] = wep1[101, 14]; - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - gear[company][k] = gear[101, 14]; - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); + add_unit_to_company("marine", company, k, roles.chaplain, eROLE.Chaplain,"default", choose_weighted(weapon_weighted_lists.pistols), "default", "default",""); } // Honour Guard - var _honour_guard_count = 0, - chapter_option, o, unit; + var _honour_guard_count = 0, unit; o = 0; chapter_option = 0; repeat(4) { o += 1; - if (obj_creation.adv[o] = "Brothers, All") then chapter_option = 1; + if (obj_creation.adv[o] = "Retinue of Renown") then chapter_option = 1; } if (chapter_option = 1) then _honour_guard_count += 10; - if (progenitor = 0) and (obj_creation.custom = 0) then _honour_guard_count += 6; + if (progenitor == ePROGENITOR.DARK_ANGELS && obj_creation.custom = 0) { _honour_guard_count += 6; } if (_honour_guard_count == 0) { _honour_guard_count = 3 } - for (i = 0; i < min(_honour_guard_count, 10); i++) { + for (var i = 0; i < min(_honour_guard_count, 10); i++) { k += 1; commands += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - spawn_unit = TTRPG[company][k]; - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.honour_guard; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit.marine_assembling(); - spawn_unit.add_trait(choose("guardian", "champion", "observant", "perfectionist")); - gear[company][k] = gear[100, 2]; - mobi[company][k] = mobi[100, 2]; - // wep1 power sword // wep2 storm bolter default - wep1[company][k] = choose("Power Sword", "Power Axe", "Power Spear"); - wep2[company][k] = wep2[101, 2]; - armour[company][k] = armour[101, 2]; - if (global.chapter_name == "Dark Angels") { - armour[company][k] = "Terminator Armour"; - wep1[company][k] = "Mace of Absolution"; - wep2[company][k] = "Storm Shield"; - } + add_unit_to_company("marine", company, k, roles.honour_guard, eROLE.HonourGuard,"default", "default","default","default","default"); } specials = k; // First Company company = 1; - for (i = 0; i < 501; i++) { + for (var i = 0; i < 501; i++) { race[company, i] = 1; loc[company, i] = ""; name[company, i] = ""; @@ -2891,335 +2536,184 @@ function scr_initialize_custom() { if (veteran + terminator > 0) { k += 1; - commands += 1; // Captain - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.captain; - wep1[company][k] = "Relic Blade"; + commands += 1; // 1st company Captain name[company][k] = honor_captain_name; - wep2[company][k] = choose("Storm Shield", "Storm Bolter"); - gear[company][k] = gear[101, 5]; - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - armour[company][k] = "Terminator Armour"; - if (scr_has_adv("Crafters")) then armour[company][k] = "Tartaros"; - if (terminator <= 0) then armour[company][k] = "MK6 Corvus"; - if (mobi[101, 5] != "") then mobi[company][k] = mobi[101, 5]; - if (armour[company][k] = "Terminator Armour") or(armour[company][k] = "Tartaros") { - man_size += 1; + var _armour = "Terminator Armour"; + if(scr_has_adv("Crafters")){ + var _armour = "Tartaros"; } - - if (global.chapter_name != "Space Wolves") and(global.chapter_name != "Iron Hands") { - k += 1; - commands += 1; // Chaplain - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.chaplain; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - wep1[company][k] = wep1[101, 14]; - wep2[company][k] = "Storm Bolter"; - armour[company][k] = "Terminator Armour"; - gear[company][k] = gear[101, 14] - if (scr_has_adv("Crafters")) then armour[company][k] = "Tartaros"; - if (terminator <= 0) then armour[company][k] = "MK6 Corvus"; - if (mobi[101, 14] != "") then mobi[company][k] = mobi[101, 14]; - if (armour[company][k] = "Terminator") or(armour[company][k] = "Tartaros") then man_size += 1; + if (terminator <= 0) { + _armour = "MK6 Corvus"; } - k += 1; - commands += 1; // Apothecary - race[company][k] = 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - loc[company][k] = home_name; - role[company][k] = roles.apothecary; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - wep1[company][k] = "Storm Bolter"; - wep2[company][k] = ""; - armour[company][k] = "Terminator Armour"; - gear[company][k] = gear[101, 15]; - if (scr_has_adv("Crafters")) then armour[company][k] = "Tartaros"; - if (terminator <= 0) then armour[company][k] = "MK6 Corvus"; - if (mobi[101, 15] != "") then mobi[company][k] = mobi[101, 15]; - if (armour[company][k] = "Terminator") or(armour[company][k] = "Tartaros") then man_size += 1; - - if (global.chapter_name = "Space Wolves") { - k += 1; - commands += 1; // Apothecary - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.apothecary; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - wep1[company][k] = wep1[101, 15]; - wep2[company][k] = wep2[101, 15]; - armour[company][k] = "Terminator Armour"; - gear[company][k] = gear[101, 15]; - if (scr_has_adv("Crafters")) then armour[company][k] = "Tartaros"; - if (terminator <= 0) then armour[company][k] = "MK6 Corvus"; - if (mobi[101, 15] != "") then mobi[company][k] = mobi[101, 15]; - if (armour[company][k] = "Terminator") or(armour[company][k] = "Tartaros") then man_size += 1; + var _spawn_unit = add_unit_to_company("marine", company, k, roles.captain, eROLE.Captain, "Relic Blade",choose("Storm Shield", "Storm Bolter"),"default","default",_armour); + if (_spawn_unit.armour() == "Terminator Armour" || _spawn_unit.armour() == "Tartaros") { + man_size += 1; } - if (!array_contains(obj_creation.dis, "Psyker Intolerant")) { - k += 1; // Company Librarian - commands += 1; - race[company][k] = 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - loc[company][k] = home_name; - role[company][k] = roles.librarian; - name[company][k] = global.name_generator.generate_space_marine_name(); - if (mobi[101, 17] != "") then mobi[company][k] = mobi[101, 17]; - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - gear[company][k] = gear[101, 17]; - wep1[company][k] = wep1[101, 17]; - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - armour[company][k] = "Terminator Armour"; - if (scr_has_adv("Crafters")) then armour[company][k] = "Tartaros"; - if (terminator <= 0) then armour[company][k] = "MK6 Corvus"; - if (mobi[101, 15] != "") then mobi[company][k] = mobi[101, 15]; - if (armour[company][k] = "Terminator") or(armour[company][k] = "Tartaros") then man_size += 1; - if (psyky){ - spawn_unit.add_exp(10); + repeat(chaplains_per_company){ + k += 1; + commands += 1; // 1st company Chaplain + var _armour = "Terminator Armour"; + if(scr_has_adv("Crafters")){ + var _armour = "Tartaros"; } - var let = ""; - var letmax = 0; - if (obj_creation.discipline = "default") { - let = "D"; - letmax = 7; + if (terminator <= 0) { + _armour = "MK6 Corvus"; } - if (obj_creation.discipline = "biomancy") { - let = "B"; - letmax = 5; + var _spawn_unit = add_unit_to_company("marine", company, k, roles.chaplain, eROLE.Chaplain,"default","Storm Bolter","default","default",_armour); + + if (_spawn_unit.armour() == "Terminator Armour" || _spawn_unit.armour() == "Tartaros") { + man_size += 1; } - if (obj_creation.discipline = "pyromancy") { - let = "P"; - letmax = 5; + } + repeat(apothecary_per_company){ + k += 1; + commands += 1; // 1st company Apothecary + var _armour = "Terminator Armour"; + if(scr_has_adv("Crafters")){ + var _armour = "Tartaros"; } - if (obj_creation.discipline = "telekinesis") { - let = "T"; - letmax = 4; + if (terminator <= 0) { + _armour = "MK6 Corvus"; } - if (obj_creation.discipline = "rune Magick") { - let = "R"; - letmax = 5; + var _spawn_unit = add_unit_to_company("marine", company, k, roles.apothecary, eROLE.Apothecary,"Storm Bolter","","default","default",_armour); + + if (_spawn_unit.armour() == "Terminator Armour" || _spawn_unit.armour() == "Tartaros") { + man_size += 1; } - spe[company][k] += string(let) + "0|"; - TTRPG[company][k].add_trait("warp_touched"); - TTRPG[company][k].psionic = choose(8, 9, 10, 11, 12, 13, 14); - TTRPG[company][k].update_powers(); } + if (!scr_has_disadv("Psyker Intolerant")) { + repeat(epistolary_per_company){ + k += 1; // 1st company Librarian + commands += 1; + var _armour = "Terminator Armour"; + if(scr_has_adv("Crafters")){ + var _armour = "Tartaros"; + } + if (terminator <= 0) { + _armour = "MK6 Corvus"; + } + var _spawn_unit = add_unit_to_company("marine", company, k, roles.librarian, eROLE.Librarian,"default",choose_weighted(weapon_weighted_lists.pistols),"default","default",_armour); + + if (_spawn_unit.armour() == "Terminator Armour" || _spawn_unit.armour() == "Tartaros") { + man_size += 1; + } + } + } repeat(techmarines_per_company){ + show_debug_message($"chap terminators {terminator}") k += 1; - commands += 1; // Techmarine - race[company][k] = 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - loc[company][k] = home_name; - role[company][k] = roles.techmarine; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - wep1[company][k] = wep1[101, 16]; - wep2[company][k] = "Storm Bolter"; - armour[company][k] = "Terminator Armour"; - gear[company][k] = gear[101, 16]; - if (scr_has_adv("Crafters")) then armour[company][k] = "Tartaros"; - if (terminator <= 0) then armour[company][k] = "Artificer Armour"; - if (mobi[101, 16] != "") then mobi[company][k] = mobi[101, 16]; - if (armour[company][k] = "Terminator") or(armour[company][k] = "Tartaros") then man_size += 1; + commands += 1; // 1st company Techmarine + var _armour = "Terminator Armour"; + if(scr_has_adv("Crafters")){ + _armour = "Tartaros"; + } + if (terminator <= 0){ + if(scr_has_disadv("Poor Equipment")){ + _armour = "MK6 Corvus"; + } else { + _armour = "Artificer Armour" + } + } + var _spawn_unit = add_unit_to_company("marine", company, k, roles.techmarine, eROLE.Techmarine, "default","Storm Bolter","default","default",_armour); + if (_spawn_unit.armour() == "Terminator Armour" || _spawn_unit.armour() == "Tartaros") { + man_size += 1; + } } + - k += 1; // Standard bearer + k += 1; // 1st company Standard bearer man_size += 1; - race[company][k] = 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - loc[company][k] = home_name; - role[company][k] = roles.ancient; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - wep1[company][k] = "Company Standard"; - wep2[company][k] = "Storm Bolter"; - armour[company][k] = "Terminator Armour"; - if (scr_has_adv("Crafters")) then armour[company][k] = "Tartaros"; - if (terminator <= 0) then armour[company][k] = "MK6 Corvus"; - if (mobi[101, 5] != "") then mobi[company][k] = mobi[101, 5]; - if (armour[company][k] = "Terminator Armour") or(armour[company][k] = "Tartaros") { + var _armour = "Terminator Armour"; + if(scr_has_adv("Crafters")){ + _armour = "Tartaros"; + } + if (terminator <= 0){ + _armour = "MK6 Corvus" + } + var _spawn_unit = add_unit_to_company("marine", company, k, roles.ancient, eROLE.Ancient, "default","Storm Bolter","default","default",_armour); + if (_spawn_unit.armour() == "Terminator Armour" || _spawn_unit.armour() == "Tartaros") { man_size += 1; } k += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); // Champion - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.champion; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - wep1[company][k] = "Thunder Hammer"; - wep2[company][k] = "Storm Bolter"; - gear[company][k] = gear[101, 7]; - armour[company][k] = "Terminator Armour"; - if (scr_has_adv("Crafters")) then armour[company][k] = "Tartaros"; - if (terminator <= 0) then armour[company][k] = "MK6 Corvus"; + var _armour = "Terminator Armour"; + if(scr_has_adv("Crafters")){ + _armour = "Tartaros"; + } + if (terminator <= 0){ + _armour = "MK6 Corvus" + } + var _wep1 = "Thunder Hammer"; + var _wep2 = "Storm Bolter"; if (global.chapter_name == "Dark Angels"){ - wep1[company][k] = "Heavy Thunder Hammer"; - wep2[company][k] = ""; + _wep1 = "Heavy Thunder Hammer"; + _wep2 = ""; + } + var _spawn_unit = add_unit_to_company("marine", company, k, roles.champion, eROLE.Champion, _wep1,_wep2,"default","default",_armour); + if (_spawn_unit.armour() == "Terminator Armour" || _spawn_unit.armour() == "Tartaros") { + man_size += 1; } - if (armour[company][k] = "Terminator") or(armour[company][k] = "Tartaros") then man_size += 1; } - // go 5 under the required xp amount - if (terminator > 0) then repeat(terminator) { k += 1; man_size += 2 - // repeat(max(terminator-4,0)){k+=1;man_size+=2; - race[company][k] = 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - loc[company][k] = home_name; - role[company][k] = roles.terminator; - wep1[company][k] = wep1[101, 4]; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep2[company][k] = wep2[101, 4]; - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); + add_unit_to_company("marine", company, k, roles.terminator, eROLE.Terminator, "","","default","default","default"); } repeat(veteran) { k += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.veteran; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - wep1[company][k] = wep1[101, 3]; - wep2[company][k] = wep2[101, 3]; - gear[company][k] = gear[101, 3]; - mobi[company][k] = mobi[101, 3]; + add_unit_to_company("marine", company, k, roles.veteran, eROLE.Veteran, "","","default","default","default"); } repeat(scr_has_adv("Venerable Ancients") ? 3 : 2) { k += 1; commands += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k, "dreadnought"); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = "Venerable " + string(roles.dreadnought); - wep1[company][k] = wep1[101, 6]; - man_size += 8; - wep2[company][k] = "Plasma Cannon"; - armour[company][k] = "Dreadnought"; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k] - spawn_unit.roll_age(); - spawn_unit.roll_experience(); + add_unit_to_company("dreadnought", company, k, "Venerable " + string(roles.dreadnought),eROLE.Dreadnought, "default", "Plasma Cannon","default","default","Dreadnought"); } - for (i = 0; i < 4; i++) { + for (var i = 0; i < 4; i++) { v += 1; man_size += 10; - veh_race[company, v] = 1; - veh_loc[company, v] = home_name; - veh_role[company, v] = "Rhino"; - veh_wep1[company, v] = "Storm Bolter"; - veh_wep2[company, v] = "HK Missile"; - veh_wep3[company, v] = ""; - veh_upgrade[company, v] = "Artificer Hull"; - veh_acc[company, v] = "Dozer Blades"; - veh_hp[company, v] = 100; - veh_chaos[company, v] = 0; - veh_pilots[company, v] = 0; - veh_lid[company, v] = 0; - veh_wid[company, v] = 2; + add_veh_to_company("Rhino", company, v, "Storm Bolter", "HK Missile", "", "Artificer Hull", "Dozer Blades") } + var predrelic = 2; - if (global.chapter_name = "Iron Hands") then predrelic = 3; - if (obj_creation.custom == 1) and (array_contains(obj_creation.adv, "Tech-Brothers")) then predrelic +=2; + if (scr_has_adv("Tech-Brothers")) then predrelic +=2; repeat(predrelic) { v += 1; man_size += 10; - var predtype; - predtype = choose(1, 2, 3, 4) - veh_race[company, v] = 1; - veh_loc[company, v] = home_name; - veh_role[company, v] = "Predator"; - if (predtype = 1) { - veh_wep1[company, v] = "Plasma Destroyer Turret"; - veh_wep2[company, v] = "Lascannon Sponsons"; - veh_wep3[company, v] = "HK Missile"; - veh_upgrade[company, v] = "Artificer Hull"; - veh_acc[company, v] = "Searchlight"; - } - if (predtype = 2) { - veh_wep1[company, v] = "Heavy Conversion Beamer Turret"; - veh_wep2[company, v] = "Lascannon Sponsons"; - veh_wep3[company, v] = "HK Missile"; - veh_upgrade[company, v] = "Artificer Hull"; - veh_acc[company, v] = "Searchlight"; - } - if (predtype = 3) { - veh_wep1[company, v] = "Flamestorm Cannon Turret"; - veh_wep2[company, v] = "Heavy Flamer Sponsons"; - veh_wep3[company, v] = "Storm Bolter"; - veh_upgrade[company, v] = "Artificer Hull"; - veh_acc[company, v] = "Dozer Blades"; - } - if (predtype = 4) { - veh_wep1[company, v] = "Magna-Melta Turret"; - veh_wep2[company, v] = "Heavy Flamer Sponsons"; - veh_wep3[company, v] = "Storm Bolter"; - veh_upgrade[company, v] = "Artificer Hull"; - veh_acc[company, v] = "Dozer Blades"; + var predtype = choose(1, 2, 3, 4); + switch (predtype){ + case 1: + add_veh_to_company("Predator", company, v, "Plasma Destroyer Turret", "Lascannon Sponsons", "HK Missile", "Artificer Hull", "Searchlight") + break; + case 2: + add_veh_to_company("Predator", company, v, "Heavy Conversion Beamer Turret", "Lascannon Sponsons", "HK Missile", "Artificer Hull", "Searchlight") + break; + case 3: + add_veh_to_company("Predator", company, v, "Flamestorm Cannon Turret", "Heavy Flamer Sponsons", "Storm Bolter", "Artificer Hull", "Dozer Blades") + break; + case 4: + add_veh_to_company("Predator", company, v, "Magna-Melta Turret", "Heavy Flamer Sponsons", "Storm Bolter", "Artificer Hull", "Dozer Blades") + break; } - veh_hp[company, v] = 100; - veh_chaos[company, v] = 0; - veh_pilots[company, v] = 0; - veh_lid[company, v] = 0; } if (global.chapter_name != "Lamenters") then repeat(6) { v += 1; man_size += 20; - veh_race[company, v] = 1; - veh_loc[company, v] = home_name; - veh_role[company, v] = "Land Raider"; - veh_hp[company, v] = 100; - veh_chaos[company, v] = 0; - veh_pilots[company, v] = 0; - veh_lid[company, v] = 0; - veh_wid[company, v] = 2; - if (floor(v mod 4) == 1) or(floor(v mod 4) == 2) { - veh_wep1[company, v] = "Twin Linked Heavy Bolter Mount"; - veh_wep2[company, v] = "Twin Linked Lascannon Sponsons"; - veh_wep3[company, v] = "HK Missile"; - veh_upgrade[company, v] = "Heavy Armour"; - veh_acc[company, v] = "Searchlight"; + if (floor(v % 4) == 1) or(floor(v % 4) == 2) { + add_veh_to_company("Land Raider", company, v, "Twin Linked Heavy Bolter Mount", "Twin Linked Lascannon Sponsons", "HK Missile", "Heavy Armour", "Searchlight") } - if (floor(v mod 4) == 3) { - veh_wep1[company, v] = "Twin Linked Assault Cannon Mount"; - veh_wep2[company, v] = "Hurricane Bolter Sponsons"; - veh_wep3[company, v] = "Storm Bolter"; - veh_upgrade[company, v] = "Heavy Armour"; - veh_acc[company, v] = "Frag Assault Launchers"; + if (floor(v % 4) == 3) { + add_veh_to_company("Land Raider", company, v, "Twin Linked Assault Cannon Mount", "Hurricane Bolter Sponsons", "Storm Bolter", "Heavy Armour", "Frag Assault Launchers") } - if (floor(v mod 4) == 0) { - veh_wep1[company, v] = "Twin Linked Assault Cannon Mount"; - veh_wep2[company, v] = "Flamestorm Cannon Sponsons"; - veh_wep3[company, v] = "Storm Bolter"; - veh_upgrade[company, v] = "Heavy Armour"; - veh_acc[company, v] = "Frag Assault Launchers"; + if (floor(v % 4) == 0) { + add_veh_to_company("Land Raider", company, v, "Twin Linked Assault Cannon Mount", "Flamestorm Cannon Sponsons", "Storm Bolter", "Heavy Armour", "Frag Assault Launchers") } } v = 0; @@ -3227,11 +2721,11 @@ function scr_initialize_custom() { firsts = k; - + // show_debug_message($"2: {second} 3: {third} 4: {fourth} 5: {fifth} 6: {sixth} 7: {seventh} 8: {eighth} 9: {ninth} 10: {tenth}") //non HQ and non firsst company initialised here for (company = 2; company < 11; company++) { // Initialize marines - for (i = 0; i < 501; i++) { + for (var i = 0; i < 501; i++) { race[company, i] = 1; loc[company, i] = ""; name[company, i] = ""; @@ -3258,9 +2752,7 @@ function scr_initialize_custom() { stahp = 0; v = 0; - i = -1; k = 0; - v = 0; if (obj_creation.equal_specialists = 1) { @@ -3281,8 +2773,8 @@ function scr_initialize_custom() { // if (company=2){dready=1; dready = 1; - if (scr_has_disadv("Sieged")) or (obj_creation.custom = 0) then dready =+ 1; - if (scr_has_adv("Venerable Ancients")) then dready += 1; + if (scr_has_disadv("Sieged") || obj_creation.custom = 0) {dready =+ 1;} + if (scr_has_adv("Venerable Ancients")) {dready += 1;} rhinoy = 8; whirly = whirlwind; speedy = 2; @@ -3305,7 +2797,7 @@ function scr_initialize_custom() { whirly = whirlwind; speedy = 2; if scr_has_adv("Lightning Warriors") then speedy += 2; rhinoy -= 2; - if (second = 0) then stahp = 1; + if (second <= 0) then stahp = 1; } if (company = 3) { @@ -3319,7 +2811,7 @@ function scr_initialize_custom() { whirly = whirlwind; speedy = 2; if (array_contains(obj_creation.adv, "Lightning Warriors")) then speedy += 2; rhinoy -= 2; - if (third = 0) then stahp = 1; + if (third <= 0) then stahp = 1; } if (company = 4) { @@ -3333,7 +2825,7 @@ function scr_initialize_custom() { whirly = whirlwind; speedy = 2; if (array_contains(obj_creation.adv, "Lightning Warriors")) then speedy += 2; rhinoy -= 2; - if (fourth = 0) then stahp = 1; + if (fourth <= 0) then stahp = 1; } if (company = 5) { @@ -3347,7 +2839,7 @@ function scr_initialize_custom() { whirly = whirlwind; speedy = 2; if (array_contains(obj_creation.adv, "Lightning Warriors")) then speedy += 2; rhinoy -= 2; - if (fifth = 0) then stahp = 1; + if (fifth <= 0) then stahp = 1; } if (company = 6) { @@ -3360,7 +2852,7 @@ function scr_initialize_custom() { rhinoy = 8; whirly = whirlwind; speedy = 0; - if (sixth = 0) then stahp = 1; + if (sixth <= 0) then stahp = 1; } if (company = 7) { @@ -3373,7 +2865,7 @@ function scr_initialize_custom() { rhinoy = 8; whirly = 0; speedy = 8; - if (seventh = 0) then stahp = 1; + if (seventh <= 0) then stahp = 1; } if (company = 8) { @@ -3386,7 +2878,7 @@ function scr_initialize_custom() { rhinoy = 2; whirly = 0; speedy = 2; - if (eighth = 0) then stahp = 1; + if (eighth <= 0) then stahp = 1; } if (company = 9) { @@ -3400,7 +2892,7 @@ function scr_initialize_custom() { rhinoy = 2; whirly = 0; speedy = 0; - if (ninth = 0) then stahp = 1; + if (ninth <= 0) then stahp = 1; } if (company = 10) { temp1 = tenth; @@ -3410,10 +2902,11 @@ function scr_initialize_custom() { rhinoy = 8; whirly = 0; speedy = 0; + if scr_has_disadv("Obliterated") then rhinoy = 0; // if (obj_creation.custom=0) then temp1-=5; - if (tenth = 0) then stahp = 1; + if (tenth <= 0) then stahp = 1; } } @@ -3421,11 +2914,6 @@ function scr_initialize_custom() { if (stahp = 0) { k += 1; commands += 1; // Captain - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.captain; - name[company][k] = global.name_generator.generate_space_marine_name(); if (company==1){ if (honor_captain_name!=""){ @@ -3489,213 +2977,86 @@ function scr_initialize_custom() { } } - wep2[company][k] = wep2[101, 5]; - spawn_unit = TTRPG[company][k]; - // used to randomly make a marine an old guard of their company, giving a bit more xp (TODO) and fancier armor they've hanged onto all these years - spawn_unit.marine_assembling(); - wep1[company][k] = wep1[101, 5]; - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - if (company = 8) and(obj_creation.equal_specialists = 0) then mobi[company][k] = "Jump Pack"; - if (mobi[101, 5] != "") then mobi[company][k] = mobi[101, 5]; - gear[company][k] = gear[101, 5]; - - if (global.chapter_name != "Space Wolves") and(global.chapter_name != "Iron Hands") { + var _mobi = mobi[defaults_slot, eROLE.Captain]; + if (company = 8) and(obj_creation.equal_specialists = 0) then _mobi = "Jump Pack"; + add_unit_to_company("marine", company, k, roles.captain, eROLE.Captain, "default",choose_weighted(weapon_weighted_lists.pistols),"default",_mobi,""); + + repeat (chaplains_per_company){ k += 1; commands += 1; // Company Chaplain race[company][k] = 1; TTRPG[company][k] = new TTRPG_stats("chapter", company, k); loc[company][k] = home_name; role[company][k] = roles.chaplain; - wep1[company][k] = wep1[101, 14]; + wep1[company][k] = wep1[defaults_slot, eROLE.Chaplain]; name[company][k] = global.name_generator.generate_space_marine_name(); wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - gear[company][k] = gear[101, 14]; + gear[company][k] = gear[defaults_slot, eROLE.Chaplain]; if (company = 8) and(obj_creation.equal_specialists = 0) then mobi[company][k] = "Jump Pack"; - if (mobi[101, 14] != "") then mobi[company][k] = mobi[101, 14]; + if (mobi[defaults_slot, eROLE.Chaplain] != "") then mobi[company][k] = mobi[defaults_slot, eROLE.Chaplain]; spawn_unit = TTRPG[company][k] spawn_unit.marine_assembling(); } - - k += 1; - commands += 1; // Company Apothecary - race[company][k] = 1; - loc[company][k] = home_name; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - role[company][k] = roles.apothecary; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - wep1[company][k] = wep1[101, 15]; - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - gear[company][k] = gear[101, 15]; - if (mobi[101, 15] != "") then mobi[company][k] = mobi[101, 15]; - - if (global.chapter_name = "Space Wolves") { + repeat (apothecary_per_company){ k += 1; commands += 1; // Company Apothecary - race[company][k] = 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - loc[company][k] = home_name; - role[company][k] = roles.apothecary; - wep1[company][k] = wep1[101, 15]; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - gear[company][k] = gear[101, 15]; - if (mobi[101, 15] != "") then mobi[company][k] = mobi[101, 15]; - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); + add_unit_to_company("marine", company, k, roles.apothecary, eROLE.Apothecary, "default",choose_weighted(weapon_weighted_lists.pistols),"default","default",""); } repeat(techmarines_per_company) { k += 1; // Company Techmarine commands += 1; - race[company][k] = 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - loc[company][k] = home_name; - role[company][k] = roles.techmarine; - name[company][k] = global.name_generator.generate_space_marine_name(); - if (mobi[101, 16] != "") then mobi[company][k] = mobi[101, 16]; - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - gear[company][k] = gear[101, 16]; - wep1[company][k] = wep1[101, 16]; - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); + add_unit_to_company("marine", company, k, roles.techmarine, eROLE.Techmarine, "default",choose_weighted(weapon_weighted_lists.pistols),"default","default",""); } - if (!array_contains(obj_creation.dis, "Psyker Intolerant")) { + if (!scr_has_disadv("Psyker Intolerant")) { k += 1; // Company Librarian commands += 1; - race[company][k] = 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - loc[company][k] = home_name; - role[company][k] = roles.librarian; - name[company][k] = global.name_generator.generate_space_marine_name(); - if (mobi[101, 17] != "") then mobi[company][k] = mobi[101, 17]; - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); - gear[company][k] = gear[101, 17]; - wep1[company][k] = wep1[101, 17]; - wep2[company][k] = choose_weighted(weapon_weighted_lists.pistols); - if (psyky = 1){ - spawn_unit.add_exp(10); - } - var let = ""; - var letmax = 0; - if (obj_creation.discipline = "default") { - let = "D"; - letmax = 7; - } - if (obj_creation.discipline = "biomancy") { - let = "B"; - letmax = 5; - } - if (obj_creation.discipline = "pyromancy") { - let = "P"; - letmax = 5; - } - if (obj_creation.discipline = "telekinesis") { - let = "T"; - letmax = 4; - } - if (obj_creation.discipline = "rune Magick") { - let = "R"; - letmax = 5; - } - spe[company][k] += string(let) + "0|"; - TTRPG[company][k].add_trait("warp_touched"); - TTRPG[company][k].psionic = choose(8, 9, 10, 11, 12, 13, 14); - TTRPG[company][k].update_powers(); + var _spawn_unit = add_unit_to_company("marine", company, k, roles.librarian, eROLE.Librarian, "default",choose_weighted(weapon_weighted_lists.pistols),"default","default",""); } k += 1; // Standard Bearer - race[company][k] = 1; - loc[company][k] = home_name; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - role[company][k] = roles.ancient; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); - wep1[company][k] = wep1[101, 11]; - wep2[company][k] = wep2[101, 11]; - + add_unit_to_company("marine", company, k, roles.ancient, eROLE.Ancient, "default","default","default","default",""); + k += 1; man_size += 1; // Champion - race[company][k] = 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - loc[company][k] = home_name; - role[company][k] = roles.champion; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep1[company][k] = wep1[100, 7]; - wep2[company][k] = wep2[100, 7]; - gear[company][k] = gear[100, 7]; - if (company = 8) and(obj_creation.equal_specialists = 0) then mobi[company][k] = "Jump Pack"; - spawn_unit = TTRPG[company][k]; - spawn_unit.add_trait("champion"); - spawn_unit.marine_assembling(); + if (company == 8) and(obj_creation.equal_specialists = 0){ + add_unit_to_company("marine", company, k, roles.champion, eROLE.Champion, "default","default","default","Jump Pack",""); + } else { + add_unit_to_company("marine", company, k, roles.champion, eROLE.Champion, "default","default","default","",""); + } + // have equal spec true or false have same old_guard chance // it doesn't fully make sense why new marines in reserve companies would have the same chance // but otherwise you'd always pick true so you'd have more shit // just making em the same to reduce meta/power gaming - if (obj_creation.equal_specialists = 1) { + if (obj_creation.equal_specialists == 1) { if (company < 10) { repeat(temp1) { k += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.tactical; - wep1[company][k] = wep1[101, 8]; - wep2[company][k] = wep2[101, 8]; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); + add_unit_to_company("marine", company, k, roles.tactical, eROLE.Tactical, "default","default", "default", "default", "default"); } repeat(assault) { k += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.assault; - wep1[company][k] = wep1[101, 10]; - name[company][k] = global.name_generator.generate_space_marine_name(); - mobi[company][k] = "Jump Pack"; - wep2[company][k] = wep2[101, 10]; - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); + add_unit_to_company("marine", company, k, roles.assault, eROLE.Assault, "default", "default", "default", "default", "default"); } repeat(devastator) { k += 1; man_size += 1; - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.devastator; - wep2[company][k] = wep2[101][9]; - mobi[company][k] = mobi[100][9]; - name[company][k] = global.name_generator.generate_space_marine_name(); - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - if (wep1[101, 9] == "Heavy Ranged") then wep1[company][k] = choose("Multi-Melta", "Lascannon", "Missile Launcher", "Heavy Bolter"); - if (wep1[101, 9] != "Heavy Ranged") then wep1[company][k] = wep1[101, 9]; - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); + var _wep1 = wep1[defaults_slot, eROLE.Devastator]; + if (wep1[defaults_slot, eROLE.Devastator] == "Heavy Ranged") { + _wep1 = choose("Multi-Melta", "Lascannon", "Missile Launcher", "Heavy Bolter"); + } + add_unit_to_company("marine", company, k, roles.devastator, eROLE.Devastator, _wep1, "default","default", "default", "default"); } } if (company = 10) { - repeat(temp1) { k += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k, "scout"); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.scout; - wep1[company][k] = wep1[101, 12]; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep2[company][k] = wep2[101, 12]; - armour[company][k] = "Scout Armour"; - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); + add_unit_to_company("scout", company, k, roles.scout, eROLE.Scout, "default", "default", "default", "default", "Scout Armour"); } } } @@ -3704,96 +3065,45 @@ function scr_initialize_custom() { if (company < 8) then repeat(temp1) { k += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.tactical; - wep1[company][k] = wep1[101, 8]; - wep2[company][k] = wep2[101, 8]; - name[company][k] = global.name_generator.generate_space_marine_name(); - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); + add_unit_to_company("marine", company, k, roles.tactical, eROLE.Tactical, "default", "default", "default", "default", "default"); } // reserve company only of assault if (company = 8) then repeat(temp1) { k += 1; man_size += 1; // assault reserve company - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.assault; - wep1[company][k] = wep1[101, 10]; - wep2[company][k] = wep2[101, 10]; - name[company][k] = global.name_generator.generate_space_marine_name(); - mobi[company][k] = "Jump Pack"; - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); + add_unit_to_company("marine", company, k, roles.assault,eROLE.Assault, "", "", "", "default", ""); } // reserve company only devo if (company = 9) then repeat(temp1) { k += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.devastator; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep2[company][k] = wep2[101, 9]; - mobi[company][k] = mobi[100][9]; - if (wep1[101, 9] = "Heavy Ranged") then wep1[company][k] = choose("Multi-Melta", "Lascannon", "Missile Launcher", "Heavy Bolter"); - if (wep1[101, 9] != "Heavy Ranged") then wep1[company][k] = wep1[101, 9]; - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); + var _wep1 = wep1[defaults_slot, eROLE.Devastator]; + if (wep1[defaults_slot, eROLE.Devastator] == "Heavy Ranged") { + _wep1 = choose("Multi-Melta", "Lascannon", "Missile Launcher", "Heavy Bolter"); + } + add_unit_to_company("marine", company, k, roles.devastator,eROLE.Devastator, _wep1,); } if (company = 10) then for (var i = 0; i < temp1; i++) { k += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k, "scout"); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.scout; - wep1[company][k] = wep1[101, 12]; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep2[company][k] = wep2[101, 12]; - armour[company][k] = "Scout Armour"; - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); + add_unit_to_company("scout", company, k, roles.scout,eROLE.Scout, , , , , "Scout Armour"); } if (company_unit2 = "assault") then repeat(assault) { k += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.assault; - wep1[company][k] = wep1[101, 10]; - wep2[company][k] = wep2[101, 10]; - name[company][k] = global.name_generator.generate_space_marine_name(); - mobi[company][k] = mobi[101, 10]; - spawn_unit = TTRPG[company][k] - spawn_unit.marine_assembling(); + add_unit_to_company("marine", company, k, roles.assault,eROLE.Assault); } if (company_unit3 = "devastator") then repeat(devastator) { k += 1; man_size += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.devastator; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep2[company][k] = wep2[101, 9]; - mobi[company][k] = mobi[100][9]; - if (wep1[101, 9] = "Heavy Ranged") then wep1[company][k] = choose("Multi-Melta", "Lascannon", "Missile Launcher", "Heavy Bolter"); - if (wep1[101, 9] != "Heavy Ranged") then wep1[company][k] = wep1[101, 9]; - spawn_unit = TTRPG[company][k]; - spawn_unit.marine_assembling(); + + add_unit_to_company("marine", company, k, roles.devastator, eROLE.Devastator); } } @@ -3802,18 +3112,11 @@ function scr_initialize_custom() { k += 1; man_size += 10; commands += 1; - TTRPG[company][k] = new TTRPG_stats("chapter", company, k, "dreadnought"); - race[company][k] = 1; - loc[company][k] = home_name; - role[company][k] = roles.dreadnought; - wep1[company][k] = "Close Combat Weapon"; - name[company][k] = global.name_generator.generate_space_marine_name(); - wep2[company][k] = wep2[101, 6]; - armour[company][k] = "Dreadnought"; - spawn_unit = TTRPG[company][k]; - spawn_unit.roll_age(); - spawn_unit.roll_experience(); - if (company = 9) then wep1[company][k] = "Missile Launcher"; + var _wep1 = "default"; + if(company == 9) { + _wep1 = "Missile Launcher"; + } + add_unit_to_company("dreadnought", company, k, roles.dreadnought, eROLE.Dreadnought, _wep1, "default", "","","Dreadnought"); } } @@ -3821,86 +3124,35 @@ function scr_initialize_custom() { if (rhinoy > 0) then repeat(rhinoy) { v += 1; man_size += 10; - veh_race[company, v] = 1; - veh_loc[company, v] = home_name; - veh_role[company, v] = "Rhino"; - veh_wep1[company, v] = "Storm Bolter"; - veh_wep2[company, v] = "HK Missile"; - veh_wep3[company, v] = ""; - veh_upgrade[company, v] = ""; - veh_acc[company, v] = "Dozer Blades"; - veh_hp[company, v] = 100; - veh_chaos[company, v] = 0; - veh_pilots[company, v] = 0; - veh_lid[company, v] = 0; - veh_wid[company, v] = 2; + add_veh_to_company("Rhino", company, v, "Storm Bolter","HK Missile","","","Dozer Blades"); + } if (whirly > 0) then repeat(whirly) { v += 1; man_size += 10; - veh_race[company, v] = 1; - veh_loc[company, v] = home_name; - veh_role[company, v] = "Whirlwind"; - veh_wep1[company, v] = "Whirlwind Missiles"; - veh_wep2[company, v] = "HK Missile"; - veh_wep3[company, v] = ""; - veh_upgrade[company, v] = ""; - veh_acc[company, v] = ""; - veh_hp[company, v] = 100; - veh_chaos[company, v] = 0; - veh_pilots[company, v] = 0; - veh_lid[company, v] = 0; - veh_wid[company, v] = 2; + add_veh_to_company("Whirlwind", company, v, "Whirlwind Missiles", "HK Missile", "","",""); } if (speedy > 0) then repeat(speedy) { v += 1; man_size += 6; - veh_race[company, v] = 1; - veh_loc[company, v] = home_name; - veh_role[company, v] = "Land Speeder"; - veh_wep1[company, v] = "Heavy Bolter"; - veh_wep2[company, v] = ""; - veh_wep3[company, v] = ""; - veh_upgrade[company, v] = ""; - veh_acc[company, v] = ""; - veh_hp[company, v] = 100; - veh_chaos[company, v] = 0; - veh_pilots[company, v] = 0; - veh_lid[company, v] = 0; - veh_wid[company, v] = 2; + add_veh_to_company("Land Speeder", company, v, "Heavy Bolter", "", "","",""); } if (company = 9) or(global.chapter_name = "Iron Hands") { var predy; predy = 5; if (global.chapter_name = "Iron Hands") then predy = 2; - if (obj_creation.custom == 1) and (array_contains(obj_creation.adv, "Tech-Brothers")) then predy -=2; + if (obj_creation.custom == 1) and (scr_has_adv("Tech-Brothers")) then predy -=2; repeat(predy) { v += 1; man_size += 10; - veh_race[company, v] = 1; - veh_loc[company, v] = home_name; - veh_role[company, v] = "Predator"; if (!floor(v mod 2) == 1) { - veh_wep1[company, v] = "Twin Linked Lascannon Turret"; - veh_wep2[company, v] = "Lascannon Sponsons"; - veh_wep3[company, v] = "HK Missile"; - veh_upgrade[company, v] = ""; - veh_acc[company, v] = "Searchlight"; + add_veh_to_company("Predator", company, v, "Twin Linked Lascannon Turret", "Lascannon Sponsons", "HK Missile", "","Searchlight"); } if (floor(v mod 2) == 1) { - veh_wep1[company, v] = "Autocannon Turret"; - veh_wep2[company, v] = "Heavy Bolter Sponsons"; - veh_wep3[company, v] = "Storm Bolter"; - veh_upgrade[company, v] = ""; - veh_acc[company, v] = "Dozer Blades"; + add_veh_to_company("Predator", company, v, "Autocannon Turret", "Heavy Bolter Sponsons", "Storm Bolter", "","Dozer Blades"); } - veh_wid[company, v] = 2; - veh_hp[company, v] = 100; - veh_chaos[company, v] = 0; - veh_pilots[company, v] = 0; - veh_lid[company, v] = 0; } } man_size += k; @@ -3938,77 +3190,112 @@ function scr_initialize_custom() { scr_restart_variables(1); - var eqi = 0; - eqi += 1; - equipment[eqi] = "MK7 Aquila"; - equipment_number[eqi] = 10; - equipment_type[eqi] = "armour"; - eqi += 1; - equipment[eqi] = "MK8 Errant"; - equipment_number[eqi] = 1; - equipment_type[eqi] = "armour"; - eqi += 1; - equipment[eqi] = "Scout Armour"; - equipment_number[eqi] = 20; - equipment_type[eqi] = "armour"; - eqi += 1; - equipment[eqi] = "Bolter"; - equipment_number[eqi] = 20; - equipment_type[eqi] = "weapon"; - eqi += 1; - equipment[eqi] = "Chainsword"; - equipment_number[eqi] = 20; - equipment_type[eqi] = "weapon"; - eqi += 1; - equipment[eqi] = "Lascannon"; - equipment_number[eqi] = 5; - equipment_type[eqi] = "weapon"; - eqi += 1; - equipment[eqi] = "Heavy Bolter"; - equipment_number[eqi] = 5; - equipment_type[eqi] = "weapon"; - eqi += 1; - equipment[eqi] = "Jump Pack"; - equipment_number[eqi] = 10; - equipment_type[eqi] = "gear"; - eqi += 1; - equipment[eqi] = "Bike"; - equipment_number[eqi] = 40; - equipment_type[eqi] = "vehicle"; + scr_add_item("Bolter", 20); + scr_add_item("Chainsword", 20); scr_add_item("Bolt Pistol", 5); scr_add_item("Heavy Weapons Pack", 10); - scr_add_item(wep1[101, 12], 20); - scr_add_item(wep2[101, 12], 20); - if (global.chapter_name = "Iron Hands") then scr_add_item("Bionics", 200); - /*if (global.chapter_name="Black Templars") then - arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "The Black Sword"; - arti.custom_description = "An all black two handed Power Sword bestowed upon the Chapter's father Sigismund by the Emperor "; - obj_ini.artifact[last_artifact] = "Power Sword"; - obj_ini.artifact_identified[last_artifact] = 0; - arti = obj_ini.artifact_struct[last_artifact]; - arti.name = "The Armor of Faith"; - arti.custom_description = "A Masterfully crafted suit of artificer armor bestowed upon the Emperor's Champion"; - obj_ini.artifact[last_artifact] = "Artificer Armor"; - obj_ini.artifact_identified[last_artifact] = 0; - */ + scr_add_item(wep1[defaults_slot, eROLE.Scout ], 20); + scr_add_item(wep2[defaults_slot, eROLE.Scout ], 20); + + scr_add_item("Scout Armour", 20); + scr_add_item("MK8 Errant", 1); + scr_add_item("MK7 Aquila", 10); - if (scr_has_disadv("Sieged")) { + scr_add_item("Jump Pack", 10); + + scr_add_item("Lascannon", 5); + scr_add_item("Heavy Bolter", 5); + + scr_add_item("Bike", 40); + + if(struct_exists(obj_creation, "extra_equipment") ){ + for(var e = 0; e < array_length(obj_creation.extra_equipment); e++){ + var e_name = obj_creation.extra_equipment[e][0]; + var e_qty = obj_creation.extra_equipment[e][1]; + scr_add_item(e_name, e_qty); + } + } + if(struct_exists(obj_creation, "extra_vehicles")){ + var _slot = 1; + while(obj_ini.veh_role[10][_slot] != ""){ // try not to overwrite existing vehicles + _slot++; + if(_slot > 500){ // no crash pls + break; + } + } + if (_slot < 500){ + if(struct_exists(obj_creation.extra_vehicles, "rhino")){ + if(real(obj_creation.extra_vehicles.rhino) > 0){ + repeat(real(obj_creation.extra_vehicles.rhino)){ + add_veh_to_company("Rhino", 10, _slot, "Storm Bolter","HK Missile","","","Dozer Blades"); + _slot++; + man_size += 10; + } + } + } + if(struct_exists(obj_creation.extra_vehicles, "whirlwind")){ + if(real(obj_creation.extra_vehicles.whirlwind) > 0){ + repeat(real(obj_creation.extra_vehicles.whirlwind)){ + add_veh_to_company("Whirlwind", 10, _slot, "Whirlwind Missiles", "HK Missile", "","",""); + _slot++; + man_size += 10; + } + } + } + if(struct_exists(obj_creation.extra_vehicles, "predator")){ + if(real(obj_creation.extra_vehicles.predator) > 0){ + repeat(real(obj_creation.extra_vehicles.predator)){ + if (!floor(_slot % 2) == 1) { + add_veh_to_company("Predator", 10, _slot, "Twin Linked Lascannon Turret", "Lascannon Sponsons", "HK Missile", "","Searchlight"); + } + if (floor(_slot % 2) == 1) { + add_veh_to_company("Predator", 10, _slot, "Autocannon Turret", "Heavy Bolter Sponsons", "Storm Bolter", "","Dozer Blades"); + } + man_size += 10; + _slot++; + } + } + } + if(struct_exists(obj_creation.extra_vehicles, "land_raider")){ + if(real(obj_creation.extra_vehicles.land_raider) > 0){ + repeat(real(obj_creation.extra_vehicles.land_raider)){ + if (floor(_slot % 4) == 1) || (floor(_slot % 4) == 2) { + add_veh_to_company("Land Raider", 10, _slot, "Twin Linked Heavy Bolter Mount", "Twin Linked Lascannon Sponsons", "HK Missile", "Heavy Armour", "Searchlight") + } + if (floor(_slot % 4) == 3) { + add_veh_to_company("Land Raider", 10, _slot, "Twin Linked Assault Cannon Mount", "Hurricane Bolter Sponsons", "Storm Bolter", "Heavy Armour", "Frag Assault Launchers") + } + if (floor(_slot % 4) == 0) { + add_veh_to_company("Land Raider", 10, _slot, "Twin Linked Assault Cannon Mount", "Flamestorm Cannon Sponsons", "Storm Bolter", "Heavy Armour", "Frag Assault Launchers") + } + _slot++; + man_size += 10; + } + } + } + if(struct_exists(obj_creation.extra_vehicles, "land_speeder")){ + if(real(obj_creation.extra_vehicles.land_speeder) > 0){ + repeat(real(obj_creation.extra_vehicles.land_speeder)){ + add_veh_to_company("Land Speeder", 10, _slot, "Heavy Bolter", "", "","",""); + _slot++; + man_size += 10; + } + } + } + } + } + + if(scr_has_disadv("Sieged")){ scr_add_item("Narthecium", 4); - scr_add_item(wep1[101, 15], 4); - scr_add_item(wep2[101, 15], 4); + scr_add_item(wep1[defaults_slot, eROLE.Apothecary], 4); + scr_add_item(wep2[defaults_slot, eROLE.Apothecary], 4); scr_add_item("Psychic Hood", 4); scr_add_item("Force Staff", 4); scr_add_item("Plasma Pistol", 4); - o = 0; - chapter_option = 0; - repeat(4) { - o += 1; - if (obj_creation.adv[o] = "Crafters") then chapter_option = 1; - } - if (chapter_option = 1) then scr_add_item("Tartaros", 10); - else { + if(scr_has_adv("Crafters")){ + scr_add_item("Tartaros", 10); + } else { scr_add_item("Terminator Armour", 10); } @@ -4026,44 +3313,27 @@ function scr_initialize_custom() { scr_add_item("Dreadnought", 6); scr_add_item("Close Combat Weapon", 6); } - if (array_contains(obj_creation.adv, "Venerable Ancients")) { + if (scr_has_adv("Venerable Ancients")) { scr_add_item("Dreadnought", 4); scr_add_item("Close Combat Weapon", 4); } // man_size+=80;// bikes - // if (string_count("Crafter",strin)>0) and (string_count("Enthusi",strin)>0) then equipment_number[1]=20; - // if (string_count("Crafter",strin)>0) and (string_count("Enthusi",strin)=0) then equipment_number[2]=20; if (scr_has_adv("Crafters")) && (scr_has_adv("Melee Enthusiasts")) { - eqi += 1; - equipment[eqi] = "MK3 Iron Armour"; - equipment_number[eqi] = round(random_range(2, 12)); - equipment_type[eqi] = "armour"; + scr_add_item("MK3 Iron Armour", irandom_range(2, 12)); } - if (scr_has_adv("Crafters")) && (!scr_has_adv("Melee Enthusiasts")) { - eqi += 1; - equipment[eqi] = "MK4 Maximus"; - equipment_number[eqi] = round(random_range(3, 18)); - equipment_type[eqi] = "armour"; - } - - var i; - i = -1; - repeat(121) { - i += 1; - slave_batch_num[i] = 0; - slave_batch_eta[i] = 0; + if (scr_has_adv("Crafters")) && (!scr_has_adv("Melee Enthusiasts")) { + scr_add_item("MK4 Maximus", irandom_range(3, 18)); } - - - + gene_slaves = []; + var bloo = 0, o = 0; - if (array_contains(obj_creation.dis, "Blood Debt")) { + if (scr_has_disadv("Blood Debt")) { bloo = 1; if (instance_exists(obj_controller)) { obj_controller.blood_debt = 1; @@ -4073,13 +3343,13 @@ function scr_initialize_custom() { penitent_end = obj_creation.strength * 48; } } else { - if (fleet_type = 3) { + if (fleet_type == eFLEET_TYPES.PENITENCE) { penitent = 1; penitent_max = (obj_creation.strength * 60); penitent_current = 1; penitent_end = obj_creation.strength * 5; - if (obj_creation.chapter = "Lamenters") { + if (obj_creation.chapter_name = "Lamenters") { penitent_max = 600; penitent_end = 600; // obj_controller.loyalty=50;obj_controller.loyalty_hidden=50; @@ -4088,6 +3358,118 @@ function scr_initialize_custom() { } } +/// @description helper function to streamline code inside of scr_initialize_custom, should only be used as part of +/// game setup and not during normal gameplay +function add_veh_to_company(name, company, slot, wep1, wep2, wep3, upgrade, accessory) { + obj_ini.veh_race[company, slot] = 1; + obj_ini.veh_loc[company, slot] = obj_ini.home_name; + obj_ini.veh_role[company, slot] = name; + obj_ini.veh_wep1[company, slot] = wep1; + obj_ini.veh_wep2[company, slot] = wep2; + obj_ini.veh_wep3[company, slot] = wep3; + obj_ini.veh_upgrade[company, slot] = upgrade; + obj_ini.veh_acc[company, slot] = accessory; + obj_ini.veh_hp[company, slot] = 100; + obj_ini.veh_chaos[company, slot] = 0; + obj_ini.veh_pilots[company, slot] = 0; + obj_ini.veh_lid[company, slot] = -1; + obj_ini.veh_wid[company, slot] = 2; +} + +/// @description helper function to streamline code inside of scr_initialize_custom, should only be used as part of +/// game setup and not during normal gameplay. +/// each item slot can be "" or "default" or a named item. "" will assign items from the available item pool. +/// Use "" if you want to set weapons and gear via squad layouts. +/// "default" will set it to the value in the default slot for the given role, see `load_default_gear` +function add_unit_to_company(ttrpg_name, company, slot, role_name, role_id, wep1="default", wep2="default", gear="default", mobi="default", armour="default"){ + obj_ini.TTRPG[company][slot] = new TTRPG_stats("chapter", company, slot, ttrpg_name); + obj_ini.race[company][slot] = 1; + obj_ini.loc[company][slot] = obj_ini.home_name; + obj_ini.role[company][slot] = role_name; + + if(obj_ini.name[company][slot] == ""){ + obj_ini.name[company][slot] = global.name_generator.generate_space_marine_name(); + } + var spawn_unit = fetch_unit([company,slot]); + if(ttrpg_name == "marine" || ttrpg_name == "scout"){ + spawn_unit.marine_assembling(); + } else { + spawn_unit.roll_age(); + spawn_unit.roll_experience(); + } + if(wep1 != ""){ + if(wep1 == "default"){ + spawn_unit.update_weapon_one(obj_ini.wep1[obj_ini.defaults_slot][role_id], false, false); + } else { + spawn_unit.update_weapon_one(wep1, false, false); + } + } + if(wep2 != ""){ + if(wep2 == "default"){ + spawn_unit.update_weapon_two(obj_ini.wep2[obj_ini.defaults_slot][role_id], false, false); + } else { + spawn_unit.update_weapon_two(wep2, false, false); + } + } + if(armour != ""){ + if(armour == "default"){ + spawn_unit.update_armour(obj_ini.armour[obj_ini.defaults_slot][role_id], false, false); + } else { + spawn_unit.update_armour(armour, false, false); + } + + // show_debug_message($"updating coy {company}:{slot} {role_name} armour to {armour}: {_msg} : {spawn_unit.armour()} : {obj_ini.armour[company][slot]}"); + } + if(gear != ""){ + if(gear == "default"){ + spawn_unit.update_gear(obj_ini.gear[obj_ini.defaults_slot][role_id], false, false); + } else { + spawn_unit.update_gear(gear, false, false); + } + } + if(mobi != ""){ + if(mobi == "default"){ + spawn_unit.update_mobility_item(obj_ini.mobi[obj_ini.defaults_slot][role_id], false, false); + } else { + spawn_unit.update_mobility_item(mobi, false, false); + } + } + if(role_id == eROLE.HonourGuard){ + spawn_unit.add_trait(choose("guardian", "champion", "observant", "perfectionist","natural_leader")); + } + if(role_id == eROLE.Champion){ + spawn_unit.add_trait("champion"); + } + if(role_id == eROLE.Librarian){ + var let = ""; + if (obj_creation.discipline = "default") { + let = "D"; + } + if (obj_creation.discipline = "biomancy") { + let = "B"; + } + if (obj_creation.discipline = "pyromancy") { + let = "P"; + } + if (obj_creation.discipline = "telekinesis") { + let = "T"; + } + if (obj_creation.discipline = "rune Magick") { + let = "R"; + } + obj_ini.spe[company][slot] += string(let) + "0|"; + + spawn_unit.add_trait("warp_touched"); + spawn_unit.psionic = choose(8, 9, 10, 11, 12, 13, 14); + spawn_unit.update_powers(); + if(scr_has_adv("Psyker Abundance")){ + spawn_unit.add_exp(10); + } + } + + return spawn_unit; +} + //function for making deep copies of structs as gml has no function function DeepCloneStruct(clone_struct) { if (is_array(clone_struct)) { @@ -4108,4 +3490,4 @@ function DeepCloneStruct(clone_struct) { return stc; } return clone_struct; -} \ No newline at end of file +} diff --git a/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml b/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml index bd3b71161..98fc4894e 100644 --- a/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml +++ b/scripts/scr_inquisition_fleet_functions/scr_inquisition_fleet_functions.gml @@ -216,8 +216,8 @@ function inquisition_inspection_logic(){ function inquisitor_approval_gene_banks(){ var gene_slave_count = 0; var hur=0 - for (var e=0;e0) then gene_slave_count+=obj_ini.slave_batch_num[e]; + for (var e=0;e=100) and (obj_controller.gene_seed>=1100) then hur=1; if (obj_controller.marines<=500) and (obj_controller.marines>200) and (gene_slave_count>=75) and (obj_controller.gene_seed>=900) then hur=1; diff --git a/scripts/scr_item_count/scr_item_count.gml b/scripts/scr_item_count/scr_item_count.gml index 1798b7f68..6b46115b7 100644 --- a/scripts/scr_item_count/scr_item_count.gml +++ b/scripts/scr_item_count/scr_item_count.gml @@ -2,14 +2,15 @@ function scr_item_count(item_type, quality="any") { // This script checks the equipment variables for the named item and returns the combined quantity - var i=0,von=0; - for (i=0;i 30) and (!obj_ini.zygote) and (string_count("Doom",obj_ini.strin2)==0) then obj_controller.gene_seed+=1; - if (unit.age() > 50) and (string_count("Doom",obj_ini.strin2)==0) then obj_controller.gene_seed+=1; + if (unit.age() > 30 && !obj_ini.zygote && !obj_ini.doomed) then obj_controller.gene_seed+=1; + if (unit.age() > 50 && !obj_ini.doomed) then obj_controller.gene_seed+=1; } if (obj_ini.race[company][unit_slot]==1){ if(is_specialist(obj_ini.role[company][unit_slot])){ diff --git a/scripts/scr_librarium/scr_librarium.gml b/scripts/scr_librarium/scr_librarium.gml index 22104c3b4..c7907139b 100644 --- a/scripts/scr_librarium/scr_librarium.gml +++ b/scripts/scr_librarium/scr_librarium.gml @@ -17,15 +17,6 @@ function set_chapter_arti_data(){ } function scr_librarium(){ var blurp=""; - var recruitment_pace = [ - " is currently halted.", - " is advancing sluggishly.", - " is advancing slowly.", - " is advancing moderately fast.", - " is advancing fast.", - " is advancing frenetically.", - " is advancing as fast as possible." - ]; var xx = __view_get(e__VW.XView, 0) + 0; var yy = __view_get(e__VW.YView, 0) + 0; draw_sprite(spr_rock_bg, 0, xx, yy); @@ -70,7 +61,10 @@ function scr_librarium(){ var tip2 = ""; // Set pace of recruitment based on training psyker value - if (training_psyker >= 0 && training_psyker <= 6) then blurp += recruitment_pace[training_psyker]; + if (training_psyker >= 0 && training_psyker <= 6){ + var _recruit_pace = ARR_recruitment_pace; + blurp += _recruit_pace[training_psyker]; + } var artif = "", artif_descr = "", @@ -348,11 +342,15 @@ function scr_librarium(){ var good = 0; if (obj_controller.artifacts>0){ for (var i = 1; i <= 20; i++) { - if (i <= 9) { + if (i <= 9 && i 0) then good = 2; diff --git a/scripts/scr_livery_setup/scr_livery_setup.gml b/scripts/scr_livery_setup/scr_livery_setup.gml new file mode 100644 index 000000000..9f6859201 --- /dev/null +++ b/scripts/scr_livery_setup/scr_livery_setup.gml @@ -0,0 +1,786 @@ +// Script assets have changed for v2.3.0 see +// https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information +function scr_livery_setup(){ + draw_set_font(fnt_40k_30b); + draw_set_halign(fa_center); + draw_set_alpha(1); + draw_set_color(38144); + + + tooltip=""; + tooltip2=""; + obj_cursor.image_index=0; + + draw_text_color_simple(800,80,string_hash_to_newline(string(chapter_name)),38144); + var draw_sprites = [spr_mk7_colors, spr_mk4_colors,spr_mk5_colors,spr_beakie_colors,spr_mk8_colors,spr_mk3_colors, spr_terminator3_colors]; + var draw_hem = [spr_generic_sgt_mk7, spr_generic_sgt_mk4,spr_generic_sgt_mk5,spr_generic_sgt_mk6,spr_generic_sgt_mk8,spr_generic_sgt_mk3, spr_generic_terminator_sgt]; + + var preview_box = { + x1: 444, + y1: 252, + w: 167, + h: 232, + } + preview_box.x2 = preview_box.x1 + preview_box.w; + preview_box.y2 = preview_box.y1 + preview_box.h; + + draw_sprite_stretched(spr_creation_arrow,0,preview_box.x1,preview_box.y1,32,32);// Left Arrow + draw_sprite_stretched(spr_creation_arrow,1,preview_box.x2-32,preview_box.y1,32,32);// Right Arrow + if (point_and_click([preview_box.x1,preview_box.y1,preview_box.x1+32,preview_box.y1+32])){ + test_sprite++; + if (test_sprite==array_length(draw_sprites)) then test_sprite=0; + } + if (point_and_click([preview_box.x2-32,preview_box.y1,preview_box.x2, preview_box.y1+32])){ + test_sprite--; + if (test_sprite<0) then test_sprite=(array_length(draw_sprites)-1); + } + livery_picker.draw_base(); + draw_rectangle_color_simple(preview_box.x1,preview_box.y1,preview_box.x2,preview_box.y2,1,38144); + if( shader_is_compiled(sReplaceColor)){ + shader_set(sReplaceColor); + + shader_set_uniform_f_array(colour_to_find1, body_colour_find ); + shader_set_uniform_f_array(colour_to_set1, body_colour_replace ); + shader_set_uniform_f_array(colour_to_find2, secondary_colour_find ); + shader_set_uniform_f_array(colour_to_set2, secondary_colour_replace ); + shader_set_uniform_f_array(colour_to_find3, pauldron_colour_find ); + shader_set_uniform_f_array(colour_to_set3, pauldron_colour_replace ); + shader_set_uniform_f_array(colour_to_find4, lens_colour_find ); + shader_set_uniform_f_array(colour_to_set4, lens_colour_replace ); + shader_set_uniform_f_array(colour_to_find5, trim_colour_find ); + shader_set_uniform_f_array(colour_to_set5, trim_colour_replace ); + shader_set_uniform_f_array(colour_to_find6, pauldron2_colour_find ); + shader_set_uniform_f_array(colour_to_set6, pauldron2_colour_replace ); + shader_set_uniform_f_array(colour_to_find7, weapon_colour_find ); + shader_set_uniform_f_array(colour_to_set7, weapon_colour_replace ); + + //Rejoice! + tester_sprite = draw_sprites[test_sprite]; + tester_helm = draw_hem[test_sprite]; + if (col_special=0) then draw_sprite(tester_sprite,10,preview_box.x1,preview_box.y1 + 8); + if (col_special=1) then draw_sprite(tester_sprite,11,preview_box.x1,preview_box.y1 + 8); + if (col_special>=2) then draw_sprite(tester_sprite,12,preview_box.x1,preview_box.y1 + 8); + + draw_sprite(tester_sprite,col_special,preview_box.x1,preview_box.y1 + 8); + if (col_special<=1){ + draw_sprite(tester_sprite,6,preview_box.x1,preview_box.y1 + 8); + draw_sprite(tester_sprite,8,preview_box.x1,preview_box.y1 + 8); + } + if (col_special>=2){ + draw_sprite(tester_sprite,6,preview_box.x1,preview_box.y1 + 8); + draw_sprite(tester_sprite,9,preview_box.x1,preview_box.y1 + 8); + } + if (trim=0) and (col_special<=1) then draw_sprite(tester_sprite,4,preview_box.x1,preview_box.y1 + 8); + if (trim=0) and (col_special>=2) then draw_sprite(tester_sprite,5,preview_box.x1,preview_box.y1 + 8); + //TODO this can be imprved but for now it's fit for purpose + if (complex_selection=="Sergeant Markers" && complex_livery){ + var sgt_col_1 = complex_livery_data.sgt.helm_primary; + var sgt_col_2 = complex_livery_data.sgt.helm_secondary; + var lens_col = complex_livery_data.sgt.helm_lens; + shader_set_uniform_f_array(colour_to_find1, [30/255,30/255,30/255]); + shader_set_uniform_f(colour_to_set1, col_r[sgt_col_1]/255, col_g[sgt_col_1]/255, col_b[sgt_col_1]/255); + shader_set_uniform_f_array(colour_to_find2, [200/255,0/255,0/255]); + shader_set_uniform_f(colour_to_set2, col_r[sgt_col_2]/255, col_g[sgt_col_2]/255, col_b[sgt_col_2]/255); + shader_set_uniform_f(colour_to_set4, col_r[lens_col]/255, col_g[lens_col]/255, col_b[lens_col]/255); + draw_sprite(tester_helm, complex_depth_selection, preview_box.x1,preview_box.y1 + 8); + } + else if (complex_selection=="Veteran Sergeant Markers" && complex_livery){ + var sgt_col_1 = complex_livery_data.vet_sgt.helm_primary; + var sgt_col_2 = complex_livery_data.vet_sgt.helm_secondary; + var lens_col = complex_livery_data.vet_sgt.helm_lens; + shader_set_uniform_f_array(colour_to_find1, [30/255,30/255,30/255]); + shader_set_uniform_f(colour_to_set1, col_r[sgt_col_1]/255, col_g[sgt_col_1]/255, col_b[sgt_col_1]/255); + shader_set_uniform_f_array(colour_to_find2, [200/255,0/255,0/255]); + shader_set_uniform_f(colour_to_set2, col_r[sgt_col_2]/255, col_g[sgt_col_2]/255, col_b[sgt_col_2]/255); + shader_set_uniform_f(colour_to_set4, col_r[lens_col]/255, col_g[lens_col]/255, col_b[lens_col]/255); + draw_sprite(tester_helm, complex_depth_selection, preview_box.x1,preview_box.y1 + 8); + } + else if (complex_selection=="Captain Markers" && complex_livery){ + var sgt_col_1 = complex_livery_data.captain.helm_primary; + var sgt_col_2 = complex_livery_data.captain.helm_secondary; + var lens_col = complex_livery_data.captain.helm_lens; + shader_set_uniform_f_array(colour_to_find1, [30/255,30/255,30/255]); + shader_set_uniform_f(colour_to_set1, col_r[sgt_col_1]/255, col_g[sgt_col_1]/255, col_b[sgt_col_1]/255); + shader_set_uniform_f_array(colour_to_find2, [200/255,0/255,0/255]); + shader_set_uniform_f(colour_to_set2, col_r[sgt_col_2]/255, col_g[sgt_col_2]/255, col_b[sgt_col_2]/255); + shader_set_uniform_f(colour_to_set4, col_r[lens_col]/255, col_g[lens_col]/255, col_b[lens_col]/255); + draw_sprite(tester_helm, complex_depth_selection, preview_box.x1,preview_box.y1 + 8); + } else if (complex_selection=="Veteran Markers" && complex_livery){ + var sgt_col_1 = complex_livery_data.veteran.helm_primary; + var sgt_col_2 = complex_livery_data.veteran.helm_secondary; + var lens_col = complex_livery_data.veteran.helm_lens; + shader_set_uniform_f_array(colour_to_find1, [30/255,30/255,30/255]); + shader_set_uniform_f(colour_to_set1, col_r[sgt_col_1]/255, col_g[sgt_col_1]/255, col_b[sgt_col_1]/255); + shader_set_uniform_f_array(colour_to_find2, [200/255,0/255,0/255]); + shader_set_uniform_f(colour_to_set2, col_r[sgt_col_2]/255, col_g[sgt_col_2]/255, col_b[sgt_col_2]/255); + shader_set_uniform_f(colour_to_set4, col_r[lens_col]/255, col_g[lens_col]/255, col_b[lens_col]/255); + draw_sprite(tester_helm, complex_depth_selection, preview_box.x1,preview_box.y1 + 8); + } + shader_set_uniform_f_array(colour_to_find1, body_colour_find ); + shader_set_uniform_f_array(colour_to_set1, body_colour_replace ); + shader_set_uniform_f_array(colour_to_find2, secondary_colour_find ); + shader_set_uniform_f_array(colour_to_set2, secondary_colour_replace ); + shader_set_uniform_f_array(colour_to_set4, lens_colour_replace ); + if(tester_sprite == spr_terminator3_colors){ + draw_sprite(spr_weapon_colors,0,444 - 12,252 + 5); + } else { + draw_sprite(spr_weapon_colors,0,444,252); + } + shader_reset(); + + }else{ + draw_text(444,252,string_hash_to_newline("Color swap shader#did not compile")); + } + var liv_string = $"Full Livery \n{livery_picker.role_set == 0? "default" :role[100][livery_picker.role_set]}"; + draw_text(160, 100, liv_string); + + draw_set_color(38144); + draw_set_halign(fa_left); + draw_text_transformed(580,118,"Battle Cry:",0.6,0.6,0); + draw_set_font(fnt_40k_14b); + if (text_selected!="battle_cry") or (custom<2) then draw_text_ext(580,144,string_hash_to_newline(string(battle_cry)+"!"),-1,580); + if (custom>1){ + if (text_selected="battle_cry") and (text_bar>30) then draw_text_ext(580,144,string_hash_to_newline(string(battle_cry)+"!"),-1,580); + if (text_selected="battle_cry") and (text_bar<=30) then draw_text_ext(580,144,string_hash_to_newline(string(battle_cry)+"|!"),-1,580); + var str_width=max(580,string_width_ext(string_hash_to_newline(battle_cry),-1,580)); + var hei=string_height_ext(string_hash_to_newline(battle_cry),-1,580); + if (scr_hit(580-2,144-2,582+str_width,146+hei)){obj_cursor.image_index=2; + if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="battle_cry";cooldown=8000;keyboard_string=battle_cry;} + } + if (text_selected="battle_cry") then battle_cry=keyboard_string; + draw_rectangle(580-2,144-2,582+580,146+hei,1); + } + + + + draw_rectangle(445, 200, 1125, 202, 0) + + draw_set_font(fnt_40k_30b); + draw_text_transformed(444,215,"Basic Livelry",0.6,0.6,0); + var button_alpha = custom < 2 ? 0.5 : 1; + var livery_swap_button = draw_unit_buttons([570,215], complex_livery? "Simple Livery":"Complex Livery",[1,1], 38144,, fnt_40k_14b, button_alpha); + if (point_and_click(livery_swap_button) && custom >= 2){ + complex_livery=!complex_livery; + } + var str,str_width,hei,x8,y8;x8=0;y8=0; + //Dont ask why the pauldron colours are switched i guess duke got confused between left and right at some point + //TODO extract this function somewhere + /*function draw_checkbox (cords, text, main_alpha, checked){ + draw_set_alpha(main_alpha); + yar = col_special==(i+1) ?1:0; + if (custom<2) then draw_set_alpha(0.5); + draw_sprite(spr_creation_check,yar,cur_button.cords[0],cur_button.cords[1]); + if (scr_hit(cur_button.cords[0],cur_button.cords[1],cur_button.cords[0]+32,cur_button.cords[1]+32) and allow_colour_click){ + cooldown=8000; + var onceh=0; + if (col_special=i+1) and (onceh=0){col_special=0;onceh=1;} + if (col_special!=i+1) and (onceh=0){col_special=i+1;onceh=1;} + } + draw_text_transformed(cur_button.cords[0]+30,cur_button.cords[1]+4,cur_button.text,0.4,0.4,0); + }*/ + if (!complex_livery){ + var button_data = [ + { + text : $"Primary : {col[main_color]}", + tooltip:"Primary", + tooltip2:"The main color of your Astartes and their vehicles.", + cords : [620, 252], + }, + { + text : $"Secondary: {col[secondary_color]}", + tooltip:"Secondary", + tooltip2:"The secondary color of your Astartes and their vehicles.", + cords : [620, 287], + }, + { + text : $"Pauldron 1: {col[right_pauldron]}", + tooltip:"First Pauldron", + tooltip2:"The color of your Astartes' right Pauldron. Normally this Pauldron displays their rank and designation.", + cords : [620, 322], + }, + { + text : $"Pauldron 2: {col[left_pauldron]}", + tooltip:"Second Pauldron", + tooltip2:"The color of your Astartes' left Pauldron. Normally this Pauldron contains the Chapter Insignia.", + cords : [620, 357], + }, + { + text : $"Trim: {col[main_trim]}", + tooltip:"Trim", + tooltip2:"The trim color that appears on the Pauldrons, armour plating, and any decorations.", + cords : [620, 392], + }, + { + text : $"Lens: {col[lens_color]}", + tooltip:"Lens", + tooltip2:"The color of your Astartes' lenss. Most of the time this will be the visor color.", + cords : [620, 427], + }, + { + text : $"Weapon: {col[weapon_color]}", + tooltip:"Weapon", + tooltip2:"The primary color of your Astartes' weapons.", + cords : [620, 462], + } + ] + var button_cords, cur_button; + for (var i=0;i= 2){ + cooldown=8000; + instance_destroy(obj_creation_popup); + var pp=instance_create(0,0,obj_creation_popup); + pp.type=i+1; + } + } + draw_set_color(38144); + var livery_type_options = [ + { + cords : [437,500], + text : $"Breastplate", + }, + { + cords : [554,500], + text : $"Vertical", + }, + { + cords : [662,500], + text : $"Quadrant", + }, + ] + var yar; + for (var i=0;i=1) and (custom>0) and (cooldown<=0) and (custom=2){ + instance_destroy(obj_creation_popup); + var pp=instance_create(0,0,obj_creation_popup); + pp.type=role_id+100; + cooldown=8000; + full_liveries[livery_picker.role_set] = DeepCloneStruct(livery_picker.map_colour); + livery_picker.role_set = role_id; + livery_picker.map_colour = full_liveries[role_id]; + if (!livery_picker.map_colour.is_changed){ + livery_picker.map_colour = DeepCloneStruct(full_liveries[0]); + } + } + } + } + } + } else { + var complex_livery_options = ["Sergeant Markers","Veteran Sergeant Markers", "Captain Markers", "Veteran Markers"]; + for (var i=0;i=1) and (!instance_exists(obj_creation_popup))){ + cooldown=8000; + var onceh=0; + load_to_ships[0] = !load_to_ships[0]; + } + draw_text_transformed(860+30,645+4+40,"Load to Ships",0.4,0.4,0); + + yar=0; + + draw_sprite(spr_creation_check,load_to_ships[0]==2,1010,645+40); + if (scr_hit(1010,645+40,1150,645+32+40)) and (!instance_exists(obj_creation_popup)){ + tooltip="Load (Sans Escorts)"; + tooltip2="Check to have your Astartes automatically loaded into ships, except for Escorts, when the game starts."; + } + if (point_and_click([1010,645+40,1020+32,645+32+40])) and (!instance_exists(obj_creation_popup)){ + cooldown=8000; + load_to_ships[0] = (load_to_ships[0]!=2) ? 2 : 0; + + } + draw_text_transformed(1010+30,645+4+40,"Load (Sans Escorts)",0.4,0.4,0); + + yar=0; + if (load_to_ships[0] > 0){ + if (load_to_ships[1] == 1){ + yar=1; + } + draw_sprite(spr_creation_check,yar,860,645+80);yar=0; + if (scr_hit(860,645+80,1005,645+32+80)) and (!instance_exists(obj_creation_popup)){tooltip="Distribute Scouts";tooltip2="Check to have your Scouts split across ships in the fleet.";} + if (scr_hit(860,645+80,860+32,645+32+80)) and (cooldown<=0) and (mouse_left>=1) and (!instance_exists(obj_creation_popup)){ + cooldown=8000; + load_to_ships[1] = !load_to_ships[1]; + } + draw_text_transformed(860+30,645+4+80,"Distribute Scouts",0.4,0.4,0); + + yar=0; + if (load_to_ships[2] == 1){ + yar=1; + } + draw_sprite(spr_creation_check,yar,1010,645+80);yar=0; + if (scr_hit(1010,645+80,1150,645+32+80)) and (!instance_exists(obj_creation_popup)){ + tooltip="Distribute Veterans";tooltip2="Check to have your Veterans split across the fleet."; + } + if (scr_hit(1010,645+80,1020+32,645+32+80)) and (cooldown<=0) and (mouse_left>=1) and (!instance_exists(obj_creation_popup)){ + cooldown=8000;var onceh=0; + load_to_ships[2] = !load_to_ships[2] + } + draw_text_transformed(1010+30,645+4+80,"Distribute Veterans",0.4,0.4,0); + } + + + + + draw_line(433,535,844,535); + draw_line(433,536,844,536); + draw_line(433,537,844,537); + + if (!instance_exists(obj_creation_popup)){ + + if (scr_hit(540,547,800,725)){tooltip="Advisor Names";tooltip2="The names of your main Advisors. They provide useful information and reports on the divisions of your Chapter.";} + + draw_text_transformed(444,550,string_hash_to_newline("Advisor Names"),0.6,0.6,0); + draw_set_font(fnt_40k_14b); + draw_set_halign(fa_right); + if (race[100,15]!=0) then draw_text(594,575,("Chief Apothecary: ")); + if (race[100,14]!=0) then draw_text(594,597,("High Chaplain: ")); + if (race[100,17]!=0) then draw_text(594,619,("Chief Librarian: ")); + if (race[100,16]!=0) then draw_text(594,641,("Forge Master: ")); + draw_text(594,663,"Master of Recruits: "); + draw_text(594,685,"Master of the Fleet: "); + draw_set_halign(fa_left); + + if (race[100,15]!=0){ + draw_set_color(38144);if (hapothecary="") then draw_set_color(c_red); + if (text_selected!="apoth") or (custom<2) then draw_text_ext(600,575,string_hash_to_newline(string(hapothecary)),-1,580); + if (custom>1){ + if (text_selected="capoth") and (text_bar>30) then draw_text_ext(600,575,string_hash_to_newline(string(hapothecary)),-1,580); + if (text_selected="capoth") and (text_bar<=30) then draw_text_ext(600,575,string_hash_to_newline(string(hapothecary)+"|"),-1,580); + var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(hapothecary),-2,580); + if (scr_hit(600,575,785,575+hei)){obj_cursor.image_index=2; + if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){ + text_selected="capoth"; + cooldown=8000;keyboard_string=hapothecary; + } + } + if (text_selected="capoth") then hapothecary=keyboard_string; + draw_rectangle(600-1,575-1,785,575+hei,1); + + var _refresh_capoth_name_btn =[794, 574, 794+20, 574+20]; + draw_unit_buttons(_refresh_capoth_name_btn,"?", [1,1], 38144,,fnt_40k_14b); + if(point_and_click(_refresh_capoth_name_btn)){ + var _new_capoth_name = global.name_generator.generate_space_marine_name(); + show_debug_message($"regen name of hapothecary from {hapothecary} to {_new_capoth_name}"); + hapothecary = _new_capoth_name; + } + } + } + + if (race[100,14]!=0){ + draw_set_color(38144);if (hchaplain="") then draw_set_color(c_red); + if (text_selected!="chap") or (custom<2) then draw_text_ext(600,597,string_hash_to_newline(string(hchaplain)),-1,580); + if (custom>1){ + if (text_selected="chap") and (text_bar>30) then draw_text_ext(600,597,string_hash_to_newline(string(hchaplain)),-1,580); + if (text_selected="chap") and (text_bar<=30) then draw_text_ext(600,597,string_hash_to_newline(string(hchaplain)+"|"),-1,580); + var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(hchaplain),-2,580); + if (scr_hit(600,597,785,597+hei)){obj_cursor.image_index=2; + if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="chap";cooldown=8000;keyboard_string=hchaplain;} + } + if (text_selected="chap") then hchaplain=keyboard_string; + draw_rectangle(600-1,597-1,785,597+hei,1); + + var _refresh_chap_name_btn =[794, 597, 794+20, 597+20]; + draw_unit_buttons(_refresh_chap_name_btn,"?", [1,1], 38144,,fnt_40k_14b); + if(point_and_click(_refresh_chap_name_btn)){ + var _new_chap_name = global.name_generator.generate_space_marine_name(); + show_debug_message($"regen name of hchaplain from {hchaplain} to {_new_chap_name}"); + hchaplain = _new_chap_name; + } + } + } + + if (race[100,17]!=0){ + draw_set_color(38144);if (clibrarian="") then draw_set_color(c_red); + if (text_selected!="libra") or (custom<2) then draw_text_ext(600,619,string_hash_to_newline(string(clibrarian)),-1,580); + if (custom>1){ + if (text_selected="libra") and (text_bar>30) then draw_text_ext(600,619,string_hash_to_newline(string(clibrarian)),-1,580); + if (text_selected="libra") and (text_bar<=30) then draw_text_ext(600,619,string_hash_to_newline(string(clibrarian)+"|"),-1,580); + var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(clibrarian),-2,580); + if (scr_hit(600,619,785,619+hei)){obj_cursor.image_index=2; + if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="libra";cooldown=8000;keyboard_string=clibrarian;} + } + if (text_selected="libra") then clibrarian=keyboard_string; + draw_rectangle(600-1,619-1,785,619+hei,1); + + var _refresh_libra_name_btn =[794, 619, 794+20, 619+20]; + draw_unit_buttons(_refresh_libra_name_btn,"?", [1,1], 38144,,fnt_40k_14b); + if(point_and_click(_refresh_libra_name_btn)){ + var _new_libra_name = global.name_generator.generate_space_marine_name(); + show_debug_message($"regen name of clibrarian from {clibrarian} to {_new_libra_name}"); + clibrarian = _new_libra_name; + } + } + } + + if (race[100,16]!=0){ + draw_set_color(38144);if (fmaster="") then draw_set_color(c_red); + if (text_selected!="forge") or (custom<2) then draw_text_ext(600,641,string_hash_to_newline(string(fmaster)),-1,580); + if (custom>1){ + if (text_selected="forge") and (text_bar>30) then draw_text_ext(600,641,string_hash_to_newline(string(fmaster)),-1,580); + if (text_selected="forge") and (text_bar<=30) then draw_text_ext(600,641,string_hash_to_newline(string(fmaster)+"|"),-1,580); + var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(fmaster),-2,580); + if (scr_hit(600,641,785,641+hei)){obj_cursor.image_index=2; + if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="forge";cooldown=8000;keyboard_string=fmaster;} + } + if (text_selected="forge") then fmaster=keyboard_string; + draw_rectangle(600-1,641-1,785,641+hei,1); + + var _refresh_forge_name_btn =[794, 641, 794+20, 641+20]; + draw_unit_buttons(_refresh_forge_name_btn,"?", [1,1], 38144,,fnt_40k_14b); + if(point_and_click(_refresh_forge_name_btn)){ + var _new_forge_name = global.name_generator.generate_space_marine_name(); + show_debug_message($"regen name of fmaster from {fmaster} to {_new_forge_name}"); + fmaster = _new_forge_name; + } + } + } + + draw_set_color(38144);if (recruiter="") then draw_set_color(c_red); + if (text_selected!="recr") or (custom<2) then draw_text_ext(600,663,string_hash_to_newline(string(recruiter)),-1,580); + if (custom>1){ + if (text_selected="recr") and (text_bar>30) then draw_text_ext(600,663,string_hash_to_newline(string(recruiter)),-1,580); + if (text_selected="recr") and (text_bar<=30) then draw_text_ext(600,663,string_hash_to_newline(string(recruiter)+"|"),-1,580); + var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(recruiter),-2,580); + if (scr_hit(600,663,785,663+hei)){obj_cursor.image_index=2; + if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="recr";cooldown=8000;keyboard_string=recruiter;} + } + if (text_selected="recr") then recruiter=keyboard_string; + draw_rectangle(600-1,663-1,785,663+hei,1); + + var _refresh_recr_name_btn =[794, 663, 794+20, 663+20]; + draw_unit_buttons(_refresh_recr_name_btn,"?", [1,1], 38144,,fnt_40k_14b); + if(point_and_click(_refresh_recr_name_btn)){ + var _new_recr_name = global.name_generator.generate_space_marine_name(); + show_debug_message($"regen name of recruiter from {recruiter} to {_new_recr_name}"); + recruiter = _new_recr_name; + } + } + + draw_set_color(38144);if (admiral="") then draw_set_color(c_red); + if (text_selected!="admi") or (custom<2) then draw_text_ext(600,685,string_hash_to_newline(string(admiral)),-1,580); + if (custom>1){ + if (text_selected="admi") and (text_bar>30) then draw_text_ext(600,685,string_hash_to_newline(string(admiral)),-1,580); + if (text_selected="admi") and (text_bar<=30) then draw_text_ext(600,685,string_hash_to_newline(string(admiral)+"|"),-1,580); + var str_width,hei;str_width=0;hei=string_height_ext(string_hash_to_newline(admiral),-2,580); + if (scr_hit(600,685,785,685+hei)){obj_cursor.image_index=2; + if (mouse_left>=1) and (cooldown<=0) and (!instance_exists(obj_creation_popup)){text_selected="admi";cooldown=8000;keyboard_string=admiral;} + } + if (text_selected="admi") then admiral=keyboard_string; + draw_rectangle(600-1,685-1,785,685+hei,1); + + var _refresh_admi_name_btn =[794, 685, 794+20, 685+20]; + draw_unit_buttons(_refresh_admi_name_btn,"?", [1,1], 38144,,fnt_40k_14b); + if(point_and_click(_refresh_admi_name_btn)){ + var _new_admi_name = global.name_generator.generate_space_marine_name(); + show_debug_message($"regen name of admiral from {admiral} to {_new_admi_name}"); + admiral = _new_admi_name; + } + } + + + + } +} \ No newline at end of file diff --git a/scripts/scr_livery_setup/scr_livery_setup.yy b/scripts/scr_livery_setup/scr_livery_setup.yy new file mode 100644 index 000000000..ea65ef99a --- /dev/null +++ b/scripts/scr_livery_setup/scr_livery_setup.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "scr_livery_setup", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "Scripts", + "path": "folders/Scripts.yy", + }, +} \ No newline at end of file diff --git a/scripts/scr_load/scr_load.gml b/scripts/scr_load/scr_load.gml index 4f54b09be..3e4464749 100644 --- a/scripts/scr_load/scr_load.gml +++ b/scripts/scr_load/scr_load.gml @@ -21,7 +21,7 @@ function load_marine_struct(company, marine){ function scr_load(save_part, save_id) { var unit; - var rang=0,i=0,g=0,stars=0,pfleets=0,efleets=0; + var rang=0,stars=0,pfleets=0,efleets=0; @@ -153,7 +153,12 @@ function scr_load(save_part, save_id) { } } + // obj_ini + //TODO allow methods to be passed as teh default to return_json_from_ini to optomise load speed + var livery_picker = new ColourItem(0,0); + livery_picker.scr_unit_draw_data(); + obj_ini.full_liveries = return_json_from_ini("Ini", "full_liveries",array_create(21,DeepCloneStruct(livery_picker.map_colour))); obj_ini.home_name=ini_read_string("Ini","home_name","Error"); obj_ini.home_type=ini_read_string("Ini","home_type","Error"); obj_ini.recruiting_name=ini_read_string("Ini","recruiting_name","Error"); @@ -165,14 +170,29 @@ function scr_load(save_part, save_id) { obj_ini.icon_name=ini_read_string("Ini","icon_name","custom1"); global.icon_name=obj_ini.icon_name; obj_ini.man_size=ini_read_real("Ini","man_size",0); - obj_ini.strin=ini_read_string("Ini","strin1",""); - obj_ini.strin2=ini_read_string("Ini","strin2",""); + // obj_ini.strin=ini_read_string("Ini","strin1",""); + // obj_ini.strin2=ini_read_string("Ini","strin2",""); obj_ini.psy_powers=ini_read_string("Ini","psy_powers","default"); + + global.chapter_icon_sprite = ini_read_real("Ini", "global_chapter_icon_sprite", spr_icon_chapters); + global.chapter_icon_frame = ini_read_real("Ini", "global_chapter_icon_frame", 0); + global.chapter_icon_path = ini_read_string("Ini", "global_chapter_icon_path", "Error"); + global.chapter_icon_filename = ini_read_real("Ini", "global_chapter_icon_filename", 0); + + + if(global.chapter_icon_path != "Error" && global.chapter_icon_path != "") { + global.chapter_icon_sprite = scr_image_cache(global.chapter_icon_path, global.chapter_icon_filename); + } else { + global.chapter_icon_sprite = spr_icon_chapters; + } + + obj_ini.companies=ini_read_real("Ini","companies",10); - var i;i=-1;repeat(21){i+=1;obj_ini.company_title[i]=ini_read_string("Ini","comp_title"+string(i),"");} - var i;i=-1;repeat(121){i+=1;obj_ini.slave_batch_num[i]=ini_read_real("Ini","slave_num_"+string(i),0);obj_ini.slave_batch_eta[i]=ini_read_real("Ini","slave_eta_"+string(i),0);} + obj_ini.company_title = return_json_from_ini("Ini","comp_title",array_create(21,"")); + obj_ini.gene_slaves = return_json_from_ini("Ini","gene_slaves",[]); + obj_ini.complex_livery_data=ini_read_string("Ini","complex_livery",""); if (obj_ini.complex_livery_data!=""){ obj_ini.complex_livery_data=json_parse(base64_decode(obj_ini.complex_livery_data)); @@ -180,6 +200,9 @@ function scr_load(save_part, save_id) { //TODO centralise and initialisation method for this other reference place is obj_creation create obj_ini.complex_livery_data = complex_livery_default(); } + var colour_temp = new ColourItem(0,0); + + obj_ini.full_liveries = return_json_from_ini("Ini", "FullLivery",colour_temp.scr_unit_draw_data()); // obj_ini.preomnor=ini_read_real("Ini","preomnor",0); obj_ini.voice=ini_read_real("Ini","voice",0); @@ -234,56 +257,36 @@ function scr_load(save_part, save_id) { } } // - obj_ini.ship_location[0]=""; - - if (global.restart=0){ - var g;g=-1;repeat(200){g+=1; - obj_ini.ship[g]=ini_read_string("Ships","shi"+string(g),""); - obj_ini.ship_uid[g]=ini_read_real("Ships","shi_uid"+string(g),0); - obj_ini.ship_class[g]=ini_read_string("Ships","shi_class"+string(g),""); - // - obj_ini.ship_size[g]=ini_read_real("Ships","shi_size"+string(g),0); - obj_ini.ship_leadership[g]=ini_read_real("Ships","shi_leadership"+string(g),0); - obj_ini.ship_hp[g]=ini_read_real("Ships","shi_hp"+string(g),0); - obj_ini.ship_maxhp[g]=ini_read_real("Ships","shi_maxhp"+string(g),0); - - if (obj_ini.ship_maxhp[g]<200) and (obj_ini.ship_maxhp[g]!=0){ - obj_ini.ship_hp[g]=obj_ini.ship_hp[g]*2; - obj_ini.ship_maxhp[g]=obj_ini.ship_maxhp[g]*2; - } + obj_ini.ship = return_json_from_ini("Ships","shi",[]); + obj_ini.ship_uid =return_json_from_ini("Ships","shi_uid",[]); + obj_ini.ship_class= return_json_from_ini("Ships","shi_class",[]); + obj_ini.ship_size = return_json_from_ini("Ships","shi_size",[]); + obj_ini.ship_leadership =return_json_from_ini("Ships","shi_leadership",[]); + obj_ini.ship_hp =return_json_from_ini("Ships","shi_hp",[]); + obj_ini.ship_maxhp =return_json_from_ini("Ships","shi_maxhp",[]); + obj_ini.ship_owner = return_json_from_ini("Ships","shi_owner",[]); + + obj_ini.ship_location=return_json_from_ini("Ships","shi_location",[]); + obj_ini.ship_shields=return_json_from_ini("Ships","shi_shields",[]); + obj_ini.ship_conditions=return_json_from_ini("Ships","shi_conditions",[]); + obj_ini.ship_speed=return_json_from_ini("Ships","shi_speed",[]); + obj_ini.ship_turning=return_json_from_ini("Ships","shi_turning",[]); + + obj_ini.ship_front_armour=return_json_from_ini("Ships","shi_front_ac",[]); + obj_ini.ship_other_armour=return_json_from_ini("Ships","shi_other_ac",[]); + obj_ini.ship_weapons=return_json_from_ini("Ships","shi_weapons",[]); + + obj_ini.ship_wep=return_json_from_ini("Ships","wep",array_create(6, "")); + obj_ini.ship_wep_facing=return_json_from_ini("Ships","wep_facing",array_create(6, "")); + obj_ini.ship_wep_condition=return_json_from_ini("Ships","wep_condition",array_create(6, "")); + + obj_ini.ship_capacity=return_json_from_ini("Ships","shi_capacity",[]); + obj_ini.ship_carrying=return_json_from_ini("Ships","shi_carrying",[]); + obj_ini.ship_contents=return_json_from_ini("Ships","shi_contents",[]); + obj_ini.ship_turrets=return_json_from_ini("Ships","shi_turrets",[]); - obj_ini.ship_location[g]=ini_read_string("Ships","shi_location"+string(g),""); - obj_ini.ship_shields[g]=ini_read_real("Ships","shi_shields"+string(g),0); - obj_ini.ship_conditions[g]=ini_read_string("Ships","shi_conditions"+string(g),""); - obj_ini.ship_speed[g]=ini_read_real("Ships","shi_speed"+string(g),0); - obj_ini.ship_turning[g]=ini_read_real("Ships","shi_turning"+string(g),0); - obj_ini.ship_front_armour[g]=ini_read_real("Ships","shi_front_ac"+string(g),0); - obj_ini.ship_other_armour[g]=ini_read_real("Ships","shi_other_ac"+string(g),0); - obj_ini.ship_weapons[g]=ini_read_real("Ships","shi_weapons"+string(g),0); - // - obj_ini.ship_wep[g,1]=ini_read_string("Ships","shi"+string(g)+"wep1",""); - obj_ini.ship_facing[g,1]=ini_read_string("Ships","shi"+string(g)+"facing1",""); - obj_ini.ship_condition[g,1]=ini_read_string("Ships","shi"+string(g)+"condition1",""); - obj_ini.ship_wep[g,2]=ini_read_string("Ships","shi"+string(g)+"wep2",""); - obj_ini.ship_facing[g,2]=ini_read_string("Ships","shi"+string(g)+"facing2",""); - obj_ini.ship_condition[g,2]=ini_read_string("Ships","shi"+string(g)+"condition2",""); - obj_ini.ship_wep[g,3]=ini_read_string("Ships","shi"+string(g)+"wep3",""); - obj_ini.ship_facing[g,3]=ini_read_string("Ships","shi"+string(g)+"facing3",""); - obj_ini.ship_condition[g,3]=ini_read_string("Ships","shi"+string(g)+"condition3",""); - obj_ini.ship_wep[g,4]=ini_read_string("Ships","shi"+string(g)+"wep4",""); - obj_ini.ship_facing[g,4]=ini_read_string("Ships","shi"+string(g)+"facing4",""); - obj_ini.ship_condition[g,4]=ini_read_string("Ships","shi"+string(g)+"condition4",""); - obj_ini.ship_wep[g,5]=ini_read_string("Ships","shi"+string(g)+"wep5",""); - obj_ini.ship_facing[g,5]=ini_read_string("Ships","shi"+string(g)+"facing5",""); - obj_ini.ship_condition[g,5]=ini_read_string("Ships","shi"+string(g)+"condition5",""); - // - obj_ini.ship_capacity[g]=ini_read_real("Ships","shi_capacity"+string(g),0); - obj_ini.ship_carrying[g]=ini_read_real("Ships","shi_carrying"+string(g),0); - obj_ini.ship_contents[g]=ini_read_string("Ships","shi_contents"+string(g),""); - obj_ini.ship_turrets[g]=ini_read_real("Ships","shi_turrets"+string(g),0); - } - } + } // the fun begins here ini_close(); } @@ -298,7 +301,6 @@ function scr_load(save_part, save_id) { good=0;coh=100;mah=-1; if (global.restart=0){ - var coh,mah,good; good=0;coh=10;mah=205; repeat(2255){ if (good=0){ @@ -312,7 +314,7 @@ function scr_load(save_part, save_id) { obj_ini.veh_race[coh,mah]=ini_read_real("Veh","co"+string(coh)+"."+string(mah),0); obj_ini.veh_loc[coh,mah]=ini_read_string("Veh","lo"+string(coh)+"."+string(mah),""); obj_ini.veh_role[coh,mah]=ini_read_string("Veh","rol"+string(coh)+"."+string(mah),"");// temp_name; - obj_ini.veh_lid[coh,mah]=ini_read_real("Veh","lid"+string(coh)+"."+string(mah),0); + obj_ini.veh_lid[coh,mah]=ini_read_real("Veh","lid"+string(coh)+"."+string(mah),-1); obj_ini.veh_uid[coh,mah]=ini_read_real("Veh","uid"+string(coh)+"."+string(mah),0); obj_ini.veh_wid[coh,mah]=ini_read_real("Veh","wid"+string(coh)+"."+string(mah),0); @@ -330,7 +332,6 @@ function scr_load(save_part, save_id) { } } - var coh,mah,good; good=0;coh=100;mah=-1; repeat(31){mah+=1; obj_ini.race[coh,mah]=ini_read_real("Mar","co"+string(coh)+"."+string(mah),0); diff --git a/scripts/scr_load_controller/scr_load_controller.gml b/scripts/scr_load_controller/scr_load_controller.gml index 90360f9f5..fdf62103a 100644 --- a/scripts/scr_load_controller/scr_load_controller.gml +++ b/scripts/scr_load_controller/scr_load_controller.gml @@ -36,9 +36,7 @@ function scr_load_controller(save_id){ debugl("Could not load save game " + save_file_name + ", file does not exist."); game_restart(); } - - // TODO temporary disabled. Will be reenabled during ironman/autosave feature task - //file_decrypt("tsave.ini","p"); + ini_open("tsave.ini"); // Global variables @@ -208,7 +206,7 @@ function scr_load_controller(save_id){ obj_controller.blood_debt=ini_read_real("Controller","penitent_blood",0); obj_controller.training_apothecary=ini_read_real("Controller","training_apothecary",0); - obj_controller.apothecary_points=ini_read_real("Controller","apothecary_points",0); + obj_controller.apothecary_recruit_points=ini_read_real("Controller","apothecary_recruit_points",0); obj_controller.apothecary_aspirant=ini_read_real("Controller","apothecary_aspirant",0); obj_controller.training_chaplain=ini_read_real("Controller","training_chaplain",0); obj_controller.chaplain_points=ini_read_real("Controller","chaplain_points",0); @@ -232,9 +230,10 @@ function scr_load_controller(save_id){ if (Production_research!=0){ obj_controller.production_research = json_parse(base64_decode(Production_research)); } - var Forge_queue=ini_read_string("Controller","forge_queue",0); - if (Forge_queue!=0){ - obj_controller.forge_queue = json_parse(base64_decode(Forge_queue)); + specialist_point_handler = new SpecialistPointHandler(); + var forge_queue=ini_read_string("Controller","forge_queue",0); + if (forge_queue!=0){ + obj_controller.specialist_point_handler.forge_queue = json_parse(base64_decode(forge_queue)); } var Stc_research=ini_read_string("Controller","stc_research",0); if (Stc_research!=0){ @@ -248,7 +247,8 @@ function scr_load_controller(save_id){ if (obj_controller.command_set[23]=0) and (obj_controller.command_set[24]=0) then obj_controller.command_set[24]=1; - ini_read_real("Controller","blandify",0); + ini_read_real("Controller","modest_livery",0); + ini_read_real("Controller","progenitor_visuals",0); var _recruit_data = return_json_from_ini("Recruit", "data", { names:[""], corruption :[0], @@ -380,7 +380,7 @@ function scr_load_controller(save_id){ obj_controller.secondary_color = tempa2; obj_ini.secondary_color = tempa2; - tempa = ini_read_string("Controller", "trim_color", "Error"); + tempa = ini_read_string("Controller", "main_trim", "Error"); tempa2 = 0; q = 0; good = 0; @@ -390,10 +390,10 @@ function scr_load_controller(save_id){ tempa2 = q; } } - obj_controller.trim_color = tempa2; - obj_ini.trim_color = tempa2; + obj_controller.main_trim = tempa2; + obj_ini.main_trim = tempa2; - tempa = ini_read_string("Controller", "pauldron2_color", "Error"); + tempa = ini_read_string("Controller", "left_pauldron", "Error"); tempa2 = 0; q = 0; good = 0; @@ -403,10 +403,10 @@ function scr_load_controller(save_id){ tempa2 = q; } } - obj_controller.pauldron2_color = tempa2; - obj_ini.pauldron2_color = tempa2; + obj_controller.left_pauldron = tempa2; + obj_ini.left_pauldron = tempa2; - tempa = ini_read_string("Controller", "pauldron_color", "Error"); + tempa = ini_read_string("Controller", "right_pauldron", "Error"); tempa2 = 0; q = 0; good = 0; @@ -416,8 +416,8 @@ function scr_load_controller(save_id){ tempa2 = q; } } - obj_controller.pauldron_color = tempa2; - obj_ini.pauldron_color = tempa2; + obj_controller.right_pauldron = tempa2; + obj_ini.right_pauldron = tempa2; tempa = ini_read_string("Controller", "lens_color", "Error"); tempa2 = 0; diff --git a/scripts/scr_log/scr_log.gml b/scripts/scr_log/scr_log.gml index d3fb0b5b5..e7db174ea 100644 --- a/scripts/scr_log/scr_log.gml +++ b/scripts/scr_log/scr_log.gml @@ -1,81 +1,130 @@ -/// @function log_into_file -/// @description Creates an error file in the logs folder and puts _message there. -/// @param {string} _message string to put into the error log. -function log_into_file(_message) { +#macro STR_error_message_head $"Your game just encountered and caught an error!" +#macro STR_error_message_head2 $"Your game just encountered a critical error! :(" +#macro STR_error_message_head3 $"Your game just encountered and caught an error! ({0})" +#macro STR_error_message $"The error log is automatically copied into your clipboard and a copy is created at: \nC:>Users>(UserName)>AppData>Local>ChapterMaster>Logs\n\nPlease, follow these steps:\n1) Create a bug report on our 'Chapter Master Discord' server.\n2) Press CTRL+V to paste the error log.\n3) Title the report with the error log's first line.\n4) If the log isn't pasted, locate and attach the latest error log file.\n\nThank you!" +#macro STR_error_message_ps $"P.S. You can ALT-TAB and try to continue playing, though it’s recommended to wait for a response in the bug-report forum." + +/// @description Logs the _message into a file in the Logs folder. +/// @param {string} _message - The message to log. +function create_error_file(_message) { if (string_length(_message) > 0) { - var _entry = string(_message); var _date_time = $"{DATE_TIME_1}"; - var _log_file = file_text_open_write("logs/" + $"{_date_time}_error.log"); - - file_text_write_string(_log_file, _entry); + var _log_file = file_text_open_write("Logs/" + $"{_date_time}_error.log"); + file_text_write_string(_log_file, _message); file_text_close(_log_file); } } -function try_and_report_loop(dev_marker="",func, turn_end=true, args=[], catch_custom=0, catch_args=[]) { - try{ - method_call(func,args); - } catch (_exception){ - handle_exception(_exception, string(STR_error_message_head3, dev_marker), undefined, true, dev_marker); +/// @description Displays a popup, logs the error into file, and copies to clipboard. +/// @param {string} _header - Header for the error popup. +/// @param {string} _message - Detailed message for the error. +/// @param {string} _stacktrace - Optional. +/// @param {string} _critical - Optional. +/// @param {string} _report_title - Optional. Preset title for the bug report. +function handle_error(_header, _message, _stacktrace="", _critical = false, _report_title="") { + var _full_message = ""; + _full_message += $"{LB_92}\n"; + _full_message += $"{_header}\n\n"; + _full_message += $"Date-Time: {DATE_TIME_3}\n"; + var _format_version = string_split(global.game_version, "/"); + _full_message += $"Game Version: {_format_version[0]}\n"; + _full_message += $"Build Date: {global.build_date}\n"; + _full_message += $"Commit Hash: {global.commit_hash}\n\n"; + _full_message += $"Details:\n"; + _full_message += $"{_message}\n\n"; + _full_message += $"Stacktrace:\n"; + _full_message += $"{_stacktrace}\n"; + _full_message += $"{LB_92}"; + + if (_report_title != "") { + _report_title += "\n"; + } + + var _commit_history_link = $"https://github.com/EttyKitty/ChapterMaster/commits/{global.commit_hash}"; + create_error_file($"{_report_title}{_full_message}\n{_commit_history_link}"); + show_debug_message(_full_message); + + var _clipboard_message = ""; + _clipboard_message += $"{_report_title}"; + _clipboard_message += $"{markdown_codeblock(_full_message, "log")}\n"; + _clipboard_message += $"{_commit_history_link}"; + clipboard_set_text(_clipboard_message); + + var _player_message = ""; + _player_message += $"{_header}\n\n"; + _player_message += $"{STR_error_message}"; + _player_message += _critical ? "" : $"\n\n{STR_error_message_ps}"; + show_message(_player_message); +} + +/// @function handle_exception +/// @description Manages exception display and logging with optional severity. +/// @param {exception} _exception - The exception to handle. +/// @param {string} custom_title - Optional custom title for the error popup. +/// @param {bool} critical - Whether the error is critical (default: false). +/// @param {string} error_marker - Optional marker for the error. +function handle_exception(_exception, custom_title=STR_error_message_head, critical=false, error_marker="") { + var _header = critical ? STR_error_message_head2 : custom_title; + var _message = _exception.longMessage; + var _stacktrace = array_to_string_list(_exception.stacktrace); + var _report_title = $"[{global.game_version}] {_exception.stacktrace[0]}"; + handle_error(_header, _message, _stacktrace, critical, _report_title); +} + +/// @description Attempts to run a function and reports any errors caught. +/// @param {string} dev_marker - Developer marker for the error. +/// @param {function} func - The function to run. +/// @param {bool} turn_end - Whether to end the turn after an error. +/// @param {array} args - Arguments to pass to the function. +/// @param {function} catch_custom - Custom function to run on error. +/// @param {array} catch_args - Arguments to pass to the custom function. +function try_and_report_loop(dev_marker="Generic Error", func, turn_end=true, args=[], catch_custom=0, catch_args=[]) { + try { + method_call(func, args); + } catch (_exception) { + handle_exception(_exception, string(STR_error_message_head3, dev_marker), false, dev_marker); if (is_method(catch_custom)) { method_call(catch_custom, catch_args); } } } -/// @function handle_exception -/// @description Accepts an exception to display an error and log it. -/// @param {struct} _exception exception struct. -/// @param {string} custom_name custom error name to display in the title. -function handle_exception(_exception, custom_title = STR_error_message_head, custom_message = MSG_error_message, non_critical = true, error_marker = ""){ - #macro STR_error_message_head "Your game just encountered and caught an error :(" - #macro STR_error_message_head2 "Your game just encountered a critical error :(" - #macro STR_error_message_head3 "Your game just encountered and caught an error ({0}) :(" - #macro MSG_error_message $"The error log is automatically copied into your clipboard and a copy is created at: \nC:>Users>(UserName)>AppData>Local>ChapterMaster>ErrorLogs \n\nPlease, do the following: \n\n1) Create a bug report on the bug-report-forum in our 'Chapter Master Discord' server. \n\n2) Press CTRL+V to paste the error log into the bug report. \n\n3) Title your report by cutting and pasting the first line of the main message (it contains game version and file that caused the error). \n\n4) If for some reason the error log wasn't pasted, find the location that is mentioned above and attach the latest (sort by time) _error.log to your bug report. In this case you can name your report as you wish. \n\n\nThank you :)" - #macro MSG_error_message_ps $"P.S. You can ALT-TAB and try to continue playing - if the error is not severe, the game should continue working, just try to avoid what caused it. \n\nBut it's recommended to wait for a response on the bug-report forum, otherwise you may make the issue worse." - - var _popup_header = $"{custom_title}\n\n"; - var _popup_message = $"{custom_message}"; - var _player_message = _popup_header + _popup_message; - if (non_critical) then _player_message += $"\n\n\n{MSG_error_message_ps}"; - - var _formatted_stacktrace = array_to_string_list(_exception.stacktrace); - var _line_break = LB_92; - var _full_message = ""; - var _report_title = $"[{global.game_version}] {_exception.stacktrace[0]}\n"; +/// @description Shows a popup for errors triggered by an unexpected condition(s). +/// @param {string} _message - The message to display to the user. +/// @param {string} _header - Optional header for the popup (default: "Assertion Error"). +function assert_error_popup(_message, _header="Assertion Error") { + var _stacktrace_array = debug_get_callstack(); - _full_message = $"{_line_break}\n"; - _full_message += non_critical ? $"Caught an Exception!" : $"Unhandled Exception!"; - _full_message += error_marker == "" ? $"\n\n" : $" ({error_marker})\n\n"; - _full_message += $"Date-Time: {DATE_TIME_3}\n"; - _full_message += $"Game Version: {global.game_version}\n"; - _full_message += $"Build Date: {global.build_date};\n"; - _full_message += $"Commit Hash: {global.commit_hash};\n\n"; - _full_message += $"{_exception.longMessage}\n\n"; - _full_message += $"Stacktrace:\n"; - _full_message += $"{_formatted_stacktrace}\n"; - _full_message += $"{_line_break}"; + array_shift(_stacktrace_array); // throw away the first line, it's this function + array_pop(_stacktrace_array); // and the last line, it's the `0` debug_get_callstack returns for the top of the stack - log_into_file(_full_message); - show_debug_message(_full_message); - clipboard_set_text(_report_title + markdown_codeblock(_full_message)); - show_message(_player_message); + var _stacktrace = array_to_string_list(_stacktrace_array); + + handle_error(_header, _message, _stacktrace); } exception_unhandled_handler(function(_exception) { - handle_exception(_exception, STR_error_message_head2, undefined, false); + handle_exception(_exception, , true); return 0; }); /// @function markdown_codeblock -/// @description Puts codeblock symbols around a string. -/// @param {string} _message -/// @return {string} -function markdown_codeblock(_message) { - if (string_length(_message) > 0) { - var _formatted_message = "```\n" +_message + "\n```"; - return _formatted_message; +/// @description Formats text as a code block. +/// @param {string} _message The message to format. +/// @param {string} _language (Optional) Code language prefix to add into the codeblock. +/// @returns {string} The formatted message. +function markdown_codeblock(_message, _language = "") { + return string_length(_message) > 0 ? $"```{_language}\n{_message}\n```" : ""; +} + +/// @function format_time +/// @description Converts to string and adds a 0 at the start, if input is less than 10. +/// @param {real} _time - Usually hours, minutes or seconds. +/// @returns {string} +function format_time(_time) { + if (_time < 10) { + _time = $"0{_time}" } - return; -} \ No newline at end of file + return string(_time); +} diff --git a/scripts/scr_manage_task_selector/scr_manage_task_selector.gml b/scripts/scr_manage_task_selector/scr_manage_task_selector.gml index 3774cd66e..a1aeb2b48 100644 --- a/scripts/scr_manage_task_selector/scr_manage_task_selector.gml +++ b/scripts/scr_manage_task_selector/scr_manage_task_selector.gml @@ -23,7 +23,7 @@ function scr_manage_task_selector(){ if (man_sel[i]){ switch(selection_data.purpose_code){ case "forge_assignment": - var forge = selection_data.feature.feature; + var forge = selection_data.feature; forge.techs_working = 0; forge.techs_working++; unit = display_unit[i]; @@ -36,7 +36,7 @@ function scr_manage_task_selector(){ break; case "captain_promote": unit = display_unit[i]; - unit.update_role(obj_ini.role[100][Role.CAPTAIN]); + unit.update_role(obj_ini.role[100][eROLE.Captain]); unit.squad="none"; var start_company = unit.company; var end_company = selection_data.system; @@ -58,7 +58,7 @@ function scr_manage_task_selector(){ break; case "champion_promote": unit = display_unit[i]; - unit.update_role(obj_ini.role[100][Role.CHAMPION]); + unit.update_role(obj_ini.role[100][eROLE.Champion]); unit.squad="none"; with (obj_ini){ @@ -71,7 +71,7 @@ function scr_manage_task_selector(){ break; case "ancient_promote": unit = display_unit[i]; - unit.update_role(obj_ini.role[100][Role.ANCIENT]); + unit.update_role(obj_ini.role[100][eROLE.Ancient]); unit.squad="none"; @@ -97,7 +97,7 @@ function scr_manage_task_selector(){ } else { switch(selection_data.purpose_code){ case "forge_assignment": - var forge = selection_data.feature.feature; + var forge = selection_data.feature; forge.techs_working = false; unit = display_unit[i]; var job = unit.job; @@ -113,7 +113,7 @@ function scr_manage_task_selector(){ } switch(selection_data.purpose_code){ case "forge_assignment": - calculate_research_points(); + specialist_point_handler.calculate_research_points(); break; case "hunt_beast": var problem_slot = selection_data.array_slot; diff --git a/scripts/scr_management/scr_management.gml b/scripts/scr_management/scr_management.gml index 9e720849d..0337d87b5 100644 --- a/scripts/scr_management/scr_management.gml +++ b/scripts/scr_management/scr_management.gml @@ -95,7 +95,7 @@ function scr_management(argument0) { num[i] = 0; nam[i] = ""; } - nam[2]=role_names[Role.HONOUR_GUARD]; + nam[2]=role_names[eROLE.HonourGuard]; for (var i = 0; i < array_length(obj_ini.name[0]); i++) { unit = fetch_unit([0,i]); @@ -103,14 +103,14 @@ function scr_management(argument0) { num[1] += 1; if (nam[1] == "") then nam[1] = unit.name(); } - if (unit.role() == role_names[Role.HONOUR_GUARD]) then num[2] += 1; + if (unit.role() == role_names[eROLE.HonourGuard]) then num[2] += 1; } // if (num[2]=0) then nam[2]="Strategic Staff";// reserved for co-master alien or something // if (num[2]>0) { - // nam[2]=string(num)+"x "+string(role_names[Role.HONOUR_GUARD]); + // nam[2]=string(num)+"x "+string(role_names[eROLE.HonourGuard]); // nam[3]="Strategic Staff"; // num[3]=1; // } @@ -131,8 +131,8 @@ function scr_management(argument0) { obj_managment_panel.italic[1]=1; obj_managment_panel.bold[q]=1; instance_activate_object(obj_managment_panel); - // ll=0;ll2=0;repeat(200){ll2++;if (obj_ini.role[company,ll2]=role_names[Role.HONOUR_GUARD]) then ll++;} - // if (ll>0) then temp[3]=string(ll)+"x "+string(role_names[Role.HONOUR_GUARD]); + // ll=0;ll2=0;repeat(200){ll2++;if (obj_ini.role[company,ll2]=role_names[eROLE.HonourGuard]) then ll++;} + // if (ll>0) then temp[3]=string(ll)+"x "+string(role_names[eROLE.HonourGuard]); @@ -144,10 +144,10 @@ function scr_management(argument0) { num[i] = 0; nam[i] = ""; } - nam[2]=role_names[Role.APOTHECARY]; + nam[2]=role_names[eROLE.Apothecary]; // Ranks - nam[3]=string(role_names[Role.APOTHECARY])+" Aspirant";// nam[4]="Sister Hospitaler"; + nam[3]=string(role_names[eROLE.Apothecary])+" Aspirant";// nam[4]="Sister Hospitaler"; for (var i = 1; i <= 200; i++) { unit = fetch_unit([0,i]); @@ -156,9 +156,9 @@ function scr_management(argument0) { if (nam[1] == "") then nam[1] = unit.name(); } - if (unit.role() == role_names[Role.APOTHECARY]) then num[2] += 1; + if (unit.role() == role_names[eROLE.Apothecary]) then num[2] += 1; - if (unit.role() == string(role_names[Role.APOTHECARY]) + " Aspirant") then num[3] += 1; + if (unit.role() == string(role_names[eROLE.Apothecary]) + " Aspirant") then num[3] += 1; // if (unit.role() == "Sister Hospitaler") then num[4] += 1; } @@ -189,10 +189,10 @@ function scr_management(argument0) { nam[i] = ""; } - nam[2]=role_names[Role.CHAPLAIN]; + nam[2]=role_names[eROLE.Chaplain]; // Ranks - nam[3]=string(role_names[Role.CHAPLAIN])+" Aspirant"; + nam[3]=string(role_names[eROLE.Chaplain])+" Aspirant"; for (var i = 1; i <= 200; i++) { unit = fetch_unit([0,i]); @@ -201,9 +201,9 @@ function scr_management(argument0) { if (nam[1] == "") then nam[1] = unit.name(); } - if (unit.role() == role_names[Role.CHAPLAIN]) then num[2] += 1; + if (unit.role() == role_names[eROLE.Chaplain]) then num[2] += 1; - if (unit.role() == string(role_names[Role.CHAPLAIN]) + " Aspirant") then num[3] += 1; + if (unit.role() == string(role_names[eROLE.Chaplain]) + " Aspirant") then num[3] += 1; } with(obj_managment_panel){if (manage!=obj_controller.temp[71]) then instance_deactivate_object(id);} @@ -242,10 +242,10 @@ function scr_management(argument0) { nam[i] = ""; } - nam[2]=role_names[Role.TECHMARINE]; + nam[2]=role_names[eROLE.Techmarine]; // Ranks - nam[3]=string(role_names[Role.TECHMARINE])+" Aspirant"; + nam[3]=string(role_names[eROLE.Techmarine])+" Aspirant"; nam[4]="Techpriest"; for (var i = 1; i <= 200; i++) { @@ -255,9 +255,9 @@ function scr_management(argument0) { if (nam[1] == "") then nam[1] = unit.name(); } - if (unit.role() == role_names[Role.TECHMARINE]) then num[2] += 1; + if (unit.role() == role_names[eROLE.Techmarine]) then num[2] += 1; - if (unit.role() == string(role_names[Role.TECHMARINE]) + " Aspirant") then num[3] += 1; + if (unit.role() == string(role_names[eROLE.Techmarine]) + " Aspirant") then num[3] += 1; if (unit.role() == "Techpriest") then num[4] += 1; } @@ -296,27 +296,27 @@ function scr_management(argument0) { nam[i] = ""; } - nam[2]=role_names[Role.LIBRARIAN]; + nam[2]=role_names[eROLE.Librarian]; // Ranks nam[3]="Codiciery"; nam[4]="Lexicanum"; - nam[5]=string(role_names[Role.LIBRARIAN])+" Aspirant"; + nam[5]=string(role_names[eROLE.Librarian])+" Aspirant"; for (var i = 1; i <= 200; i++) { unit = fetch_unit([0,i]); - if (unit.role() == "Chief " + string(role_names[Role.LIBRARIAN])) { + if (unit.role() == "Chief " + string(role_names[eROLE.Librarian])) { num[1] += 1; if (nam[1] == "") then nam[1] = unit.name(); } - if (unit.role() == role_names[Role.LIBRARIAN]) then num[2] += 1; + if (unit.role() == role_names[eROLE.Librarian]) then num[2] += 1; if (unit.role() == "Codiciery") then num[3] += 1; if (unit.role() == "Lexicanum") then num[4] += 1; - if (unit.role() == string(role_names[Role.APOTHECARY]) + " Aspirant") then num[5] += 1; + if (unit.role() == string(role_names[eROLE.Apothecary]) + " Aspirant") then num[5] += 1; } with(obj_managment_panel){if (manage!=obj_controller.temp[71]) then instance_deactivate_object(id);} @@ -358,25 +358,25 @@ function scr_management(argument0) { nam[i] = ""; } // Indexing the names to nam array - // nam[1] = role_names[Role.CAPTAIN]; - nam[2] = role_names[Role.CHAPLAIN]; - nam[3] = role_names[Role.APOTHECARY]; - nam[4] = role_names[Role.TECHMARINE]; - nam[5] = role_names[Role.LIBRARIAN]; + // nam[1] = role_names[eROLE.Captain]; + nam[2] = role_names[eROLE.Chaplain]; + nam[3] = role_names[eROLE.Apothecary]; + nam[4] = role_names[eROLE.Techmarine]; + nam[5] = role_names[eROLE.Librarian]; nam[6] = "Codiciery"; nam[7] = "Lexicanum"; - nam[8] = "Company" + role_names[Role.ANCIENT]; - nam[9] = (role_names[Role.CHAMPION] == "Champion") ? "Champion" : role_names[Role.CHAMPION]; - nam[10] = role_names[Role.TERMINATOR]; - nam[11] = role_names[Role.SERGEANT]; - nam[12] = (role_names[Role.VETERAN_SERGEANT] == "Veteran Sergeant") ? "Sergeant" : role_names[Role.VETERAN_SERGEANT]; - nam[13] = role_names[Role.VETERAN]; - nam[14] = role_names[Role.TACTICAL]; - nam[15] = role_names[Role.ASSAULT]; - nam[16] = role_names[Role.DEVASTATOR]; - nam[17] = role_names[Role.SCOUT]; - nam[18] = role_names[Role.DREADNOUGHT]; // Venerable Dreadnought, just the role name is too long for the company box - nam[19] = role_names[Role.DREADNOUGHT]; + nam[8] = "Company" + role_names[eROLE.Ancient]; + nam[9] = (role_names[eROLE.Champion] == "Champion") ? "Champion" : role_names[eROLE.Champion]; + nam[10] = role_names[eROLE.Terminator]; + nam[11] = role_names[eROLE.Sergeant]; + nam[12] = (role_names[eROLE.VeteranSergeant] == "Veteran Sergeant") ? "Sergeant" : role_names[eROLE.VeteranSergeant]; + nam[13] = role_names[eROLE.Veteran]; + nam[14] = role_names[eROLE.Tactical]; + nam[15] = role_names[eROLE.Assault]; + nam[16] = role_names[eROLE.Devastator]; + nam[17] = role_names[eROLE.Scout]; + nam[18] = role_names[eROLE.Dreadnought]; // Venerable Dreadnought, just the role name is too long for the company box + nam[19] = role_names[eROLE.Dreadnought]; nam[20] = "Land Raider"; nam[21] = "Predator"; nam[22] = "Rhino"; @@ -385,29 +385,29 @@ function scr_management(argument0) { for (var i=0;i