Exemple #1
0
    public static void LoadData()
    {
        g_EquipSetDatas = new Dictionary <int, EquipSetData>();
        SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("SingleSet");

        while (reader.Read())
        {
            int          id   = PETools.Db.GetInt(reader, "id");
            EquipSetData data = new EquipSetData();
            data.attack              = PETools.Db.GetFloat(reader, "Attack");
            data.defence             = PETools.Db.GetFloat(reader, "Defence");
            data.maxHp               = PETools.Db.GetFloat(reader, "MaxHp");
            data.hpRecovery          = PETools.Db.GetFloat(reader, "HpRecovery");
            data.maxStamina          = PETools.Db.GetFloat(reader, "MaxStamina");
            data.staminaRecovery     = PETools.Db.GetFloat(reader, "StaminaRecovery");
            data.maxHunger           = PETools.Db.GetFloat(reader, "MaxHunger");
            data.hungerDownRate      = PETools.Db.GetFloat(reader, "HungerDownRate");
            data.digPower            = PETools.Db.GetFloat(reader, "DigPower");
            data.chopPower           = PETools.Db.GetFloat(reader, "ChopPower");
            data.maxComfort          = PETools.Db.GetFloat(reader, "MaxComfort");
            data.comfortSpendingRate = PETools.Db.GetFloat(reader, "ComfortSpendingRate");
            data.buffIDs             = PETools.Db.GetIntArray(reader, "SkBuffId");
            data.ProductDes();
            g_EquipSetDatas[id] = data;
        }
    }
Exemple #2
0
        public void CheckEXBuffs()
        {
            if (m_EquipmentDirty)
            {
                m_EquipmentDirty = false;

                if (null == mSkEntity)
                {
                    return;
                }

                if (null != m_EXBuffs)
                {
                    for (int i = 0; i < m_EXBuffs.Count; ++i)
                    {
                        mSkEntity.CancelBuffById(m_EXBuffs[i]);
                    }
                }

                m_EXBuffs.Clear();
                m_SuitSetMatchDatas.Clear();

                EquipSetData.GetSuitSetEffect(_ItemList, ref m_EXBuffs);
                SuitSetData.GetSuitSetEffect(_ItemList, ref m_EXBuffs, ref m_SuitSetMatchDatas);

                for (int i = 0; i < m_EXBuffs.Count; ++i)
                {
                    SkEntity.MountBuff(mSkEntity, m_EXBuffs[i], null, null);
                }

                if (null != onSuitSetChange)
                {
                    onSuitSetChange(m_SuitSetMatchDatas);
                }
            }
        }
    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
    }
