Skip to content

Commit d494888

Browse files
committed
Added ColoredDrillArrows
1 parent db53ca0 commit d494888

9 files changed

Lines changed: 91 additions & 2 deletions

File tree

AdditionalVariants/AdditionalVariantsModule.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ public override void OnVariantsRegister(VariantManager manager, bool noPerPlayer
199199
var unfairAutobalance = manager.AddVariant(unfairAutobalanceInfo);
200200
// manager.AddVariant(arrowFallingUp);
201201

202-
// manager.CreateLinks(atomicArrow, drillingArrow);
203202
manager.CreateLinks(bottomlessQuiver, manager.MatchVariants.NoQuivers);
204203
manager.CreateLinks(bottomlessQuiver, manager.MatchVariants.SmallQuivers);
205204
manager.CreateLinks(annoyingMage, manager.MatchVariants.DarkPortals);

AdditionalVariants/Core/UnfairAutobalance.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private static void GetSpawnShield_patch(ILContext il)
100100
}
101101
}
102102

103-
public static bool HasOnePlayerCrown(Session session)
103+
private static bool HasOnePlayerCrown(Session session)
104104
{
105105
var amount = TFGame.PlayerAmount;
106106

BartizanMod.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdditionalVariants", "Addit
99
EndProject
1010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaronMode", "BaronMode\BaronMode.csproj", "{49EB7057-D949-43BA-9B16-FEB73F028FC3}"
1111
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColoredDrillArrows", "ColoredDrillArrows\ColoredDrillArrows.csproj", "{CFF25A4B-2CA6-440A-ABD2-C886AD4641F0}"
13+
EndProject
1214
Global
1315
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1416
Debug|Any CPU = Debug|Any CPU
@@ -30,5 +32,9 @@ Global
3032
{49EB7057-D949-43BA-9B16-FEB73F028FC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
3133
{49EB7057-D949-43BA-9B16-FEB73F028FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
3234
{49EB7057-D949-43BA-9B16-FEB73F028FC3}.Release|Any CPU.Build.0 = Release|Any CPU
35+
{CFF25A4B-2CA6-440A-ABD2-C886AD4641F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36+
{CFF25A4B-2CA6-440A-ABD2-C886AD4641F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
37+
{CFF25A4B-2CA6-440A-ABD2-C886AD4641F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
38+
{CFF25A4B-2CA6-440A-ABD2-C886AD4641F0}.Release|Any CPU.Build.0 = Release|Any CPU
3339
EndGlobalSection
3440
EndGlobal
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="..\..\..\Fortrise.targets" />
3+
<PropertyGroup>
4+
<TargetFramework>net472</TargetFramework>
5+
<LangVersion>11</LangVersion>
6+
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
7+
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
8+
<OutputPath>..\..\..\Mods\ColoredDrillArrows</OutputPath>
9+
</PropertyGroup>
10+
11+
12+
<ItemGroup>
13+
<Content Include="Content/Atlas/**/*">
14+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
15+
</Content>
16+
</ItemGroup>
17+
</Project>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System;
2+
using ColoredDrillArrows.Hooks;
3+
using FortRise;
4+
using MonoMod.ModInterop;
5+
6+
namespace ColoredDrillArrows;
7+
8+
[Fort("com.teuria.ColoredDrillArrows", "ColoredDrillArrows")]
9+
public class ColoredDrillArrowsModule : FortModule
10+
{
11+
public static ColoredDrillArrowsModule Instance;
12+
13+
public ColoredDrillArrowsModule()
14+
{
15+
Instance = this;
16+
}
17+
18+
public override void LoadContent() {}
19+
20+
public override void Load()
21+
{
22+
DrillArrow.Load();
23+
}
24+
25+
public override void Unload()
26+
{
27+
DrillArrow.Unload();
28+
}
29+
}
263 Bytes
Loading
130 Bytes
Loading
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using FortRise;
3+
using Monocle;
4+
using MonoMod.Utils;
5+
using TowerFall;
6+
7+
namespace ColoredDrillArrows.Hooks;
8+
9+
public static class DrillArrow
10+
{
11+
public static void Load()
12+
{
13+
On.TowerFall.DrillArrow.InitGraphics += InitGraphics_patch;
14+
}
15+
16+
public static void Unload()
17+
{
18+
On.TowerFall.DrillArrow.InitGraphics -= InitGraphics_patch;
19+
}
20+
21+
private static void InitGraphics_patch(On.TowerFall.DrillArrow.orig_InitGraphics orig, TowerFall.DrillArrow self)
22+
{
23+
orig(self);
24+
var dynSelf = DynamicData.For(self);
25+
var normalSprite = dynSelf.Get<Sprite<int>>("normalSprite");
26+
var buriedImage = dynSelf.Get<Image>("buriedImage");
27+
28+
normalSprite.Color = ArcherData.Archers[self.CharacterIndex].ColorB;
29+
buriedImage.Color = ArcherData.Archers[self.CharacterIndex].ColorB;
30+
}
31+
}

ColoredDrillArrows/meta.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "ColoredDrillArrows",
3+
"version": "1.0.0",
4+
"author": "Teuria",
5+
"description": "Add colors to the Drill Arrows by player index",
6+
"dll": "ColoredDrillArrows.dll"
7+
}

0 commit comments

Comments
 (0)