Beispiel #1
0
 public bool DeepEquals(TalentGridNode other)
 {
     return(other != null &&
            NodeIndex == other.NodeIndex &&
            NodeHash == other.NodeHash &&
            Row == other.Row &&
            Column == other.Column &&
            PrerequisiteNodeIndexes.DeepEqualsReadOnlySimpleCollection(other.PrerequisiteNodeIndexes) &&
            BinaryPairNodeIndex == other.BinaryPairNodeIndex &&
            AutoUnlocks == other.AutoUnlocks &&
            LastStepRepeats == other.LastStepRepeats &&
            IsRandom == other.IsRandom &&
            RandomActivationRequirement.DeepEquals(other.RandomActivationRequirement) &&
            IsRandomRepurchasable == other.IsRandomRepurchasable &&
            Steps.DeepEqualsReadOnlyCollections(other.Steps) &&
            ExclusiveWithNodeHashes.DeepEqualsReadOnlySimpleCollection(other.ExclusiveWithNodeHashes) &&
            RandomStartProgressionBarAtProgression == other.RandomStartProgressionBarAtProgression &&
            LayoutIdentifier == other.LayoutIdentifier &&
            GroupHash == other.GroupHash &&
            Lore.DeepEquals(other.Lore) &&
            NodeStyleIdentifier == other.NodeStyleIdentifier &&
            IgnoreForCompletion == other.IgnoreForCompletion &&
            ExclusiveSetHash == other.ExclusiveSetHash &&
            GroupScopeIndex == other.GroupScopeIndex &&
            IsRealStepSelectionRandom == other.IsRealStepSelectionRandom &&
            OriginalNodeHash == other.OriginalNodeHash &&
            TalentNodeTypes == other.TalentNodeTypes);
 }
Beispiel #2
0
 public bool DeepEquals(DestinyRecordDefinition other)
 {
     return(other != null &&
            DisplayProperties.DeepEquals(other.DisplayProperties) &&
            CompletionInfo.DeepEquals(other.CompletionInfo) &&
            ExpirationInfo.DeepEquals(other.ExpirationInfo) &&
            IntervalInfo.DeepEquals(other.IntervalInfo) &&
            StateInfo.DeepEquals(other.StateInfo) &&
            TitleInfo.DeepEquals(other.TitleInfo) &&
            Objectives.DeepEqualsReadOnlyCollections(other.Objectives) &&
            ParentNodes.DeepEqualsReadOnlyCollections(other.ParentNodes) &&
            PresentationNodeType == other.PresentationNodeType &&
            RecordValueStyle == other.RecordValueStyle &&
            Requirements.DeepEquals(other.Requirements) &&
            RewardItems.DeepEqualsReadOnlyCollections(other.RewardItems) &&
            Scope == other.Scope &&
            Traits.DeepEqualsReadOnlyCollections(other.Traits) &&
            TraitIds.DeepEqualsReadOnlySimpleCollection(other.TraitIds) &&
            Lore.DeepEquals(other.Lore) &&
            PresentationInfo.DeepEquals(other.PresentationInfo) &&
            ForTitleGilding == other.ForTitleGilding &&
            Blacklisted == other.Blacklisted &&
            Hash == other.Hash &&
            Index == other.Index &&
            Redacted == other.Redacted);
 }
