# Coverage for thb/meta/characters/daiyousei.py : 66%

## 62 statements 41 run 21 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.daiyousei.Daiyousei)

13 class Daiyousei:

14 # Character

15 name = '大妖精'

16 title = '全身萌点的保姆'

17 illustrator = '渚FUN'

18 cv = '简翎'

19

20 port_image = 'thb-portrait-daiyousei'

21 figure_image = 'thb-figure-daiyousei'

22 miss_sound_effect = 'thb-cv-daiyousei_miss'

23

24

25@ui_meta(characters.daiyousei.DaiyouseiKOF)

26 class DaiyouseiKOF:

27 # Character

28 name = '大妖精'

29 title = '全身萌点的保姆'

30 illustrator = '渚FUN'

31 cv = '简翎'

32

33 port_image = 'thb-portrait-daiyousei'

34 figure_image = 'thb-figure-daiyousei'

35 miss_sound_effect = 'thb-cv-daiyousei_miss'

36

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

38

39

40@ui_meta(characters.daiyousei.Support)

41 class Support:

42 # Skill

43 name = '支援'

44 description = '出牌阶段，你可将任意张牌交给其他角色，此阶段你给出的牌首次达到三张时，你回复1点体力。'

45

46 def clickable(self):

47 g = self.game

48 me = self.me

49

50 try:

51 act = g.action_stack[-1]

52 except IndexError:

53 return False

54

55 if isinstance(act, actions.ActionStage) and (me.cards or me.showncards or me.equips):

56 return True

57

58 return False

59

60 def is_action_valid(self, sk, tl):

61 cl = sk.associated_cards

62 if not cl: return (False, '请选择要给出的牌')

63 me = self.me

64 allcards = list(me.cards) + list(me.showncards) + list(me.equips)

65 if any(

66 c not in allcards

67 for c in cl

68 ): return (False, '你只能选择手牌与装备牌！')

69 if len(tl) != 1: return (False, '请选择1名玩家')

70 return (True, '加油！')

71

72 def effect_string(self, act):

73 # for LaunchCard.ui_meta.effect_string

74 return '|G【%s】|r发动了|G支援|r技能，将%d张牌交给了|G【%s】|r。' % (

75 act.source.ui_meta.name,

76 len(act.card.associated_cards),

77 act.target.ui_meta.name,

78 )

79

80 def sound_effect(self, act):

81 return 'thb-cv-daiyousei_support'

82

83

84@ui_meta(characters.daiyousei.SupportKOF)

85 class SupportKOF:

86 # Skill

87 name = '支援'

88 description = '你被击坠时，你可以将你的所有牌移出游戏，并令下一名登场的角色获得这些牌。'

89

90

91@ui_meta(characters.daiyousei.SupportKOFAction)

92 class SupportKOFAction:

93

94 def effect_string_before(self, act):

95 return '|G【%s】|r发动了|G支援|r技能，将所有的牌转移给下一个出场角色。' % (

96 act.target.ui_meta.name

97 )

98

99

100@ui_meta(characters.daiyousei.SupportKOFHandler)

101 class SupportKOFHandler:

102 choose_option_prompt = '你要发动【支援】，将所有牌转移给下一名出场角色吗？'

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

104

105

106@ui_meta(characters.daiyousei.Moe)

107 class Moe:

108 # Skill

109 name = '卖萌'

110 description = '|B锁定技|r，摸牌阶段你额外摸X张牌（X为你已损失的体力值）。'

111

112

113@ui_meta(characters.daiyousei.MoeDrawCard)

114 class MoeDrawCard:

115 def effect_string(self, act):

116 return '|G【%s】|r用手扯开脸颊，向大家做了一个夸张的笑脸，摸了%d张牌跑开了~' % (

117 act.target.ui_meta.name,

118 act.amount,

119 )

120

121 def sound_effect(self, act):

122 return 'thb-cv-daiyousei_moe'

123

124# ----------