Example #1
0
 private void GenerateSchemes(DropManager dropManager, int lootLevel, Workshop lootWorkshop, Difficulty d, ConcurrentDictionary <string, ServerInventoryItem> newObjects, float remapWeight)
 {
     for (int i = 0; i < ChestUtils.NumOfSchemes(d); i++)
     {
         var moduleTemplate            = resource.ModuleTemplates.RandomModule(lootWorkshop, CommonUtils.RandomEnumValue <ShipModelSlotType>());
         var schemeDropper             = dropManager.GetSchemeDropper(lootWorkshop, lootLevel, remapWeight);
         IInventoryObject schemeObject = schemeDropper.Drop() as IInventoryObject;
         newObjects.TryAdd(schemeObject.Id, new ServerInventoryItem(schemeObject, 1));
         //log.InfoFormat("scheme of level = {0} generated", schemeObject.Level);
     }
 }
Example #2
0
 private void GenerateWeapons(DropManager dropManager, int lootLevel, Workshop lootWorkshop, Difficulty d, ConcurrentDictionary <string, ServerInventoryItem> newObjects, float remapWeight)
 {
     for (int i = 0; i < ChestUtils.NumOfWeapons(d); i++)
     {
         ObjectColor color = resource.ColorRes.GenColor(ColoredObjectType.Weapon).color;
         WeaponDropper.WeaponDropParams weaponParams = new WeaponDropper.WeaponDropParams(resource, lootLevel, lootWorkshop, WeaponDamageType.damage, Difficulty.none);
         var weaponDropper             = dropManager.GetWeaponDropper(weaponParams, remapWeight);
         IInventoryObject weaponObject = weaponDropper.Drop() as IInventoryObject;
         newObjects.TryAdd(weaponObject.Id, new ServerInventoryItem(weaponObject, 1));
         //log.InfoFormat("weapon of level = {0} generated", weaponObject.Level);
     }
 }