Hide keyboard shortcuts

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 -- 

4import random 

5 

6# -- third party -- 

7# -- own -- 

8from thb import actions, characters 

9from thb.meta.common import ui_meta 

10 

11# -- code -- 

12 

13 

14@ui_meta(characters.yukari.SpiritingAway) 

15class SpiritingAway: 

16 # Skill 

17 name = '神隐' 

18 description = '出牌阶段限两次,你可以将场上的一张牌暂时移出游戏。你可以观看以此法移出游戏的牌。任何角色被紫暂时移出的牌,会在紫的结束阶段后归还回该角色的手牌中。' 

19 

20 def clickable(self, game): 

21 me = game.me 

22 if me.tags['spirit_away_tag'] >= 2: return False 

23 try: 

24 act = game.action_stack[-1] 

25 if isinstance(act, actions.ActionStage) and act.target is me: 

26 return True 

27 except IndexError: 

28 pass 

29 return False 

30 

31 def is_action_valid(self, sk, tl): 

32 cl = sk.associated_cards 

33 if cl: 

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

35 

36 if not tl: 

37 return (False, '请选择一名玩家') 

38 

39 tgt = tl[0] 

40 catnames = ['cards', 'showncards', 'equips', 'fatetell'] 

41 if not any(getattr(tgt, i) for i in catnames): 41 ↛ exit,   41 ↛ 422 missed branches: 1) line 41 didn't finish the generator expression on line 41, 2) line 41 didn't jump to line 42, because the condition on line 41 was never true

42 return (False, '这货已经没有牌了') 

43 

44 return (True, '发动【神隐】') 

45 

46 

47@ui_meta(characters.yukari.SpiritingAwayAction) 

48class SpiritingAwayAction: 

49 

50 def effect_string(self, act): 

51 words = ( 

52 '17岁就是17岁,后面没有零几个月!', 

53 '叫紫妹就对了,紫妈算什么!', 

54 ) 

55 # return u'|G【{source}】|r:“{word}”(|G{target}|r的{card}不见了)'.format( 

56 return '|G【{source}】|r:“{word}”(|G{target}|r的一张牌不见了)'.format( 

57 source=act.source.ui_meta.name, 

58 target=act.target.ui_meta.name, 

59 word=random.choice(words), 

60 # card=card_desc(act.card), 

61 ) 

62 

63 def sound_effect(self, act): 

64 return random.choice([ 

65 'thb-cv-yukari_spiritaway1', 

66 'thb-cv-yukari_spiritaway2', 

67 ]) 

68 

69 

70@ui_meta(characters.yukari.Yukari) 

71class Yukari: 

72 # Character 

73 name = '八云紫' 

74 title = '永远17岁' 

75 illustrator = 'Vivicat@幻想梦斗符' 

76 cv = 'VV' 

77 

78 port_image = 'thb-portrait-yukari' 

79 figure_image = 'thb-figure-yukari' 

80 miss_sound_effect = 'thb-cv-yukari_miss'