Beispiel #3
0
        public async Task <IActionResult> Edit(int id, [Bind("LoreID,WorldID,Title,Details")] Lore lore)
        {
            if (id != lore.LoreID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(lore);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LoreExists(lore.LoreID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["WorldID"] = new SelectList(_context.Worlds, "WorldID", "Name", lore.WorldID);
            return(View(lore));
        }
 public bool DeepEquals(TalentGridGroup other)
 {
     return(other != null &&
            GroupHash == other.GroupHash &&
            Lore.DeepEquals(other.Lore) &&
            NodeHashes.DeepEqualsReadOnlySimpleCollection(other.NodeHashes) &&
            OpposingGroupHashes.DeepEqualsReadOnlySimpleCollection(other.OpposingGroupHashes) &&
            OpposingNodeHashes.DeepEqualsReadOnlySimpleCollection(other.OpposingNodeHashes));
 }
Beispiel #5
0
        protected override EmbedBuilder AddLore(EmbedBuilder body)
        {
            var effects = Lore?.StartsWith("Pendulum Effect") == true?Lore?.Split("Monster Effect") : null;

            return(effects is null?
                   base.AddLore(body) :
                       body
                       .AddField("Pendulum Effect", effects[0].Substring(15).Trim())
                       .AddField($"[ {Types.Join(" / ")} ]", effects[1].Trim()));
        }
Beispiel #6
0
 public LoreEditVM(Lore lore, Info info)
 {
     InfoId      = lore.InfoId;
     LoreId      = lore.LoreId;
     Name        = lore.Name;
     Blurb       = info.Blurb;
     TheContent  = lore.TheContent;
     IsPublished = lore.IsPublished;
     IsSecret    = info.IsSecret;
 }
Beispiel #7
0
        public async Task <IActionResult> Create([Bind("LoreID,WorldID,Title,Details")] Lore lore)
        {
            if (ModelState.IsValid && lore.Title != null)
            {
                _context.Add(lore);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["WorldID"] = new SelectList(_context.Worlds, "WorldID", "Name", lore.WorldID);
            return(View(lore));
        }
Beispiel #8
0
 void OnTriggerEnter(Collider other)
 {
     if(other.name.Contains("boat"))
     {
         other.transform.position = resetPosition.position;
         if(lorenControls == null)
         {
             lorenControls = other.GetComponent<Lore>();
         }
         lorenControls.movingForward = false;
         StartCoroutine(startAgainAfter(2.0f));
     }
 }
Beispiel #9
0
        public NavigationSteps(Visitor visitor)
        {
            _webSystem     = new WebSystem();
            _visitor       = visitor;
            VisitorBrowser = _visitor.Browser();

            _navigation  = new Navigation(VisitorBrowser);
            _armyBuilder = new ArmyBuilder(VisitorBrowser, BaseUrl);
            _campaign    = new Campaign(VisitorBrowser, BaseUrl);
            _home        = new Home(VisitorBrowser, BaseUrl);
            _lore        = new Lore(VisitorBrowser, BaseUrl);
            _rules       = new Rules(VisitorBrowser, BaseUrl);
        }
Beispiel #10
0
        // GET: Lores/Delete/5
        public ActionResult Delete(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Lore lore = db.Lores.Find(id);

            if (lore == null)
            {
                return(HttpNotFound());
            }
            return(View(lore));
        }
Beispiel #11
0
    void OnTriggerEnter(Collider other)
    {
        if (transform.position.z <= 15 && transform.position.x < 7.5 && transform.position.x > -7.5)
        {
            GameObject      gameControllerObject = GameObject.FindGameObjectWithTag("GameController");
            ItemsController itemController       = gameControllerObject.GetComponent <ItemsController> ();
            UIController    uiController         = gameControllerObject.GetComponent <UIController> ();

            switch (other.tag)
            {
            case "Player":
                if (owner == "Enemies")
                {
                    Hit();
                    PlayerController shipScript = other.GetComponent <PlayerController> ();
                    shipScript.IsHitted(Damage);
                }
                break;

            case "Lore":
                if (owner == "Player")
                {
                    Hit();
                    Lore loreScript = other.GetComponent <Lore> ();
                    if (loreScript.IsHitted(Damage) == Constants.DEAD)
                    {
                        uiController.AddScore(Constants.INDEXSCORETLORES, Constants.INDEXSCORESSHOT, false, 0);
                        itemController.spawnItem(other.transform);
                    }
                }
                break;

            case "Enemies":
                if (owner == "Player")
                {
                    Hit();
                    EnemyController shipScript = other.GetComponent <EnemyController> ();
                    if (shipScript.IsHitted(Damage) == Constants.DEAD)
                    {
                        uiController.AddScore(shipScript.indexScoreEnemy, Constants.INDEXSCORESSHOT, false, 0);
                        itemController.spawnItem(other.transform);
                    }
                }
                break;

            default:
                break;
            }
        }
    }
Beispiel #12
0
        public override string ToString()
        {
            string str = "";

            str += Name.ToString();
            str += Description.ToString();
            str += Note0.ToString();
            str += Lore.ToString();
            for (int i = 0; i < abilitySpecials.Count(); i++)
            {
                str += abilitySpecials.ElementAt(i).ToString();
            }
            return(str);
        }
Beispiel #13
0
 public void MapValues()
 {
     if (IntervalInfo != null)
     {
         foreach (var objective in IntervalInfo.IntervalObjectives)
         {
             objective.IntervalObjective.TryMapValue();
         }
         foreach (var reward in IntervalInfo.IntervalRewards)
         {
             foreach (var item in reward.IntervalRewardItems)
             {
                 item.Item.TryMapValue();
             }
         }
     }
     if (TitleInfo != null)
     {
         TitleInfo.GildingTrackingRecord.TryMapValue();
         foreach (var gender in TitleInfo.TitlesByGenderHash.Keys)
         {
             gender.TryMapValue();
         }
     }
     foreach (var objective in Objectives)
     {
         objective.TryMapValue();
     }
     foreach (var node in ParentNodes)
     {
         node.TryMapValue();
     }
     foreach (var item in RewardItems)
     {
         item.Item.TryMapValue();
     }
     foreach (var trait in Traits)
     {
         trait.TryMapValue();
     }
     Lore.TryMapValue();
     if (PresentationInfo != null)
     {
         foreach (var node in PresentationInfo.ParentPresentationNodes)
         {
             node.TryMapValue();
         }
     }
 }
        public string GenerateJson(bool topLevel)
        {
            var b = new StringBuilder();

            var b2 = new StringBuilder("display:{");

            if (!string.IsNullOrWhiteSpace(Name))
            {
                b2.AppendFormat("Name:\"{0}\",", Name.EscapeJsonString());
            }

            if (Color != 0)
            {
                b2.AppendFormat("color:{0},", Color);
            }

            if (!string.IsNullOrWhiteSpace(Lore))
            {
                var lines = Lore.Split(new[] { Environment.NewLine, "\r", "\n" }, StringSplitOptions.None);

                b2.Append("Lore:[");

                foreach (var line in lines)
                {
                    b2.AppendFormat("\"{0}\",", line.EscapeJsonString());
                }
                b2.Remove(b2.Length - 1, 1);
                b2.Append("],");
            }


            b2.Remove(b2.Length - 1, 1);
            b2.Append("},");

            if (b2.Length > 11)
            {
                b.Append(b2);
            }

            if (DisplayHideFlags != DisplayHideFlags.None)
            {
                b.AppendFormat("HideFlags:{0},", (int)DisplayHideFlags);
            }

            return(b.ToString());
        }
Beispiel #15
0
        public override string ToString()
        {
            string str = "";

            str += Name.ToString();
            str += Description.ToString();
            if (Properties.Settings.Default.GenNote0Lore)
            {
                str += Note0.ToString();
                str += Lore.ToString();
            }
            for (int i = 0; i < abilitySpecials.Count(); i++)
            {
                str += abilitySpecials.ElementAt(i).ToString();
            }
            return(str);
        }
Beispiel #16
0
    void OnTriggerEnter(Collider other)
    {
        switch (other.tag)
        {
        case "Player":
        case "Enemies":
            Ship shipScript = other.GetComponent <Ship> ();
            shipScript.ActivateState();
            break;

        case "Lore":
            Lore loreScript = other.GetComponent <Lore>();
            loreScript.ActivateState();
            break;

        default:
            break;
        }
    }
        public Book(TagNodeCompound item)
        {
            if (!item.ContainsKey("tag"))
            {
                return;
            }
            TagNodeCompound tag = item["tag"].ToTagCompound();

            if (!tag.ContainsKey("display"))
            {
                goto Next;
            }
            TagNodeCompound display = tag["display"].ToTagCompound();

            if (display.Keys.Contains("Lore"))
            {
                TagNodeList l = display["Lore"].ToTagList();
                for (int k = 0; k < l.Count; k++)
                {
                    Lore += l[k].ToTagString().Data.Replace("Line" + (k + 1) + ":", "") + "\n";
                }
                if (Lore.Length > 0)
                {
                    Lore = Lore.Substring(0, Lore.Length - 1);
                }
            }
            Next :;
            if (tag.ContainsKey("title"))
            {
                Title = tag["title"].ToTagString().Data;
            }
            if (tag.ContainsKey("pages"))
            {
                foreach (TagNode node in tag["pages"].ToTagList())
                {
                    Pages += node.ToTagString().Data + "\n";
                }
            }
            if (Pages.Length != 0)
            {
                Pages = Pages.Substring(0, Pages.Length - 1);
            }
        }
Beispiel #18
0
    private void hasCollide(Collider other)
    {
        GameObject      gameControllerObject = GameObject.FindGameObjectWithTag("GameController");
        ItemsController itemController       = gameControllerObject.GetComponent <ItemsController>();
        UIController    uiController         = gameControllerObject.GetComponent <UIController>();

        switch (other.tag)
        {
        case "Player":
            break;

        case "Lore":
            Lore loreScript = other.GetComponent <Lore>();
            if (loreScript.IsHitted(loreScript.GetHealth()) == Constants.DEAD)
            {
                uiController.AddScore(Constants.INDEXSCORETLORES, Constants.INDEXSCORESBOMB, false, 0);
                itemController.spawnItem(other.transform);
            }
            break;

        case "Enemies":
            Ship shipScript = other.GetComponent <Ship>();
            if (shipScript.IsHitted(shipScript.GetHealth()) == Constants.DEAD)
            {
                uiController.AddScore(Constants.INDEXSCORETENEMIES, Constants.INDEXSCORESBOMB, false, 0);
                itemController.spawnItem(other.transform);
            }
            break;

        case "Shot":
            Shot shotScript = other.GetComponent <Shot>();

            if (shotScript.GetOwner() != "Player")
            {
                shotScript.IsDestroyed();
                uiController.AddScore(Constants.INDEXSCORETSHOT, Constants.INDEXSCORESBOMB, false, 0);
            }
            break;

        default:
            break;
        }
    }
Beispiel #19
0
    public void CreateLoreFile(List <GameObject> ships)
    {
        Lore temp = new Lore();

        foreach (var s in ships)
        {
            temp = new Lore()
            {
                shipName = s.name,
                loreDesc = "blablah"
            };
            loreList.Lores.Add(temp);
        }

        using (StreamWriter sw = new StreamWriter(LoreFilePath))
        {
            string json = JsonUtility.ToJson(loreList, true);
            sw.Write(json);
        }
    }
Beispiel #20
0
        public ActionResult Details(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Lore lore = db.Lores.Find(id);

            if (lore == null)
            {
                return(HttpNotFound());
            }

            //prevent users from seeing un-published work
            if (!lore.IsPublished && !User.IsInRole("Admin"))
            {
                return(View("Error"));
                //todo change redirect to a error 404 page
            }
            return(View(lore));
        }
Beispiel #21
0
        // GET: Lores/Edit/5
        public ActionResult Edit(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Lore lore = db.Lores.Find(id);

            if (lore == null)
            {
                return(HttpNotFound());
            }
            short      infoid = lore.InfoId;
            Info       info   = db.Infos.Find(infoid);
            LoreEditVM model  = new LoreEditVM(lore, info);

            List <short> selectedTags = db.InfoTags.Where(t => t.InfoId == infoid).Select(t => t.TagId).ToList();

            ViewBag.Selected = selectedTags;
            ViewBag.Tags     = db.Tags.ToList();

            return(View(model));
        }
Beispiel #22
0
        public ActionResult Edit([Bind(Include = "LoreId,InfoId,Name,TheContent,Blurb,IsPublished, IsSecret")] LoreEditVM lore,
                                 List <short> tags, string submit)
        {
            if (ModelState.IsValid)
            {
                #region Save or Publish?
                switch (submit)
                {
                case "Save Progress":
                case "Un-Publish":
                    lore.IsPublished = false;
                    break;

                case "Publish":
                case "Save":
                    lore.IsPublished = true;
                    break;
                }
                #endregion

                var infoid = lore.InfoId;
                #region Info Update
                //Info info = db.Infos.Find(infoid);
                Info info = db.Infos.Where(i => i.InfoId == infoid).FirstOrDefault();
                info.Name        = lore.Name;
                info.Blurb       = lore.Blurb;
                info.IsPublished = lore.IsPublished;
                info.IsSecret    = lore.IsSecret;
                #endregion

                #region Update tags
                List <short> currentTagIds = db.InfoTags.Where(x => x.InfoId == infoid).Select(x => x.TagId).ToList();

                if (tags != null)
                {
                    foreach (short tag in tags)
                    {
                        //if this is an already existing tag
                        if (currentTagIds.Contains(tag))
                        {
                            currentTagIds.Remove(tag);
                        }
                        //if this is a newly added tag
                        else
                        {
                            InfoTag newTag = new InfoTag {
                                InfoId = infoid, TagId = tag
                            };
                            db.InfoTags.Add(newTag);
                        }
                    }
                }

                if (currentTagIds.Count != 0)
                {
                    foreach (short id in currentTagIds)
                    {
                        InfoTag gone = db.InfoTags.Where(x => x.InfoId == infoid & x.TagId == id).FirstOrDefault();
                        db.InfoTags.Remove(gone);
                    }
                }

                #endregion

                #region Update Lore
                Lore daLore = new Lore
                {
                    LoreId      = lore.LoreId,
                    InfoId      = lore.InfoId,
                    Name        = lore.Name,
                    TheContent  = lore.TheContent,
                    IsPublished = lore.IsPublished
                };
                db.Entry(daLore).State = EntityState.Modified;
                db.SaveChanges();
                #endregion

                return(RedirectToAction("Details", new { id = lore.LoreId }));
            }

            ViewBag.Tags = db.Tags.ToList();
            if (tags != null)
            {
                ViewBag.Selected = tags;
            }
            else
            {
                ViewBag.Selected = new List <short>();
            }
            ModelState.AddModelError("", "Something has gone wrong. Look for red text to see where is went wrong");
            return(View(lore));
        }
    public void OnLevelLoad(Scene scene)
    {
        if (scene.name == "HUB scene")
        {
            inv      = GameObject.Find("HUBUI/Inventory Panel/Grid Layout").GetComponent <Inventory>();
            inv2     = GameObject.Find("HUBUI/Loadout Panel/Inventory Grid").GetComponent <Inventory>();
            equipInv = GameObject.Find("HUBUI/Loadout Panel/Equipment Grid").GetComponent <Inventory>();
            sellInv  = GameObject.Find("HUBUI/Inventory Panel/Sell Inv").GetComponent <Inventory>();
            hubStats = GameObject.Find("HUBUI/Loadout Panel/Stats Backing").GetComponent <HUBStats>();
            lore     = GameObject.Find("HUBUI/Information Panel").GetComponent <Lore>();

            uiMgr.HUBUISet();

            if (allPickedUpObjects.Count > 0)
            {
                for (int i = 0; i < allPickedUpObjects.Count; i++)
                {
                    Item item = allPickedUpObjects[i].GetComponent <Item>();

                    if (item.itemStats.equipped == true) //check if the item is equipped and then if the lead bot has it. Since the leadbot will always show when first opening the loadout screen, no other bots need to be checked
                    {
                        if (item.itemStats.leadOwns)
                        {
                            equipInv.ItemRetrieve(item.itemStats);
                        }
                    }
                    else
                    {
                        inv.ItemRetrieve(item.itemStats);
                        inv2.ItemRetrieve(item.itemStats);
                    }
                }
            }

            if (loreObjects.Count > 0)
            {
                for (int i = 0; i < loreObjects.Count; i++)
                {
                    Item item = loreObjects[i].GetComponent <Item>();

                    lore.ItemRetrieve(item.itemStats);
                }
            }

            if (loadDataOnLevelLoad) //called when a button is pressed that sets the bool false, loads save data when the level loads
            {
                hubTracker.LoadDataFromFile(saveMgr.saveFileName);
                LoadInventoryData(saveMgr.saveFileName);

                loadDataOnLevelLoad = false;
            }

            if (resetDataForNewGame) //called when a button is pressed that sets the bool false, clears save data and then updates the UI when the level loads
            {
                Debug.Log("Reseting data for new game");

                hubTracker.ClearAllSaveData();
                ClearAllSaveData();
                ClearEquipment();

                inv.UpdateSlotUI();
                inv2.UpdateSlotUI();
                equipInv.UpdateSlotUI();
                sellInv.UpdateSlotUI();

                resetDataForNewGame = false;
            }
        }
    }
Beispiel #24
0
 void Start()
 {
     boatScript = GetComponent<Lore>();
 }
Beispiel #25
0
        /// <summary>
        /// Command list for the game
        /// </summary>
        /// <param name="commandOptions">Everything after the 1st occurance of a space</param>
        /// <param name="commandKey">The string before the 1st occurance of a space</param>
        /// <param name="playerData">Player Data</param>
        /// <param name="room">Current room</param>
        /// <returns>Returns Dictionary of commands</returns>
        public static void Commands(string commandOptions, string commandKey, PlayerSetup.Player playerData, Room.Room room)
        {
            var context = HubContext.Instance;

            switch (commandKey)
            {
            case "north":
                Movement.Move(playerData, room, "North");
                break;

            case "east":
                Movement.Move(playerData, room, "East");
                break;

            case "south":
                Movement.Move(playerData, room, "South");
                break;

            case "west":
                Movement.Move(playerData, room, "West");
                break;

            case "up":
                Movement.Move(playerData, room, "Up");
                break;

            case "down":
                Movement.Move(playerData, room, "Down");
                break;

            case "look":
            case "look at":
            case "l at":
            case "search":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "look");
                break;

            case "l in":
            case "search in":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "look in");
                break;

            case "examine":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "examine");
                break;

            case "touch":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "touch");
                break;

            case "smell":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "smell");
                break;

            case "taste":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "taste");
                break;

            case "score":
                Score.ReturnScore(playerData);
                break;

            case "inventory":
                Inventory.ReturnInventory(playerData.Inventory, playerData);
                break;

            case "eq":
            case "equip":
            case "equipment":
            case "garb":
                Equipment.ShowEquipment(playerData);
                break;

            case "loot":
            case "get":
            case "take":
                ManipulateObject.GetItem(room, playerData, commandOptions, commandKey, "item");
                break;

            case "plunder":
                ManipulateObject.GetItem(room, playerData, "all " + commandOptions, commandKey, "item");
                break;

            case "drop":
            case "put":
                ManipulateObject.DropItem(room, playerData, commandOptions, commandKey);
                break;

            case "give":
                ManipulateObject.GiveItem(room, playerData, commandOptions, commandKey, "killable");
                break;

            case "save":
                Save.SavePlayer(playerData);
                break;

            case "say":
            case "'":
                Communicate.Say(commandOptions, playerData, room);
                break;

            case "sayto":
            case ">":
                Communicate.SayTo(commandOptions, room, playerData);
                break;

            case "newbie":
                Communicate.NewbieChannel(commandOptions, playerData);
                break;

            case "gossip":
                Communicate.GossipChannel(commandOptions, playerData);
                break;

            case "ooc":
                Communicate.OocChannel(commandOptions, playerData);
                break;

            case "yes":
                Communicate.Say("Yes", playerData, room);
                break;

            case "no":
                Communicate.Say("No", playerData, room);
                break;

            case "yell":
                Communicate.Yell(commandOptions, room, playerData);
                break;

            case "talkto":
                Talk.TalkTo(commandOptions, room, playerData);
                break;

            case "emote":
                Emote.EmoteActionToRoom(commandOptions, playerData);
                break;

            case "use":
            case "wear":
            case "wield":
                Equipment.WearItem(playerData, commandOptions);
                break;

            case "remove":
            case "doff":
            case "unwield":
                Equipment.RemoveItem(playerData, commandOptions);
                break;

            case "hit":
            case "kill":
            case "attack":
                Fight2.PerpareToFight(playerData, room, commandOptions);
                break;

            case "flee":
                Flee.fleeCombat(playerData, room);
                break;

            case "sacrifice":
            case "harvest":
                Harvest.Body(playerData, room, commandOptions);
                break;

            case "peek":
                Peak.DoPeak(context, playerData, room, commandOptions);
                break;

            case "steal":
                Steal.DoSteal(context, playerData, room, commandOptions);
                break;

            case "pick":
                LockPick.DoLockPick(context, playerData, room, commandOptions);
                break;

            case "c magic missile":
            case "cast magic missile":
                MagicMissile.StartMagicMissile(playerData, room, commandOptions);
                break;

            case "c armour":
            case "cast armour":
            case "c armor":
            case "cast armor":
                new Armour().StartArmour(playerData, room, commandOptions);
                break;

            case "c continual light":
            case "cast continual light":
                ContinualLight.StarContinualLight(playerData, room, commandOptions);
                break;

            case "c invis":
            case "cast invis":
                Invis.StartInvis(playerData, room, commandOptions);
                break;

            case "c weaken":
            case "cast weaken":
                Weaken.StartWeaken(playerData, room, commandOptions);
                break;

            case "c chill touch":
            case "cast chill touch":
                ChillTouch.StartChillTouch(playerData, room, commandOptions);
                break;

            case "c fly":
            case "cast fly":
                Fly.StartFly(playerData, room, commandOptions);
                break;

            case "c refresh":
            case "cast refresh":
                Refresh.StartRefresh(playerData, room, commandOptions);
                break;

            case "c faerie fire":
            case "cast faerie fire":
                FaerieFire.StartFaerieFire(playerData, room, commandOptions);
                break;

            case "c teleport":
            case "cast teleport":
                Teleport.StartTeleport(playerData, room);
                break;

            case "c blindness":
            case "cast blindness":
                Blindness.StartBlind(playerData, room, commandOptions);
                break;

            case "c haste":
            case "cast haste":
                Haste.StartHaste(playerData, room, commandOptions);
                break;

            case "c create spring":
            case "cast create spring":
                CreateSpring.StartCreateSpring(playerData, room);
                break;

            case "c shocking grasp":
            case "cast shocking grasp":
                new ShockingGrasp().StartShockingGrasp(playerData, room, commandOptions);
                break;

            case "c cause light":
            case "cast cause light":
                new CauseLight().StartCauseLight(context, playerData, room, commandOptions);
                break;

            case "c cure light":
            case "cast cure light":
                new CureLight().StartCureLight(context, playerData, room, commandOptions);
                break;

            case "c cure blindness":
                new CureBlindness().StartCureBlindness(context, playerData, room, commandOptions);
                break;

            case "c detect invis":
            case "cast detect invis":
                DetectInvis.DoDetectInvis(context, playerData, room);
                break;

            case "forage":
                new Foraging().StartForaging(playerData, room);
                break;

            case "fish":
            case "angle":
            case "line":
            case "trawl":
            case "lure":
                new Fishing().StartFishing(playerData, room);
                break;

            case "reel":
                Fishing.GetFish(playerData, room);
                break;

            case "dirt kick":
                new DirtKick().StartDirtKick(context, playerData, room, commandOptions);
                break;

            case "bash":
                new Bash().StartBash(context, playerData, room, commandOptions);
                break;

            case "shield bash":
                new ShieldBash().StartBash(context, playerData, room, commandOptions);
                break;

            case "punch":
                Punch.StartPunch(playerData, room);
                break;

            case "kick":
                new Kick().StartKick(context, playerData, room, commandOptions);
                break;

            case "spin kick":
                new SpinKick().StartKick(context, playerData, room, commandOptions);
                break;

            case "rescue":
                new Rescue().StartRescue(context, playerData, room, commandOptions);
                break;

            case "lunge":
                new Lunge().StartLunge(context, playerData, room, commandOptions);
                break;

            case "disarm":
                new Disarm().StartDisarm(context, playerData, room);
                break;

            case "backstab":
                new Backstab().StartBackstab(context, playerData, room, commandOptions);
                break;

            case "feint":
                new Feint().StartFeint(context, playerData, room, commandOptions);
                break;

            case "mount":
            case "ride":
                Mount.StartMount(playerData, room, commandOptions);
                break;

            case "dismount":
                Mount.Dismount(playerData, room, commandOptions);
                break;

            case "trip":
                new Trip().StartTrip(context, playerData, room, commandOptions);
                break;

            case "sneak":
                Sneak.DoSneak(context, playerData);
                break;

            case "hide":
                Hide.DoHide(context, playerData);
                break;

            case "lore":
                Lore.DoLore(context, playerData, commandOptions);
                break;

            case "unlock":
                ManipulateObject.UnlockItem(room, playerData, commandOptions, commandKey);
                break;

            case "lock":
                ManipulateObject.LockItem(room, playerData, commandOptions, commandKey);
                break;

            case "close":
            case "shut":
                ManipulateObject.Close(room, playerData, commandOptions, commandKey);
                break;

            case "drink":
                ManipulateObject.Drink(room, playerData, commandOptions, commandKey);
                break;

            case "help":
            case "/help":
            case "?":
            case "commands":
                Help.ShowHelp(commandOptions, playerData);
                break;

            case "time":
            case "clock":
                Update.Time.ShowTime();
                break;

            case "skills":
            case "spells":
            case "skills all":
                ShowSkills.ShowPlayerSkills(playerData, commandOptions);
                break;

            case "practice":
                Trainer.Practice(playerData, room, commandOptions);
                break;

            case "list":
                Shop.listItems(playerData, room);
                break;

            case "buy":
                Shop.buyItems(playerData, room, commandOptions);
                break;

            case "sell":
                Shop.sellItems(playerData, room, commandOptions);
                break;

            case "quest log":
            case "qlog":
                Quest.QuestLog(playerData);
                break;

            case "wake":
                Status.WakePlayer(context, playerData, room);
                break;

            case "sleep":
                Status.SleepPlayer(context, playerData, room);
                break;

            case "rest":
            case "sit":
                Status.RestPlayer(context, playerData, room);
                break;

            case "stand":
                Status.StandPlayer(context, playerData, room);
                break;

            case "greet":
                Greet.GreetMob(playerData, room, commandOptions);
                break;

            case "who":
                Who.Connected(playerData);
                break;

            case "affects":
                Effect.Show(playerData);
                break;

            case "follow":
                Follow.FollowThing(playerData, room, commandOptions);
                break;

            case "nofollow":
                Follow.FollowThing(playerData, room, "noFollow");
                break;

            case "quit":
                HubContext.Instance.Quit(playerData.HubGuid, room);
                break;

            case "craft":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Craft);
                break;

            case "chop":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Chop);
                break;

            case "cook":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Cook);
                break;

            case "brew":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Brew);
                break;

            case "forge":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Forge);
                break;

            case "carve":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Carve);
                break;

            case "knit":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Knitting);
                break;

            case "make":
            case "build":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Craft);
                break;

            case "show crafts":
            case "craftlist":
                Craft.CraftList(playerData);
                break;

            case "set up camp":
                Camp.SetUpCamp(playerData, room);
                break;

            case "repair":
                Events.Repair.RepairItem(playerData, room, commandOptions);
                break;

            case "/debug":
                PlayerSetup.Player.DebugPlayer(playerData);
                break;

            case "/setGold":
                PlayerSetup.Player.SetGold(playerData, commandOptions);
                break;

            case "/setAc":
                PlayerSetup.Player.SetAC(playerData, commandOptions);
                break;

            case "/map":
                SigmaMap.DrawMap(playerData.HubGuid);     //not what you think it does
                break;

            default:
                HubContext.Instance.SendToClient("Sorry you can't do that. Try help commands or ask on the discord channel.", playerData.HubGuid);
                var log = new Error.Error
                {
                    Date         = DateTime.Now,
                    ErrorMessage = commandKey + " " + commandOptions,
                    MethodName   = "Wrong command"
                };

                Save.LogError(log);
                break;
            }
        }
