public Contents Generate(int partyLevel) { var areaContents = areaPercentileSelector.SelectFrom(TableNameConstants.Contents); var miscellaneousContents = new List<string>(); miscellaneousContents.AddRange(areaContents.Contents.Miscellaneous); var minorFeatures = GetFeatures(areaContents.Length, TableNameConstants.MinorFeatures); miscellaneousContents.AddRange(minorFeatures); var majorFeatures = GetFeatures(areaContents.Width, TableNameConstants.MajorFeatures); miscellaneousContents.AddRange(majorFeatures); areaContents.Contents.Miscellaneous = miscellaneousContents; if (areaContents.Contents.Miscellaneous.Contains(ContentsTypeConstants.Treasure)) { var dungeonTreasure = new DungeonTreasure(); dungeonTreasure.Treasure = treasureGenerator.GenerateAtLevel(partyLevel); dungeonTreasure.Concealment = percentileSelector.SelectFrom(TableNameConstants.TreasureConcealment); dungeonTreasure.Container = percentileSelector.SelectFrom(TableNameConstants.TreasureContainers); areaContents.Contents.Treasures = new[] { dungeonTreasure }; } return areaContents.Contents; }
public static DungeonTreasure GetDungeonTreasure(int dtId) { string[][] strs = ReadTxt.ReadText("dungeon_treasure"); DungeonTreasure dt = new DungeonTreasure(); for (int i = 0; i < strs.Length - 1; i++) { dt.id = int.Parse(ReadTxt.GetDataByRowAndCol(strs, i + 1, 0)); if (dt.id != dtId) { continue; } string[][] p = ReadTxt.GetRequire(ReadTxt.GetDataByRowAndCol(strs, i + 1, 1)); dt.reward = new Dictionary <int, int> (); for (int j = 0; j < p.Length; j++) { dt.reward.Add(int.Parse(p [j] [0]), int.Parse(p [j] [1])); } return(dt); } Debug.Log("没有找到地牢宝藏--" + dtId); return(new DungeonTreasure()); }
public void Setup() { dungeonTreasure = new DungeonTreasure(); }