少年修仙传客户端代码仓库
client_Hale
2018-12-07 4752ccc41a084ab10e8caecb5169cdda52d6fe43
4632 子 【1.3.0】上古战场调整 / 【前端】【1.3.100】上古战场机器人外观处理
2个文件已删除
2个文件已添加
7个文件已修改
454 ■■■■■ 已修改文件
Core/NetworkPackage/DTCFile/ClientPack.meta 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter/DTC0319_tagFBHelp.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0406_tagNPCAppear.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H06_PlayerVsNPC/DTC0614_tagUseSkillPos.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GAMgr.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GA_NpcFightSgzcZZ.cs 312 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GA_NpcFightSgzcZZ.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GA_NpcTouchKilled.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Lua/Gen/Resources.meta 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GeneralConfig/GeneralDefine.cs 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/EnumHelper.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ClientPack.meta
File was deleted
Core/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter/DTC0319_tagFBHelp.cs
@@ -33,6 +33,18 @@
                break;
            case 31160:
                BattleHint.Instance.UpdateDungeonHelp();
                var _json = LitJson.JsonMapper.ToObject(vNetData.Msg);
                if ((_json as IDictionary).Contains("robotJob"))
                {
                    GA_NpcFightSgzcZZ.objIdToJson = _json["robotJob"];
                }
                else
                {
                    Debug.Log("没有收到ObjID和职业对应的信息: " + vNetData.Msg);
                }
                break;
        }
    }
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0406_tagNPCAppear.cs
@@ -67,7 +67,6 @@
                    break;
                case E_NpcType.Fight:
                case E_NpcType.FMBoss:
                case E_NpcType.SGZC_FightAssist:
                    if (_npcConfig.Country == 1)
                    {
@@ -137,6 +136,12 @@
                    GAMgr.Instance.RequestPlayer<GA_NpcFightZZPlayer>(vNetData.ObjID, E_ActorGroup.Player, vNetData);
                    break;
                case E_NpcType.SGZC_FightAssist:
                    GAMgr.Instance.RequestPlayer<GA_NpcFightSgzcZZ>(vNetData.ObjID, E_ActorGroup.Player, vNetData);
                    break;
            }
        }
Core/NetworkPackage/DTCFile/ServerPack/H06_PlayerVsNPC/DTC0614_tagUseSkillPos.cs
@@ -32,12 +32,13 @@
                }
                if (RuntimeLogUtility.s_ShowZZAtkValue && _attacker is GA_NpcFightZZPlayer)
                {
                    Debug.LogFormat("<color=yellow> 助战:{0} 攻击 NPC:{1}, 伤害: {2}, 剩余血量: {3}, 剩余血量Ex: {4}</color>",
                    Debug.LogFormat("<color=yellow> 助战:{0} 使用技能: {5} 攻击 NPC:{1}, 伤害: {2}, 剩余血量: {3}, 剩余血量Ex: {4}</color>",
                        vNetData.ObjID,
                        vNetData.HurtList[0].ObjID,
                        vNetData.HurtList[0].HurtHP,
                        vNetData.HurtList[0].CurHP,
                        vNetData.HurtList[0].CurHPEx);
                        vNetData.HurtList[0].CurHPEx,
                        vNetData.SkillID);
                }
            }
@@ -441,6 +442,10 @@
                        {
                            (_attacker as GA_NpcFightZZPlayer).Cmd_0614(vNetData);
                        }
                        else if (_attacker is GA_NpcFightSgzcZZ)
                        {
                            (_attacker as GA_NpcFightSgzcZZ).Cmd_0614(vNetData);
                        }
                    }
                }
@@ -523,6 +528,15 @@
                }
            }
            GA_Player _player = _hero.LockTarget as GA_Player;
            if (_player != null
             && _player.CanAtked()
             && _hero.aiHandler.IsAuto())
            {
                _startLockTarget = false;
            }
            if (_startLockTarget)
            {
                _hero.SelectTarget = _attacker;
Fight/GameActor/GAMgr.cs
@@ -472,6 +472,9 @@
                case E_ActorClassType.PlayerZZ:
                    _actor = new GA_NpcFightZZPlayer();
                    break;
                case E_ActorClassType.PlayerSgzcRobot:
                    _actor = new GA_NpcFightSgzcZZ();
                    break;
            }
        }
