# Coverage for thb/meta/characters/marisa.py : 56%

## 39 statements 24 run 15 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.marisa.Marisa)

13 class Marisa:

14 # Character

15 name = '雾雨魔理沙'

16 title = '绝非普通的强盗少女'

17 illustrator = '霏茶'

18 cv = '君寻'

19

20 port_image = 'thb-portrait-marisa'

21 figure_image = 'thb-figure-marisa'

22 miss_sound_effect = 'thb-cv-marisa_miss'

23

24

25@ui_meta(characters.marisa.Daze)

26 class Daze:

27 name = '打贼'

28

29 def effect_string(self, act):

30 # for LaunchCard.ui_meta.effect_string

31 return '|G【%s】|r喊道：“打贼啦！”向|G【%s】|r使用了|G弹幕|r。' % (

32 act.source.ui_meta.name,

33 act.target.ui_meta.name,

34 )

35

36

37@ui_meta(characters.marisa.BorrowAction)

38 class BorrowAction:

39 # choose_option

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

41 choose_option_prompt = '你要视为对魔理沙使用弹幕吗？'

42

43

44@ui_meta(characters.marisa.Borrow)

45 class Borrow:

46 # Skill

47 name = '借走'

48 description = '出牌阶段限一次，你可以获得其他角色的一张牌，然后该角色可以视为对你使用了一张|G弹幕|r。'

49

50 def clickable(self):

51 if self.limit1_skill_used('borrow_tag'):

52 return False

53

54 if not self.my_turn(): return False

55

56 return True

57

58 def is_action_valid(self, sk, tl):

59 if sk.associated_cards:

60 return (False, '请不要选择牌!')

61

62 if len(tl) != 1:

63 return (False, '请选择1名玩家')

64

65 tgt = tl[0]

66 if not (tgt.cards or tgt.showncards or tgt.equips):

67 return (False, '目标没有牌可以“借给”你')

68

69 return (True, '我死了以后你们再拿回去好了！')

70

71 def effect_string(self, act):

72 # for LaunchCard.ui_meta.effect_string

73 return '大盗|G【%s】|r又出来“|G借走|r”了|G【%s】|r的牌。' % (

74 act.source.ui_meta.name,

75 act.target.ui_meta.name,

76 )

77

78 def sound_effect(self, act):

79 return 'thb-cv-marisa_borrow'