hch
13 小时以前 51761dd1710c50fb26f4c7424faaa5466306fa27
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
using UnityEngine;
using System.Collections.Generic;
using System;
 
#if UNITY_EDITOR
 
public class TestSkillAction : RecordAction
{
 
    public HB427_tagSCUseSkill vNetData;
 
    public TestSkillAction(BattleField _battleField, int skillId, int hurtIndex)
        : base(RecordActionType.Skill, _battleField, null)
    {
        try
        {
            vNetData = new HB427_tagSCUseSkill();
 
            BattleObject battleObj = battleField.battleObjMgr.redCampList[0];
 
            vNetData.ObjID = (uint)battleObj.ObjID;
            vNetData.SkillID = (uint)skillId;
            vNetData.PMType = 0;
            vNetData.BattleType = 0;
            vNetData.CurHP = 100;
            vNetData.CurHPEx = 0;
            vNetData.HurtCount = 1;
            vNetData.HurtList = new HB427_tagSCUseSkill.tagSCUseSkillHurt[vNetData.HurtCount];
 
            //  伤害的对象
            BattleObject hurtObj = battleField.battleObjMgr.GetBattleObjectByIndex(BattleCamp.Blue, hurtIndex);
            var hurt = new HB427_tagSCUseSkill.tagSCUseSkillHurt();
            hurt.ObjID = (uint)hurtObj.ObjID;
            hurt.AttackTypes = 1; // 普通伤害
            hurt.HurtHP = 2; // 伤害值
            hurt.HurtHPEx = 0;
            hurt.CurHP = 100;
            hurt.CurHPEx = 0;
            hurt.SuckHP = 0;
            hurt.BounceHP = 0;
 
            vNetData.HurtList[0] = hurt;
        }
        catch (Exception err)
        {
            BattleDebug.LogError("Error occurred while creating TestSkillAction: " + err.Message);
        }
        
 
    }
 
    public override bool IsFinished()
    {
        return isFinish;
    }
 
    public override void Run()
    {
        base.Run();
 
        if (!isRunOnce)
        {
            isRunOnce = true;
            CustomHB426CombinePack pack = CustomHB426CombinePack.CreateCustomPack(string.Empty, vNetData);
            battleField.recordPlayer.PlayRecord(pack.CreateSkillAction());
            isFinish = true;
            return;
        }
    }
 
}
 
#endif