hch
2025-07-23 2336d5e71a6ed9c00f9a86c29d7aa33b9a1e38d5
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using LitJson;
using UnityEngine;
using System.Collections.Generic;
 
public class StoryBattleField : BattleField
{
    protected int chapter;//   章节
    protected int wave;//  波数
    protected int level;// 关卡
    protected JsonData extendData;
 
    protected MainChapterConfig chapterConfig;
 
    protected MainLevelConfig levelConfig;
 
    public StoryBattleField() : base(string.Empty)
    {
 
    }
    
    public override void Init(int MapID, int FuncLineID, JsonData _extendData, 
        List<TeamBase> _redTeamList, List<TeamBase> _blueTeamList)
    {
        base.Init(MapID, FuncLineID, extendData, _redTeamList, _blueTeamList);
 
        LoadBattleMode();
 
        chapter = FuncLineID / 10000;
        wave = MapID == 1 ? FuncLineID % 100 : 1;//第几波怪
        level = (FuncLineID % 10000) / 100;
 
        extendData = _extendData;
        chapterConfig = MainChapterConfig.Get(chapter);
        levelConfig = MainLevelConfig.Get(level);
 
    }
 
    protected void LoadBattleMode()
    {
        string savedStr = LocalSave.GetString("StoryBattleFieldBattleMode");
        if (string.IsNullOrEmpty(savedStr))
        {
            savedStr = "Hand";
        }
        SetBattleMode((BattleMode)Enum.Parse(typeof(BattleMode), savedStr));
    }
 
    public override void TurnFightState(int TurnNum, int State, 
        uint FuncLineID, JsonData extendData)
    {
        base.TurnFightState(TurnNum, State, FuncLineID, extendData);
 
        switch (State)
        {
            //  起始状态标记
            case 0:
                break;
            case 1://准备完毕
                break;
            case 2://战斗中
                break;
            case 3://战斗结束
                break;
            case 4://结算奖励
                break;
            case 5://结束状态标记
                break;
            default:
                Debug.LogError("recieve a unknown State");
                break;
        }
    }
 
    public override void OnTurnFightObjAction(int turnNum, int ObjID)
    {
        base.OnTurnFightObjAction(turnNum, ObjID);
    }
 
    public override void OnTurnFightState(int turnNum, int State, int FuncLineID, JsonData extendData)
    {
        base.OnTurnFightState(turnNum, State, FuncLineID, extendData);
        
    }
 
    // public override void Run()
    // {
    //     //  一定要记住这个
    //     if (IsPause)
    //         return;
 
    //     base.Run();
    // }
}