Beispiel #26
0
        public static PlayerClass ThiefClass()
        {
            var thief = new PlayerClass
            {
                Name               = "Thief",
                IsBaseClass        = true,
                ExperienceModifier = 2000,
                HelpText           = new Help(),
                Skills             = new List <Skill>(),
                ReclassOptions     = new List <PlayerClass>(),
                MaxHpGain          = 15,
                MinHpGain          = 10,
                MaxManaGain        = 15,
                MinManaGain        = 10,
                MaxEnduranceGain   = 15,
                MinEnduranceGain   = 11,
                StatBonusStr       = 1,
                StatBonusCon       = 1
            };


            #region  Lvl 1 skills

            var longBlades = LongBlades.LongBladesAb();
            longBlades.Learned = true;
            thief.Skills.Add(longBlades);

            var shortBlades = ShortBlades.ShortBladesAb();
            shortBlades.Learned = true;
            thief.Skills.Add(shortBlades);


            var staff = Staff.StaffAb();
            staff.Learned = true;
            thief.Skills.Add(staff);

            var handToHand = HandToHand.HandToHandAb();
            handToHand.Learned = true;
            thief.Skills.Add(handToHand);

            var lightArmour = LightArmour.LightArmourAb();
            lightArmour.Learned = true;
            thief.Skills.Add(lightArmour);

            #endregion

            #region  Lvl 2 skills
            var dodge = Player.Skills.Dodge.DodgeAb();
            dodge.LevelObtained = 2;
            thief.Skills.Add(dodge);

            #endregion

            #region  Lvl 3 skills
            var sneak = Player.Skills.Sneak.SneakAb();
            sneak.LevelObtained = 3;
            thief.Skills.Add(dodge);

            var exotic = Exotic.ExoticAb();
            exotic.LevelObtained = 3;
            thief.Skills.Add(exotic);

            #endregion

            #region  Lvl 4 skills
            var kick = Player.Skills.Kick.KickAb();
            kick.LevelObtained = 5;
            thief.Skills.Add(kick);

            #endregion


            #region Lvl 5 skills

            var blunt = BluntWeapons.BluntWeaponsAb();
            blunt.LevelObtained = 5;
            thief.Skills.Add(blunt);


            #endregion


            #region Lvl 7 skills

            var trip = Trip.TripAb();
            trip.LevelObtained = 7;
            thief.Skills.Add(trip);
            #endregion

            #region Lvl 8 skills

            var lore = Lore.LoreAb();
            thief.Skills.Add(lore);
            #endregion

            #region Lvl 9 skills

            var hide = Hide.HideAb();
            hide.LevelObtained = 9;
            thief.Skills.Add(hide);
            #endregion

            #region Lvl 10 skills

            var skick = SpinKick.KickAb();
            thief.Skills.Add(skick);

            var peak = Peak.PeakAb();
            thief.Skills.Add(peak);
            #endregion

            #region Lvl 11 skills

            var steal = Steal.StealAb();
            thief.Skills.Add(steal);


            #endregion


            #region Lvl 12 skills

            var tumble = Tumble.TumbleAb();
            thief.Skills.Add(tumble);
            #endregion


            #region Lvl 13 skills

            var picklock = LockPick.LockPickAb();
            thief.Skills.Add(picklock);
            #endregion

            #region Lvl 14 skills

            var dkick = DirtKick.DirtKickAb();
            dkick.LevelObtained = 14;
            thief.Skills.Add(dkick);
            #endregion


            #region Lvl 15 skills

            var bstab = Backstab.BackstabAb();
            thief.Skills.Add(bstab);
            #endregion

            #region Lvl 16 skills

            var parry = Parry.ParryAb();
            parry.LevelObtained = 16;
            thief.Skills.Add(parry);
            #endregion


            #region Lvl 18 skills

            var disarm = Disarm.DisarmAb();
            disarm.LevelObtained = 18;
            thief.Skills.Add(disarm);
            #endregion

            #region Lvl 20 skills

            var feint = Feint.FeintAb();

            thief.Skills.Add(feint);
            #endregion



            thief.ReclassOptions.Add(Ranger.RangerClass());

            return(thief);
        }
