コード例 #1
0
 public override void UpdateWorker()
 {
     Debug.Log(mMaxTime);
     cwei.workerPower  = (int)(mCount * mPower * TalentBuffs.GetInstance().CookingOutput);
     cwei.mSeedsToUse  = amountOfSeedsToUse;
     cwei.mWorkerCount = mCount;
     EventController.getInstance().FireEvent(cwei);
 }
コード例 #2
0
 public static TalentBuffs GetInstance()
 {
     if (mInstance == null)
     {
         mInstance = new TalentBuffs();
     }
     return(mInstance);
 }
コード例 #3
0
    //Mining by hand
    public void Mine(string resource_name)
    {
        switch (resource_name)
        {
        case "Stone":
            StoneProgress += 1 + TalentBuffs.GetInstance().StoneMultiplier;
            if (StoneProgress > StoneProgressCap)
            {
                StoneProgress = 0;
                GetReward(resource_name);
            }
            StoneProgressBar.current = StoneProgress;
            break;

        case "Copper Ore":
            CopperProgress += 1 + TalentBuffs.GetInstance().CopperMultiplier;
            if (CopperProgress > CopperProgressCap)
            {
                CopperProgress = 0;
                GetReward(resource_name);
            }
            CopperProgressBar.current = CopperProgress;
            break;

        case "Tin Ore":
            TinProgress += 1 + TalentBuffs.GetInstance().TinMultiplier;
            if (TinProgress > TinProgressCap)
            {
                TinProgress = 0;
                GetReward(resource_name);
            }
            TinProgressBar.current = TinProgress;
            break;

        case "Coal":
            CoalProgress += 1 + TalentBuffs.GetInstance().CoalMultiplier;
            if (CoalProgress > CoalProgressCap)
            {
                CoalProgress = 0;
                GetReward(resource_name);
            }
            CoalProgressBar.current = CoalProgress;
            break;

        case "Iron Ore":
            IronProgress += 1 + TalentBuffs.GetInstance().IronMultiplier;
            if (IronProgress > IronProgressCap)
            {
                IronProgress = 0;
                GetReward(resource_name);
            }
            IronProgressBar.current = IronProgress;
            break;

        default:
            break;
        }
    }
コード例 #4
0
    public void TillField(int amount = 1)
    {
        tillProgress += (int)(amount * TalentBuffs.GetInstance().TillModPower);

        if (tillProgress >= tillProgressCap)
        {
            tillProgress = 0.0f;
            isTilled     = true;
            ToggleButtonsTilled();
        }
        tillProgressBar.current = tillProgress;
    }
コード例 #5
0
    public void HarvestCrops()
    {
        //Determining our harvest and updating farmingcontrollers seed count
        int tempYield = (int)(mSeed.mHarvestYield * TalentBuffs.GetInstance().GetSeedModOutput(mSeed.mType));

        switch (mSeed.mType)
        {
        case SEED_TYPE.Corn:
            FarmingController.GetInstance().mFarmingSeeds["Corn"].modifyCountCond(tempYield, 0);
            break;

        case SEED_TYPE.Wheat:
            FarmingController.GetInstance().mFarmingSeeds["Wheat"].modifyCountCond(tempYield, 0);
            break;

        case SEED_TYPE.Potato:
            FarmingController.GetInstance().mFarmingSeeds["Potato"].modifyCountCond(tempYield, 0);
            break;

        case SEED_TYPE.Hops:
            FarmingController.GetInstance().mFarmingSeeds["Hops"].modifyCountCond(tempYield, 0);
            break;
        }


        //Resetting the plot
        mSeed.mType       = SEED_TYPE.None;
        overGrownProgress = 0.0f;
        gameObject.GetComponent <Image>().sprite = null;
        isTilled = false;
        ToggleButtonsHarvested();


        //Sending notification to farmcontroller that we need an update
        FarmingController.GetInstance().totalSeededPlots--;
        FarmingController.GetInstance().UpdateMeDaddy();
        FarmingController.GetInstance().farmingDetailScript.ClearPlot(ID);
    }
コード例 #6
0
    //private void Update()
    //{
    //	UpdateFieldStatus();

    //}
    public void UpdateFieldStatus()
    {
        if (mSeed.mType != SEED_TYPE.None)
        {
            //Checking to see if our field is overgrown. If not, the seeds will continue to grow
            if (overGrownProgress < overGrownCap)
            {
                //Plot specific
                overGrownProgress            += Time.deltaTime * TalentBuffs.GetInstance().OvergrowthModSpeed;
                overgrowthProgressBar.current = overGrownProgress;
                //Seed specific
                mSeed.mHarvestTime        += Time.deltaTime * TalentBuffs.GetInstance().GetGrowthModSpeed(mSeed.mType);
                harvestProgressBar.current = mSeed.mHarvestTime;
            }



            if (mSeed.mHarvestTime >= mSeed.mHarvestTimeCap)
            {
                HarvestCrops();
            }
        }
    }
コード例 #7
0
 public void TillModPower(TalentObject talentObj)
 {
     TalentBuffs.GetInstance().TillModPower = (int)(1 + talentObj.Rank * 0.4);
 }
コード例 #8
0
 public void StoneYield(TalentObject talentObject)
 {
     TalentBuffs.GetInstance().StoneMultiplier = talentObject.Rank;
 }
コード例 #9
0
 public void TinYield(TalentObject talentObject)
 {
     TalentBuffs.GetInstance().TinMultiplier = talentObject.Rank;
 }
コード例 #10
0
 public void CopperYield(TalentObject talentObject)
 {
     TalentBuffs.GetInstance().CopperMultiplier = talentObject.Rank;
 }
コード例 #11
0
 public void CookingModOutput(TalentObject talentObject)
 {
     TalentBuffs.GetInstance().CookingOutput = 1 + talentObject.Rank;
 }
コード例 #12
0
 public void SpeedModPower(TalentObject talentObj)
 {
     TalentBuffs.GetInstance().SetGrowthModSpeed(talentObj.Seed_Type, 1 + talentObj.Rank * 0.2f);
 }
コード例 #13
0
 public void OutputModPower(TalentObject talentObj)
 {
     TalentBuffs.GetInstance().SetSeedModOutput(talentObj.Seed_Type, 1 + talentObj.Rank * 0.2f);
 }
コード例 #14
0
 public void OvergrowthModSpeed(TalentObject talentObj)
 {
     TalentBuffs.GetInstance().OvergrowthModSpeed = 1 - talentObj.Rank * 0.05f;
 }