diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..804d003 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,124 @@ +name: Build + +on: + push: + branches: + - '*' + tags: + - '*' + +env: + PROJECT_NAME: MonkeyZeppelin + MOD_HELPER_BRANCH: master + MELONLOADER_BRANCH: alpha-development + + MOD_HELPER_NAME: Btd6ModHelper + BLOONSTD6: ./BloonsTD6 + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Clone Repo + uses: actions/checkout@master + with: + path: ${{ env.PROJECT_NAME }} + + + - name: Download Latest MelonLoader + if: env.MELONLOADER_BRANCH == '' + uses: robinraju/release-downloader@v1.4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: LavaGang/MelonLoader + fileName: MelonLoader.x64.zip + tarBall: false + zipBall: false + latest: true + - name: Extract Latest MelonLoader + if: env.MELONLOADER_BRANCH == '' + shell: bash + run: unzip MelonLoader.x64.zip -d ${{ env.BLOONSTD6 }} + + + - name: Download Specific MelonLoader + if: env.MELONLOADER_BRANCH != '' + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + workflow: build.yml + branch: ${{ env.MELONLOADER_BRANCH }} + name: MelonLoader.x64.CI.Release + repo: LavaGang/MelonLoader + path: ${{ env.BLOONSTD6 }} + + + - name: Clone Dependencies Repo + uses: actions/checkout@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: doombubbles/btd6-ci-dependencies + ref: main + path: ${{ env.BLOONSTD6 }}/MelonLoader/Managed + + + - name: Download Latest Mod Helper + uses: robinraju/release-downloader@v1.4 + if: env.MOD_HELPER_BRANCH == 'master' + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: gurrenm3/BTD-Mod-Helper + fileName: ${{ env.MOD_HELPER_NAME }}.dll + out-file-path: ${{ env.BLOONSTD6 }}/Mods/ + tarBall: false + zipBall: false + latest: true + + + - name: Download Specific Mod Helper + uses: dawidd6/action-download-artifact@v2 + if: env.MOD_HELPER_BRANCH != 'master' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + workflow: build.yml + name: ${{ env.MOD_HELPER_NAME }}.dll + branch: ${{ env.MOD_HELPER_BRANCH }} + repo: gurrenm3/BTD-Mod-Helper + path: ${{ env.BLOONSTD6 }}/Mods/ + + + - name: Download btd6.targets + shell: bash + run: | + if [ "$RUNNER_OS" == "Windows" ]; then + choco install -y wget + fi + wget https://raw.githubusercontent.com/gurrenm3/BTD-Mod-Helper/${{ env.MOD_HELPER_BRANCH }}/BloonsTD6%20Mod%20Helper/btd6.targets + + + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x # net6 can still build older as well + + + - name: Build + run: dotnet build -c Release -p:BloonsTD6="../${{ env.BLOONSTD6 }}" "${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj" + + + - name: Upload Mod DLL + uses: actions/upload-artifact@v2.2.4 + with: + name: ${{ env.PROJECT_NAME }}.dll + path: ${{ env.BLOONSTD6 }}/Mods/${{ env.PROJECT_NAME }}.dll + + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ${{ env.BLOONSTD6 }}/Mods/${{ env.PROJECT_NAME }}.dll + body_path: ${{ env.PROJECT_NAME }}/LATEST.md + fail_on_unmatched_files: true \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37876ad --- /dev/null +++ b/.gitignore @@ -0,0 +1,340 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb diff --git a/Displays/AirshipDisplays.cs b/Displays/AirshipDisplays.cs new file mode 100644 index 0000000..643f29e --- /dev/null +++ b/Displays/AirshipDisplays.cs @@ -0,0 +1,447 @@ +using Assets.Scripts.Unity.Display; +using BTD_Mod_Helper.Api.Display; +using BTD_Mod_Helper.Extensions; +using System.Linq; +using UnityEngine; + + +namespace MonkeyAirship.Displays +{ + public class MonkeyAirshipBaseDisplay : ModDisplay + { + public override string BaseDisplay => "eff76d2b677b4b6499ee03b459d9b3fa"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display100 : ModDisplay + { + public override string BaseDisplay => "eff76d2b677b4b6499ee03b459d9b3fa"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display200 : ModDisplay + { + public override string BaseDisplay => "eff76d2b677b4b6499ee03b459d9b3fa"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display001 : ModDisplay + { + public override string BaseDisplay => "eff76d2b677b4b6499ee03b459d9b3fa"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display002 : ModDisplay + { + public override string BaseDisplay => "eff76d2b677b4b6499ee03b459d9b3fa"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display020 : ModDisplay + { + public override string BaseDisplay => "eff76d2b677b4b6499ee03b459d9b3fa"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshTexture(node, Name, 1); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display010 : ModDisplay + { + public override string BaseDisplay => "eff76d2b677b4b6499ee03b459d9b3fa"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshTexture(node, Name, 1); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display300 : ModDisplay + { + public override string BaseDisplay => "6ae6151188a6cdf488d13bcb9a972c47"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + foreach (var transform in node.gameObject.GetComponentsInChildren()) + { + transform.localScale *= .94f; + + } + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 3); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211, 0), 2); + SetMeshTexture(node, Name, 3); + SetMeshTexture(node, Name, 2); + SetMeshTexture(node, Name, 1); + node.GetBone("RightTurbine").transform.localPosition = new Vector3(22f, 0, -22f); + + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display400 : ModDisplay + { + public override string BaseDisplay => "6ae6151188a6cdf488d13bcb9a972c47"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 3); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211, 0), 2); + SetMeshTexture(node, Name, 3); + SetMeshTexture(node, Name, 2); + SetMeshTexture(node, Name, 1); + node.GetBone("RightTurbine").transform.localPosition = new Vector3(22f, 0, -22f); + + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display500 : ModDisplay + { + public override string BaseDisplay => "f47778bfd841f614ca165ce4c190a661"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 3); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211, 0), 2); + SetMeshTexture(node, Name, 3); + SetMeshTexture(node, Name, 2); + SetMeshTexture(node, Name, 1); + + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display030 : ModDisplay + { + public override string BaseDisplay => "a71703da4f9dd894e83e204d8cc74c50"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211, 0), 2); + SetMeshTexture(node, Name, 2); + SetMeshTexture(node, Name, 1); + + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display040 : ModDisplay + { + public override string BaseDisplay => "a71703da4f9dd894e83e204d8cc74c50"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211, 0), 2); + SetMeshTexture(node, Name, 2); + SetMeshTexture(node, Name, 1); + + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display050 : ModDisplay + { + public override string BaseDisplay => "a71703da4f9dd894e83e204d8cc74c50"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + foreach (var transform in node.gameObject.GetComponentsInChildren()) + { + transform.localScale *= 1.25f; + + } + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211, 0), 2); + SetMeshTexture(node, Name, 2); + SetMeshTexture(node, Name, 1); + node.GetBone("FinRight").transform.localPosition = new Vector3(24f, 0, -17.5f); + node.GetBone("Propeller").transform.localPosition = new Vector3(0, 0, -52f); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display003 : ModDisplay + { + public override string BaseDisplay => "eff76d2b677b4b6499ee03b459d9b3fa"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display004 : ModDisplay + { + public override string BaseDisplay => "6ae6151188a6cdf488d13bcb9a972c47"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211, 0), 2); + SetMeshTexture(node, Name, 2); + SetMeshTexture(node, Name, 1); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class Display005 : ModDisplay + { + public override string BaseDisplay => "f47778bfd841f614ca165ce4c190a661"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211, 0), 2); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211, 0), 3); + SetMeshTexture(node, Name, 2); + SetMeshTexture(node, Name, 1); + SetMeshTexture(node, Name, 3); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class ParagonDisplay : ModDisplay + { + public override string BaseDisplay => "8fd8a703a31154a49b25ba34235ab76c"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 0); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211, 0), 2); + SetMeshTexture(node, Name, 2); + SetMeshTexture(node, Name, 1); + SetMeshTexture(node, Name, 0); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class BaseTowerModel : ModTowerDisplay + { + public override string BaseDisplay => "f0c7075edbd50f748a8c903c4065b9fc"; + public override bool UseForTower(int[] tiers) + { + return tiers.Sum() <= 5; + } + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + /* foreach (var transform in node.gameObject.GetComponentsInChildren()) + { + transform.localScale *= 1.25f; + + }*/ + SetMeshTexture(node, Name); + + + } + } +} diff --git a/Displays/BaseTowerModel.png b/Displays/BaseTowerModel.png new file mode 100644 index 0000000..d308c66 Binary files /dev/null and b/Displays/BaseTowerModel.png differ diff --git a/Displays/Display001.png b/Displays/Display001.png new file mode 100644 index 0000000..921f117 Binary files /dev/null and b/Displays/Display001.png differ diff --git a/Displays/Display002.png b/Displays/Display002.png new file mode 100644 index 0000000..3a0ebb3 Binary files /dev/null and b/Displays/Display002.png differ diff --git a/Displays/Display003.png b/Displays/Display003.png new file mode 100644 index 0000000..2f102b9 Binary files /dev/null and b/Displays/Display003.png differ diff --git a/Displays/Display004.png b/Displays/Display004.png new file mode 100644 index 0000000..e294355 Binary files /dev/null and b/Displays/Display004.png differ diff --git a/Displays/Display005.png b/Displays/Display005.png new file mode 100644 index 0000000..2138b2e Binary files /dev/null and b/Displays/Display005.png differ diff --git a/Displays/Display010.png b/Displays/Display010.png new file mode 100644 index 0000000..d0710de Binary files /dev/null and b/Displays/Display010.png differ diff --git a/Displays/Display020.png b/Displays/Display020.png new file mode 100644 index 0000000..1e1081a Binary files /dev/null and b/Displays/Display020.png differ diff --git a/Displays/Display030.png b/Displays/Display030.png new file mode 100644 index 0000000..63b2de7 Binary files /dev/null and b/Displays/Display030.png differ diff --git a/Displays/Display040.png b/Displays/Display040.png new file mode 100644 index 0000000..a964227 Binary files /dev/null and b/Displays/Display040.png differ diff --git a/Displays/Display050.png b/Displays/Display050.png new file mode 100644 index 0000000..78bb2ee Binary files /dev/null and b/Displays/Display050.png differ diff --git a/Displays/Display100.png b/Displays/Display100.png new file mode 100644 index 0000000..53d26fc Binary files /dev/null and b/Displays/Display100.png differ diff --git a/Displays/Display200.png b/Displays/Display200.png new file mode 100644 index 0000000..0f4b0d4 Binary files /dev/null and b/Displays/Display200.png differ diff --git a/Displays/Display300.png b/Displays/Display300.png new file mode 100644 index 0000000..b3e7bc5 Binary files /dev/null and b/Displays/Display300.png differ diff --git a/Displays/Display400.png b/Displays/Display400.png new file mode 100644 index 0000000..bbc420b Binary files /dev/null and b/Displays/Display400.png differ diff --git a/Displays/Display500.png b/Displays/Display500.png new file mode 100644 index 0000000..430ed36 Binary files /dev/null and b/Displays/Display500.png differ diff --git a/Displays/MonkeyAirshipBaseDisplay.png b/Displays/MonkeyAirshipBaseDisplay.png new file mode 100644 index 0000000..3a67839 Binary files /dev/null and b/Displays/MonkeyAirshipBaseDisplay.png differ diff --git a/Displays/MonkeyAirshipParagonDisplay.cs b/Displays/MonkeyAirshipParagonDisplay.cs new file mode 100644 index 0000000..92d6839 --- /dev/null +++ b/Displays/MonkeyAirshipParagonDisplay.cs @@ -0,0 +1,66 @@ +using System.Collections.Generic; +using Assets.Scripts.Models.GenericBehaviors; +using Assets.Scripts.Models.Towers; +using Assets.Scripts.Unity; +using Assets.Scripts.Unity.Display; +using BTD_Mod_Helper.Api; +using BTD_Mod_Helper.Api.Display; +using BTD_Mod_Helper.Extensions; +using UnityEngine; + +namespace MonkeyAirship.Displays +{ + public class MonkeyAirshipParagonDisplay : ModTowerDisplay + { + /// + /// All classes that derive from ModContent MUST have a zero argument constructor to work + /// + public MonkeyAirshipParagonDisplay() + { + } + + public MonkeyAirshipParagonDisplay(int i) + { + ParagonDisplayIndex = i; + } + + public override float Scale => .75f + ParagonDisplayIndex * .025f; + + public override string BaseDisplay => "f0c7075edbd50f748a8c903c4065b9fc"; + + public override int ParagonDisplayIndex { get; } + + public override string Name => nameof(MonkeyAirshipParagonDisplay) + ParagonDisplayIndex; + + public override bool UseForTower(int[] tiers) => IsParagon(tiers); + + + /// + /// Create a display for each possible ParagonDisplayIndex + /// + /// + public override IEnumerable Load() + { + for (var i = 0; i < TotalParagonDisplays; i++) + { + yield return new MonkeyAirshipParagonDisplay(i); + } + } + + /// + /// Could use the ParagonDisplayIndex property to use different effects based on the paragon strength + /// + /// + /// + public override void ModifyDisplayNode(UnityDisplayNode node) + { +#if DEBUG + node.PrintInfo(); + node.SaveMeshTexture(); +#endif + + SetMeshTexture(node, nameof(BaseTowerModel)); + SetMeshOutlineColor(node, new Color(48f / 255f, 0, 121 / 255f)); + } + } +} \ No newline at end of file diff --git a/Displays/ParagonDisplay.png b/Displays/ParagonDisplay.png new file mode 100644 index 0000000..3580a93 Binary files /dev/null and b/Displays/ParagonDisplay.png differ diff --git a/Displays/Planes/MoabPlaneDisplay.png b/Displays/Planes/MoabPlaneDisplay.png new file mode 100644 index 0000000..ab3333c Binary files /dev/null and b/Displays/Planes/MoabPlaneDisplay.png differ diff --git a/Displays/Planes/ParagonPlaneDisplay.png b/Displays/Planes/ParagonPlaneDisplay.png new file mode 100644 index 0000000..6f373fa Binary files /dev/null and b/Displays/Planes/ParagonPlaneDisplay.png differ diff --git a/Displays/Planes/PlaneDisplay.cs b/Displays/Planes/PlaneDisplay.cs new file mode 100644 index 0000000..af68d10 --- /dev/null +++ b/Displays/Planes/PlaneDisplay.cs @@ -0,0 +1,81 @@ +using Assets.Scripts.Unity.Display; +using BTD_Mod_Helper.Api.Display; +using BTD_Mod_Helper.Extensions; +using UnityEngine; +using Assets.Scripts.Models.GenericBehaviors; + +namespace MonkeyAirship.Displays.Planes +{ + public class MoabRavagerPlaneBaseDisplay : ModDisplay + { + public override string BaseDisplay => "c72030d638703fd4789f3cf854b9e925"; + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + foreach (var transform in node.gameObject.GetComponentsInChildren()) + { + transform.localScale *= .7f; + + } + node.GetBone("SmokeTrails").transform.localScale = new Vector3(.5f, .6f, .6f); + node.GetBone("SmokeTrails").transform.localPosition = new Vector3(-2.5f, 1, -15); + + + } + } +} +namespace MonkeyAirship.Displays.Planes +{ + public class MoabPlaneDisplay : ModDisplay + { + public override string BaseDisplay => "bafddc9e96223c849b29709ce057e33f"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + + SetMeshTexture(node, Name,0); + + } + } +} +namespace MonkeyAirship.Displays +{ + public class ParagonPlaneDisplay : ModDisplay + { + public override string BaseDisplay => "a71703da4f9dd894e83e204d8cc74c50"; + public override Assets.Scripts.Simulation.SMath.Vector3 PositionOffset => new(0, 100, 0); + public override void ModifyDisplayNode(UnityDisplayNode node) + { +# if DEBUG + node.SaveMeshTexture(); + node.PrintInfo(); + +#endif + foreach (var transform in node.gameObject.GetComponentsInChildren()) + { + transform.localScale *= .7f; + + } + + SetMeshTexture(node, Name); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211)); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211), 1); + SetMeshOutlineColor(node, new UnityEngine.Color(211, 211, 211, 0), 2); + SetMeshTexture(node, Name, 2); + SetMeshTexture(node, Name, 1); + node.GetBone("FinRight").transform.localPosition = new Vector3(12f, 0, -8.5f); + node.GetBone("Propeller").transform.localPosition = new Vector3(0, 0, -30.5f); + + } + } +} \ No newline at end of file diff --git a/Displays/Projectiles/ApacheLaserPulse.png b/Displays/Projectiles/ApacheLaserPulse.png new file mode 100644 index 0000000..fac3868 Binary files /dev/null and b/Displays/Projectiles/ApacheLaserPulse.png differ diff --git a/Displays/Projectiles/ArmourPiercingDisplay.png b/Displays/Projectiles/ArmourPiercingDisplay.png new file mode 100644 index 0000000..202c8f0 Binary files /dev/null and b/Displays/Projectiles/ArmourPiercingDisplay.png differ diff --git a/Displays/Projectiles/BlueApacheLaserPulse.png b/Displays/Projectiles/BlueApacheLaserPulse.png new file mode 100644 index 0000000..f912f66 Binary files /dev/null and b/Displays/Projectiles/BlueApacheLaserPulse.png differ diff --git a/Displays/Projectiles/BlueLaserDisplay.png b/Displays/Projectiles/BlueLaserDisplay.png new file mode 100644 index 0000000..99d1eb7 Binary files /dev/null and b/Displays/Projectiles/BlueLaserDisplay.png differ diff --git a/Displays/Projectiles/DartBlueDisplay.png b/Displays/Projectiles/DartBlueDisplay.png new file mode 100644 index 0000000..81234a5 Binary files /dev/null and b/Displays/Projectiles/DartBlueDisplay.png differ diff --git a/Displays/Projectiles/DartPurpleDisplay.png b/Displays/Projectiles/DartPurpleDisplay.png new file mode 100644 index 0000000..32b7949 Binary files /dev/null and b/Displays/Projectiles/DartPurpleDisplay.png differ diff --git a/Displays/Projectiles/DevastatorRocketDisplay.png b/Displays/Projectiles/DevastatorRocketDisplay.png new file mode 100644 index 0000000..46986e6 Binary files /dev/null and b/Displays/Projectiles/DevastatorRocketDisplay.png differ diff --git a/Displays/Projectiles/GreenLaserDisplay.png b/Displays/Projectiles/GreenLaserDisplay.png new file mode 100644 index 0000000..e106216 Binary files /dev/null and b/Displays/Projectiles/GreenLaserDisplay.png differ diff --git a/Displays/Projectiles/PinkLaserDisplay.png b/Displays/Projectiles/PinkLaserDisplay.png new file mode 100644 index 0000000..3728773 Binary files /dev/null and b/Displays/Projectiles/PinkLaserDisplay.png differ diff --git a/Displays/Projectiles/PlasmaBulletDisplay.png b/Displays/Projectiles/PlasmaBulletDisplay.png new file mode 100644 index 0000000..17c61a9 Binary files /dev/null and b/Displays/Projectiles/PlasmaBulletDisplay.png differ diff --git a/Displays/Projectiles/ProjectileDisplays.cs b/Displays/Projectiles/ProjectileDisplays.cs new file mode 100644 index 0000000..e8dec1e --- /dev/null +++ b/Displays/Projectiles/ProjectileDisplays.cs @@ -0,0 +1,127 @@ +using Assets.Scripts.Unity.Display; +using BTD_Mod_Helper.Api.Display; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Simulation.SMath; +using UnityEngine; +using Assets.Scripts.Models.GenericBehaviors; + +namespace MonkeyAirship.Displays +{ + public class GreenLaserDisplay : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } +} +namespace MonkeyAirship.Displays +{ + public class PinkLaserDisplay : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } +} +namespace MonkeyAirship.Displays +{ + public class TracerDisplay : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } +} +namespace MonkeyAirship.Displays +{ + public class RedTracerDisplay : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } +} +namespace MonkeyAirship.Displays +{ + public class ApacheLaserPulse : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } +} +namespace MonkeyAirship.Displays +{ + public class DartBlueDisplay : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } +} +namespace MonkeyAirship.Displays +{ + public class DartPurpleDisplay : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } +} +namespace MonkeyAirship.Displays +{ + public class DevastatorRocketDisplay : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } +} +namespace MonkeyAirship.Displays +{ + public class BlueLaserDisplay : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } +} +namespace MonkeyAirship.Displays +{ + public class BlueApacheLaserPulse : ModDisplay + { + public override string BaseDisplay => Generic2dDisplay; + + public override void ModifyDisplayNode(UnityDisplayNode node) + { + Set2DTexture(node, Name); + } + } +} \ No newline at end of file diff --git a/Displays/Projectiles/RedTracerDisplay.png b/Displays/Projectiles/RedTracerDisplay.png new file mode 100644 index 0000000..767eaad Binary files /dev/null and b/Displays/Projectiles/RedTracerDisplay.png differ diff --git a/Displays/Projectiles/TracerDisplay.png b/Displays/Projectiles/TracerDisplay.png new file mode 100644 index 0000000..7e6ae15 Binary files /dev/null and b/Displays/Projectiles/TracerDisplay.png differ diff --git a/Displays/TopPath/MoabPlaneDisplay.png b/Displays/TopPath/MoabPlaneDisplay.png new file mode 100644 index 0000000..cb5df8e Binary files /dev/null and b/Displays/TopPath/MoabPlaneDisplay.png differ diff --git a/Icon.png b/Icon.png new file mode 100644 index 0000000..936c702 Binary files /dev/null and b/Icon.png differ diff --git a/LATEST.md b/LATEST.md new file mode 100644 index 0000000..8943116 --- /dev/null +++ b/LATEST.md @@ -0,0 +1 @@ +Base Release \ No newline at end of file diff --git a/Main.cs b/Main.cs new file mode 100644 index 0000000..7f56227 --- /dev/null +++ b/Main.cs @@ -0,0 +1,149 @@ +using MelonLoader; +using BTD_Mod_Helper; +using MonkeyAirship; +using Assets.Scripts.Models; +using Assets.Scripts.Models.Towers; +using Assets.Scripts.Models.Towers.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors.Emissions; +using Assets.Scripts.Models.Towers.Behaviors.Emissions.Behaviors; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using Assets.Scripts.Simulation.Towers; +using Assets.Scripts.Simulation.Towers.Behaviors; +using Assets.Scripts.Unity; +using Assets.Scripts.Unity.UI_New.InGame.TowerSelectionMenu; +using BTD_Mod_Helper.Extensions; +using HarmonyLib; +using System; + +using ModHelperData = MonkeyAirship.ModHelperData; +using Assets.Scripts.Models.Towers.Behaviors.Attack; + +[assembly: MelonInfo(typeof(MonkeyAirship.Main), ModHelperData.Name, ModHelperData.Version, ModHelperData.RepoOwner)] +[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")] + +namespace MonkeyAirship +{ + public class Main : BloonsTD6Mod + { + public override string GithubReleaseURL => ""; + + [HarmonyPatch(typeof(TowerManager), "UpgradeTower")] + internal class Tower_Initialise + { + [HarmonyPrefix] + internal static bool Prefix(int inputIndex, + Tower tower, + TowerModel def, + int pathIndex, + float upgradeCost, + float costMultiplier, + bool triggerOnUpgraded = true, + bool triggerOnUpgrade = true, + bool playUpgradeEffect = true, + bool isParagon = false, + bool leveledFromEndOfRoundXp = false) + { + if(def.name == "Eradicator") + { + if(tower.towerModel.tiers[0] == 5) + { + tower.SetTargetType(def.targetTypes[0]); + } + else if(tower.towerModel.tiers[2] == 5) + { + tower.towerModel = Game.instance.model.GetTowerFromId("MonkeySub-050"); + } + } + return true; + } + } + + public override void OnTowerUpgraded(Tower tower, string upgradeName, Assets.Scripts.Models.Towers.TowerModel newBaseTowerModel) + { + base.OnTowerUpgraded(tower, upgradeName, newBaseTowerModel); + + if (tower.towerModel.name == "Eradicator") + { + var degree = tower.GetTowerBehavior().GetCurrentDegree();; + foreach (var attackmodel in tower.towerModel.GetBehaviors()) + { + foreach (var weapon in attackmodel.weapons) + { + weapon.rate *= 1 - (degree) / 200; + weapon.projectile.pierce += degree * 2.5f; + weapon.projectile.GetDamageModel().damage += degree / 8; + weapon.projectile.AddBehavior(new DamageModifierForTagModel("Boss", "Boss", 1.25f, 5, false, true)); + } + attackmodel.weapons[9].projectile.GetDamageModel().damage += degree / 4; + } + tower.towerModel.GetBehaviors()[1].weapons[10].projectile.GetDamageModel().damage += degree * 2f; + + if (degree >= 20) + { + foreach (var attackmodel in tower.towerModel.GetBehaviors()) + { + foreach (var weapon in attackmodel.weapons) + { + weapon.projectile.GetDamageModel().damage += 5; + weapon.projectile.AddBehavior(new DamageModifierForTagModel("Boss", "Boss", 1.5f, 5, false, true)); + } + attackmodel.weapons[9].projectile.GetDamageModel().damage += 10; + } + tower.towerModel.GetBehaviors()[1].weapons[10].projectile.GetDamageModel().damage += 20; + } + + if (degree >= 40) + { + foreach (var attackmodel in tower.towerModel.GetBehaviors()) + { + foreach (var weapon in attackmodel.weapons) + { + weapon.projectile.GetDamageModel().damage += 5; + weapon.projectile.AddBehavior(new DamageModifierForTagModel("Boss", "Boss", 1.75f, 10, false, true)); + } + attackmodel.weapons[9].projectile.GetDamageModel().damage += 10; + } + tower.towerModel.GetBehaviors()[1].weapons[10].projectile.GetDamageModel().damage += 20; + } + + if (degree >= 60) + { + foreach (var attackmodel in tower.towerModel.GetBehaviors()) + { + foreach (var weapon in attackmodel.weapons) + { + weapon.projectile.GetDamageModel().damage += 5; + weapon.projectile.AddBehavior(new DamageModifierForTagModel("Boss", "Boss", 2f, 15, false, true)); + } + attackmodel.weapons[9].projectile.GetDamageModel().damage += 10; + } + tower.towerModel.GetBehaviors()[1].weapons[10].projectile.GetDamageModel().damage += 20; + } + + if (degree >= 80) + { + foreach (var attackmodel in tower.towerModel.GetBehaviors()) + { + foreach (var weapon in attackmodel.weapons) + { + weapon.projectile.GetDamageModel().damage += 5; + weapon.projectile.AddBehavior(new DamageModifierForTagModel("Boss", "Boss", 2.25f, 20, false, true)); + } + } + } + if (degree == 100) + { + foreach (var attackmodel in tower.towerModel.GetBehaviors()) + { + foreach (var weapon in attackmodel.weapons) + { + weapon.projectile.AddBehavior(new DamageModifierForTagModel("Boss", "Boss", 2.5f, 30, false, true)); + } + attackmodel.weapons[9].projectile.GetDamageModel().damage += 10; + } + tower.towerModel.GetBehaviors()[1].weapons[10].projectile.GetDamageModel().damage += 20; + } + } + } + } +} \ No newline at end of file diff --git a/ModHelperData.cs b/ModHelperData.cs new file mode 100644 index 0000000..1f592ff --- /dev/null +++ b/ModHelperData.cs @@ -0,0 +1,14 @@ +namespace MonkeyAirship +{ + public static class ModHelperData + { + public const string Version = "1.0.0"; + public const string Name = "MonkeyAirship"; + + public const string Description = "This mods adds the Monkey Airship, a powerful flying tower that obliterates bloons!"; + + public const string RepoOwner = "Chiss5618"; + public const string RepoName = "monkey-airship"; + public const string Icon = "MonkeyAirship-Icon.png"; + } +} \ No newline at end of file diff --git a/MonkeyAirship-Icon.png b/MonkeyAirship-Icon.png new file mode 100644 index 0000000..8a3579e Binary files /dev/null and b/MonkeyAirship-Icon.png differ diff --git a/MonkeyAirship-Portrait.png b/MonkeyAirship-Portrait.png new file mode 100644 index 0000000..0f0ae98 Binary files /dev/null and b/MonkeyAirship-Portrait.png differ diff --git a/MonkeyAirship.cs b/MonkeyAirship.cs new file mode 100644 index 0000000..7fb2d4d --- /dev/null +++ b/MonkeyAirship.cs @@ -0,0 +1,64 @@ +using System.Collections.Generic; +using System.Linq; +using Assets.Scripts.Models.Towers; +using Assets.Scripts.Models.TowerSets; +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Unity; +using BTD_Mod_Helper.Api; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Behaviors; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors.Emissions; +using Assets.Scripts.Simulation.Behaviors; +using Assets.Scripts.Models.GenericBehaviors; + +namespace MonkeyAirship +{ + public class MonkeyAirship : ModTower + { + public override string TowerSet => TowerSetType.Military; + public override string BaseTower => TowerType.MonkeyAce; + public override int Cost => 910; + public override int TopPathUpgrades => 5; + public override int MiddlePathUpgrades => 5; + public override int BottomPathUpgrades => 5; + public override string Description => "Slow-moving airship that pops bloons with its powerful machine gun"; + public override ParagonMode ParagonMode => ParagonMode.Base000; + public override void ModifyBaseTowerModel(TowerModel towerModel) + { + towerModel.footprint = Game.instance.model.GetTowerFromId("HeliPilot").footprint; + var tower = towerModel.GetBehavior(); + var attackairunitmodel = towerModel.GetBehaviors()[0]; + var weapons = attackairunitmodel.weapons[0]; + var projectile = weapons.projectile; + towerModel.range = 0; + tower.display = CreatePrefabReference(); + tower.behaviors[0].Cast().speed = 10; + tower.behaviors[0].Cast().rotation = 30f; + attackairunitmodel.fireWithoutTarget = false; + attackairunitmodel.range = 80; + weapons.emission = Game.instance.model.GetTowerFromId("MonkeyAce-004").GetBehaviors()[1].weapons[0].emission; //sets targeting to 004 ace + //weapons.ejectY = 10; + weapons.Rate = .4f; //fire speed + attackairunitmodel.AddBehavior(new EmissionWithOffsetsModel("offsetmodel", null, 1, false, null, 10)); + projectile.RemoveBehavior(); + projectile.GetDamageModel().damage = 1; + projectile.pierce = 2; + projectile.scale = .7f; + projectile.GetBehavior().speed = 400; + + + + } + + public override int GetTowerIndex(List towerSet) + { + return towerSet.First(model => model.towerId == TowerType.MonkeyAce).towerIndex + 1; + } + public override bool IsValidCrosspath(int[] tiers) => + HasMod("UltimateCrosspathing") ? true : base.IsValidCrosspath(tiers); + } +} diff --git a/MonkeyAirship.csproj b/MonkeyAirship.csproj new file mode 100644 index 0000000..7feddcd --- /dev/null +++ b/MonkeyAirship.csproj @@ -0,0 +1,36 @@ + + + net48 + MonkeyAirship + Debug;Release + enable + MonkeyAirship + latest + + + + False + embedded + + + + True + none + + + + + + + + + + + + + + + + + + diff --git a/MonkeyAirship.sln b/MonkeyAirship.sln new file mode 100644 index 0000000..542cf2d --- /dev/null +++ b/MonkeyAirship.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31424.327 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonkeyAirship", "MonkeyAirship.csproj", "{561A9956-B233-4A83-87E5-D886071BC206}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {561A9956-B233-4A83-87E5-D886071BC206}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {561A9956-B233-4A83-87E5-D886071BC206}.Debug|Any CPU.Build.0 = Debug|Any CPU + {561A9956-B233-4A83-87E5-D886071BC206}.Release|Any CPU.ActiveCfg = Release|Any CPU + {561A9956-B233-4A83-87E5-D886071BC206}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {ED8C0DB6-D308-4167-936E-835A3A5386AA} + EndGlobalSection +EndGlobal diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json new file mode 100644 index 0000000..7d5bb85 --- /dev/null +++ b/Properties/launchSettings.json @@ -0,0 +1,15 @@ +{ + "profiles": { + "BloonsTD6": { + "commandName": "Executable", + "executablePath": "$(BloonsTD6)/BloonsTD6.exe", + "workingDirectory": "$(BloonsTD6)" + }, + "BloonsTD6 (ML Debug)": { + "commandName": "Executable", + "executablePath": "$(BloonsTD6)/BloonsTD6.exe", + "workingDirectory": "$(BloonsTD6)", + "commandLineArgs": "--melonloader.debug" + } + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d5552f7 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ + + Icon + Download + + +

