// mount/unmount buff public static SkBuffInst MountBuff(SkEntity target, int buffId, List <int> idxList, List <float> valList) // To save memory ,idxList should be increase step by step { int maxIdx = 0; int n = idxList != null ? idxList.Count : 0; for (int i = 0; i < n; i++) { if (idxList[i] > maxIdx) { maxIdx = idxList[i]; } } SkAttribs buffAttribs = new SkAttribs(null, maxIdx + 1); for (int i = 0; i < n; i++) { int idx = idxList[i]; buffAttribs.sums[idx] = buffAttribs.raws[idx] = valList[i]; } //lz-2016.08.22 引导检测玩家进入buff Pathea.PeEntity entity = target.GetComponent <Pathea.PeEntity>(); if (null != entity && entity.IsMainPlayer) { InGameAidData.CheckInBuff(buffId); } return(SkBuffInst.Mount(target._attribs.pack as SkPackage, SkBuffInst.Create(buffId, buffAttribs, target._attribs))); }
void ISerializable.Serialize(PeRecordWriter w) { if (w.key == InGameAidArchiveKey) { w.binaryWriter.Write(InGameAidData.Serialize()); } }
private static void LoadAllMap() { AllStartTypeMap.Clear(); AllShowTypeMap.Clear(); AllCompleteTypeMap.Clear(); InGameAidData info = null; foreach (var kv in AllData) { info = kv.Value; if (!AllStartTypeMap.ContainsKey(info.StartType)) { AllStartTypeMap.Add(info.StartType, new List <int>()); } AllStartTypeMap[info.StartType].Add(info.ID); if (info.ShowType != InGameAidType.None) { if (!AllShowTypeMap.ContainsKey(info.ShowType)) { AllShowTypeMap.Add(info.ShowType, new List <int>()); } AllShowTypeMap[info.ShowType].Add(info.ID); } if (!AllCompleteTypeMap.ContainsKey(info.ComplateType)) { AllCompleteTypeMap.Add(info.ComplateType, new List <int>()); } AllCompleteTypeMap[info.ComplateType].Add(info.ID); } LoadNoneStartType(); }
//lz-2016.08.22 检测引导用 private void CheckMainPlayerUseItem(int itemID) { if (Entity.IsMainPlayer) { InGameAidData.CheckUseItem(itemID); } }
//lz-2016.08.31 引导检测打开UI protected virtual void CheckOpenUI() { //lz-2016.08.31 只有配置了类型的面板才会进行检测,优化不必要的检测调用 if (SelfWndType != UIEnum.WndType.Null) { InGameAidData.CheckOpenUI(SelfWndType); } }
public void Restore() { byte[] data = ArchiveMgr.Instance.GetData(InGameAidArchiveKey); if (null != data) { InGameAidData.Deserialize(data); } }
void Awake() { UIEventListener.Get(this.gameObject).onClick += (go) => { if (this.m_BtnID != 0) { InGameAidData.CheckClickBtn(this.m_BtnID); } }; }
public bool AddServant(NpcCmpt follower) { if (ContainsServant(follower)) { return(false); } for (int i = 0; i < mFollowers.Length; i++) { if (null == mFollowers[i]) { mFollowers[i] = follower; if (UINPCfootManMgr.Instance != null) { UINPCfootManMgr.Instance.GetFollowerAlive(); } //DoFollow(follower.Entity.GetCmpt<FollowCmpt>()); follower.SetServantLeader(this); follower.NpcControlCmdId = 19; PeEntityCreator.RecruitRandomNpc(follower.Entity); InitSleepInfo(mFollowers[i]); if (UIMissionMgr.Instance != null) { UIMissionMgr.Instance.DeleteMission(follower.Entity); } changeEventor.Dispatch(new ServantChanged(true, follower.Entity)); //lz-2016.08.22 玩家召一个仆从 InGameAidData.CheckGetServant(follower.Entity.Id); //lw:完成成就同生共死 SteamAchievementsSystem.Instance.OnGameStateChange(Eachievement.Eleven); return(true); } } return(false); }
public void New() { InGameAidData.ShowInGameAidCtrl = true; InGameAidData.Clear(); }
public static void LoadAllData() { if (s_localDatabase != null) { return; } #if UNITY_EDITOR System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); sw.Start(); #endif s_localDatabase = LoadDb(); SkillSystem.SkData.LoadData(); Pathea.Effect.EffectData.LoadData(); Pathea.Projectile.ProjectileData.LoadData(); Pathea.RequestRelation.LoadData(); Pathea.CampData.LoadData(); Pathea.ThreatData.LoadData(); Pathea.DamageData.LoadData(); HumanSoundData.LoadData(); ItemDropData.LoadData(); PELocalization.LoadData(); NaturalResAsset.NaturalRes.LoadData(); //SkillAsset.EffCastData.LoadData(); //SkillAsset.EffSkill.LoadData(); //SkillAsset.MergeSkill.LoadData(); //AnimData.LoadData(); //AnimSoundData.LoadData(); AiAsset.AiData.LoadData(); SoundAsset.SESoundBuff.LoadData(); SoundAsset.SESoundStory.LoadData(); //CharacterData.LoadCharacterData(); StoryDoodadMap.LoadData(); StoreRepository.LoadData(); NpcMissionDataRepository.LoadData(); //PlayerAttribute.LoadData(); MissionRepository.LoadData(); TalkRespository.LoadData(); //NpcRandomRepository.LoadData(); ShopRespository.LoadData(); WareHouseManager.LoadData(); //HeroTalkRepository.LoadData(); MutiPlayRandRespository.LoadData(); PromptRepository.LoadData(); //MapIconData.LoadDate(); //MapMaskData.LoadDate(); CampPatrolData.LoadDate(); Camp.LoadData(); RepProcessor.LoadData(); CloudManager.LoadData(); //BattleUnitData.LoadData(); TutorialData.LoadData(); //RepairMachineManager.LoadData(); MapMaskData.LoadDate(); MessageData.LoadData(); //lz-2016.07.13 Add it MonsterHandbookData.LoadData(); //lz-2016.07.20 Add it StoryRepository.LoadData(); RMRepository.LoadRandMission(); MisInitRepository.LoadData(); CameraRepository.LoadCameraPlot(); AdRMRepository.LoadData(); VCConfig.InitConfig(); Cutscene.LoadData(); // BuildBrushData.LoadBrush(); BSPattern.LoadBrush(); BSVoxelMatMap.Load(); BSBlockMatMap.Load(); BlockBuilding.LoadBuilding(); LifeFormRule.LoadData(); PlantInfo.LoadData(); MetalScanData.LoadData(); BattleConstData.LoadData(); CustomCharactor.CustomMetaData.LoadData(); SkillTreeInfo.LoadData(); VArtifactUtil.LoadData(); Pathea.ActionRelationData.LoadActionRelation(); //colony CSInfoMgr.LoadData(); ProcessingObjInfo.LoadData(); CSTradeInfoData.LoadData(); CampTradeIdData.LoadData(); AbnormalTypeTreatData.LoadData(); CSMedicineSupport.LoadData(); //RandomItemMgr RandomItemDataMgr.LoadData(); FecesData.LoadData(); //randomdungeon RandomDungeonDataBase.LoadData(); AbnormalData.LoadData(); PEAbnormalNoticeData.LoadData(); RelationInfo.LoadData(); EquipSetData.LoadData(); SuitSetData.LoadData(); CheatData.LoadData(); Pathea.NpcProtoDb.Load(); Pathea.MonsterProtoDb.Load(); Pathea.MonsterRandomDb.Load(); Pathea.MonsterGroupProtoDb.Load(); Pathea.RandomNpcDb.Load(); Pathea.PlayerProtoDb.Load(); Pathea.TowerProtoDb.Load(); Pathea.DoodadProtoDb.Load(); Pathea.AttPlusNPCData.Load(); Pathea.AttPlusBuffDb.Load(); Pathea.NpcTypeDb.Load(); Pathea.NpcRandomTalkDb.Load(); Pathea.NpcThinkDb.LoadData(); Pathea.NpcEatDb.LoadData(); Pathea.NpcRobotDb.Load(); Pathea.NPCScheduleData.Load(); Pathea.NpcVoiceDb.LoadData(); InGameAidData.LoadData(); //lz-2016.08.21 add it MountsSkillDb.LoadData(); #if UNITY_EDITOR sw.Stop(); Debug.Log("Database Loaded : " + sw.ElapsedMilliseconds); sw.Reset(); #else Debug.Log("Database Loaded"); #endif }
public bool PutOnEquipment(ItemObject itemObj, bool addToReceiver = true, Receiver receiver = null, bool netRequest = false) { if (!netRequest && null != mViewCmpt && mViewCmpt.IsRagdoll) { return(false); } Receiver currentReceiver = (null == receiver)?mItemReciver:receiver; if (null == itemObj) { return(false); } ItemAsset.Equip equip = itemObj.GetCmpt <ItemAsset.Equip>(); if (null == equip) { return(false); } if (!Pathea.PeGender.IsMatch(equip.sex, Entity.ExtGetSex())) { return(false); } if (mItemList.Contains(itemObj)) { return(false); } SkillTreeUnitMgr learntSkills = Entity.GetCmpt <SkillTreeUnitMgr>(); if (!netRequest && learntSkills != null && RandomMapConfig.useSkillTree) { if (!learntSkills.CheckEquipEnable(equip.protoData.itemClassId, equip.itemObj.level)) { return(false); } } m_TakeOffEquip.Clear(); for (int i = 0; i < mItemList.Count; ++i) { ItemObject item = mItemList[i]; ItemAsset.Equip existEquip = item.GetCmpt <ItemAsset.Equip>(); if (null != existEquip) { if (System.Convert.ToBoolean(equip.equipPos & existEquip.equipPos)) { m_TakeOffEquip.Add(item); } } } for (int i = 0; i < mEquipments.Count; ++i) { if (m_TakeOffEquip.Contains(mEquipments[i].m_ItemObj) && !netRequest && !mEquipments[i].CanTakeOff()) { return(false); } } if (!netRequest && addToReceiver && null != currentReceiver) { if (!currentReceiver.CanAddItemList(m_TakeOffEquip)) { //lz-2016.08.15 如果是NPC的背包满了要单独提示 if (currentReceiver is NpcPackageCmpt) { PeTipMsg.Register(PELocalization.GetString(82209013), PeTipMsg.EMsgLevel.Warning); } else { PeTipMsg.Register(PELocalization.GetString(82209001), PeTipMsg.EMsgLevel.Warning); } return(false); } } for (int i = mItemList.Count - 1; i >= 0; i--) { if (m_TakeOffEquip.Contains(mItemList[i] as ItemObject)) { mItemList.RemoveAt(i); } } mItemList.Add(itemObj); if (addToReceiver && null != currentReceiver) { currentReceiver.AddItemList(m_TakeOffEquip); } //Do change for (int i = 0; i < m_TakeOffEquip.Count; ++i) { ItemObject item = m_TakeOffEquip[i]; RemoveItemEff(item); RemoveModel(item); mEquipType &= ~item.protoData.equipType; EventArg removeEvtArg = new EventArg(); removeEvtArg.isAdd = false; removeEvtArg.itemObj = item; changeEventor.Dispatch(removeEvtArg, this); } ApplyItemEff(itemObj); AddModel(itemObj); mEquipType |= itemObj.protoData.equipType; EventArg evtArg = new EventArg(); evtArg.isAdd = true; evtArg.itemObj = itemObj; changeEventor.Dispatch(evtArg, this); if (0 != (itemObj.protoData.equipPos & (1 << 4))) { mainHandEquipment = itemObj; } if (OnEquipmentChange != null) { OnEquipmentChange(); } //lz-2016.08.22 引导检测玩家穿装备 if (Entity.IsMainPlayer) { InGameAidData.CheckPutOnEquip(itemObj.protoId); } m_EquipmentDirty = true; return(true); }
public static void LoadData() { SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("IngameAid"); InGameAidData info = null; while (reader.Read()) { int id = Convert.ToInt32(reader.GetString(reader.GetOrdinal("ID"))); int startType = Convert.ToInt32(reader.GetString(reader.GetOrdinal("S_Type"))); string startValueStr = reader.GetString(reader.GetOrdinal("S_Value")); int showType = Convert.ToInt32(reader.GetString(reader.GetOrdinal("Type"))); string showValueStr = reader.GetString(reader.GetOrdinal("Value")); int completeType = Convert.ToInt32(reader.GetString(reader.GetOrdinal("C_Type"))); string completeValueStr = reader.GetString(reader.GetOrdinal("C_Value")); int contentID = Convert.ToInt32(reader.GetString(reader.GetOrdinal("Content"))); string[] startValueStrArray = startValueStr.Split(','); int[] startValueArray = new int[startValueStrArray.Length]; for (int i = 0; i < startValueArray.Length; i++) { int value = 0; if (int.TryParse(startValueStrArray[i], out value)) { startValueArray[i] = value; } else { Debug.LogError("Field [S_Value] has errory! and ID is " + id + " by table [IngameAid]"); return; } } string[] showValueStrArray = showValueStr.Split(','); int[] showValueArray = new int[showValueStrArray.Length]; for (int i = 0; i < showValueArray.Length; i++) { int value = 0; if (int.TryParse(showValueStrArray[i], out value)) { showValueArray[i] = value; } else { Debug.LogError("Field [Value] has errory! and ID is " + id + " by table [IngameAid]"); return; } } string[] completeValueStrArray = completeValueStr.Split(','); int[] completeValueArray = new int[completeValueStrArray.Length]; for (int i = 0; i < completeValueArray.Length; i++) { int value = 0; if (int.TryParse(completeValueStrArray[i], out value)) { completeValueArray[i] = value; } else { Debug.LogError("Field [C_Value] has errory! and ID is " + id + " by table [IngameAid]"); return; } } info = new InGameAidData(id, (InGameAidType)startType, startValueArray.ToList(), (InGameAidType)showType, showValueArray.ToList(), (InGameAidType)completeType, completeValueArray.ToList(), contentID); AllData.Add(id, info); } }