Coverage for thb/meta/characters/koakuma.py : 66%
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 g = self.game
34 me = g.me
35 if ttags(me)['find']:
36 return False
38 if self.my_turn(g) and (me.cards or me.showncards or me.equips):
39 return True
41 return False
43 def is_action_valid(self, sk, tl):
44 g = self.game
45 assert sk.is_card(characters.koakuma.Find)
46 n = len([i for i in g.players if not i.dead])
48 if not 0 < len(sk.associated_cards) <= n:
49 return (False, '请选择需要换掉的牌(至多%s张)!' % n)
51 if not [self.me] == tl: 51 ↛ 52line 51 didn't jump to line 52, because the condition on line 51 was never true
52 return (False, 'BUG!!')
54 return (True, '换掉这些牌')
56 def effect_string(self, act):
57 # for LaunchCard.ui_meta.effect_string
58 source = act.source
59 card = act.card
60 s = '|G【%s】|r发动了寻找技能,换掉了%d张牌。' % (
61 source.ui_meta.name,
62 len(card.associated_cards),
63 )
64 return s
66 def sound_effect(self, act):
67 return 'thb-cv-koakuma_find'