Coverage for thb/meta/characters/seiga.py : 95%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# -*- coding: utf-8 -*-
2from __future__ import annotations
4# -- stdlib --
5# -- third party --
6# -- own --
7from thb import characters
8from thb.cards.base import Skill
9from thb.meta.common import ui_meta
12# -- code --
13@ui_meta(characters.seiga.Seiga)
14class Seiga:
15 # Character
16 name = '霍青娥'
17 title = '僵尸别跑'
18 illustrator = '和茶'
19 cv = '小羽'
21 port_image = 'thb-portrait-seiga'
22 figure_image = 'thb-figure-seiga'
23 miss_sound_effect = 'thb-cv-seiga_miss'
26@ui_meta(characters.seiga.SeigaKOF)
27class SeigaKOF:
28 # Character
29 name = '霍青娥'
30 title = '僵尸别跑'
31 illustrator = '和茶'
32 cv = '小羽'
34 port_image = 'thb-portrait-seiga'
35 figure_image = 'thb-figure-seiga'
36 miss_sound_effect = 'thb-cv-seiga_miss'
38 notes = '|RKOF修正角色'
41@ui_meta(characters.seiga.HeterodoxyHandler)
42class HeterodoxyHandler:
43 # choose_option meta
44 choose_option_buttons = (('跳过结算', True), ('正常结算', False))
45 choose_option_prompt = '你要跳过当前的卡牌结算吗?'
48@ui_meta(characters.seiga.HeterodoxySkipAction)
49class HeterodoxySkipAction:
50 def effect_string(self, act):
51 return '|G【%s】|r跳过了卡牌效果的结算' % (
52 act.source.ui_meta.name,
53 )
56@ui_meta(characters.seiga.HeterodoxyAction)
57class HeterodoxyAction:
58 def ray(self, act):
59 return [(act.source, act.target_list[0])]
62@ui_meta(characters.seiga.Heterodoxy)
63class Heterodoxy:
64 # Skill
65 name = '邪仙'
66 description = (
67 '出牌阶段,你可以将一张手牌以一名其他角色的身份使用。\n'
68 '|B|R>> |r以此法使用|G弹幕|r消耗你的干劲。\n'
69 '|B|R>> |r你成为此法使用的群体符卡的目标后,可以跳过此次结算。'
70 )
71 custom_ray = True
73 def clickable(self):
74 if not self.my_turn(): return False
75 me = self.me
76 return bool(me.cards or me.showncards or me.equips)
78 def effect_string(self, act):
79 return '|G【%s】|r发动了邪仙技能,以|G【%s】|r的身份使用了卡牌' % (
80 act.source.ui_meta.name,
81 act.target.ui_meta.name,
82 )
84 def is_action_valid(self, sk, tl):
85 acards = sk.associated_cards
86 if (not acards) or len(acards) != 1:
87 return (False, '请选择一张手牌')
89 card = acards[0]
91 if card.resides_in.type not in ('cards', 'showncards'):
92 return (False, '请选择一张手牌!')
94 if card.is_card(Skill): 94 ↛ 95line 94 didn't jump to line 95, because the condition on line 94 was never true
95 return (False, '你不可以像这样组合技能')
97 if not getattr(card, 'associated_action', None):
98 return (False, '请的选择可以主动发动的卡牌!')
100 if not tl:
101 return (False, '请选择一名玩家作为卡牌发起者')
103 victim = tl[0]
104 _tl, valid = card.target(victim, tl[1:])
105 return card.ui_meta.is_action_valid([card], _tl)
107 # can't reach here
108 # return (True, u'僵尸什么的最萌了!')
109 # orig
111 def sound_effect(self, act):
112 return 'thb-cv-seiga_heterodoxy'
115@ui_meta(characters.seiga.Summon)
116class Summon:
117 # Skill
118 name = '通灵'
119 description = '|B限定技|r,你的回合内,当有角色被击坠时,你可以获得其一个技能。(不包括限定技,觉醒技)'
122@ui_meta(characters.seiga.SummonAction)
123class SummonAction:
124 # choose_option meta
125 choose_option_prompt = '请选择想要获得的技能:'
127 def choose_option_buttons(self, act):
128 return [
129 (s.ui_meta.name, n)
130 for n, s in act.mapping.items()
131 ]
133 def ray(self, act):
134 return [(act.source, act.target)]
136 def effect_string(self, act):
137 return '|G【%s】|r发动了|G通灵|r,获得了|G【%s】|r的|G%s|r技能。' % (
138 act.source.ui_meta.name,
139 act.target.ui_meta.name,
140 act.choice.ui_meta.name,
141 )
144@ui_meta(characters.seiga.SummonHandler)
145class SummonHandler:
146 # choose_option meta
147 choose_option_buttons = (('发动', True), ('不发动', False))
148 choose_option_prompt = '你要发动【通灵】吗?'
151@ui_meta(characters.seiga.SummonKOF)
152class SummonKOF:
153 # Skill
154 name = '通灵'
155 description = (
156 '你可以将击坠角色的角色牌加入你的备选角色;出牌阶段,你可以和你的备选角色交换角色牌,然后结束出牌阶段。\n'
157 '|B|R>> |r你的体力值保留,体力上限会调整到与新角色一致。'
158 )
160 def clickable(self):
161 return self.my_turn()
163 def is_action_valid(self, sk, tl):
164 g = self.game
165 me = self.me
166 cl = sk.associated_cards
167 if len(cl) != 0:
168 return False, '请不要选择牌'
170 rest = '、'.join([c.char_cls.ui_meta.name for c in g.chosen[me.player]])
171 return True, f'通灵:后备角色:{rest}'
173 def effect_string(self, act):
174 return '|G【%s】|r发动了|G通灵|r!' % (
175 act.source.ui_meta.name,
176 )
179@ui_meta(characters.seiga.SummonKOFAction)
180class SummonKOFAction:
182 def effect_string(self, act):
183 old, new = act.transition
184 return '|G【%s】|r召唤了|G【%s】|r,自己退居幕后!' % (
185 old.ui_meta.name,
186 new.ui_meta.name,
187 )
190@ui_meta(characters.seiga.SummonKOFCollect)
191class SummonKOFCollect:
193 def effect_string_before(self, act):
194 src, tgt = act.source, act.target
195 return '|G【%s】|r把|G【%s】|r做成了僵尸宠物!' % (
196 src.ui_meta.name,
197 tgt.ui_meta.name,
198 )