Card Monkey

+ +### This mods adds the Monkey Airship, a powerful flying tower that obliterates bloons! + +

+ Monkey Airship + Monkey Airship Paragon +

+ +This custom tower contains: + +* All 15 Upgrades and Crosspathing +* Custom Icons, Portraits, and Displays +* A Paragon +* Ultimate Crosspathing Compatibility (Some paths may be be slightly buggy/unbalanced) + +Known Bugs: +* Airship can clip underneath bloons - This seems to be hardcoded into the game and I have no easy way to circumvent this + +For suggestions and feedback (especially regarding balancing and bugs), contact Chiss#5306 on discord. Yes, I am aware the code is extremely messy. + +[![Requires BTD6 Mod Helper](https://raw.githubusercontent.com/gurrenm3/BTD-Mod-Helper/master/banner.png)](https://github.com/gurrenm3/BTD-Mod-Helper#readme) diff --git a/Upgrades/Bloonradicator-Icon.png b/Upgrades/Bloonradicator-Icon.png new file mode 100644 index 0000000..48bd37a Binary files /dev/null and b/Upgrades/Bloonradicator-Icon.png differ diff --git a/Upgrades/Bloonradicator-Portrait.png b/Upgrades/Bloonradicator-Portrait.png new file mode 100644 index 0000000..3b766a2 Binary files /dev/null and b/Upgrades/Bloonradicator-Portrait.png differ diff --git a/Upgrades/Bloonradicator.cs b/Upgrades/Bloonradicator.cs new file mode 100644 index 0000000..be3aa0b --- /dev/null +++ b/Upgrades/Bloonradicator.cs @@ -0,0 +1,296 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using System.Collections.Generic; +using System.Linq; +using Assets.Scripts.Models.TowerSets; +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Unity; +using BTD_Mod_Helper.Api; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Behaviors; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors.Emissions; +using Assets.Scripts.Simulation.Behaviors; +using Assets.Scripts.Models.GenericBehaviors; +using Assets.Scripts.Models.Towers.Behaviors.Abilities.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors.Attack.Behaviors; +using Assets.Scripts.Models.Towers.Filters; +using Assets.Scripts.Models.Towers.Weapons.Behaviors; +using MonkeyAirship.Displays.Planes; + +namespace MonkeyAirship.Upgrades +{ + public class Bloonradicator : ModParagonUpgrade + { + public override int Cost => 875000; + public override string Description => "That's no bloon..."; + public override string DisplayName => "Bloonradicator"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + var firstairunitmodel = towerModel.GetBehavior(); + var firstairweapon = firstairunitmodel.weapons[0]; + var firstprojectile = firstairweapon.projectile; + towerModel.GetBehavior().display = CreatePrefabReference(); + firstairunitmodel.GetDescendants().ForEach(model => model.isActive = false); + firstairunitmodel.range = 999999; + var airunitmodel = towerModel.GetBehavior(); + airunitmodel.behaviors[0].Cast().speed += 6; + airunitmodel.behaviors[0].Cast().rotation += 30; + + firstairweapon.rate = .3f; + firstprojectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + firstprojectile.display = CreatePrefabReference(); + firstprojectile.GetDamageModel().damage = 12; + firstprojectile.pierce = 50; + firstprojectile.AddBehavior(new DamageModifierForTagModel("boss", "Boss", 1, 20, false, true)); + firstairunitmodel.weapons[0].ejectX = -15; + + var strongairunitmodel = firstairunitmodel.Duplicate(); + strongairunitmodel.targetProvider = new TargetStrongAirUnitModel("targetstrong", false, false); + strongairunitmodel.AddBehavior(new TargetStrongAirUnitModel("targetstrong", false, false)); + var closeairunitmodel = firstairunitmodel.Duplicate(); + closeairunitmodel.targetProvider = new TargetCloseAirUnitModel("targetclose", false, false); + closeairunitmodel.AddBehavior(new TargetCloseAirUnitModel("targetclose", false, false)); + var lastairunitmodel = firstairunitmodel.Duplicate(); + lastairunitmodel.targetProvider = new TargetLastAirUnitModel("targetlast", false, false); + lastairunitmodel.AddBehavior(new TargetLastAirUnitModel("targetlast", false, false)); + var planelauncher = firstairunitmodel.Duplicate(); + planelauncher.fireWithoutTarget = true; + planelauncher.RemoveWeapon(planelauncher.weapons[0]); + + var balloflight = Game.instance.model.GetTowerFromId("BallOfLightTower").Duplicate(); + + balloflight.GetDescendant().dontUseTowerPosition = true; + + balloflight.GetAttackModel().weapons[0].AddBehavior(new FireFromAirUnitModel("fire")); + var balloflightweapon = balloflight.GetAttackModel().weapons[0]; + balloflight.GetDescendant().displayPath.assetPath = new Assets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" }; + balloflightweapon.projectile.GetDamageModel().damage = 24; + balloflightweapon.projectile.AddBehavior(new DamageModifierForTagModel("boss", "Boss", 1, 20, false, true)); + balloflightweapon.projectile.CapPierce(999999); + balloflightweapon.projectile.maxPierce = 999999; + balloflightweapon.projectile.GetDamageModel().maxDamage = 999999; + balloflightweapon.projectile.GetDamageModel().CapDamage(999999); + + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[0].Duplicate()); + firstairunitmodel.weapons[1].ejectX = -15; + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[0].Duplicate()); + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[1].Duplicate()); + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[0].Duplicate()); + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[1].Duplicate()); + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[0].Duplicate()); + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[1].Duplicate()); + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[0].Duplicate()); + firstairunitmodel.AddWeapon(balloflightweapon.Duplicate()); + + firstairunitmodel.weapons[0].ejectY = 5; + firstairunitmodel.weapons[1].ejectY = 5; + firstairunitmodel.weapons[2].ejectY = -5; + firstairunitmodel.weapons[3].ejectY = -5; + firstairunitmodel.weapons[4].ejectY = 17; + firstairunitmodel.weapons[5].ejectY = 17; + firstairunitmodel.weapons[6].ejectY = -17; + firstairunitmodel.weapons[7].ejectY = -17; + firstairunitmodel.weapons[8].ejectY = 29; + firstairunitmodel.weapons[8].ejectX = 0; + firstairunitmodel.weapons[9].ejectX = -10; + firstairunitmodel.weapons[9].ejectY = -25; + + strongairunitmodel.AddWeapon(strongairunitmodel.weapons[0].Duplicate()); + strongairunitmodel.weapons[1].ejectX = -15; + strongairunitmodel.AddWeapon(strongairunitmodel.weapons[0].Duplicate()); + strongairunitmodel.AddWeapon(strongairunitmodel.weapons[1].Duplicate()); + strongairunitmodel.AddWeapon(strongairunitmodel.weapons[0].Duplicate()); + strongairunitmodel.AddWeapon(strongairunitmodel.weapons[1].Duplicate()); + strongairunitmodel.AddWeapon(strongairunitmodel.weapons[0].Duplicate()); + strongairunitmodel.AddWeapon(strongairunitmodel.weapons[1].Duplicate()); + strongairunitmodel.AddWeapon(strongairunitmodel.weapons[0].Duplicate()); + strongairunitmodel.AddWeapon(balloflightweapon.Duplicate()); + strongairunitmodel.AddWeapon(balloflightweapon.Duplicate()); + + strongairunitmodel.weapons[0].ejectY = 8; + strongairunitmodel.weapons[1].ejectY = 8; + strongairunitmodel.weapons[2].ejectY = -8; + strongairunitmodel.weapons[3].ejectY = -8; + strongairunitmodel.weapons[4].ejectY = 20; + strongairunitmodel.weapons[5].ejectY = 20; + strongairunitmodel.weapons[6].ejectY = -20; + strongairunitmodel.weapons[7].ejectY = -20; + strongairunitmodel.weapons[8].ejectY = 30; + strongairunitmodel.weapons[8].ejectX = 0; + strongairunitmodel.weapons[9].ejectX = 10; + strongairunitmodel.weapons[9].ejectY = -25; + strongairunitmodel.weapons[10].ejectY = 0; + strongairunitmodel.weapons[10].ejectX = 0; + strongairunitmodel.weapons[10].projectile.GetDamageModel().damage = 120; + strongairunitmodel.weapons[10].projectile.AddBehavior(new DamageModifierForTagModel("boss", "Boss", 1, 100, false, true)); + strongairunitmodel.weapons[10].GetDescendant().displayPath.assetPath = new Assets.Scripts.Utils.PrefabReference() { guidRef = "b9f3014db2da83f48b34e662e9a79910" }; + strongairunitmodel.AddWeapon(strongairunitmodel.weapons[10]); + strongairunitmodel.weapons[11].GetDescendant().useTargetAsEndPoint = false; + + closeairunitmodel.AddWeapon(closeairunitmodel.weapons[0].Duplicate()); + closeairunitmodel.weapons[1].ejectX = -15; + closeairunitmodel.AddWeapon(closeairunitmodel.weapons[0].Duplicate()); + closeairunitmodel.AddWeapon(closeairunitmodel.weapons[1].Duplicate()); + closeairunitmodel.AddWeapon(closeairunitmodel.weapons[0].Duplicate()); + closeairunitmodel.AddWeapon(closeairunitmodel.weapons[1].Duplicate()); + closeairunitmodel.AddWeapon(closeairunitmodel.weapons[0].Duplicate()); + closeairunitmodel.AddWeapon(closeairunitmodel.weapons[1].Duplicate()); + closeairunitmodel.AddWeapon(closeairunitmodel.weapons[0].Duplicate()); + closeairunitmodel.AddWeapon(balloflightweapon.Duplicate()); + + closeairunitmodel.weapons[0].ejectY = 11; + closeairunitmodel.weapons[1].ejectY = 11; + closeairunitmodel.weapons[2].ejectY = -11; + closeairunitmodel.weapons[3].ejectY = -11; + closeairunitmodel.weapons[4].ejectY = 23; + closeairunitmodel.weapons[5].ejectY = 23; + closeairunitmodel.weapons[6].ejectY = -23; + closeairunitmodel.weapons[7].ejectY = -23; + closeairunitmodel.weapons[8].ejectY = -31; + closeairunitmodel.weapons[4].ejectX = 10; + closeairunitmodel.weapons[5].ejectX = -10; + closeairunitmodel.weapons[6].ejectX = 10; + closeairunitmodel.weapons[7].ejectX = -10; + closeairunitmodel.weapons[8].ejectX = 0; + closeairunitmodel.weapons[9].ejectX = -10; + closeairunitmodel.weapons[9].ejectY = 25; + + + lastairunitmodel.AddWeapon(lastairunitmodel.weapons[0].Duplicate()); + lastairunitmodel.weapons[1].ejectX = -15; + lastairunitmodel.AddWeapon(lastairunitmodel.weapons[0].Duplicate()); + lastairunitmodel.AddWeapon(lastairunitmodel.weapons[1].Duplicate()); + lastairunitmodel.AddWeapon(lastairunitmodel.weapons[0].Duplicate()); + lastairunitmodel.AddWeapon(lastairunitmodel.weapons[1].Duplicate()); + lastairunitmodel.AddWeapon(lastairunitmodel.weapons[0].Duplicate()); + lastairunitmodel.AddWeapon(lastairunitmodel.weapons[1].Duplicate()); + lastairunitmodel.AddWeapon(lastairunitmodel.weapons[0].Duplicate()); + lastairunitmodel.AddWeapon(balloflightweapon.Duplicate()); + + lastairunitmodel.weapons[0].ejectY = 14; + lastairunitmodel.weapons[1].ejectY = 14; + lastairunitmodel.weapons[2].ejectY = -14; + lastairunitmodel.weapons[3].ejectY = -14; + lastairunitmodel.weapons[4].ejectY = 26; + lastairunitmodel.weapons[5].ejectY = 26; + lastairunitmodel.weapons[6].ejectY = -26; + lastairunitmodel.weapons[7].ejectY = -26; + lastairunitmodel.weapons[8].ejectY = 32; + lastairunitmodel.weapons[4].ejectX = 10; + lastairunitmodel.weapons[5].ejectX = -10; + lastairunitmodel.weapons[6].ejectX = 10; + lastairunitmodel.weapons[7].ejectX = -10; + lastairunitmodel.weapons[8].ejectX = 0; + lastairunitmodel.weapons[9].ejectX = 10; + lastairunitmodel.weapons[9].ejectY = 25; + + towerModel.AddBehavior(strongairunitmodel); + towerModel.AddBehavior(closeairunitmodel); + towerModel.AddBehavior(lastairunitmodel); + + var bombbehavior = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).Duplicate(); + var mortar500 = Game.instance.model.GetTowerFromId("MortarMonkey-500").Duplicate(); + var bomb = bombbehavior.weapons[0]; + bomb.projectile.GetBehavior().effectModel.assetId = new Assets.Scripts.Utils.PrefabReference() { guidRef = "b1324f2f4c3809643b7ef1d8c112442a" }; + bomb.projectile.GetBehavior().effectModel.scale = .8f; + + bomb.RemoveBehavior(); + var emissionovertimemodel = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).weapons[0].emission.Duplicate(); + bomb.emission = new SingleEmmisionTowardsTargetModel("targetbloons", null, 0); + bomb.rate = .85f; + bomb.projectile.GetBehavior().timeToTake = 2.1f; + + + var explosion = mortar500.GetAttackModel().weapons[0].projectile.GetBehaviors()[0].projectile.Duplicate(); + explosion.GetDescendants().ForEach(model => model.isActive = false); + explosion.radius *= 1.1f; + explosion.pierce = 100; + explosion.GetBehavior().damage = 24; + explosion.AddBehavior(new DamageModifierForTagModel("boss", "Boss", 1, 48, false, true)); + explosion.GetBehavior().maxDamage = 999999; + explosion.GetBehavior().CapDamage(999999); + + var superbrittle = Game.instance.model.GetTowerFromId("IceMonkey-500").GetDescendant(); + superbrittle.perHitDamageAddition = 8; + + var moabstun = Game.instance.model.GetTowerFromId("BombShooter-500").GetDescendant().Duplicate(); + moabstun.lifespan *= .3f; + explosion.collisionPasses = new[] { -1, 0 }; + + explosion.AddBehavior(moabstun); + explosion.AddBehavior(superbrittle); + + + bomb.projectile.GetBehavior().projectile = explosion; + + towerModel.AddBehavior(bombbehavior); + + var carrier = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-400").GetAttackModel(1).weapons[0].Duplicate(); + var plane = Game.instance.model.GetTowerFromId("BuccaneerGreaterPlane").Duplicate(); + var strafe = plane.GetAttackModel(0).weapons[0]; + var strafeprojectile = strafe.projectile; + var missile = plane.GetAttackModel(2).weapons[0]; + var missileprojectile = missile.projectile; + + plane.GetBehavior().display = CreatePrefabReference(); + plane.RemoveBehavior(); + plane.GetAttackModel(1).RemoveWeapon(plane.GetAttackModel(1).weapons[0]); + + strafe.rate = .1f; + strafe.projectile.GetBehavior().damage = 60; + strafe.projectile.AddBehavior(new DamageModifierForTagModel("Boss", "Boss", 1, 100, false, true)); + strafeprojectile.pierce += 100; + strafeprojectile.display = CreatePrefabReference(); + missile.rate = 1f; + + plane.baseId = "Plane"; + carrier.GetBehavior().baseSubTowerId = "Plane"; + carrier.GetBehavior().maxNumberOfSubTowers = 5; + + carrier.projectile.GetBehavior().tower = plane; + carrier.projectile.GetBehavior().positionAtTarget = false; + + var moabplane = plane.Duplicate(); + var moabmissile = moabplane.GetAttackModel(2).weapons[0]; + var moabmissileprojectile = moabmissile.projectile; + var moabstrafe = moabplane.GetAttackModel(0); + var moabstrafeprojectile = moabstrafe.weapons[0].projectile; + var stun = Game.instance.model.GetTowerFromId("BombShooter-500").GetDescendant().Duplicate(); + stun.lifespan = 1.1f; + + moabplane.baseId = "MoabPlane"; + moabplane.GetDescendant().maxSpeed -= 10; + moabplane.GetDescendant().loopChancePerSecondPassed *= 1.1f; + + + moabmissileprojectile.GetBehavior().projectile.AddBehavior(stun); + moabmissileprojectile.GetBehavior().projectile.collisionPasses = new[] { -1, 0 }; + moabmissileprojectile.GetBehavior().projectile.GetDamageModel().damage = 1000; + moabmissileprojectile.GetBehavior().projectile.pierce = 25; + moabmissileprojectile.scale = .5f; + moabmissile.rate = 1.5f; + + moabplane.GetBehavior().display = CreatePrefabReference(); + moabplane.GetDescendants().ForEach(model => model.isActive = false); + plane.GetDescendants().ForEach(model => model.isActive = false); + var moabcarrier = carrier.Duplicate(); + moabcarrier.projectile.GetBehavior().tower = moabplane; + moabcarrier.projectile.GetBehavior().positionAtTarget = false; + moabcarrier.GetBehavior().baseSubTowerId = "MoabPlane"; + moabcarrier.GetBehavior().maxNumberOfSubTowers = 5; + + //planelauncher.AddWeapon(carrier); + planelauncher.AddWeapon(moabcarrier); + moabcarrier.AddBehavior(new FireFromAirUnitModel("")); + carrier.AddBehavior(new FireFromAirUnitModel("")); + towerModel.AddBehavior(planelauncher); + + towerModel.GetDescendants().ForEach(model => model.isActive = false); + + } + } +} \ No newline at end of file diff --git a/Upgrades/BottomPath/Carrier Airship.cs b/Upgrades/BottomPath/Carrier Airship.cs new file mode 100644 index 0000000..ee40cf6 --- /dev/null +++ b/Upgrades/BottomPath/Carrier Airship.cs @@ -0,0 +1,95 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Unity; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Weapons.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors; +using MonkeyAirship.Upgrades.TopPath; +using MonkeyAirship.Upgrades.MiddlePath; +using Assets.Scripts.Models.Towers.Filters; +using UnhollowerBaseLib; +using Assets.Scripts.Models.Towers.Weapons; +using Assets.Scripts.Simulation.Towers.Emissions.Behaviors; +using Assets.Scripts.Simulation.Towers.Emissions; + +namespace MonkeyAirship.Upgrades.BottomPath +{ + public class CarrierAirship : ModUpgrade + { + + public override int Path => BOTTOM; + public override int Tier => 4; + public override int Cost => 11500; + + public override string Description => "Now with new and improved fighters!"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + if (towerModel.tier == 4) + { + var attackairunitmodel = towerModel.GetBehavior(); + var firefromairunitmodel = attackairunitmodel.GetDescendant(); + var carrier = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-400").GetAttackModel(1).weapons[0].Duplicate(); + var plane = Game.instance.model.GetTowerFromId("BuccaneerGreaterPlane").Duplicate(); + var strafe = plane.GetAttackModel(0).weapons[0]; + var strafeprojectile = strafe.projectile; + var missile = plane.GetAttackModel(2).weapons[0]; + var missileprojectile = plane.GetAttackModel(2).weapons[0]; + + plane.GetBehavior().parentTowerUpgradeTier = 4; + plane.GetAttackModel(1).weapons[0].rate = 9999999; + plane.GetAttackModel(1).weapons[0].startInCooldown = true; + + + strafe.rate = .3f; + strafe.projectile.GetBehavior().damage = 1; + strafeprojectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + strafeprojectile.pierce = 8; + + missile.rate = 3f; + + plane.baseId = "BuccaneerGreaterPlane"; + carrier.GetBehavior().baseSubTowerId = "BuccaneerGreaterPlane"; + carrier.GetBehavior().maxNumberOfSubTowers = 3; + + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + plane.GetDescendants().ForEach(model => model.isActive = false); + var firefromlightplane = plane.GetDescendant(); + var decamo = Game.instance.model.GetTower(TowerType.WizardMonkey, 0, 0, 3).GetWeapons()[1].Duplicate(); + decamo.behaviors = new Il2CppReferenceArray(new WeaponBehaviorModel[] { firefromlightplane }); + decamo.rate = .3f; + decamo.projectile.display = new Assets.Scripts.Utils.PrefabReference() { guidRef = "" }; + decamo.projectile.radius = 20; + plane.GetAttackModel(0).AddWeapon(decamo); + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + strafe.rate *= .66f; + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + carrier.GetBehavior().maxNumberOfSubTowers = 4; + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + plane.GetDescendant().maxSpeed *= 1.2f; + plane.GetDescendant().loopTimeBeforeNext *= .75f; + } + carrier.projectile.GetBehavior().tower = plane; + carrier.projectile.GetBehavior().positionAtTarget = false; + carrier.projectile.AddBehavior(firefromairunitmodel); + foreach (var attackairunitmodel2 in towerModel.GetBehaviors()) + { + attackairunitmodel2.weapons[0].projectile.display = CreatePrefabReference(); + } + attackairunitmodel.AddWeapon(carrier); + towerModel.GetBehavior().display = CreatePrefabReference(); + + } + } + } +} \ No newline at end of file diff --git a/Upgrades/BottomPath/CarrierAirship-Icon.png b/Upgrades/BottomPath/CarrierAirship-Icon.png new file mode 100644 index 0000000..697d045 Binary files /dev/null and b/Upgrades/BottomPath/CarrierAirship-Icon.png differ diff --git a/Upgrades/BottomPath/CarrierAirship-Portrait.png b/Upgrades/BottomPath/CarrierAirship-Portrait.png new file mode 100644 index 0000000..3274e84 Binary files /dev/null and b/Upgrades/BottomPath/CarrierAirship-Portrait.png differ diff --git a/Upgrades/BottomPath/Improved Engines.cs b/Upgrades/BottomPath/Improved Engines.cs new file mode 100644 index 0000000..96f48c8 --- /dev/null +++ b/Upgrades/BottomPath/Improved Engines.cs @@ -0,0 +1,44 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Unity; +using Assets.Scripts.Models.Towers.Filters; +using Assets.Scripts.Models.Towers.Weapons.Behaviors; +using Assets.Scripts.Models.Towers.Weapons; +using Assets.Scripts.Models.Towers.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors.Attack.Behaviors; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using MonkeyAirship.Displays; + +namespace MonkeyAirship.Upgrades.BottomPath + +{ + public class ImprovedEngines : ModUpgrade + { + + public override int Path => BOTTOM; + public override int Tier => 2; + public override int Cost => 540; + + public override string Description => "Improved Engines allows Monkey Airship to be more manueverable!"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + var airunitmodel = towerModel.GetBehavior(); + airunitmodel.behaviors[0].Cast().speed += 4; + airunitmodel.behaviors[0].Cast().rotation += 20; + var attackairunitmodel = towerModel.GetBehavior(); + towerModel.targetTypes = Game.instance.model.GetTowerFromId("MonkeyAce-002").targetTypes; + attackairunitmodel.AddBehavior(Game.instance.model.GetTowerFromId("MonkeyAce-002").GetBehavior().GetBehavior()); + var docking = attackairunitmodel.GetBehavior(); + docking.canSelectPoint = true; + docking._name = "Docking"; + docking.widthRadius = 30; + docking.heightRadius = 30; + + airunitmodel.display = CreatePrefabReference(); + + } + } +} \ No newline at end of file diff --git a/Upgrades/BottomPath/ImprovedEngines-Icon.png b/Upgrades/BottomPath/ImprovedEngines-Icon.png new file mode 100644 index 0000000..556f14a Binary files /dev/null and b/Upgrades/BottomPath/ImprovedEngines-Icon.png differ diff --git a/Upgrades/BottomPath/ImprovedEngines-Portrait.png b/Upgrades/BottomPath/ImprovedEngines-Portrait.png new file mode 100644 index 0000000..645c1af Binary files /dev/null and b/Upgrades/BottomPath/ImprovedEngines-Portrait.png differ diff --git a/Upgrades/BottomPath/Light Carrier.cs b/Upgrades/BottomPath/Light Carrier.cs new file mode 100644 index 0000000..d79729d --- /dev/null +++ b/Upgrades/BottomPath/Light Carrier.cs @@ -0,0 +1,84 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Unity; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Weapons.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors; +using MonkeyAirship.Upgrades.TopPath; +using MonkeyAirship.Upgrades.MiddlePath; +using Assets.Scripts.Models.Towers.Filters; +using UnhollowerBaseLib; +using Assets.Scripts.Models.Towers.Weapons; + +namespace MonkeyAirship.Upgrades.BottomPath +{ + public class LightCarrier : ModUpgrade + { + + public override int Path => BOTTOM; + public override int Tier => 3; + public override int Cost => 2150; + + public override string Description => "Launches an escort of fighter planes!"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + if (towerModel.tier == 3) + { + var attackairunitmodel = towerModel.GetBehavior(); + var firefromairunitmodel = attackairunitmodel.GetDescendant(); + var carrier = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-400").GetAttackModel(1).weapons[0].Duplicate(); + var plane = Game.instance.model.GetTowerFromId("BuccaneerLesserPlane").Duplicate(); + var strafe = plane.GetAttackModel(0).weapons[0]; + var strafeprojectile = strafe.projectile; + + + plane.GetBehavior().parentTowerUpgradeTier = 3; + plane.GetAttackModel(2).weapons[0].rate = 9999999; + plane.GetAttackModel(2).weapons[0].startInCooldown = true; + plane.GetAttackModel(1).weapons[0].rate = 9999999; + plane.GetAttackModel(1).weapons[0].startInCooldown = true; + strafe.rate = .4f; + strafeprojectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + strafeprojectile.pierce = 5; + + + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + plane.GetDescendants().ForEach(model => model.isActive = false); + var firefromplane = plane.GetDescendant(); + var decamo = Game.instance.model.GetTower(TowerType.WizardMonkey, 0, 0, 3).GetWeapons()[1].Duplicate(); + decamo.behaviors = new Il2CppReferenceArray(new WeaponBehaviorModel[] { firefromairunitmodel }); + decamo.rate = .01f; + decamo.projectile.display = new Assets.Scripts.Utils.PrefabReference() { guidRef = "" }; + decamo.projectile.radius = 20; + plane.GetAttackModel(0).AddWeapon(decamo); + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + strafe.rate *= .66f; + } + plane.baseId = "BuccaneerLesserPlane"; + carrier.GetBehavior().baseSubTowerId = "BuccaneerLesserPlane"; + carrier.GetBehavior().maxNumberOfSubTowers = 3; + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + carrier.GetBehavior().maxNumberOfSubTowers = 4; + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + plane.GetDescendant().maxSpeed *= 1.2f; + plane.GetDescendant().loopTimeBeforeNext *= .75f; + } + carrier.projectile.GetBehavior().positionAtTarget = false; + carrier.projectile.AddBehavior(firefromairunitmodel); + carrier.projectile.GetBehavior().tower = plane; + attackairunitmodel.AddWeapon(carrier); + towerModel.GetBehavior().display = CreatePrefabReference(); + } + } + } +} \ No newline at end of file diff --git a/Upgrades/BottomPath/LightCarrier-Icon.png b/Upgrades/BottomPath/LightCarrier-Icon.png new file mode 100644 index 0000000..967e953 Binary files /dev/null and b/Upgrades/BottomPath/LightCarrier-Icon.png differ diff --git a/Upgrades/BottomPath/LightCarrier-Portrait.png b/Upgrades/BottomPath/LightCarrier-Portrait.png new file mode 100644 index 0000000..c41ac9f Binary files /dev/null and b/Upgrades/BottomPath/LightCarrier-Portrait.png differ diff --git a/Upgrades/BottomPath/Powerful Darts.cs b/Upgrades/BottomPath/Powerful Darts.cs new file mode 100644 index 0000000..006b14e --- /dev/null +++ b/Upgrades/BottomPath/Powerful Darts.cs @@ -0,0 +1,25 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Behaviors; + +namespace MonkeyAirship.Upgrades.BottomPath +{ + public class PowerfulDarts : ModUpgrade + { + + public override int Path => BOTTOM; + public override int Tier => 1; + public override int Cost => 550; + + public override string Description => "Darts gain more popping power!"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + towerModel.GetBehavior().weapons[0].projectile.pierce += 2; + towerModel.GetBehavior().display = CreatePrefabReference(); + } + } +} \ No newline at end of file diff --git a/Upgrades/BottomPath/PowerfulDarts-Icon.png b/Upgrades/BottomPath/PowerfulDarts-Icon.png new file mode 100644 index 0000000..8da8048 Binary files /dev/null and b/Upgrades/BottomPath/PowerfulDarts-Icon.png differ diff --git a/Upgrades/BottomPath/PowerfulDarts-Portrait.png b/Upgrades/BottomPath/PowerfulDarts-Portrait.png new file mode 100644 index 0000000..34c4db5 Binary files /dev/null and b/Upgrades/BottomPath/PowerfulDarts-Portrait.png differ diff --git a/Upgrades/BottomPath/Ravager-Icon.png b/Upgrades/BottomPath/Ravager-Icon.png new file mode 100644 index 0000000..12b06be Binary files /dev/null and b/Upgrades/BottomPath/Ravager-Icon.png differ diff --git a/Upgrades/BottomPath/Ravager-Portrait.png b/Upgrades/BottomPath/Ravager-Portrait.png new file mode 100644 index 0000000..866d2af Binary files /dev/null and b/Upgrades/BottomPath/Ravager-Portrait.png differ diff --git a/Upgrades/BottomPath/Ravager.cs b/Upgrades/BottomPath/Ravager.cs new file mode 100644 index 0000000..dd4cdbf --- /dev/null +++ b/Upgrades/BottomPath/Ravager.cs @@ -0,0 +1,148 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Unity; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Weapons.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors; +using MonkeyAirship.Upgrades.TopPath; +using MonkeyAirship.Upgrades.MiddlePath; +using Assets.Scripts.Models.Towers.Filters; +using Assets.Scripts.Models.Towers.Behaviors.Attack.Behaviors; +using MonkeyAirship.Displays.Planes; +namespace MonkeyAirship.Upgrades.BottomPath +{ + public class Ravager : ModUpgrade + { + + public override int Path => BOTTOM; + public override int Tier => 5; + public override int Cost => 42000; + + public override string Description => "Powerful fighters deal massive damage and can stun Moab-class bloons"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + if (towerModel.tier == 5) + { + var attackairunitmodel = towerModel.GetBehavior(); + var firefromairunitmodel = attackairunitmodel.GetDescendant(); + var carrier = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-400").GetAttackModel(1).weapons[0].Duplicate(); + var plane = Game.instance.model.GetTowerFromId("BuccaneerGreaterPlane").Duplicate(); + var strafe = plane.GetAttackModel(0).weapons[0]; + var strafeprojectile = strafe.projectile; + var missile = plane.GetAttackModel(2).weapons[0]; + var missileprojectile = missile.projectile; + + plane.GetBehavior().display = CreatePrefabReference(); + plane.GetBehavior().parentTowerUpgradeTier = 5; + plane.GetAttackModel(1).RemoveWeapon(plane.GetAttackModel(1).weapons[0]); + + strafe.rate = .15f; + strafe.projectile.GetBehavior().damage = 8; + strafe.projectile.AddBehavior(new DamageModifierForTagModel("ceramic", "Ceramic", 1, 6, false, true)); + strafe.projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Fortifieds", 1, 6, false, true)); + strafeprojectile.pierce += 15; + strafeprojectile.display = CreatePrefabReference(); + missile.rate = 2f; + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + missile.rate *= .8f; + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + strafe.projectile.GetDamageModel().damage += 4; + strafeprojectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + } + + plane.baseId = "Plane"; + carrier.GetBehavior().baseSubTowerId = "Plane"; + carrier.GetBehavior().maxNumberOfSubTowers = 4; + + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + plane.GetDescendants().ForEach(model => model.isActive = false); + var firefromlightplane = plane.GetDescendant(); + /*var decamo = Game.instance.model.GetTower(TowerType.WizardMonkey, 0, 0, 3).GetAttackModel(1).Duplicate(); + decamo.weapons[0].AddBehavior(new FireFromAirUnitModel("")); + decamo.weapons[0].rate = .3f; + decamo.weapons[0].projectile.display = new Assets.Scripts.Utils.PrefabReference() { guidRef = "" }; + decamo.weapons[0].projectile.radius = 35; + plane.GetAttackModel(0).AddBehavior(decamo);*/ + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + strafe.rate *= .66f; + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + carrier.GetBehavior().maxNumberOfSubTowers = 5; + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + plane.GetDescendant().maxSpeed *= 1.2f; + plane.GetDescendant().loopTimeBeforeNext *= .75f; + } + carrier.projectile.GetBehavior().tower = plane; + carrier.projectile.GetBehavior().positionAtTarget = false; + carrier.projectile.AddBehavior(firefromairunitmodel); + + var moabplane = plane.Duplicate(); + var moabmissile = moabplane.GetAttackModel(2).weapons[0]; + var moabmissileprojectile = moabmissile.projectile; + var moabstrafe = moabplane.GetAttackModel(0); + var moabstrafeprojectile = moabstrafe.weapons[0].projectile; + var stun = Game.instance.model.GetTowerFromId("BombShooter-500").GetDescendant().Duplicate(); + stun.dontRefreshDuration = true; + stun.lifespan = .8f; + + moabplane.baseId = "MoabPlane"; + moabplane.GetDescendant().maxSpeed -= 10; + moabplane.GetDescendant().loopChancePerSecondPassed *= 1.1f; + + moabstrafe.targetProvider = new TargetStrongAirUnitModel("targetstrong", false, true); + moabstrafe.AddBehavior(new FighterPilotPatternStrongModel("targetstrong", false, 25, true)); + moabstrafe.weapons[0].rate = 2; + moabstrafeprojectile.AddBehavior(new DamageModifierForTagModel("Moabs", "Moabs", 1, 15, false, true)); + + moabmissileprojectile.GetBehavior().projectile.AddBehavior(stun); + moabmissileprojectile.GetBehavior().projectile.collisionPasses = new[] { -1, 0 }; + moabmissileprojectile.GetBehavior().projectile.GetDamageModel().damage += 30; + moabmissileprojectile.GetBehavior().projectile.pierce = 3; + + + moabplane.GetBehavior().display = CreatePrefabReference(); + var moabcarrier = carrier.Duplicate(); + moabcarrier.projectile.GetBehavior().tower = moabplane; + moabcarrier.projectile.GetBehavior().positionAtTarget = false; + moabcarrier.projectile.AddBehavior(firefromairunitmodel); + moabcarrier.GetBehavior().baseSubTowerId = "MoabPlane"; + moabcarrier.GetBehavior().maxNumberOfSubTowers = 4; + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + moabcarrier.GetBehavior().maxNumberOfSubTowers = 5; + } + + + attackairunitmodel.range += 40; + foreach (var attackairunitmodel2 in towerModel.GetBehaviors()) + { + attackairunitmodel2.weapons[0].rate *= .2f; + attackairunitmodel2.weapons[0].projectile.GetDamageModel().damage += 9; + attackairunitmodel2.weapons[0].projectile.pierce += 12; + attackairunitmodel2.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("moab", "Moabs", 1, 5, false, true)); + attackairunitmodel2.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Fortified", 1, 5, false, true)); + attackairunitmodel2.weapons[0].projectile.display = CreatePrefabReference(); + attackairunitmodel2.weapons[0].projectile.scale *= .75f; + } + + attackairunitmodel.AddWeapon(carrier); + attackairunitmodel.AddWeapon(moabcarrier); + towerModel.GetBehavior().display = CreatePrefabReference(); + + } + } + } +} \ No newline at end of file diff --git a/Upgrades/MiddlePath/AbilityIcon.png b/Upgrades/MiddlePath/AbilityIcon.png new file mode 100644 index 0000000..a6ae5ff Binary files /dev/null and b/Upgrades/MiddlePath/AbilityIcon.png differ diff --git a/Upgrades/MiddlePath/Annihilator-Icon.png b/Upgrades/MiddlePath/Annihilator-Icon.png new file mode 100644 index 0000000..885b3b8 Binary files /dev/null and b/Upgrades/MiddlePath/Annihilator-Icon.png differ diff --git a/Upgrades/MiddlePath/Annihilator-Portrait.png b/Upgrades/MiddlePath/Annihilator-Portrait.png new file mode 100644 index 0000000..c132ddd Binary files /dev/null and b/Upgrades/MiddlePath/Annihilator-Portrait.png differ diff --git a/Upgrades/MiddlePath/Annihilator.cs b/Upgrades/MiddlePath/Annihilator.cs new file mode 100644 index 0000000..e00468e --- /dev/null +++ b/Upgrades/MiddlePath/Annihilator.cs @@ -0,0 +1,164 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors.Attack.Behaviors; +using Assets.Scripts.Unity; +using Assets.Scripts.Models.Towers.Weapons.Behaviors; +using UnhollowerBaseLib; +using Assets.Scripts.Models.Towers.Weapons; +using Assets.Scripts.Models.Towers.Projectiles; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Behaviors; +using MonkeyAirship.Upgrades.TopPath; +using MonkeyAirship.Upgrades.MiddlePath; +using Assets.Scripts.Models.Towers.Filters; +using Assets.Scripts.Simulation.Towers.Emissions.Behaviors; +using Assets.Scripts.Simulation.Towers.Emissions; +using Assets.Scripts.Models.Towers.Behaviors.Emissions; +using MonkeyAirship.Upgrades.BottomPath; +using Assets.Scripts.Models.Towers.Behaviors.Abilities; +using Assets.Scripts.Models.Towers.Behaviors.Abilities.Behaviors; + +namespace MonkeyAirship.Upgrades.MiddlePath +{ + public class Annihilator : ModUpgrade + { + public override int Path => MIDDLE; + public override int Tier => 5; + public override int Cost => 175000; + + public override string Description => "This behemoth of flying metal exterminates all bloons with its powerful lasers"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + var strongairunitmodel = towerModel.GetBehaviors()[2]; + var firstairunitmodel = towerModel.GetBehaviors()[0]; + var lastairunitmodel = towerModel.GetBehaviors()[3]; + var closeairunitmodel = towerModel.GetBehaviors()[1]; + var centerlaserairunitmodel = towerModel.GetBehaviors()[4]; + //var carrier = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-400").GetAttackModel(1).weapons[0].Duplicate(); + + var balloflight = Game.instance.model.GetTowerFromId("BallOfLightTower").Duplicate(); + + balloflight.GetDescendant().dontUseTowerPosition = true; + + balloflight.GetAttackModel().weapons[0].AddBehavior(new FireFromAirUnitModel("fire")); + var balloflightweapon = balloflight.GetAttackModel().weapons[0]; + + balloflightweapon.projectile.GetDamageModel().damage = 12; + balloflightweapon.projectile.CapPierce(999999); + balloflightweapon.projectile.maxPierce = 999999; + balloflightweapon.projectile.GetDamageModel().maxDamage = 999999; + balloflightweapon.projectile.GetDamageModel().CapDamage(999999); + + /*var drone = Game.instance.model.GetTowerFromId("Drone").Duplicate(); + drone.targetTypes = towerModel.targetTypes; + var pursuit = drone.GetDescendant(); + pursuit.mustBeInRangeOfParent = false; + pursuit.pursuitDistance = 200; + pursuit.initialTargetType = "Strong"; + pursuit.useParentForClose = false; + var dronelaser = balloflightweapon.Duplicate(); + dronelaser.GetDescendant().displayPath.assetPath = new Assets.Scripts.Utils.PrefabReference() { guidRef = "04ddde17722d5f640b0668c85eeea4ca" }; + drone.GetAttackModel().AddWeapon(dronelaser); + + var droneattackmodel = drone.GetDescendant(); + droneattackmodel.AddBehavior(new TargetStrongAirUnitModel("", false, true)); + droneattackmodel.targetProvider = new TargetStrongAirUnitModel("", false, true); + droneattackmodel.range = 999999; + + var helimovement = drone.GetDescendant(); + helimovement.maxSpeed = 20; + helimovement.rotationSpeed = .08f; + + var etienneability = Game.instance.model.GetTowerFromId("Etienne 3").GetDescendant(); + etienneability.GetDescendant().droneModel = drone;*/ + + + var laserstrike = Game.instance.model.GetTowerFromId("DartlingGunner-050").GetDescendant().Duplicate(); + var laserstrikeattack = balloflight.Duplicate(); + var weaklaser = laserstrikeattack.Duplicate(); + var displaylaser = laserstrikeattack.Duplicate(); + displaylaser.GetDescendant().useTargetAsEndPoint = false; + weaklaser.GetDescendant().displayPath.assetPath = new Assets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" }; + + laserstrike.attacks[0].targetProvider = new TargetStrongAirUnitModel("", false, false); + laserstrike.attacks[0].AddBehavior(new TargetStrongAirUnitModel("", false, false)); + + laserstrikeattack.GetAttackModel().weapons[0].projectile.GetDamageModel().damage = 120; + laserstrikeattack.GetDescendant().displayPath.assetPath = new Assets.Scripts.Utils.PrefabReference() { guidRef = "b9f3014db2da83f48b34e662e9a79910" }; + + laserstrike.attacks[0].weapons[0] = laserstrikeattack.GetAttackModel().weapons[0].Duplicate(); + laserstrike.attacks[0].fireWithoutTarget = false; + laserstrike.lifespan *= .8f; + laserstrike.attacks[0].AddWeapon(weaklaser.GetAttackModel().weapons[0].Duplicate()); + laserstrike.attacks[0].weapons[1].ejectY = 25; + laserstrike.attacks[0].AddWeapon(displaylaser.GetAttackModel().weapons[0].Duplicate()); + laserstrike.attacks[0].weapons[2].ejectY = -25; + laserstrike.attacks[0].AddWeapon(displaylaser.GetAttackModel().weapons[0].Duplicate()); + + + towerModel.GetDescendant().AddBehavior(laserstrike); + + + + foreach (var attackairunitmodel in towerModel.GetBehaviors()) + { + attackairunitmodel.range += 50; + attackairunitmodel.weapons[0].projectile.display = new Assets.Scripts.Utils.PrefabReference() { guidRef = "6c11e1432d6321c44b216600b2cdbac6" }; + attackairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("ceramic", "Ceramic", 1, 3, false, true)); + attackairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Fortified", 1, 3, false, true)); + attackairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("moabs", "Moabs", 1, 2, false, true)); + attackairunitmodel.weapons[0].projectile.pierce += 5; + attackairunitmodel.weapons[0].projectile.GetBehavior().damage += 2; + attackairunitmodel.weapons[0].rate *= .8f; + //attackairunitmodel.weapons[0].projectile.scale *= 1.5f; + } + centerlaserairunitmodel.range = 999999; + centerlaserairunitmodel.weapons[0] = balloflightweapon.Duplicate(); + firstairunitmodel.weapons[0].ejectY = 5; + firstairunitmodel.weapons[0].ejectX = -10; + closeairunitmodel.weapons[0].ejectY = -5; + firstairunitmodel.weapons[0].ejectX = -10; + strongairunitmodel.weapons[0].ejectY = 10; + strongairunitmodel.weapons[0].ejectX = -10; + lastairunitmodel.weapons[0].ejectY = -10; + lastairunitmodel.weapons[0].ejectX = -10; + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[0].Duplicate()); + firstairunitmodel.weapons[1].ejectX = -10; + firstairunitmodel.weapons[1].ejectY = -15; + firstairunitmodel.weapons[1].ejectZ = -5; + strongairunitmodel.AddWeapon(firstairunitmodel.weapons[1].Duplicate()); + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[1].Duplicate()); + firstairunitmodel.weapons[2].ejectX = 10; + strongairunitmodel.AddWeapon(firstairunitmodel.weapons[2].Duplicate()); + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[0].Duplicate()); + firstairunitmodel.weapons[3].ejectX = 10; + strongairunitmodel.AddWeapon(strongairunitmodel.weapons[0].Duplicate()); + strongairunitmodel.weapons[3].ejectX = 10; + closeairunitmodel.AddWeapon(closeairunitmodel.weapons[0].Duplicate()); + closeairunitmodel.weapons[1].ejectX = 10; + lastairunitmodel.AddWeapon(lastairunitmodel.weapons[0].Duplicate()); + lastairunitmodel.weapons[1].ejectX = 10; + closeairunitmodel.AddWeapon(firstairunitmodel.weapons[1].Duplicate()); + closeairunitmodel.AddWeapon(firstairunitmodel.weapons[2].Duplicate()); + firstairunitmodel.AddWeapon(firstairunitmodel.weapons[0].Duplicate()); + firstairunitmodel.weapons[4].ejectX = 0; + firstairunitmodel.weapons[4].ejectY = 25; + strongairunitmodel.AddWeapon(firstairunitmodel.weapons[4].Duplicate()); + closeairunitmodel.AddWeapon(firstairunitmodel.weapons[4].Duplicate()); + var frontlaserairunitmodel = centerlaserairunitmodel.Duplicate(); + frontlaserairunitmodel.weapons[0].ejectY = 28; + frontlaserairunitmodel.AddBehavior(new TargetFirstAirUnitModel("targetfirst", false, false)); + frontlaserairunitmodel.targetProvider = new TargetFirstAirUnitModel("targetfirst", false, false); + towerModel.AddBehavior(frontlaserairunitmodel); + towerModel.GetBehavior().display = CreatePrefabReference(); + + + + + } + } +} \ No newline at end of file diff --git a/Upgrades/MiddlePath/BloontoniumDarts-Portrait.png b/Upgrades/MiddlePath/BloontoniumDarts-Portrait.png new file mode 100644 index 0000000..931a751 Binary files /dev/null and b/Upgrades/MiddlePath/BloontoniumDarts-Portrait.png differ diff --git a/Upgrades/MiddlePath/Faster Firing.cs b/Upgrades/MiddlePath/Faster Firing.cs new file mode 100644 index 0000000..81bf996 --- /dev/null +++ b/Upgrades/MiddlePath/Faster Firing.cs @@ -0,0 +1,25 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Behaviors; + +namespace MonkeyAirship.Upgrades.MiddlePath +{ + public class FasterFiring : ModUpgrade + { + + public override int Path => MIDDLE; + public override int Tier => 1; + public override int Cost => 680; + + public override string Description => "Machine Gun Fires Faster"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + towerModel.GetBehavior().weapons[0].rate *= .66f; + towerModel.GetBehavior().display = CreatePrefabReference(); + } + } +} \ No newline at end of file diff --git a/Upgrades/MiddlePath/FasterFiring-Icon.png b/Upgrades/MiddlePath/FasterFiring-Icon.png new file mode 100644 index 0000000..a7527ac Binary files /dev/null and b/Upgrades/MiddlePath/FasterFiring-Icon.png differ diff --git a/Upgrades/MiddlePath/FasterFiring-Portrait.png b/Upgrades/MiddlePath/FasterFiring-Portrait.png new file mode 100644 index 0000000..47cbf45 Binary files /dev/null and b/Upgrades/MiddlePath/FasterFiring-Portrait.png differ diff --git a/Upgrades/MiddlePath/Gatling Laser.cs b/Upgrades/MiddlePath/Gatling Laser.cs new file mode 100644 index 0000000..59f2d85 --- /dev/null +++ b/Upgrades/MiddlePath/Gatling Laser.cs @@ -0,0 +1,51 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors.Attack.Behaviors; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Behaviors; + +namespace MonkeyAirship.Upgrades.MiddlePath +{ + public class GatlingLaser : ModUpgrade + { + + public override int Path => MIDDLE; + public override int Tier => 3; + public override int Cost => 3850; + + public override string Description => "Adds a another machine gun that fires lasers!"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + var attackairunitmodel = towerModel.GetBehavior(); + attackairunitmodel.range = 120; + foreach (var attackairunitmodels in towerModel.GetBehaviors()) + { + attackairunitmodels.weapons[0].projectile.pierce += 2; + } + var laser = attackairunitmodel.Duplicate(); + laser.weapons[0].projectile.ApplyDisplay(); + laser.targetProvider = new TargetStrongAirUnitModel("targetstrong", false, false); + laser.AddBehavior(new TargetStrongAirUnitModel("targetstrong", false, false)); + var laserweapon = laser.weapons[0]; + laserweapon.rate = .9f; + + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + laserweapon.rate *= .66f; + } + laserweapon.ejectY = 0; + var laserprojectile = laser.weapons[0].projectile; + laserprojectile.AddBehavior(new DamageModifierForTagModel("ceramicdamage", "Ceramic", 1, 2, false, true)); + laserprojectile.AddBehavior(new DamageModifierForTagModel("moabdamage", "Moabs", 1, 5, false, true)); + laserprojectile.pierce = 2; + laserprojectile.scale = 1.3f; + laserprojectile.GetBehavior().speed = 800; + towerModel.AddBehavior(laser); + towerModel.GetBehavior().display = CreatePrefabReference(); + } + } +} \ No newline at end of file diff --git a/Upgrades/MiddlePath/GatlingLaser-Icon.png b/Upgrades/MiddlePath/GatlingLaser-Icon.png new file mode 100644 index 0000000..6d800e2 Binary files /dev/null and b/Upgrades/MiddlePath/GatlingLaser-Icon.png differ diff --git a/Upgrades/MiddlePath/GatlingLaser-Portrait.png b/Upgrades/MiddlePath/GatlingLaser-Portrait.png new file mode 100644 index 0000000..478bdbe Binary files /dev/null and b/Upgrades/MiddlePath/GatlingLaser-Portrait.png differ diff --git a/Upgrades/MiddlePath/Laser Array.cs b/Upgrades/MiddlePath/Laser Array.cs new file mode 100644 index 0000000..02c7830 --- /dev/null +++ b/Upgrades/MiddlePath/Laser Array.cs @@ -0,0 +1,162 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors.Attack.Behaviors; +using Assets.Scripts.Unity; +using Assets.Scripts.Models.Towers.Weapons.Behaviors; +using UnhollowerBaseLib; +using Assets.Scripts.Models.Towers.Weapons; +using Assets.Scripts.Models.Towers.Projectiles; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Behaviors; +using MonkeyAirship.Upgrades.TopPath; +using MonkeyAirship.Upgrades.MiddlePath; +using Assets.Scripts.Models.Towers.Filters; +using Assets.Scripts.Simulation.Towers.Emissions.Behaviors; +using Assets.Scripts.Simulation.Towers.Emissions; +using Assets.Scripts.Models.Towers.Behaviors.Emissions; +using MonkeyAirship.Upgrades.BottomPath; +using Assets.Scripts.Models.Towers.Behaviors.Abilities; +using Assets.Scripts.Models.Towers.Behaviors.Abilities.Behaviors; +using BTD_Mod_Helper.Api; + +namespace MonkeyAirship.Upgrades.MiddlePath +{ + public class LaserArray : ModUpgrade + { + public override int Path => MIDDLE; + public override int Tier => 4; + public override int Cost => 28000; + + public override string Description => "Adds a powerful new beam attack that targets the strongest bloon on screen!"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + var strongairunitmodel = towerModel.GetBehaviors()[2]; + strongairunitmodel.RemoveWeapon(strongairunitmodel.weapons[0]); + var firstairunitmodel = towerModel.GetBehaviors()[0]; + var lastairunitmodel = towerModel.GetBehavior().Duplicate(); + var centerlaserairunitmodel = strongairunitmodel.Duplicate(); + var closeairunitmodel = towerModel.GetBehaviors()[1]; + towerModel.GetAttackModel(0).weapons[0].projectile.display = new Assets.Scripts.Utils.PrefabReference() { guidRef = "6c11e1432d6321c44b216600b2cdbac6" }; + + var balloflight = Game.instance.model.GetTowerFromId("BallOfLightTower").Duplicate(); + balloflight.GetDescendant().displayPath.assetPath = new Assets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" }; + balloflight.GetDescendant().dontUseTowerPosition = true; + //balloflight.GetDescendant().displayPath.assetPath = new Assets.Scripts.Utils.PrefabReference() { guidRef = "d48587764ad63c84ea37e82f58bd05ad" }; + balloflight.GetAttackModel().weapons[0].AddBehavior(new FireFromAirUnitModel("fire")); + var balloflightweapon = balloflight.GetAttackModel().weapons[0]; + + balloflightweapon.projectile.GetDamageModel().damage = 1; + balloflightweapon.projectile.AddBehavior(new DamageModifierForTagModel("moabs", "Moabs", 1, 1, false, true)); + balloflightweapon.projectile.pierce = 4; + balloflightweapon.projectile.CapPierce(999999); + balloflightweapon.projectile.maxPierce = 999999; + balloflightweapon.projectile.GetDamageModel().maxDamage = 999999; + balloflightweapon.projectile.GetDamageModel().CapDamage(999999);; + var abilitymodel = Game.instance.model.GetTowerFromId("MortarMonkey-040").GetBehavior().Duplicate(); + var turbomodel = abilitymodel.GetBehavior(); + turbomodel.multiplier = .4f; + turbomodel.extraDamage = 1; + abilitymodel.icon = GetSpriteReference(mod, "AbilityIcon"); + towerModel.GetAttackModel().AddBehavior(abilitymodel); + + + centerlaserairunitmodel.AddWeapon(balloflight.GetAttackModel().weapons[0]); + firstairunitmodel.weapons[0].projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + firstairunitmodel.weapons[0].ejectY = 10; + + closeairunitmodel.weapons[0].projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + closeairunitmodel.targetProvider = new TargetCloseAirUnitModel("targetclose", false, false); + closeairunitmodel.AddBehavior(new TargetCloseAirUnitModel("targetclose", false, false)); + closeairunitmodel.weapons[0].ejectY = 15; + + //firstairunitmodel.weapons[0].projectile.display = new Assets.Scripts.Utils.PrefabReference() { guidRef = "7952d3e088920174c8d2450218ab3f14" }; + + lastairunitmodel.targetProvider = new TargetLastAirUnitModel("targetlast", false, false); + lastairunitmodel.AddBehavior(new TargetLastAirUnitModel("targetlast", false, false)); + lastairunitmodel.weapons[0].projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + lastairunitmodel.weapons[0].ejectY = -15; + //lastairunitmodel.weapons[0].projectile.display = new Assets.Scripts.Utils.PrefabReference() { guidRef = "7952d3e088920174c8d2450218ab3f14" }; + + strongairunitmodel.AddWeapon(firstairunitmodel.weapons[0].Duplicate()); + strongairunitmodel.weapons[0].projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + strongairunitmodel.weapons[0].ejectY = -10; + //strongairunitmodel.weapons[0].projectile.display = new Assets.Scripts.Utils.PrefabReference() { guidRef = "7952d3e088920174c8d2450218ab3f14" }; + + towerModel.AddBehavior(lastairunitmodel); + + strongairunitmodel.range += 40; + strongairunitmodel.weapons[0].projectile.ApplyDisplay(); + strongairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("ceramic", "Ceramic", 1, 3, false, true)); + strongairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Fortified", 1, 3, false, true)); + strongairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Moabs", 1, 2, false, true)); + strongairunitmodel.weapons[0].projectile.pierce += 6; + strongairunitmodel.weapons[0].projectile.GetBehavior().damage += 2; + strongairunitmodel.weapons[0].rate *= .5f; + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + strongairunitmodel.weapons[0].projectile.pierce += 4; + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + strongairunitmodel.weapons[0].projectile.GetBehavior().damage += 1; + } + lastairunitmodel.range += 40; + lastairunitmodel.weapons[0].projectile.ApplyDisplay(); + lastairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("ceramic", "Ceramic", 1, 3, false, true)); + lastairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Fortified", 1, 3, false, true)); + lastairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Moabs", 1, 2, false, true)); + lastairunitmodel.weapons[0].projectile.pierce += 6; + lastairunitmodel.weapons[0].projectile.GetBehavior().damage += 2; + lastairunitmodel.weapons[0].rate *= .5f; + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + lastairunitmodel.weapons[0].projectile.pierce += 4; + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + lastairunitmodel.weapons[0].projectile.GetBehavior().damage += 1; + } + firstairunitmodel.range += 40; + firstairunitmodel.weapons[0].projectile.ApplyDisplay(); + firstairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("ceramic", "Ceramic", 1, 3, false, true)); + firstairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Fortified", 1, 3, false, true)); + firstairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Moabs", 1, 2, false, true)); + firstairunitmodel.weapons[0].projectile.pierce += 6; + firstairunitmodel.weapons[0].projectile.GetBehavior().damage += 2; + firstairunitmodel.weapons[0].rate *= .5f; + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + firstairunitmodel.weapons[0].projectile.pierce += 4; + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + firstairunitmodel.weapons[0].projectile.GetBehavior().damage += 1; + } + closeairunitmodel.range += 40; + closeairunitmodel.weapons[0].projectile.ApplyDisplay(); + closeairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("ceramic", "Ceramic", 1, 3, false, true)); + closeairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Fortified", 1, 3, false, true)); + closeairunitmodel.weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Moabs", 1, 2, false, true)); + closeairunitmodel.weapons[0].projectile.pierce += 6; + closeairunitmodel.weapons[0].projectile.GetBehavior().damage += 2; + closeairunitmodel.weapons[0].rate *= .5f; + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + closeairunitmodel.weapons[0].projectile.pierce += 4; + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + closeairunitmodel.weapons[0].projectile.GetBehavior().damage += 1; + } + towerModel.AddBehavior(centerlaserairunitmodel); + centerlaserairunitmodel.range += 40; + towerModel.GetBehavior().behaviors[0].Cast().speed += 8; + towerModel.GetBehavior().behaviors[0].Cast().rotation += 30; + towerModel.GetBehavior().display = CreatePrefabReference(); + } + } +} diff --git a/Upgrades/MiddlePath/LaserArray-Icon.png b/Upgrades/MiddlePath/LaserArray-Icon.png new file mode 100644 index 0000000..38fa42b Binary files /dev/null and b/Upgrades/MiddlePath/LaserArray-Icon.png differ diff --git a/Upgrades/MiddlePath/LaserArray-Portrait.png b/Upgrades/MiddlePath/LaserArray-Portrait.png new file mode 100644 index 0000000..9e8b9be Binary files /dev/null and b/Upgrades/MiddlePath/LaserArray-Portrait.png differ diff --git a/Upgrades/MiddlePath/Twin Guns.cs b/Upgrades/MiddlePath/Twin Guns.cs new file mode 100644 index 0000000..1964c82 --- /dev/null +++ b/Upgrades/MiddlePath/Twin Guns.cs @@ -0,0 +1,45 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors.Attack.Behaviors; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Behaviors; +using MonkeyAirship.Upgrades.BottomPath; +using MonkeyAirship.Upgrades.TopPath; + +namespace MonkeyAirship.Upgrades.MiddlePath +{ + public class TwinGuns : ModUpgrade + { + + public override int Path => MIDDLE; + public override int Tier => 2; + public override int Cost => 920; + + public override string Description => "Adds a second machine gun!"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + var attackairunitmodel = towerModel.GetBehavior(); + var machinegun2 = attackairunitmodel.Duplicate(); + machinegun2.targetProvider = new TargetCloseAirUnitModel("targetclose", false, false); + machinegun2.AddBehavior(new TargetCloseAirUnitModel("targetclose", false, false)); + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + machinegun2.weapons[0].projectile.GetDamageModel().damage = +2; + machinegun2.weapons[0].projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + } + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + machinegun2.weapons[0].projectile.pierce += 2; + } + machinegun2.weapons[0].ejectY = -10; + attackairunitmodel.weapons[0].ejectY = 10; + towerModel.AddBehavior(machinegun2); + towerModel.GetBehavior().display = CreatePrefabReference(); + + } + } +} \ No newline at end of file diff --git a/Upgrades/MiddlePath/TwinGuns-Icon.png b/Upgrades/MiddlePath/TwinGuns-Icon.png new file mode 100644 index 0000000..8e2eb1d Binary files /dev/null and b/Upgrades/MiddlePath/TwinGuns-Icon.png differ diff --git a/Upgrades/MiddlePath/TwinGuns-Portrait.png b/Upgrades/MiddlePath/TwinGuns-Portrait.png new file mode 100644 index 0000000..6714511 Binary files /dev/null and b/Upgrades/MiddlePath/TwinGuns-Portrait.png differ diff --git a/Upgrades/TopPath/Bloontonium Darts.cs b/Upgrades/TopPath/Bloontonium Darts.cs new file mode 100644 index 0000000..e62738a --- /dev/null +++ b/Upgrades/TopPath/Bloontonium Darts.cs @@ -0,0 +1,29 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Unity; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Behaviors; + +namespace MonkeyAirship.Upgrades.TopPath +{ + public class BloontoniumDarts : ModUpgrade + { + + public override int Path => TOP; + public override int Tier => 1; + public override int Cost => 950; + + public override string Description => "Bloontonium-tipped darts increases damage against all bloon types"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + var projectile = towerModel.GetBehavior().weapons[0].projectile; + projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None; + projectile.GetDamageModel().damage += 2; + towerModel.GetBehavior().display = CreatePrefabReference(); + } + } +} \ No newline at end of file diff --git a/Upgrades/TopPath/BloontoniumDarts-Icon.png b/Upgrades/TopPath/BloontoniumDarts-Icon.png new file mode 100644 index 0000000..82086e2 Binary files /dev/null and b/Upgrades/TopPath/BloontoniumDarts-Icon.png differ diff --git a/Upgrades/TopPath/BloontoniumDarts-Portrait.png b/Upgrades/TopPath/BloontoniumDarts-Portrait.png new file mode 100644 index 0000000..c80f860 Binary files /dev/null and b/Upgrades/TopPath/BloontoniumDarts-Portrait.png differ diff --git a/Upgrades/TopPath/Bomber-Icon.png b/Upgrades/TopPath/Bomber-Icon.png new file mode 100644 index 0000000..8b00742 Binary files /dev/null and b/Upgrades/TopPath/Bomber-Icon.png differ diff --git a/Upgrades/TopPath/Bomber-Portrait.png b/Upgrades/TopPath/Bomber-Portrait.png new file mode 100644 index 0000000..a00b309 Binary files /dev/null and b/Upgrades/TopPath/Bomber-Portrait.png differ diff --git a/Upgrades/TopPath/Bomber.cs b/Upgrades/TopPath/Bomber.cs new file mode 100644 index 0000000..f4d4214 --- /dev/null +++ b/Upgrades/TopPath/Bomber.cs @@ -0,0 +1,66 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Unity; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using Assets.Scripts.Models.Towers.Weapons.Behaviors; +using Assets.Scripts.Models.GenericBehaviors; +using Assets.Scripts.Models.Towers.Behaviors.Emissions; +using MonkeyAirship.Upgrades.MiddlePath; +using MonkeyAirship.Upgrades.BottomPath; +using MonkeyAirship.Displays; +using Assets.Scripts.Models.Towers.Behaviors; + +namespace MonkeyAirship.Upgrades.TopPath +{ + public class Bomber : ModUpgrade + { + + public override int Path => TOP; + public override int Tier => 3; + public override int Cost => 2100; + + public override string Description => "Drops bombs on nearby bloons that stuns them temporarily"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + if (towerModel.tier == 3) + { + var bombbehavior = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).Duplicate(); + var attackairunitmodel = towerModel.GetBehavior(); + var bomb = bombbehavior.weapons[0]; + bomb.projectile.AddBehavior(new DamageModel("dummy", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None)); + bomb.projectile.GetDamageModel().CapDamage(0); + bomb.RemoveBehavior(); + var emissionovertimemodel = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).weapons[0].emission.Duplicate(); + bomb.emission = new SingleEmmisionTowardsTargetModel("targetbloons", null, 0); + bomb.rate = .85f; + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + bomb.rate *= .66f; + } + bomb.projectile.GetBehavior().timeToTake = 2.1f; + var explosion = bomb.projectile.GetBehavior().projectile; + explosion.GetBehavior().damage = 7; + explosion.AddBehavior(new DamageModifierForTagModel("ceramic", "Ceramic", 1, 3, false, true)); + explosion.AddBehavior(new DamageModifierForTagModel("fortified", "Fortified", 1, 3, false, true)); + explosion.radius *= .7f; + var stun = Game.instance.model.GetTowerFromId("BombShooter-400").GetDescendant().Duplicate(); + var stuntag = Game.instance.model.GetTowerFromId("BombShooter-400").GetDescendant().Duplicate(); + explosion.collisionPasses = new[] { -1, 0 }; + explosion.AddBehavior(stun); + explosion.AddBehavior(stuntag); + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + explosion.pierce += 8; + explosion.radius += 3; + } + + bomb.projectile.GetBehavior().positionOffset += new Assets.Scripts.Simulation.SMath.Vector3(0, 0, 5); + towerModel.AddBehavior(bombbehavior); + towerModel.GetBehavior().display = CreatePrefabReference(); + } + } + } +} \ No newline at end of file diff --git a/Upgrades/TopPath/Devastator-Icon.png b/Upgrades/TopPath/Devastator-Icon.png new file mode 100644 index 0000000..5949bed Binary files /dev/null and b/Upgrades/TopPath/Devastator-Icon.png differ diff --git a/Upgrades/TopPath/Devastator-Portrait.png b/Upgrades/TopPath/Devastator-Portrait.png new file mode 100644 index 0000000..e07e8d8 Binary files /dev/null and b/Upgrades/TopPath/Devastator-Portrait.png differ diff --git a/Upgrades/TopPath/Devastator.cs b/Upgrades/TopPath/Devastator.cs new file mode 100644 index 0000000..e01b90c --- /dev/null +++ b/Upgrades/TopPath/Devastator.cs @@ -0,0 +1,100 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Unity; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using Assets.Scripts.Models.Towers.Weapons.Behaviors; +using Assets.Scripts.Models.Behaviors; +using Assets.Scripts.Models; +using Assets.Scripts.Simulation.Behaviors; +using Assets.Scripts.Models.GenericBehaviors; +using Assets.Scripts.Models.Towers.Behaviors.Emissions; +using Assets.Scripts.Models.Towers.Behaviors; +using Assets.Scripts.Models.Towers.Weapons; +using Assets.Scripts.Simulation.Towers.Emissions; +using MonkeyAirship.Upgrades.TopPath; +using MonkeyAirship.Upgrades.MiddlePath; +using MonkeyAirship.Upgrades.BottomPath; +using Assets.Scripts.Models.Towers.Behaviors.Attack.Behaviors; +using MonkeyAirship.Displays; + +namespace MonkeyAirship.Upgrades.TopPath +{ + public class Devastator : ModUpgrade + { + + public override int Path => TOP; + public override int Tier => 5; + public override int Cost => 38500; + + public override string Description => "Improved bombs stun and weaken all bloons in radius, including Moab-class bloons!"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + if (towerModel.tier == 5) + { + var bombbehavior = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).Duplicate(); + var attackairunitmodel = towerModel.GetBehavior(); + var mortar500 = Game.instance.model.GetTowerFromId("MortarMonkey-500").Duplicate(); + var bomb = bombbehavior.weapons[0]; + bomb.projectile.AddBehavior(new DamageModel("dummy", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None)); + bomb.projectile.GetDamageModel().CapDamage(0); + bomb.projectile.GetBehavior().effectModel.assetId = new Assets.Scripts.Utils.PrefabReference() { guidRef = "b1324f2f4c3809643b7ef1d8c112442a" }; + bomb.projectile.GetBehavior().effectModel.scale = .6f; + + bomb.RemoveBehavior(); + var emissionovertimemodel = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).weapons[0].emission.Duplicate(); + bomb.emission = new SingleEmmisionTowardsTargetModel("targetbloons", null, 0); + bomb.rate = .85f; + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + bomb.rate *= .66f; + } + bomb.projectile.GetBehavior().timeToTake = 2.1f; + + + var explosion = mortar500.GetAttackModel().weapons[0].projectile.GetBehaviors()[0].projectile.Duplicate(); + explosion.radius *= .8f; + explosion.pierce = 75; + explosion.GetBehavior().damage = 8; + explosion.AddBehavior(new DamageModifierForTagModel("fortified", "Fortified", 1, 3, false, true)); + explosion.AddBehavior(new DamageModifierForTagModel("Ceramic", "Ceramic", 1, 6, false, true)); + explosion.GetBehavior().maxDamage = 999999; + explosion.GetBehavior().CapDamage(999999); + + var superbrittle = Game.instance.model.GetTowerFromId("IceMonkey-500").GetDescendant(); + superbrittle.perHitDamageAddition = 2; + + var moabstun = Game.instance.model.GetTowerFromId("BombShooter-500").GetDescendant().Duplicate(); + moabstun.lifespan *= .15f; + var stun = Game.instance.model.GetTowerFromId("BombShooter-400").GetDescendant().Duplicate(); + var stuntag = Game.instance.model.GetTowerFromId("BombShooter-400").GetDescendant().Duplicate(); + explosion.collisionPasses = new[] { -1, 0 }; + + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + moabstun.lifespan *= 1.2f; + explosion.radius += 10; + } + + explosion.AddBehavior(stun); + explosion.AddBehavior(stuntag); + explosion.AddBehavior(moabstun); + explosion.AddBehavior(superbrittle); + + + bomb.projectile.GetBehavior().projectile = explosion; + + towerModel.AddBehavior(bombbehavior); + towerModel.GetBehaviors()[0].weapons[0].projectile.display = CreatePrefabReference(); + towerModel.GetBehaviors()[0].weapons[0].projectile.pierce += 25; + towerModel.GetBehaviors()[0].weapons[0].projectile.GetDamageModel().damage += 5; + towerModel.GetBehaviors()[0].weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("ceramic", "Ceramic", 1, 4, false, true)); + towerModel.GetBehaviors()[0].weapons[0].projectile.AddBehavior(new DamageModifierForTagModel("fortified", "Fortified", 1, 2, false, true)); + towerModel.GetBehavior().display = CreatePrefabReference(); + + } + } + } +} \ No newline at end of file diff --git a/Upgrades/TopPath/Heavy Bomber.cs b/Upgrades/TopPath/Heavy Bomber.cs new file mode 100644 index 0000000..6c82b2e --- /dev/null +++ b/Upgrades/TopPath/Heavy Bomber.cs @@ -0,0 +1,77 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Unity; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using Assets.Scripts.Models.Towers.Weapons.Behaviors; +using Assets.Scripts.Models.Behaviors; +using Assets.Scripts.Models; +using Assets.Scripts.Simulation.Behaviors; +using Assets.Scripts.Models.GenericBehaviors; +using Assets.Scripts.Models.Towers.Behaviors.Emissions; +using Assets.Scripts.Models.Towers.Behaviors; +using Assets.Scripts.Models.Towers.Weapons; +using Assets.Scripts.Simulation.Towers.Emissions; +using MonkeyAirship.Upgrades.TopPath; +using MonkeyAirship.Upgrades.MiddlePath; +using MonkeyAirship.Upgrades.BottomPath; +using MonkeyAirship.Displays; + +namespace MonkeyAirship.Upgrades.TopPath +{ + public class HeavyBomber : ModUpgrade + { + + public override int Path => TOP; + public override int Tier => 4; + public override int Cost => 6200; + + public override string Description => "Upgraded bombs have deal more damage and weaken nearby bloons"; + + public override void ApplyUpgrade(TowerModel towerModel) + { + if (towerModel.tier == 4) + { + var bombbehavior = Game.instance.model.GetTowerFromId("MonkeyAce-030").GetAttackModel(1).Duplicate(); + var bomb = bombbehavior.weapons[0]; + bomb.projectile.AddBehavior(new DamageModel("dummy", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None)); + bomb.projectile.GetDamageModel().CapDamage(0); + bomb.RemoveBehavior(); + bomb.emission = new SingleEmmisionTowardsTargetModel("targetbloons", null, 0); + bomb.rate = .85f; + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + bomb.rate *= .66f; + } + bomb.projectile.GetBehavior().timeToTake = 2.1f; + var explosion = bomb.projectile.GetBehavior().projectile; + explosion.radius *= .7f; + explosion.GetBehavior().damage = 8; + explosion.GetBehavior().maxDamage = 999999; + explosion.GetBehavior().CapDamage(999999); + + var stun = Game.instance.model.GetTowerFromId("BombShooter-400").GetDescendant().Duplicate(); + var stuntag = Game.instance.model.GetTowerFromId("BombShooter-400").GetDescendant().Duplicate(); + explosion.AddBehavior(Game.instance.model.GetTowerFromId("IceMonkey-400").GetDescendant()); + stun.lifespan = 1.5f; + explosion.collisionPasses = new[] { -1, 0 }; + explosion.AddBehavior(stun); + explosion.AddBehavior(stuntag); + explosion.pierce = 50; + + + if (towerModel.appliedUpgrades.Contains(UpgradeID())) + { + explosion.pierce += 8; + explosion.radius += 5; + } + + bomb.projectile.GetBehavior().positionOffset += new Assets.Scripts.Simulation.SMath.Vector3(0, 0, 0); + towerModel.AddBehavior(bombbehavior); + towerModel.GetBehavior().display = CreatePrefabReference(); + + } + } + } +} \ No newline at end of file diff --git a/Upgrades/TopPath/HeavyBomber-Icon.png b/Upgrades/TopPath/HeavyBomber-Icon.png new file mode 100644 index 0000000..e861e5c Binary files /dev/null and b/Upgrades/TopPath/HeavyBomber-Icon.png differ diff --git a/Upgrades/TopPath/HeavyBomber-Portrait.png b/Upgrades/TopPath/HeavyBomber-Portrait.png new file mode 100644 index 0000000..51e24d7 Binary files /dev/null and b/Upgrades/TopPath/HeavyBomber-Portrait.png differ diff --git a/Upgrades/TopPath/Mobile Reconnaissance.cs b/Upgrades/TopPath/Mobile Reconnaissance.cs new file mode 100644 index 0000000..8d60496 --- /dev/null +++ b/Upgrades/TopPath/Mobile Reconnaissance.cs @@ -0,0 +1,42 @@ +using Assets.Scripts.Models.Towers; +using BTD_Mod_Helper.Api.Towers; +using BTD_Mod_Helper.Extensions; +using Assets.Scripts.Models.Towers.Behaviors.Attack; +using Assets.Scripts.Unity; +using Assets.Scripts.Models.Towers.Filters; +using Assets.Scripts.Models.Towers.Weapons.Behaviors; +using Assets.Scripts.Models.Towers.Weapons; +using UnhollowerBaseLib; +using Assets.Scripts.Models.Towers.Projectiles.Behaviors; +using Assets.Scripts.Models.Towers.Behaviors; +using MonkeyAirship.Displays; + +namespace MonkeyAirship.Upgrades.TopPath + +{ + public class MobileReconnaissance : ModUpgrade + { + + public override int Path => TOP; + public override int Tier => 2; + public override int Cost => 540; + + public override string Description => "Mobile Reconnaissance allows Monkey Airship to pop and reveal nearby Camo bloons."; + + public override void ApplyUpgrade(TowerModel towerModel) + { + var attackairunitmodel = towerModel.GetBehavior(); + attackairunitmodel.GetDescendants().ForEach(model => model.isActive = false); + var firefromairunitmodel = attackairunitmodel.weapons[0].GetBehavior(); + var decamo = Game.instance.model.GetTower(TowerType.WizardMonkey, 0, 0, 3).GetAttackModel(1).Duplicate(); + decamo.weapons[0].behaviors = new Il2CppReferenceArray(new WeaponBehaviorModel[] {firefromairunitmodel}); + decamo.weapons[0].rate = .6f; + decamo.weapons[0].projectile.display = new Assets.Scripts.Utils.PrefabReference() { guidRef = "" }; + decamo.weapons[0].projectile.radius = 50; + decamo.weapons[0].projectile.AddBehavior(new DamageModel("", 0, 0, false, false, false, BloonProperties.None, BloonProperties.None)); + attackairunitmodel.AddBehavior(decamo); + attackairunitmodel.addsToSharedGrid = true; + towerModel.GetBehavior().display = CreatePrefabReference(); + } + } +} \ No newline at end of file diff --git a/Upgrades/TopPath/MobileReconnaissance-Icon.png b/Upgrades/TopPath/MobileReconnaissance-Icon.png new file mode 100644 index 0000000..61cf35d Binary files /dev/null and b/Upgrades/TopPath/MobileReconnaissance-Icon.png differ diff --git a/Upgrades/TopPath/MobileReconnaissance-Portrait.png b/Upgrades/TopPath/MobileReconnaissance-Portrait.png new file mode 100644 index 0000000..2f1dadb Binary files /dev/null and b/Upgrades/TopPath/MobileReconnaissance-Portrait.png differ