コード例 #1
0
        public void AfterItemTypesDefined()
        {
            StringBuilder sb = new StringBuilder();

            APILogger.LogToFile("-------------------Roaming Job Objective Loaded----------------------");
            var i = 0;

            foreach (var s in LoadedAssembalies)
            {
                if (Activator.CreateInstance(s) is IRoamingJobObjective roamingJobObjective &&
                    !string.IsNullOrEmpty(roamingJobObjective.ItemIndex))
                {
                    sb.Append($"{roamingJobObjective.ItemIndex}, ");
                    RoamingJobManager.RegisterObjectiveType(roamingJobObjective);
                    i++;

                    if (i > 5)
                    {
                        i = 0;
                        sb.AppendLine();
                    }
                }
            }

            APILogger.LogToFile(sb.ToString());
            APILogger.LogToFile("---------------------------------------------------------");
        }
コード例 #2
0
        public void AfterItemTypesDefined()
        {
            StringBuilder sb = new StringBuilder();

            PandaLogger.Log(ChatColor.lime, "-------------------Roaming Job Objective Loaded----------------------");
            var i = 0;

            foreach (var s in LoadedAssembalies)
            {
                if (Activator.CreateInstance(s) is IRoamingJobObjective roamingJobObjective &&
                    !string.IsNullOrEmpty(roamingJobObjective.name))
                {
                    sb.Append($"{roamingJobObjective.name}, ");
                    RoamingJobManager.RegisterObjectiveType(roamingJobObjective);
                    i++;

                    if (i > 5)
                    {
                        sb.Append("</color>");
                        i = 0;
                        sb.AppendLine();
                        sb.Append("<color=lime>");
                    }
                }
            }

            PandaLogger.Log(ChatColor.lime, sb.ToString());
            PandaLogger.Log(ChatColor.lime, "---------------------------------------------------------");
        }
コード例 #3
0
ファイル: Turret.cs プロジェクト: JBurlison/Pandaros.Settlers
        public static void RegisterTurret()
        {
            var rivets      = new InventoryItem(ColonyBuiltIn.ItemTypes.IRONRIVET.Name, 6);
            var iron        = new InventoryItem(ColonyBuiltIn.ItemTypes.IRONWROUGHT.Name, 2);
            var copperParts = new InventoryItem(ColonyBuiltIn.ItemTypes.COPPERPARTS.Name, 6);
            var copperNails = new InventoryItem(ColonyBuiltIn.ItemTypes.COPPERNAILS.Name, 6);
            var tools       = new InventoryItem(ColonyBuiltIn.ItemTypes.COPPERTOOLS.Name, 1);
            var planks      = new InventoryItem(ColonyBuiltIn.ItemTypes.PLANKS.Name, 2);
            var stone       = new InventoryItem(ColonyBuiltIn.ItemTypes.STONEBRICKS.Name, 4);
            var bronze      = new InventoryItem(ColonyBuiltIn.ItemTypes.BRONZEPLATE.Name, 2);
            var bronzeIngot = new InventoryItem(ColonyBuiltIn.ItemTypes.BRONZEINGOT.Name, 3);
            var steelParts  = new InventoryItem(ColonyBuiltIn.ItemTypes.STEELPARTS.Name, 6);
            var steelIngot  = new InventoryItem(ColonyBuiltIn.ItemTypes.STEELINGOT.Name, 2);

            var stoneAmmo = new InventoryItem(ColonyBuiltIn.ItemTypes.SLINGBULLET.Name, 10);
            var sling     = new InventoryItem(ColonyBuiltIn.ItemTypes.SLING.Name, 2);

            var arrow = new InventoryItem(ColonyBuiltIn.ItemTypes.BRONZEARROW.Name, 10);
            var bow   = new InventoryItem(ColonyBuiltIn.ItemTypes.BOW.Name, 2);

            var bolt     = new InventoryItem(ColonyBuiltIn.ItemTypes.CROSSBOWBOLT.Name, 10);
            var crossbow = new InventoryItem(ColonyBuiltIn.ItemTypes.CROSSBOW.Name, 2);

            var bullet    = new InventoryItem(ColonyBuiltIn.ItemTypes.LEADBULLET.Name, 10);
            var gunpowder = new InventoryItem(ColonyBuiltIn.ItemTypes.GUNPOWDERPOUCH.Name, 3);
            var matchlock = new InventoryItem(ColonyBuiltIn.ItemTypes.MATCHLOCKGUN.Name, 2);

            AddStoneTurretSettings();
            AddBronzeArrowTurretSettings();
            AddCrossBowTurretSettings();
            AddMatchlockTurretSettings();

            var stonerecipe = new Recipe(STONE_NAMESPACE,
                                         new List <InventoryItem>
            {
                planks,
                copperParts,
                copperNails,
                tools,
                stone,
                sling,
                stoneAmmo
            },
                                         new RecipeResult(TurretSettings[STONE_NAMESPACE].TurretItem.ItemIndex),
                                         5);

            ServerManager.RecipeStorage.AddLimitTypeRecipe(AdvancedCrafterRegister.JOB_NAME, stonerecipe);

            var bronzeArrowrecipe = new Recipe(BRONZEARROW_NAMESPACE,
                                               new List <InventoryItem>
            {
                planks,
                bronze,
                bronzeIngot,
                copperNails,
                tools,
                stone,
                arrow,
                bow
            },
                                               new RecipeResult(TurretSettings[BRONZEARROW_NAMESPACE].TurretItem.ItemIndex),
                                               5);

            ServerManager.RecipeStorage.AddLimitTypeRecipe(AdvancedCrafterRegister.JOB_NAME, bronzeArrowrecipe);

            var crossbowrecipe = new Recipe(CROSSBOW_NAMESPACE,
                                            new List <InventoryItem>
            {
                planks,
                iron,
                rivets,
                copperNails,
                tools,
                stone,
                bolt,
                crossbow
            },
                                            new RecipeResult(TurretSettings[CROSSBOW_NAMESPACE].TurretItem.ItemIndex),
                                            5);

            ServerManager.RecipeStorage.AddLimitTypeRecipe(AdvancedCrafterRegister.JOB_NAME, crossbowrecipe);

            var matchlockrecipe = new Recipe(MATCHLOCK_NAMESPACE,
                                             new List <InventoryItem>
            {
                planks,
                steelParts,
                steelIngot,
                copperNails,
                tools,
                stone,
                bullet,
                gunpowder,
                matchlock
            },
                                             new RecipeResult(TurretSettings[MATCHLOCK_NAMESPACE].TurretItem.ItemIndex),
                                             5);

            ServerManager.RecipeStorage.AddLimitTypeRecipe(AdvancedCrafterRegister.JOB_NAME, matchlockrecipe);

            foreach (var turret in TurretSettings)
            {
                RoamingJobManager.RegisterObjectiveType(new TurretRegister(turret.Value));
            }
        }