# Coverage for thb/meta/characters/sakuya.py : 57%

## 44 statements 25 run 19 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

3# -- stdlib --

4 import random

5

6# -- third party --

7# -- own --

8 from thb import characters

9 from thb.cards.classes import AttackCard

10 from thb.meta.common import ui_meta

11

12

13# -- code --

14

15

16@ui_meta(characters.sakuya.Sakuya)

17 class Sakuya:

18 # Character

19 name = '十六夜咲夜'

20 title = '完全潇洒的PAD长'

21 illustrator = '和茶'

22 cv = 'VV'

23

24 port_image = 'thb-portrait-sakuya'

25 figure_image = 'thb-figure-sakuya'

26 miss_sound_effect = 'thb-cv-sakuya_miss'

27

28

29@ui_meta(characters.sakuya.Dagger)

30 class Dagger:

31 # Skill

32 name = '飞刀'

33 description = '你可以将一张装备牌当|G弹幕|r使用或打出，以此法使用的|G弹幕|r无距离限制。'

34

35 def clickable(self):

36 me = self.me

37

38 if not (me.cards or me.showncards or me.equips): return False

39 return self.accept_cards([characters.sakuya.Dagger(me)])

40

41 def is_complete(self, skill):

42 assert skill.is_card(characters.sakuya.Dagger)

43 cl = skill.associated_cards

44 if len(cl) != 1 or 'equipment' not in cl[0].category:

45 return (False, '请选择一张装备牌！')

46 return (True, '快看！灰出去了！')

47

48 def is_action_valid(self, sk, tl):

49 rst, reason = self.is_complete(sk)

50 if not rst:

51 return rst, reason

52 else:

53 return AttackCard().ui_meta.is_action_valid(sk, tl)

54

55 def effect_string(self, act):

56 # for LaunchCard.ui_meta.effect_string

57 source = act.source

58 card = act.card

59 target = act.target

60 s = '|G【%s】|r将|G%s|r制成了|G飞刀|r，向|G【%s】|r掷去！' % (

61 source.ui_meta.name,

62 card.associated_cards[0].ui_meta.name,

63 target.ui_meta.name,

64 )

65 return s

66

67 def sound_effect(self, act):

68 return random.choice([

69 'thb-cv-sakuya_dagger1',

70 'thb-cv-sakuya_dagger2',

71 ])

72

73

74@ui_meta(characters.sakuya.LunaDialActionStage)

75 class LunaDialActionStage:

76 def sound_effect(self, act):

77 return 'thb-cv-sakuya_lunadial'

78

79

80@ui_meta(characters.sakuya.LunaDial)

81 class LunaDial:

82 # Skill

83 name = '月时计'

84 description = '|B锁定技|r，准备阶段开始时，你执行一个额外的出牌阶段。'