MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / feedMill

Method feedMill

code/main/LollipopFarm.ts:304–318  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

302 }
303
304 private feedMill(): void{
305 if(this.getGame().getLollipops().getCurrent() >= this.getNumberOfLollipopsToFeedTheMill()){
306 // Pay the lollipops
307 this.getGame().getLollipops().add(-this.getNumberOfLollipopsToFeedTheMill());
308
309 // Increase the candies production step
310 var oldCurrent: number = Saving.loadNumber("lollipopFarmCurrentCandiesProduction");
311 Saving.saveNumber("lollipopFarmCurrentCandiesProduction", Saving.loadNumber("lollipopFarmCurrentCandiesProduction") + Saving.loadNumber("lollipopFarmPreviousCandiesProduction"));
312 Saving.saveNumber("lollipopFarmPreviousCandiesProduction", oldCurrent);
313
314 // Update
315 this.update();
316 this.getGame().updatePlace();
317 }
318 }
319
320 private getNumberOfLollipopsToFeedTheMill(): number{
321 return Math.pow(Saving.loadNumber("lollipopFarmCurrentCandiesProduction") * 120, 2);

Callers

nothing calls this directly

Calls 7

updateMethod · 0.95
getCurrentMethod · 0.80
updatePlaceMethod · 0.80
addMethod · 0.65
getLollipopsMethod · 0.45
getGameMethod · 0.45

Tested by

no test coverage detected