Skip to content

Commit

Permalink
simplify UpHolder();, add return in starswordmerge
Browse files Browse the repository at this point in the history
  • Loading branch information
wtffidy committed Nov 7, 2024
1 parent 1099263 commit 0048786
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
30 changes: 2 additions & 28 deletions CoreBots.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3751,35 +3751,9 @@ private void KilledDungeonMonsterListener(int monsterMapID)
public bool IsMember = false;

/// <summary>
/// Checks whether the player is Upholder
/// Checks whether the player is an Upholder
/// </summary>
public bool isUpholder()
{
string[] upholder = new string[]
{
"1st Upholder",
"2nd Upholder",
"3rd Upholder",
"4th Upholder",
"5th Upholder",
"6th Upholder",
"7th Upholder",
"8th Upholder",
"9th Upholder",
"10th Upholder",
"11th Upholder",
"12th Upholder",
"13th Upholder",
"14th Upholder",
"15th Upholder",
};

foreach (string badge in upholder)
if (HasWebBadge(badge))
return true;

return false;
}
public bool IsUpholder() => Badges.Any(badge => badge.Name.Contains("Upholder"));

/// <summary>
/// Retrieves the username from a game object or falls back to the player's username.
Expand Down
5 changes: 5 additions & 0 deletions Other/MergeShops/StarswordMerge[Upholder].cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public void ScriptMain(IScriptInterface Bot)

public void BuyAllMerge(string? buyOnlyThis = null, mergeOptionsEnum? buyMode = null)
{
if (!Core.isUpholder())
{
Core.Logger("Upholder Required.");
return;
}
DR.StoryLine();
Core.BuyItem("dragonroad", 2342, "DragonRoad Merge Access Card");
//Only edit the map and shopID here
Expand Down

0 comments on commit 0048786

Please sign in to comment.