# Coverage for thb/meta/characters/cirno.py : 62%

## 52 statements 33 run 19 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.cirno.PerfectFreeze)

14 class PerfectFreeze:

15 # Skill

16 name = '完美冻结'

17 description = '每当你使用|G弹幕|r或|G弹幕战|r对其他角色造成伤害时，你可以防止此次伤害，并令该角色弃置一张牌，若其弃置的不为装备区的牌，其失去1点体力。'

18

19

20@ui_meta(characters.cirno.CirnoDropCards)

21 class CirnoDropCards:

22 def effect_string(self, act):

23 return '|G【%s】|r弃置了|G【%s】|r的%s。' % (

24 act.source.ui_meta.name,

25 act.target.ui_meta.name,

26 self.card_desc(act.cards),

27 )

28

29

30@ui_meta(characters.cirno.PerfectFreezeAction)

31 class PerfectFreezeAction:

32 def effect_string_before(self, act):

33 return '|G【%s】|r被冻伤了。' % act.target.ui_meta.name

34

35 def sound_effect(self, act):

36 return 'thb-cv-cirno_perfectfreeze'

37

38 # choose_card meta

39 def choose_card_text(self, act, cards):

40 if act.cond(cards):

41 return (True, '弃置这张牌')

42 else:

43 return (False, '完美冻结：选择一张牌弃置')

44

45

46@ui_meta(characters.cirno.PerfectFreezeHandler)

47 class PerfectFreezeHandler:

48 choose_option_prompt = '你要发动【完美冻结】吗？'

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

50

51

52@ui_meta(characters.cirno.Bakadesu)

53 class Bakadesu:

54 # Skill

55 name = '最强'

56 description = (

57 '出牌阶段限一次，你可以指定一名攻击范围内有你的角色，该角色选择一项：\n'

58 '|B|R>> |r对你使用一张|G弹幕|r。\n'

59 '|B|R>> |r令你弃置其一张牌。'

60 )

61

62 def clickable(self):

63 if ttags(self.me)['bakadesu']:

64 return False

65

66 return self.my_turn()

67

68 def is_action_valid(self, sk, tl):

69 if len(tl) != 1:

70 return (False, '请选择嘲讽对象')

71

72 if len(sk.associated_cards):

73 return (False, '请不要选择牌！')

74

75 return (True, '老娘最强！')

76

77 def effect_string(self, act):

78 # for LaunchCard.ui_meta.effect_string

79 return '|G【%s】|r双手叉腰，对着|G【%s】|r大喊：“老娘最强！”' % (

80 act.source.ui_meta.name,

81 act.target.ui_meta.name,

82 )

83

84 def sound_effect(self, act):

85 return 'thb-cv-cirno_bakadesu'

86

87

88@ui_meta(characters.cirno.BakadesuAction)

89 class BakadesuAction:

90 def choose_card_text(self, act, cl):

91 if act.cond(cl):

92 return (True, '啪！啪！啪！')

93 else:

94 return (False, '请选择一张弹幕对【%s】使用' % act.source.ui_meta.name)

95

96

97@ui_meta(characters.cirno.Cirno)

98 class Cirno:

99 # Character

100 name = '琪露诺'

101 title = '跟青蛙过不去的笨蛋'

102 illustrator = '渚FUN'

103 cv = '君寻'

104

105 port_image = 'thb-portrait-cirno'

106 figure_image = 'thb-figure-cirno'

107 miss_sound_effect = 'thb-cv-cirno_miss'