Exemplo n.º 1
0
    }                                         //how much money to go from 1 to 2



// Use this for initialization
    void Start()
    {
        plotManager     = GameObject.Find("PlotManager").GetComponent <PlotManager_Script>();
        citizenManager  = GameObject.Find("CitizenManager").GetComponent <CitizenManager_Script>();
        storageBehavior = GameObject.Find("Storage").GetComponent <StorageBehavior>();

        modeCounter  = 0;
        currentMoney = 0;
        level        = 1;

        //creates the list of crops for the game to draw from
        //wanted it out of the way because it's a lot of lines
        CropsAndBuffs.GenerateCropList();
        CropsAndBuffs.GenerateBuffList();


        baseLevelUp = 80;
    }
Exemplo n.º 2
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);
    }
Exemplo n.º 3
0
    public void ApplyBuff(CropsAndBuffs.Buff buff_in)
    {
        //to remove any old buff effects
        Unbuff();

        currentBuff = buff_in;

        //creating some floating text
        //uses the buff text from the ui box, but only the first line
        string presplit = Utilities.GenerateBuffText(buff_in);
        string[] split = presplit.Split ('\n');
        Utilities.FloatText (transform.position + new Vector3(0,1,1), split[0], Utilities.TextTypes.Positive);

        if (currentBuff.buffType != Utilities.BuffTypes.None)
        {

            buffIndicator.SetActive(true);
            //currentBuff.duration = currentBuff.maxDuration;

            //increase max attribute
            if (currentBuff.buffType == Utilities.BuffTypes.AttributeScalar)
            {
                maxAttributes[currentBuff.attribute] += (int)Mathf.Floor(currentBuff.value);
                currentAttributes[currentBuff.attribute] += (int)Mathf.Floor(currentBuff.value);
            }

            if (currentBuff.buffType == Utilities.BuffTypes.AttributeLockNegative)
            {
                buffParticles.startColor = Color.red;
            }
            else
            {
                buffParticles.startColor = Color.green;
            }

            //print (currentBuff.name + " duration: " + currentBuff.duration + " value: " + currentBuff.value);
        }
        else
        {
            //print ("NO BUFF");
        }
    }
Exemplo n.º 4
0
    //+++++++Task Functions++++++//
    //xFeed
    public void Feed(float amount, CropsAndBuffs.Buff buff_in, Utilities.CropTypes cropType_in)
    {
        if (buff_in.buffType != Utilities.BuffTypes.None)
        {
            currentBuff = buff_in;
            currentBuff.duration *= Utilities.BUFFSCALE;
            buffCropType = cropType_in;
            ApplyBuff(currentBuff);

        }

        //eating provides a small boost to all stats depending on how much was recovered
        //recoveryDifference is used to make sure this bonus doesn't encroach into full recovery
        //(ie: eating when already full)
        float recoveryDifference = currentAttributes[Utilities.Attributes.Recovery];
        currentAttributes[Utilities.Attributes.Recovery] = Mathf.Min (currentAttributes[Utilities.Attributes.Recovery]+amount, 10);

        //recoveryDifference now refers to the difference between old and new
        recoveryDifference = currentAttributes[Utilities.Attributes.Recovery] - recoveryDifference;
        string floating = "+" + (Mathf.Round(recoveryDifference*10)/10).ToString() + " rec";
        Utilities.FloatText (transform.position + new Vector3(0,1,0), floating, Utilities.TextTypes.Positive);

        for (int c = (int)Utilities.Attributes.Strength; c <= (int)Utilities.Attributes.Acumen; c++)
        {
            currentAttributes[(Utilities.Attributes)c] = Mathf.Min(currentAttributes[(Utilities.Attributes)c] + recoveryDifference*Utilities.MEALBONUS, maxAttributes[(Utilities.Attributes)c]);
        }

        //change buff in ui if needed
        if (gameController.selectedCitizen == this.gameObject)
            GameObject.Find("Current_Buff_UI").GetComponent<CurrentBuffUI_Script>().SetBuff();
    }
Exemplo n.º 5
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)
    {
        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);
    }
Exemplo n.º 6
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)
    {
        itemType = itemType_in;
        cropType = crop_in;
        restoreQuality = restQuality_in;
        CropsAndBuffs.Crop newCrop = CropsAndBuffs.cropList[cropType];

        maxProductionTime = (newCrop.timeToProduce * Utilities.COOKTIMERATIO) / (Utilities.TIMESCALE);

        base.SetItem(crop_in, itemType_in, restQuality_in, buff_in);
    }