Skip to content

Commit

Permalink
add Wriothesley
Browse files Browse the repository at this point in the history
  • Loading branch information
flick-ai committed Jun 6, 2024
1 parent a51cf9a commit 5c99572
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from genius_invocation.card.action.equipment.talent.import_head import *
from genius_invocation.card.character.characters.Wriothesley import *

class TerrorfortheEvildoers(TalentCard):
id: int = 211111
name: str = "Terror for the Evildoers"
name_ch = "予行恶者以惩惧"
is_action = True
cost = [{'cost_num': 1, 'cost_type': CostType.CRYO.value}, {'cost_num': 2, 'cost_type': 8}]
cost_power = 0
character = Wriothesley
def __init__(self) -> None:
super().__init__()
151 changes: 120 additions & 31 deletions genius_invocation/card/character/characters/Wriothesley.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def on_call(self, game: 'GeniusGame'):
game.manager.invoke(EventType.AFTER_USE_SKILL, game)

class IcefangRush(ElementalSkill):
id = 11102
id = 11112
name = 'Icefang Rush'
name_ch = "冰牙突驰"
type: SkillType = SkillType.ELEMENTAL_SKILL
Expand All @@ -53,35 +53,30 @@ def on_call(self, game: 'GeniusGame'):
super().on_call(game)
# 处理伤害
self.resolve_damage(game)
self.add_status(game, Snappy_Silhouette)
self.add_status(game, ChillingPenalty)

# 获得能量
self.gain_energy(game)
# after skill
game.manager.invoke(EventType.AFTER_USE_SKILL, game)


class Still_Photo_Comprehensive_Confirmation(ElementalBurst):
id = 11103
name = 'Still Photo: Comprehensive Confirmation'
name_ch = "定格·全方位确证"
class DarkgoldWolfbite(ElementalBurst):
id = 11113
name = 'Darkgold Wolfbite'
name_ch = "黑金狼噬"
type: SkillType = SkillType.ELEMENTAL_BURST

# damage
damage_type: SkillType = SkillType.ELEMENTAL_BURST
main_damage_element: ElementType = ElementType.CRYO
main_damage: int = 1
main_damage: int = 2
piercing_damage: int = 0

# cost
cost = [
{
'cost_num': 3,
'cost_type': CostType.CRYO
}
]
cost = [{'cost_num': 3, 'cost_type': CostType.CRYO}]

energy_cost: int = 2
energy_cost: int = 3
energy_gain: int = 0

def __init__(self, from_character: 'Character'):
Expand All @@ -93,10 +88,7 @@ def on_call(self, game: 'GeniusGame'):
# 处理伤害
self.consume_energy(game)
self.resolve_damage(game)
for character in self.from_character.from_player.character_list:
if character.is_alive:
character.heal(1, game)
self.generate_summon(game, Newsflash_Field)
self.add_combat_status(game, LingeringIcicles)
game.manager.invoke(EventType.AFTER_USE_SKILL, game)


Expand All @@ -111,9 +103,9 @@ class Wriothesley(Character):
init_health_point = 10
max_health_point = 10
skill_list = [
Cool_Color_Capture,
Framing_Freezing_Point_Composition,
Still_Photo_Comprehensive_Confirmation
ForcefulFistsofFrost,
IcefangRush,
DarkgoldWolfbite
]
max_power = 3

