Пример #1
0
 private void setUpItemPrerequisiteIfNull()
 {
     if (this.itemPrerequisite == null)
     {
         this.itemPrerequisite = new TaskPrerequisites.ItemPrerequisite(null, 0);
     }
 }
Пример #2
0
        public TaskMetaData(string Name, LocationPrerequisite LocationPrereque, StaminaPrerequisite StaminaPrerequisite = null, ToolPrerequisite ToolPrerequisite = null, InventoryFullPrerequisite InventoryFull = null, BedTimePrerequisite bedTimePrereq = null, ItemPrerequisite ItemPrereque = null)
        {
            this.name = Name;
            this.staminaPrerequisite   = StaminaPrerequisite;
            this.toolPrerequisite      = ToolPrerequisite;
            this.inventoryPrerequisite = InventoryFull;
            this.pathsToTake           = new List <List <TileNode> >();
            this.bedTimePrerequisite   = bedTimePrereq;

            this.itemPrerequisite     = ItemPrereque;
            this.locationPrerequisite = LocationPrereque;
            //Make sure to set values correctly incase of null
            setUpLocationPrerequsiteIfNull();
            setUpStaminaPrerequisiteIfNull();
            setUpToolPrerequisiteIfNull();
            setUpInventoryPrerequisiteIfNull();
            setUpBedTimeIfNull();
            setUpItemPrerequisiteIfNull();
            this.prerequisitesList = new List <TaskPrerequisites.GenericPrerequisite>();
            this.prerequisitesList.Add(this.staminaPrerequisite);
            this.prerequisitesList.Add(this.toolPrerequisite);
            this.prerequisitesList.Add(this.inventoryPrerequisite);
            this.prerequisitesList.Add(this.bedTimePrerequisite);
            this.prerequisitesList.Add(this.itemPrerequisite);
        }
Пример #3
0
        public static void shipItem(string s, string[] args)
        {
            if (args.Length < 2)
            {
                ModCore.CoreMonitor.Log("NOT ENOUGH PARAMETERS. NEED 2 ARGS. ItemIndex,Amount");
                return;
            }
            StardewValley.Object ok = new StardewValley.Object(Convert.ToInt32(args[0]), Convert.ToInt32(args[1]));

            if (ok == null)
            {
                ModCore.CoreMonitor.Log("ITEM IS NULL????");
                return;
            }
            ExecutionCore.TaskPrerequisites.ItemPrerequisite pre = new ExecutionCore.TaskPrerequisites.ItemPrerequisite(ok, ok.stack);
            if (pre.doesPlayerHaveEnoughOfMe())
            {
                ShippingLogic.goToShippingBinShipItem(ok);
            }
            else
            {
                ModCore.CoreMonitor.Log("Player does not have: " + ok.name + ": amount: " + ok.stack.ToString());
            }
        }