File size: 1,474 Bytes
c145eab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1cc60af
 
c145eab
 
1cc60af
c145eab
1cc60af
 
c145eab
 
1cc60af
 
c145eab
d26e0de
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import gradio as gr

from base.constant import SHIELD_BASE_MAP


class CombatComponent:
    def __init__(self):
        with gr.Row():
            self.combat_duration = gr.Slider(label="战斗时长", step=0.01)
            target_levels = list(SHIELD_BASE_MAP)
            self.target_level = gr.Dropdown(choices=target_levels, value=target_levels[0], label="目标等级")
        self.formulate = gr.Button("开始模拟")

        with gr.Tab("属性"):
            with gr.Row():
                self.init_attribute = gr.Textbox(label="初始属性", lines=20)
                self.final_attribute = gr.Textbox(label="增益后属性", lines=20)
        with gr.Tab("伤害总结"):
            self.skill_select = gr.Dropdown(label="选择技能")
            self.status_select = gr.Dropdown(label="选择增益", multiselect=True)
            with gr.Row():
                self.damage_detail = gr.Textbox(label="伤害细节", lines=10)
                self.damage_timeline = gr.DataFrame(show_label=False, scale=4)
        with gr.Tab("战斗统计"):
            with gr.Row():
                self.summary = gr.DataFrame(label="战斗总结", headers=["技能/次数", "命中/%", "会心/%", "伤害/%"],
                                            show_label=False, scale=3)
                with gr.Column(scale=1):
                    self.dps = gr.Textbox(label="每秒伤害")
                    self.gradient = gr.Textbox(label="属性收益", lines=10)