Exemple #1
0
        protected override void PrepareProtoCharacterMob(
            out ProtoCharacterSkeleton skeleton,
            ref double scale,
            DropItemsList lootDroplist)
        {
            skeleton = GetProtoEntity <SkeletonPsiGrove>();

            // primary loot
            lootDroplist
            .Add <ItemSlime>(count: 2, countRandom: 1)
            .Add <ItemTwigs>(count: 4, countRandom: 2)
            .Add <ItemSugar>(count: 1, countRandom: 1)
            .Add <ItemOrePragmium>(count: 1, probability: 0.3);

            // extra loot
            lootDroplist.Add(condition: SkillHunting.ServerRollExtraLoot,
                             nestedList: new DropItemsList(outputs: 1)
                             .Add <ItemSlime>(count: 1)
                             .Add <ItemTwigs>(count: 2)
                             );

            if (!IsServer)
            {
                return;
            }

            ServerCharacterDeathMechanic.CharacterKilled += ServerCharacterKilledHandler;
Exemple #2
0
        protected override void PrepareProtoCharacterMob(
            out ProtoCharacterSkeleton skeleton,
            ref double scale,
            DropItemsList lootDroplist)
        {
            skeleton = GetProtoEntity <SkeletonHoneyBadger>();

            // primary loot
            lootDroplist
            .Add <ItemMeatRaw>(count: 1)
            .Add <ItemLeather>(count: 1, countRandom: 1)
            .Add <ItemBones>(count: 1, countRandom: 1);

            // random loot
            lootDroplist.Add(probability: 1 / 2.0,
                             nestedList: new DropItemsList(outputs: 1)
                             .Add <ItemAnimalFat>(count: 1, countRandom: 1)
                             .Add <ItemBones>(count: 1, countRandom: 1));

            // extra loot
            lootDroplist.Add(condition: SkillHunting.ServerRollExtraLoot,
                             nestedList: new DropItemsList(outputs: 2)
                             .Add <ItemMeatRaw>(count: 1, weight: 1 / 2.0)
                             .Add <ItemLeather>(count: 1)
                             .Add <ItemBones>(count: 1)
                             .Add <ItemAnimalFat>(count: 1));
        }
Exemple #3
0
        protected override void PrepareProtoCharacterMob(
            out ProtoCharacterSkeleton skeleton,
            ref double scale,
            DropItemsList lootDroplist)
        {
            skeleton = GetProtoEntity <SkeletonFloater>();

            // primary loot
            lootDroplist
            .Add <ItemInsectMeatRaw>(count: 1, countRandom: 1)
            .Add <ItemSlime>(count: 10, countRandom: 10)
            .Add <ItemToxin>(count: 5, countRandom: 5)
            .Add <ItemSalt>(count: 5, countRandom: 5)
            .Add <ItemRubberRaw>(count: 8, countRandom: 4)
            .Add <ItemKeinite>(count: 2, countRandom: 2);

            // extra loot
            lootDroplist.Add(condition: SkillHunting.ServerRollExtraLoot,
                             nestedList: new DropItemsList(outputs: 2)
                             .Add <ItemInsectMeatRaw>(count: 1)
                             .Add <ItemSlime>(count: 5)
                             .Add <ItemToxin>(count: 2)
                             .Add <ItemSalt>(count: 2));

            if (!IsServer)
            {
                return;
            }

            ServerCharacterDeathMechanic.CharacterKilled += ServerCharacterKilledHandler;
 protected override void PrepareDroplistOnDestroy(DropItemsList droplist)
 {
     // primary drop
     droplist
     .Add <ItemLogs>(count: 5)
     .Add <ItemTwigs>(count: 2, countRandom: 2);
 }
        protected override void PrepareLootDroplist(DropItemsList droplist)
        {
            // common loot
            droplist.Add(
                nestedList:
                new DropItemsList(outputs: 2, outputsRandom: 0)
                // money
                .Add <ItemCoinPenny>(count: 10, countRandom: 30, weight: 1 / 1.0)
                // resources
                .Add <ItemPlanks>(count: 30, countRandom: 50, weight: 1 / 1.0)
                .Add <ItemIngotCopper>(count: 5, countRandom: 15, weight: 1 / 1.0)
                .Add <ItemIngotIron>(count: 5, countRandom: 15, weight: 1 / 1.0)
                .Add <ItemIngotSteel>(count: 5, countRandom: 10, weight: 1 / 4.0)
                .Add <ItemClay>(count: 30, countRandom: 20, weight: 1 / 4.0)
                .Add <ItemCoal>(count: 5, countRandom: 15, weight: 1 / 4.0)
                .Add <ItemOreCopper>(count: 25, countRandom: 75, weight: 1 / 10.0)
                .Add <ItemOreIron>(count: 25, countRandom: 75, weight: 1 / 10.0)
                .Add <ItemSand>(count: 50, countRandom: 100, weight: 1 / 10.0)
                .Add <ItemStone>(count: 50, countRandom: 100, weight: 1 / 10.0)
                .Add <ItemCement>(count: 2, countRandom: 8, weight: 1 / 10.0)
                // items
                .Add <ItemGlue>(count: 2, countRandom: 3, weight: 1 / 10.0)
                .Add <ItemFertilizer>(count: 2, countRandom: 3, weight: 1 / 10.0)
                .Add <ItemRubberRaw>(count: 10, countRandom: 20, weight: 1 / 10.0)
                .Add <ItemRubberVulcanized>(count: 3, countRandom: 2, weight: 1 / 10.0));

            // rare loot
            droplist.Add(
                probability: 1 / 3.0,
                nestedList:
                new DropItemsList(outputs: 1)
                // components
                .Add <ItemComponentsMechanical>(count: 5, countRandom: 5, weight: 1 / 1.0)
                .Add <ItemComponentsElectronic>(count: 5, countRandom: 5, weight: 1 / 1.0)
                .Add <ItemComponentsOptical>(count: 5, countRandom: 5, weight: 1 / 10.0)
                .Add <ItemComponentsIndustrialChemicals>(count: 5, countRandom: 5, weight: 1 / 10.0)
                // items
                .Add <ItemFirelog>(count: 2, countRandom: 3, weight: 1 / 1.0)
                .Add <ItemBatteryDisposable>(count: 2, countRandom: 3, weight: 1 / 10.0)
                .Add <ItemBombMining>(count: 2, countRandom: 3, weight: 1 / 25.0)
                // tools
                .Add <ItemAxeIron>(count: 1, weight: 1 / 25.0)
                .Add <ItemPickaxeIron>(count: 1, weight: 1 / 25.0)
                .Add <ItemToolboxT2>(count: 1, weight: 1 / 25.0)
                .Add <ItemAxeSteel>(count: 1, weight: 1 / 50.0)
                .Add <ItemPickaxeSteel>(count: 1, weight: 1 / 50.0)
                .Add <ItemToolboxT3>(count: 1, weight: 1 / 50.0)
                .Add <ItemCrowbar>(count: 1, weight: 1 / 25.0)
                // equipment
                .Add <ItemHelmetSafety>(count: 1, weight: 1 / 15.0));

            // extra loot from skill
            droplist.Add(
                condition: SkillSearching.ServerRollExtraLoot,
                nestedList:
                new DropItemsList(outputs: 1)
                .Add <ItemComponentsMechanical>(count: 1, countRandom: 1)
                .Add <ItemComponentsElectronic>(count: 1, countRandom: 1)
                .Add <ItemBatteryDisposable>(count: 1, countRandom: 1));
        }
Exemple #6
0
        protected override void PrepareLootDroplist(DropItemsList droplist)
        {
            // common loot
            droplist.Add(nestedList:
                         new DropItemsList(outputs: 1, outputsRandom: 1)
                         // money
                         .Add <ItemCoinPenny>(count: 10, countRandom: 10, probability: 1 / 5.0)
                         // resources
                         .Add <ItemPlanks>(count: 25, countRandom: 25, weight: 1 / 1.0)
                         .Add <ItemStone>(count: 25, countRandom: 25, weight: 1 / 1.0)
                         .Add <ItemTwigs>(count: 15, countRandom: 10, weight: 1 / 1.0)
                         .Add <ItemFibers>(count: 15, countRandom: 10, weight: 1 / 1.0)
                         .Add <ItemCharcoal>(count: 5, countRandom: 5, weight: 1 / 1.0)
                         .Add <ItemRot>(count: 5, countRandom: 5, weight: 1 / 1.0)
                         .Add <ItemCoal>(count: 5, countRandom: 5, weight: 1 / 5.0)
                         // misc
                         .Add <ItemGlassRaw>(count: 5, countRandom: 15, weight: 1 / 5.0)
                         .Add <ItemBottleEmpty>(count: 1, countRandom: 2, weight: 1 / 5.0)
                         .Add <ItemBottleWater>(count: 1, countRandom: 2, weight: 1 / 5.0));

            // extra loot
            droplist.Add(condition: SkillSearching.ServerRollExtraLoot,
                         nestedList:
                         new DropItemsList(outputs: 1)
                         .Add <ItemPlanks>(count: 25, countRandom: 25)
                         .Add <ItemStone>(count: 25, countRandom: 25)
                         .Add <ItemFibers>(count: 25, countRandom: 25)
                         .Add <ItemGlassRaw>(count: 10, countRandom: 10));
        }
Exemple #7
0
        protected sealed override void PrepareProtoStaticWorldObject()
        {
            base.PrepareProtoStaticWorldObject();

            this.cachedTimeToGrowTotalSeconds = this.TimeToMature.TotalSeconds;

            var droplist = new DropItemsList();

            this.PrepareDroplistOnDestroy(droplist);
            this.DroplistOnDestroy = droplist.AsReadOnly();

            var textureColumnsCount = (this.DefaultTexture as ITextureAtlasResource)?.AtlasSize.ColumnsCount
                                      ?? 1;

            this.cachedGrowthStagesCount = this.CalculateGrowthStagesCount();

            Api.Assert(
                this.cachedGrowthStagesCount <= textureColumnsCount,
                "Texture atlas for " + this + " doesn't have enough grow stages.");

            // setup growth stage duration
            this.cachedGrowthStageDurationSeconds = this.cachedGrowthStagesCount > 0
                                                        ? this.cachedTimeToGrowTotalSeconds
                                                    / this.cachedGrowthStagesCount
                                                        : 0;

            this.PrepareProtoVegetation();
        }
 protected override void PrepareProtoCharacterMob(
     out ProtoCharacterSkeleton skeleton,
     ref double scale,
     DropItemsList lootDroplist)
 {
     skeleton = GetProtoEntity <SkeletonPragmiumQueen>();
 }
Exemple #9
0
        protected override void PrepareProtoCharacterMob(
            out ProtoCharacterSkeleton skeleton,
            ref double scale,
            DropItemsList lootDroplist)
        {
            skeleton = GetProtoEntity <SkeletonScorpion>();

            // primary loot
            lootDroplist
            .Add <ItemInsectMeatRaw>(count: 1, countRandom: 1)
            .Add <ItemAnimalFat>(count: 3, countRandom: 2)
            .Add <ItemToxin>(count: 2, countRandom: 2)
            .Add <ItemSlime>(count: 2, countRandom: 2)
            // requires device
            .Add <ItemKeiniteRaw>(count: 2,
                                  countRandom: 1,
                                  condition: ItemKeiniteCollector.ConditionHasDeviceEquipped);

            // extra loot
            lootDroplist.Add(condition: SkillHunting.ServerRollExtraLoot,
                             nestedList: new DropItemsList(outputs: 2)
                             .Add <ItemInsectMeatRaw>(count: 1, countRandom: 1)
                             .Add <ItemAnimalFat>(count: 1, countRandom: 1)
                             .Add <ItemToxin>(count: 1, countRandom: 1)
                             .Add <ItemSlime>(count: 1, countRandom: 1));
        }
        private IItem ServerRemote_ClientUseItem(IItem item)
        {
            var character = ServerRemoteContext.Character;

            this.ServerValidateItemForRemoteCall(item, character);

            var protoDataLog = this.ServerGetDataLogProtoToSpawn();

            if (protoDataLog == null)
            {
                throw new Exception(
                          $"Prototype for data log is not returned by {nameof(this.ServerGetDataLogProtoToSpawn)}() method");
            }

            Logger.Important($"{character} has used data log {item} and received {protoDataLog}");

            var slotId    = item.ContainerSlotId;
            var container = item.Container;

            Server.Items.SetCount(item, item.Count - 1);

            CreateItemResult result;

            if (item.IsDestroyed)
            {
                // try to spawn right there
                result = Server.Items.CreateItem(protoDataLog, container, slotId: slotId);
            }
            else
            {
                // try to spawn simply in player
                var tempDropItemsList = new DropItemsList().Add(protoDataLog).AsReadOnly();
                result = ServerDroplistHelper.TryDropToCharacter(
                    tempDropItemsList,
                    character,
                    sendNoFreeSpaceNotification: true,
                    probabilityMultiplier: 1,
                    context: new DropItemContext(character, null));
            }

            if (!result.IsEverythingCreated)
            {
                // rollback, try spawn data log back
                if (item.IsDestroyed)
                {
                    // this item was destroyed - need to spawn it back
                    Server.Items.CreateItem(this, container, slotId: slotId);
                }
                else
                {
                    // this item was not destroyed - restore count
                    Server.Items.SetCount(item, item.Count + 1);
                }

                return(null);
            }

            return(result.ItemAmounts.FirstOrDefault().Key);
        }
 protected override void PrepareProtoCharacterMob(
     out ProtoCharacterSkeleton skeleton,
     ref double scale,
     DropItemsList lootDroplist)
 {
     base.PrepareProtoCharacterMob(out skeleton, ref scale, lootDroplist);
     lootDroplist.Clear();
 }
Exemple #12
0
        protected override void PrepareDroplistOnDestroy(DropItemsList droplist)
        {
            // primary drop
            droplist.Add <ItemLogs>(count: 3);

            // bonus drop
            droplist.Add <ItemTwigs>(count: 1, countRandom: 2, probability: 0.5);
        }
Exemple #13
0
        protected override void PrepareProtoStaticWorldObject()
        {
            base.PrepareProtoStaticWorldObject();

            var droplist = new DropItemsList();
            this.PrepareLootDroplist(droplist);
            this.LootDroplist = droplist.AsReadOnly();
        }
 protected override void PrepareGatheringDroplist(DropItemsList droplist)
 {
     droplist
     .Add <ItemCoffeeBerries>(count: 3)
     .Add <ItemCoffeeBerries>(count: 2,
                              probability: 1 / 5.0,
                              condition: SkillForaging.ConditionAdditionalYield);
 }
Exemple #15
0
 protected override void PrepareGatheringDroplist(DropItemsList droplist)
 {
     droplist
     .Add <ItemMushroomPink>(count: 1)
     .Add <ItemMushroomPink>(count: 1,
                             probability: 1 / 5.0,
                             condition: SkillForaging.ConditionAdditionalYield);
 }
Exemple #16
0
        protected override void PrepareGatheringDroplist(DropItemsList droplist)
        {
            droplist.Add <ItemFlowerOni>(count: 1);

            // additional yield
            droplist.Add <ItemFlowerOni>(count: 1, condition: ItemFertilizer.ConditionExtraYield);
            droplist.Add <ItemFlowerOni>(count: 1, condition: SkillFarming.ConditionExtraYield, probability: 0.05f);
        }
Exemple #17
0
        protected sealed override void PrepareProtoCharacter()
        {
            base.PrepareProtoCharacter();
            var lootDroplist = new DropItemsList();

            this.protoSkeletonScale = 1.0;
            this.PrepareProtoCharacterMob(out this.protoSkeleton, ref this.protoSkeletonScale, lootDroplist);
            this.LootDroplist = lootDroplist.AsReadOnly();
        }
Exemple #18
0
        protected override void PrepareLootDroplist(DropItemsList droplist)
        {
            // common loot
            droplist.Add(nestedList: new DropItemsList(outputs: 2, outputsRandom: 0)
                         //resources, components
                         .Add <ItemBlackpowder>(count: 20, countRandom: 10, weight: 1 / 1.0)
                         .Add <ItemNitrocellulosePowder>(count: 20, countRandom: 10, weight: 1 / 1.0)
                         .Add <ItemComponentsWeapon>(count: 2, countRandom: 2, weight: 1 / 20.0)
                         // ammo
                         .Add <ItemAmmo8mmStandard>(count: 5, countRandom: 5, weight: 1 / 1.0)
                         .Add <ItemAmmo8mmToxic>(count: 5, countRandom: 5, weight: 1 / 5.0)
                         .Add <ItemAmmo10mmStandard>(count: 5, countRandom: 5, weight: 1 / 1.0)
                         .Add <ItemAmmo10mmHollowPoint>(count: 5, countRandom: 5, weight: 1 / 5.0)
                         .Add <ItemAmmo10mmArmorPiercing>(count: 5, countRandom: 5, weight: 1 / 5.0)
                         .Add <ItemAmmo10mmBlank>(count: 5, countRandom: 5, weight: 1 / 15.0)
                         .Add <ItemAmmo12gaSlugs>(count: 5, countRandom: 5, weight: 1 / 2.0)
                         .Add <ItemAmmo12gaPellets>(count: 5, countRandom: 5, weight: 1 / 2.0)
                         .Add <ItemAmmo12gaBuckshot>(count: 5, countRandom: 5, weight: 1 / 2.0)
                         .Add <ItemAmmo12gaSaltCharge>(count: 5, countRandom: 5, weight: 1 / 15.0)
                         .Add <ItemAmmo300ArmorPiercing>(count: 3, countRandom: 2, weight: 1 / 15.0)
                         .Add <ItemAmmo300Incendiary>(count: 3, countRandom: 2, weight: 1 / 15.0));

            // rare loot
            droplist.Add(probability: 1 / 25.0,
                         nestedList: new DropItemsList(outputs: 1)
                         // weapons
                         .Add <ItemKnifeIron>(weight: 1 / 1.0)
                         .Add <ItemRevolver8mm>(weight: 1 / 1.0)
                         .Add <ItemLuger>(weight: 1 / 1.0)
                         .Add <ItemMachinePistol>(weight: 1 / 5.0)
                         .Add <ItemHandgun10mm>(weight: 1 / 5.0)
                         .Add <ItemShotgunDoublebarreled>(weight: 1 / 4.0)
                         .Add <ItemSubmachinegun10mm>(weight: 1 / 10.0)
                         .Add <ItemShotgunMilitary>(weight: 1 / 10.0)
                         // equipment
                         .Add <ItemMilitaryHelmet>(weight: 1 / 10.0)
                         .Add <ItemMilitaryJacket>(weight: 1 / 10.0)
                         .Add <ItemMilitaryPants>(weight: 1 / 10.0)
                         .Add <ItemAssaultHelmet>(weight: 1 / 20.0)
                         .Add <ItemAssaultJacket>(weight: 1 / 20.0)
                         .Add <ItemAssaultPants>(weight: 1 / 20.0)
                         // misc stuff for soldiers use :)
                         .Add <ItemCigarNormal>(count: 3, countRandom: 2, weight: 1 / 5.0)
                         .Add <ItemCigarPremium>(count: 3, countRandom: 2, weight: 1 / 10.0)
                         .Add <ItemStrengthBoostSmall>(count: 3, countRandom: 2, weight: 1 / 5.0)
                         .Add <ItemStrengthBoostBig>(count: 3, countRandom: 2, weight: 1 / 10.0));

            // extra loot from skill
            droplist.Add(condition: SkillSearching.ServerRollExtraLoot,
                         nestedList: new DropItemsList(outputs: 1)
                         .Add <ItemAmmo8mmStandard>(count: 1, countRandom: 2)
                         .Add <ItemAmmo10mmStandard>(count: 1, countRandom: 2)
                         .Add <ItemAmmo10mmHollowPoint>(count: 1, countRandom: 2)
                         .Add <ItemAmmo10mmArmorPiercing>(count: 1, countRandom: 2)
                         .Add <ItemAmmo12gaSlugs>(count: 1, countRandom: 2)
                         .Add <ItemAmmo12gaPellets>(count: 1, countRandom: 2));
        }
Exemple #19
0
        protected sealed override void PrepareProtoVegetation()
        {
            var gatherDroplist = new DropItemsList();

            this.PrepareGatheringDroplist(gatherDroplist);
            this.GatherDroplist = gatherDroplist.AsReadOnly();

            this.PrepareProtoGatherableVegetation();
        }
        protected override void PrepareDroplistOnDestroy(DropItemsList droplist)
        {
            // primary drop
            droplist.Add <ItemLogs>(count: 4);

            // bonus drop
            droplist.Add <ItemTreebark>(count: 1, countRandom: 1, probability: 0.25);
            droplist.Add <ItemLeaf>(count: 2, countRandom: 1, probability: 0.25);
        }
        protected override void PrepareLootDroplist(DropItemsList droplist)
        {
            DropItemConditionDelegate T3Specialized = ServerTechTimeGateHelper.IsAvailableT3Specialized;
            DropItemConditionDelegate T4Specialized = ServerTechTimeGateHelper.IsAvailableT4Specialized;
            DropItemConditionDelegate T5Specialized = ServerTechTimeGateHelper.IsAvailableT5Specialized;

            // common loot
            droplist.Add(
                nestedList:
                new DropItemsList(outputs: 1, outputsRandom: 1)
                // resources
                .Add <ItemToxin>(count: 5, countRandom: 5, weight: 1)
                .Add <ItemAcidSulfuric>(count: 3, countRandom: 2, weight: 1)
                .Add <ItemAcidNitric>(count: 3, countRandom: 2, weight: 1)
                .Add <ItemAramidFiber>(count: 5, countRandom: 5, weight: 1 / 2.0)
                .Add <ItemPlastic>(count: 3, countRandom: 2, weight: 1)
                .Add <ItemIngotLithium>(count: 2, countRandom: 3, weight: 1 / 2.0)
                .Add <ItemOreLithium>(count: 10, countRandom: 10, weight: 1 / 2.0));

            // rare loot
            droplist.Add(
                nestedList:
                new DropItemsList(outputs: 1)
                // components
                .Add <ItemComponentsMechanical>(count: 10, countRandom: 20, weight: 1)
                .Add <ItemComponentsElectronic>(count: 5, countRandom: 10, weight: 1)
                .Add <ItemComponentsOptical>(count: 5, countRandom: 10, weight: 1 / 5.0)
                .Add <ItemComponentsHighTech>(count: 2, countRandom: 3, weight: 1 / 10.0)
                // items
                .Add <ItemBatteryDisposable>(count: 1, countRandom: 2, weight: 1)
                .Add <ItemBatteryHeavyDuty>(count: 1, countRandom: 2, weight: 1 / 10.0)
                .Add <ItemPowerCell>(count: 1, countRandom: 1, weight: 1 / 10.0)
                // equipment
                .Add <ItemHelmetRespirator>(count: 1, weight: 1 / 25.0)
                // drones
                .Add <ItemDroneIndustrialStandard>(count: 1, weight: 1 / 20.0, condition: T3Specialized)
                .Add <ItemDroneControlStandard>(count: 1, weight: 1 / 30.0, condition: T3Specialized)
                .Add <ItemDroneIndustrialAdvanced>(count: 1, weight: 1 / 30.0, condition: T4Specialized)
                .Add <ItemDroneControlAdvanced>(count: 1, weight: 1 / 50.0, condition: T4Specialized)
                // devices
                .Add <ItemPowerBankStandard>(count: 1, weight: 1 / 50.0)
                .Add <ItemPowerBankLarge>(count: 1, weight: 1 / 100.0)
                // misc
                .Add <ItemTeleportLocationData>(count: 1, weight: 1 / 10.0)
                );

            // extra loot from skill
            droplist.Add(
                condition: SkillSearching.ServerRollExtraLoot,
                nestedList:
                new DropItemsList(outputs: 1)
                .Add <ItemComponentsMechanical>(count: 2, countRandom: 4)
                .Add <ItemComponentsElectronic>(count: 1, countRandom: 2)
                .Add <ItemBatteryDisposable>(count: 1, countRandom: 1));
        }
Exemple #22
0
        protected override void PrepareProtoCharacterMob(
            out ProtoCharacterSkeleton skeleton,
            ref double scale,
            DropItemsList lootDroplist)
        {
            skeleton = GetProtoEntity <SkeletonSnakeBrown>();

            // primary loot
            lootDroplist
            .Add <ItemToxin>(count: 1, countRandom: 1);
        }
Exemple #23
0
        protected override void PrepareGatheringDroplist(DropItemsList droplist)
        {
            droplist.Add <ItemWheatGrains>(count: 25, countRandom: 5);

            // additional yield
            droplist.Add <ItemWheatGrains>(count: 10, countRandom: 5, condition: ItemFertilizer.ConditionExtraYield);
            droplist.Add <ItemWheatGrains>(count: 10,
                                           countRandom: 5,
                                           condition: SkillFarming.ConditionExtraYield,
                                           probability: 0.05f);
        }
Exemple #24
0
        protected sealed override void PrepareProtoItemWithFreshness()
        {
            base.PrepareProtoItemWithFreshness();

            var dropItemsList  = new DropItemsList();
            var baitWeightList = new FishingBaitWeightList();

            this.PrepareProtoItemFish(baitWeightList, dropItemsList);
            this.DropItemsList  = dropItemsList.AsReadOnly();
            this.BaitWeightList = baitWeightList.ToReadOnly();
        }
Exemple #25
0
        private static IReadOnlyDropItemsList ServerGetDroplistForFish(IProtoItemFish protoItemFish)
        {
            if (ServerCachedDroplists.TryGetValue(protoItemFish, out var droplist))
            {
                return(droplist);
            }

            droplist = new DropItemsList().Add(protoItemFish);
            ServerCachedDroplists[protoItemFish] = droplist;
            return(droplist);
        }
 protected override void PrepareLootDroplist(DropItemsList droplist)
 {
     // common loot
     droplist.Add(nestedList:
                  new DropItemsList(outputs: 1)
                  // resources
                  .Add <ItemOreCopper>(count: 20, countRandom: 5)
                  .Add <ItemOreIron>(count: 20, countRandom: 5)
                  .Add <ItemSulfurPowder>(count: 20, countRandom: 5)
                  .Add <ItemPotassiumNitrate>(count: 20, countRandom: 5));
 }
Exemple #27
0
        private static IReadOnlyDropItemsList ServerGetDroplistFor(IProtoItemAmmo protoAmmo)
        {
            if (ServerCachedDroplists.TryGetValue(protoAmmo, out var droplist))
            {
                return(droplist);
            }

            droplist = new DropItemsList().Add(protoAmmo);
            ServerCachedDroplists[protoAmmo] = droplist;
            return(droplist);
        }
Exemple #28
0
        protected override void PrepareGatheringDroplist(DropItemsList droplist)
        {
            droplist
            .Add <ItemSugar>(count: 2, countRandom: 1)
            .Add <ItemFibers>(count: 3, countRandom: 2);

            // skill bonus
            droplist
            .Add <ItemSugar>(count: 1, probability: 1 / 5.0, condition: SkillForaging.ConditionAdditionalYield)
            .Add <ItemFibers>(count: 1, condition: SkillForaging.ConditionAdditionalYield);
        }
        protected override void PrepareDroplistOnDestroy(DropItemsList droplist)
        {
            // primary drop
            droplist.Add <ItemLogs>(count: 4);

            // saplings
            droplist.Add <ItemSaplingBirch>(count: 1, probability: 0.2);

            // bonus drop
            droplist.Add <ItemTwigs>(count: 1, countRandom: 2, probability: 0.25);
            droplist.Add <ItemLeaf>(count: 2, countRandom: 3, probability: 0.5);
        }
        protected override void PrepareDroplistOnDestroy(DropItemsList droplist)
        {
            // primary drop
            droplist.Add <ItemLogs>(count: 4);

            // saplings
            droplist.Add <ItemSaplingPineBoreal>(count: 1, probability: 0.15);

            // bonus drop
            droplist.Add <ItemTwigs>(count: 1, countRandom: 2, probability: 0.25);
            droplist.Add <ItemTreebark>(count: 1, countRandom: 1, probability: 0.25);
        }