public void Reload(GameContentDataBase gcDB)
        {
            //if (groupItemsIDs.Count != groupItems.Count)
            //{
            //    groupItemsIDs.Clear();
            //    groupItems.ForEach(obj => groupItemsIDs.Add(obj.shapeID));
            //}

            //List<Vector2> positions = new List<Vector2>();
            //groupItems.ForEach(obj => positions.Add(obj.position));

            ////foreach (var item in groupItems)
            ////{
            ////    item.ReloadTextures();
            ////}
            //groupItems.Clear();
            //for (int i = 0; i < groupItemsIDs.Count; i++)
            //{
            //    groupItems.Add(gcDB.gameObjectObjects.Find(obj => obj.shapeID == groupItemsIDs[i]).ShallowCopy());
            //    groupItems[i].position = positions[i];
            //    groupItems[i].UpdatePositioNonMovement();
            //}
            groupItems.Clear();
            foreach (var item in groupItemsIDs)
            {
                groupItems.Add(gcDB.gameObjectObjects.Find(obj => obj.shapeID == item).ShallowCopy());
            }
        }
        public void ReloadFromDatabase(GameContentDataBase gcDB)
        {
            var abilitiesToDelete = new List <int>();

            classAbilitiesIDs = classAbilitiesIDs.Distinct().ToList();
            foreach (var item in classAbilityInfos)
            {
                try
                {
                    classAbilities.Add(gcDB.gameAbilities.Find(abi => item.abilityID == abi.abilityIdentifier));
                    item.parent = classAbilities.Last();
                }
                catch (Exception)
                {
                }
            }

            //for (int i = 0; i < classAbilities.Count; i++)
            //{
            //    classAbilityInfos.Add(new ClassAbilityInfo(classAbilities[i]));
            //}
            //Removes all abilityIDs of abilities that don't exist anymore.
            classAbilitiesIDs.RemoveAll(id => classAbilities.Find(ca => ca.abilityIdentifier == id) == default(BasicAbility));

            classEXP.Reload(this);
        }
Example #3
0
        public void Reload(BasicMap m, GameContentDataBase gcdb)
        {
            buildingCompleteRender = new RenderTarget2D(Game1.graphics.GraphicsDevice, boundingZone.Height * 3, boundingZone.Height);
            buildingRender         = new RenderTarget2D(Game1.graphics.GraphicsDevice, boundingZone.Width, boundingZone.Height);


            int layer = 0;

            //location.Y *= -1;
            foreach (var item in buildingTilesPositions)
            {
                buildingTiles.Add(new List <BasicTile>());
                foreach (var position in item)
                {
                    // var chunk = m.testChunk[layer].Find(kv => kv.Key.Contains(position * 64 + location));
                    var       chunk    = m.Chunks.Find(c => c.region.Contains(position * 64 + location));
                    BasicTile tempTIle = chunk.returnLayer(layer).Find(tile => tile.positionGrid == position + location / 64);
                    tempTIle.Reload(gcdb);
                    tempTIle = tempTIle.BClone();
                    tempTIle.positionGrid = position;
                    tempTIle.BReload();
                    buildingTiles[layer].Add(tempTIle);
                }
                layer++;
            }
        }
Example #4
0
        private void GenerateTabs()
        {
            List <PlayerSaveData> saves = saveDatas;

            saves = saves.Distinct().ToList();
            saves = saves.OrderBy(psd => psd.timeIndex).ToList();
            saves.Reverse();

            if (saves.Count != 0 && gcdbSaveData == null)
            {
                if (func == null)
                {
                    gcdbSaveData = EditorFileWriter.gcdbReader(saves[0].databaseLoc);
                }
                else if (saves.Count > 1)
                {
                    gcdbSaveData = EditorFileWriter.gcdbReader(saves[1].databaseLoc);
                }
            }

            for (int i = 0; i < saves.Count; i++)
            {
                lfTabs.Add(new LoadFileTab(saves[i], saves, bgPosition, gcdbSaveData));
            }
        }
        public void ReloadGCDB(GameContentDataBase gcdb)
        {
            try
            {
                if (abilityPAID != -1)
                {
                    var temp = gcdb.gameParticleAnimations.Find(PA => PA.particleAnimationID == abilityPAID);
                    if (temp != null)
                    {
                        PAanim = temp.Clone();
                    }
                }
                else
                {
                    PAanim = null;
                }
            }
            catch
            {
            }

            try
            {
                executeSoundEffect = Game1.contentManager.Load <SoundEffect>(soundEffectLoc);
            }
            catch (Exception e)
            {
            }
        }
