Beispiel #1
0
        private static void GetItems(string[] args)
        {
            Dictionary <string, WarpItem> dict = Utils.GetWarpItems();
            StringBuilder builder = new StringBuilder(10 * dict.Count);

            foreach (string key in dict.Keys)
            {
                WarpItem item = dict[key];
                builder.AppendLine();
                builder.Append(key).AppendLine(": ");
                builder.Append("\tDestination: ").Append(item.Destination);
                builder.Append(", IgnoreDisabled: ").Append(item.IgnoreDisabled);
                builder.Append(", Color: '").Append(item.Color).AppendLine("'");
            }
            print(builder.ToString());
        }
Beispiel #2
0
        private static bool UseItem(Farmer who, string id)
        {
            Dictionary <string, WarpItem> items = Utils.GetWarpItems();

            if (items.ContainsKey(id))
            {
                WarpItem item = items[id];
                if (item.Destination.ToLower() == "_all")
                {
                    WarpHandler.ShowWarpMenu("", item.Consume);
                    return(true);
                }
                Color color = Utils.ParseColor(item.Color);
                DoTotemWarpEffects(color, id, item.Consume, who, (f) => WarpHandler.DirectWarp(item.Destination, item.IgnoreDisabled));
                return(true);
            }
            return(false);
        }
Beispiel #3
0
        public static List <ItemInfo> Load(string filename)
        {
            List <ItemInfo> itemInfo = new List <ItemInfo>();
            TextReader      reader   = new StreamReader(filename);
            string          line     = "";

            while ((line = reader.ReadLine()) != null)
            {
                List <string> values = CSVReader.Parse(line);
                switch (values[0])
                {
                case "4":
                    Ammo ammo = Ammo.Load(values);
                    BlobsToLoad.Add(ammo.graphic.blobName);
                    itemInfo.Add(ammo);
                    break;

                case "1":
                    MultiItem multiItem = MultiItem.Load(values);
                    BlobsToLoad.Add(multiItem.graphic.blobName);
                    itemInfo.Add(multiItem);
                    break;

                case "6":
                    Projectile projectile = Projectile.Load(values);
                    BlobsToLoad.Add(projectile.iconGraphic.blobName);
                    BlobsToLoad.Add(projectile.fireGraphic.blobName);
                    BlobsToLoad.Add(projectile.projectileGraphic.blobName);
                    BlobsToLoad.Add(projectile.shadowGraphic.blobName);
                    BlobsToLoad.Add(projectile.trailGraphic.blobName);
                    BlobsToLoad.Add(projectile.explosionGraphic.blobName);
                    BlobsToLoad.Add(projectile.prefireGraphic.blobName);
                    BlobsToLoad.Add(projectile.firingSound.blobName);
                    BlobsToLoad.Add(projectile.explosionSound.blobName);
                    BlobsToLoad.Add(projectile.bounceSound.blobName);
                    BlobsToLoad.Add(projectile.prefireSound.blobName);
                    itemInfo.Add(projectile);
                    break;

                case "7":
                    VehicleMaker vehicleMaker = VehicleMaker.Load(values);
                    BlobsToLoad.Add(vehicleMaker.prefireSound.blobName);
                    BlobsToLoad.Add(vehicleMaker.prefireGraphic.blobName);
                    BlobsToLoad.Add(vehicleMaker.iconGraphic.blobName);
                    itemInfo.Add(vehicleMaker);
                    break;

                case "8":
                    MultiUse multiUse = MultiUse.Load(values);
                    BlobsToLoad.Add(multiUse.prefireGraphic.blobName);
                    BlobsToLoad.Add(multiUse.firingSound.blobName);
                    BlobsToLoad.Add(multiUse.prefireSound.blobName);
                    BlobsToLoad.Add(multiUse.iconGraphic.blobName);
                    itemInfo.Add(multiUse);
                    break;

                case "11":
                    RepairItem repair = RepairItem.Load(values);
                    BlobsToLoad.Add(repair.iconGraphic.blobName);
                    BlobsToLoad.Add(repair.prefireGraphic.blobName);
                    BlobsToLoad.Add(repair.repairGraphic.blobName);
                    BlobsToLoad.Add(repair.prefireSound.blobName);
                    BlobsToLoad.Add(repair.repairSound.blobName);
                    itemInfo.Add(repair);
                    break;

                case "15":
                    UpgradeItem upgrade = UpgradeItem.Load(values);
                    BlobsToLoad.Add(upgrade.iconGraphic.blobName);
                    itemInfo.Add(upgrade);
                    break;

                case "12":
                    ControlItem control = ControlItem.Load(values);
                    BlobsToLoad.Add(control.iconGraphic.blobName);
                    BlobsToLoad.Add(control.prefireGraphic.blobName);
                    BlobsToLoad.Add(control.effectGraphic.blobName);
                    BlobsToLoad.Add(control.prefireSound.blobName);
                    BlobsToLoad.Add(control.firingSound.blobName);
                    itemInfo.Add(control);
                    break;

                case "13":
                    UtilityItem utility = UtilityItem.Load(values);
                    BlobsToLoad.Add(utility.iconGraphic.blobName);
                    BlobsToLoad.Add(utility.activateSound.blobName);
                    itemInfo.Add(utility);
                    break;

                case "17":
                    WarpItem warp = WarpItem.Load(values);
                    BlobsToLoad.Add(warp.iconGraphic.blobName);
                    BlobsToLoad.Add(warp.prefireGraphic.blobName);
                    BlobsToLoad.Add(warp.warpGraphic.blobName);
                    BlobsToLoad.Add(warp.prefireSound.blobName);
                    BlobsToLoad.Add(warp.warpSound.blobName);
                    itemInfo.Add(warp);
                    break;

                case "16":
                    SkillItem skill = SkillItem.Load(values);
                    BlobsToLoad.Add(skill.iconGraphic.blobName);
                    itemInfo.Add(skill);
                    break;

                case "14":
                    ItemMaker item = ItemMaker.Load(values);
                    BlobsToLoad.Add(item.prefireGraphic.blobName);
                    BlobsToLoad.Add(item.prefireSound.blobName);
                    BlobsToLoad.Add(item.iconGraphic.blobName);
                    itemInfo.Add(item);
                    break;

                case "18":
                    NestedItem nested = NestedItem.Load(values);
                    FilesToLoad.Add(nested.location);
                    itemInfo.Add(nested);
                    break;

                case "default":
                    //F**k you, you idiot. use Log.write
                    //Console.WriteLine("If you see this Toriad f****d up");
                    break;
                }
            }

            return(itemInfo);
        }
