protected void StartCreate() { var info = Data as SkillCreateData; TimeTickService.inst.AddTimeTick(1, OnTickCreateUniqueSkill); m_UniqueSkillCreateDeploy = UniqueSkillCreateDeploy.GetInfo(info.SkillType, info.SkillId).Value; }
public void RefreshSelectBook() { bool isAllSelected = Data.SkillType > 0 && Data.SkillId > 0; m_UI.m_BookSelected.selectedIndex = isAllSelected ? 1 : 0; if (isAllSelected) { var deploy = UniqueSkillCreateDeploy.GetInfo(Data.SkillType, Data.SkillId); m_UI.m_Fitness.icon = UIUtil.GetFitnessUrl(deploy.Value.FitValue); } }
public override void OnEnter() { var ids = PupilProxy.instance.GetPupilIds(); var xinfaDeploy = XinFaDeploy.GetInfo(m_View.Data.SkillType); var canBenDeploy = CanBenDeploy.GetInfo(m_View.Data.SkillId); var createDeploy = UniqueSkillCreateDeploy.GetInfo(m_View.Data.SkillType, m_View.Data.SkillId); m_UI.m_ListPupil.SetData(ids); m_UI.m_IconXinFaCond.icon = UIUtil.GetPupilAttUrl(xinfaDeploy.CondAttrType); m_UI.m_LabelXinFaCond.SetText(xinfaDeploy.CondAttrValue); m_UI.m_IconCanBenCond.icon = UIUtil.GetPupilAttUrl(canBenDeploy.CondAttrType); m_UI.m_LabelCanBenCond.SetText(canBenDeploy.CondAttrValue); m_UI.m_LabelCreateDiff.SetDiff(canBenDeploy.Difficulty); m_UI.m_LabelCreateFitness.SetFitness(createDeploy.Value.FitValue); m_UI.m_PupilSelected.selectedIndex = 0; }
private void OnRefreshCreatingBookInfo(EventContext context) { var xinfaDeploy = XinFaDeploy.GetInfo(Data.SkillType); var canBenDeploy = CanBenDeploy.GetInfo(Data.SkillId); var createDeploy = UniqueSkillCreateDeploy.GetInfo(Data.SkillType, Data.SkillId); m_UI.m_CreatingBookInfo.m_IconXinFaCond.icon = UIUtil.GetPupilAttUrl(xinfaDeploy.CondAttrType); m_UI.m_CreatingBookInfo.m_IconCanBenCond.icon = UIUtil.GetPupilAttUrl(canBenDeploy.CondAttrType); m_UI.m_CreatingBookInfo.m_LabelXinFaCond.SetText(xinfaDeploy.CondAttrValue); m_UI.m_CreatingBookInfo.m_LabelCanBenCond.SetText(canBenDeploy.CondAttrValue); m_UI.m_CreatingBookInfo.m_IconDiff.icon = UIUtil.GetDiffUrl(canBenDeploy.Difficulty); if (Data.PlaceId > 0) { var placeDeploy = PlaceDeploy.GetInfo(Data.PlaceId); var fitness = placeDeploy.AddAtt.AddShenFa; if (xinfaDeploy.Type == ESkillType.NeiGong) { fitness += placeDeploy.AddAtt.AddNeiGong; } else if (xinfaDeploy.Type == ESkillType.WaiGong) { fitness += placeDeploy.AddAtt.AddWaiGong; } if (canBenDeploy.Type == ESkillType.DaoFa) { fitness += placeDeploy.AddAtt.AddDaoFa; } else if (canBenDeploy.Type == ESkillType.JianFa) { fitness += placeDeploy.AddAtt.AddJianFa; } m_UI.m_CreatingBookInfo.m_IconFitness.icon = UIUtil.GetFitnessUrl(createDeploy.Value.FitValue + fitness); } else { m_UI.m_CreatingBookInfo.m_IconFitness.icon = UIUtil.GetFitnessUrl(createDeploy.Value.FitValue); } }
private void OnPlaceSelected(EventContext context) { var placeId = m_UI.m_ListPlace.GetSelectedData <int>(); m_View.Data.PlaceId = placeId; var placeDeploy = PlaceDeploy.GetInfo(placeId); var fitness = placeDeploy.AddAtt.AddShenFa; var xinfaDeploy = XinFaDeploy.GetInfo(m_View.Data.SkillType); if (xinfaDeploy.Type == ESkillType.NeiGong) { fitness += placeDeploy.AddAtt.AddNeiGong; } else if (xinfaDeploy.Type == ESkillType.WaiGong) { fitness += placeDeploy.AddAtt.AddWaiGong; } var canbenDeploy = CanBenDeploy.GetInfo(m_View.Data.SkillId); if (canbenDeploy.Type == ESkillType.DaoFa) { fitness += placeDeploy.AddAtt.AddDaoFa; } else if (canbenDeploy.Type == ESkillType.JianFa) { fitness += placeDeploy.AddAtt.AddJianFa; } var createDeploy = UniqueSkillCreateDeploy.GetInfo(m_View.Data.SkillType, m_View.Data.SkillId); var oriFit = Define.ValueToFit(createDeploy.Value.FitValue); var curFit = Define.ValueToFit(createDeploy.Value.FitValue + fitness); m_UI.m_CreatingBookInfo.m_IconFitness.icon = UIUtil.GetFitnessUrl(createDeploy.Value.FitValue + fitness); m_UI.m_CreatingBookInfo.m_IconUp.visible = (int)curFit > (int)oriFit; }
public override void OnEnter() { m_View.RefreshProgress(); m_UI.m_LabelBasePower.SetValue(m_View.Data.BasePower); m_UI.m_LabelSkillPower.SetValue(m_View.Data.SkillPower); m_UI.m_LabelValue.SetValue(m_View.Data.Value); m_UI.m_LabelDiff.SetValue(m_View.Data.Diff); var pupilDeploy = PupilDeploy.GetInfo(m_View.Data.PupilId); m_UI.m_LabelCreatorName.SetText(pupilDeploy.Name); m_UI.m_IconCreator.icon = UIUtil.GetPupilHeadUrl(pupilDeploy.Sex); var createDeploy = UniqueSkillCreateDeploy.GetInfo(m_View.Data.SkillType, m_View.Data.SkillId).Value; (m_UI.m_IconUniqueSkill as UI_GoodsSmallIcon).m_State.selectedIndex = 1; m_UI.m_IconUniqueSkill.icon = UIUtil.GetUniqueSkillBookUrl(createDeploy.SkillEffectId); m_UI.m_LabelNameInput.text = ""; m_View.OnRefreshPupilBody(); m_UI.m_IconCreator.icon = UIUtil.GetPupilHeadUrl(pupilDeploy.Sex); }
private void CreateSimulate() { var info = Data as SkillCreateData; if (info.LastCreateTime <= 0) { return; } var curTimeNow = TimeUtil.CurrentTime(); var curTime = info.LastCreateTime; var deploy = UniqueSkillCreateDeploy.GetInfo(info.SkillType, info.SkillId); if (deploy == null) { return; } m_UniqueSkillCreateDeploy = deploy.Value; while (curTime < curTimeNow) { if (info.FinishTime > 0 && info.FinishTime <= curTime) { break; } if (info.EventStartTime > 0 && info.EventFinishTime <= 0 && info.EventStartTime <= curTime) { break; } if (info.ChokeStartTime > 0 && info.ChokeFinishTime <= 0 && info.ChokeStartTime <= curTime) { break; } info.BasePower += Random.Range(m_UniqueSkillCreateDeploy.AttrPSMin.BasePower, m_UniqueSkillCreateDeploy.AttrPSMax.BasePower + 1); info.SkillPower += Random.Range(m_UniqueSkillCreateDeploy.AttrPSMin.SkillPower, m_UniqueSkillCreateDeploy.AttrPSMax.SkillPower + 1); info.Value += Random.Range(m_UniqueSkillCreateDeploy.AttrPSMin.Value, m_UniqueSkillCreateDeploy.AttrPSMax.Value + 1); info.Diff += Random.Range(m_UniqueSkillCreateDeploy.AttrPSMin.Diff, m_UniqueSkillCreateDeploy.AttrPSMax.Diff + 1); info.LastCreateTime = curTime; curTime++; } if (info.FinishTime > 0 && info.FinishTime > curTimeNow) { StartCreate(); return; } if (info.EventStartTime > 0 && info.EventStartTime > curTimeNow) { StartCreate(); return; } if (info.ChokeStartTime > 0 && info.ChokeStartTime > curTimeNow) { StartCreate(); return; } }