# Coverage for thb/meta/characters/nazrin.py : 51%

## 82 statements 44 run 38 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.base import Card

9 from thb.cards.classes import BaseUseGraze

10 from thb.meta.common import ui_meta

11

12

13# -- code --

14@ui_meta(characters.nazrin.Nazrin)

15 class Nazrin:

16 # Character

17 name = '纳兹琳'

18 title = '探宝的小小大将'

19 illustrator = '月见'

20 cv = '小羽'

21

22 port_image = 'thb-portrait-nazrin'

23 figure_image = 'thb-figure-nazrin'

24 miss_sound_effect = 'thb-cv-nazrin_miss'

25

26

27@ui_meta(characters.nazrin.NazrinKOF)

28 class NazrinKOF:

29 # Character

30 name = '纳兹琳'

31 title = '探宝的小小大将'

32 illustrator = '月见'

33 cv = '小羽'

34

35 port_image = 'thb-portrait-nazrin'

36 figure_image = 'thb-figure-nazrin'

37 miss_sound_effect = 'thb-cv-nazrin_miss'

38

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

40

41

42@ui_meta(characters.nazrin.TreasureHunt)

43 class TreasureHunt:

44 # Skill

45 name = '探宝'

46 description = '准备阶段开始时，你可以进行一次判定，若结果为黑，你获得此牌且你可以重复此流程。'

47

48

49@ui_meta(characters.nazrin.TreasureHuntHandler)

50 class TreasureHuntHandler:

51 # choose_option

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

53 choose_option_prompt = '你要发动【探宝】吗？'

54

55

56@ui_meta(characters.nazrin.Agile)

57 class Agile:

58 # Skill

59 name = '轻敏'

60 description = '你可以将一张黑色手牌当|G擦弹|r使用或打出。'

61

62 def clickable(self):

63 g = self.game

64 me = self.me

65

66 try:

67 act = g.action_stack[-1]

68 except IndexError:

69 return False

70

71 if isinstance(act, BaseUseGraze) and (me.cards or me.showncards):

72 return True

73

74 return False

75

76 def is_complete(self, skill):

77 cl = skill.associated_cards

78 me = self.me

79 if len(cl) != 1:

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

81 else:

82 c = cl[0]

83 if c.resides_in not in (me.cards, me.showncards):

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

85 if c.suit not in (Card.SPADE, Card.CLUB):

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

87 return (True, '这种三脚猫的弹幕，想要打中我是不可能的啦~')

88

89 def sound_effect(self, act):

90 return 'thb-cv-nazrin_agile'

91

92

93@ui_meta(characters.nazrin.AgileKOF)

94 class AgileKOF:

95 # Skill

96 name = '轻敏'

97 description = '你可以将一张|B黑桃|r手牌当|G擦弹|r使用或打出。'

98

99 clickable = Agile.clickable

100

101 def is_complete(self, skill):

102 cl = skill.associated_cards

103 me = self.me

104 if len(cl) != 1:

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

106 else:

107 c = cl[0]

108 if c.resides_in not in (me.cards, me.showncards):

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

110 if c.suit != Card.SPADE:

111 return (False, '请选择一张黑桃色手牌牌！')

112 return (True, '这种三脚猫的弹幕，想要打中我是不可能的啦~')

113

114 sound_effect = Agile.sound_effect

115

116

117@ui_meta(characters.nazrin.TreasureHuntAction)

118 class TreasureHuntAction:

119 fatetell_display_name = '探宝'

120

121 def effect_string(self, act):

122 if act.succeeded:

123 return '|G【%s】|r找到了|G%s|r' % (

124 act.target.ui_meta.name,

125 act.card.ui_meta.name,

126 )

127 else:

128 return '|G【%s】|r什么也没有找到…' % (

129 act.target.ui_meta.name,

130 )

131

132 def sound_effect(self, act):

133 tgt = act.target

134 t = tgt.tags

135 if not t['__treasure_hunt_se'] >= t['turn_count']:

136 t['__treasure_hunt_se'] = t['turn_count']

137 return 'thb-cv-nazrin_treasurehunt'