void OnEnable() { whosRound = RoleRound.PlayerRound; MeiJiePai_Player = true; MeiDaPai_Enemy = true; MeiJiePai_Enemy = true; RecordData currentData = CreateANewVenture.Instance.newRecordData; Player.Instance.MaxHealth = currentData.MaxHealth; Player.Instance.Fali = currentData.ChushiFali; //当前法力=初始法力 Player.Instance.ChushiFali = currentData.ChushiFali; Player.Instance.XingdongLi = currentData.ChushiXingdong; //当前行动力=初始行动力 Player.Instance.ChushiXingdong = currentData.ChushiXingdong; Player.Instance.HandCard = new List <string>(); Player.Instance.OwnedCard = currentData.OwnedCard; Player.Instance.Equipments = new List <string>(); Player.Instance.UsedCard = new List <string>(); Player.Instance.HuiheChoupai = currentData.MeihuiheChoupai; Player.Instance.MaxCard = currentData.ShoupaiShangxian; Player.Instance.Damage = 0; Player.Instance.MorenShanBi = 0; BattleUIManager._instance.UpdateEnemyAndPlayerState(0.01f); }
/// <summary> 增加武将所在回合数 </summary> private bool AddRoleRound(Int64 roleid) { if (!RoleRound.ContainsKey(roleid)) { InitRound(roleid); } else { var value = RoleRound[roleid] + 1; if (value <= Round) { RoleRound[roleid] = value; } else { if (!IsFirst) { return(false); } if (RoleRound.ContainsValue(Round - 1)) { return(false); } RoleRound[roleid] = value; Round = value; } } return(true); }
/// <summary> 初始化回合数 </summary> private void InitRound(Int64 roleid) { RoleRound.Add(roleid, 1); foreach (var item in AllRoles.Keys.Where(item => item != roleid)) { RoleRound.Add(item, 0); } }