# Coverage for thb/meta/characters/yuuka.py : 91%

## 84 statements 77 run 7 missing 0 excluded 1 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 from __future__ import annotations

3

4# -- stdlib --

5# -- third party --

6# -- own --

7 from thb import characters

8 from thb.cards.classes import AttackCard

9 from thb.meta.common import ui_meta

10

11

12# -- code --

13@ui_meta(characters.yuuka.ReversedScales)

14 class ReversedScales:

15 # Skill

16 name = '逆鳞'

17 description = '每当你成为其他角色使用的单体符卡效果目标时，你可以将其视为|G弹幕战|r效果；你的回合外，你可以将一张手牌当做|G弹幕|r使用或打出。'

18

19 def clickable(self):

20 g = self.game

21 me = self.me

22 if self.my_turn():

23 return False

24

25 if not (me.cards or me.showncards):

26 return False

27

28 try:

29 act = g.action_stack[-1]

30 return act.cond([self.build_handcard(AttackCard)])

31 except Exception:

32 pass

33

34 return False

35

36 def is_complete(self, skill):

37 acards = skill.associated_cards

38 if len(acards) != 1:

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

40

41 return (True, '反正这条也看不到，偷个懒~~~')

42

43 def is_action_valid(self, sk, tl):

44 rst, reason = self.is_complete(sk)

45 if not rst:

46 return (rst, reason)

47 else:

48 return AttackCard().ui_meta.is_action_valid([sk], tl)

49

50 def effect_string(self, act):

51 # for LaunchCard.ui_meta.effect_string

52 return '|G【%s】|r用和善的眼神看了|G【%s】|r一眼。' % (

53 act.source.ui_meta.name,

54 act.target.ui_meta.name,

55 )

56

57 def sound_effect(self, act):

58 return 'thb-cv-yuuka_flowerqueen'

59

60

61@ui_meta(characters.yuuka.Sadist)

62 class Sadist:

63 # Skill

64 name = '施虐'

65 description = '当你击坠一名角色时，你可以对攻击范围内一名其他角色造成1点伤害；你对体力值为1的其他角色造成的伤害+1。'

66

67

68@ui_meta(characters.yuuka.SadistKOF)

69 class SadistKOF:

70 # Skill

71 name = '施虐'

72 description = '|B锁定技|r，当你击坠对手后，你摸2张牌并对其下一名登场角色造成1点伤害。'

73

74

75@ui_meta(characters.yuuka.ReversedScalesAction)

76 class ReversedScalesAction:

77 def effect_string_apply(self, act):

78 return (

79 '|G【%s】|r：“来正面上我啊！”'

80 ) % (

81 act.target.ui_meta.name,

82 )

83

84 def sound_effect(self, act):

85 return 'thb-cv-yuuka_rs'

86

87

88@ui_meta(characters.yuuka.SadistAction)

89 class SadistAction:

90 def effect_string_apply(self, act):

91 return (

92 '|G【%s】|r又看了看|G【%s】|r：“你也要尝试一下么！”'

93 ) % (

94 act.source.ui_meta.name,

95 act.target.ui_meta.name,

96 )

97

98 def sound_effect(self, act):

99 return 'thb-cv-yuuka_sadist'

100

101

102@ui_meta(characters.yuuka.SadistKOFDamageAction)

103 class SadistKOFDamageAction:

104 def effect_string_apply(self, act):

105 return (

106 '|G【%s】|r又看了看|G【%s】|r：“你也要尝试一下么！”'

107 ) % (

108 act.source.ui_meta.name,

109 act.target.ui_meta.name,

110 )

111

112 def sound_effect(self, act):

113 return 'thb-cv-yuuka_sadist'

114

115

116@ui_meta(characters.yuuka.SadistHandler)

117 class SadistHandler:

118 # choose_card

119 def choose_card_text(self, act, cards):

120 if act.cond(cards):

121 return (True, '发动【施虐】')

122 else:

123 return (False, '【施虐】：请弃置一张牌')

124

125 def target(self, pl):

126 if not pl: 126 ↛ 127 line 126 didn't jump to line 127, because the condition on line 126 was never true

127 return (False, '【施虐】：请选择1名玩家')

128

129 return (True, '发动【施虐】')

130

131

132@ui_meta(characters.yuuka.ReversedScalesHandler)

133 class ReversedScalesHandler:

134 # choose_option

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

136 choose_option_prompt = '你要发动【逆鳞】吗？'

137

138

139@ui_meta(characters.yuuka.Yuuka)

140 class Yuuka:

141 # Character

142 name = '风见幽香'

143 title = '四季的鲜花之主'

144 illustrator = '霏茶'

145 cv = 'VV'

146

147 port_image = 'thb-portrait-yuuka'

148 figure_image = 'thb-figure-yuuka'

149 miss_sound_effect = 'thb-cv-yuuka_miss'

150

151

152@ui_meta(characters.yuuka.YuukaKOF)

153 class YuukaKOF:

154 # Character

155 name = '风见幽香'

156 title = '四季的鲜花之主'

157 illustrator = '霏茶'

158 cv = 'VV'

159

160 port_image = 'thb-portrait-yuuka'

161 figure_image = 'thb-figure-yuuka'

162 miss_sound_effect = 'thb-cv-yuuka_miss'

163

164 notes = '|RKOF修正角色'