diff --git a/genius_invocation/card/character/characters/Beidou.py b/genius_invocation/card/character/characters/Beidou.py index 420b6e2a..c34139e9 100644 --- a/genius_invocation/card/character/characters/Beidou.py +++ b/genius_invocation/card/character/characters/Beidou.py @@ -74,13 +74,13 @@ class TidecallerSurfEmbrace(Status): name_ch = "捉浪·涛拥之守" id = 140521 def __init__(self, game: 'GeniusGame', from_player: 'GeniusPlayer', from_character: 'Character', Next_Skill: 'CharacterSkill'): - assert self.from_character.character_zone.has_entity(ShieldTidecallerSurfEmbrace) is None + assert from_character.character_zone.has_entity(ShieldTidecallerSurfEmbrace) is None shield = ShieldTidecallerSurfEmbrace(game, from_player, from_character, self) - self.from_character.character_zone.add_entity(shield) # add shield before the status + from_character.character_zone.add_entity(shield) # add shield before the status super().__init__(game, from_player, from_character) self.skill = Next_Skill - + def on_call(self, game: 'GeniusGame'): self.skill.on_call(game) @@ -95,7 +95,7 @@ def update_listener_list(self): self.listeners = [ (EventType.AFTER_CHANGE_CHARACTER, ZoneType.CHARACTER_ZONE, self.after_change) ] - + def on_destroy(self, game: 'GeniusGame'): shield = self.from_character.character_zone.has_entity(ShieldTidecallerSurfEmbrace) if shield is not None: diff --git a/genius_invocation/card/character/characters/EmperorofFireandIron.py b/genius_invocation/card/character/characters/EmperorofFireandIron.py index 3bd3bbdb..01dd684b 100644 --- a/genius_invocation/card/character/characters/EmperorofFireandIron.py +++ b/genius_invocation/card/character/characters/EmperorofFireandIron.py @@ -165,6 +165,9 @@ def __init__(self, game:'GeniusGame', from_player: 'GeniusPlayer', from_characte super().__init__(game, from_player, from_character) self.current_usage = usage + def copy(self, game: 'GeniusGame'): + return ArmoredCrabCarapace(game, self.from_player, self.from_character, self.current_usage) + def update(self, add_usage=2): self.current_usage += add_usage @@ -221,14 +224,20 @@ def after_any_action(self, game: 'GeniusGame'): if isinstance(status, Shield) and not isinstance(status, ArmoredCrabCarapace): add_usage += 1 status.on_destroy(game) + # 方案二: 使用将螃蟹盾移除并继承可用次数 + if isinstance(status, Shield) and isinstance(status, ArmoredCrabCarapace): + add_usage += status.current_usage + status.on_destroy(game) # 检查天赋 if self.talent and add_usage>0: if self.talent_usage_round != game.round: self.talent_usage_round = game.round add_usage += 2 # 更新状态:重置盾的结算顺序至最后 - self.from_character.character_zone.add_entity( - ArmoredCrabCarapace(game, self.from_player, self, add_usage), replace_update=True, add_usage=add_usage + # 方案一: 使用replace_update=True + # 方案二: 使用将螃蟹盾移除并继承可用次数 + self.character_zone.add_entity( + ArmoredCrabCarapace(game, self.from_player, self, add_usage), replace_update=False, add_usage=add_usage ) def update_listener_list(self): diff --git a/genius_invocation/game/zone.py b/genius_invocation/game/zone.py index d195daa0..05e11e63 100644 --- a/genius_invocation/game/zone.py +++ b/genius_invocation/game/zone.py @@ -524,9 +524,9 @@ def add_entity(self, entity: 'Status', independent=False, replace_update=False, self.has_entity(entity.__class__).update(**kwargs) if replace_update: old_entity = self.has_entity(entity.__class__) - new_entity = copy.deepcopy(old_entity) + new_entity = old_entity.copy(self.game) old_entity.on_destroy(self.game) - self.status_list.appendd(new_entity) + self.status_list.append(new_entity) def clear(self, game:'GeniusGame'): diff --git a/genius_invocation/main.py b/genius_invocation/main.py index 1c8fc14b..e1c7c6a3 100644 --- a/genius_invocation/main.py +++ b/genius_invocation/main.py @@ -181,8 +181,8 @@ def code_to_deck(code): 'PaidinFull','PaidinFull','Send_Off','Starsigns','Starsigns'] } deck2 = { - 'character': ['KaedeharaKazuha', 'Xingqiu', 'EmperorofFireandIron'], - 'action_card': ['Chef_Mao' for i in range(15)] + ['Sweet_Madame' for _ in range(15)] + 'character': ['EmperorofFireandIron', 'Beidou', 'Xingqiu'], + 'action_card': ['Lotus_Flower_Crisp' for i in range(30)] } # deck2 = { # 'character': ['Arataki_Itto', 'Dehya', 'Noelle'],