Beispiel #27
0
 public void SetInformation(Lore loreInfo)
 {
     myContent       = loreInfo;
     buttomText.text = myContent.Title;
 }
Beispiel #28
0
 public (CardText, CardLore, List <CardVoiceOver>) GetGameFileData(int id)
 {
     return(Text.GetValueOrDefault(id), Lore.GetValueOrDefault(id), Voiceover.GetValueOrDefault(id, new List <CardVoiceOver>()));
 }
Beispiel #29
0
 public void MapValues()
 {
     Collectible.TryMapValue();
     SummaryItem.TryMapValue();
     foreach (var itemCategory in ItemCategories)
     {
         itemCategory.TryMapValue();
     }
     BreakerType.TryMapValue();
     DefaultDamageType.TryMapValue();
     if (Stats != null)
     {
         Stats.StatGroup.TryMapValue();
         Stats.PrimaryBaseStat.TryMapValue();
         foreach (var stat in Stats.Stats)
         {
             stat.Key.TryMapValue();
             stat.Value.Stat.TryMapValue();
         }
     }
     TalentGrid?.TalentGrid.TryMapValue();
     if (Value != null)
     {
         foreach (var value in Value.ItemValue)
         {
             value.Item.TryMapValue();
         }
     }
     if (SetData != null)
     {
         foreach (var setDataItem in SetData.ItemList)
         {
             setDataItem.Item.TryMapValue();
         }
     }
     if (Plug != null)
     {
         Plug.EnabledMaterialRequirement.TryMapValue();
         Plug.EnergyCapacity?.EnergyType.TryMapValue();
         Plug.EnergyCost?.EnergyType.TryMapValue();
         Plug.InsertionMaterialRequirement.TryMapValue();
         Plug.PlugCategory.TryMapValue();
         Plug.PreviewItemOverride.TryMapValue();
     }
     if (Preview != null)
     {
         Preview.Artifact.TryMapValue();
         Preview.PreviewVendor.TryMapValue();
         foreach (var category in Preview.DerivedItemCategories)
         {
             foreach (var item in category.Items)
             {
                 item.Item.TryMapValue();
             }
         }
     }
     if (Quality != null)
     {
         Quality.ProgressionLevelRequirement.TryMapValue();
         foreach (var version in Quality.Versions)
         {
             version.PowerCap.TryMapValue();
         }
     }
     if (Objectives != null)
     {
         foreach (var activity in Objectives.DisplayActivities)
         {
             activity.TryMapValue();
         }
         foreach (var objective in Objectives.Objectives)
         {
             objective.TryMapValue();
         }
         Objectives.QuestlineItem.TryMapValue();
         foreach (var property in Objectives.PerObjectiveDisplayProperties)
         {
             property.Activity.TryMapValue();
         }
     }
     Inventory.BucketType.TryMapValue();
     Inventory.TierType.TryMapValue();
     Inventory.RecoveryBucketType.TryMapValue();
     if (Action != null)
     {
         foreach (var reward in Action.ProgressionRewards)
         {
             reward.ProgressionMapping.TryMapValue();
         }
         foreach (var item in Action.RequiredItems)
         {
             item.Item.TryMapValue();
         }
         Action.RewardSheet.TryMapValue();
     }
     if (EquippingBlock != null)
     {
         EquippingBlock.EquipmentSlotType.TryMapValue();
         EquippingBlock.GearsetItem.TryMapValue();
     }
     if (Sockets != null)
     {
         foreach (var intrinsicSocket in Sockets.IntrinsicSockets)
         {
             intrinsicSocket.PlugItem.TryMapValue();
             intrinsicSocket.SocketType.TryMapValue();
         }
         foreach (var socketCategory in Sockets.SocketCategories)
         {
             socketCategory.SocketCategory.TryMapValue();
         }
         foreach (var socket in Sockets.SocketEntries)
         {
             socket.RandomizedPlugSet.TryMapValue();
             socket.ReusablePlugSet.TryMapValue();
             socket.SingleInitialItem.TryMapValue();
             socket.SocketType.TryMapValue();
         }
     }
     foreach (var stat in InvestmentStats)
     {
         stat.StatType.TryMapValue();
     }
     foreach (var perk in Perks)
     {
         perk.Perk.TryMapValue();
     }
     if (Gearset != null)
     {
         foreach (var item in Gearset.Items)
         {
             item.TryMapValue();
         }
     }
     EmblemObjective.TryMapValue();
     if (SourceData != null)
     {
         foreach (var rewardSource in SourceData.RewardSources)
         {
             rewardSource.TryMapValue();
         }
         foreach (var source in SourceData.Sources)
         {
             foreach (var sourceSource in source.Sources)
             {
                 sourceSource.TryMapValue();
             }
         }
         foreach (var vendorSource in SourceData.VendorSources)
         {
             vendorSource.Vendor.TryMapValue();
         }
     }
     if (Metrics != null)
     {
         foreach (var node in Metrics.AvailableMetricCategoryNodes)
         {
             node.TryMapValue();
         }
     }
     Lore.TryMapValue();
     foreach (var type in DamageTypes)
     {
         type.TryMapValue();
     }
     Season.TryMapValue();
 }
