# Coverage for thb/meta/characters/kokoro.py : 89%

## 82 statements 74 run 8 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

3# -- stdlib --

4# -- third party --

5# -- own --

6 from thb import characters

7 from thb.cards.base import Card, Skill

8 from thb.meta.common import ui_meta

9

10

11# -- code --

12

13

14@ui_meta(characters.kokoro.Kokoro)

15 class Kokoro:

16 # Character

17 name = '秦心'

18 title = '表情丰富的扑克脸'

19 illustrator = 'Takibi'

20 cv = '小羽/VV'

21

22 port_image = 'thb-portrait-kokoro'

23 figure_image = 'thb-figure-kokoro'

24 miss_sound_effect = 'thb-cv-kokoro_miss'

25

26

27@ui_meta(characters.kokoro.KokoroKOF)

28 class KokoroKOF:

29 # Character

30 name = '秦心'

31 title = '表情丰富的扑克脸'

32 illustrator = 'Takibi'

33 cv = '小羽/VV'

34

35 port_image = 'thb-portrait-kokoro'

36 figure_image = 'thb-figure-kokoro'

37 miss_sound_effect = 'thb-cv-kokoro_miss'

38

39 notes = '|RKOF修正角色|r'

40

41

42@ui_meta(characters.kokoro.HopeMask)

43 class HopeMask:

44 # Skill

45 name = '希望之面'

46 description = '出牌阶段开始时，你可以观看牌堆顶的1+X张牌，然后展示并获得其中任意数量的同花色牌，其余的牌以任意顺序置于牌堆顶。（X为你已损失的体力值）'

47

48

49@ui_meta(characters.kokoro.HopeMaskKOF)

50 class HopeMaskKOF:

51 # Skill

52 name = '希望之面'

53 description = '出牌阶段开始时，你可以观看牌堆顶的X+1张牌，然后展示并获得其中一张牌，其余的牌以任意顺序置于牌堆顶。（X为你已损失的体力值）'

54

55

56@ui_meta(characters.kokoro.BaseHopeMaskHandler)

57 class BaseHopeMaskHandler:

58 # choose_option

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

60 choose_option_prompt = '你要发动【希望之面】吗？'

61

62

63@ui_meta(characters.kokoro.BaseHopeMaskAction)

64 class BaseHopeMaskAction:

65 def effect_string_before(self, act):

66 return '|G【%s】|r挑选面具中……' % (act.source.ui_meta.name)

67

68 def effect_string(self, act):

69 if not len(act.acquire): 69 ↛ 72 line 69 didn't jump to line 72, because the condition on line 69 was never false

70 return None

71

72 return '|G【%s】|r拿起了%s，贴在了自己的脸上。' % (

73 act.source.ui_meta.name, self.card_desc(act.acquire),

74 )

75

76 def sound_effect(self, act):

77 return 'thb-cv-kokoro_hopemask'

78

79

80@ui_meta(characters.kokoro.BaseDarkNohAction)

81 class BaseDarkNohAction:

82 # choose_card

83 def choose_card_text(self, act, cards):

84 if act.cond(cards):

85 return (True, '真坑！')

86 else:

87 return (False, '请弃置%d张手牌（不能包含获得的那一张）' % act.n)

88

89

90@ui_meta(characters.kokoro.BaseDarkNoh)

91 class BaseDarkNoh:

92 # Skill

93 name = '暗黑能乐'

94

95 def is_action_valid(self, sk, tl):

96 cl = sk.associated_cards

97 if len(cl) != 1 or cl[0].suit not in (Card.SPADE, Card.CLUB):

98 return (False, '请选择一张黑色的牌！')

99

100 c = cl[0]

101 if c.is_card(Skill):

102 return (False, '你不能像这样组合技能')

103

104 return (True, '发动暗黑能乐')

105

106 def effect_string(self, act):

107 # for LaunchCard.ui_meta.effect_string

108 source = act.source

109 card = act.card

110 target = act.target

111 return [

112 '|G【%s】|r：“这点失控还不够，让你的所有感情也一起爆发吧！”' % source.ui_meta.name,

113 '|G【%s】|r使用|G%s|r对|G【%s】|r发动了|G暗黑能乐|r。' % (

114 source.ui_meta.name,

115 card.associated_cards[0].ui_meta.name,

116 target.ui_meta.name,

117 )

118 ]

119

120 def sound_effect(self, act):

121 return 'thb-cv-kokoro_darknoh'

122

123

124@ui_meta(characters.kokoro.DarkNoh)

125 class DarkNoh:

126 description = '出牌阶段限一次，你可以将一张黑色牌置于体力值不小于你的其他角色的明牌区，然后其须弃置除获得的牌以外的手牌，直到手牌数与体力值相等。'

127

128 def clickable(self):

129 me = self.me

130 if self.limit1_skill_used('darknoh_tag'):

131 return False

132

133 if not self.my_turn():

134 return False

135

136 if me.cards or me.showncards or me.equips:

137 return True

138

139 return False

140

141

142@ui_meta(characters.kokoro.DarkNohKOF)

143 class DarkNohKOF:

144 description = '|B限定技|r，出牌阶段，你可以将一张黑色牌置于体力值不小于你的其他角色的明牌区，然后其须弃置除获得的牌以外的手牌，直到手牌数与体力值相等。'

145

146 def clickable(self):

147 me = self.me

148 if me.tags['darknoh_tag'] > 0:

149 return False

150

151 if not self.my_turn():

152 return False

153

154 if me.cards or me.showncards or me.equips:

155 return True

156

157 return False