private static ObjectsPattern[] GetPatterns(IImagesStorage storage) { var patternsList = new List <ObjectsPattern> { // Table with 2 chairs CreateTableWithChairs(), // Single Shelf CreateShelfDown(), CreateShelfUp(), CreateShelfLeft(), CreateShelfRight(), // Crate CreateCrate(), // Chest CreateChest(), CreateGoldenChest(), // Water CreateWaterPool(), // Spiked Floor CreateSpikedFloor(), // Stone CreateStone() }; return(patternsList.ToArray()); }
public SymbolsImage GetWorldImage(IImagesStorage storage) { var templateImage = storage.GetImage("ItemsOnGround_Potion"); var palette = GetPotionPalette(); return(SymbolsImage.Recolor(templateImage, palette)); }
public override SymbolsImage GetEffectImage(int width, int height, IImagesStorage imagesStorage) { var color = TextHelper.GetElementColor(element); var damageText = value.ToString(); var xShift = (int)Math.Floor((width - damageText.Length) / 2d); if (damageText.Length > width) { damageText = "XXX"; } var yShift = (int)Math.Floor(height / 2d); var damageTextImage = new SymbolsImage(width, height); for (int shift = 0; shift < damageText.Length; shift++) { var x = xShift + shift; if (x >= damageTextImage.Width) { break; } damageTextImage.SetPixel(x, yShift, damageText[shift], color); } return(damageTextImage); }
public ItemsGenerator(IItemGeneratorConfiguration configuration, IImagesStorage imagesStorage, IAncientSpellsProvider spellsProvider) { var bonusesGenerator = new BonusesGenerator(configuration.BonusesConfiguration); weaponGenerators = new Dictionary <WeaponType, IWeaponGenerator> { { WeaponType.Sword, new WeaponGenerator("Sword", WorldImageNameSword, configuration.WeaponsConfiguration.SwordsConfiguration, configuration.WeaponsConfiguration, bonusesGenerator, imagesStorage) }, { WeaponType.Dagger, new WeaponGenerator("Dagger", WorldImageNameDagger, configuration.WeaponsConfiguration.DaggersConfiguration, configuration.WeaponsConfiguration, bonusesGenerator, imagesStorage) }, { WeaponType.Mace, new WeaponGenerator("Mace", WorldImageNameMace, configuration.WeaponsConfiguration.MacesConfiguration, configuration.WeaponsConfiguration, bonusesGenerator, imagesStorage) }, { WeaponType.Axe, new WeaponGenerator("Axe", WorldImageNameAxe, configuration.WeaponsConfiguration.AxesConfiguration, configuration.WeaponsConfiguration, bonusesGenerator, imagesStorage) }, { WeaponType.Staff, new WeaponGenerator("Staff", WorldImageNameStaff, configuration.WeaponsConfiguration.StaffsConfiguration, configuration.WeaponsConfiguration, bonusesGenerator, imagesStorage) } }; armorGenerator = new ArmorGenerator(configuration.ArmorConfiguration, bonusesGenerator, imagesStorage); shieldGenerator = new ShieldGenerator(configuration.ShieldsConfiguration, bonusesGenerator, imagesStorage); spellBookGenerator = new SpellBookGenerator(configuration.SpellBooksConfiguration, bonusesGenerator, imagesStorage); usableItemsGenerator = new UsableItemsGenerator(imagesStorage, spellsProvider); resourceItemsGenerator = new ResourceItemsGenerator(); foodItemsGenerator = new FoodItemsGenerator(imagesStorage); }
public UsableItemsGenerator(IImagesStorage imagesStorage, IAncientSpellsProvider spellsProvider) { generators = new Dictionary <UsableItemType, IUsableItemTypeGenerator> { { UsableItemType.Potion, new PotionsGenerator() }, { UsableItemType.Scroll, new ScrollsGenerator(spellsProvider) } }; }
public SymbolsImage GetWorldImage(IImagesStorage storage) { var body = storage.GetImage(configuration.Image); var directionImageName = GetWorldImageName(); var directionImage = storage.GetImage(directionImageName); return(SymbolsImage.Combine(body, directionImage)); }
public SymbolsImage GetInventoryImage(IImagesStorage storage) { var imageTemplateName = GetInventoryImageTemplateName(); var templateImage = storage.GetImage(imageTemplateName); var palette = GetPotionPalette(); return(SymbolsImage.Recolor(templateImage, palette)); }
public SymbolsImage GetImage(IImagesStorage storage, string animationName) { if (!managers.ContainsKey(animationName)) { managers.Add(animationName, new AnimationManager(storage.GetAnimation(animationName), changeInterval, frameStrategy)); } return(managers[animationName].GetCurrentFrame()); }
public SymbolsImage GetWorldImage(IImagesStorage storage) { if (energyLeft >= HighEnergy) { return(storage.GetImage(ImageHighEnergy)); } if (energyLeft >= MediumEnergy) { return(storage.GetImage(ImageMediumEnergy)); } return(storage.GetImage(ImageLowEnergy)); }
public SymbolsImage GetWorldImage(IImagesStorage storage) { if (Mana >= HighManaLevel) { return(animations.GetImage(storage, ImageHighMana)); } if (Mana >= MediumManaLevel) { return(animations.GetImage(storage, ImageMediumMana)); } return(animations.GetImage(storage, ImageLowMana)); }
private DungeonMapGenerator(IImagesStorage imagesStorage, bool writeMapFile = false) { this.writeMapFile = writeMapFile; generators = new Dictionary <MapType, IMapAreaGenerator> { { MapType.Dungeon, new DungeonRoomsMapGenerator( new DungeonMapObjectsFactory(), new ObjectsGenerators.DungeonObjectsGenerator(imagesStorage), new DungeonMonstersGenerator()) }, { MapType.Labyrinth, new LabyrinthMapGenerator(new DungeonMapObjectsFactory()) }, { MapType.Cave, new CaveDungeonMapGenerator(new CaveMapObjectsFactory()) } }; }
public WeaponGenerator( string baseName, string worldImageName, IWeaponConfiguration configuration, IWeaponsConfiguration configurations, BonusesGenerator bonusesGenerator, IImagesStorage imagesStorage) { this.configurations = configurations; this.imagesStorage = imagesStorage; this.bonusesGenerator = bonusesGenerator; this.baseName = baseName; this.worldImageName = worldImageName; this.configuration = configuration; }
public SymbolsImage GetWorldImage(IImagesStorage storage) { if (Volume >= Configuration.MaxVolumeBeforeSpread) { return(storage.GetImage(ImageBig)); } var halfSpread = Configuration.MaxVolumeBeforeSpread / 2; if (Volume >= halfSpread) { return(storage.GetImage(ImageMedium)); } return(storage.GetImage(ImageSmall)); }
private static IItem CreateMeat(IImagesStorage storage) { return(new FoodItem(new FoodItemConfiguration { Key = "food_meat", Name = "Meat", HungerDecrease = 7, Rareness = ItemRareness.Common, Weight = 500, InventoryImage = storage.GetImage("Food_Meat"), WorldImage = storage.GetImage("ItemsOnGround_Food_Meat"), Description = new[] { "A big piece of meat. It smells good." } })); }
private static IItem CreateApple(IImagesStorage storage) { return(new FoodItem(new FoodItemConfiguration { Key = "food_apple", Name = "Apple", HungerDecrease = 3, Rareness = ItemRareness.Common, Weight = 200, InventoryImage = storage.GetImage("Food_Apple"), WorldImage = storage.GetImage("ItemsOnGround_Food_Apple"), Description = new [] { "A sweet red apple. Juicy and tasty." } })); }
public SymbolsImage GetEquippedImage(Player player, IImagesStorage imagesStorage) { if (Equals(player.Equipment.RightHandItem)) { return(GetRightEquippedImage(imagesStorage)); } if (Equals(player.Equipment.LeftHandItem)) { return(GetLeftEquippedImage(imagesStorage)); } Log.Warning($"Trying to render item \"{Name}\" that not equipped on both left and right hand."); #if DEBUG throw new ApplicationException($"Trying to render item \"{Name}\" that not equipped on both left and right hand."); #else return(null); #endif }
public SymbolsImage GetWorldImage(IImagesStorage storage) { if (Closed) { if (HasConnectedTile(0, -1) && HasConnectedTile(0, 1)) { return(storage.GetImage(ImageClosedVertical)); } return(storage.GetImage(ImageClosedHorizontal)); } if (HasConnectedTile(0, -1) && HasConnectedTile(0, 1)) { return(storage.GetImage(ImageOpenedVertical)); } return(storage.GetImage(ImageOpenedHorizontal)); }
public SymbolsImage GetWorldImage(IImagesStorage storage) { if (!HasConnectedTile(0, 1) && !HasConnectedTile(1, 0)) { return(animationsManager.GetImage(storage, ImageBottomRight)); } if (!HasConnectedTile(0, 1)) { return(animationsManager.GetImage(storage, ImageBottom)); } if (!HasConnectedTile(1, 0)) { return(animationsManager.GetImage(storage, ImageRight)); } if (!HasConnectedTile(1, 1)) { return(storage.GetImage(ImageCorner)); } return(storage.GetImage(ImageNormal)); }
public virtual SymbolsImage GetWorldImage(IImagesStorage storage) { return(worldImage); }
public SymbolsImage GetWorldImage(IImagesStorage storage) { return(storage.GetImage(ImageName)); }
public InventoryImagesFactory(IImagesStorage imagesStorage) { this.imagesStorage = imagesStorage; }
public SymbolsImage GetWorldImage(IImagesStorage storage) { return animationsManager.GetImage(storage, AnimationName); }
protected virtual SymbolsImage GetLeftEquippedImage(IImagesStorage storage) { return(equippedImageLeft); }
protected virtual SymbolsImage GetRightEquippedImage(IImagesStorage storage) { return(equippedImageRight); }
public virtual SymbolsImage GetInventoryImage(IImagesStorage storage) { return(inventoryImage); }
public SymbolsImage GetInventoryImage(IImagesStorage storage) { return(storage.GetImage(InventoryImageName)); }
public SymbolsImage GetWorldImage(IImagesStorage storage) { var imageName = GetWorldImageName(); return(storage.GetImage(imageName)); }
public SymbolsImage GetWorldImage(IImagesStorage storage) { return(storage.GetImage("Decoratives_Stones_Small")); }
public SymbolsImage GetInventoryImage(IImagesStorage storage) { return(storage.GetImage("Item_Resource_Stone")); }
public static void Initialize(IImagesStorage imagesStorage, bool writeMapFile) { Current = new DungeonMapGenerator(imagesStorage, writeMapFile); }