Exemple #4
0
    /// <summary>套装属性</summary>
    string SuitAttribute(string text)
    {
        string str = text;

        if (null == str)
        {
            return(string.Empty);
        }
        if (null == ItemObj)
        {
            return(text);
        }

        string greenColFomat = "[B7EF54]{0}[-]";
        string grayColFomat  = "[808080]{0}[-]";
        string suitNameFomat = "{0} ( {1}/{2} )";
        char   newLineStr    = '\n';

        string        baseAttribute       = ""; //基础属性
        string        singleAttribute     = ""; //单个属性加成
        string        suitActiveInfo      = ""; //套装信息
        string        suitAttribute       = ""; //套装属性加成
        string        commonAttribute     = ""; //通用属性
        List <string> curCommonAttributes = new List <string>();

        for (int i = 0; i < m_CommonAttributeIDs.Count; i++)
        {
            curCommonAttributes.Add(PELocalization.GetString(m_CommonAttributeIDs[i]));
        }

        if (curCommonAttributes.Count > 0)
        {
            string[] strArray = text.Split(new string[] { "\\n" }, StringSplitOptions.RemoveEmptyEntries);
            if (null != strArray && strArray.Length > 0)
            {
                string curStr = "";
                bool   containsCommonAttri = false;
                for (int i = 0; i < strArray.Length; i++)
                {
                    containsCommonAttri = false;
                    curStr = strArray[i];
                    for (int j = 0; j < curCommonAttributes.Count; j++)
                    {
                        if (curStr.Contains(curCommonAttributes[j]))
                        {
                            commonAttribute    += (curStr + newLineStr);
                            containsCommonAttri = true;
                            break;
                        }
                    }
                    if (!containsCommonAttri)
                    {
                        baseAttribute += (curStr + newLineStr);
                    }
                }
            }

            if (baseAttribute.Length > 1)
            {
                baseAttribute = baseAttribute.Substring(0, baseAttribute.Length - 1);
            }
            if (commonAttribute.Length > 1)
            {
                commonAttribute = commonAttribute.Substring(0, commonAttribute.Length - 1);
            }
        }
        else
        {
            baseAttribute = str;
        }

        EquipSetData data = EquipSetData.GetData(ItemObj);

        if (null != data)
        {
            singleAttribute = data.desStr;
            if (singleAttribute.Length > 1)
            {
                singleAttribute = singleAttribute.Substring(0, singleAttribute.Length - 1);
            }
            //lz-2016.11.07 颜色改到里面处理
            //singleAttribute = string.Format(greenColFomat, singleAttribute);
        }

        EquipmentCmpt equipCmpt = GetEquipmentByCurItemPlace();
        List <SuitSetData.MatchData> matchDatas = new List <SuitSetData.MatchData>();

        if (null != equipCmpt && equipCmpt.matchDatas.Count > 0)
        {
            matchDatas = equipCmpt.matchDatas;
        }
        else
        {
            SuitSetData suitData = SuitSetData.GetData(ItemObj.protoId);
            if (null != suitData)
            {
                SuitSetData.MatchData matchData = new SuitSetData.MatchData();
                matchData.name            = suitData.suitSetName;
                matchData.itemProtoList   = suitData.itemProtoList;
                matchData.itemNames       = suitData.itemNames;
                matchData.tips            = suitData.tips;
                matchData.activeTipsIndex = -1;
                matchDatas.Add(matchData);
            }
        }
        suitActiveInfo = "";
        if (null != matchDatas && matchDatas.Count > 0)
        {
            SuitSetData.MatchData matchData = new SuitSetData.MatchData();
            string curStr = "";
            for (int i = 0; i < matchDatas.Count; i++)
            {
                if (null != matchDatas[i].itemProtoList && matchDatas[i].itemProtoList.Contains(ItemObj.protoId))
                {
                    matchData = matchDatas[i];
                    break;
                }
            }

            if (null != matchData.itemNames && matchData.itemNames.Count > 0)
            {
                int activeCount = (null == matchData.activeIndex) ? 0 : matchData.activeIndex.Count(a => a == true);
                suitActiveInfo  = string.Format(suitNameFomat, matchData.name, activeCount, matchData.itemNames.Count);
                suitActiveInfo  = string.Format(greenColFomat, suitActiveInfo);
                suitActiveInfo += newLineStr;
                for (int j = 0; j < matchData.itemNames.Count; j++)
                {
                    curStr = matchData.itemNames[j];
                    if (!string.IsNullOrEmpty(curStr))
                    {
                        if (null != matchData.activeIndex && j < matchData.activeIndex.Count && matchData.activeIndex[j])
                        {
                            curStr = string.Format(greenColFomat, curStr);
                        }
                        else
                        {
                            curStr = string.Format(grayColFomat, curStr);
                        }
                        suitActiveInfo += (curStr + newLineStr);
                    }
                }
            }

            if (null != matchData.tips && matchData.tips.Length > 0)
            {
                for (int j = 0; j < matchData.tips.Length; j++)
                {
                    if (0 != matchData.tips[j])
                    {
                        curStr = PELocalization.GetString(matchData.tips[j]);
                        if (!string.IsNullOrEmpty(curStr))
                        {
                            if (j <= matchData.activeTipsIndex)
                            {
                                curStr = string.Format(greenColFomat, curStr);
                            }
                            else
                            {
                                curStr = string.Format(grayColFomat, curStr);
                            }
                            suitAttribute += (curStr + newLineStr);
                        }
                    }
                }
            }
        }
        if (suitActiveInfo.Length > 1)
        {
            suitActiveInfo = suitActiveInfo.Substring(0, suitActiveInfo.Length - 1);
        }
        if (suitAttribute.Length > 1)
        {
            suitAttribute = suitAttribute.Substring(0, suitAttribute.Length - 1);
        }
        string newAttributeStr = "";

        if (string.IsNullOrEmpty(singleAttribute) && string.IsNullOrEmpty(suitActiveInfo) && string.IsNullOrEmpty(suitAttribute))
        {
            newAttributeStr = str;
        }
        else
        {
            if (!string.IsNullOrEmpty(baseAttribute))
            {
                newAttributeStr += (baseAttribute + newLineStr + newLineStr);
            }
            if (!string.IsNullOrEmpty(singleAttribute))
            {
                newAttributeStr += (singleAttribute + newLineStr + newLineStr);
            }
            if (!string.IsNullOrEmpty(suitActiveInfo))
            {
                newAttributeStr += (suitActiveInfo + newLineStr + newLineStr);
            }
            if (!string.IsNullOrEmpty(suitAttribute))
            {
                newAttributeStr += (suitAttribute + newLineStr + newLineStr);
            }
            if (!string.IsNullOrEmpty(commonAttribute))
            {
                newAttributeStr += commonAttribute;
            }
            for (int i = newAttributeStr.Length - 1; i >= 0; i--)
            {
                if (newAttributeStr[i] == newLineStr)
                {
                    newAttributeStr = newAttributeStr.Substring(0, i);
                }
                else
                {
                    break;
                }
            }
        }
        return(newAttributeStr);
    }