Skip to content

Commit

Permalink
version 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mend-dev committed Oct 20, 2024
1 parent 9321ab0 commit e71a29a
Show file tree
Hide file tree
Showing 430 changed files with 30,292 additions and 3,882 deletions.
File renamed without changes.
File renamed without changes.
17 changes: 11 additions & 6 deletions Util/ArtifactUtil.cs → Artifact/ArtifactUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,31 @@
using System;
using Il2CppAssets.Scripts.Unity.UI_New.InGame;

namespace BTD6Rogue;
namespace BTD6Rogue.Artifacts;

public static class ArtifactUtil {
public static class ArtifactUtil
{

public static RogueArtifact[] GetThreeArtifacts() {
public static RogueArtifact[] GetThreeArtifacts()
{
List<RogueArtifact> artifacts = new List<RogueArtifact>();

for (int i = 0; i < 3; i++) {
for (int i = 0; i < 3; i++)
{
artifacts.Add(GetRandomArtifact());
}

return artifacts.ToArray();
}

public static RogueArtifact GetRandomArtifact() {
public static RogueArtifact GetRandomArtifact()
{
List<RogueArtifact> artifacts = ModContent.GetContent<RogueArtifact>();
Random random = new Random();
int artifactId = random.Next(artifacts.Count);

while (!artifacts[artifactId].CanGetArtifact(InGame.instance)) {
while (!artifacts[artifactId].CanGetArtifact(InGame.instance))
{
artifactId = random.Next(artifacts.Count);
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions Artifact/Consumables/RogueConsumable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
namespace BTD6Rogue.Artifacts.Consumables;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
56 changes: 54 additions & 2 deletions BTD6Rogue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,57 @@

namespace BTD6Rogue;

public partial class BTD6Rogue : BloonsTD6Mod {
}
// Handles the creation of the RogueGame instance and logging
// Outside of this functionality, BTD6Rogue should not be used to keep code organized
public class BTD6Rogue : BloonsTD6Mod {

// Static instance of BTD6 Rogue, makes it easy to access lol
public static BTD6Rogue mod = null!;
public static FileManager fileManager = new FileManager();
public static PlayerStats playerStats = fileManager.LoadPlayerStats();

// Static instance of the current game
// Should only be assigned when starting/loading a game
// Unassigned when ending/exiting a game
public static RogueGame rogueGame = null!;

public override void OnApplicationStart() {
mod = this; // Only ever assign the static instance of mod in this function, never change it anywhere else
LogMessage("Successfully Loaded!", "BTD6Rogue", ErrorLevels.Info); // Inform the user that the mod has successfully loaded
}

public override void OnApplicationQuit() {
fileManager.SavePlayerStats(playerStats);
}

// Use this static function instead of ModHelper.Msg to keep the logging consistent
// Info Logs are informational logs that are meant to be read by the end user but are't disrupting the gameplay or the mod
// Warning Logs are known issues/causes of issues but won't disrupt gameplay or the mod
// Error Logs are issues that will disrupt gameplay or the mod
// Critical Logs are issues that cause crashes, extreme bugs, errors, etc
// Debug is used in development for testing, they should not be sent in release versions
public static void LogMessage(object message, object caller = null!, ErrorLevels errorLevel = ErrorLevels.Debug) {
caller ??= "null";

if (errorLevel == (ErrorLevels) 0 && RogueModSettings.LogInfoMessages) {
ModHelper.Msg<BTD6Rogue>("[BTD6Rogue-v" + ModHelperData.Version + "] (Info) " + caller + ": " + message);
} else if (errorLevel == (ErrorLevels) 1 && RogueModSettings.LogWarningMessages) {
ModHelper.Msg<BTD6Rogue>("[BTD6Rogue-v" + ModHelperData.Version + "] (Warning) " + caller + ": " + message);
} else if (errorLevel == (ErrorLevels) 2 && RogueModSettings.LogErrorMessages) {
ModHelper.Msg<BTD6Rogue>("[BTD6Rogue-v" + ModHelperData.Version + "] (Error) " + caller + ": " + message);
} else if (errorLevel == (ErrorLevels) 3 && RogueModSettings.LogCriticalMessages) {
ModHelper.Msg<BTD6Rogue>("[BTD6Rogue-v" + ModHelperData.Version + "] (Critical) " + caller + ": " + message);
} else if (errorLevel == (ErrorLevels) 4 && RogueModSettings.LogDebugMessages) {
ModHelper.Msg<BTD6Rogue>("[BTD6Rogue-v" + ModHelperData.Version + "] (Debug) " + caller + ": " + message);
}
}
}

// Error levels for logging a message with the static LogMessage function
public enum ErrorLevels : int {
Info = 0,
Warning = 1,
Error = 2,
Critical = 3,
Debug = 4,
}
70 changes: 49 additions & 21 deletions BTD6Rogue.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,57 @@
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Bloons\Brown\**" />
<Compile Remove="Bloons\Calico\**" />
<Compile Remove="Bloons\Giraffe\**" />
<Compile Remove="Bloons\Orange\**" />
<Compile Remove="Bosses\Blastapopoulos\**" />
<EmbeddedResource Remove="Bloons\Brown\**" />
<EmbeddedResource Remove="Bloons\Calico\**" />
<EmbeddedResource Remove="Bloons\Giraffe\**" />
<EmbeddedResource Remove="Bloons\Orange\**" />
<EmbeddedResource Remove="Bosses\Blastapopoulos\**" />
<None Remove="Bloons\Brown\**" />
<None Remove="Bloons\Calico\**" />
<None Remove="Bloons\Giraffe\**" />
<None Remove="Bloons\Orange\**" />
<None Remove="Bosses\Blastapopoulos\**" />
<Compile Remove=".github\**" />
<Compile Remove="Artifact\**" />
<Compile Remove="bin\**" />
<Compile Remove="Interface\Screen\**" />
<Compile Remove="obj\**" />
<Compile Remove="Portal\**" />
<EmbeddedResource Remove=".github\**" />
<EmbeddedResource Remove="Artifact\**" />
<EmbeddedResource Remove="bin\**" />
<EmbeddedResource Remove="Interface\Screen\**" />
<EmbeddedResource Remove="obj\**" />
<EmbeddedResource Remove="Portal\**" />
<None Remove=".github\**" />
<None Remove="Artifact\**" />
<None Remove="bin\**" />
<None Remove="Interface\Screen\**" />
<None Remove="obj\**" />
<None Remove="Portal\**" />
</ItemGroup>

<Import Project="..\btd6.targets" />

<ItemGroup>
<Folder Include="Artifacts\Income\" />
<Folder Include="Maps\VanillaMaps\ExpertMaps\" />
<Folder Include="Maps\VanillaMaps\BeginnerMaps\" />
<Folder Include="Maps\VanillaMaps\AdvancedMaps\" />
<Folder Include="Maps\VanillaMaps\IntermediateMaps\" />
<Compile Remove="Gamemode\Gamemodes\BlitzMode.cs" />
<Compile Remove="Interface\Panels\ArtifactChoicePanel.cs" />
<Compile Remove="Interface\Panels\InitialHeroChoicePanel.cs" />
<Compile Remove="Patch\HeroAddXpPatch.cs" />
<Compile Remove="Patch\InGame\OnMatchStartPatch.cs" />
<Compile Remove="Patch\InGame\OnRestartPatch.cs" />
<Compile Remove="Patch\InGame\OnRoundStartPatch.cs" />
<Compile Remove="Patch\IsUpgradePathClosedPatch.cs" />
<Compile Remove="Patch\ModeScreenOpenPatch.cs" />
<Compile Remove="Patch\OnCashAddedPatch.cs" />
<Compile Remove="Patch\OnMatchStartPatch.cs" />
<Compile Remove="Patch\OnRestartPatch.cs" />
<Compile Remove="Patch\OnRoundStartPatch.cs" />
<Compile Remove="Patch\OnTowerCreatedPatch.cs" />
<Compile Remove="Patch\OnUpdatePatch.cs" />
<Compile Remove="Round\RoundConfig.cs" />
<Compile Remove="Round\RoundGenerator.cs" />
<Compile Remove="Tower\TowerConfig.cs" />
</ItemGroup>

<Import Project="..\btd6.targets" />
<ItemGroup>
<Folder Include="Event\" />
<Folder Include="Data\" />
<Folder Include="Interface\Overlay\" />
<Folder Include="Resources\Data\" />
</ItemGroup>

<ItemGroup>
<None Include="BTD6Rogue.sln" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion Util/BloonUtil.cs → Bloon/BloonUtil.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BTD_Mod_Helper.Api;
using JetBrains.Annotations;

namespace BTD6Rogue;

Expand Down
72 changes: 72 additions & 0 deletions Bloon/Bosses/BossUtil.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using BTD_Mod_Helper.Api;
using System.Collections.Generic;
using System;
using BTD_Mod_Helper;

namespace BTD6Rogue;

public static class BossUtil {

public static string GetBossHint(string boss) {
List<string> BloonariusHints = new List<string>() {
"The smell of sludge and algae permeates the air",
"Swampy mists rise from an unknown presence",
"Gurgling sounds can be heard echoing loudly",
"Dampness fills the battlefield, bloons can be seen coated in a slimy sheen"
};

List<string> VortexHints = new List<string>() {
"Strong gusts of wind begin to blow sharply",
"The foilage around you begins to dance, signaling a storm is brewing",
"You feel the energy of the air currents begin to pick up",
"Water nearby ripples, responding to an unseen force from above"
};

List<string> LychHints = new List<string>() {
"A feeling of death surrounds you",
"Shadows lengthen, the land itself mourning the approach of darkness",
"An eeire chill fills the air",
"Whispers can be heard beyond your sight, a sign of dark power"
};

List<string> DreadbloonHints = new List<string>() {
"The ground shakes beneath your feet",
"The earth trembles, as if uneasy about what's to come",
"Tremors grow stronger, indicating a strong force burrowing below",
"Vibrations in the soil can be felt",
"A symphony of dirt and stone can be heard"
};

List<string> PhayzeHints = new List<string>() {
"The space around you begins to distort",
"The boundaries time are blurred",
"The fabric of reality starts shifting",
"A sudden ripple in the cosmos can be felt"
};

switch (boss) {
case "RogueBloonarius":
return BloonariusHints[new Random().Next(BloonariusHints.Count)];
case "RogueVortex":
return VortexHints[new Random().Next(VortexHints.Count)];
case "RogueLych":
return LychHints[new Random().Next(LychHints.Count)];
case "RogueDreadbloon":
return DreadbloonHints[new Random().Next(DreadbloonHints.Count)];
case "RoguePhayze":
return PhayzeHints[new Random().Next(PhayzeHints.Count)];
}
return "Error Message Lol";
}

public static RogueBoss GetBossFromBloonId(string bloonId) {
foreach (RogueBoss boss in ModContent.GetContent<RogueBoss>()) {
if (bloonId.ToLower().Contains(boss.BossName.ToLower())) {
if (boss.BossName.ToLower().Contains("mini") != bloonId.ToLower().Contains("mini")) { continue; }
return boss;
}
}

return null!;
}
}
15 changes: 15 additions & 0 deletions Bloon/Bosses/RogueBoss.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using BTD_Mod_Helper.Api;
using Il2CppAssets.Scripts.Models.Bloons;
using Il2CppAssets.Scripts.Simulation.Bloons;

namespace BTD6Rogue;

public abstract class RogueBoss : NamedModContent {
public abstract string BossName { get; }
public virtual bool IsBoss => true;

public abstract void AdjustBloonModel(BloonModel bloonModel, int tier, bool elite);
public abstract void AdjustBloon(Bloon bloon, int tier, bool elite);

public override void Register() {}
}
61 changes: 61 additions & 0 deletions Bloon/Bosses/Vanilla/BlastapopoulosBoss.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using BTD_Mod_Helper.Api.Enums;
using Il2CppAssets.Scripts.Models.Bloons.Behaviors;
using Il2CppAssets.Scripts.Models.Bloons;
using Il2CppAssets.Scripts.Simulation.Bloons;
using System.Collections.Generic;
using BTD_Mod_Helper.Extensions;
using Il2CppAssets.Scripts.Simulation.Bloons.Behaviors;
using UnityEngine;

namespace BTD6Rogue;

public class BlastapopoulosBoss : RogueBoss {
public override string BossName => "Blastapopoulos";

public static readonly float baseMaxHealth = 3000;
public static readonly float levelHealthModifier = 2.5f;

public static readonly float baseSpeed = 2f;
public static readonly float levelSpeedIncrease = 0.5f;

// RangeReductionZoneModel
public static readonly float baseRangeReduction = -0.04f;
public static readonly float levelRangeReductionAddition = -0.02f;

// AbilityCooldownZoneModel
public static readonly float baseAbilityCooldown = -0.04f;
public static readonly float levelAbilityCooldownAddition = -0.01f;

// TimeTriggerModel for RemoveDot
public static readonly float baseInterval = 4.0f;
public static readonly float levelIntervalAddition = -0.4f;

// CreatePropsOnBloonActionModel
public static readonly float baseRockDuration = 20.0f;
public static readonly float levelRockDurationAddition = 2.0f;

public override void AdjustBloonModel(BloonModel bloonModel, int tier, bool elite) {
bloonModel.maxHealth = Mathf.FloorToInt(baseMaxHealth * Mathf.Pow(levelHealthModifier, tier));
bloonModel.speed = baseSpeed + levelSpeedIncrease * tier;
bloonModel.leakDamage = 99999f;
}

public override void AdjustBloon(Bloon bloon, int tier, bool elite) {
foreach (RangeReductionZone behavior in bloon.GetBloonBehaviors<RangeReductionZone>()) {
RangeReductionZoneModel model = behavior.rangeReductionModel;
model.rangeMultiplier = (baseRangeReduction + levelRangeReductionAddition * tier);
}
foreach (AbilityCooldownZone behavior in bloon.GetBloonBehaviors<AbilityCooldownZone>()) {
AbilityCooldownZoneModel model = behavior.abilityCooldownZoneModel;
model.multiplier = (baseAbilityCooldown + levelAbilityCooldownAddition * tier);
}
foreach (TimeTrigger behavior in bloon.GetBloonBehaviors<TimeTrigger>()) {
TimeTriggerModel model = behavior.timeTriggerModel;
model.interval = (baseInterval + levelIntervalAddition * tier);
}
foreach (CreatePropsOnBloonAction behavior in bloon.GetBloonBehaviors<CreatePropsOnBloonAction>()) {
CreatePropsOnBloonActionModel model = behavior.createPropsModel;
model.rockDuration = (baseRockDuration + levelRockDurationAddition * tier);
}
}
}
Loading

0 comments on commit e71a29a

Please sign in to comment.