Coverage for thb/meta/characters/koakuma.py : 96%
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.actions import ttags
9from thb.meta.common import ui_meta
12# -- code --
13@ui_meta(characters.koakuma.Koakuma)
14class Koakuma:
15 # Character
16 name = '小恶魔'
17 title = '图书管理员'
18 illustrator = '渚FUN/Takibi'
19 cv = 'VV'
21 port_image = 'thb-portrait-koakuma'
22 figure_image = 'thb-figure-koakuma'
23 miss_sound_effect = 'thb-cv-koakuma_miss'
26@ui_meta(characters.koakuma.Find)
27class Find:
28 # Skill
29 name = '寻找'
30 description = '出牌阶段限一次,你可以弃置至多X张牌,然后摸等量的牌。(X为场上存活角色数)'
32 def clickable(self):
33 me = self.me
34 if ttags(me)['find']:
35 return False
37 if self.my_turn() and (me.cards or me.showncards or me.equips):
38 return True
40 return False
42 def is_action_valid(self, sk, tl):
43 g = self.game
44 assert sk.is_card(characters.koakuma.Find)
45 n = len([i for i in g.players if not i.dead])
47 if not 0 < len(sk.associated_cards) <= n:
48 return (False, '请选择需要换掉的牌(至多%s张)!' % n)
50 if not [self.me] == tl: 50 ↛ 51line 50 didn't jump to line 51, because the condition on line 50 was never true
51 return (False, 'BUG!!')
53 return (True, '换掉这些牌')
55 def effect_string(self, act):
56 # for LaunchCard.ui_meta.effect_string
57 source = act.source
58 card = act.card
59 s = '|G【%s】|r发动了寻找技能,换掉了%d张牌。' % (
60 source.ui_meta.name,
61 len(card.associated_cards),
62 )
63 return s
65 def sound_effect(self, act):
66 return 'thb-cv-koakuma_find'