//public MinMaxf NumberOfItemGenerated { get { return numberOfItemGenerated; } // private set { numberOfItemGenerated = value; } } #endregion public AItemGenerator() { this.levelRequired = new MinMaxi(); this.level = new MinMaxi(); this.instantiateType = e_itemInstantiateType.OnGround; this.NumberOfItemGenerated = new MinMaxf(); }
public void InitializeStuffGenerator(MinMaxf itemNumber, int minLevelRequiered, int maxLevelRequiered, e_equipmentQuality minQuality, e_equipmentQuality maxQuality) { this.stuffGenerator.LevelRequired.Initialize(minLevelRequiered, maxLevelRequiered); this.stuffGenerator.InitializeMinMaxQuality(minQuality, maxQuality); this.stuffGenerator.NumberOfItemGenerated.Initialize(itemNumber.min * this.lootAttribute.ItemQuantityPercent, itemNumber.max * this.lootAttribute.ItemQuantityPercent); this.stuffGenerator.ItemRarity = this.lootAttribute.ItemRarityPercent; }
public GenericTableOfLoot() { itemGenerator = new ItemGenerator <TModuleType>(); fixedStuff = new List <AItem <TModuleType> >(); stuffGenerated = new MinMaxf(); consommableGenerated = new MinMaxf(); this.goldQuantity = new MinMaxf(); goldGenerated = new MinMaxi(); size = 50; maxWeight = 5000; }
public static int GenerateRandomIntBetweenFloat(MinMaxf numberOfItemGenerated) { float numberOfItemGenerate = numberOfItemGenerated.RandomBetweenValues(); if (numberOfItemGenerate - Mathf.Floor(numberOfItemGenerate) > Random.Range(0.0f, 1.0f)) { numberOfItemGenerate = numberOfItemGenerate + 1 - (numberOfItemGenerate - Mathf.Floor(numberOfItemGenerate)); } return((int)numberOfItemGenerate); }
public void GenerateConsommable(AInventory <TModuleType> itemContainer, MinMaxf consommableQuantity) { int consommableGet = MathExtension.GenerateRandomIntBetweenFloat(new MinMaxf(consommableQuantity.min * this.lootAttribute.ItemQuantityPercent, consommableQuantity.max * lootAttribute.ItemQuantityPercent)); for (byte i = 0; i < consommableGet; i++) { this.consommableGenerator.GenerateConsommable(itemContainer); } this.ThrowAndClearItemsListIfOnGround(itemContainer); }
public void GenerateGold(MinMaxf goldQuantity, MinMaxi goldAmount) { float numberOfItemGenerate = MathExtension.GenerateRandomIntBetweenFloat(new MinMaxf(goldQuantity.min * this.lootAttribute.GoldQuantityPercent, goldQuantity.max * lootAttribute.GoldQuantityPercent)); for (byte goldIndex = 0; goldIndex < numberOfItemGenerate; goldIndex++) { this.goldGenerator.GenerateGoldRarityAndAmount(new MinMaxi((int)(goldAmount.Min * lootAttribute.GoldAmountPercent), (int)(goldAmount.Max * lootAttribute.GoldAmountPercent)), this.lootAttribute.GoldRarityPercent); GameObject goldItem = goldGenerator.GenerateGold(); goldItem.transform.position = position + (new Vector3(Random.insideUnitCircle.x, 0, Random.insideUnitCircle.y) * this.range); } }