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

## 78 statements 50 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 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 me = self.me

21 if self.my_turn():

22 return False

23

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

25 return False

26

27 return self.accept_cards([self.build_handcard(AttackCard)])

28

29 def is_complete(self, skill):

30 acards = skill.associated_cards

31 if len(acards) != 1:

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

33

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

35

36 def is_action_valid(self, sk, tl):

37 rst, reason = self.is_complete(sk)

38 if not rst:

39 return (rst, reason)

40 else:

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

42

43 def effect_string(self, act):

44 # for LaunchCard.ui_meta.effect_string

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

46 act.source.ui_meta.name,

47 act.target.ui_meta.name,

48 )

49

50 def sound_effect(self, act):

51 return 'thb-cv-yuuka_flowerqueen'

52

53

54@ui_meta(characters.yuuka.Sadist)

55 class Sadist:

56 # Skill

57 name = '施虐'

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

59

60

61@ui_meta(characters.yuuka.SadistKOF)

62 class SadistKOF:

63 # Skill

64 name = '施虐'

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

66

67

68@ui_meta(characters.yuuka.ReversedScalesAction)

69 class ReversedScalesAction:

70 def effect_string_apply(self, act):

71 return (

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

73 ) % (

74 act.target.ui_meta.name,

75 )

76

77 def sound_effect(self, act):

78 return 'thb-cv-yuuka_rs'

79

80

81@ui_meta(characters.yuuka.SadistAction)

82 class SadistAction:

83 def effect_string_apply(self, act):

84 return (

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

86 ) % (

87 act.source.ui_meta.name,

88 act.target.ui_meta.name,

89 )

90

91 def sound_effect(self, act):

92 return 'thb-cv-yuuka_sadist'

93

94

95@ui_meta(characters.yuuka.SadistKOFDamageAction)

96 class SadistKOFDamageAction:

97 def effect_string_apply(self, act):

98 return (

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

100 ) % (

101 act.source.ui_meta.name,

102 act.target.ui_meta.name,

103 )

104

105 def sound_effect(self, act):

106 return 'thb-cv-yuuka_sadist'

107

108

109@ui_meta(characters.yuuka.SadistHandler)

110 class SadistHandler:

111 # choose_card

112 def choose_card_text(self, act, cards):

113 if act.cond(cards):

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

115 else:

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

117

118 def target(self, pl):

119 if not pl:

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

121

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

123

124

125@ui_meta(characters.yuuka.ReversedScalesHandler)

126 class ReversedScalesHandler:

127 # choose_option

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

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

130

131

132@ui_meta(characters.yuuka.Yuuka)

133 class Yuuka:

134 # Character

135 name = '风见幽香'

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

137 illustrator = '霏茶'

138 cv = 'VV'

139

140 port_image = 'thb-portrait-yuuka'

141 figure_image = 'thb-figure-yuuka'

142 miss_sound_effect = 'thb-cv-yuuka_miss'

143

144

145@ui_meta(characters.yuuka.YuukaKOF)

146 class YuukaKOF:

147 # Character

148 name = '风见幽香'

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

150 illustrator = '霏茶'

151 cv = 'VV'

152

153 port_image = 'thb-portrait-yuuka'

154 figure_image = 'thb-figure-yuuka'

155 miss_sound_effect = 'thb-cv-yuuka_miss'

156

157 notes = '|RKOF修正角色'