# Coverage for thb/meta/characters/shinmyoumaru.py : 80%

## 39 statements 30 run 9 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 import random

6

7# -- third party --

8# -- own --

9 from thb import characters

10 from thb.meta.common import ui_meta

11

12

13# -- code --

14@ui_meta(characters.shinmyoumaru.MiracleMallet)

15 class MiracleMallet:

16 # Skill

17 name = '万宝槌'

18 description = '当一名角色的判定牌生效前，你可以用一张点数大于此牌的牌替换之。'

19

20

21@ui_meta(characters.shinmyoumaru.MiracleMalletAction)

22 class MiracleMalletAction:

23 def effect_string(self, act):

24 return '|G【%s】|r将|G【%s】|r的判定结果改为%s。' % (

25 act.source.ui_meta.name,

26 act.target.ui_meta.name,

27 self.card_desc(act.card)

28 )

29

30 def sound_effect(self, act):

31 return random.choice((

32 'thb-cv-shinmyoumaru_mallet1',

33 'thb-cv-shinmyoumaru_mallet2',

34 ))

35

36

37@ui_meta(characters.shinmyoumaru.VengeOfTsukumogami)

38 class VengeOfTsukumogami:

39 # Skill

40 name = '付丧神之怨'

41 description = '每当其他角色装备区的牌因弃置而置入弃牌堆时，你可以进行一次判定，若为9~K，你对其造成1点伤害。'

42

43

44@ui_meta(characters.shinmyoumaru.VengeOfTsukumogamiAction)

45 class VengeOfTsukumogamiAction:

46 def effect_string_before(self, act):

47 return '|G【%s】|r对|G【%s】|r发动了|G付丧神之怨|r。' % (

48 act.source.ui_meta.name,

49 act.target.ui_meta.name,

50 )

51

52 def sound_effect(self, act):

53 return random.choice((

54 'thb-cv-shinmyoumaru_venge1',

55 'thb-cv-shinmyoumaru_venge2',

56 ))

57

58

59@ui_meta(characters.shinmyoumaru.MiracleMalletHandler)

60 class MiracleMalletHandler:

61 # choose_card

62 def choose_card_text(self, act, cards):

63 if act.cond(cards):

64 return (True, '发动【万宝槌】！')

65 else:

66 return (False, '请选择一张牌点数更大的牌代替当前的判定牌')

67

68

69@ui_meta(characters.shinmyoumaru.VengeOfTsukumogamiHandler)

70 class VengeOfTsukumogamiHandler:

71 # choose_option

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

73

74 def choose_option_prompt(self, act):

75 prompt = '你要发动【付丧神之怨】吗（对%s）？'

76 return prompt % act.target.ui_meta.name

77

78

79@ui_meta(characters.shinmyoumaru.Shinmyoumaru)

80 class Shinmyoumaru:

81 # Character

82 name = '少名针妙丸'

83 title = '进击的小人'

84 illustrator = '六仔OwO'

85 designer = 'yourccz95'

86 cv = '小羽'

87

88 port_image = 'thb-portrait-shinmyoumaru'

89 figure_image = 'thb-figure-shinmyoumaru'

90 miss_sound_effect = 'thb-cv-shinmyoumaru_miss'