Example #6
0
        public void Reload(GameContentDataBase gcdb)
        {
            CCC = gcdb.gameCCCs.Find(ccc => ccc.identifier == CCCidentifier).Clone();

            CCC.ReloadDefaultAIAbility(gcdb, this);

            CCC.ReloadFromDatabase(gcdb);
        }
 public void ReloadDefaultAIAbility(GameContentDataBase gcdb, EnemyAIInfo AII)
 {
     defaultAbilityID = AII.defaultAIAbilityID;
     try
     {
         AIDefaultAttack = gcdb.gameAbilities.Find(abi => abi.abilityIdentifier == defaultAbilityID).Clone();
     }
     catch (Exception)
     {
         Console.WriteLine("Error generating default ability info for" + AII.ToString());
         AIDefaultAttack = new BasicAbility();
     }
 }
        public virtual void Draw(SpriteBatch spriteBatch, GameContentDataBase gcdb, float opacity = 1f, Color c = default(Color))
        {
            if (c == default(Color))
            {
                c = Color.White;
            }

            if (mapPosition == default(Rectangle) || (positionGrid != new Vector2(0, 0) && mapPosition.Location == new Point(0)))
            {
                reloadMapPosition();
            }
            gcdb.gameSourceTiles.Find(gst => gst.tileID == tsID).tileAnimation.DrawTile(spriteBatch, drawPosition, rotation, opacity, spriteEffect, c);
        }
Example #9
0
        public void Reload(GameContentDataBase gcdb, List <EnemyAIInfo> enemyPool)
        {
            zoneEncounterInfo.Reload(gcdb);

            foreach (var item in zoneEncounterInfo.enemyInfoIDs)
            {
                zoneEncounterInfo.enemies.Add(enemyPool.Find(i => i.infoID == item));
            }

            if (scriptIdentifier != -1)
            {
                entranceScript = gcdb.gameScripts.Find(s => s.identifier == scriptIdentifier);
            }
        }
        public void Reload(GameContentDataBase gcdb)
        {
            //enemyPool.Clear();
            foreach (var item in enemyPool)
            {
                item.Reload(gcdb);
            }


            foreach (var item in regionZones)
            {
                item.Reload(gcdb, enemyPool);
            }
        }
 public void Reload(GameContentDataBase gcdb)
 {
     //enemyInfoIDs.Clear();
     //  enemySpawnChance.Clear();
     foreach (var item in enemies)
     {
         try
         {
             item.Reload(gcdb);
         }
         catch (Exception e)
         {
         }
     }
 }
 public void ReloadWithGCDB(GameContentDataBase gcdb)
 {
     if (itemID != -1)
     {
         try
         {
             item = gcdb.gameItems.Find(i => i.itemID == itemID);
             GenerateLogic();
         }
         catch
         {
             Console.WriteLine("Error: item not found in database, ID:" + itemID);
         }
     }
 }
 public void ReloadGCDB(GameContentDataBase gcdb)
 {
     if (magicCircleID == -1)
     {
         if (gcdb.gameMagicCircleAnimations.Count != 0)
         {
             magicCircleID = gcdb.gameMagicCircleAnimations[0].magicCircleBaseID;
             ReloadGCDB(gcdb);
         }
     }
     else
     {
         mcb = gcdb.gameMagicCircleAnimations.Find(cb => cb.magicCircleBaseID == magicCircleID).Clone();
         mcb.frameInterval = magicCircleTimer;
     }
 }
        public void DataBaseReload(GameContentDataBase gcdb)
        {
            try
            {
                //baseCharacter = gcdb.gameCharacters.Find(gc => gc.shapeID == baseCharacterSourceID).Clone();
                baseCharacter         = infoHolder.Reload(gcdb) as BaseCharacter;
                baseCharacter.fromMap = BasicMap.allMapsGame().Find(map => map.identifier == mapPlacedID);
                baseCharacter.currentMapToDisplayOn = BasicMap.allMapsGame().Find(map => map.identifier == mapActiveID);
                if (baseCharacter.spriteGameSize.Size == new Point(0))
                {
                    baseCharacter.spriteGameSize.Size = new Point(64);
                }

                foreach (var item in npcCommands)
                {
                    item.script = gcdb.gameScripts.Find(s => s.identifier == item.scriptIdentifier);
                }
                //  baseCharacter.changePosition(NPCArea[0].positionGrid * 64);
            }
            finally
            {
            }
        }
        public void ReloadGCDB(GameContentDataBase gcdb)
        {
            foreach (var item in universalDrop)
            {
                item.ReloadWithGCDB(gcdb);
            }

            foreach (var item in dropsPerRegionLevel)
            {
                foreach (var loot in item)
                {
                    loot.ReloadWithGCDB(gcdb);
                }
            }

            if (expDropPerLevel.Count != moneyDropPerLevel.Count)
            {
                while (expDropPerLevel.Count != moneyDropPerLevel.Count)
                {
                    expDropPerLevel.Add(0);
                }
            }
        }
