-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
370 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
genius_invocation/card/action/support/companion/SirArthur.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from genius_invocation.utils import * | ||
from genius_invocation.card.action.support.base import SupportCard | ||
from genius_invocation.card.action.base import ActionCard | ||
from typing import TYPE_CHECKING | ||
from genius_invocation.entity.support import Support | ||
from genius_invocation.entity.status import Combat_Status | ||
from copy import deepcopy | ||
|
||
if TYPE_CHECKING: | ||
from genius_invocation.game.game import GeniusGame | ||
from genius_invocation.game.player import GeniusPlayer | ||
|
||
class SirArthurEntity(Support): | ||
name: str = 'Sir Arthur' | ||
name_ch = '亚瑟先生' | ||
max_count = 2 | ||
def __init__(self, game: 'GeniusGame', from_player: 'GeniusPlayer', from_character=None): | ||
super().__init__(game, from_player, from_character) | ||
self.news_lead = 0 | ||
|
||
def on_tune_card(self, game: 'GeniusGame'): | ||
if game.active_player_index == self.from_player.index: | ||
self.news_lead = min(self.max_count, self.news_lead + 1) | ||
|
||
def on_discard_card(self, game: 'GeniusGame'): | ||
if game.active_player_index == self.from_player.index: | ||
self.news_lead = min(self.max_count, self.news_lead + 1) | ||
|
||
def on_end(self, game: 'GeniusGame'): | ||
if game.active_player_index == self.from_player.index: | ||
if self.news_lead == self.max_count: | ||
self.news_lead = 0 | ||
card = get_opponent(game).card_zone.card[0] | ||
self.from_player.hand_zone.add([deepcopy(card)]) | ||
|
||
def update_listener_list(self): | ||
self.listeners = [ | ||
(EventType.ON_TUNE_CARD, ZoneType.SUPPORT_ZONE, self.on_tune_card), | ||
(EventType.ON_DISCARD_CARD, ZoneType.SUPPORT_ZONE, self.on_discard_card), | ||
(EventType.END_PHASE, ZoneType.SUPPORT_ZONE, self.on_end), | ||
] | ||
|
||
class SirArthur(SupportCard): | ||
id: int = 322026 | ||
name: str = 'Sir Arthur' | ||
name_ch = '亚瑟先生' | ||
cost_num = 0 | ||
cost_type = None | ||
card_type = ActionCardType.SUPPORT_COMPANION | ||
|
||
def __init__(self) -> None: | ||
super().__init__() | ||
self.entity = None | ||
|
||
def on_played(self, game: 'GeniusGame') -> None: | ||
self.entity = SirArthurEntity(game, from_player=game.active_player) | ||
super().on_played(game) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
from genius_invocation.utils import * | ||
from genius_invocation.card.action.support.base import SupportCard | ||
from typing import TYPE_CHECKING | ||
from genius_invocation.entity.support import Support | ||
|
||
if TYPE_CHECKING: | ||
from genius_invocation.game.game import GeniusGame | ||
from genius_invocation.game.player import GeniusPlayer | ||
|
||
|
||
class KusavaEntity(Support): | ||
name: str = 'Kusava' | ||
name_ch = '苦舍桓' | ||
max_count = 2 | ||
def __init__(self, game: 'GeniusGame', from_player: 'GeniusPlayer', from_character=None): | ||
super().__init__(game, from_player, from_character) | ||
self.memories_and_dreams = 0 | ||
|
||
def get_max_count_card(self, game: 'GeniusGame'): | ||
max_count = 0 | ||
max_idx = [] | ||
for idx, action_card in enumerate(self.from_player.hand_zone.card): | ||
if action_card.card_type == ActionCardType.EQUIPMENT_TALENT: | ||
count = sum([i['cost_num'] for i in action_card.cost]) | ||
else: | ||
count = action_card.cost_num | ||
|
||
if count > max_count: | ||
max_idx = [] | ||
max_count = count | ||
max_idx.append(idx) | ||
if count == max_count: | ||
max_idx.append(idx) | ||
return idx | ||
|
||
def on_begin(self, game:'GeniusGame'): | ||
if game.active_player_index == self.from_player.index: | ||
max_count_idx = self.get_max_count_card(game) | ||
if len(max_count_idx) == 0: | ||
return | ||
if len(max_count_idx) > 2: | ||
max_count_idx = max_count_idx[0:2] | ||
|
||
for idx in max_count_idx: | ||
self.from_player.hand_zone.discard_card(idx) | ||
self.memories_and_dreams = min(self.max_count, self.memories_and_dreams + 1) | ||
|
||
def on_calculate_dice(self, game: 'GeniusGame') -> bool: | ||
if game.active_player_index == self.from_player.index: | ||
if game.current_dice.use_type in SkillType: | ||
if self.from_player.round_play_cards == 0: | ||
if self.memories_and_dreams > 0: | ||
if game.current_dice.cost[0]['cost_num'] > 0: | ||
game.current_dice.cost[0]['cost_num'] -= 1 | ||
return True | ||
if len(game.current_dice.cost) > 1: | ||
if game.current_dice.cost[1]['cost_num'] > 0: | ||
game.current_dice.cost[1]['cost_num'] -= 1 | ||
return True | ||
return False | ||
|
||
def on_skill(self, game: 'GeniusGame') -> None: | ||
if self.on_calculate_dice(game): | ||
self.memories_and_dreams -= 1 | ||
|
||
def update_listener_list(self): | ||
self.listeners = [ | ||
(EventType.ON_USE_SKILL, ZoneType.SUPPORT_ZONE, self.on_skill), | ||
(EventType.CALCULATE_DICE, ZoneType.SUPPORT_ZONE, self.on_calculate_dice), | ||
(EventType.BEGIN_ACTION_PHASE, ZoneType.SUPPORT_ZONE, self.on_begin), | ||
] | ||
def show(self): | ||
return str(self.usage) | ||
|
||
class Kusava(SupportCard): | ||
id: int = 323008 | ||
name: str = 'Kusava' | ||
name_ch = '苦舍桓' | ||
cost_num = 0 | ||
cost_type = None | ||
card_type = ActionCardType.SUPPORT_ITEM | ||
|
||
def __init__(self) -> None: | ||
super().__init__() | ||
self.entity = None | ||
|
||
def on_played(self, game: 'GeniusGame') -> None: | ||
self.entity = KusavaEntity(game, from_player=game.active_player) | ||
super().on_played(game) |
58 changes: 58 additions & 0 deletions
58
genius_invocation/card/action/support/location/CentralLaboratoryRuins.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
from genius_invocation.utils import * | ||
from genius_invocation.card.action.support.base import SupportCard | ||
from typing import TYPE_CHECKING | ||
from genius_invocation.entity.support import Support | ||
|
||
if TYPE_CHECKING: | ||
from genius_invocation.game.game import GeniusGame | ||
from genius_invocation.game.player import GeniusPlayer | ||
|
||
|
||
class CentralLaboratoryRuinsEntity(Support): | ||
name = 'Central Laboratory Ruins' | ||
name_ch = '中央实验室遗址' | ||
max_usage = 9 | ||
def __init__(self, game: 'GeniusGame', from_player: 'GeniusPlayer', from_character=None): | ||
super().__init__(game, from_player, from_character) | ||
self.experimentalprogress = 0 | ||
|
||
def excute(self, game): | ||
if self.experimentalprogress > 0: | ||
if self.experimentalprogress % 3 == 0: | ||
self.from_player.dice_zone.add([DiceType.OMNI.value]) | ||
if self.experimentalprogress == self.max_usage: | ||
self.on_destroy(game) | ||
|
||
def on_tune_card(self, game: 'GeniusGame'): | ||
if game.active_player_index == self.from_player.index: | ||
self.experimentalprogress += 1 | ||
self.excute(game) | ||
|
||
def on_discard_card(self, game: 'GeniusGame'): | ||
if game.active_player_index == self.from_player.index: | ||
self.experimentalprogress += 1 | ||
self.excute(game) | ||
|
||
def update_listener_list(self): | ||
self.listeners = [ | ||
(EventType.ON_TUNE_CARD, ZoneType.SUPPORT_ZONE, self.on_tune_card), | ||
(EventType.ON_DISCARD_CARD, ZoneType.SUPPORT_ZONE, self.on_discard_card), | ||
] | ||
def show(self): | ||
return str(self.usage) | ||
|
||
class CentralLaboratoryRuins(SupportCard): | ||
id: int = 321017 | ||
name = 'Central Laboratory Ruins' | ||
name_ch = '中央实验室遗址' | ||
cost_num = 1 | ||
cost_type = CostType.WHITE | ||
card_type = ActionCardType.SUPPORT_LOCATION | ||
|
||
def __init__(self) -> None: | ||
super().__init__() | ||
self.entity = None | ||
|
||
def on_played(self, game: 'GeniusGame') -> None: | ||
self.entity = CentralLaboratoryRuinsEntity(game, from_player=game.active_player) | ||
super().on_played(game) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
genius_invocation/card/action/support/location/TheMausoleumofKingDeshret.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
from genius_invocation.utils import * | ||
from genius_invocation.card.action.support.base import SupportCard | ||
from typing import TYPE_CHECKING | ||
from genius_invocation.entity.support import Support | ||
from genius_invocation.entity.status import Combat_Status | ||
from genius_invocation.event.damage import Damage | ||
|
||
|
||
if TYPE_CHECKING: | ||
from genius_invocation.game.game import GeniusGame | ||
from genius_invocation.game.player import GeniusPlayer | ||
|
||
|
||
class HasForbiddenKnowledge(Combat_Status): | ||
name: str = 'Forbidden Knowledge' | ||
name_ch = '禁忌知识' | ||
def __init__(self, game: 'GeniusGame', from_player: 'GeniusPlayer', from_character=None): | ||
super().__init__(game, from_player, from_character) | ||
|
||
def on_end(self, game:'GeniusGame'): | ||
self.on_destroy(game) | ||
|
||
def update_listener_list(self): | ||
self.listeners = [ | ||
(EventType.FINAL_END, ZoneType.ACTIVE_ZONE, self.on_end), | ||
] | ||
|
||
class ForbiddenKnowledge(ActionCard): | ||
name = "Forbidden Knowledge" | ||
name_ch = "禁忌知识" | ||
cost_num = 0 | ||
cost_type = None | ||
card_type = ActionCardType.EVENT | ||
can_tune = False | ||
def __init__(self) -> None: | ||
super().__init__() | ||
|
||
def on_played(self, game: 'GeniusGame') -> None: | ||
dmg = Damage.create_damage( | ||
game, | ||
damage_type=SkillType.OTHER, | ||
main_damage_element=ElementType.PIERCING, | ||
main_damage=1, | ||
piercing_damage=0, | ||
damage_from=None, | ||
damage_to=get_my_active_character(game), | ||
) | ||
game.add_damage(dmg) | ||
game.resolve_damage() | ||
game.active_player.get_card(num=1) | ||
|
||
def on_tuning(self, game: 'GeniusGame') -> None: | ||
pass | ||
|
||
def find_target(self, game: 'GeniusGame'): | ||
if game.active_player.last_die_round == game.round : | ||
if game.active_player.team_combat_status.has_status(HasForbiddenKnowledge) is None: | ||
return [1] | ||
return [] | ||
|
||
|
||
class TheMausoleumofKingDeshretStatus(Combat_Status): | ||
name: str = 'The Mausoleum of King Deshret' | ||
name_ch = '赤王陵' | ||
def __init__(self, game: 'GeniusGame', from_player: 'GeniusPlayer', from_character=None): | ||
super().__init__(game, from_player, from_character) | ||
|
||
def on_get_card(self, game: 'GeniusGame'): | ||
if game.current_get_card.from_player == self.from_player: | ||
self.from_player.card_zone.place_randomly([ForbiddenKnowledge()]) | ||
|
||
def on_end(self, game:'GeniusGame'): | ||
self.on_destroy(game) | ||
|
||
def update_listener_list(self): | ||
self.listeners = [ | ||
(EventType.ON_PLAY_CARD, ZoneType.ACTIVE_ZONE, self.on_play), | ||
(EventType.FINAL_END, ZoneType.ACTIVE_ZONE, self.on_end), | ||
] | ||
|
||
|
||
class TheMausoleumofKingDeshretEntity(Support): | ||
name: str = 'The Mausoleum of King Deshret' | ||
name_ch = '赤王陵' | ||
max_count = 4 | ||
def __init__(self, game: 'GeniusGame', from_player: 'GeniusPlayer', from_character=None): | ||
super().__init__(game, from_player, from_character) | ||
self.count = 0 | ||
self.oppenent = get_opponent(game) | ||
|
||
def on_get_card(self, game: 'GeniusGame'): | ||
if game.current_get_card.from_player == self.oppenent: | ||
self.count += 1 | ||
if self.count == self.max_count: | ||
self.on_destroy(game) | ||
for _ in range(2): | ||
self.oppenent.card_zone.insert_randomly(ForbiddenKnowledge(), 0) | ||
self.oppenent.team_combat_status.add_entity(TheMausoleumofKingDeshretStatus(game, self.oppenent)) | ||
|
||
def update_listener_list(self): | ||
self.listeners = [ | ||
(EventType.ON_GET_CARD, ZoneType.SUPPORT_ZONE, self.on_get_card), | ||
] | ||
|
||
def show(self): | ||
return str(self.count) | ||
|
||
class TheMausoleumofKingDeshret(SupportCard): | ||
id: int = 321018 | ||
name: str = 'The Mausoleum of King Deshret' | ||
name_ch = '赤王陵' | ||
cost_num = 1 | ||
cost_type = CostType.WHITE | ||
card_type = ActionCardType.SUPPORT_LOCATION | ||
|
||
def __init__(self) -> None: | ||
super().__init__() | ||
self.entity = None | ||
|
||
def on_played(self, game: 'GeniusGame') -> None: | ||
self.entity = TheMausoleumofKingDeshretEntity(game, from_player=game.active_player) | ||
super().on_played(game) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.