Update 2024 Live to 2024 Season

This commit is contained in:
Cal Corum 2024-10-11 08:45:32 -05:00
parent fee00ce036
commit ccaf61e73a
4 changed files with 33 additions and 24 deletions

View File

@ -467,7 +467,7 @@ class Admins(commands.Cog):
@app_commands.checks.has_any_role('Da Commish')
async def reset_cache_command(
self, interaction: discord.Interaction, player_cache: Optional[bool] = True,
batting_cache: Optional[bool] = True, pitching_cache: Optional[bool] = True):
batting_cache: Optional[bool] = True, pitching_cache: Optional[bool] = True, team_cache: bool = True):
await interaction.response.defer()
if player_cache:
in_game.data_cache.PLAYER_CACHE = {}
@ -475,8 +475,10 @@ class Admins(commands.Cog):
in_game.data_cache.BATTINGCARD_CACHE = {}
if pitching_cache:
in_game.data_cache.PITCHINGCARD_CACHE = {}
if team_cache:
in_game.data_cache.TEAM_CACHE = {}
await interaction.edit_original_response(
content=random_gif(random.choice(['all done', 'yes sir', 'complete']))
content=random_gif(random.choice(['all done', 'yes sir', 'complete', 'finished']))
)
@commands.command(name='tc', help='Mod: Test command')
@ -532,16 +534,16 @@ class Admins(commands.Cog):
@commands.is_owner()
async def test_dropdown_command(self, ctx):
options = [
discord.SelectOption(label='2024 Live', value='17'),
discord.SelectOption(label='2018 Live', value='13'),
discord.SelectOption(label='2016 Live', value='11'),
discord.SelectOption(label='2008 Live', value='12'),
discord.SelectOption(label='2007 Live', value='07'),
discord.SelectOption(label='2006 Live', value='06'),
discord.SelectOption(label='2005 Live', value='05'),
discord.SelectOption(label='2004 Live', value='04'),
discord.SelectOption(label='2003 Live', value='03'),
discord.SelectOption(label='2002 Live', value='02'),
discord.SelectOption(label='2024 Season', value='17'),
discord.SelectOption(label='2018 Season', value='13'),
discord.SelectOption(label='2016 Season', value='11'),
discord.SelectOption(label='2008 Season', value='12'),
discord.SelectOption(label='2007 Season', value='07'),
discord.SelectOption(label='2006 Season', value='06'),
discord.SelectOption(label='2005 Season', value='05'),
discord.SelectOption(label='2004 Season', value='04'),
discord.SelectOption(label='2003 Season', value='03'),
discord.SelectOption(label='2002 Season', value='02'),
]
async def my_callback(interaction: discord.Interaction, values):

View File

