Coverage for thb/meta/characters/komachi.py : 77%
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
4# -- stdlib --
5# -- third party --
6# -- own --
7from thb import characters
8from thb.cards.base import Skill
9from thb.meta.common import ui_meta
12# -- code --
13@ui_meta(characters.komachi.Komachi)
14class Komachi:
15 # Character
16 name = '小野塚小町'
17 title = '乳不巨何以聚人心'
18 illustrator = '渚FUN'
19 cv = 'VV'
21 port_image = 'thb-portrait-komachi'
22 figure_image = 'thb-figure-komachi'
23 miss_sound_effect = 'thb-cv-komachi_miss'
26@ui_meta(characters.komachi.Riverside)
27class Riverside:
28 # Skill
29 name = '彼岸'
30 description = '出牌阶段限一次,你可以弃置一张牌并指定一名其他角色,你与其距离视为1直到回合结束,然后若该角色的体力值为全场最少的(或之一),你选择一项:|B|R>> |r摸一张牌,|B|R>> |r弃置其一张牌。'
32 def clickable(self):
33 g = self.game
34 if not self.my_turn(): return False
35 if self.limit1_skill_used('riverside_tag'): return False
37 me = g.me
38 return bool(me.cards or me.showncards or me.equips)
40 def is_action_valid(self, sk, tl):
41 acards = sk.associated_cards
42 if (not acards) or len(acards) != 1:
43 return (False, '请选择一张牌')
45 card = acards[0]
47 if card.resides_in.type not in ('cards', 'showncards', 'equips'): 47 ↛ 48line 47 didn't jump to line 48, because the condition on line 47 was never true
48 return (False, 'WTF?!')
50 if card.is_card(Skill): 50 ↛ 51line 50 didn't jump to line 51, because the condition on line 50 was never true
51 return (False, '你不可以像这样组合技能')
53 return (True, '近一点~再近一点~~')
55 def effect_string(self, act):
56 return '|G【%s】|r对|G【%s】|r使用了|G彼岸|r。' % (
57 act.source.ui_meta.name,
58 act.target.ui_meta.name
59 )
61 def sound_effect(self, act):
62 return 'thb-cv-komachi_riverside'
65@ui_meta(characters.komachi.RiversideAction)
66class RiversideAction:
67 # choose_option meta
68 choose_option_buttons = (('弃置一张牌', 'drop'), ('摸一张牌', 'draw'))
69 choose_option_prompt = '彼岸:你希望发动的效果?'
72@ui_meta(characters.komachi.ReturningAwake)
73class ReturningAwake:
74 def effect_string(self, act):
75 return '|G【%s】|r:“啊啊不能再偷懒啦!要被四季大人说教啦!”' % (
76 act.target.ui_meta.name,
77 )
79 def sound_effect(self, act):
80 return 'thb-cv-komachi_awake'
83@ui_meta(characters.komachi.Returning)
84class Returning:
85 # Skill
86 name = '归航'
87 description = (
88 '|B觉醒技|r,准备阶段开始时,若你体力值小于手牌数且不大于2,你减1点体力上限并获得技能|R渡钱|r。\n'
89 '|B|R>> |b渡钱|r:每当你对距离1的其他角色造成伤害后,你可以获得其一张牌。'
90 )
93@ui_meta(characters.komachi.FerryFee)
94class FerryFee:
95 # Skill
96 name = '渡钱'
97 description = '每当你对距离1的其他角色造成伤害后,你可以获得其一张牌。'
100@ui_meta(characters.komachi.FerryFeeEffect)
101class FerryFeeEffect:
102 def effect_string(self, act):
103 return '|G【%s】|r收走了|G【%s】|r的一张牌作为|G渡钱|r。' % (
104 act.source.ui_meta.name,
105 act.target.ui_meta.name,
106 )
108 def sound_effect(self, act):
109 return 'thb-cv-komachi_ferryfee'
112@ui_meta(characters.komachi.FerryFeeHandler)
113class FerryFeeHandler:
114 # choose_option meta
115 choose_option_buttons = (('发动', True), ('不发动', False))
116 choose_option_prompt = '你要发动渡钱吗?'