コード例 #1
0
    /* xSetItem
     * called by cropbehavior when slotting a new item,
     * code varies by type of station and type of crop
     * also sets buff values*/
    public virtual void SetItem(Utilities.CropTypes crop_in, Utilities.ItemTypes itemType_in, float restQuality_in, CropsAndBuffs.Buff buff_in)
    {
        timeToProduce = maxProductionTime;

        if (citizen1 != null)
        {
            citizen1Script.SetTaskAttributes(primaryEff, secondaryEff, primaryQual, secondaryQual, fatigueRate);

            Activate();
        }

        if (citizen2 != null)
        {
            citizen2Script.SetTaskAttributes(primaryEff, secondaryEff, primaryQual, secondaryQual, fatigueRate);

            Activate();
        }

        Utilities.SetCropTexture(this.gameObject.transform.GetChild(1).gameObject, crop_in);

        if (gameController.selectedTask == this.gameObject)
        {
            GameObject.Find("Current_Task_UI").GetComponent <CurrentTaskUI_Script>().SetTask();
        }
    }
コード例 #2
0
ファイル: DepotBehavior.cs プロジェクト: jonadiazz/bushburg
    /* xSetItem
     * called by cropbehavior when slotting a new item,
     * code varies by type of station and type of crop
     * also sets buff values*/
    public override void SetItem(Utilities.CropTypes crop_in, Utilities.ItemTypes itemType_in, float restQuality_in, CropsAndBuffs.Buff buff_in)
    {
        itemType       = itemType_in;
        cropType       = crop_in;
        restoreQuality = restQuality_in;
        CropsAndBuffs.Crop newCrop = CropsAndBuffs.cropList[cropType];
        maxProductionTime = newCrop.timeToProduce * Utilities.TRADETIMERATIO / (Utilities.TIMESCALE);

        base.SetItem(crop_in, itemType_in, restQuality_in, buff_in);
    }
コード例 #3
0
    /* xSetItem
     * called by cropbehavior when slotting a new item,
     * code varies by type of station and type of crop
     * also sets buff values*/
    public override void SetItem(Utilities.CropTypes crop_in, Utilities.ItemTypes itemType_in, float restQuality_in, CropsAndBuffs.Buff buff_in)
    {
        pestScript.RotateCrop();
        itemType       = itemType_in;
        cropType       = crop_in;
        restoreQuality = restQuality_in;

        CropsAndBuffs.Crop newCrop = CropsAndBuffs.cropList[cropType];

        primaryEff        = newCrop.primaryEff;
        secondaryEff      = newCrop.secondaryEff;
        primaryQual       = newCrop.primaryQual;
        secondaryQual     = newCrop.secondaryQual;
        fatigueRate       = newCrop.fatigueRate;
        maxProductionTime = newCrop.timeToProduce / Utilities.TIMESCALE;

        base.SetItem(crop_in, itemType_in, restQuality_in, buff_in);
    }
コード例 #4
0
ファイル: TableBehavior.cs プロジェクト: jonadiazz/bushburg
    /* xSetItem
     * called by cropbehavior when slotting a new item,
     * code varies by type of station and type of crop
     * also sets buff values*/
    public override void SetItem(Utilities.CropTypes crop_in, Utilities.ItemTypes itemType_in, float restQuality_in, CropsAndBuffs.Buff buff_in)
    {
        itemType       = itemType_in;
        cropType       = crop_in;
        restoreQuality = restQuality_in;
        CropsAndBuffs.Crop newCrop = CropsAndBuffs.cropList[cropType];

        if (itemType == Utilities.ItemTypes.Meal)
        {
            currentBuff = buff_in;
        }
        else
        {
            currentBuff.buffType = Utilities.BuffTypes.None;
        }

        recoveryRestore   = newCrop.baseRecovery + newCrop.baseRecovery * restoreQuality;
        maxProductionTime = Utilities.EATTIME / Utilities.TIMESCALE;

        base.SetItem(crop_in, itemType_in, restQuality_in, buff_in);
    }
コード例 #5
0
ファイル: CropBehavior.cs プロジェクト: jonadiazz/bushburg
    public void CreateCrop(Utilities.CropTypes crop_in, Utilities.ItemTypes type_in, GameObject creator_in, float restQuality_in, float buffQuality_in)
    {
        cropType = crop_in;
        itemType = type_in;
        creator  = creator_in;

        restoreQuality = restQuality_in;
        buffQuality    = buffQuality_in;

        if (itemType == Utilities.ItemTypes.Meal)
        {
            currentBuff              = CropsAndBuffs.buffList[cropType];
            currentBuff.maxDuration += currentBuff.maxDuration * restoreQuality;
            currentBuff.value       += currentBuff.value * buffQuality_in;
            currentBuff.duration     = currentBuff.maxDuration;
        }

        Utilities.SetCropTexture(this.gameObject, crop_in);

        if (itemType != Utilities.ItemTypes.Seed)
        {
            CreateIndicator();
        }
    }