| | |
| | | using UnityEngine; |
| | | using UnityEngine.PlayerLoop; |
| | | |
| | | |
| | | public class TeamHero |
| | | public partial class TeamHero |
| | | { |
| | | public HeroInfo heroInfo; |
| | | public TeamBase teamBase; |
| | | public int heroIndex; |
| | | public int heroId; |
| | | public HeroConfig heroConfig; |
| | | public int SkinID; |
| | | public HeroSkinConfig skinConfig; |
| | | public string guid; |
| | | |
| | | public void MergeProperties() |
| | | |
| | | public TeamBase teamBase |
| | | { |
| | | if (heroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | get; private set; |
| | | } |
| | | public int positionNum; //注意服务端的1号位是1,客户端在使用时是0,通信和策划沟通用1 |
| | | |
| | | // 战场数据 |
| | | public int ObjID = 0;// 战斗单位唯一ID |
| | | |
| | | public int NPCID = 0;// 战斗NPCID,不同的实例ID对应的NPCID可能一样 |
| | | |
| | | |
| | | // 服务器来的构造 |
| | | public TeamHero(HB424_tagSCTurnFightInit.tagSCTurnFightObj fightObj, TeamBase _teamBase) |
| | | { |
| | | heroId = (int)fightObj.HeroID; |
| | | heroConfig = HeroConfig.Get(heroId); |
| | | SkinID = (int)fightObj.SkinID; |
| | | skinConfig = HeroSkinConfig.Get(SkinID); |
| | | |
| | | teamBase = _teamBase; |
| | | |
| | | ObjID = (int)fightObj.ObjID; |
| | | NPCID = (int)fightObj.NPCID; |
| | | |
| | | // HPEx * 1亿 + HP |
| | | |
| | | curHp = (long)fightObj.HPEx * (long)Constants.ExpPointValue + (long)fightObj.HP; |
| | | maxHp = (long)fightObj.MaxHPEx * (long)Constants.ExpPointValue + (long)fightObj.MaxHP; |
| | | rage = (int)fightObj.AngreXP; |
| | | |
| | | positionNum = fightObj.PosNum - 1; |
| | | |
| | | // 【重要】战斗构成里没有卡牌的guid |
| | | guid = string.Empty; |
| | | |
| | | Update(); |
| | | } |
| | | |
| | | private static int DecreasingObjID = 0; |
| | | |
| | | // 布阵时的构造 |
| | | public TeamHero(HeroInfo heroInfo, int posNum, TeamBase _teamBase) |
| | | { |
| | | heroId = heroInfo.itemHero.config.ID; |
| | | heroConfig = HeroConfig.Get(heroId); |
| | | SkinID = heroInfo.SkinID; |
| | | skinConfig = heroInfo.skinConfig; |
| | | |
| | | teamBase = _teamBase; |
| | | |
| | | ObjID = --DecreasingObjID; |
| | | NPCID = 0; |
| | | |
| | | curHp = heroInfo.hp; |
| | | maxHp = heroInfo.hp; |
| | | rage = 0; |
| | | |
| | | positionNum = posNum; |
| | | |
| | | // 【重要】布阵里的要guid |
| | | guid = heroInfo.itemHero.guid; |
| | | |
| | | Update(); |
| | | } |
| | | |
| | | public void OnSwapPosition(TeamHero teamHero) |
| | | { |
| | | teamBase.SwapPosition(positionNum, teamHero.positionNum); |
| | | |
| | | Update(); |
| | | } |
| | | |
| | | public void Update() |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | // 最终属性 当前属性应该是要在这一层的 |
| | | |
| | | public int GetPower() |
| | | { |
| | | // 计算战斗力YYL TODO |
| | | return 0; |
| | | } |
| | | } |