@ -1544,7 +1544,7 @@ class Gameplay(commands.Cog):
@group_new_game.command(name='gauntlet', description='Start a new Gauntlet game against an AI')
@commands.has_any_role(PD_PLAYERS_ROLE_NAME)
async def new_game_gauntlet_command(
self, interaction: discord.Interaction, event_name: Literal['2024 Live', 'Super Ultra Championship'],
self, interaction: discord.Interaction, event_name: Literal['2024 Season', 'Super Ultra Championship'],
sp_card_id: int):
await interaction.response.defer()
@ -1576,7 +1576,10 @@ class Gameplay(commands.Cog):
return
this_event = e_query['events'][0]
main_team = await get_team_by_owner(interaction.user.id)
if interaction.user.id == 258104532423147520:
main_team = await get_team_by_abbrev('SKB')
else:
main_team = await get_team_by_owner(interaction.user.id)
team = await get_team_by_abbrev(f'Gauntlet-{main_team["abbrev"]}')
if not main_team:
await interaction.edit_original_response(
@ -1620,6 +1623,8 @@ class Gameplay(commands.Cog):
content=f'Yike. I\'m not sure who your next opponent is. {get_cal_user(interaction)} help plz!'
)
return
else:
logging.info(f'opponent: {opponent}')
game_code = gauntlets.get_game_code(team, this_event, this_run)
this_game = post_game({
@ -1652,6 +1657,7 @@ class Gameplay(commands.Cog):
f'{human_sp_card["team"]["sname"]}. Will you double check that before we get started?')
return
logging.info(f'Appending Human SP ({human_sp_card["player"]["p_name"]}) to all_lineups')
all_lineups.append({
'game_id': this_game.id,
'team_id': team['id'],
@ -1664,6 +1670,7 @@ class Gameplay(commands.Cog):
# Get AI Starting Pitcher
try:
logging.info(f'Getting SP for {opponent["abbrev"]}')
await interaction.edit_original_response(
content=f'Now to decide on a Starting Pitcher...'
)

View File

@ -446,7 +446,7 @@ class Players(commands.Cog):
@app_commands.checks.has_any_role(PD_PLAYERS_ROLE_NAME)
async def player_slash_command(
self, interaction: discord.Interaction, player_name: str,
cardset: Literal['All', '2024 Live', '2024 Promos', '2023 Season', '2023 Promos', '2022 Season',
cardset: Literal['All', '2024 Season', '2024 Promos', '2023 Season', '2023 Promos', '2022 Season',
'2022 Promos', '2021 Season', '2019 Season', '2018 Season', '2018 Promos', '2016 Season', '2013 Season',
'2012 Season', '2008 Season', 'Backyard Baseball', 'Mario Super Sluggers', 'Sams Choice'] = 'All'):
# min_rarity: Literal['Replacement', 'Reserve', 'Starter', 'All-Star', 'MVP'] = None):
@ -903,7 +903,7 @@ class Players(commands.Cog):
)
@app_commands.checks.has_any_role(PD_PLAYERS_ROLE_NAME)
async def gauntlet_run_command(
self, interaction: discord.Interaction, event_name: Literal['2024 Live', 'Super Ultra Championship'],
self, interaction: discord.Interaction, event_name: Literal['2024 Season', 'Super Ultra Championship'],
team_abbrev: str = None):
await interaction.response.defer()
@ -944,7 +944,7 @@ class Players(commands.Cog):
@group_gauntlet.command(name='start', description='Start a new Gauntlet run')
@app_commands.checks.has_any_role(PD_PLAYERS_ROLE_NAME)
async def gauntlet_start_command(
self, interaction: discord.Interaction, event_name: Literal['2024 Live', 'Super Ultra Championship']):
self, interaction: discord.Interaction, event_name: Literal['2024 Season', 'Super Ultra Championship']):
if 'hello' not in interaction.channel.name:
await interaction.response.send_message(
content='The draft will probably take you about 15 minutes. Why don\'t you head to your private '
@ -1017,7 +1017,7 @@ class Players(commands.Cog):
@group_gauntlet.command(name='reset', description='Wipe your current team so you can re-draft')
@app_commands.checks.has_any_role(PD_PLAYERS_ROLE_NAME)
async def gauntlet_reset_command(
self, interaction: discord.Interaction, event_name: Literal['2024 Live', 'Super Ultra Championship']):
self, interaction: discord.Interaction, event_name: Literal['2024 Season', 'Super Ultra Championship']):
await interaction.response.defer()
main_team = await get_team_by_owner(interaction.user.id)
draft_team = await get_team_by_abbrev(f'Gauntlet-{main_team["abbrev"]}')

View File

@ -225,7 +225,7 @@ RARITY = {
'Replacement': 0
}
SELECT_CARDSET_OPTIONS = [
discord.SelectOption(label='2024 Live', value='17'),
discord.SelectOption(label='2024 Season', value='17'),
discord.SelectOption(label='2024 Promos', value='18'),
discord.SelectOption(label='2023 Season', value='9'),
discord.SelectOption(label='2023 Promos', value='10'),
@ -665,7 +665,7 @@ class SelectOpenPack(discord.ui.Select):
class SelectPaperdexCardset(discord.ui.Select):
def __init__(self):
options = [
discord.SelectOption(label='2024 Live'),
discord.SelectOption(label='2024 Season'),
discord.SelectOption(label='2023 Season'),
discord.SelectOption(label='2022 Season'),
discord.SelectOption(label='2022 Promos'),
@ -705,7 +705,7 @@ class SelectPaperdexCardset(discord.ui.Select):
cardset_id = 12
elif self.values[0] == '2018 Season':
cardset_id = 13
elif self.values[0] == '2024 Live':
elif self.values[0] == '2024 Season':
cardset_id = 17
elif self.values[0] == '2024 Promos':
cardset_id = 18
@ -836,7 +836,7 @@ class SelectPaperdexTeam(discord.ui.Select):
class SelectBuyPacksCardset(discord.ui.Select):
def __init__(self, team: dict, quantity: int, pack_type_id: int, pack_embed: discord.Embed, cost: int):
options = [
discord.SelectOption(label='2024 Live'),
discord.SelectOption(label='2024 Season'),
discord.SelectOption(label='2023 Season'),
discord.SelectOption(label='2022 Season'),
discord.SelectOption(label='2021 Season'),
@ -875,7 +875,7 @@ class SelectBuyPacksCardset(discord.ui.Select):
cardset_id = 12
elif self.values[0] == '2018 Season':
cardset_id = 13
elif self.values[0] == '2024 Live':
elif self.values[0] == '2024 Season':
cardset_id = 17
self.pack_embed.description = f'{self.pack_embed.description} - {self.values[0]}'
@ -3100,7 +3100,7 @@ async def open_choice_pack(this_pack, team: dict, context, cardset_id: Optional[
params = [
('min_rarity', min_rarity), ('max_rarity', rarity_id), ('limit', 4), ('in_packs', True)
]
if 'pack_team' in this_pack:
if this_pack['pack_team'] is not None:
params.append(('franchise', this_pack['pack_team']['lname']))
if cardset_id is not None:
params.append(('cardset_id', cardset_id))