Hide keyboard shortcuts

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 -*- 

2from __future__ import annotations 

3 

4# -- stdlib -- 

5# -- third party -- 

6# -- own -- 

7from thb import actions, characters 

8from thb.meta.common import ui_meta 

9 

10 

11# -- code -- 

12@ui_meta(characters.eirin.SkySilk) 

13class 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(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(act): 

46 return 'thb-cv-eirin_medic' 

47 

48 

49@ui_meta(characters.eirin.SkySilkAction) 

50class SkySilkAction: 

51 # choose_option 

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

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

54 

55 

56@ui_meta(characters.eirin.LunaString) 

57class LunaString: 

58 name = '月弦' 

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

60 

61 def clickable(g): 

62 try: 

63 act = g.hybrid_stack[-1] 

64 if act.cond and act.cond([characters.eirin.LunaString(g.me)]): 

65 return True 

66 

67 except (IndexError, AttributeError): 

68 pass 

69 

70 return False 

71 

72 def is_complete(self, sk): 

73 from thb.cards.base import VirtualCard 

74 

75 acards = sk.associated_cards 

76 if len(acards) != 1: 

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

78 

79 c = acards[0] 

80 

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

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

83 

84 if c.is_card(VirtualCard): 84 ↛ 85line 84 didn't jump to line 85, because the condition on line 84 was never true

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

86 

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

88 

89 def is_action_valid(self, sk, tl): 

90 from thb.cards.classes import AttackCard 

91 

92 isc, t = self.is_complete(sk) 

93 if not isc: 

94 return isc, t 

95 c = sk.associated_cards[0] 

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

97 

98 

99@ui_meta(characters.eirin.LunaStringPlaceCard) 

100class LunaStringPlaceCard: 

101 # choose_option 

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

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

104 

105 def effect_string(act): 

106 if act.direction == 'front': 

107 return '阴谋!有人注意到牌堆上面的牌变了吗?' 

108 else: 

109 return '阴谋!有人注意到牌堆好像比原来高了一点吗?' 

110 

111 

112@ui_meta(characters.eirin.Eirin) 

113class Eirin: 

114 # Character 

115 name = '八意永琳' 

116 title = '伪月主谋' 

117 illustrator = '渚FUN' 

118 cv = 'VV' 

119 

120 port_image = 'thb-portrait-eirin' 

121 figure_image = 'thb-figure-eirin' 

122 miss_sound_effect = 'thb-cv-eirin_miss' 

123 

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