# Coverage for thb/meta/characters/ran.py : 98%

## 78 statements 76 run 2 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.actions import ttags

9 from thb.meta.common import ui_meta

10

11

12# -- code --

13@ui_meta(characters.ran.Prophet)

14 class Prophet:

15 # Skill

16 name = '神算'

17 description = '准备阶段开始时，你可以观看牌堆顶的X张牌，将其中任意数量的牌以任意顺序置于牌堆顶，其余以任意顺序置于牌堆底。（X为存活角色数且至多为5）'

18

19

20@ui_meta(characters.ran.ExtremeIntelligence)

21 class ExtremeIntelligence:

22 # Skill

23 name = u'极智'

24 description = '每轮限一次，你的回合外，当非延时符卡效果对一名角色生效后，你可以弃置一张牌，令该符卡效果对那名角色重新进行一次结算，此时使用者视为你。'

25

26

27@ui_meta(characters.ran.ExtremeIntelligenceKOF)

28 class ExtremeIntelligenceKOF:

29 # Skill

30 name = '极智'

31 description = '出牌阶段限一次，你可以将一张手牌当你本回合上一张使用过的非延时符卡使用。'

32

33 def clickable(self):

34 me = self.me

35

36 if not (self.my_turn() and (me.cards or me.showncards)):

37 return False

38

39 if ttags(me)['ran_eikof_tag']:

40 return False

41

42 if not ttags(me)['ran_eikof_card']:

43 return False

44

45 return True

46

47 def is_action_valid(self, sk, tl):

48 me = self.me

49 assert sk.is_card(characters.ran.ExtremeIntelligenceKOF)

50

51 cl = sk.associated_cards

52 if len(cl) != 1:

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

54

55 if cl[0].resides_in not in (me.cards, me.showncards):

56 return (False, '请选择手牌！')

57

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

59

60 def effect_string(self, act):

61 # for LaunchCard.ui_meta.effect_string

62 src, tl, card = act.source, act.target_list, act.card

63 s = '|G【%s】|r发动了|G极智|r技能，将|G%s|r当作|G%s|r对%s使用。' % (

64 src.ui_meta.name,

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

66 card.treat_as.ui_meta.name,

67 '、'.join(["|G【%s】|r" % i.ui_meta.name for i in tl]),

68 )

69 return s

70

71

72@ui_meta(characters.ran.ProphetHandler)

73 class ProphetHandler:

74 # choose_option

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

76 choose_option_prompt = '你要发动【神算】吗？'

77

78

79@ui_meta(characters.ran.ProphetAction)

80 class ProphetAction:

81 def effect_string_before(self, act):

82 return '众人正准备接招呢，|G【%s】|r却掐着指头算了起来…' % (

83 act.target.ui_meta.name,

84 )

85

86 def sound_effect(self, act):

87 return 'thb-cv-ran_prophet'

88

89

90@ui_meta(characters.ran.ExtremeIntelligenceAction)

91 class ExtremeIntelligenceAction:

92 # choose_card

93 def choose_card_text(self, act, cards):

94 if act.cond(cards):

95 return (True, '再来！')

96 else:

97 return (False, '弃置1张牌并发动【极智】')

98

99 def effect_string_before(self, act):

100 return (

101 '|G【%s】|r刚松了一口气，却看见一张一模一样的符卡从|G【%s】|r的方向飞来！'

102 ) % (

103 act.target.ui_meta.name,

104 act.source.ui_meta.name,

105 )

106

107 def sound_effect(self, act):

108 return 'thb-cv-ran_ei'

109

110

111@ui_meta(characters.ran.NakedFox)

112 class NakedFox:

113 # Skill

114 name = '素裸'

115 description = '|B锁定技|r，若你没有手牌，符卡对你造成的伤害-1。'

116

117

118@ui_meta(characters.ran.NakedFoxAction)

119 class NakedFoxAction:

120 def effect_string_before(self, act):

121 if act.dmgamount <= 1:

122 s = '符卡飞到了|G【%s】|r毛茸茸的大尾巴里，然后……就没有然后了……'

123 else:

124 s = '符卡飞到了|G【%s】|r毛茸茸的大尾巴里，恩……似乎还是有点疼……'

125

126 return s % act.target.ui_meta.name

127

128

129@ui_meta(characters.ran.Ran)

130 class Ran:

131 # Character

132 name = '八云蓝'

133 title = '天河一号的核心'

134 illustrator = '霏茶'

135 cv = 'shourei小N'

136

137 port_image = 'thb-portrait-ran'

138 figure_image = 'thb-figure-ran'

139 miss_sound_effect = 'thb-cv-ran_miss'

140

141

142@ui_meta(characters.ran.RanKOF)

143 class RanKOF:

144 # Character

145 name = '八云蓝'

146 title = '天河一号的核心'

147 illustrator = '霏茶'

148 cv = 'shourei小N'

149

150 port_image = 'thb-portrait-ran'

151 figure_image = 'thb-figure-ran'

152 miss_sound_effect = 'thb-cv-ran_miss'

153

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