Coverage for thb/meta/characters/daiyousei.py : 81%
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 -*-
2from __future__ import annotations
4# -- stdlib --
5# -- third party --
6# -- own --
7from thb import actions, characters
8from thb.meta.common import ui_meta
11# -- code --
12@ui_meta(characters.daiyousei.Daiyousei)
13class Daiyousei:
14 # Character
15 name = '大妖精'
16 title = '全身萌点的保姆'
17 illustrator = '渚FUN'
18 cv = '简翎'
20 port_image = 'thb-portrait-daiyousei'
21 figure_image = 'thb-figure-daiyousei'
22 miss_sound_effect = 'thb-cv-daiyousei_miss'
25@ui_meta(characters.daiyousei.DaiyouseiKOF)
26class DaiyouseiKOF:
27 # Character
28 name = '大妖精'
29 title = '全身萌点的保姆'
30 illustrator = '渚FUN'
31 cv = '简翎'
33 port_image = 'thb-portrait-daiyousei'
34 figure_image = 'thb-figure-daiyousei'
35 miss_sound_effect = 'thb-cv-daiyousei_miss'
37 notes = '|RKOF修正角色|r'
40@ui_meta(characters.daiyousei.Support)
41class Support:
42 # Skill
43 name = '支援'
44 description = '出牌阶段,你可将任意张牌交给其他角色,此阶段你给出的牌首次达到三张时,你回复1点体力。'
46 def clickable(self, game):
47 me = game.me
49 try:
50 act = game.action_stack[-1]
51 except IndexError:
52 return False
54 if isinstance(act, actions.ActionStage) and (me.cards or me.showncards or me.equips):
55 return True
57 return False
59 def is_action_valid(self, sk, tl):
60 cl = sk.associated_cards
61 if not cl: return (False, '请选择要给出的牌')
62 me = self.me
63 allcards = list(me.cards) + list(me.showncards) + list(me.equips)
64 if any( 64 ↛ exitline 64 didn't jump to the function exit
65 c not in allcards
66 for c in cl
67 ): return (False, '你只能选择手牌与装备牌!')
68 if len(tl) != 1: return (False, '请选择1名玩家')
69 return (True, '加油!')
71 def effect_string(self, act):
72 # for LaunchCard.ui_meta.effect_string
73 return '|G【%s】|r发动了|G支援|r技能,将%d张牌交给了|G【%s】|r。' % (
74 act.source.ui_meta.name,
75 len(act.card.associated_cards),
76 act.target.ui_meta.name,
77 )
79 def sound_effect(self, act):
80 return 'thb-cv-daiyousei_support'
83@ui_meta(characters.daiyousei.SupportKOF)
84class SupportKOF:
85 # Skill
86 name = '支援'
87 description = '你被击坠时,你可以将你的所有牌移出游戏,并令下一名登场的角色获得这些牌。'
90@ui_meta(characters.daiyousei.SupportKOFAction)
91class SupportKOFAction:
93 def effect_string_before(self, act):
94 return '|G【%s】|r发动了|G支援|r技能,将所有的牌转移给下一个出场角色。' % (
95 act.target.ui_meta.name
96 )
99@ui_meta(characters.daiyousei.SupportKOFHandler)
100class SupportKOFHandler:
101 choose_option_prompt = '你要发动【支援】,将所有牌转移给下一名出场角色吗?'
102 choose_option_buttons = (('发动', True), ('不发动', False))
105@ui_meta(characters.daiyousei.Moe)
106class Moe:
107 # Skill
108 name = '卖萌'
109 description = '|B锁定技|r,摸牌阶段你额外摸X张牌(X为你已损失的体力值)。'
112@ui_meta(characters.daiyousei.MoeDrawCard)
113class MoeDrawCard:
114 def effect_string(act):
115 return '|G【%s】|r用手扯开脸颊,向大家做了一个夸张的笑脸,摸了%d张牌跑开了~' % (
116 act.target.ui_meta.name,
117 act.amount,
118 )
120 def sound_effect(self, act):
121 return 'thb-cv-daiyousei_moe'
123# ----------