Skip to content

Commit

Permalink
Update 1.6.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DarwinBaker committed Apr 2, 2023
1 parent 61d0e58 commit 4686f24
Show file tree
Hide file tree
Showing 54 changed files with 501 additions and 338 deletions.
53 changes: 52 additions & 1 deletion AATool/AATool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
<Compile Include="Data\Objectives\Complex\EGap.cs" />
<Compile Include="Data\Objectives\Complex\Trident.cs" />
<Compile Include="Data\Objectives\Complex\WitherSkulls.cs" />
<Compile Include="Data\Speedrunning\StrongholdRing.cs" />
<Compile Include="Data\Progress\Completion.cs" />
<Compile Include="Data\Progress\NetworkContribution.cs" />
<Compile Include="Data\Progress\NetworkCriteriaSet.cs" />
Expand Down Expand Up @@ -527,6 +528,9 @@
<Content Include="assets\objectives\1.20 Snapshot\potions.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\ab_guide\grass_and_fern%242x2x30.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\ab_guide\all_infested_blocks%246x6x30.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -1184,6 +1188,12 @@
<Content Include="assets\sprites\blocks\cherry\cherry_wood^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\cherry\cherry_door^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\cherry\cherry_door^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\cherry\stripped_cherry_log^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -1676,6 +1686,12 @@
<Content Include="assets\sprites\blocks\dirt\grass_block^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\dirt\suspicious_gravel^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\dirt\suspicious_gravel^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\dirt\mycelium^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -2477,6 +2493,12 @@
<Content Include="assets\sprites\blocks\misc\pearlescent_froglight^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\misc\sniffer_egg^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\misc\sniffer_egg^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\misc\slime_block_new^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -2555,6 +2577,18 @@
<Content Include="assets\sprites\ab_guide\welcome\allay_fly%24100x25.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\plants\pitcher_pod^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\plants\pitcher_plant^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\plants\pitcher_pod^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\plants\pitcher_plant^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\plants\cherry_sapling^32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -2699,12 +2733,18 @@
<Content Include="assets\sprites\blocks\sandstone\suspicious_sand^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\sculk\calibrated_sculk_sensor^32%24152x24x1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\sculk\sculk_sensor_block^32%2496x24x1.25.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\sculk\sculk^32%2432x32x2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\sculk\calibrated_sculk_sensor^48%24152x24x1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\blocks\sculk\sculk_sensor_block^48%2496x24x1.25.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -2789,6 +2829,9 @@
<Content Include="assets\sprites\global\badges\glow\badge_rank_diamond_glow~1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\badges\legendary\badge_2k_text.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\badges\player_frames\player_frame_netherite.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -2861,6 +2904,12 @@
<Content Include="assets\sprites\global\criteria\animals\camel.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\animals\sniffer.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\biomes\cherry_grove.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="assets\sprites\global\criteria\mobs\silverfish^48.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -9401,7 +9450,9 @@
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="assets\sprites\global\gui\all_portals\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\MonoGame.Framework.WindowsDX.3.8.0.1641\build\MonoGame.Framework.WindowsDX.targets" Condition="Exists('..\packages\MonoGame.Framework.WindowsDX.3.8.0.1641\build\MonoGame.Framework.WindowsDX.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
110 changes: 42 additions & 68 deletions AATool/Data/Categories/AllPortals.cs
Original file line number Diff line number Diff line change
@@ -1,81 +1,16 @@
using System;
using System.Collections.Generic;
using AATool.Data.Objectives;
using AATool.Data.Speedrunning;
using Microsoft.Xna.Framework;

