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

Method throwLollipops

code/main/WishingWell.ts:327–342  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

325 }
326
327 private throwLollipops(): void{
328 // If we have enough lollipops
329 if(this.getGame().getLollipops().getCurrent() >= Saving.loadNumber("wishingWellCurrentLollipopWishPrice")){
330 // Pay the price
331 this.getGame().getLollipops().add(-Saving.loadNumber("wishingWellCurrentLollipopWishPrice"));
332 // Add the same amount of candies
333 this.getGame().getCandies().add(Math.ceil(Saving.loadNumber("wishingWellCurrentLollipopWishPrice")/2));
334 // Set the speech
335 this.currentSpeech = "wishingWellThrewLollipopsSpeech";
336 // Set the next price
337 Saving.saveNumber("wishingWellCurrentLollipopWishPrice", Saving.loadNumber("wishingWellCurrentLollipopWishPrice")*10)
338 // Update
339 this.update();
340 this.getGame().updatePlace();
341 }
342 }
343
344 private throwPainAuChocolat(): void{
345 if(this.getGame().getPainsAuChocolat().getCurrent() >= 1){

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
getCandiesMethod · 0.45

Tested by

no test coverage detected