Skip to content

Commit

Permalink
1.1.6
Browse files Browse the repository at this point in the history
Disable leaderboard submission, add random cyber grind hints
  • Loading branch information
TRPG0 committed Jul 8, 2023
1 parent cc8b2c4 commit f5ad995
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 6 deletions.
2 changes: 2 additions & 0 deletions mod/ArchipelagoULTRAKILL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,11 @@
<Compile Include="Patches\AltPickUp.cs" />
<Compile Include="Patches\ChallengeManager.cs" />
<Compile Include="Patches\DualWield.cs" />
<Compile Include="Patches\EndlessGrid.cs" />
<Compile Include="Patches\FinalPit.cs" />
<Compile Include="Patches\FinalRank.cs" />
<Compile Include="Patches\GameProgressSaver.cs" />
<Compile Include="Patches\LeaderboardController.cs" />
<Compile Include="Patches\NewMovement.cs" />
<Compile Include="Patches\PlayerActivatorRelay.cs" />
<Compile Include="Patches\RocketLauncher.cs" />
Expand Down
2 changes: 1 addition & 1 deletion mod/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class Core : UKMod
{
public const string ModGUID = "trpg.archipelagoultrakill";
public const string ModName = "Archipelago";
public const string ModVersion = "1.1.5";
public const string ModVersion = "1.1.6";
public const string ModDescription = "Connect to an Archipelago server to play ULTRAKILL randomizer.";

public static ManualLogSource logger = BepInEx.Logging.Logger.CreateLogSource("Archipelago");
Expand Down
2 changes: 1 addition & 1 deletion mod/LevelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static void UpdateShopObjects()
vi.buyButton.gameObject.transform.GetChild(0).GetComponent<Text>().color = new Color(0.5882f, 0.5882f, 0.5882f);
vi.equipButton.gameObject.SetActive(false);
}
else if (int.Parse(field.GetValue(generalProgress).ToString()) == 0)
else if (int.Parse(field.GetValue(generalProgress).ToString()) == 0 && weapon.Contains("0"))
{
vi.costText.text = "<color=red>UNAVAILABLE</color>";
vi.buyButton.gameObject.transform.GetChild(0).GetComponent<Text>().text = "UNAVAILABLE";
Expand Down
78 changes: 77 additions & 1 deletion mod/LocationManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Archipelago.MultiClient.Net.Enums;
using Archipelago.MultiClient.Net.Packets;
using ArchipelagoULTRAKILL.Structures;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
Expand Down Expand Up @@ -41,6 +42,8 @@ public static class LocationManager
public static bool hardDmgWaiting = false;
public static bool soapWaiting = false;

private static System.Random Random = new System.Random();

public static List<KeyValuePair<string, UKItem>> tempItems = new List<KeyValuePair<string, UKItem>>();

public static void CheckLocation(string loc)
Expand Down Expand Up @@ -287,6 +290,53 @@ public static void GetUKItem(UKItem item, string sendingPlayer = null)
if (powerupQueue.Count > 0 && Core.playerActive && Core.inLevel && !Core.poweredUp) Core.obj.GetComponent<Core>().Invoke("AddPowerup", 1f);
}

public static void GetRandomHint()
{
if (!Multiworld.Authenticated) return;

var missing = Multiworld.Session.Locations.AllMissingLocations;
var alreadyHinted = Multiworld.Session.DataStorage.GetHints()
.Where(h => h.FindingPlayer == Multiworld.Session.ConnectionInfo.Slot)
.Select(h => h.LocationId);
var available = missing.Except(alreadyHinted).ToArray();

if (available.Any())
{
var locationId = available[Random.Next(0, available.Length)];

Multiworld.Session.Locations.ScoutLocationsAsync(true, locationId);
LocationInfoPacket info = Multiworld.Session.Locations.ScoutLocationsAsync(false, locationId).Result;

string itemColor = ColorUtility.ToHtmlStringRGB(GetUKMessageColor(Multiworld.Session.Items.GetItemName(info.Locations[0].Item)));
Color color = GetUKMessageColor(Multiworld.Session.Items.GetItemName(info.Locations[0].Item));
if (itemColor == "FFFFFF")
{
itemColor = ColorUtility.ToHtmlStringRGB(GetAPMessageColor(info.Locations[0].Flags));
color = GetAPMessageColor(info.Locations[0].Flags);
}
string playerColor = ColorUtility.ToHtmlStringRGB(colors["ap_player_other"]);
string locationColor = ColorUtility.ToHtmlStringRGB(GetUKMessageColor(Multiworld.Session.Locations.GetLocationNameFromId(info.Locations[0].Location).Substring(0, 3)));

string hint = "HINT: <color=#" + itemColor + "FF>";
hint += Multiworld.Session.Items.GetItemName(info.Locations[0].Item) + "</color> ";
if (Multiworld.Session.Players.GetPlayerName(info.Locations[0].Player) != Core.data.slot_name)
hint += "(<color=#" + playerColor + "FF>" + Multiworld.Session.Players.GetPlayerAlias(info.Locations[0].Player) + "</color>) ";
hint += "at <color=#" + locationColor + "FF>" + Multiworld.Session.Locations.GetLocationNameFromId(info.Locations[0].Location) + "</color>";

messages.Add(new Message
{
image = GetUKMessageImage(Multiworld.Session.Items.GetItemName(info.Locations[0].Item)),
color = color,
message = hint
});
if (!UIManager.displayingMessage && Core.playerActive) Core.uim.StartCoroutine("DisplayMessage");
}
else
{
Core.logger.LogWarning("No locations available to hint.");
}
}

