# Coverage for thb/meta/characters/meirin.py : 53%

## 62 statements 34 run 28 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 actions, characters

7 from thb.cards.classes import AttackCard, GrazeCard

8 from thb.meta.common import ui_meta

9

10

11# -- code --

12

13

14@ui_meta(characters.meirin.RiverBehind)

15 class RiverBehind:

16 # Skill

17 name = '背水'

18 description = (

19 '|B觉醒技|r，准备阶段开始时，若你体力值为全场最低或之一且不大于2时，你减1点体力上限并获得技能|R太极|r。\n'

20 '|B|R>> |b太极|r：你可将|G弹幕|r当|G擦弹|r，|G擦弹|r当|G弹幕|r使用或打出。'

21 )

22

23

24@ui_meta(characters.meirin.Taichi)

25 class Taichi:

26 # Skill

27 name = '太极'

28 description = '你可将|G弹幕|r当|G擦弹|r，|G擦弹|r当|G弹幕|r使用或打出。'

29

30 def clickable(self):

31 g = self.game

32

33 act = g.action_stack[-1]

34 if isinstance(act, actions.ActionStage):

35 return True

36

37 if self.accept_cards([self.build_handcard(AttackCard)]):

38 return True

39

40 if self.accept_cards([self.build_handcard(GrazeCard)]):

41 return True

42

43 return False

44

45 def is_complete(self, skill):

46 cl = skill.associated_cards

47 from thb.cards.classes import AttackCard, GrazeCard

48 if len(cl) != 1 or not (cl[0].is_card(AttackCard) or cl[0].is_card(GrazeCard)):

49 return (False, '请选择一张【弹幕】或者【擦弹】！')

50 return (True, '动之则分，静之则合。无过不及，随曲就伸')

51

52 def is_action_valid(self, sk, tl):

53 rst, reason = self.is_complete(sk)

54 if not rst:

55 return (rst, reason)

56 else:

57 return sk.treat_as().ui_meta.is_action_valid(sk, tl)

58

59 def effect_string(self, act):

60 # for LaunchCard.ui_meta.effect_string

61 source = act.source

62 return (

63 '动之则分，静之则合。无过不及，随曲就伸……|G【%s】|r凭|G太极|r之势，轻松应对。'

64 ) % (

65 source.ui_meta.name,

66 )

67

68 def sound_effect(self, act):

69 return 'thb-cv-meirin_taichi'

70

71

72@ui_meta(characters.meirin.LoongPunch)

73 class LoongPunch:

74 # Skill

75 name = '龙拳'

76 description = '每当你使用的|G弹幕|r被其他角色使用的|G擦弹|r抵消时，或其他角色使用的|G弹幕|r被你使用的|G擦弹|r抵消时，你可以弃置其1张手牌。'

77

78

79@ui_meta(characters.meirin.LoongPunchHandler)

80 class LoongPunchHandler:

81 # choose_option

82 choose_option_buttons = (('发动', True), ('不发动', False))

83 choose_option_prompt = '你要发动【龙拳】吗？'

84

85

86@ui_meta(characters.meirin.LoongPunchAction)

87 class LoongPunchAction:

88 def effect_string_before(self, act):

89 if act.type == 'attack':

90 return '|G【%s】|r闪过了|G弹幕|r，却没有闪过|G【%s】|r的拳劲，一张手牌被|G【%s】|r震飞！' % (

91 act.target.ui_meta.name,

92 act.source.ui_meta.name,

93 act.source.ui_meta.name,

94 )

95 if act.type == 'graze':

96 return '|G【%s】|r擦过弹幕，随即以拳劲沿着弹幕轨迹回震，|G【%s】|r措手不及，一张手牌掉在了地上。' % (

97 act.source.ui_meta.name,

98 act.target.ui_meta.name,

99 )

100

101 def sound_effect(self, act):

102 return 'thb-cv-meirin_loongpunch'

103

104

105@ui_meta(characters.meirin.RiverBehindAwake)

106 class RiverBehindAwake:

107 def effect_string_before(self, act):

108 return '|G【%s】|r发现自己处境危险，于是强行催动内力护住身体，顺便参悟了太极拳。' % (

109 act.target.ui_meta.name,

110 )

111

112 def sound_effect(self, act):

113 return 'thb-cv-meirin_rb'

114

115

116@ui_meta(characters.meirin.Meirin)

117 class Meirin:

118 # Character

119 name = '红美铃'

120 title = '我只打盹我不翘班'

121 illustrator = '霏茶'

122 cv = '小羽'

123

124 port_image = 'thb-portrait-meirin'

125 figure_image = 'thb-figure-meirin'

126 miss_sound_effect = ('thb-cv-meirin_miss1', 'thb-cv-meirin_miss2')