# Coverage for thb/meta/characters/parsee.py : 98%

## 46 statements 45 run 1 missing 0 excluded 0 partial

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 from __future__ import annotations

3

4# -- stdlib --

5# -- third party --

6# -- own --

7 from thb import characters

8 from thb.cards.base import Card

9 from thb.cards.classes import DemolitionCard

10 from thb.meta.common import ui_meta

11

12

13# -- code --

14@ui_meta(characters.parsee.Parsee)

15 class Parsee:

16 # Character

17 name = '水桥帕露西'

18 title = '地壳下的嫉妒心'

19 illustrator = '和茶'

20 cv = '小羽'

21

22 port_image = 'thb-portrait-parsee'

23 figure_image = 'thb-figure-parsee'

24 miss_sound_effect = 'thb-cv-parsee_miss'

25

26

27@ui_meta(characters.parsee.Envy)

28 class Envy:

29 # Skill

30 name = '嫉妒'

31 description = '你可以将一张黑色牌当|G城管执法|r使用；每当距离1的其他角色的方块牌被你使用的|G城管执法|r弃置而置入弃牌堆后，你可以获得之。'

32

33 def clickable(self):

34 me = self.me

35

36 if self.my_turn() and (me.cards or me.showncards or me.equips):

37 return True

38

39 return False

40

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)

52

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

65

66 def sound_effect(self, act):

67 return 'thb-cv-parsee_envy'

68

69

70@ui_meta(characters.parsee.EnvyHandler)

71 class EnvyHandler:

72 choose_option_buttons = (('获得', True), ('不获得', False))

73

74 def choose_option_prompt(self, act):

75 return '你要获得【%s】吗？' % act.card.ui_meta.name

76

77

78@ui_meta(characters.parsee.EnvyRecycleAction)

79 class EnvyRecycleAction:

80 def effect_string(self, act):

81 return '|G【%s】|r：“喂喂这么好的牌扔掉不觉得可惜么？不要嫉妒我。”' % (

82 act.source.ui_meta.name

83 )