@@ -1260,6 +1263,9 @@
        else if (_type == typeof(GA_NpcFightZZPlayer))
        {
            return (byte)E_ActorClassType.PlayerZZ;
        }else if(_type == typeof(GA_NpcFightSgzcZZ))
        {
            return (byte)E_ActorClassType.PlayerSgzcRobot;
        }
        return (byte)E_ActorClassType.UnDefine;
Fight/GameActor/GA_NpcFightSgzcZZ.cs
New file
@@ -0,0 +1,312 @@
using Snxxz.UI;
using UnityEngine;
using System.Collections;
public class GA_NpcFightSgzcZZ : GActorPlayerBase, IOtherSelectable
{
    public class EquipRandomInfo
    {
        public int[] randClothesItemIDs;
        public int[] randWeaponItemIDs;
        public int[] randSecondaryItemIDs;
        public int[] randWingItemIDs;
        public int[] godWeaponIDs;
    }
    public static LitJson.JsonData objIdToJson;
    private H0406_tagNPCAppear m_H0406;
    private CmdManager m_CmdManager;
    public static int cacheMapDataId;
    protected override void OnInit(GameNetPackBasic package)
    {
        base.OnInit(package);
        ActorType = GameObjType.gotNPC;
        m_H0406 = package as H0406_tagNPCAppear;
        if (m_H0406 == null)
        {
            return;
        }
        CapsuleCollider _capCollider = Root.AddMissingComponent<CapsuleCollider>();
        _capCollider.height = 1.2f;
        _capCollider.center = new Vector3(0, .6f, 0);
        _capCollider.radius = .4f;
        Evt_PlayerClick _evtClick = Root.AddMissingComponent<Evt_PlayerClick>();
        _evtClick.ownerSID = ServerInstID;
        // 初始化坐标
        AdjustPos(m_H0406.PosX, m_H0406.PosY);
        ActorInfo.moveSpeed = 500f / m_H0406.Speed;
        ActorInfo.atkSpeed = 1;
        ActorInfo.LV = (ushort)m_H0406.CurLV;
        ActorInfo.PlayerName = ModelCenter.Instance.GetModel<ActivityModel>().GetAncientRobotName((int)m_H0406.ObjID, (int)m_H0406.NPCID);
        ActorInfo.Hp = m_H0406.NPCHP;
        ActorInfo.MaxHp = m_H0406.MaxHP;
        ActorInfo.familyID = 0;
        ActorInfo.familyName = "";
        ActorInfo.realm = (uint)Random.Range(3, 9);
        // -------------------------------------------------------------------------
        // -------------------------------------------------------------------------
        // -------------------------------------------------------------------------
        // -------------------------------------------------------------------------
        if (objIdToJson == null)
        {
            Debug.Log("看到机器人的时候, 还没有收到id与职业对应的关系.....!!!");
        }
        else
        {
            var _key = m_H0406.ObjID.ToString();
            if ((objIdToJson as IDictionary).Contains(_key))
            {
                var _job = (int)objIdToJson[_key];
                Debug.Log("机器人职业为: " + _job);
                JobSetup = Config.Instance.Get<TableConfig.JobSetupConfig>(_job);
                ActorInfo.Job = (byte)_job;
            }
            else
            {
                Debug.LogFormat("机器人信息中不包含ID: {0} 对应的职业.....!!!", m_H0406.ObjID);
            }
        }
        m_CmdManager = new CmdManager();
        SyncHelpPlayerInfo();
    }
    public sealed override void ChangeEquip(EquipInfo equipInfo) { }
    public void SyncHelpPlayerInfo()
    {
        int _clothesId = -1;
        int _weaponId = -1;
        int _secondaryId = -1;
        int _wingId = -1;
        if (JobSetup == null)
        {
            JobSetup = Config.Instance.Get<TableConfig.JobSetupConfig>(1);
            ActorInfo.Job = 1;
        }
        var _dict = GeneralDefine.SgzzRobotEquipDict[JobSetup.Job];
        EquipRandomInfo _info = null;
        foreach (var _key in _dict.Keys)
        {
            if (m_H0406.CurLV <= _key)
            {
                _info = _dict[_key];
                break;
            }
        }
        if (_info == null)
        {
            Debug.Log("无法确定装备信息..........");
        }
        else
        {
            _clothesId = _info.randClothesItemIDs[Random.Range(0, _info.randClothesItemIDs.Length)];
            _weaponId = _info.randWeaponItemIDs[Random.Range(0, _info.randWeaponItemIDs.Length)];
            _secondaryId = _info.randSecondaryItemIDs[Random.Range(0, _info.randSecondaryItemIDs.Length)];
            _wingId = _info.randWingItemIDs[Random.Range(0, _info.randWingItemIDs.Length)];
        }
        if (_clothesId <= 0)
        {
            SwitchClothes(0);
        }
        else
        {
            SwitchClothes((uint)_clothesId);
        }
        if (_weaponId > 0)
        {
            SwitchWeapon((uint)_weaponId);
        }
        else
        {
            SwitchWeapon(0);
        }
        if (_secondaryId > 0)
        {
            SwitchSecondary((uint)_secondaryId);
        }
        else
        {
            SwitchSecondary(0);
        }
        if (_wingId > 0)
        {
            SwitchWing((uint)_wingId);
        }
        else
        {
            SwitchWing(0);
        }
        RequestName();
        IdleImmediate();
    }
    protected sealed override void OnUpdate()
    {
        if (m_CmdManager != null)
        {
            m_CmdManager.Update();
        }
    }
    protected sealed override void OnUnit()
    {
        base.OnUnit();
        m_H0406 = null;
        m_CmdManager = null;
    }
    public override void Destroy()
    {
    }
    public override void OnHorse(byte upOrDown)
    {
    }
    public override void RefreshLifeBar(ulong value)
    {
        GA_Hero _hero = PlayerDatas.Instance.hero;
        if (_hero != null && _hero.SelectTarget == this)
        {
            if (GA_Player.s_OnRefreshLife != null)
            {
                GA_Player.s_OnRefreshLife(ServerInstID, ActorInfo.RealHp, ActorInfo.RealMaxHp);
            }
        }
    }
    public override void RequestName()
    {
        ReleaseName();
        if (MovingState == E_MovingState.Ride)
        {
            m_HeadUpName = HeadUpName.RequireHeadUpName(HeadUpName.Pattern.Player, MP_Name1, 0, CameraController.Instance.CameraObject);
        }
        else
        {
            m_HeadUpName = HeadUpName.RequireHeadUpName(HeadUpName.Pattern.Player, MP_Name, 0, CameraController.Instance.CameraObject);
        }
        m_HeadUpName.SetPlayerInfo((int)ActorInfo.realm, ActorInfo.titleID, ActorInfo.PlayerName, ActorInfo.familyName, false);
    }
    protected override void OnPutonClothes(uint clothesItemID, GameObject clothed)
    {
        clothed.layer = LayerUtility.Player;
        SkinnedMeshRenderer _renderer = clothed.GetComponentInChildren<SkinnedMeshRenderer>();
        _renderer.gameObject.SetLayer(LayerUtility.Player, false);
    }
    protected override void OnPutonSecondary(uint secondaryItemID, GameObject secondary)
    {
        Renderer _renderer = secondary.GetComponentInChildren<Renderer>();
        _renderer.gameObject.SetLayer(LayerUtility.Player, false);
    }
    protected override void OnPutonWeapon(uint weaponItemID, GameObject weapon)
    {
        Renderer _renderer = weapon.GetComponentInChildren<Renderer>();
        _renderer.gameObject.SetLayer(LayerUtility.Player, false);
    }
    protected override void OnPutonWing(uint wingItemID, GameObject wing)
    {
        SkinnedMeshRenderer _renderer = wing.GetComponentInChildren<SkinnedMeshRenderer>();
        _renderer.gameObject.SetLayer(LayerUtility.Player, false);
    }
    protected override void OnSwitchHorse(uint horseID, GameObject horse)
    {
    }
    public void OnSelect()
    {
        if (CanAtked())
        {
            SelectionManager.Request(SelectionManager.E_Type.Red, this);
        }
        else
        {
            SelectionManager.Request(SelectionManager.E_Type.Green, this);
        }
        if (GA_Player.s_OnSelected != null)
        {
            GA_Player.s_OnSelected(ServerInstID, true);
        }
    }
    public void OnClick()
    {
        if (ActorInfo.serverDie)
        {
            return;
        }
        GA_Hero _hero = PlayerDatas.Instance.hero;
        if (_hero == null)
        {
            return;
        }
        _hero.LockTarget = this;
        _hero.SelectTarget = this;
    }
    public void OnUnSelect()
    {
        SelectionManager.Release(SelectionManager.E_Type.Green);
        SelectionManager.Release(SelectionManager.E_Type.Red);
        if (GA_Player.s_OnSelected != null)
        {
            GA_Player.s_OnSelected(ServerInstID, false);
        }
    }
    public bool CanBeSelected()
    {
        if (ActorInfo.serverDie)
        {
            return false;
        }
        return true;
    }
    public void Cmd_0614(H0614_tagUseSkillPos h0614)
    {
        Cmd0614 _cmd = new Cmd0614();
        _cmd.Init(h0614);
        m_CmdManager.Enqueue(_cmd);
    }
    public void ClearAllCMD()
    {
        m_CmdManager.Clear();
    }
}
Fight/GameActor/GA_NpcFightSgzcZZ.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8066058409b23a14f8cb5cf569eb87ae
timeCreated: 1544100225
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Fight/GameActor/GA_NpcTouchKilled.cs
@@ -22,6 +22,8 @@
        // 初始化坐标
        AdjustPos(m_H0406.PosX, m_H0406.PosY);
        HandleNpcConfig((int)m_H0406.NPCID);
        // 功能NPC需要读取配置朝向
        GAStaticDefine.NPCLocation _npcLocation;
        if (GAStaticDefine.TryGetMapNPCLocation(NpcConfig.NPCID, out _npcLocation))