Beispiel #4
0
            public static WarpItem Load(List <string> values)
            {
                WarpItem item = new WarpItem();

                item.iconGraphic    = new Graphics(ref values, 23);
                item.prefireGraphic = new Graphics(ref values, 71);
                item.warpGraphic    = new Graphics(ref values, 101);
                item.prefireSound   = new Sound(ref values, 79);
                item.warpSound      = new Sound(ref values, 109);
                ItemInfo.LoadGeneralSettings1((ItemInfo)item, values);

                item.useAmmoID                      = CSVReader.GetInt(values[31]);
                item.ammoUsedPerShot                = CSVReader.GetInt(values[32]);
                item.ammoCapacity                   = CSVReader.GetInt(values[33]);
                item.requiredItem                   = CSVReader.GetInt(values[34]);
                item.requiredItemAmount             = CSVReader.GetInt(values[35]);
                item.energyCostTerrain0             = CSVReader.GetInt(values[36]);
                item.energyCostTerrain1             = CSVReader.GetInt(values[37]);
                item.energyCostTerrain2             = CSVReader.GetInt(values[38]);
                item.energyCostTerrain3             = CSVReader.GetInt(values[39]);
                item.energyCostTerrain4             = CSVReader.GetInt(values[40]);
                item.energyCostTerrain5             = CSVReader.GetInt(values[41]);
                item.energyCostTerrain6             = CSVReader.GetInt(values[42]);
                item.energyCostTerrain7             = CSVReader.GetInt(values[43]);
                item.energyCostTerrain8             = CSVReader.GetInt(values[44]);
                item.energyCostTerrain9             = CSVReader.GetInt(values[45]);
                item.energyCostTerrain10            = CSVReader.GetInt(values[46]);
                item.energyCostTerrain11            = CSVReader.GetInt(values[47]);
                item.energyCostTerrain12            = CSVReader.GetInt(values[48]);
                item.energyCostTerrain13            = CSVReader.GetInt(values[49]);
                item.energyCostTerrain14            = CSVReader.GetInt(values[50]);
                item.energyCostTerrain15            = CSVReader.GetInt(values[51]);
                item.secondShotEnergy               = CSVReader.GetInt(values[52]);
                item.secondShotTimeout              = CSVReader.GetInt(values[53]);
                item.fireDelay                      = CSVReader.GetInt(values[54]);
                item.fireDelayOther                 = CSVReader.GetInt(values[55]);
                item.maxFireDelay                   = CSVReader.GetInt(values[56]);
                item.entryFireDelay                 = CSVReader.GetInt(values[57]);
                item.reloadDelayNormal              = CSVReader.GetInt(values[58]);
                item.reloadDelayPartial             = CSVReader.GetInt(values[59]);
                item.reloadDelayAsynchronous        = CSVReader.GetInt(values[60]);
                item.reloadDelayAsynchronousPartial = CSVReader.GetInt(values[61]);
                item.routeRange                     = CSVReader.GetInt(values[62]);
                item.routeRotationalRange           = CSVReader.GetInt(values[63]);
                item.routeFriendly                  = CSVReader.GetBool(values[65]);
                item.recoil                 = CSVReader.GetInt(values[66]);
                item.verticalRecoil         = CSVReader.GetInt(values[67]);
                item.prefireDelay           = CSVReader.GetInt(values[68]);
                item.reliability            = CSVReader.GetInt(values[69]);
                item.reliabilityFireDelay   = CSVReader.GetInt(values[70]);
                item.movementCancelsPrefire = CSVReader.GetBool(values[83]);
                item.notifyOthersOfPrefire  = CSVReader.GetBool(values[84]);
                item.cashCost               = CSVReader.GetInt(values[85]);
                item.useWhileCarryingBall   = CSVReader.GetBool(values[86]);
                item.useWhileCarryingFlag   = CSVReader.GetBool(values[87]);
                item.warpMode               = (WarpMode)CSVReader.GetInt(values[93]);
                item.warpGroup              = CSVReader.GetInt(values[94]);
                item.areaEffectRadius       = CSVReader.GetInt(values[96]);
                item.accuracyRadius         = CSVReader.GetInt(values[97]);
                item.portalTime             = CSVReader.GetInt(values[98]);
                item.allowSummonBallCarrier = CSVReader.GetInt(values[99]);
                item.allowSummonFlagCarrier = CSVReader.GetInt(values[100]);

                return(item);
            }