# Coverage for thb/meta/characters/rumia.py : 95%

## 74 statements 69 run 5 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.meta.common import ui_meta

8

9# -- code --

10

11

12@ui_meta(characters.rumia.Darkness)

13 class Darkness:

14 # Skill

15 name = '黑暗'

16 description = (

17 '出牌阶段限一次，你可以弃置一张牌并指定一名其他角色，令其选择一项：\n'

18 '|B|R>> |r对其攻击范围内另一名你指定的其他角色使用一张|G弹幕|r。\n'

19 '|B|R>> |r受到你造成的1点伤害。'

20 )

21

22 custom_ray = True

23

24 def clickable(self):

25 g = self.game

26 try:

27 if self.limit1_skill_used('darkness_tag'):

28 return False

29 act = g.action_stack[-1]

30 if isinstance(act, actions.ActionStage):

31 return True

32 except IndexError:

33 pass

34 return False

35

36 def is_action_valid(self, sk, tl):

37 cl = sk.associated_cards

38 if not cl or len(cl) != 1:

39 return (False, '请选择一张牌')

40

41 if not len(tl):

42 return (False, '请选择第一名玩家（向第二名玩家出【弹幕】）')

43 elif len(tl) == 1:

44 return (False, '请选择第二名玩家（【弹幕】的目标）')

45 else:

46 return (True, '你们的关系…是~这样吗？')

47

48 def effect_string(self, act):

49 # for LaunchCard.ui_meta.effect_string

50 return '|G【%s】|r在黑暗中一通乱搅，结果|G【%s】|r和|G【%s】|r打了起来！' % (

51 act.source.ui_meta.name,

52 act.target_list[0].ui_meta.name,

53 act.target_list[1].ui_meta.name,

54 )

55

56 def sound_effect(self, act):

57 return 'thb-cv-rumia_darkness'

58

59

60@ui_meta(characters.rumia.DarknessKOF)

61 class DarknessKOF:

62 # Skill

63 name = '黑暗'

64 description = '|B登场技|r，你登场的回合，对方使用牌时不能指定你为目标。'

65

66

67@ui_meta(characters.rumia.DarknessKOFAction)

68 class DarknessKOFAction:

69

70 def effect_string(self, act):

71 return '|G【%s】|r一出现天就黑了，低头都看不见胖次！' % act.source.ui_meta.name

72

73 def sound_effect(self, act):

74 return 'thb-cv-rumia_darkness_kof'

75

76

77@ui_meta(characters.rumia.DarknessKOFLimit)

78 class DarknessKOFLimit:

79 shootdown_message = '【黑暗】你不能对其使用卡牌'

80

81

82@ui_meta(characters.rumia.DarknessAction)

83 class DarknessAction:

84 def ray(self, act):

85 src = act.source

86 tl = act.target_list

87 return [(src, tl[0]), (tl[0], tl[1])]

88

89 def choose_card_text(self, act, cards):

90 if act.cond(cards):

91 return (True, '使用【弹幕】')

92 else:

93 return (False, '请使用一张【弹幕】（否则受到一点伤害）')

94

95

96@ui_meta(characters.rumia.Cheating)

97 class Cheating:

98 # Skill

99 name = '作弊'

100 description = '|B锁定技|r，结束阶段开始时，你摸一张牌。'

101

102

103@ui_meta(characters.rumia.CheatingDrawCards)

104 class CheatingDrawCards:

105 def effect_string(self, act):

106 return '突然不知道是谁把太阳挡住了。等到大家回过神来，赫然发现牌堆里少了一张牌！'

107

108 def sound_effect(self, act):

109 return 'thb-cv-rumia_cheat'

110

111

112@ui_meta(characters.rumia.Rumia)

113 class Rumia:

114 # Character

115 name = '露米娅'

116 title = '宵暗的妖怪'

117 illustrator = '和茶'

118 cv = '小羽'

119

120 port_image = 'thb-portrait-rumia'

121 figure_image = 'thb-figure-rumia'

122 miss_sound_effect = 'thb-cv-rumia_miss'

123

124

125@ui_meta(characters.rumia.RumiaKOF)

126 class RumiaKOF:

127 # Character

128 name = '露米娅'

129 title = '宵暗的妖怪'

130 illustrator = '和茶'

131 cv = '小羽'

132

133 port_image = 'thb-portrait-rumia'

134 figure_image = 'thb-figure-rumia'

135 miss_sound_effect = 'thb-cv-rumia_miss'

136

137 notes = '|RKOF修正角色'