Skip to content

Commit

Permalink
Fix heavy core and add a vaults opened count once obtained
Browse files Browse the repository at this point in the history
  • Loading branch information
DarwinBaker committed Jun 16, 2024
1 parent 9954e2c commit aa018ce
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 24 deletions.
16 changes: 8 additions & 8 deletions AATool/Data/Objectives/Complex/HeavyCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ namespace AATool.Data.Objectives.Complex
{
public class HeavyCore : ComplexObjective
{
public const string MaceRecipe = "minecraft:recipes/combat/mace";
public const string HeavyCoreId = "minecraft:heavy_core";
public const string MaceId = "minecraft:mace";
public const string BreezeRodId = "minecraft:breeze_rod";
public const string OminousTrialKeyId = "minecraft:ominous_trial_key";
public const string OverOverkillAdvancement = "minecraft:adventure/overoverkill";

public bool ObtainedHeavyCore { get; private set; }
public bool ObtainedBreezeRod { get; private set; }
public bool MaceCrafted { get; private set; }
public bool OverOverkillComplete { get; private set; }
public int OminousVaultsOpened { get; private set; }

protected override void UpdateAdvancedState(ProgressState progress)
{
this.ObtainedHeavyCore = progress.ObtainedHeavyCore;

this.ObtainedBreezeRod = progress.WasPickedUp(BreezeRodId);
this.ObtainedHeavyCore = progress.WasPickedUp(HeavyCoreId);

this.MaceCrafted = progress.WasCrafted(MaceId);

this.OverOverkillComplete = progress.AdvancementCompleted(OverOverkillAdvancement);

this.OminousVaultsOpened = progress.TimesUsed(OminousTrialKeyId);

this.Partial = !this.OverOverkillComplete;
this.CompletionOverride = this.OverOverkillComplete || this.MaceCrafted || this.ObtainedHeavyCore;
}

protected override void ClearAdvancedState()
{
this.ObtainedHeavyCore = false;
this.ObtainedBreezeRod = false;
this.MaceCrafted = false;
this.OverOverkillComplete = false;
this.OminousVaultsOpened = 0;
}

protected override string GetShortStatus()
Expand All @@ -59,7 +59,7 @@ protected override string GetLongStatus()
return "Mace\nCrafted";

if (this.ObtainedHeavyCore)
return "Obtained\nHeavy\0Core";
return $"Obtained\nVaults:\0{this.OminousVaultsOpened}";

return "Obtain\nHeavy\0Core";
}
Expand Down
2 changes: 0 additions & 2 deletions AATool/Data/Progress/Contribution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public Contribution(Uuid Player) : base()
public Contribution(NetworkContribution network) : this(network.UUID)
{
this.Player = new Uuid(network.UUID.String);
this.ObtainedGodApple = network.ObtainedGodApple;
this.ObtainedHeavyCore = network.ObtainedHeavyCore;

//add advancements
foreach (KeyValuePair<string, DateTime> advancement in network.Advancements)
Expand Down
2 changes: 0 additions & 2 deletions AATool/Data/Progress/NetworkContribution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public class NetworkContribution
[JsonProperty] public Dictionary<string, int> Kill { get; set; }

[JsonProperty] public bool ObtainedGodApple { get; set; }
[JsonProperty] public bool ObtainedHeavyCore { get; set; }

[JsonIgnore]
private static readonly HashSet<string> TrackedStats = new () {
Expand Down Expand Up @@ -69,7 +68,6 @@ public NetworkContribution(Contribution contribution) : this()
{
this.UUID = contribution.Player;
this.ObtainedGodApple = contribution.ObtainedGodApple;
this.ObtainedHeavyCore = contribution.ObtainedHeavyCore;

//add advancements
foreach (KeyValuePair<string, Completion> advancement in contribution.Advancements)
Expand Down
1 change: 0 additions & 1 deletion AATool/Data/Progress/ProgressState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public abstract class ProgressState
public double KilometersFlown { get; set; }

public bool ObtainedGodApple { get; set; }
public bool ObtainedHeavyCore { get; set; }
public bool ObtainedLapis { get; set; }

public int Deaths { get; set; }
Expand Down
2 changes: 0 additions & 2 deletions AATool/Data/Progress/WorldState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public WorldState(NetworkState state) : this()

//enchanted golden apple
this.ObtainedGodApple |= contribution.ObtainedGodApple;
//heavy core
this.ObtainedHeavyCore |= contribution.ObtainedHeavyCore;
//lapis
this.ObtainedLapis |= contribution.ObtainedLapis;
}
Expand Down
4 changes: 2 additions & 2 deletions AATool/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.7.4.0")]
[assembly: AssemblyFileVersion("1.7.4.0")]
[assembly: AssemblyVersion("1.7.4.1")]
[assembly: AssemblyFileVersion("1.7.4.1")]
[assembly: NeutralResourcesLanguage("en")]
7 changes: 0 additions & 7 deletions AATool/Saves/AdvancementsFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ protected override void Update(JsonStream json, WorldState state, Contribution c
contribution.ObtainedGodApple = true;
}

//detect heavy core from vault using mace recipe
if (this.TryGetCompletionOf(HeavyCore.MaceRecipe, json, out _))
{
state.ObtainedHeavyCore = true;
contribution.ObtainedHeavyCore = true;
}

foreach (var recipe in ArmorTrims.Recipes)
{
//detect collection of armor trims
Expand Down

0 comments on commit aa018ce

Please sign in to comment.