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

## 56 statements 37 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.cards.base import Skill

9 from thb.meta.common import ui_meta

10

11

12# -- code --

13@ui_meta(characters.komachi.Komachi)

14 class Komachi:

15 # Character

16 name = '小野塚小町'

17 title = '乳不巨何以聚人心'

18 illustrator = '渚FUN'

19 cv = 'VV'

20

21 port_image = 'thb-portrait-komachi'

22 figure_image = 'thb-figure-komachi'

23 miss_sound_effect = 'thb-cv-komachi_miss'

24

25

26@ui_meta(characters.komachi.Riverside)

27 class Riverside:

28 # Skill

29 name = '彼岸'

30 description = '出牌阶段限一次，你可以弃置一张牌并指定一名其他角色，你与其距离视为1直到回合结束，然后若该角色的体力值为全场最少的（或之一），你选择一项：|B|R>> |r摸一张牌，|B|R>> |r弃置其一张牌。'

31

32 def clickable(self):

33 me = self.me

34 if not self.my_turn(): return False

35 if self.limit1_skill_used('riverside_tag'): return False

36

37 return bool(me.cards or me.showncards or me.equips)

38

39 def is_action_valid(self, sk, tl):

40 acards = sk.associated_cards

41 if (not acards) or len(acards) != 1:

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

43

44 card = acards[0]

45

46 if card.resides_in.type not in ('cards', 'showncards', 'equips'):

47 return (False, 'WTF?!')

48

49 if card.is_card(Skill):

50 return (False, '你不可以像这样组合技能')

51

52 return (True, '近一点~再近一点~~')

53

54 def effect_string(self, act):

55 return '|G【%s】|r对|G【%s】|r使用了|G彼岸|r。' % (

56 act.source.ui_meta.name,

57 act.target.ui_meta.name

58 )

59

60 def sound_effect(self, act):

61 return 'thb-cv-komachi_riverside'

62

63

64@ui_meta(characters.komachi.RiversideAction)

65 class RiversideAction:

66 # choose_option meta

67 choose_option_buttons = (('弃置一张牌', 'drop'), ('摸一张牌', 'draw'))

68 choose_option_prompt = '彼岸：你希望发动的效果？'

69

70

71@ui_meta(characters.komachi.ReturningAwake)

72 class ReturningAwake:

73 def effect_string(self, act):

74 return '|G【%s】|r：“啊啊不能再偷懒啦！要被四季大人说教啦！”' % (

75 act.target.ui_meta.name,

76 )

77

78 def sound_effect(self, act):

79 return 'thb-cv-komachi_awake'

80

81

82@ui_meta(characters.komachi.Returning)

83 class Returning:

84 # Skill

85 name = '归航'

86 description = (

87 '|B觉醒技|r，准备阶段开始时，若你体力值小于手牌数且不大于2，你减1点体力上限并获得技能|R渡钱|r。\n'

88 '|B|R>> |b渡钱|r：每当你对距离1的其他角色造成伤害后，你可以获得其一张牌。'

89 )

90

91

92@ui_meta(characters.komachi.FerryFee)

93 class FerryFee:

94 # Skill

95 name = '渡钱'

96 description = '每当你对距离1的其他角色造成伤害后，你可以获得其一张牌。'

97

98

99@ui_meta(characters.komachi.FerryFeeEffect)

100 class FerryFeeEffect:

101 def effect_string(self, act):

102 return '|G【%s】|r收走了|G【%s】|r的一张牌作为|G渡钱|r。' % (

103 act.source.ui_meta.name,

104 act.target.ui_meta.name,

105 )

106

107 def sound_effect(self, act):

108 return 'thb-cv-komachi_ferryfee'

109

110

111@ui_meta(characters.komachi.FerryFeeHandler)

112 class FerryFeeHandler:

113 # choose_option meta

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

115 choose_option_prompt = '你要发动渡钱吗？'