Skip to content

Commit

Permalink
fix Chef_Mao, Mushroom_Pizza, fix issue #14
Browse files Browse the repository at this point in the history
  • Loading branch information
WentDong committed Jul 4, 2024
1 parent fd5e817 commit b5ebb3e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class TulaytullahsRemembrance(WeaponCard):

def __init__(self) -> None:
super().__init__()
self.equipment_entity = TomeoftheEternalFlowWeapon
self.equipment_entity = TulaytullahsRemembrance

def on_played(self, game: 'GeniusGame') -> None:
super().on_played(game)
Expand Down
3 changes: 2 additions & 1 deletion genius_invocation/card/action/event/foods/Mushroom_Pizza.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ class Mushroom_Pizza(FoodCard):

def __init__(self) -> None:
super().__init__()
self.food_entity = Mushroom_Pizza_Entity



def on_played(self, game: 'GeniusGame'):
super().on_played(game)
self.food_entity = Mushroom_Pizza_Entity

def find_target(self, game: 'GeniusGame'):
target_list = []
Expand Down
3 changes: 2 additions & 1 deletion genius_invocation/card/action/support/companion/Chef_Mao.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def on_after(self, game:'GeniusGame'):
self.from_player.dice_zone.add(self.from_player.roll_dice(num=1, is_basic=True))
if self.usage_game > 0:
card = self.from_player.card_zone.find_card(card_type=ActionCardType.EVENT_FOOD)
self.from_player.hand_zone.add([card])
self.from_player.hand_zone.add(card)
self.usage_game = 0 # only once per support

def on_begin(self, game:'GeniusGame'):
if game.active_player_index == self.from_player.index:
Expand Down
5 changes: 3 additions & 2 deletions genius_invocation/game/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def roll_dice(self, num=8, is_basic=False, is_different=False,):
'''
if is_basic:
if is_different:
return self.game.random.choice(DICENUM-1, num, replace=False).tolist()
return self.game.random.randint(0, DICENUM-1, num).tolist()
return (self.game.random.choice(DICENUM-1, num, replace=False) + 1).tolist()
return self.game.random.randint(1, DICENUM, num).tolist()
if self.game.is_omni:
return [DiceType.OMNI.value for i in range(num)]
else:
Expand Down Expand Up @@ -229,6 +229,7 @@ def play_card(self, game: 'GeniusGame'):
else:
game.can_play_card = True
game.current_card = None #Finish use the card.
game.manager.invoke(EventType.AFTER_PLAY_CARD, game)

def change_character(self, game: 'GeniusGame'):
'''
Expand Down
2 changes: 1 addition & 1 deletion genius_invocation/game/zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def has_entity(self, entity: 'Entity'):

def add_entity(self, entity: 'Status', independent=False, **kwargs):
if independent or self.has_entity(entity.__class__) is None:
self.space.append(entity)
self.status_list.append(entity)
else:
self.has_entity(entity.__class__).update(**kwargs)

Expand Down
2 changes: 1 addition & 1 deletion genius_invocation/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def code_to_deck(code):
}
deck2 = {
'character': ['Neuvillette', 'Bennett', 'Qiqi'],
'action_card': ['VourukashasGlow' for i in range(30)]
'action_card': ['Chef_Mao' for i in range(15)] + ['Sweet_Madame' for _ in range(15)]
}
# deck2 = {
# 'character': ['Arataki_Itto', 'Dehya', 'Noelle'],
Expand Down
2 changes: 2 additions & 0 deletions genius_invocation/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def step_one_forward(self, action: Action):


if __name__ == '__main__':


base_dir = './Test'
package_dirs = ["./card/character/characters","./card/action/support/companion",
"./card/action/support/item","./card/action/support/location",
Expand Down

0 comments on commit b5ebb3e

Please sign in to comment.