Skip to content

Commit ce5a4a3

Browse files
Release
1 parent 7306837 commit ce5a4a3

11 files changed

Lines changed: 116 additions & 46 deletions

API/Behaviors/BehaviorHelper.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,19 @@ public static void ShowAddActionPopup(CustomBloonSave save, CustomBloonBehaviorT
3939

4040
List<CustomBloonBehaviorSerializable> actions = save.BloonBehaviors.Where(a => BehaviorByType[a.GetType()].Type == BehaviorType.Action || BehaviorByType[a.GetType()].Name == "Wait for Seconds Trigger").ToList();
4141

42+
if (actions.Count == 0)
43+
{
44+
PopupScreen.instance.SafelyQueue(screen =>
45+
{
46+
screen.ShowPopup(PopupScreen.Placement.menuCenter, "No Actions.", "This bloon has no actions attached. Please add an action first.", null, "Continue", null, null, Popup.TransitionAnim.Scale);
47+
});
48+
return;
49+
}
50+
4251
PopupScreen.instance.SafelyQueue(p =>
4352
{
4453
p.ShowPopup(PopupScreen.Placement.menuCenter,
45-
"Add Action", "Choose the action to add.",
54+
"Link Action", "Choose the action to link.",
4655
new Action(() => { onComplete.Invoke(actions[dropdown.Dropdown.value]); }), "Confirm", null, "Cancel", Popup.TransitionAnim.Scale, instantClose: true);
4756

4857
TaskScheduler.ScheduleTask(() =>

API/Behaviors/Triggers/HealthPercentTrigger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public override ModHelperPanel CreatePanel(CustomBloonBehaviorSerializable seria
3939
((CustomBloonBehaviorTriggerSerializable)serializable).ActionIDs.Add(behavior.GUID);
4040
UpdateScrollPanel(scrollpanel, (CustomBloonBehaviorTriggerSerializable)serializable, save);
4141
}));
42-
})).AddText(new Info("Text", 0, 0, 400, 150), "Add Action");
42+
})).AddText(new Info("Text", 0, 0, 400, 150), "Link Action", 60);
4343

4444
panel.AddText(new Info("PercentText", -237.5f, 50, 400, 150), "Percent:", 60, Il2CppTMPro.TextAlignmentOptions.Center);
4545
var input = panel.AddInputField(new Info("PercentInput", -237.5f, -75, 250, 100), $"{time.Percent}", VanillaSprites.BlueInsertPanelRound, new Action<string>(value =>

API/Behaviors/Triggers/OnDamagedTrigger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public override ModHelperPanel CreatePanel(CustomBloonBehaviorSerializable seria
4141
((CustomBloonBehaviorTriggerSerializable)serializable).ActionIDs.Add(behavior.GUID);
4242
UpdateScrollPanel(scrollpanel, (CustomBloonBehaviorTriggerSerializable)serializable, save);
4343
}));
44-
})).AddText(new Info("Text", 0, 0, 400, 150), "Add Action");
44+
})).AddText(new Info("Text", 0, 0, 400, 150), "Link Action", 60);
4545

4646
panel.AddText(new Info("CooldownText", -237.5f, 50, 400, 150), "Cooldown:", 60, Il2CppTMPro.TextAlignmentOptions.Center);
4747
var input = panel.AddInputField(new Info("CooldownInput", -237.5f, -75, 250, 100), $"{damage.Cooldown}", VanillaSprites.BlueInsertPanelRound, new Action<string>(value =>

API/Behaviors/Triggers/TimeTrigger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public override ModHelperPanel CreatePanel(CustomBloonBehaviorSerializable seria
4141
((CustomBloonBehaviorTriggerSerializable)serializable).ActionIDs.Add(behavior.GUID);
4242
UpdateScrollPanel(scrollpanel, (CustomBloonBehaviorTriggerSerializable)serializable, save);
4343
}));
44-
})).AddText(new Info("Text", 0, 0, 400, 150), "Add Action");
44+
})).AddText(new Info("Text", 0, 0, 400, 150), "Link Action", 60);
4545

4646
panel.AddText(new Info("IntervalText", -237.5f, 50, 400, 150), "Interval:", 60, Il2CppTMPro.TextAlignmentOptions.Center);
4747
var input = panel.AddInputField(new Info("IntervalInput", -237.5f, -75, 250, 100), $"{time.Interval}", VanillaSprites.BlueInsertPanelRound, new Action<string>(value =>

API/Behaviors/Triggers/TowerSoldTrigger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override ModHelperPanel CreatePanel(CustomBloonBehaviorSerializable seria
3737
((CustomBloonBehaviorTriggerSerializable)serializable).ActionIDs.Add(behavior.GUID);
3838
UpdateScrollPanel(scrollpanel, (CustomBloonBehaviorTriggerSerializable)serializable, save);
3939
}));
40-
})).AddText(new Info("Text", 0, 0, 400, 150), "Add Action");
40+
})).AddText(new Info("Text", 0, 0, 400, 150), "Link Action", 60);
4141

4242
UpdateScrollPanel(scrollpanel, (CustomBloonBehaviorTriggerSerializable)serializable, save);
4343
return panel;