Lua/Gen/Resources.meta
File was deleted
System/GeneralConfig/GeneralDefine.cs
@@ -161,6 +161,8 @@
    public static int achievementEarlierStageLevel { get; private set; }
    public static int DemonJarAutoTime { get; private set; }
    public static Dictionary<int, Dictionary<int, GA_NpcFightSgzcZZ.EquipRandomInfo>> SgzzRobotEquipDict { get; private set; }
    public static void Init()
    {
        try
@@ -553,6 +555,70 @@
            PreloadSkillEffect[0] = GetIntArray("PreloadSkillEffect");
            PreloadSkillEffect[1] = GetIntArray("PreloadSkillEffect", 2);
            DemonJarAutoTime = GetInt("DemonJarAutoTime");
            if (SgzzRobotEquipDict == null)
            {
                SgzzRobotEquipDict = new Dictionary<int, Dictionary<int, GA_NpcFightSgzcZZ.EquipRandomInfo>>();
                for (int job = 1; job <= 3; ++job)
                {
                    string _jsonString = GetInputString("SGZCHelpBattleEquip", job);
                    if (string.IsNullOrEmpty(_jsonString))
                    {
                        continue;
                    }
                    var _jsonData = LitJson.JsonMapper.ToObject(_jsonString);
                    var _jobDict = new Dictionary<int, GA_NpcFightSgzcZZ.EquipRandomInfo>();
                    for (i = 0; i < _jsonData.Count; ++i)
                    {
                        var _lvJson = _jsonData[i];
                        var _lv = (int)_lvJson["LV"];
                        if (!_jobDict.ContainsKey(_lv))
                        {
                            var _equips = _lvJson["Equips"];
                            var _randEquip = new GA_NpcFightSgzcZZ.EquipRandomInfo();
                            _randEquip.randClothesItemIDs = new int[_equips[0].Count];
                            for (int j = 0; j < _equips[0].Count; ++j)
                            {
                                _randEquip.randClothesItemIDs[j] = (int)_equips[0][j];
                            }
                            _randEquip.randWeaponItemIDs = new int[_equips[1].Count];
                            for (int j = 0; j < _equips[1].Count; ++j)
                            {
                                _randEquip.randWeaponItemIDs[j] = (int)_equips[1][j];
                            }
                            _randEquip.randSecondaryItemIDs = new int[_equips[2].Count];
                            for (int j = 0; j < _equips[2].Count; ++j)
                            {
                                _randEquip.randSecondaryItemIDs[j] = (int)_equips[2][j];
                            }
                            _randEquip.randWingItemIDs = new int[_equips[3].Count];
                            for (int j = 0; j < _equips[3].Count; ++j)
                            {
                                _randEquip.randWingItemIDs[j] = (int)_equips[3][j];
                            }
                            _randEquip.godWeaponIDs = new int[_equips[4].Count];
                            for (int j = 0; j < _equips[4].Count; ++j)
                            {
                                _randEquip.godWeaponIDs[j] = (int)_equips[4][j];
                            }
                            _jobDict.Add(_lv, _randEquip);
                        }
                    }
                    SgzzRobotEquipDict.Add(job, _jobDict);
                }
            }
        }
        catch (Exception ex)
        {
Utility/EnumHelper.cs
@@ -19,6 +19,7 @@
    PlayerXmzz,
    ClientPlayer,
    PlayerZZ,
    PlayerSgzcRobot,
}
public enum E_ActorState