namespace AATool.Data.Categories
{
class StrongholdRing
{
const int Thickness = 1536;

public int StrongholdCount { get; }
public int FilledPortals { get; }
public int StartDistance { get; }
public int EndDistance { get; }

public int OptimalBlindDistance => this.StartDistance + (Thickness / 2);

public Point ReferenceStronghold { get; private set; }
public Point[] BlindEstimates { get; private set; }
public float AngleBetween { get; private set; }
public float AngleOffset { get; private set; }

public StrongholdRing(int strongholdCount, int startDistance)
{
this.BlindEstimates = new Point[strongholdCount - 1];
this.StrongholdCount = strongholdCount;
this.StartDistance = startDistance;
this.EndDistance = startDistance + Thickness;
this.AngleBetween = MathHelper.TwoPi / this.StrongholdCount;
}

public void SetReferenceStronghold(Point coords)
{
this.AngleOffset = Angle(Point.Zero, coords);
this.CalculateOptimalBlindCoordinates();
}

private void CalculateOptimalBlindCoordinates()
{
double nextAngle = this.AngleOffset + this.AngleBetween;
for (int i = 0; i < this.BlindEstimates.Length; i++)
{
nextAngle += this.AngleBetween;
this.BlindEstimates[i] = this.EstimatedBlindCoordinates(nextAngle);
}
}

public void ClearProgress()
{

}

private static float Angle(Point start, Point end)
{
return (float)Math.Atan2(end.Y - start.Y, end.X - start.X);
}

private static double Distance(Point start, Point end)
{
double deltaX = Math.Pow(end.X - start.X, 2);
double deltaY = Math.Pow(end.Y - start.Y, 2);
return (float)Math.Sqrt(deltaY + deltaX);
}

private Point EstimatedBlindCoordinates(double angle)
{
int x = (int)Math.Round(this.OptimalBlindDistance * Math.Cos(angle));
int y = (int)Math.Round(this.OptimalBlindDistance * Math.Sin(angle));
return new Point(x, y);
}
}

internal class AllPortals : Category
{
const int TotalStrongholds = 128;

static readonly List<StrongholdRing> Rings = new()
public static readonly List<StrongholdRing> Rings = new()
{
new StrongholdRing(3, 1280),
new StrongholdRing(6, 4352),
Expand All @@ -87,6 +22,12 @@ internal class AllPortals : Category
new StrongholdRing(9, 22783),
};

static readonly List<Point> TestValues = new()
{
new Point(1700, 1200),
new Point(11770, 6700),
};

public static readonly List<string> SupportedVersions = new () {
"1.16",
};
Expand All @@ -108,6 +49,15 @@ public AllPortals()

public override void LoadObjectives()
{
foreach (Point testValue in TestValues)
this.FillPortal(testValue);
}

public void FillPortal(Point coordinates)
{
StrongholdRing ring = this.ClosestRing(coordinates);
ring.FillPortal(coordinates);
this.UpdateTotals();
}

public void ClearProgress()
Expand All @@ -121,7 +71,31 @@ private void UpdateTotals()
{
this.filledPortals = 0;
foreach (StrongholdRing ring in Rings)
this.filledPortals += ring.FilledPortals;
this.filledPortals += ring.FilledPortalCount;
}

private StrongholdRing ClosestRing(Point coordinates)
{
double distanceFromOrigin = DistanceBetween(Point.Zero, coordinates);
double smallestDifference = double.MaxValue;
StrongholdRing closest = Rings[0];
for (int i = 0; i < Rings.Count; i++)
{
double ringDifference = Math.Abs(distanceFromOrigin - Rings[i].OptimalBlindDistance);
if (ringDifference < smallestDifference)
{
smallestDifference = ringDifference;
closest = Rings[i];
}
}
return closest;
}

private static double DistanceBetween(Point start, Point end)
{
double deltaX = Math.Pow(end.X - start.X, 2);
double deltaY = Math.Pow(end.Y - start.Y, 2);
return (float)Math.Sqrt(deltaY + deltaX);
}
}
}
4 changes: 4 additions & 0 deletions AATool/Data/Credits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public static class Credits
public const string Illumina = "46405168-e9ce-40a0-99a4-0b989a912c77";
public const string IlluminaName = "illumina";

//first to complete 100 hardcore runs in a row without dying
public const string Feinberg = "9a8e24df-4c85-49d6-96a6-951da84fa5c4";
public const string FeinbergName = "feinberg";

private static bool Initialized = false;

private static Dictionary<string, Credit> ByName = new Dictionary<string, Credit>();
Expand Down
15 changes: 15 additions & 0 deletions AATool/Data/Objectives/Complex/Bees.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class Bees : ComplexObjective
private const string BalancedDiet = "minecraft:husbandry/balanced_diet";
private const string TwoByTwo = "minecraft:husbandry/bred_all_animals";
private const string StickySituation = "minecraft:adventure/honey_block_slide";
private const string WaxOn = "minecraft:husbandry/wax_on";
private const string WaxOff = "minecraft:husbandry/wax_off";
private const string HoneyBottle = "honey_bottle";
private const string Bee = "minecraft:bee";

Expand All @@ -36,6 +38,8 @@ class Bees : ComplexObjective
private bool totalBeelocation;
private bool beeOurGuest;
private bool stickySituation;
private bool waxOn;
private bool waxOff;
private bool drinkHoney;
private bool breedBees;

Expand Down Expand Up @@ -98,6 +102,9 @@ public Bees() : base()
private bool CopperAndCandlesAdded => Version.TryParse(Tracker.Category.CurrentVersion,
out Version current) && current >= CavesAndCliffsPartOne;

private bool WaxAdvancementsAdded => Version.TryParse(Tracker.Category.CurrentVersion,
out Version current) && current >= CavesAndCliffsPartOne;

protected override void UpdateAdvancedState(ProgressState progress)
{
this.estimatedCount = progress.TimesPickedUp(BlockId)
Expand All @@ -122,6 +129,8 @@ protected override void UpdateAdvancedState(ProgressState progress)
this.totalBeelocation = progress.AdvancementCompleted(TotalBeelocation);
this.beeOurGuest = progress.AdvancementCompleted(BeeOurGuest);
this.stickySituation = progress.AdvancementCompleted(StickySituation);
this.waxOn = progress.AdvancementCompleted(WaxOn);
this.waxOff = progress.AdvancementCompleted(WaxOff);

this.balancedDiet = progress.AdvancementCompleted(BalancedDiet);
this.twoByTwo = progress.AdvancementCompleted(TwoByTwo);
Expand Down Expand Up @@ -163,6 +172,10 @@ private void BuildRemainingObjectiveList()
this.remainingObjectives.Add("Needs\0To\nDrink\0Honey");
if (!this.breedBees && !this.twoByTwo)
this.remainingObjectives.Add("Needs\0To\nBreed\0Bees");
if (WaxAdvancementsAdded && !this.waxOn)
this.remainingObjectives.Add("Still\0Needs\nWax\0On");
if (WaxAdvancementsAdded && !this.waxOff)
this.remainingObjectives.Add("Still\0Needs\nWax\0Off");
}
}

Expand Down Expand Up @@ -196,6 +209,8 @@ protected override void ClearAdvancedState()
this.totalBeelocation = false;
this.beeOurGuest = false;
this.stickySituation = false;
this.waxOn = false;
this.waxOff = false;
this.drinkHoney = false;

this.balancedDiet = false;
Expand Down
Loading

0 comments on commit 4686f24

Please sign in to comment.