# Coverage for thb/meta/characters/kyouko.py : 69%

## 47 statements 32 run 15 missing 0 excluded 0 partial

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 -*-

2

3# -- stdlib --

4# -- third party --

5# -- own --

6 from thb import characters

7 from thb.cards.base import VirtualCard

8 from thb.meta.common import ui_meta

9

10

11# -- code --

12

13

14@ui_meta(characters.kyouko.Kyouko)

15 class Kyouko:

16 # Character

17 name = '幽谷响子'

18 title = '诵经的山彦'

19 illustrator = '月见'

20 designer = '蝶之羽风暂留此'

21 cv = '小羽'

22

23 port_image = 'thb-portrait-kyouko'

24 figure_image = 'thb-figure-kyouko'

25 miss_sound_effect = 'thb-cv-kyouko_miss'

26

27

28@ui_meta(characters.kyouko.Echo)

29 class Echo:

30 # Skill

31 name = '回响'

32 description = '每当你受到一次伤害后，你可以获得对你造成伤害的牌，若此牌为|G弹幕|r，你可以改为令一名其他角色获得之。'

33

34

35@ui_meta(characters.kyouko.Resonance)

36 class Resonance:

37 # Skill

38 name = '共振'

39 description = '当你对其他角色使用的|G弹幕|r结算完毕后，你可以指定另一名其他角色，被指定角色可以对其使用一张无视距离的|G弹幕|r。'

40

41

42@ui_meta(characters.kyouko.EchoHandler)

43 class EchoHandler:

44 # choose_option meta

45 choose_option_buttons = (('发动', True), ('放弃', False))

46 choose_option_prompt = '是否发动【回响】'

47

48 # choose_players

49 def target(self, pl):

50 if not pl:

51 return (False, '回响：请选择获得【弹幕】的角色')

52

53 return (True, '回响···')

54

55

56@ui_meta(characters.kyouko.ResonanceAction)

57 class ResonanceAction:

58 # choose_card meta

59 def choose_card_text(self, act, cards):

60 if act.cond(cards):

61 return (True, '共振：对%s使用弹幕' % act.victim.ui_meta.name)

62 else:

63 return (False, '共振：请选择一张弹幕对%s使用' % act.victim.ui_meta.name)

64

65 def effect_string_before(self, act):

66 return '|G【%s】|r对|G【%s】|r发动了|G共振|r。' % (

67 act.source.ui_meta.name,

68 act.target.ui_meta.name,

69 )

70

71 def ray(self, act):

72 src, tgt = act.source, act.target

73 return [(src, tgt)]

74

75 def sound_effect(self, act):

76 return 'thb-cv-kyouko_resonance'

77

78

79@ui_meta(characters.kyouko.EchoAction)

80 class EchoAction:

81

82 def effect_string_before(self, act):

83 return '|G【%s】|r发动了|G回响|r，|G【%s】|r获得了%s。' % (

84 act.source.ui_meta.name,

85 act.target.ui_meta.name,

86 self.card_desc(VirtualCard.unwrap([act.card])),

87 )

88

89 def sound_effect(self, act):

90 return 'thb-cv-kyouko_echo'

91

92

93@ui_meta(characters.kyouko.ResonanceHandler)

94 class ResonanceHandler:

95 # choose_players

96 def target(self, pl):

97 if not pl:

98 return (False, '共振：请选择一名角色使用【弹幕】')

99

100 return (True, '发动【共振】')