Beispiel #30
0
 public bool DeepEquals(DestinyInventoryItemDefinition other)
 {
     return(other != null &&
            Collectible.DeepEquals(other.Collectible) &&
            SummaryItem.DeepEquals(other.SummaryItem) &&
            ItemCategories.DeepEqualsReadOnlyCollections(other.ItemCategories) &&
            AcquireRewardSiteHash == other.AcquireRewardSiteHash &&
            AcquireUnlockHash == other.AcquireUnlockHash &&
            AllowActions == other.AllowActions &&
            (BackgroundColor != null ? BackgroundColor.DeepEquals(other.BackgroundColor) : other.BackgroundColor == null) &&
            BreakerTypeEnumValue == other.BreakerTypeEnumValue &&
            BreakerType.DeepEquals(other.BreakerType) &&
            ClassType == other.ClassType &&
            DefaultDamageTypeEnumValue == other.DefaultDamageTypeEnumValue &&
            DefaultDamageType.DeepEquals(other.DefaultDamageType) &&
            ItemSubType == other.ItemSubType &&
            ItemType == other.ItemType &&
            SpecialItemType == other.SpecialItemType &&
            DisplayProperties.DeepEquals(other.DisplayProperties) &&
            DisplaySource == other.DisplaySource &&
            DoesPostmasterPullHaveSideEffects == other.DoesPostmasterPullHaveSideEffects &&
            Equippable == other.Equippable &&
            IconWatermark == other.IconWatermark &&
            IconWatermarkShelved == other.IconWatermarkShelved &&
            IsWrapper == other.IsWrapper &&
            ItemTypeAndTierDisplayName == other.ItemTypeAndTierDisplayName &&
            ItemTypeDisplayName == other.ItemTypeDisplayName &&
            UiItemDisplayStyle == other.UiItemDisplayStyle &&
            NonTransferrable == other.NonTransferrable &&
            SecondaryIcon == other.SecondaryIcon &&
            SecondaryOverlay == other.SecondaryOverlay &&
            SecondarySpecial == other.SecondarySpecial &&
            Screenshot == other.Screenshot &&
            TooltipStyle == other.TooltipStyle &&
            TraitIds.DeepEqualsReadOnlySimpleCollection(other.TraitIds) &&
            (Stats != null ? Stats.DeepEquals(other.Stats) : other.Stats == null) &&
            (TalentGrid != null ? TalentGrid.DeepEquals(other.TalentGrid) : other.TalentGrid == null) &&
            (TranslationBlock != null ? TranslationBlock.DeepEquals(other.TranslationBlock) : other.TranslationBlock == null) &&
            (Value != null ? Value.DeepEquals(other.Value) : other.Value == null) &&
            (SetData != null ? SetData.DeepEquals(other.SetData) : other.SetData == null) &&
            (Plug != null ? Plug.DeepEquals(other.Plug) : other.Plug == null) &&
            (Preview != null ? Preview.DeepEquals(other.Preview) : other.Preview == null) &&
            (Quality != null ? Quality.DeepEquals(other.Quality) : other.Quality == null) &&
            (Objectives != null ? Objectives.DeepEquals(other.Objectives) : other.Objectives == null) &&
            Inventory.DeepEquals(other.Inventory) &&
            (Action != null ? Action.DeepEquals(other.Action) : other.Action == null) &&
            (EquippingBlock != null ? EquippingBlock.DeepEquals(other.EquippingBlock) : other.EquippingBlock == null) &&
            (Sockets != null ? Sockets.DeepEquals(other.Sockets) : other.Sockets == null) &&
            InvestmentStats.DeepEqualsReadOnlyCollections(other.InvestmentStats) &&
            Perks.DeepEqualsReadOnlyCollections(other.Perks) &&
            TooltipNotifications.DeepEqualsReadOnlyCollections(other.TooltipNotifications) &&
            (Sack != null ? Sack.DeepEquals(other.Sack) : other.Sack == null) &&
            (Gearset != null ? Gearset.DeepEquals(other.Gearset) : other.Gearset == null) &&
            EmblemObjective.DeepEquals(other.EmblemObjective) &&
            (SourceData != null ? SourceData.DeepEquals(other.SourceData) : other.SourceData == null) &&
            (Metrics != null ? Metrics.DeepEquals(other.Metrics) : other.Metrics == null) &&
            (Summary != null ? Summary.DeepEquals(other.Summary) : other.Summary == null) &&
            Lore.DeepEquals(other.Lore) &&
            Animations.DeepEqualsReadOnlyCollections(other.Animations) &&
            Links.DeepEqualsReadOnlyCollections(other.Links) &&
            DamageTypes.DeepEqualsReadOnlyCollections(other.DamageTypes) &&
            DamageTypeEnumValues.DeepEqualsReadOnlySimpleCollection(other.DamageTypeEnumValues) &&
            Season.DeepEquals(other.Season) &&
            Blacklisted == other.Blacklisted &&
            Hash == other.Hash &&
            Index == other.Index &&
            Redacted == other.Redacted);
 }