Example #16
0
        internal LoadFileTab(PlayerSaveData psd, List <PlayerSaveData> saves, Rectangle position, GameContentDataBase gcdb)
        {
            this.psd = psd;
            if (!bInitialize)
            {
                Initialize(position);
            }

            int index = saves.IndexOf(psd);

            this.index   = index;
            render       = new RenderTarget2D(Game1.graphics.GraphicsDevice, renderSize.X, renderSize.Y);
            drawPosition = new Rectangle(new Point(0), renderSize);

            int Y = horSpacing + index * renderSize.Y + vertSpacing * index;

            screenPosition = new Rectangle(horSpacing, Y, renderSize.X, renderSize.Y);

            int frameDistance = 5;
            int frameOffSet   = 25;
            int frameSize     = renderSize.Y - 2 * frameOffSet;

            if (saves[0] == psd)
            {
                bIsFirst = true;
            }

            for (int i = 0; i < 4; i++)
            {
                if (psd.heroTeamActive.Count > i)
                {
                    var tempBC = gcdb.gameCharacters.Find(c => c.shapeID == psd.heroTeamActive[i].charID);
                    portraitFrames[i] = new portraitFrame(tempBC.portraitAnimations[(int)BaseCharacter.PortraitExpressions.Neutral], new Rectangle(frameSize * i + drawPosition.X + frameOffSet + frameDistance * i, frameOffSet, frameSize, frameSize));
                }
                else
                {
                    portraitFrames[i] = new portraitFrame(null, new Rectangle(frameSize * i + drawPosition.X + frameOffSet + frameDistance * i, frameOffSet, frameSize, frameSize));
                }
            }

            if (saves.Count > 2)
            {
                if (index == saves.Count - 2)
                {
                    maxScrollOffSet = screenPosition.Y;
                }
            }
            else
            {
                maxScrollOffSet = 0;
            }
            if (psd.timeIndex != long.MaxValue - 1)
            {
                DateTime dt = new DateTime(psd.timeIndex);
                dateTimeString = dt.ToShortDateString().ToString() + " " + dt.ToLongTimeString().ToString();
            }
            else
            {
                dateTimeString = "New Save";
            }


            if (!bInitialize)
            {
                PostInitialize(position);
            }
        }
 public void Reload(GameContentDataBase gcdb)
 {
     parentClass = gcdb.gameClasses.Find(c => c.classIdentifier == classID);
 }
        public void ReloadFromDatabase(GameContentDataBase gcDB)
        {
            #region charClassList
            var classesToDelete = new List <int>();
            charClassListIDs = charClassListIDs.Distinct().ToList();
            foreach (var item in charClassListIDs)
            {
                try
                {
                    charClassList.Add(gcDB.gameClasses.Find(cl => cl.classIdentifier == item).Clone());
                }
                catch (Exception)
                {
                }
            }
            //Removes all abilityIDs of abilities that don't exist anymore.
            charClassListIDs.RemoveAll(id => charClassList.Find(cl => cl.classIdentifier == id) == default(BaseClass));
            #endregion

            #region charSeparateAbilities
            var abilitiesToDelete = new List <int>();
            charSeparateAbilityIDs = charSeparateAbilityIDs.Distinct().ToList();
            foreach (var item in charSeparateAbilityIDs)
            {
                try
                {
                    charSeparateAbilities.Add(gcDB.gameAbilities.Find(abi => abi.abilityIdentifier == item).Clone());
                }
                catch (Exception)
                {
                }
            }
            //Removes all abilityIDs of abilities that don't exist anymore.
            charSeparateAbilityIDs.RemoveAll(id => charSeparateAbilities.Find(ca => ca.abilityIdentifier == id) == default(BasicAbility));
            #endregion

            try
            {
                equippedClass = gcDB.gameClasses.Find(gc => gc.classIdentifier == equippedClassIdentifier).Clone();
            }
            catch (Exception)
            {
                equippedClass = new BaseClass(true);
            }

            try
            {
                var temp = gcDB.gameAbilities.Find(abi => abi.abilityIdentifier == defaultAbilityID);
                if (temp == null)
                {
                    temp = new BasicAbility();
                }
                AIDefaultAttack = temp.Clone();
            }
            catch (Exception e)
            {
            }

            try
            {
                abiEquipList.Reload(this);
            }
            catch (Exception e)
            {
            }

            try
            {
                //classExp.Initialize(this);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error initializing class EXP");
                if (Game1.bIsDebug)
                {
                    throw e;
                }
            }


            ReloadTalents();
        }
 public void Reload(GameContentDataBase gcdb)
 {
     tileSource  = gcdb.gameSourceTiles.Find(gst => gst.tileID == tsID);
     hitboxes    = tileSource.getHitBoxes(positionGrid.ToPoint());
     bMustReload = false;
 }