From 895587ead38d7b059a706025d7ddd70225052d39 Mon Sep 17 00:00:00 2001 From: zyr17 Date: Sun, 18 Feb 2024 00:43:11 +0800 Subject: [PATCH 1/8] refactor: run all action before triggering events of one object --- src/lpsim/server/action.py | 13 +- .../character/anemo/kaedehara_kazuha_3_8.py | 23 ++-- .../server/character/dendro/baizhu_4_2.py | 9 +- src/lpsim/server/match.py | 76 ++++++----- .../server/status/character_status/base.py | 61 +++++---- src/lpsim/server/status/team_status/base.py | 3 - .../status/team_status/dendro_characters.py | 6 - .../status/team_status/pyro_characters.py | 5 - .../jsons/test_counter_reset_when_revive.json | 2 +- tests/server/patch/v43/jsons/test_gorou.json | 2 +- tests/server/patch/v44/jsons/sayu.json | 120 ++++-------------- tests/server/patch/v44/template.py | 10 +- tests/server/patch/v44/test_json_4_4.py | 6 +- 13 files changed, 138 insertions(+), 198 deletions(-) diff --git a/src/lpsim/server/action.py b/src/lpsim/server/action.py index d9dfbae0..a6a6f2c4 100644 --- a/src/lpsim/server/action.py +++ b/src/lpsim/server/action.py @@ -466,10 +466,21 @@ class GenerateRerollDiceRequestAction(ActionBase): class SkipPlayerActionAction(ActionBase): """ - Action for skipping current player action. + Action for skipping current player action. As skipping will cause action end, its + variables are the same as ActionEndAction. """ type: Literal[ActionTypes.SKIP_PLAYER_ACTION] = ActionTypes.SKIP_PLAYER_ACTION + action_label: int # Refer to PlayerActionLabels + do_combat_action: bool + position: ObjectPosition + + def get_action_end_action(self): + return ActionEndAction( + action_label=self.action_label, + do_combat_action=self.do_combat_action, + position=self.position, + ) # 25 diff --git a/src/lpsim/server/character/anemo/kaedehara_kazuha_3_8.py b/src/lpsim/server/character/anemo/kaedehara_kazuha_3_8.py index 973c7320..f20458c6 100644 --- a/src/lpsim/server/character/anemo/kaedehara_kazuha_3_8.py +++ b/src/lpsim/server/character/anemo/kaedehara_kazuha_3_8.py @@ -48,29 +48,34 @@ class Chihayaburu(ElementalSkillBase): cost: Cost = Cost(elemental_dice_color=DieColor.ANEMO, elemental_dice_number=3) def get_actions(self, match: Any) -> List[Actions]: - ret: List[Actions] = [] - # make damage - ret.append( + return [ self.attack_opposite_active( match, self.damage, self.damage_type, [self.create_character_status("Midare Ranzan: New")], - ) - ) + ), + self.charge_self(1), + ] + + def event_handler_SKILL_END( + self, event: SkillEndEventArguments, match: Any + ) -> List[SwitchCharacterAction]: + if event.action.position.id != self.id: + # not using this skill, do nothing + return [] # switch character next_character = match.player_tables[ self.position.player_idx ].next_character_idx() if next_character is not None: - ret.append( + return [ SwitchCharacterAction( player_idx=self.position.player_idx, character_idx=next_character, ) - ) - ret.append(self.charge_self(1)) - return ret + ] + return [] class KazuhaSlash(ElementalBurstBase): diff --git a/src/lpsim/server/character/dendro/baizhu_4_2.py b/src/lpsim/server/character/dendro/baizhu_4_2.py index bdf71fc7..9d1d6f2f 100644 --- a/src/lpsim/server/character/dendro/baizhu_4_2.py +++ b/src/lpsim/server/character/dendro/baizhu_4_2.py @@ -127,8 +127,13 @@ def event_handler_MAKE_DAMAGE( ): # not our team status, or not equipped return [] - source = match.get_object(source_position) - if source.name != "Seamless Shield": + # shield should be moved to trashbin, found it in trashbin + source = None + for obj in match.trashbin: + if obj.id == source_position.id: + source = obj + # source = match.get_object(source_position, ActionTypes.MAKE_DAMAGE) + if source is None or source.name != "Seamless Shield": # not our shield return [] # create dice diff --git a/src/lpsim/server/match.py b/src/lpsim/server/match.py index f0ac2875..8499a25e 100644 --- a/src/lpsim/server/match.py +++ b/src/lpsim/server/match.py @@ -485,6 +485,21 @@ def _save_history(self) -> None: if len(self._history) > 2: self._history = [self._history[0], self._history[-1]] + def _record_last_action_history(self): + """ + Record history based on last action. + When history level is 0, no information will be recorded. + With higher history level, more information will be recorded. + By default, all actions have history level 100. + """ + if ( + self.config.history_level >= self.last_action.record_level + and self.last_action.type != ActionTypes.EMPTY + ): # pragma: no cover + self._save_history() + # after potential history recording, reset last action + self.last_action = ActionBase() + def _debug_save_appeared_object_names_to_file(self): # pragma: no cover # save appeared object names and descs if self._debug_save_file_name == "": @@ -565,7 +580,7 @@ def _save_random_state(self): """ Save the random state. """ - self.random_state = list(self._random_state.get_state(legacy=True)) # type: ignore + self.random_state = list(self._random_state.get_state(legacy=True)) self.random_state[1] = self.random_state[1].tolist() def _random(self): @@ -799,19 +814,7 @@ def step(self, run_continuously: bool = True) -> bool: self._round_start() else: raise NotImplementedError(f"Match state {self.state} not implemented.") - """ - Record history. - When history level is 0, no information will be recorded. - With higher history level, more information will be recorded. - By default, all actions have history level 100. - """ - if ( - self.config.history_level >= self.last_action.record_level - and self.last_action.type != ActionTypes.EMPTY - ): # pragma: no cover - self._save_history() - # after potential history recording, reset last action - self.last_action = ActionBase() + self._record_last_action_history() if self._debug_save_appeared_object_names: # pragma: no cover self._debug_save_appeared_object_names_to_file() if len(self.requests) or not run_continuously: @@ -911,11 +914,22 @@ def _next_action(self): while len(self.event_frames): event_frame = self.event_frames[-1] if len(event_frame.triggered_actions): - # do one action - activated_action = event_frame.triggered_actions.pop(0) - logging.info(f"Action activated: {activated_action}") - event_args = self._act(activated_action) - self._stack_events(event_args) + if event_frame.processing_event is None: + # do one action + activated_action = event_frame.triggered_actions.pop(0) + logging.info(f"Action activated: {activated_action}") + event_args = self._act(activated_action) + self._record_last_action_history() + self._stack_events(event_args) + else: + # do all actions + event_args = [] + for activated_action in event_frame.triggered_actions: + logging.info(f"Action activated: {activated_action}") + event_args += self._act(activated_action) + self._record_last_action_history() + event_frame.triggered_actions = [] + self._stack_events(event_args) return elif len(event_frame.triggered_objects): # get actions @@ -2389,16 +2403,7 @@ def _action_charge(self, action: ChargeAction) -> List[ChargeEventArguments]: player_idx = action.player_idx table = self.player_tables[player_idx] character = table.characters[action.character_idx] - if character.is_defeated: - # charge defeated character - logging.warning( - f"tried to charge a defeated character! " - f"player {player_idx} " - f"character {character.name}:{action.character_idx}. " - f"bug or defeated before charging?" - ) - # ignore this action and return empty event arguments - return [] + assert character.is_alive, "Cannot charge a defeated character." logging.info( f"player {player_idx} " f"character {character.name}:{table.active_character_idx} " @@ -2959,9 +2964,7 @@ def _action_use_card(self, action: UseCardAction) -> List[UseCardEventArguments] use_card_value = UseCardValue(position=card.position, card=card) self._modify_value(use_card_value, "REAL") - info_str = ( - f"player {action.card_position.player_idx} " f"use card {card.name}." # type: ignore - ) + info_str = f"player {action.card_position.player_idx} use card {card.name}." if not use_card_value.use_card: info_str += " But use card failed!" logging.info(info_str) @@ -3028,11 +3031,16 @@ def _action_generate_switch_card_request( def _action_skip_player_action( self, action: SkipPlayerActionAction - ) -> List[EventArgumentsBase]: + ) -> List[ActionEndEventArguments]: + """ + In this action, match state is changed to PLAYER_ACTION_REQUEST, so + no requests are generated to current player, and it will immediately end + the action phase. + """ if self.state != MatchState.PLAYER_ACTION_START: raise AssertionError( f"Cannot skip player action when match state is " f"{self.state}." ) self._set_match_state(MatchState.PLAYER_ACTION_REQUEST) logging.info(f"player {self.current_player} skipped player action.") - return [] + return self._action_action_end(action.get_action_end_action()) diff --git a/src/lpsim/server/status/character_status/base.py b/src/lpsim/server/status/character_status/base.py index f83734fc..918e06fa 100644 --- a/src/lpsim/server/status/character_status/base.py +++ b/src/lpsim/server/status/character_status/base.py @@ -20,7 +20,6 @@ ) from ..base import StatusBase from ...action import ( - ActionEndAction, MakeDamageAction, RemoveObjectAction, Actions, @@ -34,6 +33,7 @@ RoundEndEventArguments, RoundPrepareEventArguments, SwitchCharacterEventArguments, + UseSkillEventArguments, ) @@ -285,6 +285,8 @@ class PrepareCharacterStatus(CharacterStatusBase): max_usage: int = 1 icon_type: Literal[IconType.SPECIAL] = IconType.SPECIAL + done: bool = False + def event_handler_SWITCH_CHARACTER( self, event: SwitchCharacterEventArguments, match: Any ) -> List[RemoveObjectAction]: @@ -320,12 +322,12 @@ def event_handler_CHOOSE_CHARACTER( def event_handler_PLAYER_ACTION_START( self, event: PlayerActionStartEventArguments, match: Any - ) -> List[ - RemoveObjectAction | UseSkillAction | SkipPlayerActionAction | ActionEndAction - ]: + ) -> List[UseSkillAction]: """ If self player action start, and this character is at front, - use skill, remove this status, and skip player action. + use skill. it will also listen to Use Skill event to remove self, and skip + player action. + remove this status, and skip player action. """ if event.player_idx != self.position.player_idx: # not self player action start, do nothing @@ -339,38 +341,35 @@ def event_handler_PLAYER_ACTION_START( if character.is_stunned: # stunned, do nothing return [] - ret: List[ - RemoveObjectAction - | UseSkillAction - | SkipPlayerActionAction - | ActionEndAction - ] = [] - ret.append(RemoveObjectAction(object_position=self.position)) assert character.name == self.character_name - # use skill for skill in character.skills: if skill.name == self.skill_name: - # clear, should not remove self first - ret.clear() - ret.append(UseSkillAction(skill_position=skill.position)) - # skip player action - ret.append(SkipPlayerActionAction()) - # remove self - ret.append(RemoveObjectAction(object_position=self.position)) - # action end action to switch player - ret.append( - ActionEndAction( - action_label=PlayerActionLabels.SKILL, - do_combat_action=True, - position=skill.position, - ) - ) - # note based on its description, no skill end action will be - # triggered. - return ret + self.done = True + return [UseSkillAction(skill_position=skill.position)] else: raise AssertionError("Skill not found") + def event_handler_USE_SKILL( + self, event: UseSkillEventArguments, match: Any + ) -> List[RemoveObjectAction | SkipPlayerActionAction]: + """ + When use skill, and this status is marked as done, remove self and trigger + skip player action. + As it is a character status, it will always trigger after skill of character. + """ + if self.done: + return [ + # remove self + RemoveObjectAction(object_position=self.position), + # skip player action + SkipPlayerActionAction( + action_label=PlayerActionLabels.SKILL, + do_combat_action=True, + position=event.action.skill_position, + ), + ] + return [] + class ReviveCharacterStatus(UsageCharacterStatus): name: str diff --git a/src/lpsim/server/status/team_status/base.py b/src/lpsim/server/status/team_status/base.py index c6bb92d5..1dab62aa 100644 --- a/src/lpsim/server/status/team_status/base.py +++ b/src/lpsim/server/status/team_status/base.py @@ -152,9 +152,6 @@ def value_modifier_DAMAGE_DECREASE( ): # not this character receive damage, not modify return value - if self.usage <= 0: - # no usage, not modify - return value new_usage = value.apply_shield( self.usage, self.min_damage_to_trigger, diff --git a/src/lpsim/server/status/team_status/dendro_characters.py b/src/lpsim/server/status/team_status/dendro_characters.py index ee23785d..ad5bbf65 100644 --- a/src/lpsim/server/status/team_status/dendro_characters.py +++ b/src/lpsim/server/status/team_status/dendro_characters.py @@ -248,7 +248,6 @@ class SeamlessShield_4_2(ShieldTeamStatus): version: Literal["4.2"] = "4.2" usage: int = 1 max_usage: int = 1 - remove_triggered: bool = False def effect_action(self, match: Any) -> MakeDamageAction: """ @@ -309,13 +308,8 @@ def event_handler_MAKE_DAMAGE( """ When damage made, check whether the team status should be removed. """ - if self.remove_triggered: - # already triggered, do nothing - return [] ret = self.check_should_remove() if len(ret) > 0: - # should remove, remove self, then make damage and heal - self.remove_triggered = True return [ self.effect_action(match), RemoveObjectAction(object_position=self.position), diff --git a/src/lpsim/server/status/team_status/pyro_characters.py b/src/lpsim/server/status/team_status/pyro_characters.py index f54b6e3b..af15259d 100644 --- a/src/lpsim/server/status/team_status/pyro_characters.py +++ b/src/lpsim/server/status/team_status/pyro_characters.py @@ -201,7 +201,6 @@ class FierySanctumField_4_1(DefendTeamStatus): min_damage_to_trigger: int = 1 max_in_one_time: int = 1 decrease_usage_by_damage: bool = False - remove_triggered: bool = False def _find_dehya(self, match: Any) -> int: """ @@ -235,10 +234,6 @@ def event_handler_MAKE_DAMAGE( """ ret: List[MakeDamageAction | RemoveObjectAction] = [] if self.usage == 0: - if self.remove_triggered: - # has triggered remove, do nothing - return [] - self.remove_triggered = True # check if should attack dehya dehya_idx = self._find_dehya(match) assert dehya_idx != -1 diff --git a/tests/server/bugfix/jsons/test_counter_reset_when_revive.json b/tests/server/bugfix/jsons/test_counter_reset_when_revive.json index c5a18cbc..0090e83f 100644 --- a/tests/server/bugfix/jsons/test_counter_reset_when_revive.json +++ b/tests/server/bugfix/jsons/test_counter_reset_when_revive.json @@ -1527,7 +1527,7 @@ "TEST 5 p1c3", "TEST 5 p1c4", "skill 0 6 5 4", - "TEST 1 0 8 8 3 8 0 8 9 9 9", + "TEST 1 2 8 8 3 8 0 8 9 9 9", "TEST 5 p0c0", "TEST 5 p0c1 3", "TEST 5 p0c2", diff --git a/tests/server/patch/v43/jsons/test_gorou.json b/tests/server/patch/v43/jsons/test_gorou.json index 4b640b30..94c7a663 100644 --- a/tests/server/patch/v43/jsons/test_gorou.json +++ b/tests/server/patch/v43/jsons/test_gorou.json @@ -761,7 +761,7 @@ "TEST 2 p0", "TEST 4 p0", "TEST 6 p0 11", - "TEST 2 p1 0", + "TEST 2 p1", "TEST 4 p1 3", "TEST 6 p1 12", "choose 1", diff --git a/tests/server/patch/v44/jsons/sayu.json b/tests/server/patch/v44/jsons/sayu.json index 9a8ea4e1..9f443682 100644 --- a/tests/server/patch/v44/jsons/sayu.json +++ b/tests/server/patch/v44/jsons/sayu.json @@ -635,6 +635,28 @@ "default_version:4.4\ncharacter:Sayu@4.4\ncharacter:Mona@3.3\ncharacter:Klee@3.4\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\n", "default_version:4.4\ncharacter:Sayu@4.4\ncharacter:Mona@3.3\ncharacter:Klee@3.4\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSweet Madame@3.3\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\nSkiving: New and Improved@4.4\n" ], + "match_config": { + "random_first_player": false, + "player_go_first": 0, + "check_deck_restriction": false, + "initial_hand_size": 5, + "initial_card_draw": 2, + "initial_dice_number": 16, + "initial_dice_reroll_times": 1, + "card_number": null, + "max_same_card_number": null, + "character_number": null, + "max_round_number": 999, + "max_hand_size": 10, + "max_dice_number": 16, + "max_summon_number": 4, + "max_support_number": 4, + "make_skill_prediction": false, + "history_level": 10, + "compress_history": true, + "recreate_mode": false, + "random_object_information": [] + }, "command_history": [ [ "TEST 1 10 10 10 10 10 10", @@ -645,7 +667,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -653,7 +674,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", - "TEST 6 p1 5", "sw_card", "TEST 1 10 10 10 10 10 10", "TEST 2 p0", @@ -663,7 +683,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -671,7 +690,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", - "TEST 6 p1 5", "choose 1", "TEST 1 10 10 10 10 10 10", "TEST 2 p0", @@ -681,7 +699,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -689,7 +706,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", - "TEST 6 p1 5", "skill 1 15 14 13", "TEST 1 10 10 10 10 10 10", "TEST 2 p0 0", @@ -699,7 +715,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1 1", "TEST 12 p1c0 HYDRO", @@ -707,7 +722,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", - "TEST 6 p1 4", "sw_char 0 12", "TEST 1 10 10 10 10 10 10", "TEST 2 p0 0", @@ -717,7 +731,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1 1", "TEST 12 p1c0 HYDRO", @@ -725,7 +738,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", - "TEST 6 p1 4", "skill 1 11 10 9", "TEST 1 7 10 10 7 9 9", "TEST 2 p0 0", @@ -735,7 +747,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1 1", "TEST 12 p1c0 HYDRO", @@ -743,7 +754,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 3", "sw_char 1 8", "TEST 1 7 8 10 7 9 9", "TEST 2 p0 0", @@ -753,7 +763,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -761,7 +770,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 3", "sw_char 0 7", "TEST 1 7 8 10 7 9 9", "TEST 2 p0 0", @@ -771,7 +779,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -779,7 +786,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 3", "card 1 0 6 5 4", "TEST 1 6 8 10 4 8 8", "TEST 2 p0 0", @@ -789,7 +795,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 6", "TEST 2 p1 2", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -797,7 +802,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 3", "skill 1 3 2 1", "TEST 1 6 8 10 3 7 5", "TEST 2 p0 0", @@ -807,7 +811,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 6", "TEST 2 p1 2", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -815,7 +818,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 3", "end", "TEST 1 5 8 10 5 7 4", "TEST 2 p0", @@ -825,7 +827,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 8", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0 HYDRO", @@ -833,7 +834,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 5", "skill 3 15 14 13", "TEST 1 4 8 10 4 6 3", "TEST 2 p0 2", @@ -843,7 +843,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0 1", "TEST 12 p1c0", @@ -851,7 +850,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 5", "skill 1 12 11 10", "TEST 1 0 8 10 1 6 3", "TEST 2 p0 2", @@ -860,7 +858,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -868,7 +865,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 5", "choose 1", "TEST 1 0 8 10 1 6 3", "TEST 2 p0 2", @@ -877,7 +873,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -885,7 +880,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 5", "skill 1 9 8 7", "TEST 1 0 8 10 0 6 3", "TEST 2 p0 2 1", @@ -894,14 +888,12 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 5", "end", "TEST 1 0 7 10 0 5 3", "TEST 2 p0 1", @@ -910,14 +902,12 @@ "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2 1", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 7", "skill 1 15 14 13", "TEST 1 0 7 10 0 5 2", "TEST 2 p0 1 1", @@ -926,14 +916,12 @@ "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2 1", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 7", "skill 1 12 11 10", "TEST 1 0 7 10 0 5 1", "TEST 2 p0 1 1", @@ -942,14 +930,12 @@ "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2 1", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 7", "end" ], [ @@ -961,7 +947,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -969,7 +954,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", - "TEST 6 p1 5", "sw_card 4 3", "TEST 1 10 10 10 10 10 10", "TEST 2 p0", @@ -979,7 +963,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -987,7 +970,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", - "TEST 6 p1 5", "choose 0", "TEST 1 10 10 10 9 10 10", "TEST 2 p0 1", @@ -997,7 +979,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0 HYDRO", @@ -1005,7 +986,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", - "TEST 6 p1 5", "card 2 0", "TEST 1 10 10 10 10 10 10", "TEST 2 p0 1", @@ -1015,7 +995,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1023,7 +1002,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", - "TEST 6 p1 4", "skill 1 15 14 13", "TEST 1 8 10 10 7 9 9", "TEST 2 p0 0", @@ -1033,7 +1011,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1041,7 +1018,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 4", "card 2 0 12 11 10", "TEST 1 7 8 10 7 9 9", "TEST 2 p0 0", @@ -1051,7 +1027,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1059,7 +1034,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 3", "sw_char 1 9", "TEST 1 7 8 10 6 8 8", "TEST 2 p0 0", @@ -1069,7 +1043,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 6", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1077,7 +1050,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 3", "sw_char 0 8", "TEST 1 7 8 10 6 8 8", "TEST 2 p0 0", @@ -1087,7 +1059,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 6", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1095,7 +1066,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 3", "skill 3 7 6 5", "TEST 1 6 8 10 4 8 8", "TEST 2 p0 0", @@ -1105,7 +1075,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 6", "TEST 2 p1 2", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1113,7 +1082,6 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 3", "sw_char 2 4", "TEST 1 6 8 10 3 7 7", "TEST 2 p0 0", @@ -1123,7 +1091,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 6", "TEST 2 p1 2", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1131,7 +1098,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2", - "TEST 6 p1 3", "end", "TEST 1 5 8 10 5 7 4", "TEST 2 p0", @@ -1141,7 +1107,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 8", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0 HYDRO", @@ -1149,7 +1114,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 5", "sw_char 0 15", "TEST 1 5 8 10 4 6 3", "TEST 2 p0 2", @@ -1159,7 +1123,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -1167,7 +1130,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 5", "skill 1 14 13 12", "TEST 1 2 8 10 1 6 3", "TEST 2 p0 2", @@ -1177,7 +1139,6 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -1185,7 +1146,6 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 5", "skill 0 11 10 9", "TEST 1 0 8 10 0 6 3", "TEST 2 p0 2 1", @@ -1194,14 +1154,12 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 5", "choose 2", "TEST 1 0 8 10 0 6 3", "TEST 2 p0 2 1", @@ -1210,14 +1168,12 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 5", "end", "TEST 1 0 10 10 0 5 3", "TEST 2 p0 1", @@ -1226,14 +1182,12 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 7", "skill 1 12 11 10", "TEST 1 0 7 10 0 5 2", "TEST 2 p0 1 1", @@ -1242,29 +1196,25 @@ "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2 1", "TEST 12 p1c2 HYDRO", - "TEST 6 p1 7", "end", "TEST 1 0 9 10 0 4 0", - "TEST 2 p0 1 1", + "TEST 2 p0 1", "TEST 5 p0c0", "TEST 5 p0c1", "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", - "TEST 6 p1 7", "choose 1", "TEST 1 0 9 10 0 3 0", "TEST 2 p0", @@ -1273,38 +1223,14 @@ "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", - "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", - "TEST 6 p1 9", "card 0 0" ] ], - "match_config": { - "random_first_player": false, - "player_go_first": 0, - "check_deck_restriction": false, - "initial_hand_size": 5, - "initial_card_draw": 2, - "initial_dice_number": 16, - "initial_dice_reroll_times": 1, - "card_number": null, - "max_same_card_number": null, - "character_number": null, - "max_round_number": 999, - "max_hand_size": 10, - "max_dice_number": 16, - "max_summon_number": 4, - "max_support_number": 4, - "make_skill_prediction": false, - "history_level": 10, - "compress_history": true, - "recreate_mode": false, - "random_object_information": [] - }, "command_history_raw": [ [ [ diff --git a/tests/server/patch/v44/template.py b/tests/server/patch/v44/template.py index b38ce258..8a8017f0 100644 --- a/tests/server/patch/v44/template.py +++ b/tests/server/patch/v44/template.py @@ -10,7 +10,7 @@ def template(): - json_fname = "veteran_2.json" + json_fname = "sayu.json" json_path = os.path.join(os.path.dirname(__file__), "jsons", json_fname) match, agent_0, agent_1 = read_from_log_json(json_path) # backup json @@ -44,17 +44,17 @@ def template(): # add tests enable = [ 1, # hp - # 2, # summon + 2, # summon # 3, # support # 4, # team status 5, # character status - 6, # hands - 7, # dice + # 6, # hands + # 7, # dice # 8, # charge # 9, # summon element # 10, # character desc # 11, # hand usage availability - # 12, # element application + 12, # element application ] # 1 for hp hp_str = "TEST 1" diff --git a/tests/server/patch/v44/test_json_4_4.py b/tests/server/patch/v44/test_json_4_4.py index c465cf18..1fa840ab 100644 --- a/tests/server/patch/v44/test_json_4_4.py +++ b/tests/server/patch/v44/test_json_4_4.py @@ -81,9 +81,9 @@ def test_jeht_sunyata(): # test_cryo_hypostasis() # test_millennial_pearl_seahorse() # test_millennial_pearl_seahorse_2() - # test_thoma() - # test_sayu() + test_thoma() + test_sayu() # test_sapwood_machine_veteran() # test_machine_2() # test_veteran_2() - test_silver() + # test_silver() From 30534dcc76f30ff008fa98e9b04d2125648e5bb7 Mon Sep 17 00:00:00 2001 From: zyr17 Date: Sun, 18 Feb 2024 10:32:12 +0800 Subject: [PATCH 2/8] refactor: move switch character out of make damage --- src/lpsim/server/action.py | 13 --------- src/lpsim/server/character/anemo/jean_3_3.py | 22 +++++++++------ .../server/character/anemo/sucrose_3_3.py | 17 ++++++------ src/lpsim/server/character/anemo/venti_3_7.py | 27 ++++++++++++++----- src/lpsim/server/match.py | 11 +++----- .../patch/v43/characters/lynette_4_3.py | 19 ++++++++++--- 6 files changed, 62 insertions(+), 47 deletions(-) diff --git a/src/lpsim/server/action.py b/src/lpsim/server/action.py index a6a6f2c4..e42b36bb 100644 --- a/src/lpsim/server/action.py +++ b/src/lpsim/server/action.py @@ -402,20 +402,10 @@ class MakeDamageAction(ActionBase): Action for making damage. Heal treats as negative damage. Elemental applies to the character (e.g. Kokomi) treats as zero damage. - It can also contain character change and object creation (caused by - elemental reaction or skill effects). They will be executed right after - making damage, and gives corresponding events. - Args: damage_value_list (List[DamageValue]): The damage values to make. do_character_change (bool): Whether to change character after making damage. - character_change_idx (List[int]): The character indices of the - character who will be changed to for each player. If it is -1, - this damage will not explicitly change the character. It should - not be a defeated character. - create_objects (List[CreateObjectAction]): The objects to create after - making damage. """ type: Literal[ActionTypes.MAKE_DAMAGE] = ActionTypes.MAKE_DAMAGE @@ -423,9 +413,6 @@ class MakeDamageAction(ActionBase): damage_value_list: List[DamageValue] create_objects: List[CreateObjectAction] = [] - # character change - character_change_idx: List[int] = [-1, -1] - def __init__(self, *argv, **kwargs): super().__init__(*argv, **kwargs) for damage_value in self.damage_value_list: diff --git a/src/lpsim/server/character/anemo/jean_3_3.py b/src/lpsim/server/character/anemo/jean_3_3.py index 055f8dd2..c5e33fd3 100644 --- a/src/lpsim/server/character/anemo/jean_3_3.py +++ b/src/lpsim/server/character/anemo/jean_3_3.py @@ -8,7 +8,12 @@ from ...modifiable_values import DamageIncreaseValue, DamageValue -from ...action import ActionTypes, Actions, ChangeObjectUsageAction, MakeDamageAction +from ...action import ( + Actions, + ChangeObjectUsageAction, + MakeDamageAction, + SwitchCharacterAction, +) from ...struct import Cost from ...consts import ( @@ -100,17 +105,18 @@ class GaleBlade(ElementalSkillBase): cost: Cost = Cost(elemental_dice_color=DieColor.ANEMO, elemental_dice_number=3) def get_actions(self, match: Any) -> List[Actions]: - ret = super().get_actions(match) next_idx = match.player_tables[ 1 - self.position.player_idx ].next_character_idx() if next_idx is None: - return ret - # change character - attack_action = ret[0] - assert attack_action.type == ActionTypes.MAKE_DAMAGE - attack_action.character_change_idx[1 - self.position.player_idx] = next_idx - return ret + return super().get_actions(match) + return [ + self.attack_opposite_active(match, self.damage, self.damage_type), + SwitchCharacterAction( + player_idx=1 - self.position.player_idx, character_idx=next_idx + ), + self.charge_self(1), + ] class DandelionBreeze(ElementalBurstBase): diff --git a/src/lpsim/server/character/anemo/sucrose_3_3.py b/src/lpsim/server/character/anemo/sucrose_3_3.py index 82f7484b..60b83c1d 100644 --- a/src/lpsim/server/character/anemo/sucrose_3_3.py +++ b/src/lpsim/server/character/anemo/sucrose_3_3.py @@ -6,7 +6,7 @@ from ...modifiable_values import DamageIncreaseValue -from ...action import ActionTypes, Actions +from ...action import Actions, SwitchCharacterAction from ...struct import Cost from ...consts import ( @@ -91,17 +91,18 @@ class AstableAnemohypostasisCreation6308(ElementalSkillBase): cost: Cost = Cost(elemental_dice_color=DieColor.ANEMO, elemental_dice_number=3) def get_actions(self, match: Any) -> List[Actions]: - ret = super().get_actions(match) prev_idx = match.player_tables[ 1 - self.position.player_idx ].previous_character_idx() if prev_idx is None: - return ret - # change character - attack_action = ret[0] - assert attack_action.type == ActionTypes.MAKE_DAMAGE - attack_action.character_change_idx[1 - self.position.player_idx] = prev_idx - return ret + return super().get_actions(match) + return [ + self.attack_opposite_active(match, self.damage, self.damage_type), + SwitchCharacterAction( + player_idx=1 - self.position.player_idx, character_idx=prev_idx + ), + self.charge_self(1), + ] class ForbiddenCreationIsomer75TypeII(ElementalBurstBase): diff --git a/src/lpsim/server/character/anemo/venti_3_7.py b/src/lpsim/server/character/anemo/venti_3_7.py index 39bb152d..4b11b740 100644 --- a/src/lpsim/server/character/anemo/venti_3_7.py +++ b/src/lpsim/server/character/anemo/venti_3_7.py @@ -6,7 +6,12 @@ from ...event import RoundEndEventArguments -from ...action import ActionTypes, Actions, ChangeObjectUsageAction, MakeDamageAction +from ...action import ( + Actions, + ChangeObjectUsageAction, + MakeDamageAction, + SwitchCharacterAction, +) from ...struct import Cost from ...consts import ( @@ -37,11 +42,14 @@ class Stormeye_3_7(SwirlChangeSummonBase): def event_handler_ROUND_END( self, event: RoundEndEventArguments, match: Any - ) -> List[MakeDamageAction | ChangeObjectUsageAction]: + ) -> List[MakeDamageAction | ChangeObjectUsageAction | SwitchCharacterAction]: """ Need to change enemy active """ - ret = super().event_handler_ROUND_END(event, match) + ret: List[ + MakeDamageAction | ChangeObjectUsageAction | SwitchCharacterAction + ] = [] + ret += super().event_handler_ROUND_END(event, match) our_active = match.player_tables[self.position.player_idx].active_character_idx target_characters = match.player_tables[1 - self.position.player_idx].characters target_idx = our_active @@ -53,9 +61,16 @@ def event_handler_ROUND_END( break else: raise AssertionError("No character alive") - attack_action = ret[0] - assert attack_action.type == ActionTypes.MAKE_DAMAGE - attack_action.character_change_idx[1 - self.position.player_idx] = target_idx + if ( + target_idx + != match.player_tables[1 - self.position.player_idx].active_character_idx + ): + ret.append( + SwitchCharacterAction( + player_idx=1 - self.position.player_idx, + character_idx=target_idx, + ) + ) return ret diff --git a/src/lpsim/server/match.py b/src/lpsim/server/match.py index 8499a25e..0255994d 100644 --- a/src/lpsim/server/match.py +++ b/src/lpsim/server/match.py @@ -2252,13 +2252,8 @@ def _action_make_damage( 1. MakeDamageEventArguments: All damage information dealt by this action. 2. SwitchCharacterEventArguments: If this damage action contains - character change, i.e. overloaded, Skills of Anemo characters, etc. - A SwitchCharacterEventArguments will be generated. - NOTE: only character switch of character received this damage will - trigger this event, character switch of attacker (Kazuha, Kenki, - When the Crane Returned) should be another SwitchCharacterAction. - TODO is it possible to have character switch of attacker in - make damage action? + character change, i.e. overloaded, + a SwitchCharacterEventArguments will be generated. 3. CreateObjectEventArguments: If this damage action contains create object, i.e. massive skills that deal damage and create object, or triggered dendro reaction, etc. A CreateObjectEventArguments @@ -2267,7 +2262,7 @@ def _action_make_damage( handler, which is listening ReceiveDamageEventArguments. """ damage_lists = action.damage_value_list[:] - switch_character: List[int] = action.character_change_idx + switch_character: List[int] = [-1, -1] create_objects: List[CreateObjectAction] = [] assert self.event_handlers[0].name == "System" # version used in side effect generation diff --git a/src/lpsim/server/patch/v43/characters/lynette_4_3.py b/src/lpsim/server/patch/v43/characters/lynette_4_3.py index 8969a502..084d792e 100644 --- a/src/lpsim/server/patch/v43/characters/lynette_4_3.py +++ b/src/lpsim/server/patch/v43/characters/lynette_4_3.py @@ -3,7 +3,13 @@ from .....utils.class_registry import register_class from ....status.team_status.base import DefendTeamStatus from ....summon.base import AttackAndGenerateStatusSummonBase, SwirlChangeSummonBase -from ....action import Actions, CreateObjectAction, MakeDamageAction, RemoveObjectAction +from ....action import ( + Actions, + CreateObjectAction, + MakeDamageAction, + RemoveObjectAction, + SwitchCharacterAction, +) from ....status.character_status.base import RoundEndAttackCharacterStatus from ....match import Match from ....event import ( @@ -131,9 +137,14 @@ def get_actions(self, match: Match) -> List[Actions]: 1 - self.position.player_idx ].previous_character_idx() if prev_character_idx is not None: - damage_action.character_change_idx[ - 1 - self.position.player_idx - ] = prev_character_idx + return [ + damage_action, + SwitchCharacterAction( + player_idx=1 - self.position.player_idx, + character_idx=prev_character_idx, + ), + self.charge_self(1), + ] elif self.use_time_this_round == 1 and character.hp <= 8: # first use, heal 2 hp and attach status heal = self.attack_self(match, -2) From ef30cfe01c9d99a760c70168b0cf7458c99e8569 Mon Sep 17 00:00:00 2001 From: zyr17 Date: Sun, 18 Feb 2024 11:07:24 +0800 Subject: [PATCH 3/8] refactor: remove `create_objects` from `MakeDamageAction` --- src/lpsim/server/action.py | 1 - src/lpsim/server/character/anemo/jean_3_3.py | 4 +- .../character/anemo/kaedehara_kazuha_3_8.py | 11 ++--- .../server/character/anemo/maguu_kenki_3_3.py | 18 +++----- .../server/character/anemo/sucrose_3_3.py | 6 +-- src/lpsim/server/character/anemo/venti_3_7.py | 13 ++---- .../server/character/anemo/wanderer_4_1.py | 9 ++-- src/lpsim/server/character/anemo/xiao_3_7.py | 9 ++-- src/lpsim/server/character/character_base.py | 45 ++----------------- .../server/character/cryo/chongyun_3_3.py | 9 ++-- src/lpsim/server/character/cryo/diona_3_3.py | 8 ++-- src/lpsim/server/character/cryo/eula_3_8.py | 10 ++--- .../cryo/fatui_cryo_cicin_mage_4_1.py | 11 ++--- src/lpsim/server/character/cryo/ganyu_3_7.py | 11 ++--- src/lpsim/server/character/cryo/kaeya_3_3.py | 2 +- .../character/cryo/kamisato_ayaka_3_3.py | 4 +- src/lpsim/server/character/cryo/qiqi_4_0.py | 6 +-- src/lpsim/server/character/cryo/shenhe_3_7.py | 11 ++--- .../server/character/dendro/baizhu_4_2.py | 2 +- .../server/character/dendro/collei_3_3.py | 8 ++-- .../server/character/dendro/nahida_3_7.py | 6 +-- .../server/character/dendro/tighnari_3_6.py | 9 ++-- .../server/character/dendro/yaoyao_4_1.py | 2 +- .../server/character/electro/beidou_3_8.py | 9 ++-- .../server/character/electro/dori_4_2.py | 19 ++++---- .../electro/electro_hypostasis_3_7.py | 16 +++---- .../server/character/electro/fischl_3_3.py | 2 +- .../server/character/electro/keqing_3_3.py | 17 +++---- .../character/electro/kujou_sara_3_5.py | 10 ++--- .../server/character/electro/lisa_4_0.py | 14 +++--- .../server/character/electro/razor_3_8.py | 6 +-- .../server/character/electro/yae_miko_3_7.py | 8 +--- .../server/character/geo/arataki_itto_3_6.py | 23 +++------- .../server/character/geo/ningguang_3_3.py | 9 ++-- src/lpsim/server/character/geo/noelle_3_3.py | 10 ++--- src/lpsim/server/character/geo/zhongli_3_7.py | 16 +++---- .../server/character/hydro/barbara_3_3.py | 3 +- .../server/character/hydro/candace_3_8.py | 9 ++-- .../character/hydro/kamisato_ayato_3_6.py | 9 ++-- .../character/hydro/kamisato_ayato_4_1.py | 15 +++---- .../character/hydro/mirror_maiden_3_7.py | 6 ++- src/lpsim/server/character/hydro/mona_3_3.py | 4 +- src/lpsim/server/character/hydro/nilou_4_2.py | 12 ++--- .../character/hydro/sangonomiya_kokomi_3_5.py | 9 ++-- .../character/hydro/sangonomiya_kokomi_3_6.py | 15 +++---- .../server/character/hydro/xingqiu_3_3.py | 2 +- .../server/character/hydro/xingqiu_4_1.py | 10 ++--- .../abyss_lector_fathomless_flames_3_7.py | 2 +- .../server/character/pyro/bennett_3_3.py | 15 +++---- src/lpsim/server/character/pyro/dehya_4_1.py | 18 +++----- src/lpsim/server/character/pyro/diluc_3_3.py | 11 ++--- .../character/pyro/fatui_pyro_agent_3_3.py | 2 +- src/lpsim/server/character/pyro/klee_3_4.py | 34 ++++++-------- .../server/character/pyro/xiangling_3_8.py | 4 +- src/lpsim/server/character/pyro/yanfei_3_8.py | 30 +++++-------- .../server/character/pyro/yoimiya_3_8.py | 2 +- src/lpsim/server/match.py | 1 - .../patch/v43/characters/alhaitham_4_3.py | 13 +++--- .../patch/v43/characters/azhdaha_4_3.py | 7 ++- .../server/patch/v43/characters/dvalin_4_3.py | 16 +++---- .../eremite_scorching_loremaster_4_3.py | 11 ++--- .../server/patch/v43/characters/gorou_4_3.py | 19 ++++---- .../server/patch/v43/characters/layla_4_3.py | 9 ++-- .../patch/v43/characters/lynette_4_3.py | 4 +- .../server/patch/v43/characters/lyney_4_3.py | 4 +- .../patch/v43/characters/signora_4_3.py | 6 +-- .../characters/thunder_manifestation_4_3.py | 9 ++-- .../server/patch/v43/characters/yelan_4_3.py | 9 ++-- .../v44/characters/cryo_hypostasis_4_4.py | 11 ++--- .../millennial_pearl_seahorse_4_4.py | 11 ++--- .../server/patch/v44/characters/sayu_4_4.py | 18 +++----- .../server/patch/v44/characters/thoma_4_4.py | 19 ++++---- templates/character.py | 5 +-- tests/server/cards/test_food.py | 2 +- tests/server/characters/cryo/test_ganyu.py | 1 + 75 files changed, 290 insertions(+), 471 deletions(-) diff --git a/src/lpsim/server/action.py b/src/lpsim/server/action.py index e42b36bb..77393291 100644 --- a/src/lpsim/server/action.py +++ b/src/lpsim/server/action.py @@ -411,7 +411,6 @@ class MakeDamageAction(ActionBase): type: Literal[ActionTypes.MAKE_DAMAGE] = ActionTypes.MAKE_DAMAGE record_level: int = 10 damage_value_list: List[DamageValue] - create_objects: List[CreateObjectAction] = [] def __init__(self, *argv, **kwargs): super().__init__(*argv, **kwargs) diff --git a/src/lpsim/server/character/anemo/jean_3_3.py b/src/lpsim/server/character/anemo/jean_3_3.py index c5e33fd3..c6ea60f4 100644 --- a/src/lpsim/server/character/anemo/jean_3_3.py +++ b/src/lpsim/server/character/anemo/jean_3_3.py @@ -133,9 +133,6 @@ def get_actions(self, match: Any) -> List[Actions]: characters = match.player_tables[self.position.player_idx].characters heal_action = MakeDamageAction( damage_value_list=[], - create_objects=[ - self.create_summon("Dandelion Field", {"version": self.version}) - ], ) for character in characters: if character.is_alive: @@ -150,6 +147,7 @@ def get_actions(self, match: Any) -> List[Actions]: ) ) ret.append(heal_action) + ret.append(self.create_summon("Dandelion Field", {"version": self.version})) return ret diff --git a/src/lpsim/server/character/anemo/kaedehara_kazuha_3_8.py b/src/lpsim/server/character/anemo/kaedehara_kazuha_3_8.py index f20458c6..1e8a30cf 100644 --- a/src/lpsim/server/character/anemo/kaedehara_kazuha_3_8.py +++ b/src/lpsim/server/character/anemo/kaedehara_kazuha_3_8.py @@ -53,8 +53,8 @@ def get_actions(self, match: Any) -> List[Actions]: match, self.damage, self.damage_type, - [self.create_character_status("Midare Ranzan: New")], ), + self.create_character_status("Midare Ranzan: New"), self.charge_self(1), ] @@ -87,12 +87,9 @@ class KazuhaSlash(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_summon("Autumn Whirlwind"), - ], - ) + return super().get_actions(match) + [ + self.create_summon("Autumn Whirlwind"), + ] # Talents diff --git a/src/lpsim/server/character/anemo/maguu_kenki_3_3.py b/src/lpsim/server/character/anemo/maguu_kenki_3_3.py index 7205adde..cd96d0f1 100644 --- a/src/lpsim/server/character/anemo/maguu_kenki_3_3.py +++ b/src/lpsim/server/character/anemo/maguu_kenki_3_3.py @@ -19,12 +19,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ gather two actions """ - return super(BB_3_4, self).get_actions( - match, - [ - self.create_summon("Shadowsword: Lone Gale"), - ], - ) + return super(BB_3_4, self).get_actions(match) + [ + self.create_summon("Shadowsword: Lone Gale"), + ] class FrostyAssault(FA_3_4): @@ -34,12 +31,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ gather two actions """ - return super(FA_3_4, self).get_actions( - match, - [ - self.create_summon("Shadowsword: Galloping Frost"), - ], - ) + return super(FA_3_4, self).get_actions(match) + [ + self.create_summon("Shadowsword: Galloping Frost"), + ] class MaguuKenki_3_3(MK_3_4): diff --git a/src/lpsim/server/character/anemo/sucrose_3_3.py b/src/lpsim/server/character/anemo/sucrose_3_3.py index 60b83c1d..32d3ba0c 100644 --- a/src/lpsim/server/character/anemo/sucrose_3_3.py +++ b/src/lpsim/server/character/anemo/sucrose_3_3.py @@ -117,9 +117,9 @@ class ForbiddenCreationIsomer75TypeII(ElementalBurstBase): def get_actions(self, match: Any) -> List[Actions]: args = {"talent_activated": self.is_talent_equipped(match)} - return super().get_actions( - match, [self.create_summon("Large Wind Spirit", args)] - ) + return super().get_actions(match) + [ + self.create_summon("Large Wind Spirit", args) + ] # Talents diff --git a/src/lpsim/server/character/anemo/venti_3_7.py b/src/lpsim/server/character/anemo/venti_3_7.py index 4b11b740..f91777ea 100644 --- a/src/lpsim/server/character/anemo/venti_3_7.py +++ b/src/lpsim/server/character/anemo/venti_3_7.py @@ -94,14 +94,9 @@ def get_actions(self, match: Any) -> List[Actions]: talent_activated = False if self.is_talent_equipped(match): talent_activated = True - return super().get_actions( - match, - [ - self.create_team_status( - "Stormzone", {"talent_activated": talent_activated} - ) - ], - ) + return super().get_actions(match) + [ + self.create_team_status("Stormzone", {"talent_activated": talent_activated}) + ] class WindsGrandOde(ElementalBurstBase): @@ -117,7 +112,7 @@ def get_actions(self, match: Any) -> List[Actions]: Attack and create object """ # create summon first, so it can change element immediately. - return super().get_actions(match, [self.create_summon("Stormeye")]) + return super().get_actions(match) + [self.create_summon("Stormeye")] # Talents diff --git a/src/lpsim/server/character/anemo/wanderer_4_1.py b/src/lpsim/server/character/anemo/wanderer_4_1.py index 63d28701..887571e9 100644 --- a/src/lpsim/server/character/anemo/wanderer_4_1.py +++ b/src/lpsim/server/character/anemo/wanderer_4_1.py @@ -97,12 +97,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, - [ - self.create_character_status("Windfavored"), - ], - ) + return super().get_actions(match) + [ + self.create_character_status("Windfavored"), + ] class KyougenFiveCeremonialPlays(ElementalBurstBase): diff --git a/src/lpsim/server/character/anemo/xiao_3_7.py b/src/lpsim/server/character/anemo/xiao_3_7.py index b754ccd9..b39f9962 100644 --- a/src/lpsim/server/character/anemo/xiao_3_7.py +++ b/src/lpsim/server/character/anemo/xiao_3_7.py @@ -42,12 +42,9 @@ def get_actions(self, match: Any) -> List[Actions]: args = {} if self.is_talent_equipped(match): args["skill_cost_decrease_usage"] = 2 - return super().get_actions( - match, - [ - self.create_character_status("Yaksha's Mask", args), - ], - ) + return super().get_actions(match) + [ + self.create_character_status("Yaksha's Mask", args), + ] # Talents diff --git a/src/lpsim/server/character/character_base.py b/src/lpsim/server/character/character_base.py index 34040b68..ad18af00 100644 --- a/src/lpsim/server/character/character_base.py +++ b/src/lpsim/server/character/character_base.py @@ -88,9 +88,7 @@ def is_valid(self, match: Any) -> bool: """ return True - def get_actions( - self, match: Any, create_object_actions: List[CreateObjectAction] | None = None - ) -> List[Actions]: + def get_actions(self, match: Any) -> List[Actions]: """ The skill is triggered, and get actions of the skill. By default, it will generate three actions: @@ -99,9 +97,7 @@ def get_actions( 2. ChargeAction to charge the active character by 1. """ return [ - self.attack_opposite_active( - match, self.damage, self.damage_type, create_object_actions - ), + self.attack_opposite_active(match, self.damage, self.damage_type), self.charge_self(1), ] @@ -114,27 +110,6 @@ def event_handler_USE_SKILL( """ if event.action.skill_position == self.position: ret = self.get_actions(match) - has_damage = False - has_creation = False - from ..action import ActionTypes - - for action in ret: - if action.type == ActionTypes.MAKE_DAMAGE: - has_damage = True - if action.type == ActionTypes.CREATE_OBJECT: - has_creation = True - if has_damage and has_creation: - import logging - - # import time - # import os - logging.warning(f"Skill {self.name} has both damage and creation") - # with open( - # f'logs/damage_create/{os.getpid()}-{time.time()}.txt', - # 'w', - # encoding = 'utf8' - # ) as f: - # f.write(f'{self.name}\n') return ret return [] @@ -197,14 +172,11 @@ def attack_opposite_active( match: Any, damage: int, damage_type: DamageElementalType, - create_object_actions: List[CreateObjectAction] | None = None, ) -> MakeDamageAction: assert damage > 0 target_table = match.player_tables[1 - self.position.player_idx] target_character_idx = target_table.active_character_idx target_character = target_table.characters[target_character_idx] - if create_object_actions is None: - create_object_actions = [] return MakeDamageAction( damage_value_list=[ DamageValue( @@ -216,7 +188,6 @@ def attack_opposite_active( cost=self.cost.copy(), ) ], - create_objects=create_object_actions, ) def attack_self( @@ -345,18 +316,14 @@ def get_cost(element: ElementType, number: int, charge: int) -> Cost: charge=charge, ) - def get_actions( - self, match: Any, create_object_actions: List[CreateObjectAction] | None = None - ) -> List[Actions]: + def get_actions(self, match: Any) -> List[Actions]: """ When using elemental burst, the charge of the active character will be reduced by `self.charge`. """ return [ self.charge_self(-self.cost.charge), - self.attack_opposite_active( - match, self.damage, self.damage_type, create_object_actions - ), + self.attack_opposite_active(match, self.damage, self.damage_type), ] @@ -374,7 +341,6 @@ def attack_opposite_active( match: Any, damage: int, damage_type: DamageElementalType, - create_object_actions: List[CreateObjectAction] | None = None, ) -> MakeDamageAction: """ For AOE, modify attack opposite to also attack back characters @@ -383,8 +349,6 @@ def attack_opposite_active( target_character_idx = target_table.active_character_idx target_character = target_table.characters[target_character_idx] characters = target_table.characters - if create_object_actions is None: - create_object_actions = [] damage_action = MakeDamageAction( damage_value_list=[ DamageValue( @@ -396,7 +360,6 @@ def attack_opposite_active( cost=self.cost.copy(), ) ], - create_objects=create_object_actions, ) for cid, character in enumerate(characters): if cid == target_table.active_character_idx: diff --git a/src/lpsim/server/character/cryo/chongyun_3_3.py b/src/lpsim/server/character/cryo/chongyun_3_3.py index 8aada012..c8486eb5 100644 --- a/src/lpsim/server/character/cryo/chongyun_3_3.py +++ b/src/lpsim/server/character/cryo/chongyun_3_3.py @@ -50,12 +50,9 @@ def get_actions(self, match: Any) -> List[Actions]: "usage": talent.status_max_usage, "max_usage": talent.status_max_usage, } - return super().get_actions( - match, - [ - self.create_team_status("Chonghua's Frost Field", args), - ], - ) + return super().get_actions(match) + [ + self.create_team_status("Chonghua's Frost Field", args), + ] # Talents diff --git a/src/lpsim/server/character/cryo/diona_3_3.py b/src/lpsim/server/character/cryo/diona_3_3.py index a0273adf..b4ce43e7 100644 --- a/src/lpsim/server/character/cryo/diona_3_3.py +++ b/src/lpsim/server/character/cryo/diona_3_3.py @@ -78,9 +78,9 @@ def get_actions(self, match: Any) -> List[Actions]: # have talent, shield gain one more usage args["usage"] = 2 args["max_usage"] = 2 - return super().get_actions( - match, [self.create_team_status("Cat-Claw Shield", args)] - ) + return super().get_actions(match) + [ + self.create_team_status("Cat-Claw Shield", args) + ] class SignatureMix(ElementalBurstBase): @@ -108,9 +108,9 @@ def get_actions(self, match: Any) -> List[Actions]: cost=Cost(), ) ], - create_objects=[self.create_summon("Drunken Mist")], ) ) + ret.append(self.create_summon("Drunken Mist")) return ret diff --git a/src/lpsim/server/character/cryo/eula_3_8.py b/src/lpsim/server/character/cryo/eula_3_8.py index 7652a341..6dc1bede 100644 --- a/src/lpsim/server/character/cryo/eula_3_8.py +++ b/src/lpsim/server/character/cryo/eula_3_8.py @@ -158,9 +158,7 @@ def get_actions(self, match: Any) -> List[Actions]: # has Grimheart, return return ret # no Grimheart, add Grimheart - ret[0].create_objects = [ - self.create_character_status("Grimheart", {"version": self.version}) - ] + ret += [self.create_character_status("Grimheart", {"version": self.version})] return ret @@ -177,9 +175,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and summon """ - return super().get_actions( - match, [self.create_summon("Lightfall Sword", {"version": self.version})] - ) + return super().get_actions(match) + [ + self.create_summon("Lightfall Sword", {"version": self.version}) + ] # Talents diff --git a/src/lpsim/server/character/cryo/fatui_cryo_cicin_mage_4_1.py b/src/lpsim/server/character/cryo/fatui_cryo_cicin_mage_4_1.py index 669856c4..3e49e4c7 100644 --- a/src/lpsim/server/character/cryo/fatui_cryo_cicin_mage_4_1.py +++ b/src/lpsim/server/character/cryo/fatui_cryo_cicin_mage_4_1.py @@ -147,12 +147,9 @@ class MistySummons(ElementalSkillBase): cost: Cost = Cost(elemental_dice_color=DieColor.CRYO, elemental_dice_number=3) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_summon("Cryo Cicins", {"version": self.version}), - ], - ) + return super().get_actions(match) + [ + self.create_summon("Cryo Cicins", {"version": self.version}), + ] class BlizzardBranchBlossom(ElementalBurstBase): @@ -176,8 +173,8 @@ def get_actions(self, match: Any) -> List[Actions]: match, self.damage, self.damage_type, - [self.create_team_status("Flowing Cicin Shield", args)], ), + self.create_team_status("Flowing Cicin Shield", args), ] app = self.element_application_self(match, DamageElementalType.CRYO) ret[1].damage_value_list += app.damage_value_list diff --git a/src/lpsim/server/character/cryo/ganyu_3_7.py b/src/lpsim/server/character/cryo/ganyu_3_7.py index a7a31e12..e9fc2f7a 100644 --- a/src/lpsim/server/character/cryo/ganyu_3_7.py +++ b/src/lpsim/server/character/cryo/ganyu_3_7.py @@ -53,12 +53,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, - [ - self.create_team_status("Ice Lotus"), - ], - ) + return super().get_actions(match) + [ + self.create_team_status("Ice Lotus"), + ] class FrostflakeArrow(ElementalNormalAttackBase, AOESkillBase): @@ -115,7 +112,7 @@ class CelestialShower(ElementalBurstBase, AOESkillBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_summon("Sacred Cryo Pearl")]) + return super().get_actions(match) + [self.create_summon("Sacred Cryo Pearl")] # Talents diff --git a/src/lpsim/server/character/cryo/kaeya_3_3.py b/src/lpsim/server/character/cryo/kaeya_3_3.py index 0c3d0956..8c43beb8 100644 --- a/src/lpsim/server/character/cryo/kaeya_3_3.py +++ b/src/lpsim/server/character/cryo/kaeya_3_3.py @@ -45,7 +45,7 @@ class GlacialWaltz(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_team_status("Icicle")]) + return super().get_actions(match) + [self.create_team_status("Icicle")] # Talents diff --git a/src/lpsim/server/character/cryo/kamisato_ayaka_3_3.py b/src/lpsim/server/character/cryo/kamisato_ayaka_3_3.py index fd745b2a..1b3a0082 100644 --- a/src/lpsim/server/character/cryo/kamisato_ayaka_3_3.py +++ b/src/lpsim/server/character/cryo/kamisato_ayaka_3_3.py @@ -58,7 +58,9 @@ class KamisatoArtSoumetsu(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_summon("Frostflake Seki no To")]) + return super().get_actions(match) + [ + self.create_summon("Frostflake Seki no To") + ] class KamisatoArtSenho(PassiveSkillBase): diff --git a/src/lpsim/server/character/cryo/qiqi_4_0.py b/src/lpsim/server/character/cryo/qiqi_4_0.py index 063d4a3f..f0b01486 100644 --- a/src/lpsim/server/character/cryo/qiqi_4_0.py +++ b/src/lpsim/server/character/cryo/qiqi_4_0.py @@ -127,9 +127,9 @@ def get_actions(self, match: Any) -> List[Actions]: Make damage and create status. Then if has talent and has revive usage, revive all defeated characters with 2 hp. """ - ret = super().get_actions( - match, [self.create_team_status("Fortune-Preserving Talisman")] - ) + ret = super().get_actions(match) + [ + self.create_team_status("Fortune-Preserving Talisman") + ] if not self.is_talent_equipped(match): # no talent return ret diff --git a/src/lpsim/server/character/cryo/shenhe_3_7.py b/src/lpsim/server/character/cryo/shenhe_3_7.py index f313c6fb..571e35f8 100644 --- a/src/lpsim/server/character/cryo/shenhe_3_7.py +++ b/src/lpsim/server/character/cryo/shenhe_3_7.py @@ -93,12 +93,9 @@ def get_actions(self, match: Any) -> List[Actions]: "talent_max_usage": 1, } ) - return super().get_actions( - match, - [ - self.create_team_status("Icy Quill", args), - ], - ) + return super().get_actions(match) + [ + self.create_team_status("Icy Quill", args), + ] class DivineMaidensDeliverance(ElementalBurstBase): @@ -110,7 +107,7 @@ class DivineMaidensDeliverance(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_summon("Talisman Spirit")]) + return super().get_actions(match) + [self.create_summon("Talisman Spirit")] # Talents diff --git a/src/lpsim/server/character/dendro/baizhu_4_2.py b/src/lpsim/server/character/dendro/baizhu_4_2.py index 9d1d6f2f..0bbbeaaa 100644 --- a/src/lpsim/server/character/dendro/baizhu_4_2.py +++ b/src/lpsim/server/character/dendro/baizhu_4_2.py @@ -82,7 +82,7 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions(match, [self.create_summon("Gossamer Sprite")]) + return super().get_actions(match) + [self.create_summon("Gossamer Sprite")] class HolisticRevivification(ElementalBurstBase): diff --git a/src/lpsim/server/character/dendro/collei_3_3.py b/src/lpsim/server/character/dendro/collei_3_3.py index 51b64260..874e201e 100644 --- a/src/lpsim/server/character/dendro/collei_3_3.py +++ b/src/lpsim/server/character/dendro/collei_3_3.py @@ -87,9 +87,9 @@ def get_actions(self, match: Any) -> List[Actions]: if character.talent is None: # no talent equipped return ret - return super().get_actions( - match, [self.create_team_status("Floral Sidewinder")] - ) + return super().get_actions(match) + [ + self.create_team_status("Floral Sidewinder") + ] class TrumpCardKitty(ElementalBurstBase): @@ -106,7 +106,7 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions(match, [self.create_summon("Cuilein-Anbar")]) + return super().get_actions(match) + [self.create_summon("Cuilein-Anbar")] # Talents diff --git a/src/lpsim/server/character/dendro/nahida_3_7.py b/src/lpsim/server/character/dendro/nahida_3_7.py index 5977870c..dfb5845a 100644 --- a/src/lpsim/server/character/dendro/nahida_3_7.py +++ b/src/lpsim/server/character/dendro/nahida_3_7.py @@ -73,7 +73,7 @@ def get_actions(self, match: Any) -> List[Actions]: ) ) # apply damage after apply status. - return super().get_actions(match, ret) + return super().get_actions(match) + ret class AllSchemesToKnowTathata(ElementalSkillBase): @@ -103,7 +103,7 @@ def get_actions(self, match: Any) -> List[Actions]: object_arguments={}, ) ) - return super().get_actions(match, ret) + return super().get_actions(match) + ret class IllusoryHeart(ElementalBurstBase): @@ -117,7 +117,7 @@ class IllusoryHeart(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_team_status("Shrine of Maya")]) + return super().get_actions(match) + [self.create_team_status("Shrine of Maya")] class TheSeedOfStoredKnowledge_3_7(SkillTalent): diff --git a/src/lpsim/server/character/dendro/tighnari_3_6.py b/src/lpsim/server/character/dendro/tighnari_3_6.py index 72a37ac4..2cd041de 100644 --- a/src/lpsim/server/character/dendro/tighnari_3_6.py +++ b/src/lpsim/server/character/dendro/tighnari_3_6.py @@ -50,12 +50,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, - [ - self.create_character_status("Vijnana Suffusion"), - ], - ) + return super().get_actions(match) + [ + self.create_character_status("Vijnana Suffusion"), + ] class FashionersTanglevineShaft(ElementalBurstBase, AOESkillBase): diff --git a/src/lpsim/server/character/dendro/yaoyao_4_1.py b/src/lpsim/server/character/dendro/yaoyao_4_1.py index 44f8c18f..edc0349c 100644 --- a/src/lpsim/server/character/dendro/yaoyao_4_1.py +++ b/src/lpsim/server/character/dendro/yaoyao_4_1.py @@ -104,7 +104,7 @@ class MoonjadeDescent(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_team_status("Adeptal Legacy")]) + return super().get_actions(match) + [self.create_team_status("Adeptal Legacy")] # Talents diff --git a/src/lpsim/server/character/electro/beidou_3_8.py b/src/lpsim/server/character/electro/beidou_3_8.py index ee30744d..776eb47c 100644 --- a/src/lpsim/server/character/electro/beidou_3_8.py +++ b/src/lpsim/server/character/electro/beidou_3_8.py @@ -76,12 +76,9 @@ class Stormbreaker(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_team_status("Thunderbeast's Targe"), - ], - ) + return super().get_actions(match) + [ + self.create_team_status("Thunderbeast's Targe"), + ] # Talents diff --git a/src/lpsim/server/character/electro/dori_4_2.py b/src/lpsim/server/character/electro/dori_4_2.py index 233ea606..ba88d020 100644 --- a/src/lpsim/server/character/electro/dori_4_2.py +++ b/src/lpsim/server/character/electro/dori_4_2.py @@ -84,9 +84,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, [self.create_summon("After-Sales Service Rounds")] - ) + return super().get_actions(match) + [ + self.create_summon("After-Sales Service Rounds") + ] class AlcazarzaraysExactitude(ElementalBurstBase): @@ -98,14 +98,11 @@ class AlcazarzaraysExactitude(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_summon( - "Jinni", {"talent_activated": self.is_talent_equipped(match)} - ) - ], - ) + return super().get_actions(match) + [ + self.create_summon( + "Jinni", {"talent_activated": self.is_talent_equipped(match)} + ) + ] # Talents diff --git a/src/lpsim/server/character/electro/electro_hypostasis_3_7.py b/src/lpsim/server/character/electro/electro_hypostasis_3_7.py index 22dea938..1f6bd490 100644 --- a/src/lpsim/server/character/electro/electro_hypostasis_3_7.py +++ b/src/lpsim/server/character/electro/electro_hypostasis_3_7.py @@ -90,9 +90,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create prepare skill """ - return super().get_actions( - match, [self.create_character_status("Rock-Paper-Scissors Combo: Scissors")] - ) + return super().get_actions(match) + [ + self.create_character_status("Rock-Paper-Scissors Combo: Scissors") + ] class RockPaperScissorsComboScissors(ElementalSkillBase): @@ -118,8 +118,8 @@ def get_actions(self, match: Any) -> List[Actions]: match, self.damage, self.damage_type, - [self.create_character_status("Rock-Paper-Scissors Combo: Paper")], - ) + ), + self.create_character_status("Rock-Paper-Scissors Combo: Paper"), ] @@ -157,9 +157,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, [self.create_summon("Chains of Warding Thunder")] - ) + return super().get_actions(match) + [ + self.create_summon("Chains of Warding Thunder") + ] class ElectroCrystalCore(CreateStatusPassiveSkill): diff --git a/src/lpsim/server/character/electro/fischl_3_3.py b/src/lpsim/server/character/electro/fischl_3_3.py index 45e6588b..3df65e52 100644 --- a/src/lpsim/server/character/electro/fischl_3_3.py +++ b/src/lpsim/server/character/electro/fischl_3_3.py @@ -37,7 +37,7 @@ class Nightrider(ElementalSkillBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_summon("Oz")]) + return super().get_actions(match) + [self.create_summon("Oz")] class MidnightPhantasmagoria(ElementalBurstBase, AOESkillBase): diff --git a/src/lpsim/server/character/electro/keqing_3_3.py b/src/lpsim/server/character/electro/keqing_3_3.py index 0dff36cc..a74e18a4 100644 --- a/src/lpsim/server/character/electro/keqing_3_3.py +++ b/src/lpsim/server/character/electro/keqing_3_3.py @@ -60,16 +60,13 @@ def get_actions(self, match: Any) -> List[Actions]: position = ObjectPosition( player_idx=self.position.player_idx, area=ObjectPositionType.HAND, id=-1 ) - return super().get_actions( - match, - [ - CreateObjectAction( - object_name="Lightning Stiletto", - object_position=position, - object_arguments={}, - ) - ], - ) + return super().get_actions(match) + [ + CreateObjectAction( + object_name="Lightning Stiletto", + object_position=position, + object_arguments={}, + ) + ] return super().get_actions(match) diff --git a/src/lpsim/server/character/electro/kujou_sara_3_5.py b/src/lpsim/server/character/electro/kujou_sara_3_5.py index f5fb2ab1..7c74de53 100644 --- a/src/lpsim/server/character/electro/kujou_sara_3_5.py +++ b/src/lpsim/server/character/electro/kujou_sara_3_5.py @@ -51,7 +51,7 @@ def event_handler_ROUND_END( damage_action = ret[0] assert damage_action.type == ActionTypes.MAKE_DAMAGE active_idx = match.player_tables[self.position.player_idx].active_character_idx - damage_action.create_objects.append( + ret.append( CreateObjectAction( object_name="Crowfeather Cover", object_position=ObjectPosition( @@ -86,7 +86,7 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions(match, [self.create_summon("Tengu Juurai: Ambush")]) + return super().get_actions(match) + [self.create_summon("Tengu Juurai: Ambush")] class SubjugationKoukouSendou(ElementalBurstBase): @@ -101,9 +101,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, [self.create_summon("Tengu Juurai: Stormcluster")] - ) + return super().get_actions(match) + [ + self.create_summon("Tengu Juurai: Stormcluster") + ] # Talents diff --git a/src/lpsim/server/character/electro/lisa_4_0.py b/src/lpsim/server/character/electro/lisa_4_0.py index 958353e5..c0d1d67e 100644 --- a/src/lpsim/server/character/electro/lisa_4_0.py +++ b/src/lpsim/server/character/electro/lisa_4_0.py @@ -59,9 +59,9 @@ def get_actions(self, match: Any) -> List[Actions]: if not match.player_tables[self.position.player_idx].charge_satisfied: # not charged attack return super().get_actions(match) - return super().get_actions( - match, [self.create_opposite_character_status(match, "Conductive", {})] - ) + return super().get_actions(match) + [ + self.create_opposite_character_status(match, "Conductive", {}) + ] class VioletArc(ElementalSkillBase): @@ -86,9 +86,9 @@ def get_actions(self, match: Any) -> List[Actions]: break if conductive is None: # no conductive - return super().get_actions( - match, [self.create_opposite_character_status(match, "Conductive", {})] - ) + return super().get_actions(match) + [ + self.create_opposite_character_status(match, "Conductive", {}) + ] else: # has conductive self.damage += conductive.usage @@ -107,7 +107,7 @@ class LightningRose(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_summon(self.name)]) + return super().get_actions(match) + [self.create_summon(self.name)] # Talents diff --git a/src/lpsim/server/character/electro/razor_3_8.py b/src/lpsim/server/character/electro/razor_3_8.py index 09a2f1c1..ed72b9bc 100644 --- a/src/lpsim/server/character/electro/razor_3_8.py +++ b/src/lpsim/server/character/electro/razor_3_8.py @@ -43,9 +43,9 @@ class LightningFang(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions( - match, [self.create_character_status("The Wolf Within")] - ) + return super().get_actions(match) + [ + self.create_character_status("The Wolf Within") + ] # Talents diff --git a/src/lpsim/server/character/electro/yae_miko_3_7.py b/src/lpsim/server/character/electro/yae_miko_3_7.py index cae31929..2c939a48 100644 --- a/src/lpsim/server/character/electro/yae_miko_3_7.py +++ b/src/lpsim/server/character/electro/yae_miko_3_7.py @@ -78,14 +78,10 @@ def get_actions(self, match: Any) -> List[Actions]: if sakura is not None: # destroy and add status ret = [RemoveObjectAction(object_position=sakura.position)] + ret - damage_action.create_objects.append( - self.create_team_status("Tenko Thunderbolts") - ) + ret.append(self.create_team_status("Tenko Thunderbolts")) if self.is_talent_equipped(match): # add status - damage_action.create_objects.append( - self.create_character_status("The Shrine's Sacred Shade") - ) + ret.append(self.create_character_status("The Shrine's Sacred Shade")) return ret diff --git a/src/lpsim/server/character/geo/arataki_itto_3_6.py b/src/lpsim/server/character/geo/arataki_itto_3_6.py index 79e5667c..9c1e3ef0 100644 --- a/src/lpsim/server/character/geo/arataki_itto_3_6.py +++ b/src/lpsim/server/character/geo/arataki_itto_3_6.py @@ -112,14 +112,10 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack, create Ushi and create status """ - ret = super().get_actions( - match, - [ - self.create_summon("Ushi"), - self.create_character_status("Superlative Superstrength"), - ], - ) - return ret + return super().get_actions(match) + [ + self.create_summon("Ushi"), + self.create_character_status("Superlative Superstrength"), + ] class RoyalDescentBeholdIttoTheEvil(ElementalBurstBase): @@ -137,14 +133,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create status """ - return super().get_actions( - match, - [ - self.create_character_status( - "Raging Oni King", {"version": self.version} - ) - ], - ) + return super().get_actions(match) + [ + self.create_character_status("Raging Oni King", {"version": self.version}) + ] # Talents diff --git a/src/lpsim/server/character/geo/ningguang_3_3.py b/src/lpsim/server/character/geo/ningguang_3_3.py index b1ca2386..17af59eb 100644 --- a/src/lpsim/server/character/geo/ningguang_3_3.py +++ b/src/lpsim/server/character/geo/ningguang_3_3.py @@ -35,12 +35,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, - [ - self.create_team_status(self.name), - ], - ) + return super().get_actions(match) + [ + self.create_team_status(self.name), + ] class Starshatter(ElementalBurstBase): diff --git a/src/lpsim/server/character/geo/noelle_3_3.py b/src/lpsim/server/character/geo/noelle_3_3.py index 89ca36d7..78aedde6 100644 --- a/src/lpsim/server/character/geo/noelle_3_3.py +++ b/src/lpsim/server/character/geo/noelle_3_3.py @@ -28,8 +28,7 @@ class Breastplate(ElementalSkillBase): cost: Cost = Cost(elemental_dice_number=3, elemental_dice_color=DieColor.GEO) def get_actions(self, match: Any) -> List[Actions]: - ret = super().get_actions(match, [self.create_team_status("Full Plate")]) - return ret + return super().get_actions(match) + [self.create_team_status("Full Plate")] class SweepingTime(ElementalBurstBase): @@ -41,10 +40,9 @@ class SweepingTime(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - ret = super().get_actions( - match, [self.create_character_status("Sweeping Time")] - ) - return ret + return super().get_actions(match) + [ + self.create_character_status("Sweeping Time") + ] class IGotYourBack_3_3(SkillTalent): diff --git a/src/lpsim/server/character/geo/zhongli_3_7.py b/src/lpsim/server/character/geo/zhongli_3_7.py index 1ac8028d..1bfc16b6 100644 --- a/src/lpsim/server/character/geo/zhongli_3_7.py +++ b/src/lpsim/server/character/geo/zhongli_3_7.py @@ -56,7 +56,7 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions(match, [self.create_summon("Stone Stele")]) + return super().get_actions(match) + [self.create_summon("Stone Stele")] class DominusLapidisStrikingStone(ElementalSkillBase): @@ -69,10 +69,10 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, - [self.create_summon("Stone Stele"), self.create_team_status("Jade Shield")], - ) + return super().get_actions(match) + [ + self.create_summon("Stone Stele"), + self.create_team_status("Jade Shield"), + ] class PlanetBefall(ElementalBurstBase): @@ -87,9 +87,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack target, and create status for target """ - return super().get_actions( - match, [self.create_opposite_character_status(match, "Petrification", {})] - ) + return super().get_actions(match) + [ + self.create_opposite_character_status(match, "Petrification", {}) + ] # Talents diff --git a/src/lpsim/server/character/hydro/barbara_3_3.py b/src/lpsim/server/character/hydro/barbara_3_3.py index 6106b5df..f13183d8 100644 --- a/src/lpsim/server/character/hydro/barbara_3_3.py +++ b/src/lpsim/server/character/hydro/barbara_3_3.py @@ -81,8 +81,7 @@ class LetTheShowBegin(ElementalSkillBase): cost: Cost = Cost(elemental_dice_number=3, elemental_dice_color=DieColor.HYDRO) def get_actions(self, match: Any) -> List[Actions]: - ret = super().get_actions(match, [self.create_summon("Melody Loop")]) - return ret + return super().get_actions(match) + [self.create_summon("Melody Loop")] class ShiningMiracle(ElementalBurstBase): diff --git a/src/lpsim/server/character/hydro/candace_3_8.py b/src/lpsim/server/character/hydro/candace_3_8.py index 582aa1be..e50fae03 100644 --- a/src/lpsim/server/character/hydro/candace_3_8.py +++ b/src/lpsim/server/character/hydro/candace_3_8.py @@ -75,12 +75,9 @@ class SacredRiteWagtailsTide(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_team_status("Prayer of the Crimson Crown"), - ], - ) + return super().get_actions(match) + [ + self.create_team_status("Prayer of the Crimson Crown"), + ] # Talents diff --git a/src/lpsim/server/character/hydro/kamisato_ayato_3_6.py b/src/lpsim/server/character/hydro/kamisato_ayato_3_6.py index 203a7483..efb71142 100644 --- a/src/lpsim/server/character/hydro/kamisato_ayato_3_6.py +++ b/src/lpsim/server/character/hydro/kamisato_ayato_3_6.py @@ -28,12 +28,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, - [ - self.create_character_status("Takimeguri Kanka"), - ], - ) + return super().get_actions(match) + [ + self.create_character_status("Takimeguri Kanka"), + ] class KamisatoAyato_3_6(KA_4_1): diff --git a/src/lpsim/server/character/hydro/kamisato_ayato_4_1.py b/src/lpsim/server/character/hydro/kamisato_ayato_4_1.py index 82889a40..ff359ff6 100644 --- a/src/lpsim/server/character/hydro/kamisato_ayato_4_1.py +++ b/src/lpsim/server/character/hydro/kamisato_ayato_4_1.py @@ -61,14 +61,11 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, - [ - self.create_character_status( - "Takimeguri Kanka", {"usage": 3, "max_usage": 3} - ), - ], - ) + return super().get_actions(match) + [ + self.create_character_status( + "Takimeguri Kanka", {"usage": 3, "max_usage": 3} + ), + ] class KamisatoArtSuiyuu(ElementalBurstBase): @@ -80,7 +77,7 @@ class KamisatoArtSuiyuu(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_summon("Garden of Purity")]) + return super().get_actions(match) + [self.create_summon("Garden of Purity")] # Talents diff --git a/src/lpsim/server/character/hydro/mirror_maiden_3_7.py b/src/lpsim/server/character/hydro/mirror_maiden_3_7.py index b3b835ac..0652f388 100644 --- a/src/lpsim/server/character/hydro/mirror_maiden_3_7.py +++ b/src/lpsim/server/character/hydro/mirror_maiden_3_7.py @@ -61,8 +61,10 @@ def get_actions(self, match: Any) -> List[Actions]: ): # attach to same character, do not remove ret = [] - return ret + super().get_actions( - match, [self.create_opposite_character_status(match, "Refraction", args)] + return ( + ret + + super().get_actions(match) + + [self.create_opposite_character_status(match, "Refraction", args)] ) diff --git a/src/lpsim/server/character/hydro/mona_3_3.py b/src/lpsim/server/character/hydro/mona_3_3.py index a7151633..1b8341c3 100644 --- a/src/lpsim/server/character/hydro/mona_3_3.py +++ b/src/lpsim/server/character/hydro/mona_3_3.py @@ -53,7 +53,7 @@ class MirrorReflectionOfDoom(ElementalSkillBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_summon("Reflection")]) + return super().get_actions(match) + [self.create_summon("Reflection")] class StellarisPhantasm(ElementalBurstBase): @@ -67,7 +67,7 @@ class StellarisPhantasm(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_team_status("Illusory Bubble")]) + return super().get_actions(match) + [self.create_team_status("Illusory Bubble")] class IllusoryTorrent(PassiveSkillBase): diff --git a/src/lpsim/server/character/hydro/nilou_4_2.py b/src/lpsim/server/character/hydro/nilou_4_2.py index 330ee14a..8f08eaca 100644 --- a/src/lpsim/server/character/hydro/nilou_4_2.py +++ b/src/lpsim/server/character/hydro/nilou_4_2.py @@ -61,9 +61,9 @@ def get_actions(self, match: Any) -> List[Actions]: break if all_hydro_dendro: # first generate team status, then attack - return super().get_actions( - match, [self.create_team_status("Golden Chalice's Bounty")] - ) + return super().get_actions(match) + [ + self.create_team_status("Golden Chalice's Bounty") + ] return super().get_actions(match) @@ -78,9 +78,9 @@ class DanceOfAbzendegiDistantDreamsListeningSpring(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions( - match, [self.create_opposite_character_status(match, "Lingering Aeon")] - ) + return super().get_actions(match) + [ + self.create_opposite_character_status(match, "Lingering Aeon") + ] # Talents diff --git a/src/lpsim/server/character/hydro/sangonomiya_kokomi_3_5.py b/src/lpsim/server/character/hydro/sangonomiya_kokomi_3_5.py index 2e69a54f..d639bc15 100644 --- a/src/lpsim/server/character/hydro/sangonomiya_kokomi_3_5.py +++ b/src/lpsim/server/character/hydro/sangonomiya_kokomi_3_5.py @@ -19,12 +19,9 @@ def get_actions(self, match: Any) -> List[Actions]: """ No healing """ - return super(NA_3_6, self).get_actions( - match, - [ - self.create_character_status("Ceremonial Garment"), - ], - ) + return super(NA_3_6, self).get_actions(match) + [ + self.create_character_status("Ceremonial Garment"), + ] class TamakushiCasket_3_5(SkillTalent): diff --git a/src/lpsim/server/character/hydro/sangonomiya_kokomi_3_6.py b/src/lpsim/server/character/hydro/sangonomiya_kokomi_3_6.py index 37eb1541..d98cbb18 100644 --- a/src/lpsim/server/character/hydro/sangonomiya_kokomi_3_6.py +++ b/src/lpsim/server/character/hydro/sangonomiya_kokomi_3_6.py @@ -95,11 +95,10 @@ def get_actions(self, match: Any) -> List[Actions]: application and create object """ ret = [ - self.charge_self(1), self.element_application_self(match, DamageElementalType.HYDRO), + self.create_summon("Bake-Kurage"), + self.charge_self(1), ] - summon = self.create_summon("Bake-Kurage") - ret[1].create_objects.append(summon) return ret @@ -131,9 +130,7 @@ def get_actions(self, match: Any) -> List[Actions]: cost=Cost(), ) ) - damage_action.create_objects.append( - self.create_character_status("Ceremonial Garment") - ) + ret.append(self.create_character_status("Ceremonial Garment")) character = match.player_tables[self.position.player_idx].characters[ self.position.character_idx ] @@ -148,9 +145,7 @@ def get_actions(self, match: Any) -> List[Actions]: if talent.version == "3.5": # if has 3.5 talent, re-create Bake-Kurage if kurage_found: - damage_action.create_objects.append( - self.create_summon("Bake-Kurage") - ) + ret.append(self.create_summon("Bake-Kurage")) elif talent.version == "4.2": # with 4.2 talent if kurage_found is not None: @@ -162,7 +157,7 @@ def get_actions(self, match: Any) -> List[Actions]: ) else: # otherwise, create kurage with 1 usage - damage_action.create_objects.append( + ret.append( self.create_summon( "Bake-Kurage", { diff --git a/src/lpsim/server/character/hydro/xingqiu_3_3.py b/src/lpsim/server/character/hydro/xingqiu_3_3.py index 87d77673..54b815fe 100644 --- a/src/lpsim/server/character/hydro/xingqiu_3_3.py +++ b/src/lpsim/server/character/hydro/xingqiu_3_3.py @@ -22,8 +22,8 @@ def get_actions(self, match: Any) -> List[Actions]: match, self.damage, self.damage_type, - [self.create_team_status("Rainbow Bladework", {"version": "3.3"})], ), + self.create_team_status("Rainbow Bladework", {"version": "3.3"}), self.element_application_self(match, DamageElementalType.HYDRO), ] diff --git a/src/lpsim/server/character/hydro/xingqiu_4_1.py b/src/lpsim/server/character/hydro/xingqiu_4_1.py index 8b122aef..7bd0ba19 100644 --- a/src/lpsim/server/character/hydro/xingqiu_4_1.py +++ b/src/lpsim/server/character/hydro/xingqiu_4_1.py @@ -51,7 +51,7 @@ def get_actions(self, match: Any) -> List[Actions]: ] talent = character.talent if talent is not None: - ret[0].create_objects += [ + ret.append( self.create_team_status( "Rain Sword", { @@ -60,11 +60,9 @@ def get_actions(self, match: Any) -> List[Actions]: "max_usage": 3, }, ) - ] + ) else: - ret[0].create_objects += [ - self.create_team_status("Rain Sword", {"version": "3.3"}) - ] + ret.append(self.create_team_status("Rain Sword", {"version": "3.3"})) return ret @@ -86,7 +84,7 @@ def get_actions(self, match: Any) -> List[Actions]: ] ele_app = self.element_application_self(match, DamageElementalType.HYDRO) ret[1].damage_value_list += ele_app.damage_value_list - ret[1].create_objects += [self.create_team_status("Rainbow Bladework")] + ret.append(self.create_team_status("Rainbow Bladework")) return ret diff --git a/src/lpsim/server/character/pyro/abyss_lector_fathomless_flames_3_7.py b/src/lpsim/server/character/pyro/abyss_lector_fathomless_flames_3_7.py index 2345de68..e460717a 100644 --- a/src/lpsim/server/character/pyro/abyss_lector_fathomless_flames_3_7.py +++ b/src/lpsim/server/character/pyro/abyss_lector_fathomless_flames_3_7.py @@ -54,7 +54,7 @@ class OminousStar(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_summon("Darkfire Furnace")]) + return super().get_actions(match) + [self.create_summon("Darkfire Furnace")] class FieryRebirth(CreateStatusPassiveSkill): diff --git a/src/lpsim/server/character/pyro/bennett_3_3.py b/src/lpsim/server/character/pyro/bennett_3_3.py index 16151c94..c5c33e92 100644 --- a/src/lpsim/server/character/pyro/bennett_3_3.py +++ b/src/lpsim/server/character/pyro/bennett_3_3.py @@ -36,15 +36,12 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, - [ - self.create_team_status( - "Inspiration Field", - {"talent_activated": self.is_talent_equipped(match)}, - ) - ], - ) + return super().get_actions(match) + [ + self.create_team_status( + "Inspiration Field", + {"talent_activated": self.is_talent_equipped(match)}, + ) + ] # Talents diff --git a/src/lpsim/server/character/pyro/dehya_4_1.py b/src/lpsim/server/character/pyro/dehya_4_1.py index 8c0d9f05..feaf5e75 100644 --- a/src/lpsim/server/character/pyro/dehya_4_1.py +++ b/src/lpsim/server/character/pyro/dehya_4_1.py @@ -62,12 +62,9 @@ def get_actions(self, match: Any) -> List[Actions]: break if summon_exists: # make damage and create summon - return super().get_actions( - match, - [ - self.create_summon(summon_name), - ], - ) + return super().get_actions(match) + [ + self.create_summon(summon_name), + ] return [self.create_summon(summon_name), self.charge_self(1)] @@ -80,12 +77,9 @@ class LeonineBite(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_character_status("Incineration Drive"), - ], - ) + return super().get_actions(match) + [ + self.create_character_status("Incineration Drive"), + ] class IncinerationDrive(ElementalBurstBase): diff --git a/src/lpsim/server/character/pyro/diluc_3_3.py b/src/lpsim/server/character/pyro/diluc_3_3.py index 32e100b2..cd520a09 100644 --- a/src/lpsim/server/character/pyro/diluc_3_3.py +++ b/src/lpsim/server/character/pyro/diluc_3_3.py @@ -101,14 +101,9 @@ class Dawn(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_character_status( - "Pyro Elemental Infusion", {"mark": "Diluc"} - ) - ], - ) + return super().get_actions(match) + [ + self.create_character_status("Pyro Elemental Infusion", {"mark": "Diluc"}) + ] # Talents diff --git a/src/lpsim/server/character/pyro/fatui_pyro_agent_3_3.py b/src/lpsim/server/character/pyro/fatui_pyro_agent_3_3.py index a2e75105..78224137 100644 --- a/src/lpsim/server/character/pyro/fatui_pyro_agent_3_3.py +++ b/src/lpsim/server/character/pyro/fatui_pyro_agent_3_3.py @@ -37,7 +37,7 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions(match, [self.create_character_status("Stealth")]) + return super().get_actions(match) + [self.create_character_status("Stealth")] class StealthMaster(CreateStatusPassiveSkill): diff --git a/src/lpsim/server/character/pyro/klee_3_4.py b/src/lpsim/server/character/pyro/klee_3_4.py index 5dcc727f..7e61a8e6 100644 --- a/src/lpsim/server/character/pyro/klee_3_4.py +++ b/src/lpsim/server/character/pyro/klee_3_4.py @@ -39,18 +39,15 @@ def get_actions(self, match: Any) -> List[Actions]: status_usage = 1 if self.is_talent_equipped(match): status_usage = 2 - return super().get_actions( - match, - [ - self.create_character_status( - "Explosive Spark", - { - "usage": status_usage, - "max_usage": status_usage, - }, - ) - ], - ) + return super().get_actions(match) + [ + self.create_character_status( + "Explosive Spark", + { + "usage": status_usage, + "max_usage": status_usage, + }, + ) + ] class SparksNSplash(ElementalBurstBase): @@ -70,14 +67,11 @@ def get_actions(self, match: Any) -> List[Actions]: area=ObjectPositionType.TEAM_STATUS, id=-1, ) - return super().get_actions( - match, - [ - CreateObjectAction( - object_name=self.name, object_position=position, object_arguments={} - ) - ], - ) + return super().get_actions(match) + [ + CreateObjectAction( + object_name=self.name, object_position=position, object_arguments={} + ) + ] # Talents diff --git a/src/lpsim/server/character/pyro/xiangling_3_8.py b/src/lpsim/server/character/pyro/xiangling_3_8.py index 16913b49..cbe1fc9a 100644 --- a/src/lpsim/server/character/pyro/xiangling_3_8.py +++ b/src/lpsim/server/character/pyro/xiangling_3_8.py @@ -58,7 +58,7 @@ def get_actions(self, match: Any) -> List[Actions]: ret = super().get_actions(match) damage_action = ret[0] assert damage_action.type == ActionTypes.MAKE_DAMAGE - damage_action.create_objects.append(self.create_summon("Guoba")) + ret.append(self.create_summon("Guoba")) else: ret: List[Actions] = [self.create_summon("Guoba"), self.charge_self(1)] return ret @@ -73,7 +73,7 @@ class Pyronado(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions(match, [self.create_team_status("Pyronado")]) + return super().get_actions(match) + [self.create_team_status("Pyronado")] # Talents diff --git a/src/lpsim/server/character/pyro/yanfei_3_8.py b/src/lpsim/server/character/pyro/yanfei_3_8.py index 1fdf8160..39795330 100644 --- a/src/lpsim/server/character/pyro/yanfei_3_8.py +++ b/src/lpsim/server/character/pyro/yanfei_3_8.py @@ -43,17 +43,14 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, - [ - self.create_character_status( - "Scarlet Seal", - { - "version": self.version, - }, - ) - ], - ) + return super().get_actions(match) + [ + self.create_character_status( + "Scarlet Seal", + { + "version": self.version, + }, + ) + ] class DoneDeal(ElementalBurstBase): @@ -65,13 +62,10 @@ class DoneDeal(ElementalBurstBase): ) def get_actions(self, match: Any) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_character_status("Scarlet Seal"), - self.create_character_status("Brilliance"), - ], - ) + return super().get_actions(match) + [ + self.create_character_status("Scarlet Seal"), + self.create_character_status("Brilliance"), + ] # Talents diff --git a/src/lpsim/server/character/pyro/yoimiya_3_8.py b/src/lpsim/server/character/pyro/yoimiya_3_8.py index a82dafaf..1927d203 100644 --- a/src/lpsim/server/character/pyro/yoimiya_3_8.py +++ b/src/lpsim/server/character/pyro/yoimiya_3_8.py @@ -69,7 +69,7 @@ def get_actions(self, match: Any) -> List[Actions]: """ Attack and create object """ - return super().get_actions(match, [self.create_team_status("Aurous Blaze")]) + return super().get_actions(match) + [self.create_team_status("Aurous Blaze")] # Talents diff --git a/src/lpsim/server/match.py b/src/lpsim/server/match.py index 0255994d..f4d4155a 100644 --- a/src/lpsim/server/match.py +++ b/src/lpsim/server/match.py @@ -2388,7 +2388,6 @@ def _action_make_damage( ) sw_events = self._action_switch_character(sw_action) events += sw_events - create_objects += action.create_objects for co_action in create_objects: co_events = self._action_create_object(co_action) events += co_events diff --git a/src/lpsim/server/patch/v43/characters/alhaitham_4_3.py b/src/lpsim/server/patch/v43/characters/alhaitham_4_3.py index a927ec3c..d2f82642 100644 --- a/src/lpsim/server/patch/v43/characters/alhaitham_4_3.py +++ b/src/lpsim/server/patch/v43/characters/alhaitham_4_3.py @@ -100,9 +100,9 @@ class UniversalityAnElaborationOnForm(ElementalSkillBase): cost: Cost = Cost(elemental_dice_color=DieColor.DENDRO, elemental_dice_number=3) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions( - match, [self.create_character_status("Chisel-Light Mirror")] - ) + return super().get_actions(match) + [ + self.create_character_status("Chisel-Light Mirror") + ] class ParticularFieldFettersOfPhenomena(ElementalBurstBase): @@ -126,10 +126,9 @@ def get_actions(self, match: Match) -> List[Actions]: break if status is None: # attack and create 3-stack status - return super().get_actions( - match, - [self.create_character_status("Chisel-Light Mirror", {"usage": 3})], - ) + return super().get_actions(match) + [ + self.create_character_status("Chisel-Light Mirror", {"usage": 3}) + ] else: # attack and change status usage has_talent = self.is_talent_equipped(match) diff --git a/src/lpsim/server/patch/v43/characters/azhdaha_4_3.py b/src/lpsim/server/patch/v43/characters/azhdaha_4_3.py index 27b24574..7e0b6570 100644 --- a/src/lpsim/server/patch/v43/characters/azhdaha_4_3.py +++ b/src/lpsim/server/patch/v43/characters/azhdaha_4_3.py @@ -260,10 +260,9 @@ def is_valid(self, match: Match) -> bool: raise AssertionError("Stone Facets: Elemental Absorption not found") def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions( - match, - [self.create_character_status("Stone Facets: Elemental Crystallization")], - ) + return super().get_actions(match) + [ + self.create_character_status("Stone Facets: Elemental Crystallization") + ] class DecimatingRockfall(ElementalBurstBase): diff --git a/src/lpsim/server/patch/v43/characters/dvalin_4_3.py b/src/lpsim/server/patch/v43/characters/dvalin_4_3.py index 26bcc4c1..1088a721 100644 --- a/src/lpsim/server/patch/v43/characters/dvalin_4_3.py +++ b/src/lpsim/server/patch/v43/characters/dvalin_4_3.py @@ -96,9 +96,9 @@ class TempestuousBarrage(ElementalSkillBase): ) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions( - match, [self.create_opposite_character_status(match, "Total Collapse", {})] - ) + return super().get_actions(match) + [ + self.create_opposite_character_status(match, "Total Collapse", {}) + ] class DvalinsCleansing(ElementalSkillBase): @@ -111,9 +111,9 @@ class DvalinsCleansing(ElementalSkillBase): ) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions( - match, [self.create_character_status("Perpetual Cleansing", {})] - ) + return super().get_actions(match) + [ + self.create_character_status("Perpetual Cleansing", {}) + ] class PerpetualCleansing(ElementalSkillBase): @@ -142,8 +142,8 @@ def get_actions(self, match: Match) -> List[Actions]: cost=self.cost.copy(), ) ], - create_objects=[self.create_character_status("Ultimate Cleansing", {})], ), + self.create_character_status("Ultimate Cleansing", {}), ] @@ -196,7 +196,7 @@ def get_actions(self, match: Match) -> List[Actions]: if character.is_defeated: continue # apply status - damage_action.create_objects.append( + ret.append( CreateObjectAction( object_name="Total Collapse", object_position=character.position.set_area( diff --git a/src/lpsim/server/patch/v43/characters/eremite_scorching_loremaster_4_3.py b/src/lpsim/server/patch/v43/characters/eremite_scorching_loremaster_4_3.py index f5224fac..1a19387e 100644 --- a/src/lpsim/server/patch/v43/characters/eremite_scorching_loremaster_4_3.py +++ b/src/lpsim/server/patch/v43/characters/eremite_scorching_loremaster_4_3.py @@ -138,14 +138,9 @@ def get_actions(self, match: Match) -> List[Actions]: summon_desc = "" if self.is_talent_equipped(match): summon_desc = "talent" - return super().get_actions( - match, - [ - self.create_summon( - "Spirit of Omen: Pyro Scorpion", {"desc": summon_desc} - ) - ], - ) + return super().get_actions(match) + [ + self.create_summon("Spirit of Omen: Pyro Scorpion", {"desc": summon_desc}) + ] class SpiritOfOmensPower(PassiveSkillBase): diff --git a/src/lpsim/server/patch/v43/characters/gorou_4_3.py b/src/lpsim/server/patch/v43/characters/gorou_4_3.py index 85498c1c..39c9c37a 100644 --- a/src/lpsim/server/patch/v43/characters/gorou_4_3.py +++ b/src/lpsim/server/patch/v43/characters/gorou_4_3.py @@ -92,7 +92,7 @@ def event_handler_ROUND_END( if character.element == ElementType.GEO: geo_number += 1 if geo_number >= 2: - damage_action.create_objects.append( + ret.append( CreateObjectAction( object_name="Crystallize", object_position=ObjectPosition( @@ -116,9 +116,9 @@ class InuzakaAllRoundDefense(ElementalSkillBase): ) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions( - match, [self.create_team_status("General's War Banner")] - ) + return super().get_actions(match) + [ + self.create_team_status("General's War Banner") + ] class JuugaForwardUntoVictory(ElementalBurstBase): @@ -130,13 +130,10 @@ class JuugaForwardUntoVictory(ElementalBurstBase): ) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_team_status("General's War Banner"), - self.create_summon("General's Glory"), - ], - ) + return super().get_actions(match) + [ + self.create_team_status("General's War Banner"), + self.create_summon("General's Glory"), + ] class RushingHoundSwiftAsTheWind_4_3(SkillTalent): diff --git a/src/lpsim/server/patch/v43/characters/layla_4_3.py b/src/lpsim/server/patch/v43/characters/layla_4_3.py index 06df1ba3..0b4f0f61 100644 --- a/src/lpsim/server/patch/v43/characters/layla_4_3.py +++ b/src/lpsim/server/patch/v43/characters/layla_4_3.py @@ -174,12 +174,9 @@ class DreamOfTheStarStreamShaker(ElementalBurstBase): ) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_summon("Celestial Dreamsphere"), - ], - ) + return super().get_actions(match) + [ + self.create_summon("Celestial Dreamsphere"), + ] class LightsRemit_4_3(SkillTalent): diff --git a/src/lpsim/server/patch/v43/characters/lynette_4_3.py b/src/lpsim/server/patch/v43/characters/lynette_4_3.py index 084d792e..40e4a660 100644 --- a/src/lpsim/server/patch/v43/characters/lynette_4_3.py +++ b/src/lpsim/server/patch/v43/characters/lynette_4_3.py @@ -149,7 +149,7 @@ def get_actions(self, match: Match) -> List[Actions]: # first use, heal 2 hp and attach status heal = self.attack_self(match, -2) damage_action.damage_value_list += heal.damage_value_list - damage_action.create_objects.append( + ret.append( CreateObjectAction( object_name="Overawing Assault", object_position=character.position.set_area( @@ -170,7 +170,7 @@ class MagicTrickAstonishingShift(ElementalBurstBase): damage_type: DamageElementalType = DamageElementalType.ANEMO def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions(match, [self.create_summon("Bogglecat Box", {})]) + return super().get_actions(match) + [self.create_summon("Bogglecat Box", {})] class AColdBladeLikeAShadow_4_3(SkillTalent): diff --git a/src/lpsim/server/patch/v43/characters/lyney_4_3.py b/src/lpsim/server/patch/v43/characters/lyney_4_3.py index 69e2fcc1..94c92681 100644 --- a/src/lpsim/server/patch/v43/characters/lyney_4_3.py +++ b/src/lpsim/server/patch/v43/characters/lyney_4_3.py @@ -128,7 +128,7 @@ def get_actions(self, match: Match) -> List[Actions]: ret = super().get_actions(match) damage_action = ret[0] assert damage_action.type == ActionTypes.MAKE_DAMAGE - damage_action.create_objects += [ + ret += [ self.create_summon("Grin-Malkin Hat"), self.create_character_status("Prop Surplus"), ] @@ -152,7 +152,7 @@ def get_actions(self, match: Match) -> List[Actions]: ret = super().get_actions(match) damage_action = ret[1] assert damage_action.type == ActionTypes.MAKE_DAMAGE - damage_action.create_objects += [ + ret += [ self.create_summon("Grin-Malkin Hat"), self.create_character_status("Prop Surplus"), ] diff --git a/src/lpsim/server/patch/v43/characters/signora_4_3.py b/src/lpsim/server/patch/v43/characters/signora_4_3.py index c3c9fb25..08a40f84 100644 --- a/src/lpsim/server/patch/v43/characters/signora_4_3.py +++ b/src/lpsim/server/patch/v43/characters/signora_4_3.py @@ -257,9 +257,9 @@ def get_actions(self, match: Match) -> List[Actions]: status_name = "Blazing Heat" else: raise AssertionError(f"Unknown damage type {self.damage_type}") - return super().get_actions( - match, [self.create_opposite_character_status(match, status_name)] - ) + return super().get_actions(match) + [ + self.create_opposite_character_status(match, status_name) + ] class CarmineChrysalis(SignoraSkillValidCheck, ElementalBurstBase): diff --git a/src/lpsim/server/patch/v43/characters/thunder_manifestation_4_3.py b/src/lpsim/server/patch/v43/characters/thunder_manifestation_4_3.py index be1e6013..d83163c4 100644 --- a/src/lpsim/server/patch/v43/characters/thunder_manifestation_4_3.py +++ b/src/lpsim/server/patch/v43/characters/thunder_manifestation_4_3.py @@ -237,12 +237,9 @@ class ThunderingShackles(ElementalBurstBase): ) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_summon("Thundering Shackles"), - ], - ) + return super().get_actions(match) + [ + self.create_summon("Thundering Shackles"), + ] class LightningProbe(PassiveSkillBase): diff --git a/src/lpsim/server/patch/v43/characters/yelan_4_3.py b/src/lpsim/server/patch/v43/characters/yelan_4_3.py index 16db4235..6d54d9f4 100644 --- a/src/lpsim/server/patch/v43/characters/yelan_4_3.py +++ b/src/lpsim/server/patch/v43/characters/yelan_4_3.py @@ -141,12 +141,9 @@ class DepthClarionDice(ElementalBurstBase): ) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_team_status("Exquisite Throw"), - ], - ) + return super().get_actions(match) + [ + self.create_team_status("Exquisite Throw"), + ] class Breakthrough(CreateStatusPassiveSkill): diff --git a/src/lpsim/server/patch/v44/characters/cryo_hypostasis_4_4.py b/src/lpsim/server/patch/v44/characters/cryo_hypostasis_4_4.py index a47b833d..50395aff 100644 --- a/src/lpsim/server/patch/v44/characters/cryo_hypostasis_4_4.py +++ b/src/lpsim/server/patch/v44/characters/cryo_hypostasis_4_4.py @@ -131,12 +131,9 @@ def get_actions(self, match: Match) -> List[Actions]: """ Attack and create object """ - return super().get_actions( - match, - [ - self.create_character_status("Overwhelming Ice"), - ], - ) + return super().get_actions(match) + [ + self.create_character_status("Overwhelming Ice"), + ] class PlungingIceShards(ElementalBurstBase, AOESkillBase): @@ -151,7 +148,7 @@ class PlungingIceShards(ElementalBurstBase, AOESkillBase): ) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions(match, [self.create_summon("Piercing Iceridge")]) + return super().get_actions(match) + [self.create_summon("Piercing Iceridge")] class CryocrystalCore(CreateStatusPassiveSkill): diff --git a/src/lpsim/server/patch/v44/characters/millennial_pearl_seahorse_4_4.py b/src/lpsim/server/patch/v44/characters/millennial_pearl_seahorse_4_4.py index 01f9f361..4991e34c 100644 --- a/src/lpsim/server/patch/v44/characters/millennial_pearl_seahorse_4_4.py +++ b/src/lpsim/server/patch/v44/characters/millennial_pearl_seahorse_4_4.py @@ -160,13 +160,10 @@ def get_actions(self, match: Match) -> List[Actions]: args: Dict[str, Any] = {"usage": 2} if self.is_talent_equipped(match): args["desc"] = "talent" - return super().get_actions( - match, - [ - self.create_character_status("Fontemer Pearl", args), - self.create_summon("Resonant Coral Orb"), - ], - ) + return super().get_actions(match) + [ + self.create_character_status("Fontemer Pearl", args), + self.create_summon("Resonant Coral Orb"), + ] class PearlArmor(CreateStatusPassiveSkill): diff --git a/src/lpsim/server/patch/v44/characters/sayu_4_4.py b/src/lpsim/server/patch/v44/characters/sayu_4_4.py index ba9a4447..5142d828 100644 --- a/src/lpsim/server/patch/v44/characters/sayu_4_4.py +++ b/src/lpsim/server/patch/v44/characters/sayu_4_4.py @@ -118,12 +118,9 @@ class YooHooArtFuuinDash(ElementalSkillBase): cost: Cost = Cost(elemental_dice_color=DieColor.ANEMO, elemental_dice_number=3) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_character_status("Fuufuu Whirlwind Kick"), - ], - ) + return super().get_actions(match) + [ + self.create_character_status("Fuufuu Whirlwind Kick"), + ] class FuufuuWhirlwindKick(ElementalSkillBase): @@ -160,12 +157,9 @@ class YoohooArtMujinaFlurry(ElementalBurstBase): ) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions( - match, - [ - self.create_summon("Muji-Muji Daruma"), - ], - ) + return super().get_actions(match) + [ + self.create_summon("Muji-Muji Daruma"), + ] class SkivingNewAndImproved_4_4(SkillTalent): diff --git a/src/lpsim/server/patch/v44/characters/thoma_4_4.py b/src/lpsim/server/patch/v44/characters/thoma_4_4.py index a45ffdd6..001a5564 100644 --- a/src/lpsim/server/patch/v44/characters/thoma_4_4.py +++ b/src/lpsim/server/patch/v44/characters/thoma_4_4.py @@ -56,19 +56,19 @@ class ScorchingOoyoroi_4_4(ExtraAttackTeamStatus, UsageTeamStatus): def event_handler_SKILL_END( self, event: SkillEndEventArguments, match: Match - ) -> List[MakeDamageAction | RemoveObjectAction]: + ) -> List[MakeDamageAction | RemoveObjectAction | CreateObjectAction]: skill = match.get_object(event.action.position) assert skill is not None if skill.name == "Crimson Ooyoroi": # Thoma use burst Crimson Ooyoroi return [] - ret: List[MakeDamageAction | RemoveObjectAction] = [] + ret: List[MakeDamageAction | RemoveObjectAction | CreateObjectAction] = [] ret += super().event_handler_SKILL_END(event, match) if len(ret) == 0: return ret damage_action = ret[0] assert damage_action.type == ActionTypes.MAKE_DAMAGE - damage_action.create_objects.append( + ret.append( CreateObjectAction( object_name="Blazing Barrier", object_position=ObjectPosition( @@ -89,7 +89,7 @@ class BlazingBlessing(ElementalSkillBase): cost: Cost = Cost(elemental_dice_color=DieColor.PYRO, elemental_dice_number=3) def get_actions(self, match: Match) -> List[Actions]: - return super().get_actions(match, [self.create_team_status("Blazing Barrier")]) + return super().get_actions(match) + [self.create_team_status("Blazing Barrier")] class CrimsonOoyoroi(ElementalBurstBase): @@ -110,13 +110,10 @@ def get_actions(self, match: Match) -> List[Actions]: "usage": 3, "max_usage": 3, } - return super().get_actions( - match, - [ - self.create_team_status("Blazing Barrier"), - self.create_team_status("Scorching Ooyoroi", status_args), - ], - ) + return super().get_actions(match) + [ + self.create_team_status("Blazing Barrier"), + self.create_team_status("Scorching Ooyoroi", status_args), + ] class ASubordinatesSkills_4_4(SkillTalent): diff --git a/templates/character.py b/templates/character.py index a362ec8c..8001f5dc 100644 --- a/templates/character.py +++ b/templates/character.py @@ -117,11 +117,10 @@ def get_actions(self, match: Match) -> List[Actions]: """ Attack and create object """ - return super().get_actions(match, [ - self.create_summon('...'), + return super().get_actions(match) + [self.create_summon('...'), self.create_character_status('...'), self.create_team_status('...'), - ]) + ] class ...(ElementalBurstBase): diff --git a/tests/server/cards/test_food.py b/tests/server/cards/test_food.py index 61bd46a6..3dc1927e 100644 --- a/tests/server/cards/test_food.py +++ b/tests/server/cards/test_food.py @@ -1407,7 +1407,7 @@ def test_guoba_egg(): # test_lotus_flower_crisp() # test_lotus_flower_crisp_and_reflection() # test_mond_hash() - # test_tandoori() + test_tandoori() # test_pizza() # test_full_and_tandoori() # test_north_chicken() diff --git a/tests/server/characters/cryo/test_ganyu.py b/tests/server/characters/cryo/test_ganyu.py index 195be5cf..bcefab60 100644 --- a/tests/server/characters/cryo/test_ganyu.py +++ b/tests/server/characters/cryo/test_ganyu.py @@ -374,5 +374,6 @@ def test_ganyu_mona(): if __name__ == "__main__": test_ganyu() + test_ganyu_2() test_ganyu_with_heavy_and_cryo_resonance() test_ganyu_mona() From e5cef37963e5ba394771946da15c51fd28b1bec9 Mon Sep 17 00:00:00 2001 From: zyr17 Date: Sun, 18 Feb 2024 11:12:02 +0800 Subject: [PATCH 4/8] chore: update comment --- src/lpsim/server/match.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lpsim/server/match.py b/src/lpsim/server/match.py index f4d4155a..5d05f1e4 100644 --- a/src/lpsim/server/match.py +++ b/src/lpsim/server/match.py @@ -2255,11 +2255,8 @@ def _action_make_damage( character change, i.e. overloaded, a SwitchCharacterEventArguments will be generated. 3. CreateObjectEventArguments: If this damage action contains create - object, i.e. massive skills that deal damage and create object, - or triggered dendro reaction, etc. A CreateObjectEventArguments + object, i.e. dendro reactions, a CreateObjectEventArguments will be generated. - NOTE: side effects by elemental reaction is handled by system event - handler, which is listening ReceiveDamageEventArguments. """ damage_lists = action.damage_value_list[:] switch_character: List[int] = [-1, -1] From 00dc42df2b3cfadd32eb744535fd8fb236d899a5 Mon Sep 17 00:00:00 2001 From: zyr17 Date: Sun, 18 Feb 2024 11:15:57 +0800 Subject: [PATCH 5/8] chore: fix import path --- http_room_serve.py | 2 +- http_test_serve.py | 6 +++--- ipynb/parse_name_type.ipynb | 4 ++-- templates/test.py | 6 ++++-- update.md | 7 +++++++ 5 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 update.md diff --git a/http_room_serve.py b/http_room_serve.py index 499be0a4..1de79b80 100644 --- a/http_room_serve.py +++ b/http_room_serve.py @@ -4,7 +4,7 @@ """ -from src.lpsim.network.http_room_server import HTTPRoomServer +from lpsim.network.http_room_server import HTTPRoomServer if __name__ == "__main__": diff --git a/http_test_serve.py b/http_test_serve.py index 7f85f129..acc62d15 100644 --- a/http_test_serve.py +++ b/http_test_serve.py @@ -1,6 +1,6 @@ -from src.lpsim.server.event_handler import OmnipotentGuideEventHandler_3_3 -from src.lpsim.network import HTTPServer -from src.lpsim.server.match import MatchConfig, Match +from lpsim.server.event_handler import OmnipotentGuideEventHandler_3_3 +from lpsim.network import HTTPServer +from lpsim.server.match import MatchConfig, Match from tests.utils_for_test import get_random_state import logging diff --git a/ipynb/parse_name_type.ipynb b/ipynb/parse_name_type.ipynb index ef81d132..0561a3b1 100644 --- a/ipynb/parse_name_type.ipynb +++ b/ipynb/parse_name_type.ipynb @@ -6,8 +6,8 @@ "metadata": {}, "outputs": [], "source": [ - "from src.lpsim.server import Cards, Summons, Characters, CharacterStatus, TeamStatus\n", - "from src.lpsim.server.consts import IconType\n", + "from lpsim.server import Cards, Summons, Characters, CharacterStatus, TeamStatus\n", + "from lpsim.server.consts import IconType\n", "from typing import get_type_hints\n", "import time\n", "import pydantic\n", diff --git a/templates/test.py b/templates/test.py index 37b19ad0..a10f587c 100644 --- a/templates/test.py +++ b/templates/test.py @@ -2,9 +2,11 @@ """ This file contains a template for writing tests. You can copy this file to tests/folder/test_xxx.py and modify it to write your own tests. + +NOTE: outdated, now better to use `do_log_tests` utility function to test on a log. """ -from src.lpsim.agents import InteractionAgent -from src.lpsim import Deck, Match, MatchState +from lpsim.agents import InteractionAgent +from lpsim import Deck, Match, MatchState from tests.utils_for_test import ( check_hp, get_random_state, get_test_id_from_command, make_respond, set_16_omni diff --git a/update.md b/update.md new file mode 100644 index 00000000..8acadec2 --- /dev/null +++ b/update.md @@ -0,0 +1,7 @@ +## 版更需要做的事 + +1. 从ambr获取最新的描述(可以优化成db,在正式上线后使用db内容) +2. 实现新卡和平衡性 +3. 更新`deck_code_data.json`,加入新卡顺序定义 +4. 更新腾讯云和机器人的图像资源。资源列表解包得到,用脚本比对增量文件并筛选(可以更新后用db数据) +5. 发版 From 074221c95d32a68c121860575ece95df494536cd Mon Sep 17 00:00:00 2001 From: zyr17 Date: Sun, 18 Feb 2024 11:19:18 +0800 Subject: [PATCH 6/8] test: restore missed tests --- tests/server/patch/v44/jsons/sayu.json | 74 ++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/tests/server/patch/v44/jsons/sayu.json b/tests/server/patch/v44/jsons/sayu.json index 9f443682..7862b766 100644 --- a/tests/server/patch/v44/jsons/sayu.json +++ b/tests/server/patch/v44/jsons/sayu.json @@ -667,6 +667,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -674,6 +675,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", + "TEST 6 p1 5", "sw_card", "TEST 1 10 10 10 10 10 10", "TEST 2 p0", @@ -683,6 +685,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -690,6 +693,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", + "TEST 6 p1 5", "choose 1", "TEST 1 10 10 10 10 10 10", "TEST 2 p0", @@ -699,6 +703,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -706,6 +711,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", + "TEST 6 p1 5", "skill 1 15 14 13", "TEST 1 10 10 10 10 10 10", "TEST 2 p0 0", @@ -715,6 +721,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1 1", "TEST 12 p1c0 HYDRO", @@ -722,6 +729,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", + "TEST 6 p1 4", "sw_char 0 12", "TEST 1 10 10 10 10 10 10", "TEST 2 p0 0", @@ -731,6 +739,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1 1", "TEST 12 p1c0 HYDRO", @@ -738,6 +747,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", + "TEST 6 p1 4", "skill 1 11 10 9", "TEST 1 7 10 10 7 9 9", "TEST 2 p0 0", @@ -747,6 +757,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1 1", "TEST 12 p1c0 HYDRO", @@ -754,6 +765,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 3", "sw_char 1 8", "TEST 1 7 8 10 7 9 9", "TEST 2 p0 0", @@ -763,6 +775,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -770,6 +783,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 3", "sw_char 0 7", "TEST 1 7 8 10 7 9 9", "TEST 2 p0 0", @@ -779,6 +793,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -786,6 +801,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 3", "card 1 0 6 5 4", "TEST 1 6 8 10 4 8 8", "TEST 2 p0 0", @@ -795,6 +811,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 6", "TEST 2 p1 2", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -802,6 +819,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 3", "skill 1 3 2 1", "TEST 1 6 8 10 3 7 5", "TEST 2 p0 0", @@ -811,6 +829,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 6", "TEST 2 p1 2", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -818,6 +837,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 3", "end", "TEST 1 5 8 10 5 7 4", "TEST 2 p0", @@ -827,6 +847,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 8", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0 HYDRO", @@ -834,6 +855,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 5", "skill 3 15 14 13", "TEST 1 4 8 10 4 6 3", "TEST 2 p0 2", @@ -843,6 +865,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0 1", "TEST 12 p1c0", @@ -850,6 +873,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 5", "skill 1 12 11 10", "TEST 1 0 8 10 1 6 3", "TEST 2 p0 2", @@ -858,6 +882,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -865,6 +890,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 5", "choose 1", "TEST 1 0 8 10 1 6 3", "TEST 2 p0 2", @@ -873,6 +899,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -880,6 +907,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 5", "skill 1 9 8 7", "TEST 1 0 8 10 0 6 3", "TEST 2 p0 2 1", @@ -888,12 +916,14 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 5", "end", "TEST 1 0 7 10 0 5 3", "TEST 2 p0 1", @@ -902,12 +932,14 @@ "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2 1", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 7", "skill 1 15 14 13", "TEST 1 0 7 10 0 5 2", "TEST 2 p0 1 1", @@ -916,12 +948,14 @@ "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2 1", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 7", "skill 1 12 11 10", "TEST 1 0 7 10 0 5 1", "TEST 2 p0 1 1", @@ -930,12 +964,14 @@ "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2 1", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 7", "end" ], [ @@ -947,6 +983,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -954,6 +991,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", + "TEST 6 p1 5", "sw_card 4 3", "TEST 1 10 10 10 10 10 10", "TEST 2 p0", @@ -963,6 +1001,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -970,6 +1009,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", + "TEST 6 p1 5", "choose 0", "TEST 1 10 10 10 9 10 10", "TEST 2 p0 1", @@ -979,6 +1019,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0", "TEST 12 p1c0 HYDRO", @@ -986,6 +1027,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", + "TEST 6 p1 5", "card 2 0", "TEST 1 10 10 10 10 10 10", "TEST 2 p0 1", @@ -995,6 +1037,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1002,6 +1045,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2", + "TEST 6 p1 4", "skill 1 15 14 13", "TEST 1 8 10 10 7 9 9", "TEST 2 p0 0", @@ -1011,6 +1055,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1018,6 +1063,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 4", "card 2 0 12 11 10", "TEST 1 7 8 10 7 9 9", "TEST 2 p0 0", @@ -1027,6 +1073,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 5", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1034,6 +1081,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 3", "sw_char 1 9", "TEST 1 7 8 10 6 8 8", "TEST 2 p0 0", @@ -1043,6 +1091,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 6", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1050,6 +1099,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 3", "sw_char 0 8", "TEST 1 7 8 10 6 8 8", "TEST 2 p0 0", @@ -1059,6 +1109,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 6", "TEST 2 p1", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1066,6 +1117,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 3", "skill 3 7 6 5", "TEST 1 6 8 10 4 8 8", "TEST 2 p0 0", @@ -1075,6 +1127,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 6", "TEST 2 p1 2", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1082,6 +1135,7 @@ "TEST 12 p1c1", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 3", "sw_char 2 4", "TEST 1 6 8 10 3 7 7", "TEST 2 p0 0", @@ -1091,6 +1145,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 6", "TEST 2 p1 2", "TEST 5 p1c0 1", "TEST 12 p1c0 HYDRO", @@ -1098,6 +1153,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2", + "TEST 6 p1 3", "end", "TEST 1 5 8 10 5 7 4", "TEST 2 p0", @@ -1107,6 +1163,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 8", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0 HYDRO", @@ -1114,6 +1171,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 5", "sw_char 0 15", "TEST 1 5 8 10 4 6 3", "TEST 2 p0 2", @@ -1123,6 +1181,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -1130,6 +1189,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 5", "skill 1 14 13 12", "TEST 1 2 8 10 1 6 3", "TEST 2 p0 2", @@ -1139,6 +1199,7 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 12 p1c0", @@ -1146,6 +1207,7 @@ "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 5", "skill 0 11 10 9", "TEST 1 0 8 10 0 6 3", "TEST 2 p0 2 1", @@ -1154,12 +1216,14 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 5", "choose 2", "TEST 1 0 8 10 0 6 3", "TEST 2 p0 2 1", @@ -1168,12 +1232,14 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1 1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 5", "end", "TEST 1 0 10 10 0 5 3", "TEST 2 p0 1", @@ -1182,12 +1248,14 @@ "TEST 12 p0c1", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 7", "skill 1 12 11 10", "TEST 1 0 7 10 0 5 2", "TEST 2 p0 1 1", @@ -1196,12 +1264,14 @@ "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2 1", "TEST 12 p1c2 HYDRO", + "TEST 6 p1 7", "end", "TEST 1 0 9 10 0 4 0", "TEST 2 p0 1", @@ -1210,11 +1280,13 @@ "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", + "TEST 6 p1 7", "choose 1", "TEST 1 0 9 10 0 3 0", "TEST 2 p0", @@ -1223,11 +1295,13 @@ "TEST 12 p0c1 PYRO", "TEST 5 p0c2", "TEST 12 p0c2", + "TEST 6 p0 10", "TEST 2 p1", "TEST 5 p1c0", "TEST 5 p1c1", "TEST 12 p1c1 HYDRO", "TEST 5 p1c2", + "TEST 6 p1 9", "card 0 0" ] ], From 263c42adf8d78073391c326963d206097123e52f Mon Sep 17 00:00:00 2001 From: zyr17 Date: Sun, 18 Feb 2024 11:24:42 +0800 Subject: [PATCH 7/8] fix: remove unused files --- update.md | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 update.md diff --git a/update.md b/update.md deleted file mode 100644 index 8acadec2..00000000 --- a/update.md +++ /dev/null @@ -1,7 +0,0 @@ -## 版更需要做的事 - -1. 从ambr获取最新的描述(可以优化成db,在正式上线后使用db内容) -2. 实现新卡和平衡性 -3. 更新`deck_code_data.json`,加入新卡顺序定义 -4. 更新腾讯云和机器人的图像资源。资源列表解包得到,用脚本比对增量文件并筛选(可以更新后用db数据) -5. 发版 From db9b65cd96aa39493f3252ebb0a64b9b15ce715d Mon Sep 17 00:00:00 2001 From: zyr17 Date: Sun, 18 Feb 2024 11:25:53 +0800 Subject: [PATCH 8/8] chore: update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e246b2bc..a2be1829 100644 --- a/.gitignore +++ b/.gitignore @@ -172,3 +172,4 @@ prof ZZZ Z2 *DS_Store +update.md