API/Behaviors/Triggers/WaitForSecondsTrigger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public override ModHelperPanel CreatePanel(CustomBloonBehaviorSerializable seria
4141
((CustomBloonBehaviorTriggerSerializable)serializable).ActionIDs.Add(behavior.GUID);
4242
UpdateScrollPanel(scrollpanel, (CustomBloonBehaviorTriggerSerializable)serializable, save);
4343
}));
44-
})).AddText(new Info("Text", 0, 0, 400, 150), "Add Action");
44+
})).AddText(new Info("Text", 0, 0, 400, 150), "Link Action", 60);
4545

4646
panel.AddText(new Info("SecondsText", -237.5f, 50, 400, 150), "Time to wait:", 60, Il2CppTMPro.TextAlignmentOptions.Center);
4747
var input = panel.AddInputField(new Info("SecondsInput", -237.5f, -75, 250, 100), $"{seconds.TimeToWait}", VanillaSprites.BlueInsertPanelRound, new Action<string>(value =>

API/Serializables/CustomBloonDecal.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using Newtonsoft.Json;
1+
using Il2CppSystem.IO;
2+
using Newtonsoft.Json;
3+
using System;
24
using System.Text.Json.Serialization;
35
using UnityEngine;
46
using JsonIgnoreAttribute = Newtonsoft.Json.JsonIgnoreAttribute;
@@ -22,13 +24,17 @@ public class CustomBloonDecal
2224
[JsonInclude]
2325
public DecalType Type = DecalType.None;
2426

27+
public int OffsetX = 0;
28+
29+
public int OffsetY = 0;
30+
2531
public int GetOffsetX()
2632
{
27-
return GetSpriteOffset(Type).x + 64;
33+
return Math.Clamp(GetSpriteOffset(Type).x + 64 + OffsetX, 0, 128);
2834
}
2935
public int GetOffsetY()
3036
{
31-
return GetSpriteOffset(Type).y + 64;
37+
return Math.Clamp(GetSpriteOffset(Type).y + 64 + OffsetY, 0, 128);
3238
}
3339
public enum DecalType
3440
{

ModHelperData.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ namespace BloonFactoryMod;
33
public static class ModHelperData
44
{
55
public const string WorksOnVersion = "42.0";
6-
public const string Version = "0.5.0";
6+
public const string Version = "1.0.0";
77
public const string Name = "BloonFactoryMod";
88

9-
public const string Description = "Create your own bloons! Thanks to Manny for creating most of the beautiful decals! ";
9+
public const string Description = "Create your own bloons! Thanks to Manny for creating most of the beautiful decals!";
1010

1111
public const string RepoOwner = "Commander-Cat101";
12-
public const string RepoName = "";
12+
public const string RepoName = "BloonFactoryMod";
13+
public const string Author = "Commander__Cat";
1314
}

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,28 @@
66
BloonFactoryMod
77
</h1>
88

9-
This is an empty mod generated by BTD6 Mod Helper
9+
# How to use
1010

11-
For your mod, remember to add the GitHub topic "btd6-mod"
11+
## Selector Menu
12+
The Bloon Editor is accessed through the main menu on the left. This is where you can make your own bloons. You can import or create a bloon in here and when you are ready to edit a bloon, you just need to click the edit button. You can also export your bloons from here. When you create or import a bloon you must restart the game before it will be spawnable.
1213

13-
Features a GitHub actions setup to automatically build the mod whenever commits are pushed,
14-
and publish a release if a tag is pushed (using the LATEST.md as the body).
14+
## Actual Editor
15+
In the editor there are 4 different tabs allowing you to edit 4 different aspects of the bloon.
16+
17+
- Visuals
18+
This is where you can change how the bloon looks by changing the color. You can also add decals (sorta like stickers) to the bloon, you can change the position and color of these decals.
19+
20+
- Stats
21+
This is where you can edit the base stats of the bloon such as health, speed, and name. You can also select properties such as camo, lead, purple, ect. to add to your bloon. Along with these this is where you add the bloons child bloons. These are the bloons that the bloon spawns when it pops.
22+
23+
- Behaviors
24+
This is the most complicated part of the editor. This is where you add different behaviors that change how the bloon functions. There are 3 types of behaviors, triggers, actions, and standard behaviors. Triggers link up to actions and activate them when a certain thing happens, like a tower getting sold, or getting damaged. Actions are activated by triggers, these are things like spawning bloons, or stunning towers. Lastly, standard behaviors are behaviors that are always active, like damage reduction or giving lives on pop.
25+
26+
- Spawning
27+
This is where you can set how the bloon spawns in a match. You can add a single round group, where you can set the round, how many bloons spawn, and the spacing between them. You can also add a multi round group where the bloons will spawn each round between the start and end round with the desired settings.
28+
29+
This is my beautiful guide on how to make bloon. Yippee!
30+
31+
If you would like to share your bloons or ask questions you can on my discord! https://discord.gg/3nKPfw6mxt
1532

1633
[![Requires BTD6 Mod Helper](https://raw.githubusercontent.com/gurrenm3/BTD-Mod-Helper/master/banner.png)](https://github.com/gurrenm3/BTD-Mod-Helper#readme)

0 commit comments

Comments
 (0)