public static void AddAPItemMessage(APItem item)
{
string itemColor = ColorUtility.ToHtmlStringRGB(GetAPMessageColor(item.type));
Expand Down Expand Up @@ -479,6 +529,10 @@ public static Color GetUKMessageColor(string itemName)
case "5-2: WAVES OF THE STARLESS SEA":
case "5-3: SHIP OF FOOLS":
case "5-4: LEVIATHAN":
case "5-1":
case "5-2":
case "5-3":
case "5-4":
case "LAYER 5: WRATH":
case "Blue Skull (0-2)":
case "Blue Skull (0-S)":
Expand All @@ -501,11 +555,17 @@ public static Color GetUKMessageColor(string itemName)
case "1-2: THE BURNING WORLD":
case "1-3: HALLS OF SACRED REMAINS":
case "1-4: CLAIR DE LUNE":
case "1-1":
case "1-2":
case "1-3":
case "1-4":
case "LAYER 1: LIMBO":
return colors["green"];
case "Knuckleblaster":
case "6-1: CRY FOR THE WEEPER":
case "6-2: AESTHETICS OF HATE":
case "6-1":
case "6-2":
case "LAYER 6: HERESY":
case "P-1: SOUL SURVIVOR":
case "P-2: WAIT OF THE WORLD":
Expand All @@ -525,27 +585,43 @@ public static Color GetUKMessageColor(string itemName)
case "0-4: A ONE-MACHINE ARMY":
case "0-5: CERBERUS":
case "OVERTURE: THE MOUTH OF HELL":
case "0-1":
case "0-2":
case "0-3":
case "0-4":
case "0-5":
return colors["orange"];
case "2-1: BRIDGEBURNER":
case "2-2: DEATH AT 20,000 VOLTS":
case "2-3: SHEER HEART ATTACK":
case "2-4: COURT OF THE CORPSE KING":
case "LAYER 2: LUST":
case "2-1":
case "2-2":
case "2-3":
case "2-4":
return colors["purple"];
case "3-1: BELLY OF THE BEAST":
case "3-2: IN THE FLESH":
case "3-1":
case "3-2":
case "LAYER 3: GLUTTONY":
return colors["bone"];
case "4-1: SLAVES TO POWER":
case "4-2: GOD DAMN THE SUN":
case "4-3: A SHOT IN THE DARK":
case "4-4: CLAIR DE SOLEIL":
case "LAYER 4: GREED":
case "4-1":
case "4-2":
case "4-3":
case "4-4":
case "Dual Wield":
return colors["yellow"];
case "Overheal":
return ColorBlindSettings.Instance.overHealColor;
case "+10,000P":
case "Sho":
return colors["gold"];
case "Hard Damage":
case "Stamina Limiter":
Expand Down
16 changes: 16 additions & 0 deletions mod/Patches/EndlessGrid.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using HarmonyLib;

namespace ArchipelagoULTRAKILL.Patches
{
[HarmonyPatch(typeof(EndlessGrid), "NextWave")]
class NextWave_Patch
{
public static void Prefix(EndlessGrid __instance)
{
if (Core.DataExists() && Multiworld.Authenticated)
{
if (__instance.currentWave != 0 && __instance.currentWave % 5 == 0) LocationManager.GetRandomHint();
}
}
}
}
18 changes: 18 additions & 0 deletions mod/Patches/LeaderboardController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using HarmonyLib;

namespace ArchipelagoULTRAKILL.Patches
{
[HarmonyPatch(typeof(LeaderboardController), "SubmitLevelScore")]
class SubmitLevelScore_Patch
{
public static bool Prefix()
{
if (Core.DataExists())
{
Core.logger.LogInfo("Current save file is randomized. Skipped leaderboard submission.");
return false;
}
else return true;
}
}
}
4 changes: 2 additions & 2 deletions mod/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.5")]
[assembly: AssemblyFileVersion("1.1.5")]
[assembly: AssemblyVersion("1.1.6")]
[assembly: AssemblyFileVersion("1.1.6")]
5 changes: 5 additions & 0 deletions package/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.1.6

- Leaderboard times can no longer be submitted while playing randomizer.
- Every 5 waves cleared in The Cyber Grind will now unlock a random hint.

## 1.1.5

- Fixed: The displays on the side of the Core Eject and Pump Charge shotguns wouldn't work.
Expand Down
2 changes: 1 addition & 1 deletion package/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Archipelago",
"version_number": "1.1.5",
"version_number": "1.1.6",
"website_url": "https://github.com/TRPG0/ArchipelagoULTRAKILL",
"description": "Connect to an Archipelago server to play ULTRAKILL randomizer.",
"dependencies": [
Expand Down

0 comments on commit f5ad995

Please sign in to comment.