Coverage for thb/meta/characters/parsee.py : 98%
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 Card
9from thb.cards.classes import DemolitionCard
10from thb.meta.common import ui_meta
13# -- code --
14@ui_meta(characters.parsee.Parsee)
15class Parsee:
16 # Character
17 name = '水桥帕露西'
18 title = '地壳下的嫉妒心'
19 illustrator = '和茶'
20 cv = '小羽'
22 port_image = 'thb-portrait-parsee'
23 figure_image = 'thb-figure-parsee'
24 miss_sound_effect = 'thb-cv-parsee_miss'
27@ui_meta(characters.parsee.Envy)
28class Envy:
29 # Skill
30 name = '嫉妒'
31 description = '你可以将一张黑色牌当|G城管执法|r使用;每当距离1的其他角色的方块牌被你使用的|G城管执法|r弃置而置入弃牌堆后,你可以获得之。'
33 def clickable(self):
34 me = self.me
36 if self.my_turn() and (me.cards or me.showncards or me.equips):
37 return True
39 return False
41 def is_action_valid(self, sk, tl):
42 skill = sk
43 assert skill.is_card(characters.parsee.Envy)
44 cl = skill.associated_cards
45 if len(cl) != 1:
46 return (False, '请选择一张牌!')
47 else:
48 c = sk
49 if c.suit not in (Card.SPADE, Card.CLUB):
50 return (False, '请选择一张黑色的牌!')
51 return DemolitionCard().ui_meta.is_action_valid([skill], tl)
53 def effect_string(self, act):
54 # for LaunchCard.ui_meta.effect_string
55 source = act.source
56 card = act.card
57 target = act.target
58 s = '|G【%s】|r发动了嫉妒技能,将|G%s|r当作|G%s|r对|G【%s】|r使用。' % (
59 source.ui_meta.name,
60 card.associated_cards[0].ui_meta.name,
61 card.treat_as.ui_meta.name,
62 target.ui_meta.name,
63 )
64 return s
66 def sound_effect(self, act):
67 return 'thb-cv-parsee_envy'
70@ui_meta(characters.parsee.EnvyHandler)
71class EnvyHandler:
72 choose_option_buttons = (('获得', True), ('不获得', False))
74 def choose_option_prompt(self, act):
75 return '你要获得【%s】吗?' % act.card.ui_meta.name
78@ui_meta(characters.parsee.EnvyRecycleAction)
79class EnvyRecycleAction:
80 def effect_string(self, act):
81 return '|G【%s】|r:“喂喂这么好的牌扔掉不觉得可惜么?不要嫉妒我。”' % (
82 act.source.ui_meta.name
83 )