Coverage for thb/meta/characters/kogasa.py : 90%
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 -*-
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
10# -- code --
13@ui_meta(characters.kogasa.Jolly)
14class Jolly:
15 # Skill
16 name = '愉快'
17 description = '|B锁定技|r,摸牌阶段摸牌后,你令一名角色摸一张牌。'
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 )
29 def sound_effect(self, act):
30 return 'thb-cv-kogasa_jolly'
33@ui_meta(characters.kogasa.JollyHandler)
34class JollyHandler:
35 def choose_card_text(self, act, cards):
36 if cards:
37 return (False, '请不要选择牌!')
39 return (True, '(~ ̄▽ ̄)~')
41 # choose_players
42 def target(self, pl):
43 if not pl: 43 ↛ 44line 43 didn't jump to line 44, because the condition on line 43 was never true
44 return (False, '请选择1名玩家,该玩家摸一张牌')
46 return (True, '(~ ̄▽ ̄)~')
49@ui_meta(characters.kogasa.Surprise)
50class Surprise:
51 # Skill
52 name = '惊吓'
53 description = '出牌阶段限一次,你可以选择一张手牌并指定一名其他角色,该角色选择一种花色后,获得此牌并明置之。若此牌与其选择的花色不同,你对其造成1点伤害。'
55 def clickable(self):
56 g = self.game
57 me = self.me
59 if me.tags.get('surprise_tag', 0) >= me.tags.get('turn_count', 0):
60 return False
62 try:
63 act = g.action_stack[-1]
64 except IndexError:
65 return False
67 if isinstance(act, actions.ActionStage) and (me.cards or me.showncards):
68 return True
70 return False
72 def is_action_valid(self, sk, tl):
73 if len(tl) != 1:
74 return (False, '请选择惊吓对象…')
76 cl = sk.associated_cards
77 if len(cl) != 1:
78 return (False, '请选择一张手牌!')
80 c, = cl
81 if c.is_card(VirtualCard) or c.resides_in.type not in ('cards', 'showncards'):
82 return (False, '请选择一张手牌!')
84 # return (True, u'(´・ω・`)')
85 return (True, r'\ ( °▽ °) /')
87 def effect_string(self, act):
88 # for LaunchCard.ui_meta.effect_string
89 return (
90 '|G【%s】|r突然出现在|G【%s】|r面前,伞上'
91 '的大舌头直接糊在了|G【%s】|r的脸上!'
92 ) % (
93 act.source.ui_meta.name,
94 act.target.ui_meta.name,
95 act.target.ui_meta.name,
96 )
98 def sound_effect(self, act):
99 return 'thb-cv-kogasa_surprise'
102@ui_meta(characters.kogasa.SurpriseAction)
103class SurpriseAction:
104 # choose_option
105 choose_option_buttons = (
106 ('黑桃', Card.SPADE),
107 ('红桃', Card.HEART),
108 ('草花', Card.CLUB),
109 ('方片', Card.DIAMOND),
110 )
112 # choose_option
113 choose_option_buttons = (
114 ('♠', Card.SPADE),
115 ('♥', Card.HEART),
116 ('♣', Card.CLUB),
117 ('♦', Card.DIAMOND),
118 )
120 choose_option_prompt = '请选择一个花色…'
122 def effect_string(self, act):
123 if act.succeeded:
124 return '效果拔群!'
125 else:
126 return '似乎没有什么效果'
129@ui_meta(characters.kogasa.Kogasa)
130class Kogasa:
131 # Character
132 name = '多多良小伞'
133 title = '愉快的遗忘之伞'
134 illustrator = '霏茶'
135 cv = 'VV'
137 port_image = 'thb-portrait-kogasa'
138 figure_image = 'thb-figure-kogasa'
139 miss_sound_effect = 'thb-cv-kogasa_miss'