# Coverage for thb/meta/characters/yuyuko.py : 65%

## 58 statements 38 run 20 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

3

4# -- stdlib --

5 import random

6

7# -- third party --

8# -- own --

9 from thb import characters

10 from thb.actions import ttags

11 from thb.meta.common import ui_meta

12

13

14# -- code --

15

16

17@ui_meta(characters.yuyuko.Yuyuko)

18 class Yuyuko:

19 # Character

20 name = '西行寺幽幽子'

21 title = '幽冥阁楼的吃货少女'

22 illustrator = '和茶'

23 cv = 'VV'

24

25 port_image = 'thb-portrait-yuyuko'

26 figure_image = 'thb-figure-yuyuko'

27 miss_sound_effect = 'thb-cv-yuyuko_miss'

28

29 notes = '|RKOF不平衡角色'

30

31

32@ui_meta(characters.yuyuko.GuidedDeath)

33 class GuidedDeath:

34 # Skill

35 name = '诱死'

36 description = '出牌阶段限一次，你可以令一名其它角色失去一点体力，然后其于回合结束阶段回复一点体力。回合结束阶段，若你于出牌阶段没有发动过该技能，则所有体力值为1的其它角色失去一点体力。'

37

38 def clickable(self):

39 me = self.me

40 if ttags(me)['guided_death_active_use']:

41 return False

42

43 if not self.my_turn():

44 return False

45

46 return True

47

48 def is_action_valid(self, sk, tl):

49 assert sk.is_card(characters.yuyuko.GuidedDeath)

50 cards = sk.associated_cards

51

52 if len(cards) != 0:

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

54

55 if not tl:

56 return (False, '请选择『诱死』发动的目标')

57

58 return (True, '发动「诱死」（回合结束时不再发动第二效果）')

59

60 def effect_string(self, act):

61 return '|G【%s】|r将|G【%s】|r献祭给了西行妖。' % (

62 act.source.ui_meta.name,

63 act.target.ui_meta.name,

64 )

65

66 def sound_effect(self, act):

67 return 'thb-cv-yuyuko_pcb'

68

69

70@ui_meta(characters.yuyuko.SoulDrain)

71 class SoulDrain:

72 # Skill

73 name = '离魂'

74 description = (

75 '你的回合内，当一名其它角色进入濒死状态时，你摸一张牌，然后你可以与该角色拼点：\n'

76 '|B|R>> |r若你赢，则将其体力上限改为1。\n'

77 '|B|R>> |r若你没赢，则将其体力值改为1。'

78 )

79

80

81@ui_meta(characters.yuyuko.PerfectCherryBlossom)

82 class PerfectCherryBlossom:

83 # Skill

84 name = '反魂'

85 description = (

86 '|B锁定技|r，一名角色被击坠后，你可以增加一点体力上限或回复一点体力。你的手牌上限是你的体力上限。'

87 )

88

89

90@ui_meta(characters.yuyuko.PerfectCherryBlossomExtractAction)

91 class PerfectCherryBlossomExtractAction:

92 choose_option_prompt = '返魂：请选择你要的效果'

93 choose_option_buttons = (('回复体力', 'life'), ('增加体力上限', 'maxlife'))

94

95 def effect_string_before(self, act):

96 return '幽雅地绽放吧，墨染的樱花！西行妖的力量又增强了一些。'

97

98 def sound_effect_before(self, act):

99 return 'thb-cv-yuyuko_pcb_extract'

100

101

102@ui_meta(characters.yuyuko.GuidedDeathEffect)

103 class GuidedDeathEffect:

104 def effect_string_apply(self, act):

105 return '|G【%s】|r：“既然在座的各位中暑的中暑，受伤的受伤，不如都到花下沉眠吧！”' % (

106 act.source.ui_meta.name,

107 )

108

109

110@ui_meta(characters.yuyuko.SoulDrainEffect)

111 class SoulDrainEffect:

112 # choose_option

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

114 choose_option_prompt = '你要发动『离魂』吗？'

115

116 def effect_string_apply(self, act):

117 return '|G【%s】|r微笑着站在一旁。|G【%s】|r似乎离死亡更近了一点。' % (

118 act.source.ui_meta.name,

119 act.target.ui_meta.name,

120 )

121

122 def sound_effect_before(self, act):

123 return random.choice([

124 'thb-cv-yuyuko_souldrain1',

125 'thb-cv-yuyuko_souldrain2',

126 ])