# Coverage for thb/meta/characters/medicine.py : 87%

## 45 statements 37 run 8 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.meta.common import ui_meta

9

10

11# -- code --

12@ui_meta(characters.medicine.Medicine)

13 class Medicine:

14 # Character

15 name = '梅蒂欣'

16 title = '小小的甜蜜毒药'

17 illustrator = '和茶'

18 cv = 'VV'

19

20 port_image = 'thb-portrait-medicine'

21 figure_image = 'thb-figure-medicine'

22 miss_sound_effect = 'thb-cv-medicine_miss'

23

24 notes = '|RKOF不平衡角色|r'

25

26

27@ui_meta(characters.medicine.Ciguatera)

28 class Ciguatera:

29 # Skill

30 name = '神经之毒'

31 description = '一名角色准备阶段开始时，你可以弃置一张黑色牌，令其失去1点体力并获得|B喝醉|r状态。'

32

33

34@ui_meta(characters.medicine.CiguateraAction)

35 class CiguateraAction:

36 def effect_string_before(self, act):

37 return '|G【%s】|r对|G【%s】|r使用了|G神经之毒|r。' % (

38 act.source.ui_meta.name,

39 act.target.ui_meta.name

40 )

41

42 def sound_effect(self, act):

43 return 'thb-cv-medicine_ciguatera'

44

45

46@ui_meta(characters.medicine.CiguateraHandler)

47 class CiguateraHandler:

48 def choose_card_text(self, act, cards):

49 return act.cond(cards), '弃置一张黑色牌，发动【神经之毒】'

50

51

52@ui_meta(characters.medicine.Melancholy)

53 class Melancholy:

54 # Skill

55 name = '忧郁之毒'

56 description = '每当你受到一次有来源的伤害后，你可以展示并获得牌堆顶的一张牌，若此牌不是梅花牌，伤害来源不能使用或打出手牌，直到回合结束。'

57

58

59@ui_meta(characters.medicine.MelancholyPoison)

60 class MelancholyPoison:

61 name = '忧郁之毒(效果)'

62

63 def is_complete(self, skill):

64 return (False, '忧郁之毒：无法使用或打出手牌直到该回合结束')

65

66 def is_action_valid(self, sk, tl):

67 return (False, '忧郁之毒：无法使用或打出手牌直到该回合结束')

68

69

70@ui_meta(characters.medicine.MelancholyAction)

71 class MelancholyAction:

72 def effect_string_before(self, act):

73 return '|G【%s】|r对|G【%s】|r使用了|G忧郁之毒|r。' % (

74 act.source.ui_meta.name,

75 act.target.ui_meta.name

76 )

77

78 def effect_string(self, act):

79 return ('|G【%s】|r陷入了忧郁。' if act.effective

80 else '但|G【%s】|r缓了过来。') % act.target.ui_meta.name

81

82 def sound_effect(self, act):

83 return 'thb-cv-medicine_melancholy'

84

85

86@ui_meta(characters.medicine.MelancholyHandler)

87 class MelancholyHandler:

88 # choose_option

89 choose_option_buttons = (('发动', True), ('不发动', False))

90 choose_option_prompt = '是否发动【忧郁之毒】'

91

92

93@ui_meta(characters.medicine.MelancholyLimit)

94 class MelancholyLimit:

95 target_independent = True

96 shootdown_message = '【忧郁】你不能使用或打出手牌'