Beispiel #31
0
        public ActionResult Create([Bind(Include = "Name,TheContent, Blurb, IsSecret")] LoreCreateVM lore,
                                   List <short> tags,
                                   string submit)
        {
            #region Save or Publish?
            switch (submit)
            {
            case "Save Progress":
            case "Un-Publish":
                lore.IsPublished = false;
                break;

            case "Publish":
            case "Save":
                lore.IsPublished = true;
                break;
            }
            #endregion

            if (ModelState.IsValid)
            {
                #region Info
                Info info = new Info
                {
                    InfoTypeId   = 1, //<-------------------Info Type ID. CHANGE UPON COPY
                    IdWithinType = null,
                    Blurb        = lore.Blurb,
                    Name         = lore.Name,
                    IsPublished  = lore.IsPublished,
                    IsSecret     = lore.IsSecret
                };
                db.Infos.Add(info);
                db.SaveChanges(); //this has to go here in order to ensure that the infoId short below is accurate. Also at this point I am doing no further gets on validity so there is no point to not saving

                short infoId = db.Infos.Max(i => i.InfoId);

                #endregion

                #region Adding Tags
                if (tags != null)
                {
                    foreach (short t in tags)
                    {
                        InfoTag infoTag = new InfoTag {
                            InfoId = infoId, TagId = t
                        };
                        db.InfoTags.Add(infoTag);
                    }
                }
                #endregion

                #region Lore
                Lore daLore = new Lore
                {
                    InfoId      = infoId,
                    Name        = lore.Name,
                    TheContent  = lore.TheContent,
                    IsPublished = lore.IsPublished
                };
                db.Lores.Add(daLore);
                db.SaveChanges();
                #endregion

                #region give info the IdWithinType
                short maxi = db.Lores.Max(i => i.LoreId); // <------------ CHANGE THIS UPON COPY PASTE!!!!!!!!
                info.IdWithinType    = maxi;
                db.Entry(info).State = EntityState.Modified;
                db.SaveChanges();
                #endregion

                return(RedirectToAction("Details", new { id = maxi }));
            }

            //if model is not valid
            ViewBag.Tags = new MultiSelectList(db.Tags, "TagId", "TagName", tags);
            ModelState.AddModelError("", "Something has gone wrong. Look for red text to see where is went wrong");
            return(View(lore));
        }
