コード例 #1
0
        public bool SpawnSimpleItem(string location, int x, int y, string modItemId, int quality, bool destructive = false)
        {
            Spawnpoint spawn = new Spawnpoint(location, x, y);

            if (!spawn.isClear())
            {
                if (!destructive)
                {
                    return(false);
                }
                spawn.AttemptToClear();
            }
            SimpleObject item = SimpleItemFactory.CreateItem(spawn, modItemId, quality);

            spawn.PlaceItem(item);
            return(true);
        }
コード例 #2
0
ファイル: SimpleItemFactory.cs プロジェクト: aphadeon/SDVX3
        public static SimpleObject CreateItem(Spawnpoint location, string modItemId, int quality = 0)
        {
            SimpleObject item = new SimpleObject(location.Position, modItemId);

            item.parentSheetIndex = SDVX3Mod.itemID; //make this modItemId dependant later
            item.placeholderId    = SDVX3Mod.itemID;

            item.canBeGrabbed    = true;
            item.canBeSetDown    = false;
            item.Type            = "Basic";
            item.readyForHarvest = true;
            item.category        = SimpleObject.artisanGoodsCategory;
            item.quality         = quality;
            item.displayName     = GetDisplayName(modItemId);
            item.isSpawnedObject = true;
            return(item);
        }