Skip to content

Commit

Permalink
2.1.1
Browse files Browse the repository at this point in the history
- Fix shotgun alt check not working
- Fix 7-2 switch logic
- Fix classic hud secondary indicator
- Fix log not repositioning itself
  • Loading branch information
TRPG0 committed May 1, 2024
1 parent 407d51a commit a5cb28c
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 15 deletions.
8 changes: 4 additions & 4 deletions apworld/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -2480,7 +2480,7 @@ def rules(ultrakillworld):
and dashes(state, player, dash, 1)
))
if skulls:
add_rule(multiworld.get_location("7-2: Switch #2", player),
add_rule(multiworld.get_location("7-2: Switch #3", player),
lambda state: state.has("Red Skull (7-2)", player))
set_rule(multiworld.get_location("7-2: Secret Weapon", player),
lambda state: state.has_all({"Violence Switch I", "Violence Switch II", "Violence Switch III"}, player))
Expand Down Expand Up @@ -2513,9 +2513,9 @@ def rules(ultrakillworld):
# 7-3
set_rule(multiworld.get_location("7-3: Secret #5", player),
lambda state: can_slide(state, player, slide))
if challenge:
set_rule(multiworld.get_location("7-3: Become marked for death", player),
lambda state: good_weapon(state, player, fire2, arm, slide, dash, shoalt, naialt))
#if challenge: <- can cheese by going thru secret exit now
# set_rule(multiworld.get_location("7-3: Become marked for death", player),
# lambda state: good_weapon(state, player, fire2, arm, slide, dash, shoalt, naialt))
if prank:
set_rule(multiworld.get_location("7-3: Perfect Rank", player),
lambda state: good_weapon(state, player, fire2, arm, slide, dash, shoalt, naialt))
Expand Down
6 changes: 6 additions & 0 deletions mod/Components/Fire2HUD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public class Fire2HUD : MonoBehaviour
public Image sec;
public Image secGlow;
public Image alt1;
public GameObject alt1shadow;
public Image alt2;
public GameObject alt2shadow;

public float timer = 0f;

Expand Down Expand Up @@ -64,15 +66,19 @@ public void UpdateCurrentWeapon()
sec.gameObject.SetActive(false);
secGlow.gameObject.SetActive(false);
if (alt1 != null) alt1.gameObject.SetActive(false);
if (alt1shadow != null) alt1shadow.SetActive(false);
if (alt2 != null) alt2.gameObject.SetActive(false);
if (alt2shadow != null) alt2shadow.SetActive(false);
return;
}
else
{
sec.gameObject.SetActive(true);
secGlow.gameObject.SetActive(true);
if (alt1 != null) alt1.gameObject.SetActive(true);
if (alt1shadow != null) alt1shadow.SetActive(true);
if (alt2 != null) alt2.gameObject.SetActive(true);
if (alt2shadow != null) alt2shadow.SetActive(true);
}

if (CurrentIsUnlocked)
Expand Down
2 changes: 1 addition & 1 deletion mod/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Core : BaseUnityPlugin
{
public const string PluginGUID = "trpg.archipelagoultrakill";
public const string PluginName = "Archipelago";
public const string PluginVersion = "2.1.0";
public const string PluginVersion = "2.1.1";

public static string workingPath;
public static string workingDir;
Expand Down
2 changes: 1 addition & 1 deletion mod/Patches/AltPickUp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AltPickUp_GotActivated_Patch
{
public static bool Prefix(AltPickUp __instance)
{
if (Core.DataExists() && StatsManager.Instance.levelNumber != 27)
if (Core.DataExists())
{
UnityEvent unityEvent = __instance.onPickUp;
if (unityEvent != null) unityEvent.Invoke();
Expand Down
8 changes: 4 additions & 4 deletions mod/Patches/HudController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ public static void Postfix(HudController __instance)
{
Fire2HUD.Instance.alt1 = GameObject.Instantiate(__instance.weaponIcon.transform.Find("Image").gameObject, __instance.weaponIcon.transform).GetComponent<Image>();
Fire2HUD.Instance.alt1.GetComponent<CopyImage>().imgToCopy = Fire2HUD.Instance.sec;
GameObject alt1Clone = GameObject.Instantiate(__instance.weaponIcon.transform.Find("Image (1)").gameObject, __instance.weaponIcon.transform);
alt1Clone.GetComponent<CopyImage>().imgToCopy = Fire2HUD.Instance.secGlow;
Fire2HUD.Instance.alt1shadow = GameObject.Instantiate(__instance.weaponIcon.transform.Find("Image (1)").gameObject, __instance.weaponIcon.transform);
Fire2HUD.Instance.alt1shadow.GetComponent<CopyImage>().imgToCopy = Fire2HUD.Instance.secGlow;
Fire2HUD.Instance.alt1.transform.SetAsLastSibling();
if (Fire2HUD.Instance.CurrentWeapon == "?") Fire2HUD.Instance.alt1.gameObject.SetActive(false);
}
else if (__instance.altHud && __instance.colorless)
{
Fire2HUD.Instance.alt2 = GameObject.Instantiate(__instance.weaponIcon.transform.Find("Image").gameObject, __instance.weaponIcon.transform).GetComponent<Image>();
Fire2HUD.Instance.alt2.GetComponent<CopyImage>().imgToCopy = Fire2HUD.Instance.sec;
GameObject alt2Clone = GameObject.Instantiate(__instance.weaponIcon.transform.Find("Image (1)").gameObject, __instance.weaponIcon.transform);
alt2Clone.GetComponent<CopyImage>().imgToCopy = Fire2HUD.Instance.secGlow;
Fire2HUD.Instance.alt2shadow = GameObject.Instantiate(__instance.weaponIcon.transform.Find("Image (1)").gameObject, __instance.weaponIcon.transform);
Fire2HUD.Instance.alt2shadow.GetComponent<CopyImage>().imgToCopy = Fire2HUD.Instance.secGlow;
Fire2HUD.Instance.alt2.transform.SetAsLastSibling();
if (Fire2HUD.Instance.CurrentWeapon == "?") Fire2HUD.Instance.alt2.gameObject.SetActive(false);
}
Expand Down
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("2.0.7")]
[assembly: AssemblyFileVersion("2.0.7")]
[assembly: AssemblyVersion("2.1.1")]
[assembly: AssemblyFileVersion("2.1.1")]
11 changes: 8 additions & 3 deletions mod/UIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,16 @@ public static void SetLogText(string text)

public static void AdjustLogBounds()
{
if (PrefsManager.Instance.GetInt("hudType") >= 2 && Core.IsPlaying)
if (PrefsManager.Instance.GetInt("hudType") >= 2 && Core.IsInLevel)
{
log.GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width - 10, ((float)Math.Round(Screen.height * 0.77f)));
log.GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width - 10, (float)Math.Round(Screen.height * 0.77f));
logBlack.GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width - 10, (float)Math.Round(Screen.height * 0.77f));
}
else
{
log.GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width - 10, Screen.height - 10);
logBlack.GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width - 10, Screen.height - 10);
}
else log.GetComponent<RectTransform>().sizeDelta = new Vector2(Screen.width - 10, Screen.height - 10);
}

public static void FindMenuObjects()
Expand Down

0 comments on commit a5cb28c

Please sign in to comment.