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); }
public static TalentBuffs GetInstance() { if (mInstance == null) { mInstance = new TalentBuffs(); } return(mInstance); }
//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; } }
public void TillField(int amount = 1) { tillProgress += (int)(amount * TalentBuffs.GetInstance().TillModPower); if (tillProgress >= tillProgressCap) { tillProgress = 0.0f; isTilled = true; ToggleButtonsTilled(); } tillProgressBar.current = tillProgress; }
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); }
//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(); } } }
public void TillModPower(TalentObject talentObj) { TalentBuffs.GetInstance().TillModPower = (int)(1 + talentObj.Rank * 0.4); }
public void StoneYield(TalentObject talentObject) { TalentBuffs.GetInstance().StoneMultiplier = talentObject.Rank; }
public void TinYield(TalentObject talentObject) { TalentBuffs.GetInstance().TinMultiplier = talentObject.Rank; }
public void CopperYield(TalentObject talentObject) { TalentBuffs.GetInstance().CopperMultiplier = talentObject.Rank; }
public void CookingModOutput(TalentObject talentObject) { TalentBuffs.GetInstance().CookingOutput = 1 + talentObject.Rank; }
public void SpeedModPower(TalentObject talentObj) { TalentBuffs.GetInstance().SetGrowthModSpeed(talentObj.Seed_Type, 1 + talentObj.Rank * 0.2f); }
public void OutputModPower(TalentObject talentObj) { TalentBuffs.GetInstance().SetSeedModOutput(talentObj.Seed_Type, 1 + talentObj.Rank * 0.2f); }
public void OvergrowthModSpeed(TalentObject talentObj) { TalentBuffs.GetInstance().OvergrowthModSpeed = 1 - talentObj.Rank * 0.05f; }