Expand All @@ -123,13 +115,68 @@ def __init__(self, game: 'GeniusGame', zone: 'CharacterZone', from_player: 'Geni
self.power = 0
self.talent_skill = self.skills[1]

self.round_heal = 0
self.round_damage = 0
self.penalty = 0

self.listen_event(game, EventType.AFTER_HEAL, ZoneType.CHARACTER_ZONE, self.on_heal)
self.listen_event(game, EventType.EXECUTE_DAMAGE, ZoneType.CHARACTER_ZONE, self.on_damage)
self.listen_event(game, EventType.CALCULATE_DICE, ZoneType.CHARACTER_ZONE, self.on_calculate_dice)
self.listen_event(game, EventType.ON_USE_SKILL, ZoneType.CHARACTER_ZONE, self.on_skill)
if self.talent:
self.listen_talent_events(game)

def on_begin(self, game: 'GeniusGame'):
super().on_begin(game)
self.round_damage = 0
self.round_heal = 0

def on_heal(self, game: 'GeniusGame'):
if game.current_heal.heal_to_character == self:
self.round_heal += 1
if self.talent:
self.penalty += 1

def on_damage(self, game: 'GeniusGame'):
if game.current_damage.damage_to == self:
self.round_damage += 1
if self.talent:
self.penalty += 1

def on_calculate_dice(self, game: 'GeniusGame'):
if game.current_dice.from_character == self:
if game.current_dice.use_type == SkillType.ELEMENTAL_BURST:
count = self.from_character.round_damage + self.from_character.round_heal
dice_num = min(count // 2, 2)
if game.current_dice.cost[0]['cost_num'] > 0:
game.current_dice.cost[0]['cost_num'] = max(0, game.current_dice.cost[1]['cost_num'] - dice_num)
return True
return False

def on_skill(self, game: 'GeniusGame'):
self.on_calculate_dice(game)

def on_damage_add(self, game: 'GeniusGame'):
if game.current_damage.damage_from == self:
if game.current_damage.damage_type in [SkillType.NORMAL_ATTACK,
SkillType.ELEMENTAL_SKILL,
SkillType.ELEMENTAL_BURST]:
if self.talent and self.penalty >= 3:
game.current_damage.main_damage += 1
self.penalty -= 3

def listen_talent_events(self, game: 'GeniusGame'):
self.listen_event(game, EventType.DAMAGE_ADD, ZoneType.CHARACTER_ZONE, self.on_damage_add)



class ChillingPenalty(Status):
name = 'Chilling Penalty'
name_ch = "寒烈的惩裁"
def __init__(self, game: 'GeniusGame', from_player: 'GeniusPlayer', from_character: 'Character', talent = False):
super().__init__(game, from_player, from_character)
self.current_usage = 2
self.is_
self.is_heal = False

def on_calculate_dice(self, game: 'GeniusGame'):
if game.active_player_index == self.from_player.index:
Expand All @@ -148,21 +195,63 @@ def on_damage_add(self, game: 'GeniusGame'):
game.current_damage.main_damage += 1
self.current_usage -= 1
if self.from_character.health_point >= 6:
damage = Damage()

damage = Damage.create_damage(
game=game,
damage_type=SkillType.OTHER,
main_damage_element=ElementType.PIERCING,
main_damage=1,
damage_from=self.from_character,
damage_to=self.from_character,
)
game.add_damage(damage)
game.resolve_damage()
else:
self.is_heal = True

def on_skill(self, game: 'GeniusGame'):
if self.on_calculate_dice(game):
self.current_usage -= 1
self.is_use = True
self.on_calculate_dice(game)

def after_skill(self, game: 'GeniusGame'):



if self.is_heal:
self.from_character.heal(1, game)
self.is_heal = False
if self.current_usage == 0:
self.on_destroy(game)

def update_listener_list(self):
self.listeners = [
(EventType.AFTER_USE_SKILL, ZoneType.CHARACTER_ZONE, self.after_skill),
(EventType.END_PHASE, ZoneType.CHARACTER_ZONE, self.on_end_phase)
(EventType.CALCULATE_DICE, ZoneType.CHARACTER_ZONE, self.on_calculate_dice),
(EventType.DAMAGE_ADD, ZoneType.CHARACTER_ZONE, self.on_damage_add),
(EventType.ON_USE_SKILL, ZoneType.CHARACTER_ZONE, self.on_skill)
]

class LingeringIcicles(Combat_Status):
name = 'Lingering Icicles'
name_ch = "余威冰锥"
def __init__(self, game: 'GeniusGame', from_player: 'GeniusPlayer', from_character:'Character'=None):
super().__init__(game, from_player, from_character)
self.current_usage = 1

def update(self):
assert False # Should no update!

def on_begin(self, game: 'GeniusGame'):
if game.active_player == self.from_player:
dmg = Damage.create_damage(
game,
damage_type=SkillType.OTHER,
main_damage=2,
main_damage_element=ElementType.PYRO,
piercing_damage=0,
damage_from=self,
damage_to=get_opponent_active_character(game),
)
game.add_damage(dmg)
game.resolve_damage()
self.on_destroy(game)

def update_listener_list(self):
self.listeners = [
(EventType.BEFORE_ANY_ACTION, ZoneType.CHARACTER_ZONE, self.on_begin)
]

0 comments on commit 5c99572

Please sign in to comment.