# Coverage for thb/meta/characters/eirin.py : 49%

## 62 statements 32 run 30 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 actions, characters

8 from thb.meta.common import ui_meta

9

10

11# -- code --

12@ui_meta(characters.eirin.SkySilk)

13 class SkySilk:

14 # Skill

15 name = '天丝'

16 description = (

17 '出牌阶段限一次，你可以弃置一名角色的一张牌，并令其选择一项：\n'

18 '|B|R>> |r回复1点体力。\n'

19 '|B|R>> |r展示牌堆底的3张牌，获得其中的非基本牌，并弃置其他的牌。'

20 )

21

22 def clickable(self):

23 me = self.me

24 if not self.my_turn() or actions.ttags(me)['sky_silk']:

25 return False

26

27 return True

28

29 def is_action_valid(g, sk, tl):

30 cl = sk.associated_cards

31 if cl:

32 return False, '请不要选择牌！'

33

34 return True, '发动「天丝」'

35

36 def effect_string(self, act):

37 # for LaunchCard.ui_meta.effect_string

38 return (

39 '|G【%s】|r对|G【%s】|r发动了「天丝」。'

40 ) % (

41 act.source.ui_meta.name,

42 act.target.ui_meta.name,

43 )

44

45 def sound_effect(self, act):

46 return 'thb-cv-eirin_medic'

47

48

49@ui_meta(characters.eirin.SkySilkAction)

50 class SkySilkAction:

51 # choose_option

52 choose_option_buttons = (('回复', 'heal'), ('摸牌', 'draw'))

53 choose_option_prompt = '选择你要发动的效果'

54

55

56@ui_meta(characters.eirin.LunaString)

57 class LunaString:

58 name = '月弦'

59 description = '你可以将一张手牌置于牌堆顶或牌堆底底，视为使用或打出了一张|G弹幕|r。'

60

61 def clickable(self):

62 return self.accept_cards([characters.eirin.LunaString(self.me)])

63

64 def is_complete(self, sk):

65 from thb.cards.base import VirtualCard

66

67 acards = sk.associated_cards

68 if len(acards) != 1:

69 return False, '请选择一张手牌'

70

71 c = acards[0]

72

73 if c.resides_in.type not in ('cards', 'showncards'):

74 return False, '请选择一张手牌'

75

76 if c.is_card(VirtualCard):

77 return False, '「月弦」不允许组合使用'

78

79 return True, '发动「月弦」'

80

81 def is_action_valid(self, sk, tl):

82 from thb.cards.classes import AttackCard

83

84 isc, t = self.is_complete(sk)

85 if not isc:

86 return isc, t

87 c = sk.associated_cards[0]

88 return AttackCard().ui_meta.is_action_valid(c, tl)

89

90

91@ui_meta(characters.eirin.LunaStringPlaceCard)

92 class LunaStringPlaceCard:

93 # choose_option

94 choose_option_buttons = (('牌堆顶↑', 'front'), ('牌堆底↓', 'back'))

95 choose_option_prompt = '你要把牌放到哪里'

96

97 def effect_string(self, act):

98 if act.direction == 'front':

99 return '阴谋！有人注意到牌堆上面的牌变了吗？'

100 else:

101 return '阴谋！有人注意到牌堆好像比原来高了一点吗？'

102

103

104@ui_meta(characters.eirin.Eirin)

105 class Eirin:

106 # Character

107 name = '八意永琳'

108 title = '伪月主谋'

109 illustrator = '渚FUN'

110 cv = 'VV'

111

112 port_image = 'thb-portrait-eirin'

113 figure_image = 'thb-figure-eirin'

114 miss_sound_effect = 'thb-cv-eirin_miss'

115

116 notes = u'|RKOF不平衡角色|r'