Skip to content

Commit

Permalink
Add Swarms PVE mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Its-Haze committed Jul 18, 2024
1 parent ee28d59 commit 2376af5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
39 changes: 39 additions & 0 deletions league_rpc/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,45 @@ def main(cli_args: argparse.Namespace) -> None:
)
discord_reconnect_attempt(rpc=rpc)
time.sleep(10)

elif gamemode == "Swarm - PVE":
# Swarm PVE RPC
skin_asset: str = get_skin_asset(
champion_name=champ_name,
skin_id=skin_id,
)
print(
f"{Color.green}Successfully gathered all data. Updating your Presence now!{Color.reset}"
)
while player_state() == "InGame":
large_text = (
f"{skin_name} ({chroma_name})"
if chroma_name
else (
skin_name
if skin_name
else CHAMPION_NAME_CONVERT_MAP.get(
champ_name, champ_name
)
)
)
try:
rpc.update( # type:ignore
large_image=skin_asset,
large_text=large_text,
details=gamemode,
state=f"In Game {f'· {get_creepscore()} · lvl: {get_level()} · gold: {get_gold()}' if not cli_args.no_stats else ''}",
small_image=LEAGUE_OF_LEGENDS_LOGO,
small_text=SMALL_TEXT,
start=int(time.time())
- get_current_ingame_time(default_time=start_time),
)
except RuntimeError:
print(
f"{Color.red}Discord seems to be closed, will attempt to reconnect!{Color.reset}"
)
discord_reconnect_attempt(rpc=rpc)
time.sleep(10)
else:
# LEAGUE RPC
skin_asset = get_skin_asset(
Expand Down
2 changes: 1 addition & 1 deletion league_rpc/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Set version number of package."""

__version__ = "v2.2.0"
__version__ = "v2.3.0"
import requests

RELEASES_PAGE = "https://github.com/Its-Haze/league-rpc/releases"
Expand Down
2 changes: 1 addition & 1 deletion league_rpc/champion.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def gather_ingame_information() -> tuple[str, str, str, int, str, int, int]:
champion_name, skin_id, skin_name, chroma_name = gather_league_data(
parsed_data=parsed_data, summoners_name=your_summoner_name
)
if game_mode == "Arena":
if game_mode in ("Arena", "Swarm - PVE"):
level, gold = get_level(), get_gold()
print("-" * 50)
if champion_name:
Expand Down
4 changes: 3 additions & 1 deletion league_rpc/utils/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

BASE_SKIN_URL = "https://ddragon.leagueoflegends.com/cdn/img/champion/tiles/"

BASE_MAP_ICON_URL = "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/content/src/leagueclient/gamemodeassets/{map_name}/img/game-select-icon-hover.png"
BASE_MAP_ICON_URL = "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/content/src/leagueclient/gamemodeassets/{map_name}/img/game-select-icon-active.png"

PROFILE_ICON_BASE_URL = (
"https://raw.communitydragon.org/latest/game/assets/ux/summonericons/profileicon"
Expand All @@ -39,6 +39,7 @@
21: "gamemodex",
22: "tft",
30: "cherry",
33: "strawberry",
}


Expand All @@ -50,6 +51,7 @@
"URF": "Summoner's Rift (URF)",
"NEXUSBLITZ": "Nexux Blitz",
"CHERRY": "Arena",
"STRAWBERRY": "Swarm - PVE",
"TUTORIAL_MODULE_3": "Summoner's Rift (Tutorial)",
"TUTORIAL_MODULE_2": "Summoner's Rift (Tutorial)",
"TUTORIAL_MODULE_1": "Summoner's Rift (Tutorial)",
Expand Down

0 comments on commit 2376af5

Please sign in to comment.