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

2 

3# -- stdlib -- 

4# -- third party -- 

5# -- own -- 

6from thb import actions, characters 

7from thb.cards.base import Card, VirtualCard 

8from thb.meta.common import ui_meta 

9 

10# -- code -- 

11 

12 

13@ui_meta(characters.kogasa.Jolly) 

14class Jolly: 

15 # Skill 

16 name = '愉快' 

17 description = '|B锁定技|r,摸牌阶段摸牌后,你令一名角色摸一张牌。' 

18 

19 

20@ui_meta(characters.kogasa.JollyDrawCard) 

21class JollyDrawCard: 

22 def effect_string(self, act): 

23 return '|G【%s】|r高兴地让|G【%s】|r摸了%d张牌~' % ( 

24 act.source.ui_meta.name, 

25 act.target.ui_meta.name, 

26 act.amount, 

27 ) 

28 

29 def sound_effect(self, act): 

30 return 'thb-cv-kogasa_jolly' 

31 

32 

33@ui_meta(characters.kogasa.JollyHandler) 

34class JollyHandler: 

35 def choose_card_text(self, g, act, cards): 

36 if cards: 

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

38 

39 return (True, '(~ ̄▽ ̄)~') 

40 

41 # choose_players 

42 def target(self, pl): 

43 if not pl: 

44 return (False, '请选择1名玩家,该玩家摸一张牌') 

45 

46 return (True, '(~ ̄▽ ̄)~') 

47 

48 

49@ui_meta(characters.kogasa.Surprise) 

50class Surprise: 

51 # Skill 

52 name = '惊吓' 

53 description = '出牌阶段限一次,你可以选择一张手牌并指定一名其他角色,该角色选择一种花色后,获得此牌并明置之。若此牌与其选择的花色不同,你对其造成1点伤害。' 

54 

55 def clickable(self, game): 

56 me = game.me 

57 

58 if me.tags.get('surprise_tag', 0) >= me.tags.get('turn_count', 0): 

59 return False 

60 

61 try: 

62 act = game.action_stack[-1] 

63 except IndexError: 

64 return False 

65 

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

67 return True 

68 

69 return False 

70 

71 def is_action_valid(self, sk, tl): 

72 if len(tl) != 1: 

73 return (False, '请选择惊吓对象…') 

74 

75 cl = sk.associated_cards 

76 if len(cl) != 1: 

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

78 

79 c, = cl 

80 if c.is_card(VirtualCard) or c.resides_in.type not in ('cards', 'showncards'): 

81 return (False, '请选择一张手牌!') 

82 

83 # return (True, u'(´・ω・`)') 

84 return (True, r'\ ( °▽ °) /') 

85 

86 def effect_string(self, act): 

87 # for LaunchCard.ui_meta.effect_string 

88 return ( 

89 '|G【%s】|r突然出现在|G【%s】|r面前,伞上' 

90 '的大舌头直接糊在了|G【%s】|r的脸上!' 

91 ) % ( 

92 act.source.ui_meta.name, 

93 act.target.ui_meta.name, 

94 act.target.ui_meta.name, 

95 ) 

96 

97 def sound_effect(self, act): 

98 return 'thb-cv-kogasa_surprise' 

99 

100 

101@ui_meta(characters.kogasa.SurpriseAction) 

102class SurpriseAction: 

103 # choose_option 

104 choose_option_buttons = ( 

105 ('黑桃', Card.SPADE), 

106 ('红桃', Card.HEART), 

107 ('草花', Card.CLUB), 

108 ('方片', Card.DIAMOND), 

109 ) 

110 

111 # choose_option 

112 choose_option_buttons = ( 

113 ('♠', Card.SPADE), 

114 ('♥', Card.HEART), 

115 ('♣', Card.CLUB), 

116 ('♦', Card.DIAMOND), 

117 ) 

118 

119 choose_option_prompt = '请选择一个花色…' 

120 

121 def effect_string(self, act): 

122 if act.succeeded: 

123 return '效果拔群!' 

124 else: 

125 return '似乎没有什么效果' 

126 

127 

128@ui_meta(characters.kogasa.Kogasa) 

129class Kogasa: 

130 # Character 

131 name = '多多良小伞' 

132 title = '愉快的遗忘之伞' 

133 illustrator = '霏茶' 

134 cv = 'VV' 

135 

136 port_image = 'thb-portrait-kogasa' 

137 figure_image = 'thb-figure-kogasa' 

138 miss_sound_effect = 'thb-cv-kogasa_miss'