Beispiel #32
0
        public ActionResult DeleteConfirmed(short id)
        {
            Lore  lore   = db.Lores.Find(id);
            short infoId = lore.InfoId;

            db.Lores.Remove(lore);

            #region Remove Rumors
            var rumors = db.Rumors.Where(r => r.RumorOfId == infoId);
            foreach (Rumor r in rumors)
            {
                db.Rumors.Remove(r);
            }
            #endregion

            #region Remove Secrets
            var                    secrets   = db.Secrets.Where(s => s.IsAboutId == infoId);
            List <short>           secretIds = db.Secrets.Where(s => s.IsAboutId == infoId).Select(s => s.SecretId).ToList();
            List <SecretSecretTag> ssts      = db.SecretSecretTags.Where(s => secretIds.Contains(s.SecretId)).ToList();

            //remove sst
            foreach (SecretSecretTag secretSecretTag in ssts)
            {
                db.SecretSecretTags.Remove(secretSecretTag);
            }

            //remove secrets
            foreach (Secret secret in secrets)
            {
                db.Secrets.Remove(secret);
            }

            #endregion

            #region remove stories
            var             stories  = db.Stories.Where(s => s.IsAboutId == infoId);
            List <short>    storyIds = db.Stories.Where(s => s.IsAboutId == infoId).Select(s => s.StoryId).ToList();
            List <StoryTag> st       = db.StoryTags.Where(s => storyIds.Contains(s.StoryId)).ToList();

            //remove story tags
            foreach (StoryTag storyTag in st)
            {
                db.StoryTags.Remove(storyTag);
            }

            //remove stories
            foreach (Story story in stories)
            {
                db.Stories.Remove(story);
            }
            #endregion

            #region Remove info
            Info info     = db.Infos.Where(i => i.InfoId == infoId).First();
            var  infoTags = db.InfoTags.Where(it => it.InfoId == infoId).ToList();
            foreach (InfoTag infoTag in infoTags)
            {
                db.InfoTags.Remove(infoTag);
            }

            db.Infos.Remove(info);
            #endregion

            db.SaveChanges();
            return(RedirectToAction("Index"));
        }